From 602f2c0e0ae1d1351d141faf91e20a3c5e3164eb Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 13 Feb 2025 22:40:37 +0000 Subject: [PATCH 01/22] chore(test): update some test values (#437) --- .stats.yml | 2 +- .../models/SandboxDirectoryCreateParamsTest.kt | 18 +++++++++--------- .../SandboxEmploymentUpdateParamsTest.kt | 6 +++--- .../SandboxIndividualUpdateParamsTest.kt | 6 +++--- .../blocking/sandbox/DirectoryServiceTest.kt | 6 +++--- .../blocking/sandbox/EmploymentServiceTest.kt | 2 +- .../blocking/sandbox/IndividualServiceTest.kt | 2 +- 7 files changed, 21 insertions(+), 21 deletions(-) diff --git a/.stats.yml b/.stats.yml index 119fd722..82b11004 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-97bf4795deec23d1bfd3b0b5fd77c2a93c87f10e5fa3375ab30f4a877be97f53.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-cc4c848e303cfff6aec3e0e300ac1841bdbd34bbe6c72151a1687724caae7c15.yml 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 fe0ec6a6..de96c2df 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 @@ -25,7 +25,7 @@ class SandboxDirectoryCreateParamsTest { .name("name") .build() ) - .dob("01/01/2000") + .dob("dob") .addEmail( SandboxDirectoryCreateParams.IndividualOrEmployment.Email.builder() .data("data") @@ -53,7 +53,7 @@ class SandboxDirectoryCreateParamsTest { .encryptedSsn("encrypted_ssn") .endDate("end_date") .ethnicity(SandboxDirectoryCreateParams.IndividualOrEmployment.Ethnicity.ASIAN) - .firstName("John") + .firstName("first_name") .gender(SandboxDirectoryCreateParams.IndividualOrEmployment.Gender.FEMALE) .income( Income.builder() @@ -72,7 +72,7 @@ class SandboxDirectoryCreateParamsTest { .build() ) .isActive(true) - .lastName("Smith") + .lastName("last_name") .latestRehireDate("latest_rehire_date") .location( Location.builder() @@ -142,7 +142,7 @@ class SandboxDirectoryCreateParamsTest { .name("name") .build() ) - .dob("01/01/2000") + .dob("dob") .addEmail( SandboxDirectoryCreateParams.IndividualOrEmployment.Email.builder() .data("data") @@ -175,7 +175,7 @@ class SandboxDirectoryCreateParamsTest { .ethnicity( SandboxDirectoryCreateParams.IndividualOrEmployment.Ethnicity.ASIAN ) - .firstName("John") + .firstName("first_name") .gender(SandboxDirectoryCreateParams.IndividualOrEmployment.Gender.FEMALE) .income( Income.builder() @@ -194,7 +194,7 @@ class SandboxDirectoryCreateParamsTest { .build() ) .isActive(true) - .lastName("Smith") + .lastName("last_name") .latestRehireDate("latest_rehire_date") .location( Location.builder() @@ -264,7 +264,7 @@ class SandboxDirectoryCreateParamsTest { .name("name") .build() ) - .dob("01/01/2000") + .dob("dob") .addEmail( SandboxDirectoryCreateParams.IndividualOrEmployment.Email.builder() .data("data") @@ -297,7 +297,7 @@ class SandboxDirectoryCreateParamsTest { .ethnicity( SandboxDirectoryCreateParams.IndividualOrEmployment.Ethnicity.ASIAN ) - .firstName("John") + .firstName("first_name") .gender(SandboxDirectoryCreateParams.IndividualOrEmployment.Gender.FEMALE) .income( Income.builder() @@ -316,7 +316,7 @@ class SandboxDirectoryCreateParamsTest { .build() ) .isActive(true) - .lastName("Smith") + .lastName("last_name") .latestRehireDate("latest_rehire_date") .location( Location.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 1ea5c35c..317e2067 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 @@ -63,7 +63,7 @@ class SandboxEmploymentUpdateParamsTest { .manager(SandboxEmploymentUpdateParams.Manager.builder().id("id").build()) .middleName("middle_name") .sourceId("source_id") - .startDate("3/4/2020") + .startDate("start_date") .title("title") .build() } @@ -124,7 +124,7 @@ class SandboxEmploymentUpdateParamsTest { .manager(SandboxEmploymentUpdateParams.Manager.builder().id("id").build()) .middleName("middle_name") .sourceId("source_id") - .startDate("3/4/2020") + .startDate("start_date") .title("title") .build() val body = params._body() @@ -192,7 +192,7 @@ class SandboxEmploymentUpdateParamsTest { .contains(SandboxEmploymentUpdateParams.Manager.builder().id("id").build()) assertThat(body.middleName()).contains("middle_name") assertThat(body.sourceId()).contains("source_id") - assertThat(body.startDate()).contains("3/4/2020") + assertThat(body.startDate()).contains("start_date") assertThat(body.title()).contains("title") } 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 48d7af5d..14801fa5 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 @@ -11,7 +11,7 @@ class SandboxIndividualUpdateParamsTest { fun create() { SandboxIndividualUpdateParams.builder() .individualId("individual_id") - .dob("12/20/1989") + .dob("dob") .addEmail( SandboxIndividualUpdateParams.Email.builder() .data("data") @@ -52,7 +52,7 @@ class SandboxIndividualUpdateParamsTest { val params = SandboxIndividualUpdateParams.builder() .individualId("individual_id") - .dob("12/20/1989") + .dob("dob") .addEmail( SandboxIndividualUpdateParams.Email.builder() .data("data") @@ -88,7 +88,7 @@ class SandboxIndividualUpdateParamsTest { .build() val body = params._body() assertThat(body).isNotNull - assertThat(body.dob()).contains("12/20/1989") + assertThat(body.dob()).contains("dob") assertThat(body.emails()) .contains( listOf( 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 013e7140..b236df8b 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 @@ -41,7 +41,7 @@ class DirectoryServiceTest { .name("name") .build() ) - .dob("01/01/2000") + .dob("dob") .addEmail( SandboxDirectoryCreateParams.IndividualOrEmployment.Email.builder() .data("data") @@ -78,7 +78,7 @@ class DirectoryServiceTest { .ethnicity( SandboxDirectoryCreateParams.IndividualOrEmployment.Ethnicity.ASIAN ) - .firstName("John") + .firstName("first_name") .gender( SandboxDirectoryCreateParams.IndividualOrEmployment.Gender.FEMALE ) @@ -99,7 +99,7 @@ class DirectoryServiceTest { .build() ) .isActive(true) - .lastName("Smith") + .lastName("last_name") .latestRehireDate("latest_rehire_date") .location( Location.builder() 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 aaeef4d7..0fbd8fd4 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 @@ -79,7 +79,7 @@ class EmploymentServiceTest { .manager(SandboxEmploymentUpdateParams.Manager.builder().id("id").build()) .middleName("middle_name") .sourceId("source_id") - .startDate("3/4/2020") + .startDate("start_date") .title("title") .build() ) 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 5e6c4be6..f2aca632 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 @@ -24,7 +24,7 @@ class IndividualServiceTest { individualService.update( SandboxIndividualUpdateParams.builder() .individualId("individual_id") - .dob("12/20/1989") + .dob("dob") .addEmail( SandboxIndividualUpdateParams.Email.builder() .data("data") From 54b58c894270795449f4a4ad42d0bc6ff0448658 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 19 Feb 2025 15:27:29 +0000 Subject: [PATCH 02/22] chore(internal): update formatter (#439) chore(internal): optimize build and test perf --- buildSrc/build.gradle.kts | 6 +- .../src/main/kotlin/finch.java.gradle.kts | 6 +- .../src/main/kotlin/finch.kotlin.gradle.kts | 11 ++- .../api/client/okhttp/OkHttpClient.kt | 9 +-- .../api/client/FinchClientAsyncImpl.kt | 4 +- .../tryfinch/api/client/FinchClientImpl.kt | 4 +- .../com/tryfinch/api/core/BaseDeserializer.kt | 6 +- .../com/tryfinch/api/core/ClientOptions.kt | 2 +- .../tryfinch/api/core/HttpRequestBodies.kt | 11 ++- .../com/tryfinch/api/core/PrepareRequest.kt | 2 +- .../com/tryfinch/api/core/RequestOptions.kt | 6 +- .../kotlin/com/tryfinch/api/core/Values.kt | 19 +++-- .../com/tryfinch/api/core/http/Headers.kt | 4 +- .../http/PhantomReachableClosingHttpClient.kt | 2 +- .../com/tryfinch/api/core/http/QueryParams.kt | 2 +- .../api/core/http/RetryingHttpClient.kt | 15 ++-- .../api/errors/BadRequestException.kt | 7 +- .../com/tryfinch/api/errors/FinchError.kt | 2 +- .../api/errors/FinchServiceException.kt | 2 +- .../api/errors/InternalServerException.kt | 8 +-- .../tryfinch/api/errors/NotFoundException.kt | 7 +- .../api/errors/PermissionDeniedException.kt | 7 +- .../tryfinch/api/errors/RateLimitException.kt | 7 +- .../api/errors/UnauthorizedException.kt | 7 +- .../errors/UnprocessableEntityException.kt | 7 +- .../api/models/AccountCreateResponse.kt | 4 +- .../tryfinch/api/models/AccountUpdateEvent.kt | 64 ++++------------- .../api/models/AccountUpdateResponse.kt | 4 +- .../tryfinch/api/models/AutomatedAsyncJob.kt | 12 +--- .../api/models/BenefitContribution.kt | 12 +--- .../models/BenefitFeaturesAndOperations.kt | 12 +--- .../tryfinch/api/models/BenefitFrequency.kt | 7 +- .../com/tryfinch/api/models/BenefitType.kt | 6 +- .../kotlin/com/tryfinch/api/models/Company.kt | 34 ++------- .../com/tryfinch/api/models/CompanyEvent.kt | 10 +-- .../api/models/CompanyUpdateResponse.kt | 34 ++------- .../api/models/ConnectSessionNewParams.kt | 26 ++----- .../ConnectSessionReauthenticateParams.kt | 7 +- .../api/models/ConnectionCreateResponse.kt | 4 +- .../api/models/ConnectionStatusType.kt | 7 +- .../api/models/CreateAccessTokenResponse.kt | 13 +--- .../models/CreateCompanyBenefitsResponse.kt | 2 +- .../com/tryfinch/api/models/DirectoryEvent.kt | 6 +- .../tryfinch/api/models/DocumentResponse.kt | 15 +--- .../api/models/DocumentRetreiveResponse.kt | 2 +- .../com/tryfinch/api/models/EmploymentData.kt | 34 ++------- .../api/models/EmploymentDataResponse.kt | 7 +- .../tryfinch/api/models/EmploymentEvent.kt | 6 +- .../api/models/EmploymentUpdateResponse.kt | 34 ++------- .../tryfinch/api/models/EnrolledIndividual.kt | 21 +----- ...nefitIndividualRetrieveManyBenefitsPage.kt | 14 ++-- ...IndividualRetrieveManyBenefitsPageAsync.kt | 19 ++--- .../HrisBenefitIndividualUnenrollManyPage.kt | 14 ++-- ...sBenefitIndividualUnenrollManyPageAsync.kt | 19 ++--- ...HrisBenefitIndividualUnenrollManyParams.kt | 2 +- .../api/models/HrisBenefitListPage.kt | 10 +-- .../api/models/HrisBenefitListPageAsync.kt | 19 ++--- .../HrisBenefitListSupportedBenefitsPage.kt | 14 ++-- ...isBenefitListSupportedBenefitsPageAsync.kt | 19 ++--- .../HrisBenefitListSupportedBenefitsParams.kt | 2 +- .../HrisDirectoryListIndividualsPage.kt | 21 ++---- .../HrisDirectoryListIndividualsPageAsync.kt | 26 ++----- .../api/models/HrisDirectoryListPage.kt | 21 ++---- .../api/models/HrisDirectoryListPageAsync.kt | 26 ++----- .../api/models/HrisDocumentListParams.kt | 6 +- .../models/HrisEmploymentRetrieveManyPage.kt | 14 ++-- .../HrisEmploymentRetrieveManyPageAsync.kt | 19 ++--- .../HrisEmploymentRetrieveManyParams.kt | 4 +- .../models/HrisIndividualRetrieveManyPage.kt | 14 ++-- .../HrisIndividualRetrieveManyPageAsync.kt | 19 ++--- .../HrisIndividualRetrieveManyParams.kt | 2 +- .../HrisPayStatementRetrieveManyPage.kt | 14 ++-- .../HrisPayStatementRetrieveManyPageAsync.kt | 19 ++--- .../HrisPayStatementRetrieveManyParams.kt | 2 +- .../api/models/HrisPaymentListPage.kt | 10 +-- .../api/models/HrisPaymentListPageAsync.kt | 17 ++--- .../kotlin/com/tryfinch/api/models/Income.kt | 14 +--- .../com/tryfinch/api/models/Individual.kt | 38 ++-------- .../tryfinch/api/models/IndividualBenefit.kt | 11 +-- .../tryfinch/api/models/IndividualEvent.kt | 6 +- .../tryfinch/api/models/IndividualResponse.kt | 7 +- .../api/models/IndividualUpdateResponse.kt | 38 ++-------- .../com/tryfinch/api/models/Introspection.kt | 31 ++------ .../api/models/JobAutomatedCreateParams.kt | 20 ++---- .../api/models/JobAutomatedListPage.kt | 20 ++---- .../api/models/JobAutomatedListPageAsync.kt | 26 ++----- .../tryfinch/api/models/JobCompletionEvent.kt | 6 +- .../com/tryfinch/api/models/ManualAsyncJob.kt | 6 +- .../kotlin/com/tryfinch/api/models/Money.kt | 7 +- .../tryfinch/api/models/OperationSupport.kt | 7 +- .../api/models/OperationSupportMatrix.kt | 8 +-- .../kotlin/com/tryfinch/api/models/Paging.kt | 7 +- .../api/models/PayGroupListResponse.kt | 7 +- .../api/models/PayGroupRetrieveResponse.kt | 7 +- .../com/tryfinch/api/models/PayStatement.kt | 43 ++---------- .../tryfinch/api/models/PayStatementEvent.kt | 13 +--- .../api/models/PayStatementResponse.kt | 7 +- .../kotlin/com/tryfinch/api/models/Payment.kt | 13 +--- .../com/tryfinch/api/models/PaymentEvent.kt | 6 +- .../api/models/PayrollPayGroupListPage.kt | 14 ++-- .../models/PayrollPayGroupListPageAsync.kt | 19 ++--- .../com/tryfinch/api/models/Provider.kt | 56 +++------------ .../tryfinch/api/models/ProviderListPage.kt | 10 +-- .../api/models/ProviderListPageAsync.kt | 17 ++--- .../api/models/SandboxCompanyUpdateParams.kt | 34 ++------- .../SandboxConnectionAccountCreateParams.kt | 4 +- .../SandboxConnectionAccountUpdateParams.kt | 2 +- .../models/SandboxConnectionCreateParams.kt | 4 +- .../models/SandboxDirectoryCreateParams.kt | 70 +++++-------------- .../models/SandboxEmploymentUpdateParams.kt | 34 ++------- .../models/SandboxIndividualUpdateParams.kt | 38 ++-------- .../api/models/SandboxJobConfiguration.kt | 15 ++-- .../SandboxJobConfigurationRetrieveParams.kt | 2 +- .../SandboxJobConfigurationUpdateParams.kt | 15 ++-- .../api/models/SandboxJobCreateParams.kt | 10 +-- .../api/models/SandboxPaymentCreateParams.kt | 45 +++--------- .../tryfinch/api/models/SupportedBenefit.kt | 15 ++-- .../api/models/UnenrolledIndividual.kt | 15 +--- .../models/UpdateCompanyBenefitResponse.kt | 2 +- .../kotlin/com/tryfinch/api/models/W42005.kt | 30 ++------ .../kotlin/com/tryfinch/api/models/W42020.kt | 23 ++---- .../com/tryfinch/api/models/WebhookEvent.kt | 2 +- .../services/async/AccessTokenServiceAsync.kt | 2 +- .../async/AccessTokenServiceAsyncImpl.kt | 8 +-- .../api/services/async/AccountServiceAsync.kt | 4 +- .../services/async/AccountServiceAsyncImpl.kt | 10 ++- .../services/async/ConnectServiceAsyncImpl.kt | 6 +- .../services/async/HrisServiceAsyncImpl.kt | 6 +- .../api/services/async/JobServiceAsyncImpl.kt | 6 +- .../services/async/PayrollServiceAsyncImpl.kt | 6 +- .../services/async/ProviderServiceAsync.kt | 2 +- .../async/ProviderServiceAsyncImpl.kt | 10 ++- .../async/RequestForwardingServiceAsync.kt | 2 +- .../RequestForwardingServiceAsyncImpl.kt | 6 +- .../services/async/SandboxServiceAsyncImpl.kt | 6 +- .../async/connect/SessionServiceAsync.kt | 4 +- .../async/connect/SessionServiceAsyncImpl.kt | 10 ++- .../async/hris/BenefitServiceAsync.kt | 10 +-- .../async/hris/BenefitServiceAsyncImpl.kt | 20 +++--- .../async/hris/CompanyServiceAsync.kt | 2 +- .../async/hris/CompanyServiceAsyncImpl.kt | 8 +-- .../async/hris/DirectoryServiceAsync.kt | 4 +- .../async/hris/DirectoryServiceAsyncImpl.kt | 10 ++- .../async/hris/DocumentServiceAsync.kt | 4 +- .../async/hris/DocumentServiceAsyncImpl.kt | 10 ++- .../async/hris/EmploymentServiceAsync.kt | 2 +- .../async/hris/EmploymentServiceAsyncImpl.kt | 8 +-- .../async/hris/IndividualServiceAsync.kt | 2 +- .../async/hris/IndividualServiceAsyncImpl.kt | 8 +-- .../async/hris/PayStatementServiceAsync.kt | 2 +- .../hris/PayStatementServiceAsyncImpl.kt | 8 +-- .../async/hris/PaymentServiceAsync.kt | 2 +- .../async/hris/PaymentServiceAsyncImpl.kt | 10 ++- .../hris/benefits/IndividualServiceAsync.kt | 6 +- .../benefits/IndividualServiceAsyncImpl.kt | 16 ++--- .../async/jobs/AutomatedServiceAsync.kt | 6 +- .../async/jobs/AutomatedServiceAsyncImpl.kt | 12 ++-- .../services/async/jobs/ManualServiceAsync.kt | 2 +- .../async/jobs/ManualServiceAsyncImpl.kt | 8 +-- .../async/payroll/PayGroupServiceAsync.kt | 4 +- .../async/payroll/PayGroupServiceAsyncImpl.kt | 12 ++-- .../async/sandbox/CompanyServiceAsync.kt | 2 +- .../async/sandbox/CompanyServiceAsyncImpl.kt | 8 +-- .../async/sandbox/ConnectionServiceAsync.kt | 2 +- .../sandbox/ConnectionServiceAsyncImpl.kt | 8 +-- .../async/sandbox/DirectoryServiceAsync.kt | 2 +- .../sandbox/DirectoryServiceAsyncImpl.kt | 8 +-- .../async/sandbox/EmploymentServiceAsync.kt | 2 +- .../sandbox/EmploymentServiceAsyncImpl.kt | 8 +-- .../async/sandbox/IndividualServiceAsync.kt | 2 +- .../sandbox/IndividualServiceAsyncImpl.kt | 8 +-- .../services/async/sandbox/JobServiceAsync.kt | 2 +- .../async/sandbox/JobServiceAsyncImpl.kt | 8 +-- .../async/sandbox/PaymentServiceAsync.kt | 2 +- .../async/sandbox/PaymentServiceAsyncImpl.kt | 8 +-- .../connections/AccountServiceAsync.kt | 4 +- .../connections/AccountServiceAsyncImpl.kt | 10 ++- .../sandbox/jobs/ConfigurationServiceAsync.kt | 4 +- .../jobs/ConfigurationServiceAsyncImpl.kt | 10 ++- .../services/blocking/AccessTokenService.kt | 2 +- .../blocking/AccessTokenServiceImpl.kt | 8 +-- .../api/services/blocking/AccountService.kt | 4 +- .../services/blocking/AccountServiceImpl.kt | 10 ++- .../services/blocking/ConnectServiceImpl.kt | 6 +- .../api/services/blocking/HrisServiceImpl.kt | 5 +- .../api/services/blocking/JobServiceImpl.kt | 5 +- .../services/blocking/PayrollServiceImpl.kt | 6 +- .../api/services/blocking/ProviderService.kt | 2 +- .../services/blocking/ProviderServiceImpl.kt | 10 ++- .../blocking/RequestForwardingService.kt | 2 +- .../blocking/RequestForwardingServiceImpl.kt | 8 +-- .../services/blocking/SandboxServiceImpl.kt | 6 +- .../services/blocking/WebhookServiceImpl.kt | 2 +- .../blocking/connect/SessionService.kt | 4 +- .../blocking/connect/SessionServiceImpl.kt | 10 ++- .../services/blocking/hris/BenefitService.kt | 10 +-- .../blocking/hris/BenefitServiceImpl.kt | 20 +++--- .../services/blocking/hris/CompanyService.kt | 2 +- .../blocking/hris/CompanyServiceImpl.kt | 8 +-- .../blocking/hris/DirectoryService.kt | 4 +- .../blocking/hris/DirectoryServiceImpl.kt | 10 ++- .../services/blocking/hris/DocumentService.kt | 4 +- .../blocking/hris/DocumentServiceImpl.kt | 10 ++- .../blocking/hris/EmploymentService.kt | 2 +- .../blocking/hris/EmploymentServiceImpl.kt | 8 +-- .../blocking/hris/IndividualService.kt | 2 +- .../blocking/hris/IndividualServiceImpl.kt | 8 +-- .../blocking/hris/PayStatementService.kt | 2 +- .../blocking/hris/PayStatementServiceImpl.kt | 8 +-- .../services/blocking/hris/PaymentService.kt | 2 +- .../blocking/hris/PaymentServiceImpl.kt | 10 ++- .../hris/benefits/IndividualService.kt | 6 +- .../hris/benefits/IndividualServiceImpl.kt | 16 ++--- .../blocking/jobs/AutomatedService.kt | 6 +- .../blocking/jobs/AutomatedServiceImpl.kt | 12 ++-- .../services/blocking/jobs/ManualService.kt | 2 +- .../blocking/jobs/ManualServiceImpl.kt | 8 +-- .../blocking/payroll/PayGroupService.kt | 4 +- .../blocking/payroll/PayGroupServiceImpl.kt | 12 ++-- .../blocking/sandbox/CompanyService.kt | 2 +- .../blocking/sandbox/CompanyServiceImpl.kt | 8 +-- .../blocking/sandbox/ConnectionService.kt | 2 +- .../blocking/sandbox/ConnectionServiceImpl.kt | 8 +-- .../blocking/sandbox/DirectoryService.kt | 2 +- .../blocking/sandbox/DirectoryServiceImpl.kt | 8 +-- .../blocking/sandbox/EmploymentService.kt | 2 +- .../blocking/sandbox/EmploymentServiceImpl.kt | 8 +-- .../blocking/sandbox/IndividualService.kt | 2 +- .../blocking/sandbox/IndividualServiceImpl.kt | 8 +-- .../services/blocking/sandbox/JobService.kt | 2 +- .../blocking/sandbox/JobServiceImpl.kt | 7 +- .../blocking/sandbox/PaymentService.kt | 2 +- .../blocking/sandbox/PaymentServiceImpl.kt | 8 +-- .../sandbox/connections/AccountService.kt | 4 +- .../sandbox/connections/AccountServiceImpl.kt | 10 ++- .../sandbox/jobs/ConfigurationService.kt | 4 +- .../sandbox/jobs/ConfigurationServiceImpl.kt | 10 ++- .../com/tryfinch/api/TestServerExtension.kt | 2 +- .../tryfinch/api/core/PhantomReachableTest.kt | 2 +- .../com/tryfinch/api/core/http/HeadersTest.kt | 64 ++++++++--------- .../tryfinch/api/core/http/QueryParamsTest.kt | 50 ++++++------- .../api/core/http/RetryingHttpClientTest.kt | 22 +++--- .../tryfinch/api/core/http/SerializerTest.kt | 11 +-- ...ndividualRetrieveManyBenefitsParamsTest.kt | 2 +- .../api/services/ErrorHandlingTest.kt | 8 +-- gradle.properties | 4 +- scripts/format | 2 +- scripts/lint | 2 +- scripts/test | 2 +- 249 files changed, 805 insertions(+), 1827 deletions(-) diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index 8a1d7a10..d1ed374d 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -1,6 +1,6 @@ plugins { `kotlin-dsl` - kotlin("jvm") version "2.1.0" + kotlin("jvm") version "2.1.10" id("com.vanniktech.maven.publish") version "0.28.0" } @@ -10,7 +10,7 @@ repositories { } dependencies { - implementation("com.diffplug.spotless:spotless-plugin-gradle:6.25.0") - implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.23") + implementation("com.diffplug.spotless:spotless-plugin-gradle:7.0.2") + implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:2.1.10") implementation("com.vanniktech:gradle-maven-publish-plugin:0.28.0") } diff --git a/buildSrc/src/main/kotlin/finch.java.gradle.kts b/buildSrc/src/main/kotlin/finch.java.gradle.kts index a2c35b93..597b6e80 100644 --- a/buildSrc/src/main/kotlin/finch.java.gradle.kts +++ b/buildSrc/src/main/kotlin/finch.java.gradle.kts @@ -39,9 +39,13 @@ tasks.named("jar") { } } -tasks.named("test") { +tasks.withType().configureEach { useJUnitPlatform() + // Run tests in parallel to some degree. + maxParallelForks = (Runtime.getRuntime().availableProcessors() / 2).coerceAtLeast(1) + forkEvery = 100 + testLogging { exceptionFormat = TestExceptionFormat.FULL } diff --git a/buildSrc/src/main/kotlin/finch.kotlin.gradle.kts b/buildSrc/src/main/kotlin/finch.kotlin.gradle.kts index c431ae27..9bdebacd 100644 --- a/buildSrc/src/main/kotlin/finch.kotlin.gradle.kts +++ b/buildSrc/src/main/kotlin/finch.kotlin.gradle.kts @@ -1,4 +1,5 @@ import com.diffplug.gradle.spotless.SpotlessExtension +import org.jetbrains.kotlin.gradle.dsl.JvmTarget import org.jetbrains.kotlin.gradle.tasks.KotlinCompile plugins { @@ -20,13 +21,19 @@ configure { } tasks.withType().configureEach { - kotlinOptions { + compilerOptions { 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" + jvmTarget.set(JvmTarget.JVM_1_8) } } + +// Run tests in parallel to some degree. +tasks.withType().configureEach { + maxParallelForks = (Runtime.getRuntime().availableProcessors() / 2).coerceAtLeast(1) + forkEvery = 100 +} 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 cd06aa82..7c59fad7 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,10 +31,7 @@ class OkHttpClient private constructor(private val okHttpClient: okhttp3.OkHttpClient, private val baseUrl: HttpUrl) : HttpClient { - override fun execute( - request: HttpRequest, - requestOptions: RequestOptions, - ): HttpResponse { + override fun execute(request: HttpRequest, requestOptions: RequestOptions): HttpResponse { val call = newCall(request, requestOptions) return try { @@ -120,13 +117,13 @@ private constructor(private val okHttpClient: okhttp3.OkHttpClient, private val ) { builder.header( "X-Stainless-Read-Timeout", - Duration.ofMillis(client.readTimeoutMillis.toLong()).seconds.toString() + 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() + Duration.ofMillis(client.callTimeoutMillis.toLong()).seconds.toString(), ) } 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 2e0e7395..6160acbf 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,9 +38,7 @@ import com.tryfinch.api.services.async.WebhookServiceAsyncImpl import java.net.URLEncoder import java.util.concurrent.CompletableFuture -class FinchClientAsyncImpl( - private val clientOptions: ClientOptions, -) : FinchClientAsync { +class FinchClientAsyncImpl(private val clientOptions: ClientOptions) : FinchClientAsync { private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) 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 84439057..2b555575 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,9 +37,7 @@ import com.tryfinch.api.services.blocking.WebhookService import com.tryfinch.api.services.blocking.WebhookServiceImpl import java.net.URLEncoder -class FinchClientImpl( - private val clientOptions: ClientOptions, -) : FinchClient { +class FinchClientImpl(private val clientOptions: ClientOptions) : FinchClient { private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/core/BaseDeserializer.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/core/BaseDeserializer.kt index cc970627..c850405c 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/core/BaseDeserializer.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/core/BaseDeserializer.kt @@ -18,7 +18,7 @@ abstract class BaseDeserializer(type: KClass) : override fun createContextual( context: DeserializationContext, - property: BeanProperty? + property: BeanProperty?, ): JsonDeserializer { return this } @@ -32,7 +32,7 @@ abstract class BaseDeserializer(type: KClass) : protected fun ObjectCodec.tryDeserialize( node: JsonNode, type: TypeReference, - validate: (T) -> Unit = {} + validate: (T) -> Unit = {}, ): T? { return try { readValue(treeAsTokens(node), type).apply(validate) @@ -46,7 +46,7 @@ abstract class BaseDeserializer(type: KClass) : protected fun ObjectCodec.tryDeserialize( node: JsonNode, type: JavaType, - validate: (T) -> Unit = {} + validate: (T) -> Unit = {}, ): T? { return try { readValue(treeAsTokens(node), type).apply(validate) 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 15542787..f34021de 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 @@ -212,7 +212,7 @@ private constructor( if (!username.isEmpty() && !password.isEmpty()) { headers.put( "Authorization", - "Basic ${Base64.getEncoder().encodeToString("$username:$password".toByteArray())}" + "Basic ${Base64.getEncoder().encodeToString("$username:$password".toByteArray())}", ) } } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/core/HttpRequestBodies.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/core/HttpRequestBodies.kt index 9361c66b..4d3d1862 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/core/HttpRequestBodies.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/core/HttpRequestBodies.kt @@ -10,10 +10,7 @@ import java.io.OutputStream import org.apache.hc.client5.http.entity.mime.MultipartEntityBuilder @JvmSynthetic -internal inline fun json( - jsonMapper: JsonMapper, - value: T, -): HttpRequestBody { +internal inline fun json(jsonMapper: JsonMapper, value: T): HttpRequestBody { return object : HttpRequestBody { private var cachedBytes: ByteArray? = null @@ -49,7 +46,7 @@ internal inline fun json( @JvmSynthetic internal fun multipartFormData( jsonMapper: JsonMapper, - parts: Array?> + parts: Array?>, ): HttpRequestBody { val builder = MultipartEntityBuilder.create() parts.forEach { part -> @@ -66,14 +63,14 @@ internal fun multipartFormData( part.name, buffer.toByteArray(), part.contentType, - part.filename + part.filename, ) } is Boolean -> builder.addTextBody( part.name, if (part.value) "true" else "false", - part.contentType + part.contentType, ) is Int -> builder.addTextBody(part.name, part.value.toString(), part.contentType) is Long -> builder.addTextBody(part.name, part.value.toString(), part.contentType) 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 index 974ae9d8..6e1aaafb 100644 --- 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 @@ -17,7 +17,7 @@ internal fun HttpRequest.prepare(clientOptions: ClientOptions, params: Params): @JvmSynthetic internal fun HttpRequest.prepareAsync( clientOptions: ClientOptions, - params: Params + params: Params, ): CompletableFuture = // This async version exists to make it easier to add async specific preparation logic in the // future. 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 b31943e2..cee1a369 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 @@ -2,11 +2,7 @@ package com.tryfinch.api.core import java.time.Duration -class RequestOptions -private constructor( - val responseValidation: Boolean?, - val timeout: Duration?, -) { +class RequestOptions private constructor(val responseValidation: Boolean?, val timeout: Duration?) { fun applyDefaults(options: RequestOptions): RequestOptions { return RequestOptions( responseValidation = this.responseValidation ?: options.responseValidation, 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 16ad91e7..c4680e54 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 @@ -287,7 +287,7 @@ class JsonMissing : JsonValue() { override fun serialize( value: JsonMissing, generator: JsonGenerator, - provider: SerializerProvider + provider: SerializerProvider, ) { throw RuntimeException("JsonMissing cannot be serialized") } @@ -422,10 +422,7 @@ private constructor( } @JacksonAnnotationsInside -@JsonInclude( - JsonInclude.Include.CUSTOM, - valueFilter = JsonField.IsMissing::class, -) +@JsonInclude(JsonInclude.Include.CUSTOM, valueFilter = JsonField.IsMissing::class) annotation class ExcludeMissing @JacksonAnnotationsInside @@ -434,7 +431,7 @@ annotation class ExcludeMissing isGetterVisibility = Visibility.NONE, setterVisibility = Visibility.NONE, creatorVisibility = Visibility.NONE, - fieldVisibility = Visibility.NONE + fieldVisibility = Visibility.NONE, ) annotation class NoAutoDetect @@ -443,7 +440,7 @@ internal constructor( val name: String, val value: T, val contentType: ContentType, - val filename: String? = null + val filename: String? = null, ) { private var hashCode: Int = 0 @@ -462,7 +459,7 @@ internal constructor( is Long -> value is Double -> value else -> value?.hashCode() - } + }, ) } return hashCode @@ -496,7 +493,7 @@ internal constructor( internal fun fromString( name: String, value: String, - contentType: ContentType + contentType: ContentType, ): MultipartFormValue = MultipartFormValue(name, value, contentType) internal fun fromBoolean( @@ -520,14 +517,14 @@ internal constructor( internal fun fromEnum( name: String, value: T, - contentType: ContentType + contentType: ContentType, ): MultipartFormValue = MultipartFormValue(name, value, contentType) internal fun fromByteArray( name: String, value: ByteArray, contentType: ContentType, - filename: String? = null + filename: String? = null, ): MultipartFormValue = MultipartFormValue(name, value, contentType, filename) } } 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 1a95b473..b3b56dec 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 @@ -6,7 +6,7 @@ import java.util.TreeMap class Headers private constructor( private val map: Map>, - @get:JvmName("size") val size: Int + @get:JvmName("size") val size: Int, ) { fun isEmpty(): Boolean = map.isEmpty() @@ -74,7 +74,7 @@ private constructor( values.toImmutable() } .toImmutable(), - size + size, ) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/core/http/PhantomReachableClosingHttpClient.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/core/http/PhantomReachableClosingHttpClient.kt index 82a11397..c0fcdc44 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/core/http/PhantomReachableClosingHttpClient.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/core/http/PhantomReachableClosingHttpClient.kt @@ -19,7 +19,7 @@ internal class PhantomReachableClosingHttpClient(private val httpClient: HttpCli override fun executeAsync( request: HttpRequest, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture = httpClient.executeAsync(request, requestOptions) override fun close() = httpClient.close() 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 73766d6a..e35ea929 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 @@ -5,7 +5,7 @@ import com.tryfinch.api.core.toImmutable class QueryParams private constructor( private val map: Map>, - @get:JvmName("size") val size: Int + @get:JvmName("size") val size: Int, ) { fun isEmpty(): Boolean = map.isEmpty() 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 29095887..77823c9b 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 @@ -28,10 +28,7 @@ private constructor( private val idempotencyHeader: String?, ) : HttpClient { - override fun execute( - request: HttpRequest, - requestOptions: RequestOptions, - ): HttpResponse { + override fun execute(request: HttpRequest, requestOptions: RequestOptions): HttpResponse { if (!isRetryable(request) || maxRetries <= 0) { return httpClient.execute(request, requestOptions) } @@ -100,7 +97,7 @@ private constructor( .handleAsync( fun( response: HttpResponse?, - throwable: Throwable? + throwable: Throwable?, ): CompletableFuture { if (response != null) { if (++retries > maxRetries || !shouldRetry(response)) { @@ -120,7 +117,7 @@ private constructor( return sleepAsync(backoffMillis.toMillis()).thenCompose { executeWithRetries(requestWithRetryCount, requestOptions) } - }, + } ) { // Run in the same thread. it.run() @@ -200,8 +197,8 @@ private constructor( OffsetDateTime.now(clock), OffsetDateTime.parse( retryAfter, - DateTimeFormatter.RFC_1123_DATE_TIME - ) + DateTimeFormatter.RFC_1123_DATE_TIME, + ), ) } catch (e: DateTimeParseException) { null @@ -239,7 +236,7 @@ private constructor( future.complete(null) } }, - millis + millis, ) return future } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/errors/BadRequestException.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/errors/BadRequestException.kt index c688913c..1375ba00 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/errors/BadRequestException.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/errors/BadRequestException.kt @@ -2,8 +2,5 @@ package com.tryfinch.api.errors import com.tryfinch.api.core.http.Headers -class BadRequestException( - headers: Headers, - body: String, - error: FinchError, -) : FinchServiceException(400, headers, body, error) +class BadRequestException(headers: Headers, body: String, error: FinchError) : + FinchServiceException(400, headers, body, error) 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 7a51327d..db1b299f 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 @@ -20,7 +20,7 @@ private constructor( @ExcludeMissing @JsonAnySetter @get:JvmName("additionalProperties") - val additionalProperties: Map = immutableEmptyMap(), + val additionalProperties: Map = immutableEmptyMap() ) { fun toBuilder() = Builder().from(this) diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/errors/FinchServiceException.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/errors/FinchServiceException.kt index 1a4c2000..9fa5ecc4 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/errors/FinchServiceException.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/errors/FinchServiceException.kt @@ -10,7 +10,7 @@ constructor( private val body: String, private val error: FinchError, message: String = "$statusCode: $error", - cause: Throwable? = null + cause: Throwable? = null, ) : FinchException(message, cause) { fun statusCode(): Int = statusCode diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/errors/InternalServerException.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/errors/InternalServerException.kt index 1b08ca2a..8701e4a7 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/errors/InternalServerException.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/errors/InternalServerException.kt @@ -2,9 +2,5 @@ package com.tryfinch.api.errors import com.tryfinch.api.core.http.Headers -class InternalServerException( - statusCode: Int, - headers: Headers, - body: String, - error: FinchError, -) : FinchServiceException(statusCode, headers, body, error) +class InternalServerException(statusCode: Int, headers: Headers, body: String, error: FinchError) : + FinchServiceException(statusCode, headers, body, error) diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/errors/NotFoundException.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/errors/NotFoundException.kt index 5a3bbcd9..370a60c4 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/errors/NotFoundException.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/errors/NotFoundException.kt @@ -2,8 +2,5 @@ package com.tryfinch.api.errors import com.tryfinch.api.core.http.Headers -class NotFoundException( - headers: Headers, - body: String, - error: FinchError, -) : FinchServiceException(404, headers, body, error) +class NotFoundException(headers: Headers, body: String, error: FinchError) : + FinchServiceException(404, headers, body, error) diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/errors/PermissionDeniedException.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/errors/PermissionDeniedException.kt index 5f50ddd5..36058d72 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/errors/PermissionDeniedException.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/errors/PermissionDeniedException.kt @@ -2,8 +2,5 @@ package com.tryfinch.api.errors import com.tryfinch.api.core.http.Headers -class PermissionDeniedException( - headers: Headers, - body: String, - error: FinchError, -) : FinchServiceException(403, headers, body, error) +class PermissionDeniedException(headers: Headers, body: String, error: FinchError) : + FinchServiceException(403, headers, body, error) diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/errors/RateLimitException.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/errors/RateLimitException.kt index 7a54435d..f14024da 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/errors/RateLimitException.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/errors/RateLimitException.kt @@ -2,8 +2,5 @@ package com.tryfinch.api.errors import com.tryfinch.api.core.http.Headers -class RateLimitException( - headers: Headers, - body: String, - error: FinchError, -) : FinchServiceException(429, headers, body, error) +class RateLimitException(headers: Headers, body: String, error: FinchError) : + FinchServiceException(429, headers, body, error) diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/errors/UnauthorizedException.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/errors/UnauthorizedException.kt index d762046f..a060f3d4 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/errors/UnauthorizedException.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/errors/UnauthorizedException.kt @@ -2,8 +2,5 @@ package com.tryfinch.api.errors import com.tryfinch.api.core.http.Headers -class UnauthorizedException( - headers: Headers, - body: String, - error: FinchError, -) : FinchServiceException(401, headers, body, error) +class UnauthorizedException(headers: Headers, body: String, error: FinchError) : + FinchServiceException(401, headers, body, error) diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/errors/UnprocessableEntityException.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/errors/UnprocessableEntityException.kt index 34f27cb7..6efe853c 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/errors/UnprocessableEntityException.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/errors/UnprocessableEntityException.kt @@ -2,8 +2,5 @@ package com.tryfinch.api.errors import com.tryfinch.api.core.http.Headers -class UnprocessableEntityException( - headers: Headers, - body: String, - error: FinchError, -) : FinchServiceException(422, headers, body, error) +class UnprocessableEntityException(headers: Headers, body: String, error: FinchError) : + FinchServiceException(422, headers, body, error) 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 030c0f24..ef2aee8b 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 @@ -241,9 +241,7 @@ private constructor( class AuthenticationType @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccountUpdateEvent.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccountUpdateEvent.kt index 7b811c69..b47cd3a9 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 @@ -1218,11 +1218,7 @@ private constructor( } fun build(): Departments = - Departments( - name, - parent, - additionalProperties.toImmutable(), - ) + Departments(name, parent, additionalProperties.toImmutable()) } @NoAutoDetect @@ -1446,11 +1442,7 @@ private constructor( } fun build(): Entity = - Entity( - subtype, - type, - additionalProperties.toImmutable(), - ) + Entity(subtype, type, additionalProperties.toImmutable()) } override fun equals(other: Any?): Boolean { @@ -2221,11 +2213,7 @@ private constructor( } fun build(): Paging = - Paging( - count, - offset, - additionalProperties.toImmutable(), - ) + Paging(count, offset, additionalProperties.toImmutable()) } override fun equals(other: Any?): Boolean { @@ -2863,11 +2851,7 @@ private constructor( } fun build(): Employment = - Employment( - subtype, - type, - additionalProperties.toImmutable(), - ) + Employment(subtype, type, additionalProperties.toImmutable()) } override fun equals(other: Any?): Boolean { @@ -3003,12 +2987,7 @@ private constructor( } fun build(): Income = - Income( - amount, - currency, - unit, - additionalProperties.toImmutable(), - ) + Income(amount, currency, unit, additionalProperties.toImmutable()) } override fun equals(other: Any?): Boolean { @@ -3751,11 +3730,7 @@ private constructor( } fun build(): Emails = - Emails( - data, - type, - additionalProperties.toImmutable(), - ) + Emails(data, type, additionalProperties.toImmutable()) } override fun equals(other: Any?): Boolean { @@ -3871,11 +3846,7 @@ private constructor( } fun build(): PhoneNumbers = - PhoneNumbers( - data, - type, - additionalProperties.toImmutable(), - ) + PhoneNumbers(data, type, additionalProperties.toImmutable()) } override fun equals(other: Any?): Boolean { @@ -5912,11 +5883,7 @@ private constructor( } fun build(): PayPeriod = - PayPeriod( - endDate, - startDate, - additionalProperties.toImmutable(), - ) + PayPeriod(endDate, startDate, additionalProperties.toImmutable()) } override fun equals(other: Any?): Boolean { @@ -5974,11 +5941,8 @@ private constructor( } /** The type of authentication method. */ - class Type - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class Type @JsonCreator private constructor(private val value: JsonField) : + Enum { /** * Returns this class instance's raw value. @@ -6122,11 +6086,7 @@ private constructor( "Data{authenticationMethod=$authenticationMethod, status=$status, additionalProperties=$additionalProperties}" } - class EventType - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class EventType @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. @@ -6147,7 +6107,7 @@ private constructor( /** An enum containing [EventType]'s known values. */ enum class Known { - ACCOUNT_UPDATED, + 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 0d82edfa..869a9686 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 @@ -226,9 +226,7 @@ private constructor( class AuthenticationType @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AutomatedAsyncJob.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AutomatedAsyncJob.kt index 83f762e9..7f043a2d 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 @@ -412,11 +412,7 @@ private constructor( "Params{individualId=$individualId, additionalProperties=$additionalProperties}" } - class Status - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class Status @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. @@ -528,11 +524,7 @@ private constructor( } /** The type of automated job */ - class Type - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class Type @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/BenefitContribution.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/BenefitContribution.kt index dc207e16..a4be659e 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 @@ -118,19 +118,11 @@ private constructor( } fun build(): BenefitContribution = - BenefitContribution( - amount, - type, - additionalProperties.toImmutable(), - ) + BenefitContribution(amount, type, additionalProperties.toImmutable()) } /** Contribution type. */ - class Type - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class Type @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/BenefitFeaturesAndOperations.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/BenefitFeaturesAndOperations.kt index 6a1b7702..11fe8c51 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 @@ -493,9 +493,7 @@ private constructor( class CompanyContribution @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. @@ -590,9 +588,7 @@ private constructor( class EmployeeDeduction @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. @@ -686,9 +682,7 @@ private constructor( class HsaContributionLimit @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. 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 a574a104..07c02684 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 @@ -7,11 +7,8 @@ import com.tryfinch.api.core.Enum import com.tryfinch.api.core.JsonField import com.tryfinch.api.errors.FinchInvalidDataException -class BenefitFrequency -@JsonCreator -private constructor( - private val value: JsonField, -) : Enum { +class BenefitFrequency @JsonCreator private constructor(private val value: JsonField) : + Enum { /** * Returns this class instance's raw value. 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 dd5abd4c..68849de4 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 @@ -8,11 +8,7 @@ import com.tryfinch.api.core.JsonField import com.tryfinch.api.errors.FinchInvalidDataException /** Type of benefit. */ -class BenefitType -@JsonCreator -private constructor( - private val value: JsonField, -) : Enum { +class BenefitType @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Company.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Company.kt index 0314da32..2704e01c 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 @@ -556,11 +556,8 @@ private constructor( } /** The type of bank account. */ - class AccountType - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class AccountType @JsonCreator private constructor(private val value: JsonField) : + Enum { /** * Returns this class instance's raw value. @@ -769,12 +766,7 @@ private constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): Department = - Department( - name, - parent, - additionalProperties.toImmutable(), - ) + fun build(): Department = Department(name, parent, additionalProperties.toImmutable()) } /** The parent department, if present. */ @@ -998,20 +990,12 @@ private constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): Entity = - Entity( - subtype, - type, - additionalProperties.toImmutable(), - ) + fun build(): Entity = Entity(subtype, type, additionalProperties.toImmutable()) } /** The tax payer subtype of the company. */ - class Subtype - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class Subtype @JsonCreator private constructor(private val value: JsonField) : + Enum { /** * Returns this class instance's raw value. @@ -1108,11 +1092,7 @@ private constructor( } /** The tax payer type of the company. */ - class Type - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class Type @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/CompanyEvent.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/CompanyEvent.kt index 1b603827..5c0ecbf5 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 @@ -220,7 +220,7 @@ private constructor( @JsonCreator private constructor( @JsonAnySetter - private val additionalProperties: Map = immutableEmptyMap(), + private val additionalProperties: Map = immutableEmptyMap() ) { @JsonAnyGetter @@ -293,11 +293,7 @@ private constructor( override fun toString() = "Data{additionalProperties=$additionalProperties}" } - class EventType - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class EventType @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. @@ -318,7 +314,7 @@ private constructor( /** An enum containing [EventType]'s known values. */ enum class Known { - COMPANY_UPDATED, + 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 94219b90..8c03fd72 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 @@ -539,11 +539,8 @@ private constructor( } /** The type of bank account. */ - class AccountType - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class AccountType @JsonCreator private constructor(private val value: JsonField) : + Enum { /** * Returns this class instance's raw value. @@ -752,12 +749,7 @@ private constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): Department = - Department( - name, - parent, - additionalProperties.toImmutable(), - ) + fun build(): Department = Department(name, parent, additionalProperties.toImmutable()) } /** The parent department, if present. */ @@ -981,20 +973,12 @@ private constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): Entity = - Entity( - subtype, - type, - additionalProperties.toImmutable(), - ) + fun build(): Entity = Entity(subtype, type, additionalProperties.toImmutable()) } /** The tax payer subtype of the company. */ - class Subtype - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class Subtype @JsonCreator private constructor(private val value: JsonField) : + Enum { /** * Returns this class instance's raw value. @@ -1091,11 +1075,7 @@ private constructor( } /** The tax payer type of the company. */ - class Type - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class Type @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ConnectSessionNewParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ConnectSessionNewParams.kt index 29c5f4e9..da8025e5 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 @@ -615,11 +615,8 @@ private constructor( } /** The Finch products that can be requested during the Connect flow. */ - class ConnectProducts - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class ConnectProducts @JsonCreator private constructor(private val value: JsonField) : + Enum { /** * Returns this class instance's raw value. @@ -841,18 +838,11 @@ private constructor( } fun build(): Integration = - Integration( - authMethod, - provider, - additionalProperties.toImmutable(), - ) + Integration(authMethod, provider, additionalProperties.toImmutable()) } - class AuthMethod - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class AuthMethod @JsonCreator private constructor(private val value: JsonField) : + Enum { /** * Returns this class instance's raw value. @@ -973,11 +963,7 @@ private constructor( "Integration{authMethod=$authMethod, provider=$provider, additionalProperties=$additionalProperties}" } - class Sandbox - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class Sandbox @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ConnectSessionReauthenticateParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ConnectSessionReauthenticateParams.kt index 1073bff0..8483632b 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 @@ -498,11 +498,8 @@ private constructor( } /** The Finch products that can be requested during the Connect flow. */ - class ConnectProducts - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class ConnectProducts @JsonCreator private constructor(private val value: JsonField) : + Enum { /** * Returns this class instance's raw value. diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ConnectionCreateResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ConnectionCreateResponse.kt index 49be8e42..d98a0dbe 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 @@ -257,9 +257,7 @@ private constructor( class AuthenticationType @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. 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 b87840e6..10a9db26 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 @@ -7,11 +7,8 @@ import com.tryfinch.api.core.Enum import com.tryfinch.api.core.JsonField import com.tryfinch.api.errors.FinchInvalidDataException -class ConnectionStatusType -@JsonCreator -private constructor( - private val value: JsonField, -) : Enum { +class ConnectionStatusType @JsonCreator private constructor(private val value: JsonField) : + Enum { /** * Returns this class instance's raw value. diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/CreateAccessTokenResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/CreateAccessTokenResponse.kt index 312150e0..9893ffb1 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 @@ -354,11 +354,7 @@ private constructor( } /** The type of application associated with a token. */ - class ClientType - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class ClientType @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. @@ -458,11 +454,8 @@ private constructor( * - `provider` - connection to an external provider * - `finch` - finch-generated data. */ - class ConnectionType - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class ConnectionType @JsonCreator private constructor(private val value: JsonField) : + Enum { /** * Returns this class instance's raw value. diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/CreateCompanyBenefitsResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/CreateCompanyBenefitsResponse.kt index 182bc3e7..c526676e 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 @@ -90,7 +90,7 @@ private constructor( fun build(): CreateCompanyBenefitsResponse = CreateCompanyBenefitsResponse( checkRequired("benefitId", benefitId), - additionalProperties.toImmutable() + 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 750c01b2..32d36987 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 @@ -315,11 +315,7 @@ private constructor( "Data{individualId=$individualId, additionalProperties=$additionalProperties}" } - class EventType - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class EventType @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. 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 6d71abd4..d79cfa9a 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 @@ -200,22 +200,11 @@ private constructor( } fun build(): DocumentResponse = - DocumentResponse( - id, - individualId, - type, - url, - year, - additionalProperties.toImmutable(), - ) + DocumentResponse(id, individualId, type, url, year, additionalProperties.toImmutable()) } /** The type of document. */ - class Type - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class Type @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. 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 83153e62..4fa2026a 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 @@ -188,7 +188,7 @@ private constructor( override fun serialize( value: DocumentRetreiveResponse, generator: JsonGenerator, - provider: SerializerProvider + provider: SerializerProvider, ) { when { value.w42020 != null -> generator.writeObject(value.w42020) 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 d0d6ea8d..5867cea9 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 @@ -697,12 +697,7 @@ private constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): CustomField = - CustomField( - name, - value, - additionalProperties.toImmutable(), - ) + fun build(): CustomField = CustomField(name, value, additionalProperties.toImmutable()) } override fun equals(other: Any?): Boolean { @@ -938,23 +933,15 @@ private constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): Employment = - Employment( - subtype, - type, - additionalProperties.toImmutable(), - ) + fun build(): Employment = Employment(subtype, type, additionalProperties.toImmutable()) } /** * The secondary employment type of the individual. Options: `full_time`, `part_time`, * `intern`, `temp`, `seasonal` and `individual_contractor`. */ - class Subtype - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class Subtype @JsonCreator private constructor(private val value: JsonField) : + Enum { /** * Returns this class instance's raw value. @@ -1069,11 +1056,7 @@ private constructor( } /** The main employment type of the individual. */ - class Type - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class Type @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. @@ -1183,11 +1166,8 @@ private constructor( * The detailed employment status of the individual. Available options: `active`, `deceased`, * `leave`, `onboarding`, `prehire`, `retired`, `terminated`. */ - class EmploymentStatus - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class EmploymentStatus @JsonCreator private constructor(private val value: JsonField) : + Enum { /** * Returns this class instance's raw value. diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/EmploymentDataResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/EmploymentDataResponse.kt index 2b83375e..28da48df 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 @@ -119,12 +119,7 @@ private constructor( } fun build(): EmploymentDataResponse = - EmploymentDataResponse( - body, - code, - individualId, - additionalProperties.toImmutable(), - ) + EmploymentDataResponse(body, code, individualId, additionalProperties.toImmutable()) } override fun equals(other: Any?): Boolean { 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 f9bd150a..424082ff 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 @@ -315,11 +315,7 @@ private constructor( "Data{individualId=$individualId, additionalProperties=$additionalProperties}" } - class EventType - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class EventType @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/EmploymentUpdateResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/EmploymentUpdateResponse.kt index 4ea8b3f5..afaf2187 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 @@ -646,12 +646,7 @@ private constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): CustomField = - CustomField( - name, - value, - additionalProperties.toImmutable(), - ) + fun build(): CustomField = CustomField(name, value, additionalProperties.toImmutable()) } override fun equals(other: Any?): Boolean { @@ -887,23 +882,15 @@ private constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): Employment = - Employment( - subtype, - type, - additionalProperties.toImmutable(), - ) + fun build(): Employment = Employment(subtype, type, additionalProperties.toImmutable()) } /** * The secondary employment type of the individual. Options: `full_time`, `part_time`, * `intern`, `temp`, `seasonal` and `individual_contractor`. */ - class Subtype - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class Subtype @JsonCreator private constructor(private val value: JsonField) : + Enum { /** * Returns this class instance's raw value. @@ -1018,11 +1005,7 @@ private constructor( } /** The main employment type of the individual. */ - class Type - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class Type @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. @@ -1129,11 +1112,8 @@ private constructor( } /** The detailed employment status of the individual. */ - class EmploymentStatus - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class EmploymentStatus @JsonCreator private constructor(private val value: JsonField) : + Enum { /** * Returns this class instance's raw value. diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/EnrolledIndividual.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/EnrolledIndividual.kt index 7ac3fc5c..6b463cfa 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 @@ -123,12 +123,7 @@ private constructor( } fun build(): EnrolledIndividual = - EnrolledIndividual( - body, - code, - individualId, - additionalProperties.toImmutable(), - ) + EnrolledIndividual(body, code, individualId, additionalProperties.toImmutable()) } @NoAutoDetect @@ -252,13 +247,7 @@ private constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): Body = - Body( - finchCode, - message, - name, - additionalProperties.toImmutable(), - ) + fun build(): Body = Body(finchCode, message, name, additionalProperties.toImmutable()) } override fun equals(other: Any?): Boolean { @@ -280,11 +269,7 @@ private constructor( } /** HTTP status code. Either 201 or 200 */ - class Code - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class Code @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitIndividualRetrieveManyBenefitsPage.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitIndividualRetrieveManyBenefitsPage.kt index 8af049c0..d00f2f3a 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 @@ -64,13 +64,8 @@ private constructor( fun of( individualsService: IndividualService, params: HrisBenefitIndividualRetrieveManyBenefitsParams, - response: Response - ) = - HrisBenefitIndividualRetrieveManyBenefitsPage( - individualsService, - params, - response, - ) + response: Response, + ) = HrisBenefitIndividualRetrieveManyBenefitsPage(individualsService, params, response) } @NoAutoDetect @@ -146,9 +141,8 @@ private constructor( } } - class AutoPager( - private val firstPage: HrisBenefitIndividualRetrieveManyBenefitsPage, - ) : Iterable { + class AutoPager(private val firstPage: HrisBenefitIndividualRetrieveManyBenefitsPage) : + Iterable { override fun iterator(): Iterator = iterator { var page = firstPage 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 3b65576e..6c87b64f 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 @@ -68,13 +68,8 @@ private constructor( fun of( individualsService: IndividualServiceAsync, params: HrisBenefitIndividualRetrieveManyBenefitsParams, - response: Response - ) = - HrisBenefitIndividualRetrieveManyBenefitsPageAsync( - individualsService, - params, - response, - ) + response: Response, + ) = HrisBenefitIndividualRetrieveManyBenefitsPageAsync(individualsService, params, response) } @NoAutoDetect @@ -150,18 +145,16 @@ private constructor( } } - class AutoPager( - private val firstPage: HrisBenefitIndividualRetrieveManyBenefitsPageAsync, - ) { + class AutoPager(private val firstPage: HrisBenefitIndividualRetrieveManyBenefitsPageAsync) { fun forEach( action: Predicate, - executor: Executor + executor: Executor, ): CompletableFuture { fun CompletableFuture> .forEach( action: (IndividualBenefit) -> Boolean, - executor: Executor + executor: Executor, ): CompletableFuture = thenComposeAsync( { page -> @@ -170,7 +163,7 @@ private constructor( .map { it.getNextPage().forEach(action, executor) } .orElseGet { CompletableFuture.completedFuture(null) } }, - executor + executor, ) return CompletableFuture.completedFuture(Optional.of(firstPage)) .forEach(action::test, executor) 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 cdb9f7ac..fbd19014 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 @@ -64,13 +64,8 @@ private constructor( fun of( individualsService: IndividualService, params: HrisBenefitIndividualUnenrollManyParams, - response: Response - ) = - HrisBenefitIndividualUnenrollManyPage( - individualsService, - params, - response, - ) + response: Response, + ) = HrisBenefitIndividualUnenrollManyPage(individualsService, params, response) } @NoAutoDetect @@ -146,9 +141,8 @@ private constructor( } } - class AutoPager( - private val firstPage: HrisBenefitIndividualUnenrollManyPage, - ) : Iterable { + class AutoPager(private val firstPage: HrisBenefitIndividualUnenrollManyPage) : + Iterable { override fun iterator(): Iterator = iterator { var page = firstPage 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 fafba6a4..2540f64e 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 @@ -67,13 +67,8 @@ private constructor( fun of( individualsService: IndividualServiceAsync, params: HrisBenefitIndividualUnenrollManyParams, - response: Response - ) = - HrisBenefitIndividualUnenrollManyPageAsync( - individualsService, - params, - response, - ) + response: Response, + ) = HrisBenefitIndividualUnenrollManyPageAsync(individualsService, params, response) } @NoAutoDetect @@ -149,17 +144,15 @@ private constructor( } } - class AutoPager( - private val firstPage: HrisBenefitIndividualUnenrollManyPageAsync, - ) { + class AutoPager(private val firstPage: HrisBenefitIndividualUnenrollManyPageAsync) { fun forEach( action: Predicate, - executor: Executor + executor: Executor, ): CompletableFuture { fun CompletableFuture>.forEach( action: (UnenrolledIndividual) -> Boolean, - executor: Executor + executor: Executor, ): CompletableFuture = thenComposeAsync( { page -> @@ -168,7 +161,7 @@ private constructor( .map { it.getNextPage().forEach(action, executor) } .orElseGet { CompletableFuture.completedFuture(null) } }, - executor + executor, ) return CompletableFuture.completedFuture(Optional.of(firstPage)) .forEach(action::test, executor) 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 30914a92..17e72f0c 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 @@ -159,7 +159,7 @@ private constructor( fun build(): HrisBenefitIndividualUnenrollManyBody = HrisBenefitIndividualUnenrollManyBody( (individualIds ?: JsonMissing.of()).map { it.toImmutable() }, - additionalProperties.toImmutable() + additionalProperties.toImmutable(), ) } 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 dcfd510d..b2a4c5d6 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 @@ -62,11 +62,7 @@ private constructor( @JvmStatic fun of(benefitsService: BenefitService, params: HrisBenefitListParams, response: Response) = - HrisBenefitListPage( - benefitsService, - params, - response, - ) + HrisBenefitListPage(benefitsService, params, response) } @NoAutoDetect @@ -142,9 +138,7 @@ private constructor( } } - class AutoPager( - private val firstPage: HrisBenefitListPage, - ) : Iterable { + class AutoPager(private val firstPage: HrisBenefitListPage) : Iterable { override fun iterator(): Iterator = iterator { var page = firstPage 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 600505e0..fcd50f1f 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 @@ -67,13 +67,8 @@ private constructor( fun of( benefitsService: BenefitServiceAsync, params: HrisBenefitListParams, - response: Response - ) = - HrisBenefitListPageAsync( - benefitsService, - params, - response, - ) + response: Response, + ) = HrisBenefitListPageAsync(benefitsService, params, response) } @NoAutoDetect @@ -149,17 +144,15 @@ private constructor( } } - class AutoPager( - private val firstPage: HrisBenefitListPageAsync, - ) { + class AutoPager(private val firstPage: HrisBenefitListPageAsync) { fun forEach( action: Predicate, - executor: Executor + executor: Executor, ): CompletableFuture { fun CompletableFuture>.forEach( action: (CompanyBenefit) -> Boolean, - executor: Executor + executor: Executor, ): CompletableFuture = thenComposeAsync( { page -> @@ -168,7 +161,7 @@ private constructor( .map { it.getNextPage().forEach(action, executor) } .orElseGet { CompletableFuture.completedFuture(null) } }, - executor + executor, ) return CompletableFuture.completedFuture(Optional.of(firstPage)) .forEach(action::test, executor) 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 25e77547..5e65cc88 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 @@ -64,13 +64,8 @@ private constructor( fun of( benefitsService: BenefitService, params: HrisBenefitListSupportedBenefitsParams, - response: Response - ) = - HrisBenefitListSupportedBenefitsPage( - benefitsService, - params, - response, - ) + response: Response, + ) = HrisBenefitListSupportedBenefitsPage(benefitsService, params, response) } @NoAutoDetect @@ -146,9 +141,8 @@ private constructor( } } - class AutoPager( - private val firstPage: HrisBenefitListSupportedBenefitsPage, - ) : Iterable { + class AutoPager(private val firstPage: HrisBenefitListSupportedBenefitsPage) : + Iterable { override fun iterator(): Iterator = iterator { var page = firstPage 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 add12868..e21eb7f7 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 @@ -67,13 +67,8 @@ private constructor( fun of( benefitsService: BenefitServiceAsync, params: HrisBenefitListSupportedBenefitsParams, - response: Response - ) = - HrisBenefitListSupportedBenefitsPageAsync( - benefitsService, - params, - response, - ) + response: Response, + ) = HrisBenefitListSupportedBenefitsPageAsync(benefitsService, params, response) } @NoAutoDetect @@ -149,17 +144,15 @@ private constructor( } } - class AutoPager( - private val firstPage: HrisBenefitListSupportedBenefitsPageAsync, - ) { + class AutoPager(private val firstPage: HrisBenefitListSupportedBenefitsPageAsync) { fun forEach( action: Predicate, - executor: Executor + executor: Executor, ): CompletableFuture { fun CompletableFuture>.forEach( action: (SupportedBenefit) -> Boolean, - executor: Executor + executor: Executor, ): CompletableFuture = thenComposeAsync( { page -> @@ -168,7 +161,7 @@ private constructor( .map { it.getNextPage().forEach(action, executor) } .orElseGet { CompletableFuture.completedFuture(null) } }, - executor + executor, ) return CompletableFuture.completedFuture(Optional.of(firstPage)) .forEach(action::test, executor) 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 a5393797..0719a212 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 @@ -147,7 +147,7 @@ private constructor( fun build(): HrisBenefitListSupportedBenefitsParams = HrisBenefitListSupportedBenefitsParams( additionalHeaders.build(), - additionalQueryParams.build() + additionalQueryParams.build(), ) } 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 5c83291a..4b994a9e 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 @@ -81,13 +81,8 @@ private constructor( fun of( directoryService: DirectoryService, params: HrisDirectoryListIndividualsParams, - response: Response - ) = - HrisDirectoryListIndividualsPage( - directoryService, - params, - response, - ) + response: Response, + ) = HrisDirectoryListIndividualsPage(directoryService, params, response) } @NoAutoDetect @@ -177,18 +172,12 @@ private constructor( this.additionalProperties.put(key, value) } - fun build() = - Response( - individuals, - paging, - additionalProperties.toImmutable(), - ) + fun build() = Response(individuals, paging, additionalProperties.toImmutable()) } } - class AutoPager( - private val firstPage: HrisDirectoryListIndividualsPage, - ) : Iterable { + class AutoPager(private val firstPage: HrisDirectoryListIndividualsPage) : + Iterable { override fun iterator(): Iterator = iterator { var page = firstPage 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 e516e91e..ca3201d0 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 @@ -84,13 +84,8 @@ private constructor( fun of( directoryService: DirectoryServiceAsync, params: HrisDirectoryListIndividualsParams, - response: Response - ) = - HrisDirectoryListIndividualsPageAsync( - directoryService, - params, - response, - ) + response: Response, + ) = HrisDirectoryListIndividualsPageAsync(directoryService, params, response) } @NoAutoDetect @@ -180,26 +175,19 @@ private constructor( this.additionalProperties.put(key, value) } - fun build() = - Response( - individuals, - paging, - additionalProperties.toImmutable(), - ) + fun build() = Response(individuals, paging, additionalProperties.toImmutable()) } } - class AutoPager( - private val firstPage: HrisDirectoryListIndividualsPageAsync, - ) { + class AutoPager(private val firstPage: HrisDirectoryListIndividualsPageAsync) { fun forEach( action: Predicate, - executor: Executor + executor: Executor, ): CompletableFuture { fun CompletableFuture>.forEach( action: (IndividualInDirectory) -> Boolean, - executor: Executor + executor: Executor, ): CompletableFuture = thenComposeAsync( { page -> @@ -208,7 +196,7 @@ private constructor( .map { it.getNextPage().forEach(action, executor) } .orElseGet { CompletableFuture.completedFuture(null) } }, - executor + executor, ) return CompletableFuture.completedFuture(Optional.of(firstPage)) .forEach(action::test, executor) 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 1eb5dec5..4a31c2c6 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 @@ -80,13 +80,8 @@ private constructor( fun of( directoryService: DirectoryService, params: HrisDirectoryListParams, - response: Response - ) = - HrisDirectoryListPage( - directoryService, - params, - response, - ) + response: Response, + ) = HrisDirectoryListPage(directoryService, params, response) } @NoAutoDetect @@ -176,18 +171,12 @@ private constructor( this.additionalProperties.put(key, value) } - fun build() = - Response( - individuals, - paging, - additionalProperties.toImmutable(), - ) + fun build() = Response(individuals, paging, additionalProperties.toImmutable()) } } - class AutoPager( - private val firstPage: HrisDirectoryListPage, - ) : Iterable { + class AutoPager(private val firstPage: HrisDirectoryListPage) : + Iterable { override fun iterator(): Iterator = iterator { var page = firstPage 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 a46ebda5..861ffde7 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 @@ -83,13 +83,8 @@ private constructor( fun of( directoryService: DirectoryServiceAsync, params: HrisDirectoryListParams, - response: Response - ) = - HrisDirectoryListPageAsync( - directoryService, - params, - response, - ) + response: Response, + ) = HrisDirectoryListPageAsync(directoryService, params, response) } @NoAutoDetect @@ -179,26 +174,19 @@ private constructor( this.additionalProperties.put(key, value) } - fun build() = - Response( - individuals, - paging, - additionalProperties.toImmutable(), - ) + fun build() = Response(individuals, paging, additionalProperties.toImmutable()) } } - class AutoPager( - private val firstPage: HrisDirectoryListPageAsync, - ) { + class AutoPager(private val firstPage: HrisDirectoryListPageAsync) { fun forEach( action: Predicate, - executor: Executor + executor: Executor, ): CompletableFuture { fun CompletableFuture>.forEach( action: (IndividualInDirectory) -> Boolean, - executor: Executor + executor: Executor, ): CompletableFuture = thenComposeAsync( { page -> @@ -207,7 +195,7 @@ private constructor( .map { it.getNextPage().forEach(action, executor) } .orElseGet { CompletableFuture.completedFuture(null) } }, - executor + executor, ) return CompletableFuture.completedFuture(Optional.of(firstPage)) .forEach(action::test, executor) 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 6d13fc3b..c7cb36e7 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 @@ -245,11 +245,7 @@ private constructor( ) } - class Type - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class Type @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisEmploymentRetrieveManyPage.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisEmploymentRetrieveManyPage.kt index 1ef955e2..fb7c68c0 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 @@ -64,13 +64,8 @@ private constructor( fun of( employmentsService: EmploymentService, params: HrisEmploymentRetrieveManyParams, - response: Response - ) = - HrisEmploymentRetrieveManyPage( - employmentsService, - params, - response, - ) + response: Response, + ) = HrisEmploymentRetrieveManyPage(employmentsService, params, response) } @NoAutoDetect @@ -151,9 +146,8 @@ private constructor( } } - class AutoPager( - private val firstPage: HrisEmploymentRetrieveManyPage, - ) : Iterable { + class AutoPager(private val firstPage: HrisEmploymentRetrieveManyPage) : + Iterable { override fun iterator(): Iterator = iterator { var page = firstPage 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 f3dc9330..16233a7b 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 @@ -67,13 +67,8 @@ private constructor( fun of( employmentsService: EmploymentServiceAsync, params: HrisEmploymentRetrieveManyParams, - response: Response - ) = - HrisEmploymentRetrieveManyPageAsync( - employmentsService, - params, - response, - ) + response: Response, + ) = HrisEmploymentRetrieveManyPageAsync(employmentsService, params, response) } @NoAutoDetect @@ -154,17 +149,15 @@ private constructor( } } - class AutoPager( - private val firstPage: HrisEmploymentRetrieveManyPageAsync, - ) { + class AutoPager(private val firstPage: HrisEmploymentRetrieveManyPageAsync) { fun forEach( action: Predicate, - executor: Executor + executor: Executor, ): CompletableFuture { fun CompletableFuture>.forEach( action: (EmploymentDataResponse) -> Boolean, - executor: Executor + executor: Executor, ): CompletableFuture = thenComposeAsync( { page -> @@ -173,7 +166,7 @@ private constructor( .map { it.getNextPage().forEach(action, executor) } .orElseGet { CompletableFuture.completedFuture(null) } }, - executor + executor, ) return CompletableFuture.completedFuture(Optional.of(firstPage)) .forEach(action::test, executor) 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 47a1156c..7151df11 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 @@ -145,7 +145,7 @@ private constructor( fun build(): HrisEmploymentRetrieveManyBody = HrisEmploymentRetrieveManyBody( checkRequired("requests", requests).map { it.toImmutable() }, - additionalProperties.toImmutable() + additionalProperties.toImmutable(), ) } @@ -425,7 +425,7 @@ private constructor( fun build(): Request = Request( checkRequired("individualId", individualId), - additionalProperties.toImmutable() + additionalProperties.toImmutable(), ) } 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 30c5ab22..580aacb5 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 @@ -64,13 +64,8 @@ private constructor( fun of( individualsService: IndividualService, params: HrisIndividualRetrieveManyParams, - response: Response - ) = - HrisIndividualRetrieveManyPage( - individualsService, - params, - response, - ) + response: Response, + ) = HrisIndividualRetrieveManyPage(individualsService, params, response) } @NoAutoDetect @@ -149,9 +144,8 @@ private constructor( } } - class AutoPager( - private val firstPage: HrisIndividualRetrieveManyPage, - ) : Iterable { + class AutoPager(private val firstPage: HrisIndividualRetrieveManyPage) : + Iterable { override fun iterator(): Iterator = iterator { var page = firstPage 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 62e2a9c6..8693075d 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 @@ -67,13 +67,8 @@ private constructor( fun of( individualsService: IndividualServiceAsync, params: HrisIndividualRetrieveManyParams, - response: Response - ) = - HrisIndividualRetrieveManyPageAsync( - individualsService, - params, - response, - ) + response: Response, + ) = HrisIndividualRetrieveManyPageAsync(individualsService, params, response) } @NoAutoDetect @@ -152,17 +147,15 @@ private constructor( } } - class AutoPager( - private val firstPage: HrisIndividualRetrieveManyPageAsync, - ) { + class AutoPager(private val firstPage: HrisIndividualRetrieveManyPageAsync) { fun forEach( action: Predicate, - executor: Executor + executor: Executor, ): CompletableFuture { fun CompletableFuture>.forEach( action: (IndividualResponse) -> Boolean, - executor: Executor + executor: Executor, ): CompletableFuture = thenComposeAsync( { page -> @@ -171,7 +164,7 @@ private constructor( .map { it.getNextPage().forEach(action, executor) } .orElseGet { CompletableFuture.completedFuture(null) } }, - executor + executor, ) return CompletableFuture.completedFuture(Optional.of(firstPage)) .forEach(action::test, executor) 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 c63cd80a..a99cbfc8 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 @@ -433,7 +433,7 @@ private constructor( fun build(): Options = Options( (include ?: JsonMissing.of()).map { it.toImmutable() }, - additionalProperties.toImmutable() + additionalProperties.toImmutable(), ) } 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 3343773b..6e8a850e 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 @@ -68,13 +68,8 @@ private constructor( fun of( payStatementsService: PayStatementService, params: HrisPayStatementRetrieveManyParams, - response: Response - ) = - HrisPayStatementRetrieveManyPage( - payStatementsService, - params, - response, - ) + response: Response, + ) = HrisPayStatementRetrieveManyPage(payStatementsService, params, response) } @NoAutoDetect @@ -154,9 +149,8 @@ private constructor( } } - class AutoPager( - private val firstPage: HrisPayStatementRetrieveManyPage, - ) : Iterable { + class AutoPager(private val firstPage: HrisPayStatementRetrieveManyPage) : + Iterable { override fun iterator(): Iterator = iterator { var page = firstPage 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 8402cb89..e1e84e39 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 @@ -71,13 +71,8 @@ private constructor( fun of( payStatementsService: PayStatementServiceAsync, params: HrisPayStatementRetrieveManyParams, - response: Response - ) = - HrisPayStatementRetrieveManyPageAsync( - payStatementsService, - params, - response, - ) + response: Response, + ) = HrisPayStatementRetrieveManyPageAsync(payStatementsService, params, response) } @NoAutoDetect @@ -157,17 +152,15 @@ private constructor( } } - class AutoPager( - private val firstPage: HrisPayStatementRetrieveManyPageAsync, - ) { + class AutoPager(private val firstPage: HrisPayStatementRetrieveManyPageAsync) { fun forEach( action: Predicate, - executor: Executor + executor: Executor, ): CompletableFuture { fun CompletableFuture>.forEach( action: (PayStatementResponse) -> Boolean, - executor: Executor + executor: Executor, ): CompletableFuture = thenComposeAsync( { page -> @@ -176,7 +169,7 @@ private constructor( .map { it.getNextPage().forEach(action, executor) } .orElseGet { CompletableFuture.completedFuture(null) } }, - executor + executor, ) return CompletableFuture.completedFuture(Optional.of(firstPage)) .forEach(action::test, executor) 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 2bd05098..53571ac0 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 @@ -149,7 +149,7 @@ private constructor( fun build(): HrisPayStatementRetrieveManyBody = HrisPayStatementRetrieveManyBody( checkRequired("requests", requests).map { it.toImmutable() }, - additionalProperties.toImmutable() + additionalProperties.toImmutable(), ) } 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 21e1d194..c321b38f 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 @@ -62,11 +62,7 @@ private constructor( @JvmStatic fun of(paymentsService: PaymentService, params: HrisPaymentListParams, response: Response) = - HrisPaymentListPage( - paymentsService, - params, - response, - ) + HrisPaymentListPage(paymentsService, params, response) } @NoAutoDetect @@ -141,9 +137,7 @@ private constructor( } } - class AutoPager( - private val firstPage: HrisPaymentListPage, - ) : Iterable { + class AutoPager(private val firstPage: HrisPaymentListPage) : Iterable { override fun iterator(): Iterator = iterator { var page = firstPage 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 90b5f23f..c2d3ad50 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 @@ -67,13 +67,8 @@ private constructor( fun of( paymentsService: PaymentServiceAsync, params: HrisPaymentListParams, - response: Response - ) = - HrisPaymentListPageAsync( - paymentsService, - params, - response, - ) + response: Response, + ) = HrisPaymentListPageAsync(paymentsService, params, response) } @NoAutoDetect @@ -148,14 +143,12 @@ private constructor( } } - class AutoPager( - private val firstPage: HrisPaymentListPageAsync, - ) { + class AutoPager(private val firstPage: HrisPaymentListPageAsync) { fun forEach(action: Predicate, executor: Executor): CompletableFuture { fun CompletableFuture>.forEach( action: (Payment) -> Boolean, - executor: Executor + executor: Executor, ): CompletableFuture = thenComposeAsync( { page -> @@ -164,7 +157,7 @@ private constructor( .map { it.getNextPage().forEach(action, executor) } .orElseGet { CompletableFuture.completedFuture(null) } }, - executor + executor, ) return CompletableFuture.completedFuture(Optional.of(firstPage)) .forEach(action::test, executor) 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 28c6cfb7..b83b95f6 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 @@ -187,24 +187,14 @@ private constructor( } fun build(): Income = - Income( - amount, - currency, - effectiveDate, - unit, - additionalProperties.toImmutable(), - ) + Income(amount, currency, effectiveDate, unit, additionalProperties.toImmutable()) } /** * The income unit of payment. Options: `yearly`, `quarterly`, `monthly`, `semi_monthly`, * `bi_weekly`, `weekly`, `daily`, `hourly`, and `fixed`. */ - class Unit - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class Unit @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Individual.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Individual.kt index b26b4aba..3f7d3e4c 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 @@ -511,19 +511,10 @@ private constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): Email = - Email( - data, - type, - additionalProperties.toImmutable(), - ) + fun build(): Email = Email(data, type, additionalProperties.toImmutable()) } - class Type - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class Type @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. @@ -630,11 +621,7 @@ private constructor( } /** The EEOC-defined ethnicity of the individual. */ - class Ethnicity - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class Ethnicity @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. @@ -761,11 +748,7 @@ private constructor( } /** The gender of the individual. */ - class Gender - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class Gender @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. @@ -952,19 +935,10 @@ private constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): PhoneNumber = - PhoneNumber( - data, - type, - additionalProperties.toImmutable(), - ) + fun build(): PhoneNumber = PhoneNumber(data, type, additionalProperties.toImmutable()) } - class Type - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class Type @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/IndividualBenefit.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/IndividualBenefit.kt index f0d60f8a..0f2e9a3a 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 @@ -119,12 +119,7 @@ private constructor( } fun build(): IndividualBenefit = - IndividualBenefit( - body, - code, - individualId, - additionalProperties.toImmutable(), - ) + IndividualBenefit(body, code, individualId, additionalProperties.toImmutable()) } @NoAutoDetect @@ -349,9 +344,7 @@ private constructor( /** Type for HSA contribution limit if the benefit is a HSA. */ class HsaContributionLimit @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/IndividualEvent.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/IndividualEvent.kt index c380b159..3cebd63c 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 @@ -315,11 +315,7 @@ private constructor( "Data{individualId=$individualId, additionalProperties=$additionalProperties}" } - class EventType - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class EventType @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/IndividualResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/IndividualResponse.kt index d4fb4462..c78a32ba 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 @@ -119,12 +119,7 @@ private constructor( } fun build(): IndividualResponse = - IndividualResponse( - body, - code, - individualId, - additionalProperties.toImmutable(), - ) + IndividualResponse(body, code, individualId, additionalProperties.toImmutable()) } override fun equals(other: Any?): Boolean { 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 d1864f48..66f0ba75 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 @@ -511,19 +511,10 @@ private constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): Email = - Email( - data, - type, - additionalProperties.toImmutable(), - ) + fun build(): Email = Email(data, type, additionalProperties.toImmutable()) } - class Type - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class Type @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. @@ -630,11 +621,7 @@ private constructor( } /** The EEOC-defined ethnicity of the individual. */ - class Ethnicity - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class Ethnicity @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. @@ -761,11 +748,7 @@ private constructor( } /** The gender of the individual. */ - class Gender - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class Gender @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. @@ -950,19 +933,10 @@ private constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): PhoneNumber = - PhoneNumber( - data, - type, - additionalProperties.toImmutable(), - ) + fun build(): PhoneNumber = PhoneNumber(data, type, additionalProperties.toImmutable()) } - class Type - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class Type @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Introspection.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Introspection.kt index 16b78e12..63379965 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 @@ -812,11 +812,7 @@ private constructor( } fun build(): ConnectionStatus = - ConnectionStatus( - message, - status, - additionalProperties.toImmutable(), - ) + ConnectionStatus(message, status, additionalProperties.toImmutable()) } override fun equals(other: Any?): Boolean { @@ -838,11 +834,7 @@ private constructor( } /** The type of authentication method. */ - class Type - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class Type @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. @@ -967,11 +959,7 @@ private constructor( } /** The type of application associated with a token. */ - class ClientType - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class ClientType @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. @@ -1156,11 +1144,7 @@ private constructor( } fun build(): ConnectionStatus = - ConnectionStatus( - message, - status, - additionalProperties.toImmutable(), - ) + ConnectionStatus(message, status, additionalProperties.toImmutable()) } override fun equals(other: Any?): Boolean { @@ -1186,11 +1170,8 @@ private constructor( * - `provider` - connection to an external provider * - `finch` - finch-generated data. */ - class ConnectionType - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class ConnectionType @JsonCreator private constructor(private val value: JsonField) : + Enum { /** * Returns this class instance's raw value. diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobAutomatedCreateParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobAutomatedCreateParams.kt index 9e723312..84f9be5a 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 @@ -187,7 +187,7 @@ private constructor( override fun serialize( value: JobAutomatedCreateBody, generator: JsonGenerator, - provider: SerializerProvider + provider: SerializerProvider, ) { when { value.dataSyncAll != null -> generator.writeObject(value.dataSyncAll) @@ -415,11 +415,7 @@ private constructor( } /** The type of job to start. */ - class Type - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class Type @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. @@ -440,7 +436,7 @@ private constructor( /** An enum containing [Type]'s known values. */ enum class Known { - DATA_SYNC_ALL, + DATA_SYNC_ALL } /** @@ -701,7 +697,7 @@ private constructor( fun build(): Params = Params( checkRequired("individualId", individualId), - additionalProperties.toImmutable() + additionalProperties.toImmutable(), ) } @@ -724,11 +720,7 @@ private constructor( } /** The type of job to start. */ - class Type - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class Type @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. @@ -749,7 +741,7 @@ private constructor( /** An enum containing [Type]'s known values. */ enum class Known { - W4_FORM_EMPLOYEE_SYNC, + W4_FORM_EMPLOYEE_SYNC } /** 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 23663d9a..3774d28b 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 @@ -84,13 +84,8 @@ private constructor( fun of( automatedService: AutomatedService, params: JobAutomatedListParams, - response: Response - ) = - JobAutomatedListPage( - automatedService, - params, - response, - ) + response: Response, + ) = JobAutomatedListPage(automatedService, params, response) } @NoAutoDetect @@ -175,18 +170,11 @@ private constructor( this.additionalProperties.put(key, value) } - fun build() = - Response( - data, - paging, - additionalProperties.toImmutable(), - ) + fun build() = Response(data, paging, additionalProperties.toImmutable()) } } - class AutoPager( - private val firstPage: JobAutomatedListPage, - ) : Iterable { + class AutoPager(private val firstPage: JobAutomatedListPage) : Iterable { override fun iterator(): Iterator = iterator { var page = firstPage 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 a89d64a1..f2ba3f01 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 @@ -87,13 +87,8 @@ private constructor( fun of( automatedService: AutomatedServiceAsync, params: JobAutomatedListParams, - response: Response - ) = - JobAutomatedListPageAsync( - automatedService, - params, - response, - ) + response: Response, + ) = JobAutomatedListPageAsync(automatedService, params, response) } @NoAutoDetect @@ -178,26 +173,19 @@ private constructor( this.additionalProperties.put(key, value) } - fun build() = - Response( - data, - paging, - additionalProperties.toImmutable(), - ) + fun build() = Response(data, paging, additionalProperties.toImmutable()) } } - class AutoPager( - private val firstPage: JobAutomatedListPageAsync, - ) { + class AutoPager(private val firstPage: JobAutomatedListPageAsync) { fun forEach( action: Predicate, - executor: Executor + executor: Executor, ): CompletableFuture { fun CompletableFuture>.forEach( action: (AutomatedAsyncJob) -> Boolean, - executor: Executor + executor: Executor, ): CompletableFuture = thenComposeAsync( { page -> @@ -206,7 +194,7 @@ private constructor( .map { it.getNextPage().forEach(action, executor) } .orElseGet { CompletableFuture.completedFuture(null) } }, - executor + executor, ) return CompletableFuture.completedFuture(Optional.of(firstPage)) .forEach(action::test, executor) 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 0e35e6bf..00294490 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 @@ -333,11 +333,7 @@ private constructor( "Data{jobId=$jobId, jobUrl=$jobUrl, additionalProperties=$additionalProperties}" } - class EventType - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class EventType @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ManualAsyncJob.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ManualAsyncJob.kt index 42a27152..65bc5869 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 @@ -148,11 +148,7 @@ private constructor( ) } - class Status - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class Status @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Money.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/Money.kt index 2aeaa697..547abdfa 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 @@ -110,12 +110,7 @@ private constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): Money = - Money( - amount, - currency, - additionalProperties.toImmutable(), - ) + fun build(): Money = Money(amount, currency, additionalProperties.toImmutable()) } override fun equals(other: Any?): Boolean { 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 7ff857eb..13f54944 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 @@ -16,11 +16,8 @@ import com.tryfinch.api.errors.FinchInvalidDataException * - `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( - private val value: JsonField, -) : Enum { +class OperationSupport @JsonCreator private constructor(private val value: JsonField) : + Enum { /** * Returns this class instance's raw value. diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/OperationSupportMatrix.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/OperationSupportMatrix.kt index 28f0e217..56ac7c5f 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 @@ -274,13 +274,7 @@ private constructor( } fun build(): OperationSupportMatrix = - OperationSupportMatrix( - create, - delete, - read, - update, - additionalProperties.toImmutable(), - ) + OperationSupportMatrix(create, delete, read, update, additionalProperties.toImmutable()) } override fun equals(other: Any?): Boolean { 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 7775b803..d75f67c8 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 @@ -105,12 +105,7 @@ private constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): Paging = - Paging( - count, - offset, - additionalProperties.toImmutable(), - ) + fun build(): Paging = Paging(count, offset, additionalProperties.toImmutable()) } override fun equals(other: Any?): Boolean { 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 157209b2..47a584fa 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 @@ -154,11 +154,8 @@ private constructor( ) } - class PayFrequency - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class PayFrequency @JsonCreator private constructor(private val value: JsonField) : + Enum { /** * Returns this class instance's raw value. diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayGroupRetrieveResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayGroupRetrieveResponse.kt index fbf23ba7..6eeb325e 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 @@ -185,11 +185,8 @@ private constructor( ) } - class PayFrequency - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class PayFrequency @JsonCreator private constructor(private val value: JsonField) : + Enum { /** * Returns this class instance's raw value. diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayStatement.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayStatement.kt index d529522b..ebefdb09 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 @@ -560,22 +560,11 @@ private constructor( } fun build(): Earning = - Earning( - amount, - currency, - hours, - name, - type, - additionalProperties.toImmutable(), - ) + Earning(amount, currency, hours, name, type, additionalProperties.toImmutable()) } /** The type of earning. */ - class Type - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class Type @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. @@ -1122,11 +1111,8 @@ private constructor( } /** The payment method. */ - class PaymentMethod - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class PaymentMethod @JsonCreator private constructor(private val value: JsonField) : + Enum { /** * Returns this class instance's raw value. @@ -1386,22 +1372,11 @@ private constructor( } fun build(): Tax = - Tax( - amount, - currency, - employer, - name, - type, - additionalProperties.toImmutable(), - ) + Tax(amount, currency, employer, name, type, additionalProperties.toImmutable()) } /** The type of taxes. */ - class Type - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class Type @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. @@ -1520,11 +1495,7 @@ private constructor( } /** The type of the payment associated with the pay statement. */ - class Type - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class Type @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayStatementEvent.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayStatementEvent.kt index 37ad59a8..6ed2b6a4 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 @@ -312,12 +312,7 @@ private constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): Data = - Data( - individualId, - paymentId, - additionalProperties.toImmutable(), - ) + fun build(): Data = Data(individualId, paymentId, additionalProperties.toImmutable()) } override fun equals(other: Any?): Boolean { @@ -338,11 +333,7 @@ private constructor( "Data{individualId=$individualId, paymentId=$paymentId, additionalProperties=$additionalProperties}" } - class EventType - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class EventType @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayStatementResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayStatementResponse.kt index d2b73d6d..22aaf7fe 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 @@ -114,12 +114,7 @@ private constructor( } fun build(): PayStatementResponse = - PayStatementResponse( - body, - code, - paymentId, - additionalProperties.toImmutable(), - ) + PayStatementResponse(body, code, paymentId, additionalProperties.toImmutable()) } override fun equals(other: Any?): Boolean { 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 a98098da..49c187e4 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 @@ -385,11 +385,8 @@ private constructor( ) } - class PayFrequency - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class PayFrequency @JsonCreator private constructor(private val value: JsonField) : + Enum { /** * Returns this class instance's raw value. @@ -612,11 +609,7 @@ private constructor( } fun build(): PayPeriod = - PayPeriod( - endDate, - startDate, - additionalProperties.toImmutable(), - ) + PayPeriod(endDate, startDate, additionalProperties.toImmutable()) } override fun equals(other: Any?): Boolean { 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 020fc76d..51651333 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 @@ -335,11 +335,7 @@ private constructor( "PaymentIdentifiers{payDate=$payDate, paymentId=$paymentId, additionalProperties=$additionalProperties}" } - class EventType - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class EventType @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayrollPayGroupListPage.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayrollPayGroupListPage.kt index 51aa4989..aec5d816 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 @@ -64,13 +64,8 @@ private constructor( fun of( payGroupsService: PayGroupService, params: PayrollPayGroupListParams, - response: Response - ) = - PayrollPayGroupListPage( - payGroupsService, - params, - response, - ) + response: Response, + ) = PayrollPayGroupListPage(payGroupsService, params, response) } @NoAutoDetect @@ -146,9 +141,8 @@ private constructor( } } - class AutoPager( - private val firstPage: PayrollPayGroupListPage, - ) : Iterable { + class AutoPager(private val firstPage: PayrollPayGroupListPage) : + Iterable { override fun iterator(): Iterator = iterator { var page = firstPage 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 eb29f545..8e352508 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 @@ -67,13 +67,8 @@ private constructor( fun of( payGroupsService: PayGroupServiceAsync, params: PayrollPayGroupListParams, - response: Response - ) = - PayrollPayGroupListPageAsync( - payGroupsService, - params, - response, - ) + response: Response, + ) = PayrollPayGroupListPageAsync(payGroupsService, params, response) } @NoAutoDetect @@ -149,17 +144,15 @@ private constructor( } } - class AutoPager( - private val firstPage: PayrollPayGroupListPageAsync, - ) { + class AutoPager(private val firstPage: PayrollPayGroupListPageAsync) { fun forEach( action: Predicate, - executor: Executor + executor: Executor, ): CompletableFuture { fun CompletableFuture>.forEach( action: (PayGroupListResponse) -> Boolean, - executor: Executor + executor: Executor, ): CompletableFuture = thenComposeAsync( { page -> @@ -168,7 +161,7 @@ private constructor( .map { it.getNextPage().forEach(action, executor) } .orElseGet { CompletableFuture.completedFuture(null) } }, - executor + executor, ) return CompletableFuture.completedFuture(Optional.of(firstPage)) .forEach(action::test, executor) 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 75479ec8..6fcd5df1 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 @@ -1213,11 +1213,7 @@ private constructor( } fun build(): Departments = - Departments( - name, - parent, - additionalProperties.toImmutable(), - ) + Departments(name, parent, additionalProperties.toImmutable()) } @NoAutoDetect @@ -1431,11 +1427,7 @@ private constructor( } fun build(): Entity = - Entity( - subtype, - type, - additionalProperties.toImmutable(), - ) + Entity(subtype, type, additionalProperties.toImmutable()) } override fun equals(other: Any?): Boolean { @@ -2173,11 +2165,7 @@ private constructor( } fun build(): Paging = - Paging( - count, - offset, - additionalProperties.toImmutable(), - ) + Paging(count, offset, additionalProperties.toImmutable()) } override fun equals(other: Any?): Boolean { @@ -2795,11 +2783,7 @@ private constructor( } fun build(): Employment = - Employment( - subtype, - type, - additionalProperties.toImmutable(), - ) + Employment(subtype, type, additionalProperties.toImmutable()) } override fun equals(other: Any?): Boolean { @@ -2933,12 +2917,7 @@ private constructor( } fun build(): Income = - Income( - amount, - currency, - unit, - additionalProperties.toImmutable(), - ) + Income(amount, currency, unit, additionalProperties.toImmutable()) } override fun equals(other: Any?): Boolean { @@ -3653,12 +3632,7 @@ private constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): Emails = - Emails( - data, - type, - additionalProperties.toImmutable(), - ) + fun build(): Emails = Emails(data, type, additionalProperties.toImmutable()) } override fun equals(other: Any?): Boolean { @@ -3770,11 +3744,7 @@ private constructor( } fun build(): PhoneNumbers = - PhoneNumbers( - data, - type, - additionalProperties.toImmutable(), - ) + PhoneNumbers(data, type, additionalProperties.toImmutable()) } override fun equals(other: Any?): Boolean { @@ -5733,11 +5703,7 @@ private constructor( } fun build(): PayPeriod = - PayPeriod( - endDate, - startDate, - additionalProperties.toImmutable(), - ) + PayPeriod(endDate, startDate, additionalProperties.toImmutable()) } override fun equals(other: Any?): Boolean { @@ -5795,11 +5761,7 @@ private constructor( } /** The type of authentication method. */ - class Type - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class Type @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ProviderListPage.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ProviderListPage.kt index 9d818def..3d4f3975 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 @@ -62,11 +62,7 @@ private constructor( @JvmStatic fun of(providersService: ProviderService, params: ProviderListParams, response: Response) = - ProviderListPage( - providersService, - params, - response, - ) + ProviderListPage(providersService, params, response) } @NoAutoDetect @@ -141,9 +137,7 @@ private constructor( } } - class AutoPager( - private val firstPage: ProviderListPage, - ) : Iterable { + class AutoPager(private val firstPage: ProviderListPage) : Iterable { override fun iterator(): Iterator = iterator { var page = firstPage 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 92cdf968..37cf24fe 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 @@ -67,13 +67,8 @@ private constructor( fun of( providersService: ProviderServiceAsync, params: ProviderListParams, - response: Response - ) = - ProviderListPageAsync( - providersService, - params, - response, - ) + response: Response, + ) = ProviderListPageAsync(providersService, params, response) } @NoAutoDetect @@ -148,14 +143,12 @@ private constructor( } } - class AutoPager( - private val firstPage: ProviderListPageAsync, - ) { + class AutoPager(private val firstPage: ProviderListPageAsync) { fun forEach(action: Predicate, executor: Executor): CompletableFuture { fun CompletableFuture>.forEach( action: (Provider) -> Boolean, - executor: Executor + executor: Executor, ): CompletableFuture = thenComposeAsync( { page -> @@ -164,7 +157,7 @@ private constructor( .map { it.getNextPage().forEach(action, executor) } .orElseGet { CompletableFuture.completedFuture(null) } }, - executor + executor, ) return CompletableFuture.completedFuture(Optional.of(firstPage)) .forEach(action::test, executor) 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 1d725117..10f02d49 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 @@ -866,11 +866,8 @@ private constructor( } /** The type of bank account. */ - class AccountType - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class AccountType @JsonCreator private constructor(private val value: JsonField) : + Enum { /** * Returns this class instance's raw value. @@ -1079,12 +1076,7 @@ private constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): Department = - Department( - name, - parent, - additionalProperties.toImmutable(), - ) + fun build(): Department = Department(name, parent, additionalProperties.toImmutable()) } /** The parent department, if present. */ @@ -1308,20 +1300,12 @@ private constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): Entity = - Entity( - subtype, - type, - additionalProperties.toImmutable(), - ) + fun build(): Entity = Entity(subtype, type, additionalProperties.toImmutable()) } /** The tax payer subtype of the company. */ - class Subtype - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class Subtype @JsonCreator private constructor(private val value: JsonField) : + Enum { /** * Returns this class instance's raw value. @@ -1418,11 +1402,7 @@ private constructor( } /** The tax payer type of the company. */ - class Type - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class Type @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxConnectionAccountCreateParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxConnectionAccountCreateParams.kt index d212b752..c14fc852 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 @@ -452,9 +452,7 @@ private constructor( class AuthenticationType @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxConnectionAccountUpdateParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxConnectionAccountUpdateParams.kt index 41bffb71..f5605cb7 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 @@ -130,7 +130,7 @@ private constructor( fun build(): SandboxConnectionAccountUpdateBody = SandboxConnectionAccountUpdateBody( connectionStatus, - additionalProperties.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 9201ae74..9f0e6568 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 @@ -452,9 +452,7 @@ private constructor( class AuthenticationType @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxDirectoryCreateParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxDirectoryCreateParams.kt index da8089a4..a9399f8b 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 @@ -1081,11 +1081,7 @@ private constructor( } fun build(): CustomField = - CustomField( - name, - value, - additionalProperties.toImmutable(), - ) + CustomField(name, value, additionalProperties.toImmutable()) } override fun equals(other: Any?): Boolean { @@ -1301,19 +1297,11 @@ private constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): Email = - Email( - data, - type, - additionalProperties.toImmutable(), - ) + fun build(): Email = Email(data, type, additionalProperties.toImmutable()) } - class Type - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class Type @JsonCreator private constructor(private val value: JsonField) : + Enum { /** * Returns this class instance's raw value. @@ -1541,22 +1529,15 @@ private constructor( } fun build(): Employment = - Employment( - subtype, - type, - additionalProperties.toImmutable(), - ) + Employment(subtype, type, additionalProperties.toImmutable()) } /** * The secondary employment type of the individual. Options: `full_time`, `part_time`, * `intern`, `temp`, `seasonal` and `individual_contractor`. */ - class Subtype - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class Subtype @JsonCreator private constructor(private val value: JsonField) : + Enum { /** * Returns this class instance's raw value. @@ -1672,11 +1653,8 @@ private constructor( } /** The main employment type of the individual. */ - class Type - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class Type @JsonCreator private constructor(private val value: JsonField) : + Enum { /** * Returns this class instance's raw value. @@ -1787,9 +1765,7 @@ private constructor( /** The detailed employment status of the individual. */ class EmploymentStatus @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. @@ -1912,11 +1888,8 @@ private constructor( } /** The EEOC-defined ethnicity of the individual. */ - class Ethnicity - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class Ethnicity @JsonCreator private constructor(private val value: JsonField) : + Enum { /** * Returns this class instance's raw value. @@ -2046,11 +2019,7 @@ private constructor( } /** The gender of the individual. */ - class Gender - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class Gender @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. @@ -2344,18 +2313,11 @@ private constructor( } fun build(): PhoneNumber = - PhoneNumber( - data, - type, - additionalProperties.toImmutable(), - ) + PhoneNumber(data, type, additionalProperties.toImmutable()) } - class Type - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class Type @JsonCreator private constructor(private val value: JsonField) : + Enum { /** * Returns this class instance's raw value. diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxEmploymentUpdateParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxEmploymentUpdateParams.kt index 251c39f9..d07a6db1 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 @@ -1154,12 +1154,7 @@ private constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): CustomField = - CustomField( - name, - value, - additionalProperties.toImmutable(), - ) + fun build(): CustomField = CustomField(name, value, additionalProperties.toImmutable()) } override fun equals(other: Any?): Boolean { @@ -1395,23 +1390,15 @@ private constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): Employment = - Employment( - subtype, - type, - additionalProperties.toImmutable(), - ) + fun build(): Employment = Employment(subtype, type, additionalProperties.toImmutable()) } /** * The secondary employment type of the individual. Options: `full_time`, `part_time`, * `intern`, `temp`, `seasonal` and `individual_contractor`. */ - class Subtype - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class Subtype @JsonCreator private constructor(private val value: JsonField) : + Enum { /** * Returns this class instance's raw value. @@ -1526,11 +1513,7 @@ private constructor( } /** The main employment type of the individual. */ - class Type - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class Type @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. @@ -1637,11 +1620,8 @@ private constructor( } /** The detailed employment status of the individual. */ - class EmploymentStatus - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class EmploymentStatus @JsonCreator private constructor(private val value: JsonField) : + Enum { /** * Returns this class instance's raw value. diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxIndividualUpdateParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxIndividualUpdateParams.kt index 694c9061..4df0b489 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 @@ -924,19 +924,10 @@ private constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): Email = - Email( - data, - type, - additionalProperties.toImmutable(), - ) + fun build(): Email = Email(data, type, additionalProperties.toImmutable()) } - class Type - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class Type @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. @@ -1043,11 +1034,7 @@ private constructor( } /** The EEOC-defined ethnicity of the individual. */ - class Ethnicity - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class Ethnicity @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. @@ -1174,11 +1161,7 @@ private constructor( } /** The gender of the individual. */ - class Gender - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class Gender @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. @@ -1363,19 +1346,10 @@ private constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): PhoneNumber = - PhoneNumber( - data, - type, - additionalProperties.toImmutable(), - ) + fun build(): PhoneNumber = PhoneNumber(data, type, additionalProperties.toImmutable()) } - class Type - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class Type @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxJobConfiguration.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxJobConfiguration.kt index 874c66b6..a8b6125a 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 @@ -114,11 +114,8 @@ private constructor( ) } - class CompletionStatus - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class CompletionStatus @JsonCreator private constructor(private val value: JsonField) : + Enum { /** * Returns this class instance's raw value. @@ -220,11 +217,7 @@ private constructor( override fun toString() = value.toString() } - class Type - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class Type @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. @@ -245,7 +238,7 @@ private constructor( /** An enum containing [Type]'s known values. */ enum class Known { - DATA_SYNC_ALL, + 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 0eeb3408..8bde74ca 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 @@ -147,7 +147,7 @@ private constructor( fun build(): SandboxJobConfigurationRetrieveParams = SandboxJobConfigurationRetrieveParams( additionalHeaders.build(), - additionalQueryParams.build() + additionalQueryParams.build(), ) } 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 6b54e4c1..f30d929d 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 @@ -330,11 +330,8 @@ private constructor( ) } - class CompletionStatus - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class CompletionStatus @JsonCreator private constructor(private val value: JsonField) : + Enum { /** * Returns this class instance's raw value. @@ -436,11 +433,7 @@ private constructor( override fun toString() = value.toString() } - class Type - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class Type @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. @@ -461,7 +454,7 @@ private constructor( /** An enum containing [Type]'s known values. */ enum class Known { - DATA_SYNC_ALL, + 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 8babd659..71da1c0b 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 @@ -124,7 +124,7 @@ private constructor( fun build(): SandboxJobCreateBody = SandboxJobCreateBody( checkRequired("type", type), - additionalProperties.toImmutable() + additionalProperties.toImmutable(), ) } @@ -300,11 +300,7 @@ private constructor( } /** The type of job to start. Currently the only supported type is `data_sync_all` */ - class Type - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class Type @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. @@ -325,7 +321,7 @@ private constructor( /** An enum containing [Type]'s known values. */ enum class Known { - DATA_SYNC_ALL, + 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 c0829f94..41673370 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 @@ -929,22 +929,12 @@ private constructor( } fun build(): Earning = - Earning( - amount, - currency, - hours, - name, - type, - additionalProperties.toImmutable(), - ) + Earning(amount, currency, hours, name, type, additionalProperties.toImmutable()) } /** The type of earning. */ - class Type - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class Type @JsonCreator private constructor(private val value: JsonField) : + Enum { /** * Returns this class instance's raw value. @@ -1499,11 +1489,8 @@ private constructor( } /** The payment method. */ - class PaymentMethod - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class PaymentMethod @JsonCreator private constructor(private val value: JsonField) : + Enum { /** * Returns this class instance's raw value. @@ -1771,22 +1758,12 @@ private constructor( } fun build(): Tax = - Tax( - amount, - currency, - employer, - name, - type, - additionalProperties.toImmutable(), - ) + Tax(amount, currency, employer, name, type, additionalProperties.toImmutable()) } /** The type of taxes. */ - class Type - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class Type @JsonCreator private constructor(private val value: JsonField) : + Enum { /** * Returns this class instance's raw value. @@ -1907,11 +1884,7 @@ private constructor( } /** The type of the payment associated with the pay statement. */ - class Type - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class Type @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SupportedBenefit.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SupportedBenefit.kt index 174b02b1..c249b175 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 @@ -396,9 +396,7 @@ private constructor( class CompanyContribution @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. @@ -488,11 +486,8 @@ private constructor( override fun toString() = value.toString() } - class EmployeeDeduction - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class EmployeeDeduction @JsonCreator private constructor(private val value: JsonField) : + Enum { /** * Returns this class instance's raw value. @@ -584,9 +579,7 @@ private constructor( class HsaContributionLimit @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/UnenrolledIndividual.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/UnenrolledIndividual.kt index ade72313..f5adb2ec 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 @@ -121,12 +121,7 @@ private constructor( } fun build(): UnenrolledIndividual = - UnenrolledIndividual( - body, - code, - individualId, - additionalProperties.toImmutable(), - ) + UnenrolledIndividual(body, code, individualId, additionalProperties.toImmutable()) } @NoAutoDetect @@ -250,13 +245,7 @@ private constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): Body = - Body( - finchCode, - message, - name, - additionalProperties.toImmutable(), - ) + fun build(): Body = Body(finchCode, message, name, additionalProperties.toImmutable()) } override fun equals(other: Any?): Boolean { 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 d1a7e8ba..95463baa 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 @@ -90,7 +90,7 @@ private constructor( fun build(): UpdateCompanyBenefitResponse = UpdateCompanyBenefitResponse( checkRequired("benefitId", benefitId), - additionalProperties.toImmutable() + additionalProperties.toImmutable(), ) } 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 98111406..eabe083c 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 @@ -134,13 +134,7 @@ private constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): W42005 = - W42005( - data, - type, - year, - additionalProperties.toImmutable(), - ) + fun build(): W42005 = W42005(data, type, year, additionalProperties.toImmutable()) } /** Detailed information specific to the 2005 W4 form. */ @@ -347,11 +341,8 @@ private constructor( } /** Indicates exemption status from federal tax withholding. */ - class Exemption - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class Exemption @JsonCreator private constructor(private val value: JsonField) : + Enum { /** * Returns this class instance's raw value. @@ -443,11 +434,8 @@ private constructor( } /** The individual's filing status for tax purposes. */ - class FilingStatus - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class FilingStatus @JsonCreator private constructor(private val value: JsonField) : + Enum { /** * Returns this class instance's raw value. @@ -567,11 +555,7 @@ private constructor( } /** Specifies the form type, indicating that this document is a 2005 W4 form. */ - class Type - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class Type @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. @@ -592,7 +576,7 @@ private constructor( /** An enum containing [Type]'s known values. */ enum class Known { - W4_2005, + 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 91bf811e..980f4078 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 @@ -134,13 +134,7 @@ private constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): W42020 = - W42020( - data, - type, - year, - additionalProperties.toImmutable(), - ) + fun build(): W42020 = W42020(data, type, year, additionalProperties.toImmutable()) } /** Detailed information specific to the 2020 W4 form. */ @@ -481,11 +475,8 @@ private constructor( } /** The individual's filing status for tax purposes. */ - class FilingStatus - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class FilingStatus @JsonCreator private constructor(private val value: JsonField) : + Enum { /** * Returns this class instance's raw value. @@ -606,11 +597,7 @@ private constructor( } /** Specifies the form type, indicating that this document is a 2020 W4 form. */ - class Type - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { + class Type @JsonCreator private constructor(private val value: JsonField) : Enum { /** * Returns this class instance's raw value. @@ -631,7 +618,7 @@ private constructor( /** An enum containing [Type]'s known values. */ enum class Known { - W4_2020, + 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 57c76c37..fd604b72 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 @@ -274,7 +274,7 @@ private constructor( override fun serialize( value: WebhookEvent, generator: JsonGenerator, - provider: SerializerProvider + provider: SerializerProvider, ) { when { value.accountUpdate != null -> generator.writeObject(value.accountUpdate) diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/AccessTokenServiceAsync.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/AccessTokenServiceAsync.kt index a335874c..42797f29 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/AccessTokenServiceAsync.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/AccessTokenServiceAsync.kt @@ -15,6 +15,6 @@ interface AccessTokenServiceAsync { @JvmOverloads fun create( params: AccessTokenCreateParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture } 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 16392293..3a5a40a0 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,10 +18,8 @@ import com.tryfinch.api.models.AccessTokenCreateParams import com.tryfinch.api.models.CreateAccessTokenResponse import java.util.concurrent.CompletableFuture -class AccessTokenServiceAsyncImpl -internal constructor( - private val clientOptions: ClientOptions, -) : AccessTokenServiceAsync { +class AccessTokenServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : + AccessTokenServiceAsync { private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) @@ -32,7 +30,7 @@ internal constructor( /** Exchange the authorization code for an access token */ override fun create( params: AccessTokenCreateParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture { val builder = params.toBuilder() diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/AccountServiceAsync.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/AccountServiceAsync.kt index 1759239f..b602490d 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/AccountServiceAsync.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/AccountServiceAsync.kt @@ -17,13 +17,13 @@ interface AccountServiceAsync { @JvmOverloads fun disconnect( params: AccountDisconnectParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture /** Read account information associated with an `access_token` */ @JvmOverloads fun introspect( params: AccountIntrospectParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture } 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 12fb92bd..218b9c5d 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,10 +19,8 @@ import com.tryfinch.api.models.DisconnectResponse import com.tryfinch.api.models.Introspection import java.util.concurrent.CompletableFuture -class AccountServiceAsyncImpl -internal constructor( - private val clientOptions: ClientOptions, -) : AccountServiceAsync { +class AccountServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : + AccountServiceAsync { private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) @@ -32,7 +30,7 @@ internal constructor( /** Disconnect one or more `access_token`s from your application. */ override fun disconnect( params: AccountDisconnectParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture { val request = HttpRequest.builder() @@ -60,7 +58,7 @@ internal constructor( /** Read account information associated with an `access_token` */ override fun introspect( params: AccountIntrospectParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture { val request = HttpRequest.builder() 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 f86fb285..a019a5c1 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 @@ -6,10 +6,8 @@ import com.tryfinch.api.core.ClientOptions import com.tryfinch.api.services.async.connect.SessionServiceAsync import com.tryfinch.api.services.async.connect.SessionServiceAsyncImpl -class ConnectServiceAsyncImpl -internal constructor( - private val clientOptions: ClientOptions, -) : ConnectServiceAsync { +class ConnectServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : + ConnectServiceAsync { private val sessions: SessionServiceAsync by lazy { SessionServiceAsyncImpl(clientOptions) } 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 d39d2925..913a435f 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 @@ -20,10 +20,8 @@ import com.tryfinch.api.services.async.hris.PayStatementServiceAsyncImpl import com.tryfinch.api.services.async.hris.PaymentServiceAsync import com.tryfinch.api.services.async.hris.PaymentServiceAsyncImpl -class HrisServiceAsyncImpl -internal constructor( - private val clientOptions: ClientOptions, -) : HrisServiceAsync { +class HrisServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : + HrisServiceAsync { private val company: CompanyServiceAsync by lazy { CompanyServiceAsyncImpl(clientOptions) } 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 a8a0006f..264fb526 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 @@ -8,10 +8,8 @@ import com.tryfinch.api.services.async.jobs.AutomatedServiceAsyncImpl import com.tryfinch.api.services.async.jobs.ManualServiceAsync import com.tryfinch.api.services.async.jobs.ManualServiceAsyncImpl -class JobServiceAsyncImpl -internal constructor( - private val clientOptions: ClientOptions, -) : JobServiceAsync { +class JobServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : + JobServiceAsync { private val automated: AutomatedServiceAsync by lazy { AutomatedServiceAsyncImpl(clientOptions) 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 6431023a..a856537b 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 @@ -6,10 +6,8 @@ import com.tryfinch.api.core.ClientOptions import com.tryfinch.api.services.async.payroll.PayGroupServiceAsync import com.tryfinch.api.services.async.payroll.PayGroupServiceAsyncImpl -class PayrollServiceAsyncImpl -internal constructor( - private val clientOptions: ClientOptions, -) : PayrollServiceAsync { +class PayrollServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : + PayrollServiceAsync { private val payGroups: PayGroupServiceAsync by lazy { PayGroupServiceAsyncImpl(clientOptions) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/ProviderServiceAsync.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/ProviderServiceAsync.kt index a0c9d904..7fe3883c 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/ProviderServiceAsync.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/ProviderServiceAsync.kt @@ -15,6 +15,6 @@ interface ProviderServiceAsync { @JvmOverloads fun list( params: ProviderListParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture } 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 ace4182b..08227c2a 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,10 +17,8 @@ import com.tryfinch.api.models.ProviderListPageAsync import com.tryfinch.api.models.ProviderListParams import java.util.concurrent.CompletableFuture -class ProviderServiceAsyncImpl -internal constructor( - private val clientOptions: ClientOptions, -) : ProviderServiceAsync { +class ProviderServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : + ProviderServiceAsync { private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) @@ -30,7 +28,7 @@ internal constructor( /** Return details on all available payroll and HR systems. */ override fun list( params: ProviderListParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture { val request = HttpRequest.builder() @@ -52,7 +50,7 @@ internal constructor( ProviderListPageAsync.of( this, params, - ProviderListPageAsync.Response.builder().items(it).build() + ProviderListPageAsync.Response.builder().items(it).build(), ) } } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/RequestForwardingServiceAsync.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/RequestForwardingServiceAsync.kt index 074159d0..824ada2d 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/RequestForwardingServiceAsync.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/RequestForwardingServiceAsync.kt @@ -19,6 +19,6 @@ interface RequestForwardingServiceAsync { @JvmOverloads fun forward( params: RequestForwardingForwardParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture } 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 70742b77..bcc50f5c 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 @@ -18,9 +18,7 @@ import com.tryfinch.api.models.RequestForwardingForwardResponse import java.util.concurrent.CompletableFuture class RequestForwardingServiceAsyncImpl -internal constructor( - private val clientOptions: ClientOptions, -) : RequestForwardingServiceAsync { +internal constructor(private val clientOptions: ClientOptions) : RequestForwardingServiceAsync { private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) @@ -35,7 +33,7 @@ internal constructor( */ override fun forward( params: RequestForwardingForwardParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture { val request = HttpRequest.builder() 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 1557fa1a..d68cb53a 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 @@ -18,10 +18,8 @@ import com.tryfinch.api.services.async.sandbox.JobServiceAsyncImpl import com.tryfinch.api.services.async.sandbox.PaymentServiceAsync import com.tryfinch.api.services.async.sandbox.PaymentServiceAsyncImpl -class SandboxServiceAsyncImpl -internal constructor( - private val clientOptions: ClientOptions, -) : SandboxServiceAsync { +class SandboxServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : + SandboxServiceAsync { private val connections: ConnectionServiceAsync by lazy { ConnectionServiceAsyncImpl(clientOptions) diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/connect/SessionServiceAsync.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/connect/SessionServiceAsync.kt index 26af3b52..e79109d7 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/connect/SessionServiceAsync.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/connect/SessionServiceAsync.kt @@ -17,13 +17,13 @@ interface SessionServiceAsync { @JvmOverloads fun new_( params: ConnectSessionNewParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture /** Create a new Connect session for reauthenticating an existing connection */ @JvmOverloads fun reauthenticate( params: ConnectSessionReauthenticateParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture } 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 b2d06dbc..385c1cb5 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,10 +19,8 @@ import com.tryfinch.api.models.SessionNewResponse import com.tryfinch.api.models.SessionReauthenticateResponse import java.util.concurrent.CompletableFuture -class SessionServiceAsyncImpl -internal constructor( - private val clientOptions: ClientOptions, -) : SessionServiceAsync { +class SessionServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : + SessionServiceAsync { private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) @@ -32,7 +30,7 @@ internal constructor( /** Create a new connect session for an employer */ override fun new_( params: ConnectSessionNewParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture { val request = HttpRequest.builder() @@ -61,7 +59,7 @@ internal constructor( /** Create a new Connect session for reauthenticating an existing connection */ override fun reauthenticate( params: ConnectSessionReauthenticateParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture { val request = HttpRequest.builder() diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/BenefitServiceAsync.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/BenefitServiceAsync.kt index 0805aad8..6f547577 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/BenefitServiceAsync.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/BenefitServiceAsync.kt @@ -29,34 +29,34 @@ interface BenefitServiceAsync { @JvmOverloads fun create( params: HrisBenefitCreateParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture /** Lists deductions and contributions information for a given item */ @JvmOverloads fun retrieve( params: HrisBenefitRetrieveParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture /** Updates an existing company-wide deduction or contribution */ @JvmOverloads fun update( params: HrisBenefitUpdateParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture /** List all company-wide deductions and contributions. */ @JvmOverloads fun list( params: HrisBenefitListParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture /** Get deductions metadata */ @JvmOverloads fun listSupportedBenefits( params: HrisBenefitListSupportedBenefitsParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture } 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 cf6c3816..88f2f69f 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,10 +28,8 @@ import com.tryfinch.api.services.async.hris.benefits.IndividualServiceAsync import com.tryfinch.api.services.async.hris.benefits.IndividualServiceAsyncImpl import java.util.concurrent.CompletableFuture -class BenefitServiceAsyncImpl -internal constructor( - private val clientOptions: ClientOptions, -) : BenefitServiceAsync { +class BenefitServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : + BenefitServiceAsync { private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) @@ -51,7 +49,7 @@ internal constructor( */ override fun create( params: HrisBenefitCreateParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture { val request = HttpRequest.builder() @@ -79,7 +77,7 @@ internal constructor( /** Lists deductions and contributions information for a given item */ override fun retrieve( params: HrisBenefitRetrieveParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture { val request = HttpRequest.builder() @@ -107,7 +105,7 @@ internal constructor( /** Updates an existing company-wide deduction or contribution */ override fun update( params: HrisBenefitUpdateParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture { val request = HttpRequest.builder() @@ -135,7 +133,7 @@ internal constructor( /** List all company-wide deductions and contributions. */ override fun list( params: HrisBenefitListParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture { val request = HttpRequest.builder() @@ -157,7 +155,7 @@ internal constructor( HrisBenefitListPageAsync.of( this, params, - HrisBenefitListPageAsync.Response.builder().items(it).build() + HrisBenefitListPageAsync.Response.builder().items(it).build(), ) } } @@ -169,7 +167,7 @@ internal constructor( /** Get deductions metadata */ override fun listSupportedBenefits( params: HrisBenefitListSupportedBenefitsParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture { val request = HttpRequest.builder() @@ -193,7 +191,7 @@ internal constructor( params, HrisBenefitListSupportedBenefitsPageAsync.Response.builder() .items(it) - .build() + .build(), ) } } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/CompanyServiceAsync.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/CompanyServiceAsync.kt index 339bf081..250bddee 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/CompanyServiceAsync.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/CompanyServiceAsync.kt @@ -15,6 +15,6 @@ interface CompanyServiceAsync { @JvmOverloads fun retrieve( params: HrisCompanyRetrieveParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture } 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 fe766f4a..36830f68 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,10 +16,8 @@ import com.tryfinch.api.models.Company import com.tryfinch.api.models.HrisCompanyRetrieveParams import java.util.concurrent.CompletableFuture -class CompanyServiceAsyncImpl -internal constructor( - private val clientOptions: ClientOptions, -) : CompanyServiceAsync { +class CompanyServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : + CompanyServiceAsync { private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) @@ -29,7 +27,7 @@ internal constructor( /** Read basic company data */ override fun retrieve( params: HrisCompanyRetrieveParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture { val request = HttpRequest.builder() 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 6c42d153..e0afdd7f 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 @@ -17,7 +17,7 @@ interface DirectoryServiceAsync { @JvmOverloads fun list( params: HrisDirectoryListParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture /** Read company directory and organization structure */ @@ -25,6 +25,6 @@ interface DirectoryServiceAsync { @JvmOverloads fun listIndividuals( params: HrisDirectoryListIndividualsParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture } 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 2c864b2b..00b8c0bb 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,10 +18,8 @@ import com.tryfinch.api.models.HrisDirectoryListPageAsync import com.tryfinch.api.models.HrisDirectoryListParams import java.util.concurrent.CompletableFuture -class DirectoryServiceAsyncImpl -internal constructor( - private val clientOptions: ClientOptions, -) : DirectoryServiceAsync { +class DirectoryServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : + DirectoryServiceAsync { private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) @@ -32,7 +30,7 @@ internal constructor( /** Read company directory and organization structure */ override fun list( params: HrisDirectoryListParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture { val request = HttpRequest.builder() @@ -62,7 +60,7 @@ internal constructor( @Deprecated("use `list` instead") override fun listIndividuals( params: HrisDirectoryListIndividualsParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture { val request = HttpRequest.builder() diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/DocumentServiceAsync.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/DocumentServiceAsync.kt index 182bca7f..80833114 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/DocumentServiceAsync.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/DocumentServiceAsync.kt @@ -19,7 +19,7 @@ interface DocumentServiceAsync { @JvmOverloads fun list( params: HrisDocumentListParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture /** @@ -29,6 +29,6 @@ interface DocumentServiceAsync { @JvmOverloads fun retreive( params: HrisDocumentRetreiveParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture } 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 ee9d305e..a3faa516 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,10 +18,8 @@ import com.tryfinch.api.models.HrisDocumentListParams import com.tryfinch.api.models.HrisDocumentRetreiveParams import java.util.concurrent.CompletableFuture -class DocumentServiceAsyncImpl -internal constructor( - private val clientOptions: ClientOptions, -) : DocumentServiceAsync { +class DocumentServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : + DocumentServiceAsync { private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) @@ -33,7 +31,7 @@ internal constructor( */ override fun list( params: HrisDocumentListParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture { val request = HttpRequest.builder() @@ -64,7 +62,7 @@ internal constructor( */ override fun retreive( params: HrisDocumentRetreiveParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture { val request = HttpRequest.builder() diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/EmploymentServiceAsync.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/EmploymentServiceAsync.kt index 07dd2ccd..d12c27bc 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/EmploymentServiceAsync.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/EmploymentServiceAsync.kt @@ -15,6 +15,6 @@ interface EmploymentServiceAsync { @JvmOverloads fun retrieveMany( params: HrisEmploymentRetrieveManyParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture } 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 4641c6dc..07a11f84 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,10 +17,8 @@ import com.tryfinch.api.models.HrisEmploymentRetrieveManyPageAsync import com.tryfinch.api.models.HrisEmploymentRetrieveManyParams import java.util.concurrent.CompletableFuture -class EmploymentServiceAsyncImpl -internal constructor( - private val clientOptions: ClientOptions, -) : EmploymentServiceAsync { +class EmploymentServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : + EmploymentServiceAsync { private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) @@ -31,7 +29,7 @@ internal constructor( /** Read individual employment and income data */ override fun retrieveMany( params: HrisEmploymentRetrieveManyParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture { val request = HttpRequest.builder() diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/IndividualServiceAsync.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/IndividualServiceAsync.kt index 899ae063..c888eba6 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/IndividualServiceAsync.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/IndividualServiceAsync.kt @@ -15,6 +15,6 @@ interface IndividualServiceAsync { @JvmOverloads fun retrieveMany( params: HrisIndividualRetrieveManyParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture } 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 8ee3f4d5..a901d00d 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,10 +17,8 @@ import com.tryfinch.api.models.HrisIndividualRetrieveManyPageAsync import com.tryfinch.api.models.HrisIndividualRetrieveManyParams import java.util.concurrent.CompletableFuture -class IndividualServiceAsyncImpl -internal constructor( - private val clientOptions: ClientOptions, -) : IndividualServiceAsync { +class IndividualServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : + IndividualServiceAsync { private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) @@ -31,7 +29,7 @@ internal constructor( /** Read individual data, excluding income and employment data */ override fun retrieveMany( params: HrisIndividualRetrieveManyParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture { val request = HttpRequest.builder() diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/PayStatementServiceAsync.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/PayStatementServiceAsync.kt index 00bf54fb..6cb4e5d8 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/PayStatementServiceAsync.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/PayStatementServiceAsync.kt @@ -19,6 +19,6 @@ interface PayStatementServiceAsync { @JvmOverloads fun retrieveMany( params: HrisPayStatementRetrieveManyParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture } 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 92a73112..5b5ac320 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,10 +17,8 @@ import com.tryfinch.api.models.HrisPayStatementRetrieveManyPageAsync import com.tryfinch.api.models.HrisPayStatementRetrieveManyParams import java.util.concurrent.CompletableFuture -class PayStatementServiceAsyncImpl -internal constructor( - private val clientOptions: ClientOptions, -) : PayStatementServiceAsync { +class PayStatementServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : + PayStatementServiceAsync { private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) @@ -35,7 +33,7 @@ internal constructor( */ override fun retrieveMany( params: HrisPayStatementRetrieveManyParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture { val request = HttpRequest.builder() diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/PaymentServiceAsync.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/PaymentServiceAsync.kt index d734128c..98dee989 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/PaymentServiceAsync.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/PaymentServiceAsync.kt @@ -15,6 +15,6 @@ interface PaymentServiceAsync { @JvmOverloads fun list( params: HrisPaymentListParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture } 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 d78ed34b..db387453 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,10 +17,8 @@ import com.tryfinch.api.models.HrisPaymentListParams import com.tryfinch.api.models.Payment import java.util.concurrent.CompletableFuture -class PaymentServiceAsyncImpl -internal constructor( - private val clientOptions: ClientOptions, -) : PaymentServiceAsync { +class PaymentServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : + PaymentServiceAsync { private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) @@ -30,7 +28,7 @@ internal constructor( /** Read payroll and contractor related payments by the company. */ override fun list( params: HrisPaymentListParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture { val request = HttpRequest.builder() @@ -52,7 +50,7 @@ internal constructor( HrisPaymentListPageAsync.of( this, params, - HrisPaymentListPageAsync.Response.builder().items(it).build() + HrisPaymentListPageAsync.Response.builder().items(it).build(), ) } } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/benefits/IndividualServiceAsync.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/benefits/IndividualServiceAsync.kt index 84a4f2d3..62575fe9 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/benefits/IndividualServiceAsync.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/hris/benefits/IndividualServiceAsync.kt @@ -19,20 +19,20 @@ interface IndividualServiceAsync { @JvmOverloads fun enrolledIds( params: HrisBenefitIndividualEnrolledIdsParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture /** Get enrollment information for the given individuals. */ @JvmOverloads fun retrieveManyBenefits( params: HrisBenefitIndividualRetrieveManyBenefitsParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture /** Unenroll individuals from a deduction or contribution */ @JvmOverloads fun unenrollMany( params: HrisBenefitIndividualUnenrollManyParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture } 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 b60550b9..db7f5262 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,10 +23,8 @@ import com.tryfinch.api.models.IndividualEnrolledIdsResponse import com.tryfinch.api.models.UnenrolledIndividual import java.util.concurrent.CompletableFuture -class IndividualServiceAsyncImpl -internal constructor( - private val clientOptions: ClientOptions, -) : IndividualServiceAsync { +class IndividualServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : + IndividualServiceAsync { private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) @@ -37,7 +35,7 @@ internal constructor( /** Lists individuals currently enrolled in a given deduction. */ override fun enrolledIds( params: HrisBenefitIndividualEnrolledIdsParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture { val request = HttpRequest.builder() @@ -65,7 +63,7 @@ internal constructor( /** Get enrollment information for the given individuals. */ override fun retrieveManyBenefits( params: HrisBenefitIndividualRetrieveManyBenefitsParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture { val request = HttpRequest.builder() @@ -89,7 +87,7 @@ internal constructor( params, HrisBenefitIndividualRetrieveManyBenefitsPageAsync.Response.builder() .items(it) - .build() + .build(), ) } } @@ -102,7 +100,7 @@ internal constructor( /** Unenroll individuals from a deduction or contribution */ override fun unenrollMany( params: HrisBenefitIndividualUnenrollManyParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture { val request = HttpRequest.builder() @@ -127,7 +125,7 @@ internal constructor( params, HrisBenefitIndividualUnenrollManyPageAsync.Response.builder() .items(it) - .build() + .build(), ) } } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/jobs/AutomatedServiceAsync.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/jobs/AutomatedServiceAsync.kt index 4489016e..aecaf07b 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/jobs/AutomatedServiceAsync.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/jobs/AutomatedServiceAsync.kt @@ -33,14 +33,14 @@ interface AutomatedServiceAsync { @JvmOverloads fun create( params: JobAutomatedCreateParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture /** Get an automated job by `job_id`. */ @JvmOverloads fun retrieve( params: JobAutomatedRetrieveParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture /** @@ -51,6 +51,6 @@ interface AutomatedServiceAsync { @JvmOverloads fun list( params: JobAutomatedListParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture } 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 b40330e6..934af1b6 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,10 +21,8 @@ import com.tryfinch.api.models.JobAutomatedListParams import com.tryfinch.api.models.JobAutomatedRetrieveParams import java.util.concurrent.CompletableFuture -class AutomatedServiceAsyncImpl -internal constructor( - private val clientOptions: ClientOptions, -) : AutomatedServiceAsync { +class AutomatedServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : + AutomatedServiceAsync { private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) @@ -49,7 +47,7 @@ internal constructor( */ override fun create( params: JobAutomatedCreateParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture { val request = HttpRequest.builder() @@ -77,7 +75,7 @@ internal constructor( /** Get an automated job by `job_id`. */ override fun retrieve( params: JobAutomatedRetrieveParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture { val request = HttpRequest.builder() @@ -109,7 +107,7 @@ internal constructor( */ override fun list( params: JobAutomatedListParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture { val request = HttpRequest.builder() diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/jobs/ManualServiceAsync.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/jobs/ManualServiceAsync.kt index 4de2be8c..b3b9e674 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/jobs/ManualServiceAsync.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/jobs/ManualServiceAsync.kt @@ -18,6 +18,6 @@ interface ManualServiceAsync { @JvmOverloads fun retrieve( params: JobManualRetrieveParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture } 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 bc85ac72..4b05c57a 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,10 +16,8 @@ import com.tryfinch.api.models.JobManualRetrieveParams import com.tryfinch.api.models.ManualAsyncJob import java.util.concurrent.CompletableFuture -class ManualServiceAsyncImpl -internal constructor( - private val clientOptions: ClientOptions, -) : ManualServiceAsync { +class ManualServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : + ManualServiceAsync { private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) @@ -32,7 +30,7 @@ internal constructor( */ override fun retrieve( params: JobManualRetrieveParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture { val request = HttpRequest.builder() diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/payroll/PayGroupServiceAsync.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/payroll/PayGroupServiceAsync.kt index 4761934d..92ee6590 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/payroll/PayGroupServiceAsync.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/payroll/PayGroupServiceAsync.kt @@ -17,13 +17,13 @@ interface PayGroupServiceAsync { @JvmOverloads fun retrieve( params: PayrollPayGroupRetrieveParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture /** Read company pay groups and frequencies */ @JvmOverloads fun list( params: PayrollPayGroupListParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture } 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 a62ed715..c9fa6c1a 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,10 +19,8 @@ import com.tryfinch.api.models.PayrollPayGroupListParams import com.tryfinch.api.models.PayrollPayGroupRetrieveParams import java.util.concurrent.CompletableFuture -class PayGroupServiceAsyncImpl -internal constructor( - private val clientOptions: ClientOptions, -) : PayGroupServiceAsync { +class PayGroupServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : + PayGroupServiceAsync { private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) @@ -33,7 +31,7 @@ internal constructor( /** Read information from a single pay group */ override fun retrieve( params: PayrollPayGroupRetrieveParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture { val request = HttpRequest.builder() @@ -61,7 +59,7 @@ internal constructor( /** Read company pay groups and frequencies */ override fun list( params: PayrollPayGroupListParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture { val request = HttpRequest.builder() @@ -83,7 +81,7 @@ internal constructor( PayrollPayGroupListPageAsync.of( this, params, - PayrollPayGroupListPageAsync.Response.builder().items(it).build() + PayrollPayGroupListPageAsync.Response.builder().items(it).build(), ) } } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/CompanyServiceAsync.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/CompanyServiceAsync.kt index 8565c002..09dc9208 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/CompanyServiceAsync.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/CompanyServiceAsync.kt @@ -15,6 +15,6 @@ interface CompanyServiceAsync { @JvmOverloads fun update( params: SandboxCompanyUpdateParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture } 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 f3a188cf..4ca29904 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,10 +17,8 @@ import com.tryfinch.api.models.CompanyUpdateResponse import com.tryfinch.api.models.SandboxCompanyUpdateParams import java.util.concurrent.CompletableFuture -class CompanyServiceAsyncImpl -internal constructor( - private val clientOptions: ClientOptions, -) : CompanyServiceAsync { +class CompanyServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : + CompanyServiceAsync { private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) @@ -30,7 +28,7 @@ internal constructor( /** Update a sandbox company's data */ override fun update( params: SandboxCompanyUpdateParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture { val request = HttpRequest.builder() diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/ConnectionServiceAsync.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/ConnectionServiceAsync.kt index cd3a9715..02284513 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/ConnectionServiceAsync.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/ConnectionServiceAsync.kt @@ -18,6 +18,6 @@ interface ConnectionServiceAsync { @JvmOverloads fun create( params: SandboxConnectionCreateParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture } 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 f3fbb40c..aecc772e 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,10 +19,8 @@ import com.tryfinch.api.services.async.sandbox.connections.AccountServiceAsync import com.tryfinch.api.services.async.sandbox.connections.AccountServiceAsyncImpl import java.util.concurrent.CompletableFuture -class ConnectionServiceAsyncImpl -internal constructor( - private val clientOptions: ClientOptions, -) : ConnectionServiceAsync { +class ConnectionServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : + ConnectionServiceAsync { private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) @@ -37,7 +35,7 @@ internal constructor( /** Create a new connection (new company/provider pair) with a new account */ override fun create( params: SandboxConnectionCreateParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture { val request = HttpRequest.builder() diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/DirectoryServiceAsync.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/DirectoryServiceAsync.kt index 20741d7c..7802b965 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/DirectoryServiceAsync.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/DirectoryServiceAsync.kt @@ -15,6 +15,6 @@ interface DirectoryServiceAsync { @JvmOverloads fun create( params: SandboxDirectoryCreateParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture> } 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 a85a58fc..43178f1f 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,10 +17,8 @@ import com.tryfinch.api.errors.FinchError import com.tryfinch.api.models.SandboxDirectoryCreateParams import java.util.concurrent.CompletableFuture -class DirectoryServiceAsyncImpl -internal constructor( - private val clientOptions: ClientOptions, -) : DirectoryServiceAsync { +class DirectoryServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : + DirectoryServiceAsync { private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) @@ -30,7 +28,7 @@ internal constructor( /** Add new individuals to a sandbox company */ override fun create( params: SandboxDirectoryCreateParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture> { val request = HttpRequest.builder() diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/EmploymentServiceAsync.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/EmploymentServiceAsync.kt index 4c8888aa..00219b33 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/EmploymentServiceAsync.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/EmploymentServiceAsync.kt @@ -15,6 +15,6 @@ interface EmploymentServiceAsync { @JvmOverloads fun update( params: SandboxEmploymentUpdateParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture } 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 aa2c9d0b..11baffe9 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,10 +17,8 @@ import com.tryfinch.api.models.EmploymentUpdateResponse import com.tryfinch.api.models.SandboxEmploymentUpdateParams import java.util.concurrent.CompletableFuture -class EmploymentServiceAsyncImpl -internal constructor( - private val clientOptions: ClientOptions, -) : EmploymentServiceAsync { +class EmploymentServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : + EmploymentServiceAsync { private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) @@ -31,7 +29,7 @@ internal constructor( /** Update sandbox employment */ override fun update( params: SandboxEmploymentUpdateParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture { val request = HttpRequest.builder() diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/IndividualServiceAsync.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/IndividualServiceAsync.kt index eead5ee1..81695b1c 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/IndividualServiceAsync.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/IndividualServiceAsync.kt @@ -15,6 +15,6 @@ interface IndividualServiceAsync { @JvmOverloads fun update( params: SandboxIndividualUpdateParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture } 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 f01dc64f..d194f2c1 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,10 +17,8 @@ import com.tryfinch.api.models.IndividualUpdateResponse import com.tryfinch.api.models.SandboxIndividualUpdateParams import java.util.concurrent.CompletableFuture -class IndividualServiceAsyncImpl -internal constructor( - private val clientOptions: ClientOptions, -) : IndividualServiceAsync { +class IndividualServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : + IndividualServiceAsync { private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) @@ -31,7 +29,7 @@ internal constructor( /** Update sandbox individual */ override fun update( params: SandboxIndividualUpdateParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture { val request = HttpRequest.builder() diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/JobServiceAsync.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/JobServiceAsync.kt index 40b1d48c..56612e5b 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/JobServiceAsync.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/JobServiceAsync.kt @@ -18,6 +18,6 @@ interface JobServiceAsync { @JvmOverloads fun create( params: SandboxJobCreateParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture } 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 ec086214..ae344f6c 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,10 +19,8 @@ import com.tryfinch.api.services.async.sandbox.jobs.ConfigurationServiceAsync import com.tryfinch.api.services.async.sandbox.jobs.ConfigurationServiceAsyncImpl import java.util.concurrent.CompletableFuture -class JobServiceAsyncImpl -internal constructor( - private val clientOptions: ClientOptions, -) : JobServiceAsync { +class JobServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : + JobServiceAsync { private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) @@ -38,7 +36,7 @@ internal constructor( /** Enqueue a new sandbox job */ override fun create( params: SandboxJobCreateParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture { val request = HttpRequest.builder() diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/PaymentServiceAsync.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/PaymentServiceAsync.kt index 0cd953ff..00f99f4c 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/PaymentServiceAsync.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/PaymentServiceAsync.kt @@ -15,6 +15,6 @@ interface PaymentServiceAsync { @JvmOverloads fun create( params: SandboxPaymentCreateParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture } 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 6aa24d29..13b829d5 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,10 +17,8 @@ import com.tryfinch.api.models.PaymentCreateResponse import com.tryfinch.api.models.SandboxPaymentCreateParams import java.util.concurrent.CompletableFuture -class PaymentServiceAsyncImpl -internal constructor( - private val clientOptions: ClientOptions, -) : PaymentServiceAsync { +class PaymentServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : + PaymentServiceAsync { private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) @@ -30,7 +28,7 @@ internal constructor( /** Add a new sandbox payment */ override fun create( params: SandboxPaymentCreateParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture { val request = HttpRequest.builder() diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/connections/AccountServiceAsync.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/connections/AccountServiceAsync.kt index 40a4fb8a..9b1de597 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/connections/AccountServiceAsync.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/connections/AccountServiceAsync.kt @@ -17,7 +17,7 @@ interface AccountServiceAsync { @JvmOverloads fun create( params: SandboxConnectionAccountCreateParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture /** @@ -27,6 +27,6 @@ interface AccountServiceAsync { @JvmOverloads fun update( params: SandboxConnectionAccountUpdateParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture } 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 acaf2640..b84f6266 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,10 +19,8 @@ import com.tryfinch.api.models.SandboxConnectionAccountCreateParams import com.tryfinch.api.models.SandboxConnectionAccountUpdateParams import java.util.concurrent.CompletableFuture -class AccountServiceAsyncImpl -internal constructor( - private val clientOptions: ClientOptions, -) : AccountServiceAsync { +class AccountServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : + AccountServiceAsync { private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) @@ -32,7 +30,7 @@ internal constructor( /** Create a new account for an existing connection (company/provider pair) */ override fun create( params: SandboxConnectionAccountCreateParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture { val request = HttpRequest.builder() @@ -63,7 +61,7 @@ internal constructor( */ override fun update( params: SandboxConnectionAccountUpdateParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture { val request = HttpRequest.builder() diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/jobs/ConfigurationServiceAsync.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/jobs/ConfigurationServiceAsync.kt index ba1dbde7..e9fa09f4 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/jobs/ConfigurationServiceAsync.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/sandbox/jobs/ConfigurationServiceAsync.kt @@ -16,13 +16,13 @@ interface ConfigurationServiceAsync { @JvmOverloads fun retrieve( params: SandboxJobConfigurationRetrieveParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture> /** Update configurations for sandbox jobs */ @JvmOverloads fun update( params: SandboxJobConfigurationUpdateParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture } 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 3929d315..b3ebe7aa 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,10 +18,8 @@ import com.tryfinch.api.models.SandboxJobConfigurationRetrieveParams import com.tryfinch.api.models.SandboxJobConfigurationUpdateParams import java.util.concurrent.CompletableFuture -class ConfigurationServiceAsyncImpl -internal constructor( - private val clientOptions: ClientOptions, -) : ConfigurationServiceAsync { +class ConfigurationServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : + ConfigurationServiceAsync { private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) @@ -32,7 +30,7 @@ internal constructor( /** Get configurations for sandbox jobs */ override fun retrieve( params: SandboxJobConfigurationRetrieveParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture> { val request = HttpRequest.builder() @@ -60,7 +58,7 @@ internal constructor( /** Update configurations for sandbox jobs */ override fun update( params: SandboxJobConfigurationUpdateParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture { val request = HttpRequest.builder() diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/AccessTokenService.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/AccessTokenService.kt index ad4b8e53..5eb189ed 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/AccessTokenService.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/AccessTokenService.kt @@ -14,6 +14,6 @@ interface AccessTokenService { @JvmOverloads fun create( params: AccessTokenCreateParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CreateAccessTokenResponse } 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 00fb601b..d1bab69e 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,10 +17,8 @@ import com.tryfinch.api.errors.FinchException import com.tryfinch.api.models.AccessTokenCreateParams import com.tryfinch.api.models.CreateAccessTokenResponse -class AccessTokenServiceImpl -internal constructor( - private val clientOptions: ClientOptions, -) : AccessTokenService { +class AccessTokenServiceImpl internal constructor(private val clientOptions: ClientOptions) : + AccessTokenService { private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) @@ -31,7 +29,7 @@ internal constructor( /** Exchange the authorization code for an access token */ override fun create( params: AccessTokenCreateParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CreateAccessTokenResponse { val builder = params.toBuilder() diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/AccountService.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/AccountService.kt index 917a0827..5cc0334d 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/AccountService.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/AccountService.kt @@ -16,13 +16,13 @@ interface AccountService { @JvmOverloads fun disconnect( params: AccountDisconnectParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): DisconnectResponse /** Read account information associated with an `access_token` */ @JvmOverloads fun introspect( params: AccountIntrospectParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): Introspection } 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 a636d599..45a7f120 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,10 +18,8 @@ import com.tryfinch.api.models.AccountIntrospectParams import com.tryfinch.api.models.DisconnectResponse import com.tryfinch.api.models.Introspection -class AccountServiceImpl -internal constructor( - private val clientOptions: ClientOptions, -) : AccountService { +class AccountServiceImpl internal constructor(private val clientOptions: ClientOptions) : + AccountService { private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) @@ -31,7 +29,7 @@ internal constructor( /** Disconnect one or more `access_token`s from your application. */ override fun disconnect( params: AccountDisconnectParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): DisconnectResponse { val request = HttpRequest.builder() @@ -56,7 +54,7 @@ internal constructor( /** Read account information associated with an `access_token` */ override fun introspect( params: AccountIntrospectParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): Introspection { val request = HttpRequest.builder() 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 33ad8280..52c64ab3 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 @@ -6,10 +6,8 @@ import com.tryfinch.api.core.ClientOptions import com.tryfinch.api.services.blocking.connect.SessionService import com.tryfinch.api.services.blocking.connect.SessionServiceImpl -class ConnectServiceImpl -internal constructor( - private val clientOptions: ClientOptions, -) : ConnectService { +class ConnectServiceImpl internal constructor(private val clientOptions: ClientOptions) : + ConnectService { private val sessions: SessionService by lazy { SessionServiceImpl(clientOptions) } 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 7815bd7c..78b7de0a 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 @@ -20,10 +20,7 @@ import com.tryfinch.api.services.blocking.hris.PayStatementServiceImpl import com.tryfinch.api.services.blocking.hris.PaymentService import com.tryfinch.api.services.blocking.hris.PaymentServiceImpl -class HrisServiceImpl -internal constructor( - private val clientOptions: ClientOptions, -) : HrisService { +class HrisServiceImpl internal constructor(private val clientOptions: ClientOptions) : HrisService { private val company: CompanyService by lazy { CompanyServiceImpl(clientOptions) } 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 e66f9efc..29bdd632 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 @@ -8,10 +8,7 @@ import com.tryfinch.api.services.blocking.jobs.AutomatedServiceImpl import com.tryfinch.api.services.blocking.jobs.ManualService import com.tryfinch.api.services.blocking.jobs.ManualServiceImpl -class JobServiceImpl -internal constructor( - private val clientOptions: ClientOptions, -) : JobService { +class JobServiceImpl internal constructor(private val clientOptions: ClientOptions) : JobService { private val automated: AutomatedService by lazy { AutomatedServiceImpl(clientOptions) } 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 574b007b..ca423f3d 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 @@ -6,10 +6,8 @@ import com.tryfinch.api.core.ClientOptions import com.tryfinch.api.services.blocking.payroll.PayGroupService import com.tryfinch.api.services.blocking.payroll.PayGroupServiceImpl -class PayrollServiceImpl -internal constructor( - private val clientOptions: ClientOptions, -) : PayrollService { +class PayrollServiceImpl internal constructor(private val clientOptions: ClientOptions) : + PayrollService { private val payGroups: PayGroupService by lazy { PayGroupServiceImpl(clientOptions) } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/ProviderService.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/ProviderService.kt index 5573b3a1..9c534a0d 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/ProviderService.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/ProviderService.kt @@ -14,6 +14,6 @@ interface ProviderService { @JvmOverloads fun list( params: ProviderListParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): ProviderListPage } 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 e27d7069..b74c1193 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,10 +16,8 @@ import com.tryfinch.api.models.Provider import com.tryfinch.api.models.ProviderListPage import com.tryfinch.api.models.ProviderListParams -class ProviderServiceImpl -internal constructor( - private val clientOptions: ClientOptions, -) : ProviderService { +class ProviderServiceImpl internal constructor(private val clientOptions: ClientOptions) : + ProviderService { private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) @@ -29,7 +27,7 @@ internal constructor( /** Return details on all available payroll and HR systems. */ override fun list( params: ProviderListParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): ProviderListPage { val request = HttpRequest.builder() @@ -49,7 +47,7 @@ internal constructor( ProviderListPage.of( this, params, - ProviderListPage.Response.builder().items(it).build() + ProviderListPage.Response.builder().items(it).build(), ) } } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/RequestForwardingService.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/RequestForwardingService.kt index db08ee9b..7bcd0174 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/RequestForwardingService.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/RequestForwardingService.kt @@ -18,6 +18,6 @@ interface RequestForwardingService { @JvmOverloads fun forward( params: RequestForwardingForwardParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): RequestForwardingForwardResponse } 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 7b041fc3..8121df1d 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,10 +16,8 @@ import com.tryfinch.api.errors.FinchError import com.tryfinch.api.models.RequestForwardingForwardParams import com.tryfinch.api.models.RequestForwardingForwardResponse -class RequestForwardingServiceImpl -internal constructor( - private val clientOptions: ClientOptions, -) : RequestForwardingService { +class RequestForwardingServiceImpl internal constructor(private val clientOptions: ClientOptions) : + RequestForwardingService { private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) @@ -34,7 +32,7 @@ internal constructor( */ override fun forward( params: RequestForwardingForwardParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): RequestForwardingForwardResponse { val request = HttpRequest.builder() 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 e93cb9d6..7eeca782 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 @@ -18,10 +18,8 @@ import com.tryfinch.api.services.blocking.sandbox.JobServiceImpl import com.tryfinch.api.services.blocking.sandbox.PaymentService import com.tryfinch.api.services.blocking.sandbox.PaymentServiceImpl -class SandboxServiceImpl -internal constructor( - private val clientOptions: ClientOptions, -) : SandboxService { +class SandboxServiceImpl internal constructor(private val clientOptions: ClientOptions) : + SandboxService { private val connections: ConnectionService by lazy { ConnectionServiceImpl(clientOptions) } 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 0330cb2e..b7698929 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 @@ -90,4 +90,4 @@ internal constructor( throw FinchException("None of the given webhook signatures match the expected signature") } -} +} \ No newline at end of file diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/connect/SessionService.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/connect/SessionService.kt index 7c2dcf4b..dc3e860f 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/connect/SessionService.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/connect/SessionService.kt @@ -16,13 +16,13 @@ interface SessionService { @JvmOverloads fun new_( params: ConnectSessionNewParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): SessionNewResponse /** Create a new Connect session for reauthenticating an existing connection */ @JvmOverloads fun reauthenticate( params: ConnectSessionReauthenticateParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): SessionReauthenticateResponse } 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 5bd2beaf..98ac5eb3 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,10 +18,8 @@ import com.tryfinch.api.models.ConnectSessionReauthenticateParams import com.tryfinch.api.models.SessionNewResponse import com.tryfinch.api.models.SessionReauthenticateResponse -class SessionServiceImpl -internal constructor( - private val clientOptions: ClientOptions, -) : SessionService { +class SessionServiceImpl internal constructor(private val clientOptions: ClientOptions) : + SessionService { private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) @@ -31,7 +29,7 @@ internal constructor( /** Create a new connect session for an employer */ override fun new_( params: ConnectSessionNewParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): SessionNewResponse { val request = HttpRequest.builder() @@ -57,7 +55,7 @@ internal constructor( /** Create a new Connect session for reauthenticating an existing connection */ override fun reauthenticate( params: ConnectSessionReauthenticateParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): SessionReauthenticateResponse { val request = HttpRequest.builder() diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/BenefitService.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/BenefitService.kt index 047a9412..1c6a96e2 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/BenefitService.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/BenefitService.kt @@ -28,34 +28,34 @@ interface BenefitService { @JvmOverloads fun create( params: HrisBenefitCreateParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CreateCompanyBenefitsResponse /** Lists deductions and contributions information for a given item */ @JvmOverloads fun retrieve( params: HrisBenefitRetrieveParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompanyBenefit /** Updates an existing company-wide deduction or contribution */ @JvmOverloads fun update( params: HrisBenefitUpdateParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): UpdateCompanyBenefitResponse /** List all company-wide deductions and contributions. */ @JvmOverloads fun list( params: HrisBenefitListParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): HrisBenefitListPage /** Get deductions metadata */ @JvmOverloads fun listSupportedBenefits( params: HrisBenefitListSupportedBenefitsParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): HrisBenefitListSupportedBenefitsPage } 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 2cd734de..212bc6bc 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,10 +27,8 @@ import com.tryfinch.api.models.UpdateCompanyBenefitResponse import com.tryfinch.api.services.blocking.hris.benefits.IndividualService import com.tryfinch.api.services.blocking.hris.benefits.IndividualServiceImpl -class BenefitServiceImpl -internal constructor( - private val clientOptions: ClientOptions, -) : BenefitService { +class BenefitServiceImpl internal constructor(private val clientOptions: ClientOptions) : + BenefitService { private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) @@ -48,7 +46,7 @@ internal constructor( */ override fun create( params: HrisBenefitCreateParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CreateCompanyBenefitsResponse { val request = HttpRequest.builder() @@ -73,7 +71,7 @@ internal constructor( /** Lists deductions and contributions information for a given item */ override fun retrieve( params: HrisBenefitRetrieveParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompanyBenefit { val request = HttpRequest.builder() @@ -98,7 +96,7 @@ internal constructor( /** Updates an existing company-wide deduction or contribution */ override fun update( params: HrisBenefitUpdateParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): UpdateCompanyBenefitResponse { val request = HttpRequest.builder() @@ -123,7 +121,7 @@ internal constructor( /** List all company-wide deductions and contributions. */ override fun list( params: HrisBenefitListParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): HrisBenefitListPage { val request = HttpRequest.builder() @@ -143,7 +141,7 @@ internal constructor( HrisBenefitListPage.of( this, params, - HrisBenefitListPage.Response.builder().items(it).build() + HrisBenefitListPage.Response.builder().items(it).build(), ) } } @@ -154,7 +152,7 @@ internal constructor( /** Get deductions metadata */ override fun listSupportedBenefits( params: HrisBenefitListSupportedBenefitsParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): HrisBenefitListSupportedBenefitsPage { val request = HttpRequest.builder() @@ -174,7 +172,7 @@ internal constructor( HrisBenefitListSupportedBenefitsPage.of( this, params, - HrisBenefitListSupportedBenefitsPage.Response.builder().items(it).build() + HrisBenefitListSupportedBenefitsPage.Response.builder().items(it).build(), ) } } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/CompanyService.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/CompanyService.kt index 5597c793..e14f27cd 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/CompanyService.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/CompanyService.kt @@ -14,6 +14,6 @@ interface CompanyService { @JvmOverloads fun retrieve( params: HrisCompanyRetrieveParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): Company } 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 46b695b3..f8642c39 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,10 +15,8 @@ import com.tryfinch.api.errors.FinchError import com.tryfinch.api.models.Company import com.tryfinch.api.models.HrisCompanyRetrieveParams -class CompanyServiceImpl -internal constructor( - private val clientOptions: ClientOptions, -) : CompanyService { +class CompanyServiceImpl internal constructor(private val clientOptions: ClientOptions) : + CompanyService { private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) @@ -28,7 +26,7 @@ internal constructor( /** Read basic company data */ override fun retrieve( params: HrisCompanyRetrieveParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): Company { val request = HttpRequest.builder() 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 8c8e64c0..5223328e 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 @@ -16,7 +16,7 @@ interface DirectoryService { @JvmOverloads fun list( params: HrisDirectoryListParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): HrisDirectoryListPage /** Read company directory and organization structure */ @@ -24,6 +24,6 @@ interface DirectoryService { @JvmOverloads fun listIndividuals( params: HrisDirectoryListIndividualsParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): HrisDirectoryListIndividualsPage } 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 5d98caa5..d20b1bcf 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,10 +17,8 @@ import com.tryfinch.api.models.HrisDirectoryListIndividualsParams import com.tryfinch.api.models.HrisDirectoryListPage import com.tryfinch.api.models.HrisDirectoryListParams -class DirectoryServiceImpl -internal constructor( - private val clientOptions: ClientOptions, -) : DirectoryService { +class DirectoryServiceImpl internal constructor(private val clientOptions: ClientOptions) : + DirectoryService { private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) @@ -31,7 +29,7 @@ internal constructor( /** Read company directory and organization structure */ override fun list( params: HrisDirectoryListParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): HrisDirectoryListPage { val request = HttpRequest.builder() @@ -58,7 +56,7 @@ internal constructor( @Deprecated("use `list` instead") override fun listIndividuals( params: HrisDirectoryListIndividualsParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): HrisDirectoryListIndividualsPage { val request = HttpRequest.builder() diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/DocumentService.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/DocumentService.kt index fc30aa9a..3e06ad08 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/DocumentService.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/DocumentService.kt @@ -18,7 +18,7 @@ interface DocumentService { @JvmOverloads fun list( params: HrisDocumentListParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): DocumentListResponse /** @@ -28,6 +28,6 @@ interface DocumentService { @JvmOverloads fun retreive( params: HrisDocumentRetreiveParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): DocumentRetreiveResponse } 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 b823de32..fb50f412 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,10 +17,8 @@ import com.tryfinch.api.models.DocumentRetreiveResponse import com.tryfinch.api.models.HrisDocumentListParams import com.tryfinch.api.models.HrisDocumentRetreiveParams -class DocumentServiceImpl -internal constructor( - private val clientOptions: ClientOptions, -) : DocumentService { +class DocumentServiceImpl internal constructor(private val clientOptions: ClientOptions) : + DocumentService { private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) @@ -32,7 +30,7 @@ internal constructor( */ override fun list( params: HrisDocumentListParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): DocumentListResponse { val request = HttpRequest.builder() @@ -60,7 +58,7 @@ internal constructor( */ override fun retreive( params: HrisDocumentRetreiveParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): DocumentRetreiveResponse { val request = HttpRequest.builder() diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/EmploymentService.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/EmploymentService.kt index 6252358d..98beeb34 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/EmploymentService.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/EmploymentService.kt @@ -14,6 +14,6 @@ interface EmploymentService { @JvmOverloads fun retrieveMany( params: HrisEmploymentRetrieveManyParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): HrisEmploymentRetrieveManyPage } 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 caa1ddb0..1f65f3bc 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,10 +16,8 @@ import com.tryfinch.api.errors.FinchError import com.tryfinch.api.models.HrisEmploymentRetrieveManyPage import com.tryfinch.api.models.HrisEmploymentRetrieveManyParams -class EmploymentServiceImpl -internal constructor( - private val clientOptions: ClientOptions, -) : EmploymentService { +class EmploymentServiceImpl internal constructor(private val clientOptions: ClientOptions) : + EmploymentService { private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) @@ -30,7 +28,7 @@ internal constructor( /** Read individual employment and income data */ override fun retrieveMany( params: HrisEmploymentRetrieveManyParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): HrisEmploymentRetrieveManyPage { val request = HttpRequest.builder() diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/IndividualService.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/IndividualService.kt index 844f65c8..669e8aa9 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/IndividualService.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/IndividualService.kt @@ -14,6 +14,6 @@ interface IndividualService { @JvmOverloads fun retrieveMany( params: HrisIndividualRetrieveManyParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): HrisIndividualRetrieveManyPage } 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 1c6acb60..55949402 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,10 +16,8 @@ import com.tryfinch.api.errors.FinchError import com.tryfinch.api.models.HrisIndividualRetrieveManyPage import com.tryfinch.api.models.HrisIndividualRetrieveManyParams -class IndividualServiceImpl -internal constructor( - private val clientOptions: ClientOptions, -) : IndividualService { +class IndividualServiceImpl internal constructor(private val clientOptions: ClientOptions) : + IndividualService { private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) @@ -30,7 +28,7 @@ internal constructor( /** Read individual data, excluding income and employment data */ override fun retrieveMany( params: HrisIndividualRetrieveManyParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): HrisIndividualRetrieveManyPage { val request = HttpRequest.builder() diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/PayStatementService.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/PayStatementService.kt index cf337107..aa04af04 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/PayStatementService.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/PayStatementService.kt @@ -18,6 +18,6 @@ interface PayStatementService { @JvmOverloads fun retrieveMany( params: HrisPayStatementRetrieveManyParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): HrisPayStatementRetrieveManyPage } 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 38bd156c..129ec2f5 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,10 +16,8 @@ import com.tryfinch.api.errors.FinchError import com.tryfinch.api.models.HrisPayStatementRetrieveManyPage import com.tryfinch.api.models.HrisPayStatementRetrieveManyParams -class PayStatementServiceImpl -internal constructor( - private val clientOptions: ClientOptions, -) : PayStatementService { +class PayStatementServiceImpl internal constructor(private val clientOptions: ClientOptions) : + PayStatementService { private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) @@ -34,7 +32,7 @@ internal constructor( */ override fun retrieveMany( params: HrisPayStatementRetrieveManyParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): HrisPayStatementRetrieveManyPage { val request = HttpRequest.builder() diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/PaymentService.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/PaymentService.kt index 5b27a625..c1f5ea2d 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/PaymentService.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/PaymentService.kt @@ -14,6 +14,6 @@ interface PaymentService { @JvmOverloads fun list( params: HrisPaymentListParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): HrisPaymentListPage } 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 4f20d692..3fc047c3 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,10 +16,8 @@ import com.tryfinch.api.models.HrisPaymentListPage import com.tryfinch.api.models.HrisPaymentListParams import com.tryfinch.api.models.Payment -class PaymentServiceImpl -internal constructor( - private val clientOptions: ClientOptions, -) : PaymentService { +class PaymentServiceImpl internal constructor(private val clientOptions: ClientOptions) : + PaymentService { private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) @@ -29,7 +27,7 @@ internal constructor( /** Read payroll and contractor related payments by the company. */ override fun list( params: HrisPaymentListParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): HrisPaymentListPage { val request = HttpRequest.builder() @@ -49,7 +47,7 @@ internal constructor( HrisPaymentListPage.of( this, params, - HrisPaymentListPage.Response.builder().items(it).build() + HrisPaymentListPage.Response.builder().items(it).build(), ) } } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/benefits/IndividualService.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/benefits/IndividualService.kt index 666da43e..4ca4e5f0 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/benefits/IndividualService.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/hris/benefits/IndividualService.kt @@ -18,20 +18,20 @@ interface IndividualService { @JvmOverloads fun enrolledIds( params: HrisBenefitIndividualEnrolledIdsParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): IndividualEnrolledIdsResponse /** Get enrollment information for the given individuals. */ @JvmOverloads fun retrieveManyBenefits( params: HrisBenefitIndividualRetrieveManyBenefitsParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): HrisBenefitIndividualRetrieveManyBenefitsPage /** Unenroll individuals from a deduction or contribution */ @JvmOverloads fun unenrollMany( params: HrisBenefitIndividualUnenrollManyParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): HrisBenefitIndividualUnenrollManyPage } 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 2de79b77..51cb9c63 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,10 +22,8 @@ import com.tryfinch.api.models.IndividualBenefit import com.tryfinch.api.models.IndividualEnrolledIdsResponse import com.tryfinch.api.models.UnenrolledIndividual -class IndividualServiceImpl -internal constructor( - private val clientOptions: ClientOptions, -) : IndividualService { +class IndividualServiceImpl internal constructor(private val clientOptions: ClientOptions) : + IndividualService { private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) @@ -36,7 +34,7 @@ internal constructor( /** Lists individuals currently enrolled in a given deduction. */ override fun enrolledIds( params: HrisBenefitIndividualEnrolledIdsParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): IndividualEnrolledIdsResponse { val request = HttpRequest.builder() @@ -61,7 +59,7 @@ internal constructor( /** Get enrollment information for the given individuals. */ override fun retrieveManyBenefits( params: HrisBenefitIndividualRetrieveManyBenefitsParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): HrisBenefitIndividualRetrieveManyBenefitsPage { val request = HttpRequest.builder() @@ -83,7 +81,7 @@ internal constructor( params, HrisBenefitIndividualRetrieveManyBenefitsPage.Response.builder() .items(it) - .build() + .build(), ) } } @@ -95,7 +93,7 @@ internal constructor( /** Unenroll individuals from a deduction or contribution */ override fun unenrollMany( params: HrisBenefitIndividualUnenrollManyParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): HrisBenefitIndividualUnenrollManyPage { val request = HttpRequest.builder() @@ -116,7 +114,7 @@ internal constructor( HrisBenefitIndividualUnenrollManyPage.of( this, params, - HrisBenefitIndividualUnenrollManyPage.Response.builder().items(it).build() + HrisBenefitIndividualUnenrollManyPage.Response.builder().items(it).build(), ) } } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/jobs/AutomatedService.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/jobs/AutomatedService.kt index 8f5dd094..dc4e6545 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/jobs/AutomatedService.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/jobs/AutomatedService.kt @@ -32,14 +32,14 @@ interface AutomatedService { @JvmOverloads fun create( params: JobAutomatedCreateParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): AutomatedCreateResponse /** Get an automated job by `job_id`. */ @JvmOverloads fun retrieve( params: JobAutomatedRetrieveParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): AutomatedAsyncJob /** @@ -50,6 +50,6 @@ interface AutomatedService { @JvmOverloads fun list( params: JobAutomatedListParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): JobAutomatedListPage } 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 ac866243..ed3b54cc 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,10 +20,8 @@ import com.tryfinch.api.models.JobAutomatedListPage import com.tryfinch.api.models.JobAutomatedListParams import com.tryfinch.api.models.JobAutomatedRetrieveParams -class AutomatedServiceImpl -internal constructor( - private val clientOptions: ClientOptions, -) : AutomatedService { +class AutomatedServiceImpl internal constructor(private val clientOptions: ClientOptions) : + AutomatedService { private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) @@ -48,7 +46,7 @@ internal constructor( */ override fun create( params: JobAutomatedCreateParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): AutomatedCreateResponse { val request = HttpRequest.builder() @@ -73,7 +71,7 @@ internal constructor( /** Get an automated job by `job_id`. */ override fun retrieve( params: JobAutomatedRetrieveParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): AutomatedAsyncJob { val request = HttpRequest.builder() @@ -102,7 +100,7 @@ internal constructor( */ override fun list( params: JobAutomatedListParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): JobAutomatedListPage { val request = HttpRequest.builder() diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/jobs/ManualService.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/jobs/ManualService.kt index 835a3702..b6b76e59 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/jobs/ManualService.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/jobs/ManualService.kt @@ -17,6 +17,6 @@ interface ManualService { @JvmOverloads fun retrieve( params: JobManualRetrieveParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): ManualAsyncJob } 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 27291f16..9ce1917a 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,10 +15,8 @@ import com.tryfinch.api.errors.FinchError import com.tryfinch.api.models.JobManualRetrieveParams import com.tryfinch.api.models.ManualAsyncJob -class ManualServiceImpl -internal constructor( - private val clientOptions: ClientOptions, -) : ManualService { +class ManualServiceImpl internal constructor(private val clientOptions: ClientOptions) : + ManualService { private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) @@ -31,7 +29,7 @@ internal constructor( */ override fun retrieve( params: JobManualRetrieveParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): ManualAsyncJob { val request = HttpRequest.builder() diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/payroll/PayGroupService.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/payroll/PayGroupService.kt index f7ae892d..660dcb3a 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/payroll/PayGroupService.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/payroll/PayGroupService.kt @@ -16,13 +16,13 @@ interface PayGroupService { @JvmOverloads fun retrieve( params: PayrollPayGroupRetrieveParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): PayGroupRetrieveResponse /** Read company pay groups and frequencies */ @JvmOverloads fun list( params: PayrollPayGroupListParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): PayrollPayGroupListPage } 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 6a494736..f4653cda 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,10 +18,8 @@ import com.tryfinch.api.models.PayrollPayGroupListPage import com.tryfinch.api.models.PayrollPayGroupListParams import com.tryfinch.api.models.PayrollPayGroupRetrieveParams -class PayGroupServiceImpl -internal constructor( - private val clientOptions: ClientOptions, -) : PayGroupService { +class PayGroupServiceImpl internal constructor(private val clientOptions: ClientOptions) : + PayGroupService { private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) @@ -32,7 +30,7 @@ internal constructor( /** Read information from a single pay group */ override fun retrieve( params: PayrollPayGroupRetrieveParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): PayGroupRetrieveResponse { val request = HttpRequest.builder() @@ -57,7 +55,7 @@ internal constructor( /** Read company pay groups and frequencies */ override fun list( params: PayrollPayGroupListParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): PayrollPayGroupListPage { val request = HttpRequest.builder() @@ -77,7 +75,7 @@ internal constructor( PayrollPayGroupListPage.of( this, params, - PayrollPayGroupListPage.Response.builder().items(it).build() + PayrollPayGroupListPage.Response.builder().items(it).build(), ) } } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/CompanyService.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/CompanyService.kt index a6b20bb3..7c7c7238 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/CompanyService.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/CompanyService.kt @@ -14,6 +14,6 @@ interface CompanyService { @JvmOverloads fun update( params: SandboxCompanyUpdateParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): CompanyUpdateResponse } 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 e2f62a1d..63e3b740 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,10 +16,8 @@ import com.tryfinch.api.errors.FinchError import com.tryfinch.api.models.CompanyUpdateResponse import com.tryfinch.api.models.SandboxCompanyUpdateParams -class CompanyServiceImpl -internal constructor( - private val clientOptions: ClientOptions, -) : CompanyService { +class CompanyServiceImpl internal constructor(private val clientOptions: ClientOptions) : + CompanyService { private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) @@ -29,7 +27,7 @@ internal constructor( /** Update a sandbox company's data */ override fun update( params: SandboxCompanyUpdateParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompanyUpdateResponse { val request = HttpRequest.builder() diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/ConnectionService.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/ConnectionService.kt index 79026f5e..c1bca965 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/ConnectionService.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/ConnectionService.kt @@ -17,6 +17,6 @@ interface ConnectionService { @JvmOverloads fun create( params: SandboxConnectionCreateParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): ConnectionCreateResponse } 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 c0ce13ef..8f8fdd38 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,10 +18,8 @@ import com.tryfinch.api.models.SandboxConnectionCreateParams import com.tryfinch.api.services.blocking.sandbox.connections.AccountService import com.tryfinch.api.services.blocking.sandbox.connections.AccountServiceImpl -class ConnectionServiceImpl -internal constructor( - private val clientOptions: ClientOptions, -) : ConnectionService { +class ConnectionServiceImpl internal constructor(private val clientOptions: ClientOptions) : + ConnectionService { private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) @@ -36,7 +34,7 @@ internal constructor( /** Create a new connection (new company/provider pair) with a new account */ override fun create( params: SandboxConnectionCreateParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): ConnectionCreateResponse { val request = HttpRequest.builder() diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/DirectoryService.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/DirectoryService.kt index cdeb0c1a..fd14c7da 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/DirectoryService.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/DirectoryService.kt @@ -14,6 +14,6 @@ interface DirectoryService { @JvmOverloads fun create( params: SandboxDirectoryCreateParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): List } 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 1f992263..5213cce1 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,10 +16,8 @@ import com.tryfinch.api.core.prepare import com.tryfinch.api.errors.FinchError import com.tryfinch.api.models.SandboxDirectoryCreateParams -class DirectoryServiceImpl -internal constructor( - private val clientOptions: ClientOptions, -) : DirectoryService { +class DirectoryServiceImpl internal constructor(private val clientOptions: ClientOptions) : + DirectoryService { private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) @@ -29,7 +27,7 @@ internal constructor( /** Add new individuals to a sandbox company */ override fun create( params: SandboxDirectoryCreateParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): List { val request = HttpRequest.builder() diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/EmploymentService.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/EmploymentService.kt index c16beaa5..6d26b611 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/EmploymentService.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/EmploymentService.kt @@ -14,6 +14,6 @@ interface EmploymentService { @JvmOverloads fun update( params: SandboxEmploymentUpdateParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): EmploymentUpdateResponse } 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 742a804c..a538224d 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,10 +16,8 @@ import com.tryfinch.api.errors.FinchError import com.tryfinch.api.models.EmploymentUpdateResponse import com.tryfinch.api.models.SandboxEmploymentUpdateParams -class EmploymentServiceImpl -internal constructor( - private val clientOptions: ClientOptions, -) : EmploymentService { +class EmploymentServiceImpl internal constructor(private val clientOptions: ClientOptions) : + EmploymentService { private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) @@ -30,7 +28,7 @@ internal constructor( /** Update sandbox employment */ override fun update( params: SandboxEmploymentUpdateParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): EmploymentUpdateResponse { val request = HttpRequest.builder() diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/IndividualService.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/IndividualService.kt index 227ed995..34657b8f 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/IndividualService.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/IndividualService.kt @@ -14,6 +14,6 @@ interface IndividualService { @JvmOverloads fun update( params: SandboxIndividualUpdateParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): IndividualUpdateResponse } 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 3333a62a..feb15e1f 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,10 +16,8 @@ import com.tryfinch.api.errors.FinchError import com.tryfinch.api.models.IndividualUpdateResponse import com.tryfinch.api.models.SandboxIndividualUpdateParams -class IndividualServiceImpl -internal constructor( - private val clientOptions: ClientOptions, -) : IndividualService { +class IndividualServiceImpl internal constructor(private val clientOptions: ClientOptions) : + IndividualService { private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) @@ -30,7 +28,7 @@ internal constructor( /** Update sandbox individual */ override fun update( params: SandboxIndividualUpdateParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): IndividualUpdateResponse { val request = HttpRequest.builder() diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/JobService.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/JobService.kt index 524c0de0..65e3c055 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/JobService.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/JobService.kt @@ -17,6 +17,6 @@ interface JobService { @JvmOverloads fun create( params: SandboxJobCreateParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): JobCreateResponse } 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 589c02eb..a2a60c9d 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,10 +18,7 @@ import com.tryfinch.api.models.SandboxJobCreateParams import com.tryfinch.api.services.blocking.sandbox.jobs.ConfigurationService import com.tryfinch.api.services.blocking.sandbox.jobs.ConfigurationServiceImpl -class JobServiceImpl -internal constructor( - private val clientOptions: ClientOptions, -) : JobService { +class JobServiceImpl internal constructor(private val clientOptions: ClientOptions) : JobService { private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) @@ -37,7 +34,7 @@ internal constructor( /** Enqueue a new sandbox job */ override fun create( params: SandboxJobCreateParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): JobCreateResponse { val request = HttpRequest.builder() diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/PaymentService.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/PaymentService.kt index 9097dc10..968cafd4 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/PaymentService.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/PaymentService.kt @@ -14,6 +14,6 @@ interface PaymentService { @JvmOverloads fun create( params: SandboxPaymentCreateParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): PaymentCreateResponse } 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 d8e902a1..61b5783b 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,10 +16,8 @@ import com.tryfinch.api.errors.FinchError import com.tryfinch.api.models.PaymentCreateResponse import com.tryfinch.api.models.SandboxPaymentCreateParams -class PaymentServiceImpl -internal constructor( - private val clientOptions: ClientOptions, -) : PaymentService { +class PaymentServiceImpl internal constructor(private val clientOptions: ClientOptions) : + PaymentService { private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) @@ -29,7 +27,7 @@ internal constructor( /** Add a new sandbox payment */ override fun create( params: SandboxPaymentCreateParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): PaymentCreateResponse { val request = HttpRequest.builder() diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/connections/AccountService.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/connections/AccountService.kt index 57d84f21..7fbb6b15 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/connections/AccountService.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/connections/AccountService.kt @@ -16,7 +16,7 @@ interface AccountService { @JvmOverloads fun create( params: SandboxConnectionAccountCreateParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): AccountCreateResponse /** @@ -26,6 +26,6 @@ interface AccountService { @JvmOverloads fun update( params: SandboxConnectionAccountUpdateParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): AccountUpdateResponse } 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 d42f5064..6f053eb8 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,10 +18,8 @@ import com.tryfinch.api.models.AccountUpdateResponse import com.tryfinch.api.models.SandboxConnectionAccountCreateParams import com.tryfinch.api.models.SandboxConnectionAccountUpdateParams -class AccountServiceImpl -internal constructor( - private val clientOptions: ClientOptions, -) : AccountService { +class AccountServiceImpl internal constructor(private val clientOptions: ClientOptions) : + AccountService { private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) @@ -31,7 +29,7 @@ internal constructor( /** Create a new account for an existing connection (company/provider pair) */ override fun create( params: SandboxConnectionAccountCreateParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): AccountCreateResponse { val request = HttpRequest.builder() @@ -59,7 +57,7 @@ internal constructor( */ override fun update( params: SandboxConnectionAccountUpdateParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): AccountUpdateResponse { val request = HttpRequest.builder() diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/jobs/ConfigurationService.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/jobs/ConfigurationService.kt index e40e3a80..393f230c 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/jobs/ConfigurationService.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/sandbox/jobs/ConfigurationService.kt @@ -15,13 +15,13 @@ interface ConfigurationService { @JvmOverloads fun retrieve( params: SandboxJobConfigurationRetrieveParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): List /** Update configurations for sandbox jobs */ @JvmOverloads fun update( params: SandboxJobConfigurationUpdateParams, - requestOptions: RequestOptions = RequestOptions.none() + requestOptions: RequestOptions = RequestOptions.none(), ): SandboxJobConfiguration } 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 70a26346..08046405 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,10 +17,8 @@ import com.tryfinch.api.models.SandboxJobConfiguration import com.tryfinch.api.models.SandboxJobConfigurationRetrieveParams import com.tryfinch.api.models.SandboxJobConfigurationUpdateParams -class ConfigurationServiceImpl -internal constructor( - private val clientOptions: ClientOptions, -) : ConfigurationService { +class ConfigurationServiceImpl internal constructor(private val clientOptions: ClientOptions) : + ConfigurationService { private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) @@ -31,7 +29,7 @@ internal constructor( /** Get configurations for sandbox jobs */ override fun retrieve( params: SandboxJobConfigurationRetrieveParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): List { val request = HttpRequest.builder() @@ -56,7 +54,7 @@ internal constructor( /** Update configurations for sandbox jobs */ override fun update( params: SandboxJobConfigurationUpdateParams, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): SandboxJobConfiguration { val request = HttpRequest.builder() diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/TestServerExtension.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/TestServerExtension.kt index d9ec3cdf..5e740846 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/TestServerExtension.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/TestServerExtension.kt @@ -36,7 +36,7 @@ class TestServerExtension : BeforeAllCallback, ExecutionCondition { $ prism mock path/to/your.openapi.yml """ .trimIndent(), - e + e, ) } } diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/core/PhantomReachableTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/core/PhantomReachableTest.kt index b608618e..02dbac71 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/core/PhantomReachableTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/core/PhantomReachableTest.kt @@ -14,7 +14,7 @@ internal class PhantomReachableTest { // Pass an inline object for the object to observe so that it becomes immediately // unreachable. Any(), - closeable + closeable, ) assertThat(closed).isFalse() diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/core/http/HeadersTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/core/http/HeadersTest.kt index 9511f5f4..f1611438 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/core/http/HeadersTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/core/http/HeadersTest.kt @@ -11,28 +11,28 @@ internal class HeadersTest { enum class TestCase( val headers: Headers, val expectedMap: Map>, - val expectedSize: Int + val expectedSize: Int, ) { EMPTY(Headers.builder().build(), expectedMap = mapOf(), expectedSize = 0), PUT_ONE( Headers.builder().put("name", "value").build(), expectedMap = mapOf("name" to listOf("value")), - expectedSize = 1 + expectedSize = 1, ), PUT_MULTIPLE( Headers.builder().put("name", listOf("value1", "value2")).build(), expectedMap = mapOf("name" to listOf("value1", "value2")), - expectedSize = 2 + expectedSize = 2, ), MULTIPLE_PUT( Headers.builder().put("name1", "value").put("name2", "value").build(), expectedMap = mapOf("name1" to listOf("value"), "name2" to listOf("value")), - expectedSize = 2 + expectedSize = 2, ), MULTIPLE_PUT_SAME_NAME( Headers.builder().put("name", "value1").put("name", "value2").build(), expectedMap = mapOf("name" to listOf("value1", "value2")), - expectedSize = 2 + expectedSize = 2, ), MULTIPLE_PUT_MULTIPLE( Headers.builder() @@ -40,7 +40,7 @@ internal class HeadersTest { .put("name", listOf("value1", "value2")) .build(), expectedMap = mapOf("name" to listOf("value1", "value2", "value1", "value2")), - expectedSize = 4 + expectedSize = 4, ), PUT_CASE_INSENSITIVE( Headers.builder() @@ -49,25 +49,25 @@ internal class HeadersTest { .put("nAmE", "value3") .build(), expectedMap = mapOf("name" to listOf("value1", "value2", "value3")), - expectedSize = 3 + expectedSize = 3, ), PUT_ALL_MAP( Headers.builder() .putAll( mapOf( "name1" to listOf("value1", "value2"), - "name2" to listOf("value1", "value2") + "name2" to listOf("value1", "value2"), ) ) .build(), expectedMap = mapOf("name1" to listOf("value1", "value2"), "name2" to listOf("value1", "value2")), - expectedSize = 4 + expectedSize = 4, ), PUT_ALL_HEADERS( Headers.builder().putAll(Headers.builder().put("name", "value").build()).build(), expectedMap = mapOf("name" to listOf("value")), - expectedSize = 1 + expectedSize = 1, ), PUT_ALL_CASE_INSENSITIVE( Headers.builder() @@ -75,32 +75,32 @@ internal class HeadersTest { mapOf( "name" to listOf("value1"), "NAME" to listOf("value2"), - "nAmE" to listOf("value3") + "nAmE" to listOf("value3"), ) ) .build(), expectedMap = mapOf("name" to listOf("value1", "value2", "value3")), - expectedSize = 3 + expectedSize = 3, ), REMOVE_ABSENT( Headers.builder().remove("name").build(), expectedMap = mapOf(), - expectedSize = 0 + expectedSize = 0, ), REMOVE_PRESENT_ONE( Headers.builder().put("name", "value").remove("name").build(), expectedMap = mapOf(), - expectedSize = 0 + expectedSize = 0, ), REMOVE_PRESENT_MULTIPLE( Headers.builder().put("name", listOf("value1", "value2")).remove("name").build(), expectedMap = mapOf(), - expectedSize = 0 + expectedSize = 0, ), REMOVE_CASE_INSENSITIVE( Headers.builder().put("name", listOf("value1", "value2")).remove("NAME").build(), expectedMap = mapOf(), - expectedSize = 0 + expectedSize = 0, ), REMOVE_ALL( Headers.builder() @@ -109,7 +109,7 @@ internal class HeadersTest { .removeAll(setOf("name1", "name2", "name3")) .build(), expectedMap = mapOf(), - expectedSize = 0 + expectedSize = 0, ), REMOVE_ALL_CASE_INSENSITIVE( Headers.builder() @@ -118,22 +118,22 @@ internal class HeadersTest { .removeAll(setOf("NAME1", "nAmE3")) .build(), expectedMap = mapOf(), - expectedSize = 0 + expectedSize = 0, ), CLEAR( Headers.builder().put("name1", "value").put("name2", "value").clear().build(), expectedMap = mapOf(), - expectedSize = 0 + expectedSize = 0, ), REPLACE_ONE_ABSENT( Headers.builder().replace("name", "value").build(), expectedMap = mapOf("name" to listOf("value")), - expectedSize = 1 + expectedSize = 1, ), REPLACE_ONE_PRESENT_ONE( Headers.builder().put("name", "value1").replace("name", "value2").build(), expectedMap = mapOf("name" to listOf("value2")), - expectedSize = 1 + expectedSize = 1, ), REPLACE_ONE_PRESENT_MULTIPLE( Headers.builder() @@ -141,12 +141,12 @@ internal class HeadersTest { .replace("name", "value3") .build(), expectedMap = mapOf("name" to listOf("value3")), - expectedSize = 1 + expectedSize = 1, ), REPLACE_MULTIPLE_ABSENT( Headers.builder().replace("name", listOf("value1", "value2")).build(), expectedMap = mapOf("name" to listOf("value1", "value2")), - expectedSize = 2 + expectedSize = 2, ), REPLACE_MULTIPLE_PRESENT_ONE( Headers.builder() @@ -154,7 +154,7 @@ internal class HeadersTest { .replace("name", listOf("value2", "value3")) .build(), expectedMap = mapOf("name" to listOf("value2", "value3")), - expectedSize = 2 + expectedSize = 2, ), REPLACE_MULTIPLE_PRESENT_MULTIPLE( Headers.builder() @@ -162,7 +162,7 @@ internal class HeadersTest { .replace("name", listOf("value3", "value4")) .build(), expectedMap = mapOf("name" to listOf("value3", "value4")), - expectedSize = 2 + expectedSize = 2, ), REPLACE_CASE_INSENSITIVE( Headers.builder() @@ -170,7 +170,7 @@ internal class HeadersTest { .replace("NAME", listOf("value2", "value3")) .build(), expectedMap = mapOf("NAME" to listOf("value2", "value3")), - expectedSize = 2 + expectedSize = 2, ), REPLACE_ALL_MAP( Headers.builder() @@ -183,9 +183,9 @@ internal class HeadersTest { mapOf( "name1" to listOf("value2"), "name2" to listOf("value1"), - "name3" to listOf("value2") + "name3" to listOf("value2"), ), - expectedSize = 3 + expectedSize = 3, ), REPLACE_ALL_HEADERS( Headers.builder() @@ -198,9 +198,9 @@ internal class HeadersTest { mapOf( "name1" to listOf("value2"), "name2" to listOf("value1"), - "name3" to listOf("value2") + "name3" to listOf("value2"), ), - expectedSize = 3 + expectedSize = 3, ), REPLACE_ALL_CASE_INSENSITIVE( Headers.builder() @@ -209,8 +209,8 @@ internal class HeadersTest { .replaceAll(mapOf("NAME1" to listOf("value2"), "nAmE2" to listOf("value2"))) .build(), expectedMap = mapOf("NAME1" to listOf("value2"), "nAmE2" to listOf("value2")), - expectedSize = 2 - ) + expectedSize = 2, + ), } @ParameterizedTest diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/core/http/QueryParamsTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/core/http/QueryParamsTest.kt index 302bf7a0..2002ca28 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/core/http/QueryParamsTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/core/http/QueryParamsTest.kt @@ -11,28 +11,28 @@ internal class QueryParamsTest { enum class TestCase( val queryParams: QueryParams, val expectedMap: Map>, - val expectedSize: Int + val expectedSize: Int, ) { EMPTY(QueryParams.builder().build(), expectedMap = mapOf(), expectedSize = 0), PUT_ONE( QueryParams.builder().put("key", "value").build(), expectedMap = mapOf("key" to listOf("value")), - expectedSize = 1 + expectedSize = 1, ), PUT_MULTIPLE( QueryParams.builder().put("key", listOf("value1", "value2")).build(), expectedMap = mapOf("key" to listOf("value1", "value2")), - expectedSize = 2 + expectedSize = 2, ), MULTIPLE_PUT( QueryParams.builder().put("key1", "value").put("key2", "value").build(), expectedMap = mapOf("key1" to listOf("value"), "key2" to listOf("value")), - expectedSize = 2 + expectedSize = 2, ), MULTIPLE_PUT_SAME_NAME( QueryParams.builder().put("key", "value1").put("key", "value2").build(), expectedMap = mapOf("key" to listOf("value1", "value2")), - expectedSize = 2 + expectedSize = 2, ), MULTIPLE_PUT_MULTIPLE( QueryParams.builder() @@ -40,40 +40,40 @@ internal class QueryParamsTest { .put("key", listOf("value1", "value2")) .build(), expectedMap = mapOf("key" to listOf("value1", "value2", "value1", "value2")), - expectedSize = 4 + expectedSize = 4, ), PUT_ALL_MAP( QueryParams.builder() .putAll( mapOf( "key1" to listOf("value1", "value2"), - "key2" to listOf("value1", "value2") + "key2" to listOf("value1", "value2"), ) ) .build(), expectedMap = mapOf("key1" to listOf("value1", "value2"), "key2" to listOf("value1", "value2")), - expectedSize = 4 + expectedSize = 4, ), PUT_ALL_HEADERS( QueryParams.builder().putAll(QueryParams.builder().put("key", "value").build()).build(), expectedMap = mapOf("key" to listOf("value")), - expectedSize = 1 + expectedSize = 1, ), REMOVE_ABSENT( QueryParams.builder().remove("key").build(), expectedMap = mapOf(), - expectedSize = 0 + expectedSize = 0, ), REMOVE_PRESENT_ONE( QueryParams.builder().put("key", "value").remove("key").build(), expectedMap = mapOf(), - expectedSize = 0 + expectedSize = 0, ), REMOVE_PRESENT_MULTIPLE( QueryParams.builder().put("key", listOf("value1", "value2")).remove("key").build(), expectedMap = mapOf(), - expectedSize = 0 + expectedSize = 0, ), REMOVE_ALL( QueryParams.builder() @@ -82,22 +82,22 @@ internal class QueryParamsTest { .removeAll(setOf("key1", "key2", "key3")) .build(), expectedMap = mapOf(), - expectedSize = 0 + expectedSize = 0, ), CLEAR( QueryParams.builder().put("key1", "value").put("key2", "value").clear().build(), expectedMap = mapOf(), - expectedSize = 0 + expectedSize = 0, ), REPLACE_ONE_ABSENT( QueryParams.builder().replace("key", "value").build(), expectedMap = mapOf("key" to listOf("value")), - expectedSize = 1 + expectedSize = 1, ), REPLACE_ONE_PRESENT_ONE( QueryParams.builder().put("key", "value1").replace("key", "value2").build(), expectedMap = mapOf("key" to listOf("value2")), - expectedSize = 1 + expectedSize = 1, ), REPLACE_ONE_PRESENT_MULTIPLE( QueryParams.builder() @@ -105,12 +105,12 @@ internal class QueryParamsTest { .replace("key", "value3") .build(), expectedMap = mapOf("key" to listOf("value3")), - expectedSize = 1 + expectedSize = 1, ), REPLACE_MULTIPLE_ABSENT( QueryParams.builder().replace("key", listOf("value1", "value2")).build(), expectedMap = mapOf("key" to listOf("value1", "value2")), - expectedSize = 2 + expectedSize = 2, ), REPLACE_MULTIPLE_PRESENT_ONE( QueryParams.builder() @@ -118,7 +118,7 @@ internal class QueryParamsTest { .replace("key", listOf("value2", "value3")) .build(), expectedMap = mapOf("key" to listOf("value2", "value3")), - expectedSize = 2 + expectedSize = 2, ), REPLACE_MULTIPLE_PRESENT_MULTIPLE( QueryParams.builder() @@ -126,7 +126,7 @@ internal class QueryParamsTest { .replace("key", listOf("value3", "value4")) .build(), expectedMap = mapOf("key" to listOf("value3", "value4")), - expectedSize = 2 + expectedSize = 2, ), REPLACE_ALL_MAP( QueryParams.builder() @@ -139,9 +139,9 @@ internal class QueryParamsTest { mapOf( "key1" to listOf("value2"), "key2" to listOf("value1"), - "key3" to listOf("value2") + "key3" to listOf("value2"), ), - expectedSize = 3 + expectedSize = 3, ), REPLACE_ALL_HEADERS( QueryParams.builder() @@ -156,10 +156,10 @@ internal class QueryParamsTest { mapOf( "key1" to listOf("value2"), "key2" to listOf("value1"), - "key3" to listOf("value2") + "key3" to listOf("value2"), ), - expectedSize = 3 - ) + expectedSize = 3, + ), } @ParameterizedTest 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 40ab4321..ae5c8211 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 @@ -26,12 +26,12 @@ internal class RetryingHttpClientTest { object : HttpClient { override fun execute( request: HttpRequest, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): HttpResponse = trackClose(okHttpClient.execute(request, requestOptions)) override fun executeAsync( request: HttpRequest, - requestOptions: RequestOptions + requestOptions: RequestOptions, ): CompletableFuture = okHttpClient.executeAsync(request, requestOptions).thenApply { trackClose(it) } @@ -71,7 +71,7 @@ internal class RetryingHttpClientTest { val response = retryingClient.execute( HttpRequest.builder().method(HttpMethod.POST).addPathSegment("something").build(), - async + async, ) assertThat(response.statusCode()).isEqualTo(200) @@ -97,7 +97,7 @@ internal class RetryingHttpClientTest { val response = retryingClient.execute( HttpRequest.builder().method(HttpMethod.POST).addPathSegment("something").build(), - async + async, ) assertThat(response.statusCode()).isEqualTo(200) @@ -140,24 +140,24 @@ internal class RetryingHttpClientTest { val response = retryingClient.execute( HttpRequest.builder().method(HttpMethod.POST).addPathSegment("something").build(), - async + async, ) assertThat(response.statusCode()).isEqualTo(200) verify( 1, postRequestedFor(urlPathEqualTo("/something")) - .withHeader("x-stainless-retry-count", equalTo("0")) + .withHeader("x-stainless-retry-count", equalTo("0")), ) verify( 1, postRequestedFor(urlPathEqualTo("/something")) - .withHeader("x-stainless-retry-count", equalTo("1")) + .withHeader("x-stainless-retry-count", equalTo("1")), ) verify( 1, postRequestedFor(urlPathEqualTo("/something")) - .withHeader("x-stainless-retry-count", equalTo("2")) + .withHeader("x-stainless-retry-count", equalTo("2")), ) assertNoResponseLeaks() } @@ -191,14 +191,14 @@ internal class RetryingHttpClientTest { .addPathSegment("something") .putHeader("x-stainless-retry-count", "42") .build(), - async + async, ) assertThat(response.statusCode()).isEqualTo(200) verify( 2, postRequestedFor(urlPathEqualTo("/something")) - .withHeader("x-stainless-retry-count", equalTo("42")) + .withHeader("x-stainless-retry-count", equalTo("42")), ) assertNoResponseLeaks() } @@ -226,7 +226,7 @@ internal class RetryingHttpClientTest { val response = retryingClient.execute( HttpRequest.builder().method(HttpMethod.POST).addPathSegment("something").build(), - async + async, ) assertThat(response.statusCode()).isEqualTo(200) 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 59d8dece..159fc882 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 @@ -48,11 +48,7 @@ internal class SerializerTest { override fun hashCode(): Int { if (hashCode == 0) { - hashCode = - Objects.hash( - isActive, - additionalProperties, - ) + hashCode = Objects.hash(isActive, additionalProperties) } return hashCode } @@ -91,10 +87,7 @@ internal class SerializerTest { } fun build(): ClassWithBooleanFieldPrefixedWithIs = - ClassWithBooleanFieldPrefixedWithIs( - isActive, - additionalProperties.toImmutable(), - ) + ClassWithBooleanFieldPrefixedWithIs(isActive, additionalProperties.toImmutable()) } } 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 926ce855..5768f00c 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 @@ -30,7 +30,7 @@ class HrisBenefitIndividualRetrieveManyBenefitsParamsTest { val expected = QueryParams.builder() expected.put( "individual_ids", - "d675d2b7-6d7b-41a8-b2d3-001eb3fb88f6,d02a6346-1f08-4312-a064-49ff3cafaa7a" + "d675d2b7-6d7b-41a8-b2d3-001eb3fb88f6,d02a6346-1f08-4312-a064-49ff3cafaa7a", ) assertThat(params._queryParams()).isEqualTo(expected.build()) } 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 c76df6e8..a51b273f 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 @@ -181,7 +181,7 @@ class ErrorHandlingTest { assertUnprocessableEntity( e, Headers.builder().put("Foo", "Bar").build(), - FINCH_ERROR + FINCH_ERROR, ) }) } @@ -231,7 +231,7 @@ class ErrorHandlingTest { e, 999, Headers.builder().put("Foo", "Bar").build(), - toJson(FINCH_ERROR) + toJson(FINCH_ERROR), ) }) } @@ -270,7 +270,7 @@ class ErrorHandlingTest { throwable: Throwable, statusCode: Int, headers: Headers, - responseBody: ByteArray + responseBody: ByteArray, ) { assertThat(throwable) .asInstanceOf( @@ -328,7 +328,7 @@ class ErrorHandlingTest { private fun assertUnprocessableEntity( throwable: Throwable, headers: Headers, - error: FinchError + error: FinchError, ) { assertThat(throwable) .asInstanceOf( diff --git a/gradle.properties b/gradle.properties index a3bc58f2..ec5c5092 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,6 @@ +org.gradle.configuration-cache=true org.gradle.caching=true -org.gradle.jvmargs=-Xmx4g org.gradle.parallel=true +org.gradle.daemon=false +org.gradle.jvmargs=-Xmx4g kotlin.daemon.jvmargs=-Xmx4g diff --git a/scripts/format b/scripts/format index c6239fab..456a69db 100755 --- a/scripts/format +++ b/scripts/format @@ -5,4 +5,4 @@ set -e cd "$(dirname "$0")/.." echo "==> Running spotlessApply" -./gradlew --build-cache --parallel --no-daemon spotlessApply +./gradlew spotlessApply diff --git a/scripts/lint b/scripts/lint index 58753d0b..e3a5f5e2 100755 --- a/scripts/lint +++ b/scripts/lint @@ -5,4 +5,4 @@ set -e cd "$(dirname "$0")/.." echo "==> Build classes" -./gradlew --build-cache --parallel --no-daemon build testClasses -x test +./gradlew build testClasses -x test diff --git a/scripts/test b/scripts/test index 72ed0333..6b750a74 100755 --- a/scripts/test +++ b/scripts/test @@ -53,4 +53,4 @@ else fi echo "==> Running tests" -./gradlew --build-cache --parallel --no-daemon test +./gradlew test From 545758da4865c820e81165c78cd9034aa75e0a9b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 17 Feb 2025 20:42:12 +0000 Subject: [PATCH 03/22] chore(internal): use better test example values (#441) chore(internal): rename internal body classes chore(internal): make body class constructors private chore(internal): make body classes for multipart requests chore(internal): misc formatting changes --- .../api/models/AccessTokenCreateParams.kt | 34 +- .../api/models/ConnectSessionNewParams.kt | 44 +- .../ConnectSessionReauthenticateParams.kt | 39 +- .../api/models/HrisBenefitCreateParams.kt | 37 +- ...HrisBenefitIndividualUnenrollManyParams.kt | 33 +- .../api/models/HrisBenefitUpdateParams.kt | 27 +- .../HrisEmploymentRetrieveManyParams.kt | 33 +- .../HrisIndividualRetrieveManyParams.kt | 35 +- .../HrisPayStatementRetrieveManyParams.kt | 33 +- .../api/models/JobAutomatedCreateParams.kt | 1054 +++++++++-------- .../models/RequestForwardingForwardParams.kt | 38 +- .../api/models/SandboxCompanyUpdateParams.kt | 42 +- .../SandboxConnectionAccountCreateParams.kt | 38 +- .../SandboxConnectionAccountUpdateParams.kt | 34 +- .../models/SandboxConnectionCreateParams.kt | 36 +- .../models/SandboxDirectoryCreateParams.kt | 318 +++-- .../models/SandboxEmploymentUpdateParams.kt | 64 +- .../models/SandboxIndividualUpdateParams.kt | 52 +- .../SandboxJobConfigurationUpdateParams.kt | 372 +----- .../api/models/SandboxJobCreateParams.kt | 32 +- .../api/models/SandboxPaymentCreateParams.kt | 32 +- .../api/models/AccessTokenCreateParamsTest.kt | 4 + .../api/models/ConnectSessionNewParamsTest.kt | 4 + .../ConnectSessionReauthenticateParamsTest.kt | 4 + .../api/models/HrisBenefitCreateParamsTest.kt | 4 + ...BenefitIndividualUnenrollManyParamsTest.kt | 4 + .../api/models/HrisBenefitUpdateParamsTest.kt | 4 + .../HrisEmploymentRetrieveManyParamsTest.kt | 4 + .../HrisIndividualRetrieveManyParamsTest.kt | 4 + .../HrisPayStatementRetrieveManyParamsTest.kt | 4 + .../models/JobAutomatedCreateParamsTest.kt | 55 +- .../RequestForwardingForwardParamsTest.kt | 4 + .../models/SandboxCompanyUpdateParamsTest.kt | 4 + ...andboxConnectionAccountCreateParamsTest.kt | 4 + ...andboxConnectionAccountUpdateParamsTest.kt | 4 + .../SandboxConnectionCreateParamsTest.kt | 4 + .../SandboxDirectoryCreateParamsTest.kt | 4 + .../SandboxEmploymentUpdateParamsTest.kt | 4 + .../SandboxIndividualUpdateParamsTest.kt | 4 + ...SandboxJobConfigurationUpdateParamsTest.kt | 48 +- .../api/models/SandboxJobCreateParamsTest.kt | 4 + .../models/SandboxPaymentCreateParamsTest.kt | 4 + .../blocking/jobs/AutomatedServiceTest.kt | 6 +- .../sandbox/jobs/ConfigurationServiceTest.kt | 8 +- 44 files changed, 1195 insertions(+), 1425 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 c45bcbb2..38868876 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 @@ -23,7 +23,7 @@ import java.util.Optional /** Exchange the authorization code for an access token */ class AccessTokenCreateParams private constructor( - private val body: AccessTokenCreateBody, + private val body: Body, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, ) : Params { @@ -50,16 +50,16 @@ private constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun _body(): AccessTokenCreateBody = body + @JvmSynthetic internal fun _body(): Body = body override fun _headers(): Headers = additionalHeaders override fun _queryParams(): QueryParams = additionalQueryParams @NoAutoDetect - class AccessTokenCreateBody + class Body @JsonCreator - internal constructor( + private constructor( @JsonProperty("code") @ExcludeMissing private val code: JsonField = JsonMissing.of(), @@ -104,7 +104,7 @@ private constructor( private var validated: Boolean = false - fun validate(): AccessTokenCreateBody = apply { + fun validate(): Body = apply { if (validated) { return@apply } @@ -123,7 +123,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [AccessTokenCreateBody]. */ + /** A builder for [Body]. */ class Builder internal constructor() { private var code: JsonField? = null @@ -133,12 +133,12 @@ private constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(accessTokenCreateBody: AccessTokenCreateBody) = apply { - code = accessTokenCreateBody.code - clientId = accessTokenCreateBody.clientId - clientSecret = accessTokenCreateBody.clientSecret - redirectUri = accessTokenCreateBody.redirectUri - additionalProperties = accessTokenCreateBody.additionalProperties.toMutableMap() + internal fun from(body: Body) = apply { + code = body.code + clientId = body.clientId + clientSecret = body.clientSecret + redirectUri = body.redirectUri + additionalProperties = body.additionalProperties.toMutableMap() } fun code(code: String) = code(JsonField.of(code)) @@ -180,8 +180,8 @@ private constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): AccessTokenCreateBody = - AccessTokenCreateBody( + fun build(): Body = + Body( checkRequired("code", code), clientId, clientSecret, @@ -195,7 +195,7 @@ private constructor( return true } - return /* spotless:off */ other is AccessTokenCreateBody && code == other.code && clientId == other.clientId && clientSecret == other.clientSecret && redirectUri == other.redirectUri && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Body && code == other.code && clientId == other.clientId && clientSecret == other.clientSecret && redirectUri == other.redirectUri && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ @@ -205,7 +205,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "AccessTokenCreateBody{code=$code, clientId=$clientId, clientSecret=$clientSecret, redirectUri=$redirectUri, additionalProperties=$additionalProperties}" + "Body{code=$code, clientId=$clientId, clientSecret=$clientSecret, redirectUri=$redirectUri, additionalProperties=$additionalProperties}" } fun toBuilder() = Builder().from(this) @@ -219,7 +219,7 @@ private constructor( @NoAutoDetect class Builder internal constructor() { - private var body: AccessTokenCreateBody.Builder = AccessTokenCreateBody.builder() + private var body: Body.Builder = Body.builder() 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/ConnectSessionNewParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ConnectSessionNewParams.kt index da8025e5..6fc524f0 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 @@ -25,7 +25,7 @@ import java.util.Optional /** Create a new connect session for an employer */ class ConnectSessionNewParams private constructor( - private val body: ConnectSessionNewBody, + private val body: Body, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, ) : Params { @@ -74,16 +74,16 @@ private constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun _body(): ConnectSessionNewBody = body + @JvmSynthetic internal fun _body(): Body = body override fun _headers(): Headers = additionalHeaders override fun _queryParams(): QueryParams = additionalQueryParams @NoAutoDetect - class ConnectSessionNewBody + class Body @JsonCreator - internal constructor( + private constructor( @JsonProperty("customer_id") @ExcludeMissing private val customerId: JsonField = JsonMissing.of(), @@ -181,7 +181,7 @@ private constructor( private var validated: Boolean = false - fun validate(): ConnectSessionNewBody = apply { + fun validate(): Body = apply { if (validated) { return@apply } @@ -205,7 +205,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [ConnectSessionNewBody]. */ + /** A builder for [Body]. */ class Builder internal constructor() { private var customerId: JsonField? = null @@ -220,17 +220,17 @@ private constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(connectSessionNewBody: ConnectSessionNewBody) = apply { - customerId = connectSessionNewBody.customerId - customerName = connectSessionNewBody.customerName - products = connectSessionNewBody.products.map { it.toMutableList() } - customerEmail = connectSessionNewBody.customerEmail - integration = connectSessionNewBody.integration - manual = connectSessionNewBody.manual - minutesToExpire = connectSessionNewBody.minutesToExpire - redirectUri = connectSessionNewBody.redirectUri - sandbox = connectSessionNewBody.sandbox - additionalProperties = connectSessionNewBody.additionalProperties.toMutableMap() + internal fun from(body: Body) = apply { + customerId = body.customerId + customerName = body.customerName + products = body.products.map { it.toMutableList() } + customerEmail = body.customerEmail + integration = body.integration + manual = body.manual + minutesToExpire = body.minutesToExpire + redirectUri = body.redirectUri + sandbox = body.sandbox + additionalProperties = body.additionalProperties.toMutableMap() } fun customerId(customerId: String) = customerId(JsonField.of(customerId)) @@ -354,8 +354,8 @@ private constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): ConnectSessionNewBody = - ConnectSessionNewBody( + fun build(): Body = + Body( checkRequired("customerId", customerId), checkRequired("customerName", customerName), checkRequired("products", products).map { it.toImmutable() }, @@ -374,7 +374,7 @@ private constructor( return true } - return /* spotless:off */ other is ConnectSessionNewBody && customerId == other.customerId && customerName == other.customerName && products == other.products && customerEmail == other.customerEmail && integration == other.integration && manual == other.manual && minutesToExpire == other.minutesToExpire && redirectUri == other.redirectUri && sandbox == other.sandbox && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Body && customerId == other.customerId && customerName == other.customerName && products == other.products && customerEmail == other.customerEmail && integration == other.integration && manual == other.manual && minutesToExpire == other.minutesToExpire && redirectUri == other.redirectUri && sandbox == other.sandbox && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ @@ -384,7 +384,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "ConnectSessionNewBody{customerId=$customerId, customerName=$customerName, products=$products, customerEmail=$customerEmail, integration=$integration, manual=$manual, minutesToExpire=$minutesToExpire, redirectUri=$redirectUri, sandbox=$sandbox, additionalProperties=$additionalProperties}" + "Body{customerId=$customerId, customerName=$customerName, products=$products, customerEmail=$customerEmail, integration=$integration, manual=$manual, minutesToExpire=$minutesToExpire, redirectUri=$redirectUri, sandbox=$sandbox, additionalProperties=$additionalProperties}" } fun toBuilder() = Builder().from(this) @@ -398,7 +398,7 @@ private constructor( @NoAutoDetect class Builder internal constructor() { - private var body: ConnectSessionNewBody.Builder = ConnectSessionNewBody.builder() + private var body: Body.Builder = Body.builder() 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/ConnectSessionReauthenticateParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ConnectSessionReauthenticateParams.kt index 8483632b..021ffc91 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 @@ -25,7 +25,7 @@ import java.util.Optional /** Create a new Connect session for reauthenticating an existing connection */ class ConnectSessionReauthenticateParams private constructor( - private val body: ConnectSessionReauthenticateBody, + private val body: Body, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, ) : Params { @@ -60,16 +60,16 @@ private constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun _body(): ConnectSessionReauthenticateBody = body + @JvmSynthetic internal fun _body(): Body = body override fun _headers(): Headers = additionalHeaders override fun _queryParams(): QueryParams = additionalQueryParams @NoAutoDetect - class ConnectSessionReauthenticateBody + class Body @JsonCreator - internal constructor( + private constructor( @JsonProperty("connection_id") @ExcludeMissing private val connectionId: JsonField = JsonMissing.of(), @@ -131,7 +131,7 @@ private constructor( private var validated: Boolean = false - fun validate(): ConnectSessionReauthenticateBody = apply { + fun validate(): Body = apply { if (validated) { return@apply } @@ -150,7 +150,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [ConnectSessionReauthenticateBody]. */ + /** A builder for [Body]. */ class Builder internal constructor() { private var connectionId: JsonField? = null @@ -160,15 +160,13 @@ private constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(connectSessionReauthenticateBody: ConnectSessionReauthenticateBody) = - apply { - connectionId = connectSessionReauthenticateBody.connectionId - minutesToExpire = connectSessionReauthenticateBody.minutesToExpire - products = connectSessionReauthenticateBody.products.map { it.toMutableList() } - redirectUri = connectSessionReauthenticateBody.redirectUri - additionalProperties = - connectSessionReauthenticateBody.additionalProperties.toMutableMap() - } + internal fun from(body: Body) = apply { + connectionId = body.connectionId + minutesToExpire = body.minutesToExpire + products = body.products.map { it.toMutableList() } + redirectUri = body.redirectUri + additionalProperties = body.additionalProperties.toMutableMap() + } /** The ID of the existing connection to reauthenticate */ fun connectionId(connectionId: String) = connectionId(JsonField.of(connectionId)) @@ -264,8 +262,8 @@ private constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): ConnectSessionReauthenticateBody = - ConnectSessionReauthenticateBody( + fun build(): Body = + Body( checkRequired("connectionId", connectionId), minutesToExpire, (products ?: JsonMissing.of()).map { it.toImmutable() }, @@ -279,7 +277,7 @@ private constructor( return true } - return /* spotless:off */ other is ConnectSessionReauthenticateBody && connectionId == other.connectionId && minutesToExpire == other.minutesToExpire && products == other.products && redirectUri == other.redirectUri && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Body && connectionId == other.connectionId && minutesToExpire == other.minutesToExpire && products == other.products && redirectUri == other.redirectUri && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ @@ -289,7 +287,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "ConnectSessionReauthenticateBody{connectionId=$connectionId, minutesToExpire=$minutesToExpire, products=$products, redirectUri=$redirectUri, additionalProperties=$additionalProperties}" + "Body{connectionId=$connectionId, minutesToExpire=$minutesToExpire, products=$products, redirectUri=$redirectUri, additionalProperties=$additionalProperties}" } fun toBuilder() = Builder().from(this) @@ -303,8 +301,7 @@ private constructor( @NoAutoDetect class Builder internal constructor() { - private var body: ConnectSessionReauthenticateBody.Builder = - ConnectSessionReauthenticateBody.builder() + private var body: Body.Builder = Body.builder() 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/HrisBenefitCreateParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitCreateParams.kt index cb2ec7dc..5f17f2f8 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 @@ -25,7 +25,7 @@ import java.util.Optional */ class HrisBenefitCreateParams private constructor( - private val body: HrisBenefitCreateBody, + private val body: Body, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, ) : Params { @@ -58,16 +58,16 @@ private constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun _body(): HrisBenefitCreateBody = body + @JvmSynthetic internal fun _body(): Body = body override fun _headers(): Headers = additionalHeaders override fun _queryParams(): QueryParams = additionalQueryParams @NoAutoDetect - class HrisBenefitCreateBody + class Body @JsonCreator - internal constructor( + private constructor( @JsonProperty("description") @ExcludeMissing private val description: JsonField = JsonMissing.of(), @@ -115,7 +115,7 @@ private constructor( private var validated: Boolean = false - fun validate(): HrisBenefitCreateBody = apply { + fun validate(): Body = apply { if (validated) { return@apply } @@ -133,7 +133,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [HrisBenefitCreateBody]. */ + /** A builder for [Body]. */ class Builder internal constructor() { private var description: JsonField = JsonMissing.of() @@ -142,11 +142,11 @@ private constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(hrisBenefitCreateBody: HrisBenefitCreateBody) = apply { - description = hrisBenefitCreateBody.description - frequency = hrisBenefitCreateBody.frequency - type = hrisBenefitCreateBody.type - additionalProperties = hrisBenefitCreateBody.additionalProperties.toMutableMap() + internal fun from(body: Body) = apply { + description = body.description + frequency = body.frequency + type = body.type + additionalProperties = body.additionalProperties.toMutableMap() } /** @@ -201,13 +201,8 @@ private constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): HrisBenefitCreateBody = - HrisBenefitCreateBody( - description, - frequency, - type, - additionalProperties.toImmutable(), - ) + fun build(): Body = + Body(description, frequency, type, additionalProperties.toImmutable()) } override fun equals(other: Any?): Boolean { @@ -215,7 +210,7 @@ private constructor( return true } - return /* spotless:off */ other is HrisBenefitCreateBody && description == other.description && frequency == other.frequency && type == other.type && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Body && description == other.description && frequency == other.frequency && type == other.type && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ @@ -225,7 +220,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "HrisBenefitCreateBody{description=$description, frequency=$frequency, type=$type, additionalProperties=$additionalProperties}" + "Body{description=$description, frequency=$frequency, type=$type, additionalProperties=$additionalProperties}" } fun toBuilder() = Builder().from(this) @@ -239,7 +234,7 @@ private constructor( @NoAutoDetect class Builder internal constructor() { - private var body: HrisBenefitCreateBody.Builder = HrisBenefitCreateBody.builder() + private var body: Body.Builder = Body.builder() 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/HrisBenefitIndividualUnenrollManyParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitIndividualUnenrollManyParams.kt index 17e72f0c..9994d336 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 @@ -24,7 +24,7 @@ import java.util.Optional class HrisBenefitIndividualUnenrollManyParams private constructor( private val benefitId: String, - private val body: HrisBenefitIndividualUnenrollManyBody, + private val body: Body, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, ) : Params { @@ -43,7 +43,7 @@ private constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun _body(): HrisBenefitIndividualUnenrollManyBody = body + @JvmSynthetic internal fun _body(): Body = body override fun _headers(): Headers = additionalHeaders @@ -57,9 +57,9 @@ private constructor( } @NoAutoDetect - class HrisBenefitIndividualUnenrollManyBody + class Body @JsonCreator - internal constructor( + private constructor( @JsonProperty("individual_ids") @ExcludeMissing private val individualIds: JsonField> = JsonMissing.of(), @@ -82,7 +82,7 @@ private constructor( private var validated: Boolean = false - fun validate(): HrisBenefitIndividualUnenrollManyBody = apply { + fun validate(): Body = apply { if (validated) { return@apply } @@ -98,20 +98,16 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [HrisBenefitIndividualUnenrollManyBody]. */ + /** A builder for [Body]. */ class Builder internal constructor() { private var individualIds: JsonField>? = null private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from( - hrisBenefitIndividualUnenrollManyBody: HrisBenefitIndividualUnenrollManyBody - ) = apply { - individualIds = - hrisBenefitIndividualUnenrollManyBody.individualIds.map { it.toMutableList() } - additionalProperties = - hrisBenefitIndividualUnenrollManyBody.additionalProperties.toMutableMap() + internal fun from(body: Body) = apply { + individualIds = body.individualIds.map { it.toMutableList() } + additionalProperties = body.additionalProperties.toMutableMap() } /** Array of individual_ids to unenroll. */ @@ -156,8 +152,8 @@ private constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): HrisBenefitIndividualUnenrollManyBody = - HrisBenefitIndividualUnenrollManyBody( + fun build(): Body = + Body( (individualIds ?: JsonMissing.of()).map { it.toImmutable() }, additionalProperties.toImmutable(), ) @@ -168,7 +164,7 @@ private constructor( return true } - return /* spotless:off */ other is HrisBenefitIndividualUnenrollManyBody && individualIds == other.individualIds && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Body && individualIds == other.individualIds && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ @@ -178,7 +174,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "HrisBenefitIndividualUnenrollManyBody{individualIds=$individualIds, additionalProperties=$additionalProperties}" + "Body{individualIds=$individualIds, additionalProperties=$additionalProperties}" } fun toBuilder() = Builder().from(this) @@ -193,8 +189,7 @@ private constructor( class Builder internal constructor() { private var benefitId: String? = null - private var body: HrisBenefitIndividualUnenrollManyBody.Builder = - HrisBenefitIndividualUnenrollManyBody.builder() + private var body: Body.Builder = Body.builder() 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/HrisBenefitUpdateParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitUpdateParams.kt index 208bf30c..f3e83adb 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 @@ -24,7 +24,7 @@ import java.util.Optional class HrisBenefitUpdateParams private constructor( private val benefitId: String, - private val body: HrisBenefitUpdateBody, + private val body: Body, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, ) : Params { @@ -43,7 +43,7 @@ private constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun _body(): HrisBenefitUpdateBody = body + @JvmSynthetic internal fun _body(): Body = body override fun _headers(): Headers = additionalHeaders @@ -57,9 +57,9 @@ private constructor( } @NoAutoDetect - class HrisBenefitUpdateBody + class Body @JsonCreator - internal constructor( + private constructor( @JsonProperty("description") @ExcludeMissing private val description: JsonField = JsonMissing.of(), @@ -82,7 +82,7 @@ private constructor( private var validated: Boolean = false - fun validate(): HrisBenefitUpdateBody = apply { + fun validate(): Body = apply { if (validated) { return@apply } @@ -98,16 +98,16 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [HrisBenefitUpdateBody]. */ + /** A builder for [Body]. */ class Builder internal constructor() { private var description: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(hrisBenefitUpdateBody: HrisBenefitUpdateBody) = apply { - description = hrisBenefitUpdateBody.description - additionalProperties = hrisBenefitUpdateBody.additionalProperties.toMutableMap() + internal fun from(body: Body) = apply { + description = body.description + additionalProperties = body.additionalProperties.toMutableMap() } /** Updated name or description. */ @@ -137,8 +137,7 @@ private constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): HrisBenefitUpdateBody = - HrisBenefitUpdateBody(description, additionalProperties.toImmutable()) + fun build(): Body = Body(description, additionalProperties.toImmutable()) } override fun equals(other: Any?): Boolean { @@ -146,7 +145,7 @@ private constructor( return true } - return /* spotless:off */ other is HrisBenefitUpdateBody && description == other.description && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Body && description == other.description && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ @@ -156,7 +155,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "HrisBenefitUpdateBody{description=$description, additionalProperties=$additionalProperties}" + "Body{description=$description, additionalProperties=$additionalProperties}" } fun toBuilder() = Builder().from(this) @@ -171,7 +170,7 @@ private constructor( class Builder internal constructor() { private var benefitId: String? = null - private var body: HrisBenefitUpdateBody.Builder = HrisBenefitUpdateBody.builder() + private var body: Body.Builder = Body.builder() 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/HrisEmploymentRetrieveManyParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisEmploymentRetrieveManyParams.kt index 7151df11..7dc8e0fa 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 @@ -22,7 +22,7 @@ import java.util.Objects /** Read individual employment and income data */ class HrisEmploymentRetrieveManyParams private constructor( - private val body: HrisEmploymentRetrieveManyBody, + private val body: Body, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, ) : Params { @@ -39,7 +39,7 @@ private constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun _body(): HrisEmploymentRetrieveManyBody = body + @JvmSynthetic internal fun _body(): Body = body override fun _headers(): Headers = additionalHeaders @@ -47,9 +47,9 @@ private constructor( /** Individual Ids Request Body */ @NoAutoDetect - class HrisEmploymentRetrieveManyBody + class Body @JsonCreator - internal constructor( + private constructor( @JsonProperty("requests") @ExcludeMissing private val requests: JsonField> = JsonMissing.of(), @@ -71,7 +71,7 @@ private constructor( private var validated: Boolean = false - fun validate(): HrisEmploymentRetrieveManyBody = apply { + fun validate(): Body = apply { if (validated) { return@apply } @@ -87,19 +87,17 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [HrisEmploymentRetrieveManyBody]. */ + /** A builder for [Body]. */ class Builder internal constructor() { private var requests: JsonField>? = null private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(hrisEmploymentRetrieveManyBody: HrisEmploymentRetrieveManyBody) = - apply { - requests = hrisEmploymentRetrieveManyBody.requests.map { it.toMutableList() } - additionalProperties = - hrisEmploymentRetrieveManyBody.additionalProperties.toMutableMap() - } + internal fun from(body: Body) = apply { + requests = body.requests.map { it.toMutableList() } + additionalProperties = body.additionalProperties.toMutableMap() + } /** The array of batch requests. */ fun requests(requests: List) = requests(JsonField.of(requests)) @@ -142,8 +140,8 @@ private constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): HrisEmploymentRetrieveManyBody = - HrisEmploymentRetrieveManyBody( + fun build(): Body = + Body( checkRequired("requests", requests).map { it.toImmutable() }, additionalProperties.toImmutable(), ) @@ -154,7 +152,7 @@ private constructor( return true } - return /* spotless:off */ other is HrisEmploymentRetrieveManyBody && requests == other.requests && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Body && requests == other.requests && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ @@ -164,7 +162,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "HrisEmploymentRetrieveManyBody{requests=$requests, additionalProperties=$additionalProperties}" + "Body{requests=$requests, additionalProperties=$additionalProperties}" } fun toBuilder() = Builder().from(this) @@ -178,8 +176,7 @@ private constructor( @NoAutoDetect class Builder internal constructor() { - private var body: HrisEmploymentRetrieveManyBody.Builder = - HrisEmploymentRetrieveManyBody.builder() + private var body: Body.Builder = Body.builder() 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/HrisIndividualRetrieveManyParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisIndividualRetrieveManyParams.kt index a99cbfc8..e65280f8 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 @@ -22,7 +22,7 @@ import java.util.Optional /** Read individual data, excluding income and employment data */ class HrisIndividualRetrieveManyParams private constructor( - private val body: HrisIndividualRetrieveManyBody, + private val body: Body, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, ) : Params { @@ -41,16 +41,16 @@ private constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun _body(): HrisIndividualRetrieveManyBody = body + @JvmSynthetic internal fun _body(): Body = body override fun _headers(): Headers = additionalHeaders override fun _queryParams(): QueryParams = additionalQueryParams @NoAutoDetect - class HrisIndividualRetrieveManyBody + class Body @JsonCreator - internal constructor( + private constructor( @JsonProperty("options") @ExcludeMissing private val options: JsonField = JsonMissing.of(), @@ -78,7 +78,7 @@ private constructor( private var validated: Boolean = false - fun validate(): HrisIndividualRetrieveManyBody = apply { + fun validate(): Body = apply { if (validated) { return@apply } @@ -95,7 +95,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [HrisIndividualRetrieveManyBody]. */ + /** A builder for [Body]. */ class Builder internal constructor() { private var options: JsonField = JsonMissing.of() @@ -103,13 +103,11 @@ private constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(hrisIndividualRetrieveManyBody: HrisIndividualRetrieveManyBody) = - apply { - options = hrisIndividualRetrieveManyBody.options - requests = hrisIndividualRetrieveManyBody.requests.map { it.toMutableList() } - additionalProperties = - hrisIndividualRetrieveManyBody.additionalProperties.toMutableMap() - } + internal fun from(body: Body) = apply { + options = body.options + requests = body.requests.map { it.toMutableList() } + additionalProperties = body.additionalProperties.toMutableMap() + } fun options(options: Options?) = options(JsonField.ofNullable(options)) @@ -155,8 +153,8 @@ private constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): HrisIndividualRetrieveManyBody = - HrisIndividualRetrieveManyBody( + fun build(): Body = + Body( options, (requests ?: JsonMissing.of()).map { it.toImmutable() }, additionalProperties.toImmutable(), @@ -168,7 +166,7 @@ private constructor( return true } - return /* spotless:off */ other is HrisIndividualRetrieveManyBody && options == other.options && requests == other.requests && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Body && options == other.options && requests == other.requests && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ @@ -178,7 +176,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "HrisIndividualRetrieveManyBody{options=$options, requests=$requests, additionalProperties=$additionalProperties}" + "Body{options=$options, requests=$requests, additionalProperties=$additionalProperties}" } fun toBuilder() = Builder().from(this) @@ -192,8 +190,7 @@ private constructor( @NoAutoDetect class Builder internal constructor() { - private var body: HrisIndividualRetrieveManyBody.Builder = - HrisIndividualRetrieveManyBody.builder() + private var body: Body.Builder = Body.builder() 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/HrisPayStatementRetrieveManyParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisPayStatementRetrieveManyParams.kt index 53571ac0..7bf49d28 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 @@ -27,7 +27,7 @@ import java.util.Optional */ class HrisPayStatementRetrieveManyParams private constructor( - private val body: HrisPayStatementRetrieveManyBody, + private val body: Body, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, ) : Params { @@ -44,16 +44,16 @@ private constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun _body(): HrisPayStatementRetrieveManyBody = body + @JvmSynthetic internal fun _body(): Body = body override fun _headers(): Headers = additionalHeaders override fun _queryParams(): QueryParams = additionalQueryParams @NoAutoDetect - class HrisPayStatementRetrieveManyBody + class Body @JsonCreator - internal constructor( + private constructor( @JsonProperty("requests") @ExcludeMissing private val requests: JsonField> = JsonMissing.of(), @@ -75,7 +75,7 @@ private constructor( private var validated: Boolean = false - fun validate(): HrisPayStatementRetrieveManyBody = apply { + fun validate(): Body = apply { if (validated) { return@apply } @@ -91,19 +91,17 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [HrisPayStatementRetrieveManyBody]. */ + /** A builder for [Body]. */ class Builder internal constructor() { private var requests: JsonField>? = null private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(hrisPayStatementRetrieveManyBody: HrisPayStatementRetrieveManyBody) = - apply { - requests = hrisPayStatementRetrieveManyBody.requests.map { it.toMutableList() } - additionalProperties = - hrisPayStatementRetrieveManyBody.additionalProperties.toMutableMap() - } + internal fun from(body: Body) = apply { + requests = body.requests.map { it.toMutableList() } + additionalProperties = body.additionalProperties.toMutableMap() + } /** The array of batch requests. */ fun requests(requests: List) = requests(JsonField.of(requests)) @@ -146,8 +144,8 @@ private constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): HrisPayStatementRetrieveManyBody = - HrisPayStatementRetrieveManyBody( + fun build(): Body = + Body( checkRequired("requests", requests).map { it.toImmutable() }, additionalProperties.toImmutable(), ) @@ -158,7 +156,7 @@ private constructor( return true } - return /* spotless:off */ other is HrisPayStatementRetrieveManyBody && requests == other.requests && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Body && requests == other.requests && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ @@ -168,7 +166,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "HrisPayStatementRetrieveManyBody{requests=$requests, additionalProperties=$additionalProperties}" + "Body{requests=$requests, additionalProperties=$additionalProperties}" } fun toBuilder() = Builder().from(this) @@ -182,8 +180,7 @@ private constructor( @NoAutoDetect class Builder internal constructor() { - private var body: HrisPayStatementRetrieveManyBody.Builder = - HrisPayStatementRetrieveManyBody.builder() + private var body: Body.Builder = Body.builder() 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/JobAutomatedCreateParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobAutomatedCreateParams.kt index 84f9be5a..258cfc63 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 @@ -50,29 +50,27 @@ import kotlin.jvm.optionals.getOrNull */ class JobAutomatedCreateParams private constructor( - private val body: JobAutomatedCreateBody, + private val body: Body, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, ) : Params { - fun dataSyncAll(): Optional = body.dataSyncAll() - - fun w4FormEmployeeSync(): Optional = body.w4FormEmployeeSync() + fun body(): Body = body fun _additionalHeaders(): Headers = additionalHeaders fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun _body(): JobAutomatedCreateBody = body + @JvmSynthetic internal fun _body(): Body = body override fun _headers(): Headers = additionalHeaders override fun _queryParams(): QueryParams = additionalQueryParams - @JsonDeserialize(using = JobAutomatedCreateBody.Deserializer::class) - @JsonSerialize(using = JobAutomatedCreateBody.Serializer::class) - class JobAutomatedCreateBody - internal constructor( + @JsonDeserialize(using = Body.Deserializer::class) + @JsonSerialize(using = Body.Serializer::class) + class Body + private constructor( private val dataSyncAll: DataSyncAll? = null, private val w4FormEmployeeSync: W4FormEmployeeSync? = null, private val _json: JsonValue? = null, @@ -102,40 +100,55 @@ private constructor( } } + private var validated: Boolean = false + + fun validate(): Body = apply { + if (validated) { + return@apply + } + + accept( + object : Visitor { + override fun visitDataSyncAll(dataSyncAll: DataSyncAll) { + dataSyncAll.validate() + } + + override fun visitW4FormEmployeeSync(w4FormEmployeeSync: W4FormEmployeeSync) { + w4FormEmployeeSync.validate() + } + } + ) + validated = true + } + override fun equals(other: Any?): Boolean { if (this === other) { return true } - return /* spotless:off */ other is JobAutomatedCreateBody && dataSyncAll == other.dataSyncAll && w4FormEmployeeSync == other.w4FormEmployeeSync /* spotless:on */ + return /* spotless:off */ other is Body && dataSyncAll == other.dataSyncAll && w4FormEmployeeSync == other.w4FormEmployeeSync /* spotless:on */ } override fun hashCode(): Int = /* spotless:off */ Objects.hash(dataSyncAll, w4FormEmployeeSync) /* spotless:on */ override fun toString(): String = when { - dataSyncAll != null -> "JobAutomatedCreateBody{dataSyncAll=$dataSyncAll}" - w4FormEmployeeSync != null -> - "JobAutomatedCreateBody{w4FormEmployeeSync=$w4FormEmployeeSync}" - _json != null -> "JobAutomatedCreateBody{_unknown=$_json}" - else -> throw IllegalStateException("Invalid JobAutomatedCreateBody") + dataSyncAll != null -> "Body{dataSyncAll=$dataSyncAll}" + w4FormEmployeeSync != null -> "Body{w4FormEmployeeSync=$w4FormEmployeeSync}" + _json != null -> "Body{_unknown=$_json}" + else -> throw IllegalStateException("Invalid Body") } companion object { - @JvmStatic - fun ofDataSyncAll(dataSyncAll: DataSyncAll) = - JobAutomatedCreateBody(dataSyncAll = dataSyncAll) + @JvmStatic fun ofDataSyncAll(dataSyncAll: DataSyncAll) = Body(dataSyncAll = dataSyncAll) @JvmStatic fun ofW4FormEmployeeSync(w4FormEmployeeSync: W4FormEmployeeSync) = - JobAutomatedCreateBody(w4FormEmployeeSync = w4FormEmployeeSync) + Body(w4FormEmployeeSync = w4FormEmployeeSync) } - /** - * An interface that defines how to map each variant of [JobAutomatedCreateBody] to a value - * of type [T]. - */ + /** An interface that defines how to map each variant of [Body] to a value of type [T]. */ interface Visitor { fun visitDataSyncAll(dataSyncAll: DataSyncAll): T @@ -143,49 +156,48 @@ private constructor( fun visitW4FormEmployeeSync(w4FormEmployeeSync: W4FormEmployeeSync): T /** - * Maps an unknown variant of [JobAutomatedCreateBody] to a value of type [T]. + * Maps an unknown variant of [Body] 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. + * An instance of [Body] 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") + throw FinchInvalidDataException("Unknown Body: $json") } } - internal class Deserializer : - BaseDeserializer(JobAutomatedCreateBody::class) { + internal class Deserializer : BaseDeserializer(Body::class) { - override fun ObjectCodec.deserialize(node: JsonNode): JobAutomatedCreateBody { + override fun ObjectCodec.deserialize(node: JsonNode): Body { val json = JsonValue.fromJsonNode(node) val type = json.asObject().getOrNull()?.get("type")?.asString()?.getOrNull() when (type) { "data_sync_all" -> { - tryDeserialize(node, jacksonTypeRef())?.let { - return JobAutomatedCreateBody(dataSyncAll = it, _json = json) - } + tryDeserialize(node, jacksonTypeRef()) { it.validate() } + ?.let { + return Body(dataSyncAll = it, _json = json) + } } "w4_form_employee_sync" -> { - tryDeserialize(node, jacksonTypeRef())?.let { - return JobAutomatedCreateBody(w4FormEmployeeSync = it, _json = json) - } + tryDeserialize(node, jacksonTypeRef()) { it.validate() } + ?.let { + return Body(w4FormEmployeeSync = it, _json = json) + } } } - return JobAutomatedCreateBody(_json = json) + return Body(_json = json) } } - internal class Serializer : - BaseSerializer(JobAutomatedCreateBody::class) { + internal class Serializer : BaseSerializer(Body::class) { override fun serialize( - value: JobAutomatedCreateBody, + value: Body, generator: JsonGenerator, provider: SerializerProvider, ) { @@ -194,511 +206,492 @@ private constructor( value.w4FormEmployeeSync != null -> generator.writeObject(value.w4FormEmployeeSync) value._json != null -> generator.writeObject(value._json) - else -> throw IllegalStateException("Invalid JobAutomatedCreateBody") + else -> throw IllegalStateException("Invalid Body") } } } - } - - fun toBuilder() = Builder().from(this) - - companion object { - @JvmStatic fun builder() = Builder() - } + @NoAutoDetect + class DataSyncAll + @JsonCreator + private constructor( + @JsonProperty("type") + @ExcludeMissing + private val type: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), + ) { - /** A builder for [JobAutomatedCreateParams]. */ - @NoAutoDetect - class Builder internal constructor() { + /** The type of job to start. */ + fun type(): Type = type.getRequired("type") - private var body: JobAutomatedCreateBody? = null - private var additionalHeaders: Headers.Builder = Headers.builder() - private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() + /** The type of job to start. */ + @JsonProperty("type") @ExcludeMissing fun _type(): JsonField = type - @JvmSynthetic - internal fun from(jobAutomatedCreateParams: JobAutomatedCreateParams) = apply { - body = jobAutomatedCreateParams.body - additionalHeaders = jobAutomatedCreateParams.additionalHeaders.toBuilder() - additionalQueryParams = jobAutomatedCreateParams.additionalQueryParams.toBuilder() - } + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties - fun forDataSyncAll(dataSyncAll: DataSyncAll) = apply { - body = JobAutomatedCreateBody.ofDataSyncAll(dataSyncAll) - } + private var validated: Boolean = false - fun forW4FormEmployeeSync(w4FormEmployeeSync: W4FormEmployeeSync) = apply { - body = JobAutomatedCreateBody.ofW4FormEmployeeSync(w4FormEmployeeSync) - } + fun validate(): DataSyncAll = apply { + if (validated) { + return@apply + } - fun additionalHeaders(additionalHeaders: Headers) = apply { - this.additionalHeaders.clear() - putAllAdditionalHeaders(additionalHeaders) - } + type() + validated = true + } - fun additionalHeaders(additionalHeaders: Map>) = apply { - this.additionalHeaders.clear() - putAllAdditionalHeaders(additionalHeaders) - } + fun toBuilder() = Builder().from(this) - fun putAdditionalHeader(name: String, value: String) = apply { - additionalHeaders.put(name, value) - } + companion object { - fun putAdditionalHeaders(name: String, values: Iterable) = apply { - additionalHeaders.put(name, values) - } + @JvmStatic fun builder() = Builder() + } - fun putAllAdditionalHeaders(additionalHeaders: Headers) = apply { - this.additionalHeaders.putAll(additionalHeaders) - } + /** A builder for [DataSyncAll]. */ + class Builder internal constructor() { - fun putAllAdditionalHeaders(additionalHeaders: Map>) = apply { - this.additionalHeaders.putAll(additionalHeaders) - } + private var type: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() - fun replaceAdditionalHeaders(name: String, value: String) = apply { - additionalHeaders.replace(name, value) - } + @JvmSynthetic + internal fun from(dataSyncAll: DataSyncAll) = apply { + type = dataSyncAll.type + additionalProperties = dataSyncAll.additionalProperties.toMutableMap() + } - fun replaceAdditionalHeaders(name: String, values: Iterable) = apply { - additionalHeaders.replace(name, values) - } + /** The type of job to start. */ + fun type(type: Type) = type(JsonField.of(type)) - fun replaceAllAdditionalHeaders(additionalHeaders: Headers) = apply { - this.additionalHeaders.replaceAll(additionalHeaders) - } + /** The type of job to start. */ + fun type(type: JsonField) = apply { this.type = type } - fun replaceAllAdditionalHeaders(additionalHeaders: Map>) = apply { - this.additionalHeaders.replaceAll(additionalHeaders) - } + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } - fun removeAdditionalHeaders(name: String) = apply { additionalHeaders.remove(name) } + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } - fun removeAllAdditionalHeaders(names: Set) = apply { - additionalHeaders.removeAll(names) - } + fun putAllAdditionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.putAll(additionalProperties) + } - fun additionalQueryParams(additionalQueryParams: QueryParams) = apply { - this.additionalQueryParams.clear() - putAllAdditionalQueryParams(additionalQueryParams) - } + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } - fun additionalQueryParams(additionalQueryParams: Map>) = apply { - this.additionalQueryParams.clear() - putAllAdditionalQueryParams(additionalQueryParams) - } + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } - fun putAdditionalQueryParam(key: String, value: String) = apply { - additionalQueryParams.put(key, value) - } + fun build(): DataSyncAll = + DataSyncAll(checkRequired("type", type), additionalProperties.toImmutable()) + } - fun putAdditionalQueryParams(key: String, values: Iterable) = apply { - additionalQueryParams.put(key, values) - } + /** The type of job to start. */ + class Type @JsonCreator private constructor(private val value: JsonField) : + Enum { - fun putAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply { - this.additionalQueryParams.putAll(additionalQueryParams) - } + /** + * 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 - fun putAllAdditionalQueryParams(additionalQueryParams: Map>) = - apply { - this.additionalQueryParams.putAll(additionalQueryParams) - } + companion object { - fun replaceAdditionalQueryParams(key: String, value: String) = apply { - additionalQueryParams.replace(key, value) - } + @JvmField val DATA_SYNC_ALL = of("data_sync_all") - fun replaceAdditionalQueryParams(key: String, values: Iterable) = apply { - additionalQueryParams.replace(key, values) - } + @JvmStatic fun of(value: String) = Type(JsonField.of(value)) + } - fun replaceAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply { - this.additionalQueryParams.replaceAll(additionalQueryParams) - } + /** An enum containing [Type]'s known values. */ + enum class Known { + DATA_SYNC_ALL + } - fun replaceAllAdditionalQueryParams(additionalQueryParams: Map>) = - apply { - this.additionalQueryParams.replaceAll(additionalQueryParams) - } + /** + * 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, + } - fun removeAdditionalQueryParams(key: String) = apply { additionalQueryParams.remove(key) } + /** + * 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 + } - fun removeAllAdditionalQueryParams(keys: Set) = apply { - additionalQueryParams.removeAll(keys) - } + /** + * 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 + else -> throw FinchInvalidDataException("Unknown Type: $value") + } - fun build(): JobAutomatedCreateParams = - JobAutomatedCreateParams( - body ?: JobAutomatedCreateBody(), - additionalHeaders.build(), - additionalQueryParams.build(), - ) - } + fun asString(): String = _value().asStringOrThrow() - @NoAutoDetect - class DataSyncAll - @JsonCreator - private constructor( - @JsonProperty("type") @ExcludeMissing private val type: JsonField = JsonMissing.of(), - @JsonAnySetter - private val additionalProperties: Map = immutableEmptyMap(), - ) { + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } - /** The type of job to start. */ - fun type(): Type = type.getRequired("type") + return /* spotless:off */ other is Type && value == other.value /* spotless:on */ + } - /** The type of job to start. */ - @JsonProperty("type") @ExcludeMissing fun _type(): JsonField = type + override fun hashCode() = value.hashCode() - @JsonAnyGetter - @ExcludeMissing - fun _additionalProperties(): Map = additionalProperties + override fun toString() = value.toString() + } - private var validated: Boolean = false + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } - fun validate(): DataSyncAll = apply { - if (validated) { - return@apply + return /* spotless:off */ other is DataSyncAll && type == other.type && additionalProperties == other.additionalProperties /* spotless:on */ } - type() - validated = true - } - - fun toBuilder() = Builder().from(this) + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(type, additionalProperties) } + /* spotless:on */ - companion object { + override fun hashCode(): Int = hashCode - @JvmStatic fun builder() = Builder() + override fun toString() = + "DataSyncAll{type=$type, additionalProperties=$additionalProperties}" } - /** A builder for [DataSyncAll]. */ - class Builder internal constructor() { - - private var type: JsonField? = null - private var additionalProperties: MutableMap = mutableMapOf() + @NoAutoDetect + class W4FormEmployeeSync + @JsonCreator + private constructor( + @JsonProperty("params") + @ExcludeMissing + private val params: JsonField = JsonMissing.of(), + @JsonProperty("type") + @ExcludeMissing + private val type: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), + ) { - @JvmSynthetic - internal fun from(dataSyncAll: DataSyncAll) = apply { - type = dataSyncAll.type - additionalProperties = dataSyncAll.additionalProperties.toMutableMap() - } + fun params(): Params = params.getRequired("params") /** The type of job to start. */ - fun type(type: Type) = type(JsonField.of(type)) + fun type(): Type = type.getRequired("type") - /** The type of job to start. */ - fun type(type: JsonField) = apply { this.type = type } + @JsonProperty("params") @ExcludeMissing fun _params(): JsonField = params - fun additionalProperties(additionalProperties: Map) = apply { - this.additionalProperties.clear() - putAllAdditionalProperties(additionalProperties) - } + /** The type of job to start. */ + @JsonProperty("type") @ExcludeMissing fun _type(): JsonField = type - fun putAdditionalProperty(key: String, value: JsonValue) = apply { - additionalProperties.put(key, value) - } + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties - fun putAllAdditionalProperties(additionalProperties: Map) = apply { - this.additionalProperties.putAll(additionalProperties) - } + private var validated: Boolean = false - fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + fun validate(): W4FormEmployeeSync = apply { + if (validated) { + return@apply + } - fun removeAllAdditionalProperties(keys: Set) = apply { - keys.forEach(::removeAdditionalProperty) + params().validate() + type() + validated = true } - fun build(): DataSyncAll = - DataSyncAll(checkRequired("type", type), additionalProperties.toImmutable()) - } - - /** The type of job to start. */ - class Type @JsonCreator 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 + fun toBuilder() = Builder().from(this) companion object { - @JvmField val DATA_SYNC_ALL = of("data_sync_all") - - @JvmStatic fun of(value: String) = Type(JsonField.of(value)) - } - - /** An enum containing [Type]'s known values. */ - enum class Known { - DATA_SYNC_ALL + @JvmStatic fun builder() = Builder() } - /** - * 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, - } + /** A builder for [W4FormEmployeeSync]. */ + class Builder internal constructor() { - /** - * 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 - } + private var params: JsonField? = null + private var type: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() - /** - * 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 - else -> throw FinchInvalidDataException("Unknown Type: $value") + @JvmSynthetic + internal fun from(w4FormEmployeeSync: W4FormEmployeeSync) = apply { + params = w4FormEmployeeSync.params + type = w4FormEmployeeSync.type + additionalProperties = w4FormEmployeeSync.additionalProperties.toMutableMap() } - fun asString(): String = _value().asStringOrThrow() + fun params(params: Params) = params(JsonField.of(params)) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } + fun params(params: JsonField) = apply { this.params = params } - return /* spotless:off */ other is Type && value == other.value /* spotless:on */ - } + /** The type of job to start. */ + fun type(type: Type) = type(JsonField.of(type)) - override fun hashCode() = value.hashCode() + /** The type of job to start. */ + fun type(type: JsonField) = apply { this.type = type } - override fun toString() = value.toString() - } - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return /* spotless:off */ other is DataSyncAll && type == other.type && additionalProperties == other.additionalProperties /* spotless:on */ - } - - /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(type, additionalProperties) } - /* spotless:on */ - - override fun hashCode(): Int = hashCode - - override fun toString() = - "DataSyncAll{type=$type, additionalProperties=$additionalProperties}" - } - - @NoAutoDetect - class W4FormEmployeeSync - @JsonCreator - private constructor( - @JsonProperty("params") - @ExcludeMissing - private val params: JsonField = JsonMissing.of(), - @JsonProperty("type") @ExcludeMissing private val type: JsonField = JsonMissing.of(), - @JsonAnySetter - private val additionalProperties: Map = immutableEmptyMap(), - ) { - - fun params(): Params = params.getRequired("params") - - /** The type of job to start. */ - fun type(): Type = type.getRequired("type") + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } - @JsonProperty("params") @ExcludeMissing fun _params(): JsonField = params + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } - /** The type of job to start. */ - @JsonProperty("type") @ExcludeMissing fun _type(): JsonField = type + fun putAllAdditionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.putAll(additionalProperties) + } - @JsonAnyGetter - @ExcludeMissing - fun _additionalProperties(): Map = additionalProperties + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } - private var validated: Boolean = false + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } - fun validate(): W4FormEmployeeSync = apply { - if (validated) { - return@apply + fun build(): W4FormEmployeeSync = + W4FormEmployeeSync( + checkRequired("params", params), + checkRequired("type", type), + additionalProperties.toImmutable(), + ) } - params().validate() - type() - validated = true - } + @NoAutoDetect + class Params + @JsonCreator + private constructor( + @JsonProperty("individual_id") + @ExcludeMissing + private val individualId: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), + ) { - fun toBuilder() = Builder().from(this) + /** The unique ID of the individual for W-4 data sync. */ + fun individualId(): String = individualId.getRequired("individual_id") - companion object { + /** The unique ID of the individual for W-4 data sync. */ + @JsonProperty("individual_id") + @ExcludeMissing + fun _individualId(): JsonField = individualId - @JvmStatic fun builder() = Builder() - } + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties - /** A builder for [W4FormEmployeeSync]. */ - class Builder internal constructor() { + private var validated: Boolean = false - private var params: JsonField? = null - private var type: JsonField? = null - private var additionalProperties: MutableMap = mutableMapOf() + fun validate(): Params = apply { + if (validated) { + return@apply + } - @JvmSynthetic - internal fun from(w4FormEmployeeSync: W4FormEmployeeSync) = apply { - params = w4FormEmployeeSync.params - type = w4FormEmployeeSync.type - additionalProperties = w4FormEmployeeSync.additionalProperties.toMutableMap() - } + individualId() + validated = true + } - fun params(params: Params) = params(JsonField.of(params)) + fun toBuilder() = Builder().from(this) - fun params(params: JsonField) = apply { this.params = params } + companion object { - /** The type of job to start. */ - fun type(type: Type) = type(JsonField.of(type)) + @JvmStatic fun builder() = Builder() + } - /** The type of job to start. */ - fun type(type: JsonField) = apply { this.type = type } + /** A builder for [Params]. */ + class Builder internal constructor() { - fun additionalProperties(additionalProperties: Map) = apply { - this.additionalProperties.clear() - putAllAdditionalProperties(additionalProperties) - } + private var individualId: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() - fun putAdditionalProperty(key: String, value: JsonValue) = apply { - additionalProperties.put(key, value) - } + @JvmSynthetic + internal fun from(params: Params) = apply { + individualId = params.individualId + additionalProperties = params.additionalProperties.toMutableMap() + } - fun putAllAdditionalProperties(additionalProperties: Map) = apply { - this.additionalProperties.putAll(additionalProperties) - } + /** The unique ID of the individual for W-4 data sync. */ + fun individualId(individualId: String) = + individualId(JsonField.of(individualId)) - fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + /** The unique ID of the individual for W-4 data sync. */ + fun individualId(individualId: JsonField) = apply { + this.individualId = individualId + } - fun removeAllAdditionalProperties(keys: Set) = apply { - keys.forEach(::removeAdditionalProperty) - } + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } - fun build(): W4FormEmployeeSync = - W4FormEmployeeSync( - checkRequired("params", params), - checkRequired("type", type), - additionalProperties.toImmutable(), - ) - } + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } - @NoAutoDetect - class Params - @JsonCreator - private constructor( - @JsonProperty("individual_id") - @ExcludeMissing - private val individualId: JsonField = JsonMissing.of(), - @JsonAnySetter - private val additionalProperties: Map = immutableEmptyMap(), - ) { + fun putAllAdditionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.putAll(additionalProperties) + } - /** The unique ID of the individual for W-4 data sync. */ - fun individualId(): String = individualId.getRequired("individual_id") + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } - /** The unique ID of the individual for W-4 data sync. */ - @JsonProperty("individual_id") - @ExcludeMissing - fun _individualId(): JsonField = individualId + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } - @JsonAnyGetter - @ExcludeMissing - fun _additionalProperties(): Map = additionalProperties + fun build(): Params = + Params( + checkRequired("individualId", individualId), + additionalProperties.toImmutable(), + ) + } - private var validated: Boolean = false + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } - fun validate(): Params = apply { - if (validated) { - return@apply + return /* spotless:off */ other is Params && individualId == other.individualId && additionalProperties == other.additionalProperties /* spotless:on */ } - individualId() - validated = true - } - - fun toBuilder() = Builder().from(this) + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(individualId, additionalProperties) } + /* spotless:on */ - companion object { + override fun hashCode(): Int = hashCode - @JvmStatic fun builder() = Builder() + override fun toString() = + "Params{individualId=$individualId, additionalProperties=$additionalProperties}" } - /** A builder for [Params]. */ - class Builder internal constructor() { + /** The type of job to start. */ + class Type @JsonCreator private constructor(private val value: JsonField) : + Enum { - private var individualId: JsonField? = null - private var additionalProperties: MutableMap = mutableMapOf() + /** + * 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 - @JvmSynthetic - internal fun from(params: Params) = apply { - individualId = params.individualId - additionalProperties = params.additionalProperties.toMutableMap() - } + companion object { - /** The unique ID of the individual for W-4 data sync. */ - fun individualId(individualId: String) = individualId(JsonField.of(individualId)) + @JvmField val W4_FORM_EMPLOYEE_SYNC = of("w4_form_employee_sync") - /** The unique ID of the individual for W-4 data sync. */ - fun individualId(individualId: JsonField) = apply { - this.individualId = individualId + @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } - fun additionalProperties(additionalProperties: Map) = apply { - this.additionalProperties.clear() - putAllAdditionalProperties(additionalProperties) + /** An enum containing [Type]'s known values. */ + enum class Known { + W4_FORM_EMPLOYEE_SYNC } - fun putAdditionalProperty(key: String, value: JsonValue) = apply { - additionalProperties.put(key, value) + /** + * 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, } - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { - this.additionalProperties.putAll(additionalProperties) + /** + * 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 } - fun removeAdditionalProperty(key: String) = apply { - additionalProperties.remove(key) - } + /** + * 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 + else -> throw FinchInvalidDataException("Unknown Type: $value") + } - fun removeAllAdditionalProperties(keys: Set) = apply { - keys.forEach(::removeAdditionalProperty) + fun asString(): String = _value().asStringOrThrow() + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Type && value == other.value /* spotless:on */ } - fun build(): Params = - Params( - checkRequired("individualId", individualId), - additionalProperties.toImmutable(), - ) + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() } override fun equals(other: Any?): Boolean { @@ -706,118 +699,163 @@ private constructor( return true } - return /* spotless:off */ other is Params && individualId == other.individualId && 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, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(params, type, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "Params{individualId=$individualId, additionalProperties=$additionalProperties}" + "W4FormEmployeeSync{params=$params, type=$type, additionalProperties=$additionalProperties}" } + } - /** The type of job to start. */ - class Type @JsonCreator private constructor(private val value: JsonField) : Enum { + fun toBuilder() = Builder().from(this) - /** - * 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 { - companion object { + @JvmStatic fun builder() = Builder() + } - @JvmField val W4_FORM_EMPLOYEE_SYNC = of("w4_form_employee_sync") + /** A builder for [JobAutomatedCreateParams]. */ + @NoAutoDetect + class Builder internal constructor() { - @JvmStatic fun of(value: String) = Type(JsonField.of(value)) - } + private var body: Body? = null + private var additionalHeaders: Headers.Builder = Headers.builder() + private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() - /** An enum containing [Type]'s known values. */ - enum class Known { - W4_FORM_EMPLOYEE_SYNC - } + @JvmSynthetic + internal fun from(jobAutomatedCreateParams: JobAutomatedCreateParams) = apply { + body = jobAutomatedCreateParams.body + additionalHeaders = jobAutomatedCreateParams.additionalHeaders.toBuilder() + additionalQueryParams = jobAutomatedCreateParams.additionalQueryParams.toBuilder() + } - /** - * 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, - } + fun body(body: Body) = apply { this.body = body } - /** - * 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 - } + fun body(dataSyncAll: Body.DataSyncAll) = body(Body.ofDataSyncAll(dataSyncAll)) - /** - * 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 - else -> throw FinchInvalidDataException("Unknown Type: $value") - } + fun body(w4FormEmployeeSync: Body.W4FormEmployeeSync) = + body(Body.ofW4FormEmployeeSync(w4FormEmployeeSync)) - fun asString(): String = _value().asStringOrThrow() + fun w4FormEmployeeSyncBody(params: Body.W4FormEmployeeSync.Params) = + body( + Body.W4FormEmployeeSync.builder() + .type( + JobAutomatedCreateParams.Body.W4FormEmployeeSync.Type.W4_FORM_EMPLOYEE_SYNC + ) + .params(params) + .build() + ) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } + fun additionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.clear() + putAllAdditionalHeaders(additionalHeaders) + } - return /* spotless:off */ other is Type && value == other.value /* spotless:on */ - } + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllAdditionalHeaders(additionalHeaders) + } - override fun hashCode() = value.hashCode() + fun putAdditionalHeader(name: String, value: String) = apply { + additionalHeaders.put(name, value) + } - override fun toString() = value.toString() + fun putAdditionalHeaders(name: String, values: Iterable) = apply { + additionalHeaders.put(name, values) } - override fun equals(other: Any?): Boolean { - if (this === other) { - return true + fun putAllAdditionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.putAll(additionalHeaders) + } + + fun putAllAdditionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.putAll(additionalHeaders) + } + + fun replaceAdditionalHeaders(name: String, value: String) = apply { + additionalHeaders.replace(name, value) + } + + fun replaceAdditionalHeaders(name: String, values: Iterable) = apply { + additionalHeaders.replace(name, values) + } + + fun replaceAllAdditionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.replaceAll(additionalHeaders) + } + + fun replaceAllAdditionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.replaceAll(additionalHeaders) + } + + fun removeAdditionalHeaders(name: String) = apply { additionalHeaders.remove(name) } + + fun removeAllAdditionalHeaders(names: Set) = apply { + additionalHeaders.removeAll(names) + } + + fun additionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.clear() + putAllAdditionalQueryParams(additionalQueryParams) + } + + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllAdditionalQueryParams(additionalQueryParams) + } + + fun putAdditionalQueryParam(key: String, value: String) = apply { + additionalQueryParams.put(key, value) + } + + fun putAdditionalQueryParams(key: String, values: Iterable) = apply { + additionalQueryParams.put(key, values) + } + + fun putAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.putAll(additionalQueryParams) + } + + fun putAllAdditionalQueryParams(additionalQueryParams: Map>) = + apply { + this.additionalQueryParams.putAll(additionalQueryParams) } - return /* spotless:off */ other is W4FormEmployeeSync && params == other.params && type == other.type && additionalProperties == other.additionalProperties /* spotless:on */ + fun replaceAdditionalQueryParams(key: String, value: String) = apply { + additionalQueryParams.replace(key, value) + } + + fun replaceAdditionalQueryParams(key: String, values: Iterable) = apply { + additionalQueryParams.replace(key, values) + } + + fun replaceAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.replaceAll(additionalQueryParams) } - /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(params, type, additionalProperties) } - /* spotless:on */ + fun replaceAllAdditionalQueryParams(additionalQueryParams: Map>) = + apply { + this.additionalQueryParams.replaceAll(additionalQueryParams) + } - override fun hashCode(): Int = hashCode + fun removeAdditionalQueryParams(key: String) = apply { additionalQueryParams.remove(key) } - override fun toString() = - "W4FormEmployeeSync{params=$params, type=$type, additionalProperties=$additionalProperties}" + fun removeAllAdditionalQueryParams(keys: Set) = apply { + additionalQueryParams.removeAll(keys) + } + + fun build(): JobAutomatedCreateParams = + JobAutomatedCreateParams( + checkRequired("body", body), + additionalHeaders.build(), + additionalQueryParams.build(), + ) } override fun equals(other: Any?): Boolean { 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 86d06978..7379952c 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 @@ -27,7 +27,7 @@ import java.util.Optional */ class RequestForwardingForwardParams private constructor( - private val body: RequestForwardingForwardBody, + private val body: Body, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, ) : Params { @@ -87,7 +87,7 @@ private constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun _body(): RequestForwardingForwardBody = body + @JvmSynthetic internal fun _body(): Body = body override fun _headers(): Headers = additionalHeaders @@ -95,9 +95,9 @@ private constructor( /** Forward Request Body */ @NoAutoDetect - class RequestForwardingForwardBody + class Body @JsonCreator - internal constructor( + private constructor( @JsonProperty("method") @ExcludeMissing private val method: JsonField = JsonMissing.of(), @@ -168,7 +168,7 @@ private constructor( private var validated: Boolean = false - fun validate(): RequestForwardingForwardBody = apply { + fun validate(): Body = apply { if (validated) { return@apply } @@ -186,7 +186,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [RequestForwardingForwardBody]. */ + /** A builder for [Body]. */ class Builder internal constructor() { private var method: JsonField? = null @@ -197,14 +197,13 @@ private constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(requestForwardingForwardBody: RequestForwardingForwardBody) = apply { - method = requestForwardingForwardBody.method - route = requestForwardingForwardBody.route - data = requestForwardingForwardBody.data - headers = requestForwardingForwardBody.headers - params = requestForwardingForwardBody.params - additionalProperties = - requestForwardingForwardBody.additionalProperties.toMutableMap() + internal fun from(body: Body) = apply { + method = body.method + route = body.route + data = body.data + headers = body.headers + params = body.params + additionalProperties = body.additionalProperties.toMutableMap() } /** @@ -283,8 +282,8 @@ private constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): RequestForwardingForwardBody = - RequestForwardingForwardBody( + fun build(): Body = + Body( checkRequired("method", method), checkRequired("route", route), data, @@ -299,7 +298,7 @@ private constructor( return true } - return /* spotless:off */ other is RequestForwardingForwardBody && method == other.method && route == other.route && data == other.data && headers == other.headers && params == other.params && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Body && method == other.method && route == other.route && data == other.data && headers == other.headers && params == other.params && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ @@ -309,7 +308,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "RequestForwardingForwardBody{method=$method, route=$route, data=$data, headers=$headers, params=$params, additionalProperties=$additionalProperties}" + "Body{method=$method, route=$route, data=$data, headers=$headers, params=$params, additionalProperties=$additionalProperties}" } fun toBuilder() = Builder().from(this) @@ -323,8 +322,7 @@ private constructor( @NoAutoDetect class Builder internal constructor() { - private var body: RequestForwardingForwardBody.Builder = - RequestForwardingForwardBody.builder() + private var body: Body.Builder = Body.builder() 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/SandboxCompanyUpdateParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxCompanyUpdateParams.kt index 10f02d49..388c14ba 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 @@ -25,7 +25,7 @@ import java.util.Optional /** Update a sandbox company's data */ class SandboxCompanyUpdateParams private constructor( - private val body: SandboxCompanyUpdateBody, + private val body: CompanyWithoutId, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, ) : Params { @@ -82,16 +82,16 @@ private constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun _body(): SandboxCompanyUpdateBody = body + @JvmSynthetic internal fun _body(): CompanyWithoutId = body override fun _headers(): Headers = additionalHeaders override fun _queryParams(): QueryParams = additionalQueryParams @NoAutoDetect - class SandboxCompanyUpdateBody + class CompanyWithoutId @JsonCreator - internal constructor( + private constructor( @JsonProperty("accounts") @ExcludeMissing private val accounts: JsonField> = JsonMissing.of(), @@ -185,7 +185,7 @@ private constructor( private var validated: Boolean = false - fun validate(): SandboxCompanyUpdateBody = apply { + fun validate(): CompanyWithoutId = apply { if (validated) { return@apply } @@ -208,7 +208,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [SandboxCompanyUpdateBody]. */ + /** A builder for [CompanyWithoutId]. */ class Builder internal constructor() { private var accounts: JsonField>? = null @@ -222,16 +222,16 @@ private constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(sandboxCompanyUpdateBody: SandboxCompanyUpdateBody) = apply { - accounts = sandboxCompanyUpdateBody.accounts.map { it.toMutableList() } - departments = sandboxCompanyUpdateBody.departments.map { it.toMutableList() } - ein = sandboxCompanyUpdateBody.ein - entity = sandboxCompanyUpdateBody.entity - legalName = sandboxCompanyUpdateBody.legalName - locations = sandboxCompanyUpdateBody.locations.map { it.toMutableList() } - primaryEmail = sandboxCompanyUpdateBody.primaryEmail - primaryPhoneNumber = sandboxCompanyUpdateBody.primaryPhoneNumber - additionalProperties = sandboxCompanyUpdateBody.additionalProperties.toMutableMap() + internal fun from(companyWithoutId: CompanyWithoutId) = apply { + accounts = companyWithoutId.accounts.map { it.toMutableList() } + departments = companyWithoutId.departments.map { it.toMutableList() } + ein = companyWithoutId.ein + entity = companyWithoutId.entity + legalName = companyWithoutId.legalName + locations = companyWithoutId.locations.map { it.toMutableList() } + primaryEmail = companyWithoutId.primaryEmail + primaryPhoneNumber = companyWithoutId.primaryPhoneNumber + additionalProperties = companyWithoutId.additionalProperties.toMutableMap() } /** An array of bank account objects associated with the payroll/HRIS system. */ @@ -379,8 +379,8 @@ private constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): SandboxCompanyUpdateBody = - SandboxCompanyUpdateBody( + fun build(): CompanyWithoutId = + CompanyWithoutId( checkRequired("accounts", accounts).map { it.toImmutable() }, checkRequired("departments", departments).map { it.toImmutable() }, checkRequired("ein", ein), @@ -398,7 +398,7 @@ private constructor( return true } - return /* spotless:off */ other is SandboxCompanyUpdateBody && accounts == other.accounts && departments == other.departments && ein == other.ein && entity == other.entity && legalName == other.legalName && locations == other.locations && primaryEmail == other.primaryEmail && primaryPhoneNumber == other.primaryPhoneNumber && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is CompanyWithoutId && accounts == other.accounts && departments == other.departments && ein == other.ein && entity == other.entity && legalName == other.legalName && locations == other.locations && primaryEmail == other.primaryEmail && primaryPhoneNumber == other.primaryPhoneNumber && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ @@ -408,7 +408,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "SandboxCompanyUpdateBody{accounts=$accounts, departments=$departments, ein=$ein, entity=$entity, legalName=$legalName, locations=$locations, primaryEmail=$primaryEmail, primaryPhoneNumber=$primaryPhoneNumber, additionalProperties=$additionalProperties}" + "CompanyWithoutId{accounts=$accounts, departments=$departments, ein=$ein, entity=$entity, legalName=$legalName, locations=$locations, primaryEmail=$primaryEmail, primaryPhoneNumber=$primaryPhoneNumber, additionalProperties=$additionalProperties}" } fun toBuilder() = Builder().from(this) @@ -422,7 +422,7 @@ private constructor( @NoAutoDetect class Builder internal constructor() { - private var body: SandboxCompanyUpdateBody.Builder = SandboxCompanyUpdateBody.builder() + private var body: CompanyWithoutId.Builder = CompanyWithoutId.builder() 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/SandboxConnectionAccountCreateParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxConnectionAccountCreateParams.kt index c14fc852..2ea08c1b 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 @@ -25,7 +25,7 @@ import java.util.Optional /** Create a new account for an existing connection (company/provider pair) */ class SandboxConnectionAccountCreateParams private constructor( - private val body: SandboxConnectionAccountCreateBody, + private val body: Body, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, ) : Params { @@ -62,16 +62,16 @@ private constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun _body(): SandboxConnectionAccountCreateBody = body + @JvmSynthetic internal fun _body(): Body = body override fun _headers(): Headers = additionalHeaders override fun _queryParams(): QueryParams = additionalQueryParams @NoAutoDetect - class SandboxConnectionAccountCreateBody + class Body @JsonCreator - internal constructor( + private constructor( @JsonProperty("company_id") @ExcludeMissing private val companyId: JsonField = JsonMissing.of(), @@ -128,7 +128,7 @@ private constructor( private var validated: Boolean = false - fun validate(): SandboxConnectionAccountCreateBody = apply { + fun validate(): Body = apply { if (validated) { return@apply } @@ -147,7 +147,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [SandboxConnectionAccountCreateBody]. */ + /** A builder for [Body]. */ class Builder internal constructor() { private var companyId: JsonField? = null @@ -157,15 +157,12 @@ private constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from( - sandboxConnectionAccountCreateBody: SandboxConnectionAccountCreateBody - ) = apply { - companyId = sandboxConnectionAccountCreateBody.companyId - providerId = sandboxConnectionAccountCreateBody.providerId - authenticationType = sandboxConnectionAccountCreateBody.authenticationType - products = sandboxConnectionAccountCreateBody.products.map { it.toMutableList() } - additionalProperties = - sandboxConnectionAccountCreateBody.additionalProperties.toMutableMap() + internal fun from(body: Body) = apply { + companyId = body.companyId + providerId = body.providerId + authenticationType = body.authenticationType + products = body.products.map { it.toMutableList() } + additionalProperties = body.additionalProperties.toMutableMap() } fun companyId(companyId: String) = companyId(JsonField.of(companyId)) @@ -235,8 +232,8 @@ private constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): SandboxConnectionAccountCreateBody = - SandboxConnectionAccountCreateBody( + fun build(): Body = + Body( checkRequired("companyId", companyId), checkRequired("providerId", providerId), authenticationType, @@ -250,7 +247,7 @@ private constructor( return true } - return /* spotless:off */ other is SandboxConnectionAccountCreateBody && companyId == other.companyId && providerId == other.providerId && authenticationType == other.authenticationType && products == other.products && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Body && companyId == other.companyId && providerId == other.providerId && authenticationType == other.authenticationType && products == other.products && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ @@ -260,7 +257,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "SandboxConnectionAccountCreateBody{companyId=$companyId, providerId=$providerId, authenticationType=$authenticationType, products=$products, additionalProperties=$additionalProperties}" + "Body{companyId=$companyId, providerId=$providerId, authenticationType=$authenticationType, products=$products, additionalProperties=$additionalProperties}" } fun toBuilder() = Builder().from(this) @@ -274,8 +271,7 @@ private constructor( @NoAutoDetect class Builder internal constructor() { - private var body: SandboxConnectionAccountCreateBody.Builder = - SandboxConnectionAccountCreateBody.builder() + private var body: Body.Builder = Body.builder() 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/SandboxConnectionAccountUpdateParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxConnectionAccountUpdateParams.kt index f5605cb7..c487b917 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 @@ -25,7 +25,7 @@ import java.util.Optional */ class SandboxConnectionAccountUpdateParams private constructor( - private val body: SandboxConnectionAccountUpdateBody, + private val body: Body, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, ) : Params { @@ -40,16 +40,16 @@ private constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun _body(): SandboxConnectionAccountUpdateBody = body + @JvmSynthetic internal fun _body(): Body = body override fun _headers(): Headers = additionalHeaders override fun _queryParams(): QueryParams = additionalQueryParams @NoAutoDetect - class SandboxConnectionAccountUpdateBody + class Body @JsonCreator - internal constructor( + private constructor( @JsonProperty("connection_status") @ExcludeMissing private val connectionStatus: JsonField = JsonMissing.of(), @@ -70,7 +70,7 @@ private constructor( private var validated: Boolean = false - fun validate(): SandboxConnectionAccountUpdateBody = apply { + fun validate(): Body = apply { if (validated) { return@apply } @@ -86,19 +86,16 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [SandboxConnectionAccountUpdateBody]. */ + /** A builder for [Body]. */ class Builder internal constructor() { private var connectionStatus: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from( - sandboxConnectionAccountUpdateBody: SandboxConnectionAccountUpdateBody - ) = apply { - connectionStatus = sandboxConnectionAccountUpdateBody.connectionStatus - additionalProperties = - sandboxConnectionAccountUpdateBody.additionalProperties.toMutableMap() + internal fun from(body: Body) = apply { + connectionStatus = body.connectionStatus + additionalProperties = body.additionalProperties.toMutableMap() } fun connectionStatus(connectionStatus: ConnectionStatusType) = @@ -127,11 +124,7 @@ private constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): SandboxConnectionAccountUpdateBody = - SandboxConnectionAccountUpdateBody( - connectionStatus, - additionalProperties.toImmutable(), - ) + fun build(): Body = Body(connectionStatus, additionalProperties.toImmutable()) } override fun equals(other: Any?): Boolean { @@ -139,7 +132,7 @@ private constructor( return true } - return /* spotless:off */ other is SandboxConnectionAccountUpdateBody && connectionStatus == other.connectionStatus && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Body && connectionStatus == other.connectionStatus && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ @@ -149,7 +142,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "SandboxConnectionAccountUpdateBody{connectionStatus=$connectionStatus, additionalProperties=$additionalProperties}" + "Body{connectionStatus=$connectionStatus, additionalProperties=$additionalProperties}" } fun toBuilder() = Builder().from(this) @@ -163,8 +156,7 @@ private constructor( @NoAutoDetect class Builder internal constructor() { - private var body: SandboxConnectionAccountUpdateBody.Builder = - SandboxConnectionAccountUpdateBody.builder() + private var body: Body.Builder = Body.builder() 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/SandboxConnectionCreateParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxConnectionCreateParams.kt index 9f0e6568..0c1718a9 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 @@ -25,7 +25,7 @@ import java.util.Optional /** Create a new connection (new company/provider pair) with a new account */ class SandboxConnectionCreateParams private constructor( - private val body: SandboxConnectionCreateBody, + private val body: Body, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, ) : Params { @@ -64,16 +64,16 @@ private constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun _body(): SandboxConnectionCreateBody = body + @JvmSynthetic internal fun _body(): Body = body override fun _headers(): Headers = additionalHeaders override fun _queryParams(): QueryParams = additionalQueryParams @NoAutoDetect - class SandboxConnectionCreateBody + class Body @JsonCreator - internal constructor( + private constructor( @JsonProperty("provider_id") @ExcludeMissing private val providerId: JsonField = JsonMissing.of(), @@ -135,7 +135,7 @@ private constructor( private var validated: Boolean = false - fun validate(): SandboxConnectionCreateBody = apply { + fun validate(): Body = apply { if (validated) { return@apply } @@ -154,7 +154,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [SandboxConnectionCreateBody]. */ + /** A builder for [Body]. */ class Builder internal constructor() { private var providerId: JsonField? = null @@ -164,13 +164,12 @@ private constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(sandboxConnectionCreateBody: SandboxConnectionCreateBody) = apply { - providerId = sandboxConnectionCreateBody.providerId - authenticationType = sandboxConnectionCreateBody.authenticationType - employeeSize = sandboxConnectionCreateBody.employeeSize - products = sandboxConnectionCreateBody.products.map { it.toMutableList() } - additionalProperties = - sandboxConnectionCreateBody.additionalProperties.toMutableMap() + internal fun from(body: Body) = apply { + providerId = body.providerId + authenticationType = body.authenticationType + employeeSize = body.employeeSize + products = body.products.map { it.toMutableList() } + additionalProperties = body.additionalProperties.toMutableMap() } /** The provider associated with the connection */ @@ -240,8 +239,8 @@ private constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): SandboxConnectionCreateBody = - SandboxConnectionCreateBody( + fun build(): Body = + Body( checkRequired("providerId", providerId), authenticationType, employeeSize, @@ -255,7 +254,7 @@ private constructor( return true } - return /* spotless:off */ other is SandboxConnectionCreateBody && providerId == other.providerId && authenticationType == other.authenticationType && employeeSize == other.employeeSize && products == other.products && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Body && providerId == other.providerId && authenticationType == other.authenticationType && employeeSize == other.employeeSize && products == other.products && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ @@ -265,7 +264,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "SandboxConnectionCreateBody{providerId=$providerId, authenticationType=$authenticationType, employeeSize=$employeeSize, products=$products, additionalProperties=$additionalProperties}" + "Body{providerId=$providerId, authenticationType=$authenticationType, employeeSize=$employeeSize, products=$products, additionalProperties=$additionalProperties}" } fun toBuilder() = Builder().from(this) @@ -279,8 +278,7 @@ private constructor( @NoAutoDetect class Builder internal constructor() { - private var body: SandboxConnectionCreateBody.Builder = - SandboxConnectionCreateBody.builder() + private var body: Body.Builder = Body.builder() 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/SandboxDirectoryCreateParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxDirectoryCreateParams.kt index a9399f8b..14462260 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 @@ -46,148 +46,6 @@ private constructor( override fun _queryParams(): QueryParams = additionalQueryParams - fun toBuilder() = Builder().from(this) - - companion object { - - @JvmStatic fun builder() = Builder() - } - - /** A builder for [SandboxDirectoryCreateParams]. */ - @NoAutoDetect - class Builder internal constructor() { - - private var body: MutableList? = null - private var additionalHeaders: Headers.Builder = Headers.builder() - private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() - - @JvmSynthetic - internal fun from(sandboxDirectoryCreateParams: SandboxDirectoryCreateParams) = apply { - body = sandboxDirectoryCreateParams.body.toMutableList() - additionalHeaders = sandboxDirectoryCreateParams.additionalHeaders.toBuilder() - additionalQueryParams = sandboxDirectoryCreateParams.additionalQueryParams.toBuilder() - } - - /** - * Array of individuals to create. Takes all combined fields from `/individual` and - * `/employment` endpoints. All fields are optional. - */ - fun body(body: List) = apply { this.body = body.toMutableList() } - - /** - * Array of individuals to create. Takes all combined fields from `/individual` and - * `/employment` endpoints. All fields are optional. - */ - fun addBody(body: IndividualOrEmployment) = apply { - this.body = (this.body ?: mutableListOf()).apply { add(body) } - } - - fun additionalHeaders(additionalHeaders: Headers) = apply { - this.additionalHeaders.clear() - putAllAdditionalHeaders(additionalHeaders) - } - - fun additionalHeaders(additionalHeaders: Map>) = apply { - this.additionalHeaders.clear() - putAllAdditionalHeaders(additionalHeaders) - } - - fun putAdditionalHeader(name: String, value: String) = apply { - additionalHeaders.put(name, value) - } - - fun putAdditionalHeaders(name: String, values: Iterable) = apply { - additionalHeaders.put(name, values) - } - - fun putAllAdditionalHeaders(additionalHeaders: Headers) = apply { - this.additionalHeaders.putAll(additionalHeaders) - } - - fun putAllAdditionalHeaders(additionalHeaders: Map>) = apply { - this.additionalHeaders.putAll(additionalHeaders) - } - - fun replaceAdditionalHeaders(name: String, value: String) = apply { - additionalHeaders.replace(name, value) - } - - fun replaceAdditionalHeaders(name: String, values: Iterable) = apply { - additionalHeaders.replace(name, values) - } - - fun replaceAllAdditionalHeaders(additionalHeaders: Headers) = apply { - this.additionalHeaders.replaceAll(additionalHeaders) - } - - fun replaceAllAdditionalHeaders(additionalHeaders: Map>) = apply { - this.additionalHeaders.replaceAll(additionalHeaders) - } - - fun removeAdditionalHeaders(name: String) = apply { additionalHeaders.remove(name) } - - fun removeAllAdditionalHeaders(names: Set) = apply { - additionalHeaders.removeAll(names) - } - - fun additionalQueryParams(additionalQueryParams: QueryParams) = apply { - this.additionalQueryParams.clear() - putAllAdditionalQueryParams(additionalQueryParams) - } - - fun additionalQueryParams(additionalQueryParams: Map>) = apply { - this.additionalQueryParams.clear() - putAllAdditionalQueryParams(additionalQueryParams) - } - - fun putAdditionalQueryParam(key: String, value: String) = apply { - additionalQueryParams.put(key, value) - } - - fun putAdditionalQueryParams(key: String, values: Iterable) = apply { - additionalQueryParams.put(key, values) - } - - fun putAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply { - this.additionalQueryParams.putAll(additionalQueryParams) - } - - fun putAllAdditionalQueryParams(additionalQueryParams: Map>) = - apply { - this.additionalQueryParams.putAll(additionalQueryParams) - } - - fun replaceAdditionalQueryParams(key: String, value: String) = apply { - additionalQueryParams.replace(key, value) - } - - fun replaceAdditionalQueryParams(key: String, values: Iterable) = apply { - additionalQueryParams.replace(key, values) - } - - fun replaceAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply { - this.additionalQueryParams.replaceAll(additionalQueryParams) - } - - fun replaceAllAdditionalQueryParams(additionalQueryParams: Map>) = - apply { - this.additionalQueryParams.replaceAll(additionalQueryParams) - } - - fun removeAdditionalQueryParams(key: String) = apply { additionalQueryParams.remove(key) } - - fun removeAllAdditionalQueryParams(keys: Set) = apply { - additionalQueryParams.removeAll(keys) - } - - fun build(): SandboxDirectoryCreateParams = - SandboxDirectoryCreateParams( - checkRequired("body", body).toImmutable(), - additionalHeaders.build(), - additionalQueryParams.build(), - ) - } - @NoAutoDetect class IndividualOrEmployment @JsonCreator @@ -269,8 +127,6 @@ private constructor( @JsonProperty("title") @ExcludeMissing private val title: JsonField = JsonMissing.of(), - @JsonAnySetter - private val additionalProperties: Map = immutableEmptyMap(), ) { /** Worker's compensation classification code for this employee */ @@ -483,10 +339,6 @@ private constructor( /** The current title of the individual. */ @JsonProperty("title") @ExcludeMissing fun _title(): JsonField = title - @JsonAnyGetter - @ExcludeMissing - fun _additionalProperties(): Map = additionalProperties - private var validated: Boolean = false fun validate(): IndividualOrEmployment = apply { @@ -561,7 +413,6 @@ private constructor( private var ssn: JsonField = JsonMissing.of() private var startDate: JsonField = JsonMissing.of() private var title: JsonField = JsonMissing.of() - private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(individualOrEmployment: IndividualOrEmployment) = apply { @@ -592,7 +443,6 @@ private constructor( ssn = individualOrEmployment.ssn startDate = individualOrEmployment.startDate title = individualOrEmployment.title - additionalProperties = individualOrEmployment.additionalProperties.toMutableMap() } /** Worker's compensation classification code for this employee */ @@ -944,25 +794,6 @@ private constructor( /** The current title of the individual. */ fun title(title: JsonField) = apply { this.title = title } - 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(): IndividualOrEmployment = IndividualOrEmployment( classCode, @@ -992,7 +823,6 @@ private constructor( ssn, startDate, title, - additionalProperties.toImmutable(), ) } @@ -2430,17 +2260,159 @@ private constructor( return true } - return /* spotless:off */ other is IndividualOrEmployment && classCode == other.classCode && customFields == other.customFields && department == other.department && dob == other.dob && emails == other.emails && employment == other.employment && employmentStatus == other.employmentStatus && encryptedSsn == other.encryptedSsn && endDate == other.endDate && ethnicity == other.ethnicity && firstName == other.firstName && gender == other.gender && income == other.income && incomeHistory == other.incomeHistory && isActive == other.isActive && lastName == other.lastName && latestRehireDate == other.latestRehireDate && location == other.location && manager == other.manager && middleName == other.middleName && phoneNumbers == other.phoneNumbers && preferredName == other.preferredName && residence == other.residence && sourceId == other.sourceId && ssn == other.ssn && startDate == other.startDate && title == other.title && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is IndividualOrEmployment && classCode == other.classCode && customFields == other.customFields && department == other.department && dob == other.dob && emails == other.emails && employment == other.employment && employmentStatus == other.employmentStatus && encryptedSsn == other.encryptedSsn && endDate == other.endDate && ethnicity == other.ethnicity && firstName == other.firstName && gender == other.gender && income == other.income && incomeHistory == other.incomeHistory && isActive == other.isActive && lastName == other.lastName && latestRehireDate == other.latestRehireDate && location == other.location && manager == other.manager && middleName == other.middleName && phoneNumbers == other.phoneNumbers && preferredName == other.preferredName && residence == other.residence && sourceId == other.sourceId && ssn == other.ssn && startDate == other.startDate && title == other.title /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(classCode, customFields, department, dob, emails, employment, employmentStatus, encryptedSsn, endDate, ethnicity, firstName, gender, income, incomeHistory, isActive, lastName, latestRehireDate, location, manager, middleName, phoneNumbers, preferredName, residence, sourceId, ssn, startDate, title, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(classCode, customFields, department, dob, emails, employment, employmentStatus, encryptedSsn, endDate, ethnicity, firstName, gender, income, incomeHistory, isActive, lastName, latestRehireDate, location, manager, middleName, phoneNumbers, preferredName, residence, sourceId, ssn, startDate, title) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "IndividualOrEmployment{classCode=$classCode, customFields=$customFields, department=$department, dob=$dob, emails=$emails, employment=$employment, employmentStatus=$employmentStatus, encryptedSsn=$encryptedSsn, endDate=$endDate, ethnicity=$ethnicity, firstName=$firstName, gender=$gender, income=$income, incomeHistory=$incomeHistory, isActive=$isActive, lastName=$lastName, latestRehireDate=$latestRehireDate, location=$location, manager=$manager, middleName=$middleName, phoneNumbers=$phoneNumbers, preferredName=$preferredName, residence=$residence, sourceId=$sourceId, ssn=$ssn, startDate=$startDate, title=$title, additionalProperties=$additionalProperties}" + "IndividualOrEmployment{classCode=$classCode, customFields=$customFields, department=$department, dob=$dob, emails=$emails, employment=$employment, employmentStatus=$employmentStatus, encryptedSsn=$encryptedSsn, endDate=$endDate, ethnicity=$ethnicity, firstName=$firstName, gender=$gender, income=$income, incomeHistory=$incomeHistory, isActive=$isActive, lastName=$lastName, latestRehireDate=$latestRehireDate, location=$location, manager=$manager, middleName=$middleName, phoneNumbers=$phoneNumbers, preferredName=$preferredName, residence=$residence, sourceId=$sourceId, ssn=$ssn, startDate=$startDate, title=$title}" + } + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + /** A builder for [SandboxDirectoryCreateParams]. */ + @NoAutoDetect + class Builder internal constructor() { + + private var body: MutableList? = null + private var additionalHeaders: Headers.Builder = Headers.builder() + private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() + + @JvmSynthetic + internal fun from(sandboxDirectoryCreateParams: SandboxDirectoryCreateParams) = apply { + body = sandboxDirectoryCreateParams.body.toMutableList() + additionalHeaders = sandboxDirectoryCreateParams.additionalHeaders.toBuilder() + additionalQueryParams = sandboxDirectoryCreateParams.additionalQueryParams.toBuilder() + } + + /** + * Array of individuals to create. Takes all combined fields from `/individual` and + * `/employment` endpoints. All fields are optional. + */ + fun body(body: List) = apply { this.body = body.toMutableList() } + + /** + * Array of individuals to create. Takes all combined fields from `/individual` and + * `/employment` endpoints. All fields are optional. + */ + fun addBody(body: IndividualOrEmployment) = apply { + this.body = (this.body ?: mutableListOf()).apply { add(body) } + } + + fun additionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.clear() + putAllAdditionalHeaders(additionalHeaders) + } + + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllAdditionalHeaders(additionalHeaders) + } + + fun putAdditionalHeader(name: String, value: String) = apply { + additionalHeaders.put(name, value) + } + + fun putAdditionalHeaders(name: String, values: Iterable) = apply { + additionalHeaders.put(name, values) + } + + fun putAllAdditionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.putAll(additionalHeaders) + } + + fun putAllAdditionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.putAll(additionalHeaders) + } + + fun replaceAdditionalHeaders(name: String, value: String) = apply { + additionalHeaders.replace(name, value) + } + + fun replaceAdditionalHeaders(name: String, values: Iterable) = apply { + additionalHeaders.replace(name, values) + } + + fun replaceAllAdditionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.replaceAll(additionalHeaders) + } + + fun replaceAllAdditionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.replaceAll(additionalHeaders) + } + + fun removeAdditionalHeaders(name: String) = apply { additionalHeaders.remove(name) } + + fun removeAllAdditionalHeaders(names: Set) = apply { + additionalHeaders.removeAll(names) + } + + fun additionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.clear() + putAllAdditionalQueryParams(additionalQueryParams) + } + + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllAdditionalQueryParams(additionalQueryParams) + } + + fun putAdditionalQueryParam(key: String, value: String) = apply { + additionalQueryParams.put(key, value) + } + + fun putAdditionalQueryParams(key: String, values: Iterable) = apply { + additionalQueryParams.put(key, values) + } + + fun putAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.putAll(additionalQueryParams) + } + + fun putAllAdditionalQueryParams(additionalQueryParams: Map>) = + apply { + this.additionalQueryParams.putAll(additionalQueryParams) + } + + fun replaceAdditionalQueryParams(key: String, value: String) = apply { + additionalQueryParams.replace(key, value) + } + + fun replaceAdditionalQueryParams(key: String, values: Iterable) = apply { + additionalQueryParams.replace(key, values) + } + + fun replaceAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.replaceAll(additionalQueryParams) + } + + fun replaceAllAdditionalQueryParams(additionalQueryParams: Map>) = + apply { + this.additionalQueryParams.replaceAll(additionalQueryParams) + } + + fun removeAdditionalQueryParams(key: String) = apply { additionalQueryParams.remove(key) } + + fun removeAllAdditionalQueryParams(keys: Set) = apply { + additionalQueryParams.removeAll(keys) + } + + fun build(): SandboxDirectoryCreateParams = + SandboxDirectoryCreateParams( + checkRequired("body", body).toImmutable(), + additionalHeaders.build(), + additionalQueryParams.build(), + ) } override fun equals(other: Any?): Boolean { diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxEmploymentUpdateParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxEmploymentUpdateParams.kt index d07a6db1..4bb4060d 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 @@ -26,7 +26,7 @@ import java.util.Optional class SandboxEmploymentUpdateParams private constructor( private val individualId: String, - private val body: SandboxEmploymentUpdateBody, + private val body: EmploymentWithoutId, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, ) : Params { @@ -153,7 +153,7 @@ private constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun _body(): SandboxEmploymentUpdateBody = body + @JvmSynthetic internal fun _body(): EmploymentWithoutId = body override fun _headers(): Headers = additionalHeaders @@ -167,9 +167,9 @@ private constructor( } @NoAutoDetect - class SandboxEmploymentUpdateBody + class EmploymentWithoutId @JsonCreator - internal constructor( + private constructor( @JsonProperty("class_code") @ExcludeMissing private val classCode: JsonField = JsonMissing.of(), @@ -369,7 +369,7 @@ private constructor( private var validated: Boolean = false - fun validate(): SandboxEmploymentUpdateBody = apply { + fun validate(): EmploymentWithoutId = apply { if (validated) { return@apply } @@ -402,7 +402,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [SandboxEmploymentUpdateBody]. */ + /** A builder for [EmploymentWithoutId]. */ class Builder internal constructor() { private var classCode: JsonField = JsonMissing.of() @@ -426,27 +426,26 @@ private constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(sandboxEmploymentUpdateBody: SandboxEmploymentUpdateBody) = apply { - classCode = sandboxEmploymentUpdateBody.classCode - customFields = sandboxEmploymentUpdateBody.customFields.map { it.toMutableList() } - department = sandboxEmploymentUpdateBody.department - employment = sandboxEmploymentUpdateBody.employment - employmentStatus = sandboxEmploymentUpdateBody.employmentStatus - endDate = sandboxEmploymentUpdateBody.endDate - firstName = sandboxEmploymentUpdateBody.firstName - income = sandboxEmploymentUpdateBody.income - incomeHistory = sandboxEmploymentUpdateBody.incomeHistory.map { it.toMutableList() } - isActive = sandboxEmploymentUpdateBody.isActive - lastName = sandboxEmploymentUpdateBody.lastName - latestRehireDate = sandboxEmploymentUpdateBody.latestRehireDate - location = sandboxEmploymentUpdateBody.location - manager = sandboxEmploymentUpdateBody.manager - middleName = sandboxEmploymentUpdateBody.middleName - sourceId = sandboxEmploymentUpdateBody.sourceId - startDate = sandboxEmploymentUpdateBody.startDate - title = sandboxEmploymentUpdateBody.title - additionalProperties = - sandboxEmploymentUpdateBody.additionalProperties.toMutableMap() + internal fun from(employmentWithoutId: EmploymentWithoutId) = apply { + classCode = employmentWithoutId.classCode + customFields = employmentWithoutId.customFields.map { it.toMutableList() } + department = employmentWithoutId.department + employment = employmentWithoutId.employment + employmentStatus = employmentWithoutId.employmentStatus + endDate = employmentWithoutId.endDate + firstName = employmentWithoutId.firstName + income = employmentWithoutId.income + incomeHistory = employmentWithoutId.incomeHistory.map { it.toMutableList() } + isActive = employmentWithoutId.isActive + lastName = employmentWithoutId.lastName + latestRehireDate = employmentWithoutId.latestRehireDate + location = employmentWithoutId.location + manager = employmentWithoutId.manager + middleName = employmentWithoutId.middleName + sourceId = employmentWithoutId.sourceId + startDate = employmentWithoutId.startDate + title = employmentWithoutId.title + additionalProperties = employmentWithoutId.additionalProperties.toMutableMap() } /** Worker's compensation classification code for this employee */ @@ -684,8 +683,8 @@ private constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): SandboxEmploymentUpdateBody = - SandboxEmploymentUpdateBody( + fun build(): EmploymentWithoutId = + EmploymentWithoutId( classCode, (customFields ?: JsonMissing.of()).map { it.toImmutable() }, department, @@ -713,7 +712,7 @@ private constructor( return true } - return /* spotless:off */ other is SandboxEmploymentUpdateBody && classCode == other.classCode && customFields == other.customFields && department == other.department && employment == other.employment && employmentStatus == other.employmentStatus && endDate == other.endDate && firstName == other.firstName && income == other.income && incomeHistory == other.incomeHistory && isActive == other.isActive && lastName == other.lastName && latestRehireDate == other.latestRehireDate && location == other.location && manager == other.manager && middleName == other.middleName && sourceId == other.sourceId && startDate == other.startDate && title == other.title && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is EmploymentWithoutId && classCode == other.classCode && customFields == other.customFields && department == other.department && employment == other.employment && employmentStatus == other.employmentStatus && endDate == other.endDate && firstName == other.firstName && income == other.income && incomeHistory == other.incomeHistory && isActive == other.isActive && lastName == other.lastName && latestRehireDate == other.latestRehireDate && location == other.location && manager == other.manager && middleName == other.middleName && sourceId == other.sourceId && startDate == other.startDate && title == other.title && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ @@ -723,7 +722,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "SandboxEmploymentUpdateBody{classCode=$classCode, customFields=$customFields, department=$department, employment=$employment, employmentStatus=$employmentStatus, endDate=$endDate, firstName=$firstName, income=$income, incomeHistory=$incomeHistory, isActive=$isActive, lastName=$lastName, latestRehireDate=$latestRehireDate, location=$location, manager=$manager, middleName=$middleName, sourceId=$sourceId, startDate=$startDate, title=$title, additionalProperties=$additionalProperties}" + "EmploymentWithoutId{classCode=$classCode, customFields=$customFields, department=$department, employment=$employment, employmentStatus=$employmentStatus, endDate=$endDate, firstName=$firstName, income=$income, incomeHistory=$incomeHistory, isActive=$isActive, lastName=$lastName, latestRehireDate=$latestRehireDate, location=$location, manager=$manager, middleName=$middleName, sourceId=$sourceId, startDate=$startDate, title=$title, additionalProperties=$additionalProperties}" } fun toBuilder() = Builder().from(this) @@ -738,8 +737,7 @@ private constructor( class Builder internal constructor() { private var individualId: String? = null - private var body: SandboxEmploymentUpdateBody.Builder = - SandboxEmploymentUpdateBody.builder() + private var body: EmploymentWithoutId.Builder = EmploymentWithoutId.builder() 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/SandboxIndividualUpdateParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxIndividualUpdateParams.kt index 4df0b489..490b56fc 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 @@ -26,7 +26,7 @@ import java.util.Optional class SandboxIndividualUpdateParams private constructor( private val individualId: String, - private val body: SandboxIndividualUpdateBody, + private val body: IndividualWithoutId, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, ) : Params { @@ -119,7 +119,7 @@ private constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun _body(): SandboxIndividualUpdateBody = body + @JvmSynthetic internal fun _body(): IndividualWithoutId = body override fun _headers(): Headers = additionalHeaders @@ -133,9 +133,9 @@ private constructor( } @NoAutoDetect - class SandboxIndividualUpdateBody + class IndividualWithoutId @JsonCreator - internal constructor( + private constructor( @JsonProperty("dob") @ExcludeMissing private val dob: JsonField = JsonMissing.of(), @JsonProperty("emails") @ExcludeMissing @@ -274,7 +274,7 @@ private constructor( private var validated: Boolean = false - fun validate(): SandboxIndividualUpdateBody = apply { + fun validate(): IndividualWithoutId = apply { if (validated) { return@apply } @@ -301,7 +301,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [SandboxIndividualUpdateBody]. */ + /** A builder for [IndividualWithoutId]. */ class Builder internal constructor() { private var dob: JsonField = JsonMissing.of() @@ -319,21 +319,20 @@ private constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(sandboxIndividualUpdateBody: SandboxIndividualUpdateBody) = apply { - dob = sandboxIndividualUpdateBody.dob - emails = sandboxIndividualUpdateBody.emails.map { it.toMutableList() } - encryptedSsn = sandboxIndividualUpdateBody.encryptedSsn - ethnicity = sandboxIndividualUpdateBody.ethnicity - firstName = sandboxIndividualUpdateBody.firstName - gender = sandboxIndividualUpdateBody.gender - lastName = sandboxIndividualUpdateBody.lastName - middleName = sandboxIndividualUpdateBody.middleName - phoneNumbers = sandboxIndividualUpdateBody.phoneNumbers.map { it.toMutableList() } - preferredName = sandboxIndividualUpdateBody.preferredName - residence = sandboxIndividualUpdateBody.residence - ssn = sandboxIndividualUpdateBody.ssn - additionalProperties = - sandboxIndividualUpdateBody.additionalProperties.toMutableMap() + internal fun from(individualWithoutId: IndividualWithoutId) = apply { + dob = individualWithoutId.dob + emails = individualWithoutId.emails.map { it.toMutableList() } + encryptedSsn = individualWithoutId.encryptedSsn + ethnicity = individualWithoutId.ethnicity + firstName = individualWithoutId.firstName + gender = individualWithoutId.gender + lastName = individualWithoutId.lastName + middleName = individualWithoutId.middleName + phoneNumbers = individualWithoutId.phoneNumbers.map { it.toMutableList() } + preferredName = individualWithoutId.preferredName + residence = individualWithoutId.residence + ssn = individualWithoutId.ssn + additionalProperties = individualWithoutId.additionalProperties.toMutableMap() } fun dob(dob: String?) = dob(JsonField.ofNullable(dob)) @@ -515,8 +514,8 @@ private constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): SandboxIndividualUpdateBody = - SandboxIndividualUpdateBody( + fun build(): IndividualWithoutId = + IndividualWithoutId( dob, (emails ?: JsonMissing.of()).map { it.toImmutable() }, encryptedSsn, @@ -538,7 +537,7 @@ private constructor( return true } - return /* spotless:off */ other is SandboxIndividualUpdateBody && dob == other.dob && emails == other.emails && encryptedSsn == other.encryptedSsn && ethnicity == other.ethnicity && firstName == other.firstName && gender == other.gender && lastName == other.lastName && middleName == other.middleName && phoneNumbers == other.phoneNumbers && preferredName == other.preferredName && residence == other.residence && ssn == other.ssn && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is IndividualWithoutId && dob == other.dob && emails == other.emails && encryptedSsn == other.encryptedSsn && ethnicity == other.ethnicity && firstName == other.firstName && gender == other.gender && lastName == other.lastName && middleName == other.middleName && phoneNumbers == other.phoneNumbers && preferredName == other.preferredName && residence == other.residence && ssn == other.ssn && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ @@ -548,7 +547,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "SandboxIndividualUpdateBody{dob=$dob, emails=$emails, encryptedSsn=$encryptedSsn, ethnicity=$ethnicity, firstName=$firstName, gender=$gender, lastName=$lastName, middleName=$middleName, phoneNumbers=$phoneNumbers, preferredName=$preferredName, residence=$residence, ssn=$ssn, additionalProperties=$additionalProperties}" + "IndividualWithoutId{dob=$dob, emails=$emails, encryptedSsn=$encryptedSsn, ethnicity=$ethnicity, firstName=$firstName, gender=$gender, lastName=$lastName, middleName=$middleName, phoneNumbers=$phoneNumbers, preferredName=$preferredName, residence=$residence, ssn=$ssn, additionalProperties=$additionalProperties}" } fun toBuilder() = Builder().from(this) @@ -563,8 +562,7 @@ private constructor( class Builder internal constructor() { private var individualId: String? = null - private var body: SandboxIndividualUpdateBody.Builder = - SandboxIndividualUpdateBody.builder() + private var body: IndividualWithoutId.Builder = IndividualWithoutId.builder() 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 f30d929d..72a0a4d2 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 @@ -2,171 +2,37 @@ package com.tryfinch.api.models -import com.fasterxml.jackson.annotation.JsonAnyGetter -import com.fasterxml.jackson.annotation.JsonAnySetter -import com.fasterxml.jackson.annotation.JsonCreator -import com.fasterxml.jackson.annotation.JsonProperty -import com.tryfinch.api.core.Enum -import com.tryfinch.api.core.ExcludeMissing -import com.tryfinch.api.core.JsonField -import com.tryfinch.api.core.JsonMissing import com.tryfinch.api.core.JsonValue import com.tryfinch.api.core.NoAutoDetect import com.tryfinch.api.core.Params 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 -import com.tryfinch.api.core.toImmutable -import com.tryfinch.api.errors.FinchInvalidDataException import java.util.Objects /** Update configurations for sandbox jobs */ class SandboxJobConfigurationUpdateParams private constructor( - private val body: SandboxJobConfigurationUpdateBody, + private val sandboxJobConfiguration: SandboxJobConfiguration, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, ) : Params { - fun completionStatus(): CompletionStatus = body.completionStatus() + fun sandboxJobConfiguration(): SandboxJobConfiguration = sandboxJobConfiguration - fun type(): Type = body.type() - - fun _completionStatus(): JsonField = body._completionStatus() - - fun _type(): JsonField = body._type() - - fun _additionalBodyProperties(): Map = body._additionalProperties() + fun _additionalBodyProperties(): Map = + sandboxJobConfiguration._additionalProperties() fun _additionalHeaders(): Headers = additionalHeaders fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun _body(): SandboxJobConfigurationUpdateBody = body + @JvmSynthetic internal fun _body(): SandboxJobConfiguration = sandboxJobConfiguration override fun _headers(): Headers = additionalHeaders override fun _queryParams(): QueryParams = additionalQueryParams - @NoAutoDetect - class SandboxJobConfigurationUpdateBody - @JsonCreator - internal constructor( - @JsonProperty("completion_status") - @ExcludeMissing - private val completionStatus: JsonField = JsonMissing.of(), - @JsonProperty("type") @ExcludeMissing private val type: JsonField = JsonMissing.of(), - @JsonAnySetter - private val additionalProperties: Map = immutableEmptyMap(), - ) { - - fun completionStatus(): CompletionStatus = completionStatus.getRequired("completion_status") - - fun type(): Type = type.getRequired("type") - - @JsonProperty("completion_status") - @ExcludeMissing - fun _completionStatus(): JsonField = completionStatus - - @JsonProperty("type") @ExcludeMissing fun _type(): JsonField = type - - @JsonAnyGetter - @ExcludeMissing - fun _additionalProperties(): Map = additionalProperties - - private var validated: Boolean = false - - fun validate(): SandboxJobConfigurationUpdateBody = apply { - if (validated) { - return@apply - } - - completionStatus() - type() - validated = true - } - - fun toBuilder() = Builder().from(this) - - companion object { - - @JvmStatic fun builder() = Builder() - } - - /** A builder for [SandboxJobConfigurationUpdateBody]. */ - class Builder internal constructor() { - - private var completionStatus: JsonField? = null - private var type: JsonField? = null - private var additionalProperties: MutableMap = mutableMapOf() - - @JvmSynthetic - internal fun from( - sandboxJobConfigurationUpdateBody: SandboxJobConfigurationUpdateBody - ) = apply { - completionStatus = sandboxJobConfigurationUpdateBody.completionStatus - type = sandboxJobConfigurationUpdateBody.type - additionalProperties = - sandboxJobConfigurationUpdateBody.additionalProperties.toMutableMap() - } - - fun completionStatus(completionStatus: CompletionStatus) = - completionStatus(JsonField.of(completionStatus)) - - fun completionStatus(completionStatus: JsonField) = apply { - this.completionStatus = completionStatus - } - - fun type(type: Type) = type(JsonField.of(type)) - - fun type(type: JsonField) = apply { this.type = type } - - fun additionalProperties(additionalProperties: Map) = apply { - this.additionalProperties.clear() - putAllAdditionalProperties(additionalProperties) - } - - 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(): SandboxJobConfigurationUpdateBody = - SandboxJobConfigurationUpdateBody( - checkRequired("completionStatus", completionStatus), - checkRequired("type", type), - additionalProperties.toImmutable(), - ) - } - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return /* spotless:off */ other is SandboxJobConfigurationUpdateBody && completionStatus == other.completionStatus && type == other.type && additionalProperties == other.additionalProperties /* spotless:on */ - } - - /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(completionStatus, type, additionalProperties) } - /* spotless:on */ - - override fun hashCode(): Int = hashCode - - override fun toString() = - "SandboxJobConfigurationUpdateBody{completionStatus=$completionStatus, type=$type, additionalProperties=$additionalProperties}" - } - fun toBuilder() = Builder().from(this) companion object { @@ -178,8 +44,7 @@ private constructor( @NoAutoDetect class Builder internal constructor() { - private var body: SandboxJobConfigurationUpdateBody.Builder = - SandboxJobConfigurationUpdateBody.builder() + private var sandboxJobConfiguration: SandboxJobConfiguration? = null private var additionalHeaders: Headers.Builder = Headers.builder() private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() @@ -187,41 +52,14 @@ private constructor( internal fun from( sandboxJobConfigurationUpdateParams: SandboxJobConfigurationUpdateParams ) = apply { - body = sandboxJobConfigurationUpdateParams.body.toBuilder() + sandboxJobConfiguration = sandboxJobConfigurationUpdateParams.sandboxJobConfiguration additionalHeaders = sandboxJobConfigurationUpdateParams.additionalHeaders.toBuilder() additionalQueryParams = sandboxJobConfigurationUpdateParams.additionalQueryParams.toBuilder() } - fun completionStatus(completionStatus: CompletionStatus) = apply { - body.completionStatus(completionStatus) - } - - fun completionStatus(completionStatus: JsonField) = apply { - body.completionStatus(completionStatus) - } - - fun type(type: Type) = apply { body.type(type) } - - fun type(type: JsonField) = apply { body.type(type) } - - fun additionalBodyProperties(additionalBodyProperties: Map) = apply { - body.additionalProperties(additionalBodyProperties) - } - - fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply { - body.putAdditionalProperty(key, value) - } - - fun putAllAdditionalBodyProperties(additionalBodyProperties: Map) = - apply { - body.putAllAdditionalProperties(additionalBodyProperties) - } - - fun removeAdditionalBodyProperty(key: String) = apply { body.removeAdditionalProperty(key) } - - fun removeAllAdditionalBodyProperties(keys: Set) = apply { - body.removeAllAdditionalProperties(keys) + fun sandboxJobConfiguration(sandboxJobConfiguration: SandboxJobConfiguration) = apply { + this.sandboxJobConfiguration = sandboxJobConfiguration } fun additionalHeaders(additionalHeaders: Headers) = apply { @@ -324,206 +162,22 @@ private constructor( fun build(): SandboxJobConfigurationUpdateParams = SandboxJobConfigurationUpdateParams( - body.build(), + checkRequired("sandboxJobConfiguration", sandboxJobConfiguration), additionalHeaders.build(), additionalQueryParams.build(), ) } - class CompletionStatus @JsonCreator 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 { - - @JvmField val COMPLETE = of("complete") - - @JvmField val REAUTH_ERROR = of("reauth_error") - - @JvmField val PERMISSIONS_ERROR = of("permissions_error") - - @JvmField val ERROR = of("error") - - @JvmStatic fun of(value: String) = CompletionStatus(JsonField.of(value)) - } - - /** An enum containing [CompletionStatus]'s known values. */ - enum class Known { - COMPLETE, - REAUTH_ERROR, - PERMISSIONS_ERROR, - 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 - REAUTH_ERROR -> Value.REAUTH_ERROR - PERMISSIONS_ERROR -> Value.PERMISSIONS_ERROR - ERROR -> Value.ERROR - 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 - REAUTH_ERROR -> Known.REAUTH_ERROR - PERMISSIONS_ERROR -> Known.PERMISSIONS_ERROR - ERROR -> Known.ERROR - else -> throw FinchInvalidDataException("Unknown CompletionStatus: $value") - } - - fun asString(): String = _value().asStringOrThrow() - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return /* spotless:off */ other is CompletionStatus && value == other.value /* spotless:on */ - } - - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() - } - - class Type @JsonCreator 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 { - - @JvmField val DATA_SYNC_ALL = of("data_sync_all") - - @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 - else -> throw FinchInvalidDataException("Unknown Type: $value") - } - - fun asString(): String = _value().asStringOrThrow() - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return /* spotless:off */ other is Type && value == other.value /* spotless:on */ - } - - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() - } - override fun equals(other: Any?): Boolean { if (this === other) { return true } - return /* spotless:off */ other is SandboxJobConfigurationUpdateParams && body == other.body && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams /* spotless:on */ + return /* spotless:off */ other is SandboxJobConfigurationUpdateParams && sandboxJobConfiguration == other.sandboxJobConfiguration && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams /* spotless:on */ } - override fun hashCode(): Int = /* spotless:off */ Objects.hash(body, additionalHeaders, additionalQueryParams) /* spotless:on */ + override fun hashCode(): Int = /* spotless:off */ Objects.hash(sandboxJobConfiguration, additionalHeaders, additionalQueryParams) /* spotless:on */ override fun toString() = - "SandboxJobConfigurationUpdateParams{body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" + "SandboxJobConfigurationUpdateParams{sandboxJobConfiguration=$sandboxJobConfiguration, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxJobCreateParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxJobCreateParams.kt index 71da1c0b..d06268dd 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 @@ -24,7 +24,7 @@ import java.util.Objects /** Enqueue a new sandbox job */ class SandboxJobCreateParams private constructor( - private val body: SandboxJobCreateBody, + private val body: Body, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, ) : Params { @@ -41,16 +41,16 @@ private constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun _body(): SandboxJobCreateBody = body + @JvmSynthetic internal fun _body(): Body = body override fun _headers(): Headers = additionalHeaders override fun _queryParams(): QueryParams = additionalQueryParams @NoAutoDetect - class SandboxJobCreateBody + class Body @JsonCreator - internal constructor( + private constructor( @JsonProperty("type") @ExcludeMissing private val type: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), @@ -68,7 +68,7 @@ private constructor( private var validated: Boolean = false - fun validate(): SandboxJobCreateBody = apply { + fun validate(): Body = apply { if (validated) { return@apply } @@ -84,16 +84,16 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [SandboxJobCreateBody]. */ + /** A builder for [Body]. */ class Builder internal constructor() { private var type: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(sandboxJobCreateBody: SandboxJobCreateBody) = apply { - type = sandboxJobCreateBody.type - additionalProperties = sandboxJobCreateBody.additionalProperties.toMutableMap() + internal fun from(body: Body) = apply { + type = body.type + additionalProperties = body.additionalProperties.toMutableMap() } /** The type of job to start. Currently the only supported type is `data_sync_all` */ @@ -121,11 +121,8 @@ private constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): SandboxJobCreateBody = - SandboxJobCreateBody( - checkRequired("type", type), - additionalProperties.toImmutable(), - ) + fun build(): Body = + Body(checkRequired("type", type), additionalProperties.toImmutable()) } override fun equals(other: Any?): Boolean { @@ -133,7 +130,7 @@ private constructor( return true } - return /* spotless:off */ other is SandboxJobCreateBody && type == other.type && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Body && type == other.type && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ @@ -142,8 +139,7 @@ private constructor( override fun hashCode(): Int = hashCode - override fun toString() = - "SandboxJobCreateBody{type=$type, additionalProperties=$additionalProperties}" + override fun toString() = "Body{type=$type, additionalProperties=$additionalProperties}" } fun toBuilder() = Builder().from(this) @@ -157,7 +153,7 @@ private constructor( @NoAutoDetect class Builder internal constructor() { - private var body: SandboxJobCreateBody.Builder = SandboxJobCreateBody.builder() + private var body: Body.Builder = Body.builder() 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/SandboxPaymentCreateParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxPaymentCreateParams.kt index 41673370..53be672c 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 @@ -24,7 +24,7 @@ import java.util.Optional /** Add a new sandbox payment */ class SandboxPaymentCreateParams private constructor( - private val body: SandboxPaymentCreateBody, + private val body: Body, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, ) : Params { @@ -47,7 +47,7 @@ private constructor( fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun _body(): SandboxPaymentCreateBody = body + @JvmSynthetic internal fun _body(): Body = body override fun _headers(): Headers = additionalHeaders @@ -58,9 +58,9 @@ private constructor( * are optional. */ @NoAutoDetect - class SandboxPaymentCreateBody + class Body @JsonCreator - internal constructor( + private constructor( @JsonProperty("end_date") @ExcludeMissing private val endDate: JsonField = JsonMissing.of(), @@ -95,7 +95,7 @@ private constructor( private var validated: Boolean = false - fun validate(): SandboxPaymentCreateBody = apply { + fun validate(): Body = apply { if (validated) { return@apply } @@ -113,7 +113,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [SandboxPaymentCreateBody]. */ + /** A builder for [Body]. */ class Builder internal constructor() { private var endDate: JsonField = JsonMissing.of() @@ -122,11 +122,11 @@ private constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(sandboxPaymentCreateBody: SandboxPaymentCreateBody) = apply { - endDate = sandboxPaymentCreateBody.endDate - payStatements = sandboxPaymentCreateBody.payStatements.map { it.toMutableList() } - startDate = sandboxPaymentCreateBody.startDate - additionalProperties = sandboxPaymentCreateBody.additionalProperties.toMutableMap() + internal fun from(body: Body) = apply { + endDate = body.endDate + payStatements = body.payStatements.map { it.toMutableList() } + startDate = body.startDate + additionalProperties = body.additionalProperties.toMutableMap() } fun endDate(endDate: String) = endDate(JsonField.of(endDate)) @@ -176,8 +176,8 @@ private constructor( keys.forEach(::removeAdditionalProperty) } - fun build(): SandboxPaymentCreateBody = - SandboxPaymentCreateBody( + fun build(): Body = + Body( endDate, (payStatements ?: JsonMissing.of()).map { it.toImmutable() }, startDate, @@ -190,7 +190,7 @@ private constructor( return true } - return /* spotless:off */ other is SandboxPaymentCreateBody && endDate == other.endDate && payStatements == other.payStatements && startDate == other.startDate && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Body && endDate == other.endDate && payStatements == other.payStatements && startDate == other.startDate && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ @@ -200,7 +200,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "SandboxPaymentCreateBody{endDate=$endDate, payStatements=$payStatements, startDate=$startDate, additionalProperties=$additionalProperties}" + "Body{endDate=$endDate, payStatements=$payStatements, startDate=$startDate, additionalProperties=$additionalProperties}" } fun toBuilder() = Builder().from(this) @@ -214,7 +214,7 @@ private constructor( @NoAutoDetect class Builder internal constructor() { - private var body: SandboxPaymentCreateBody.Builder = SandboxPaymentCreateBody.builder() + private var body: Body.Builder = Body.builder() private var additionalHeaders: Headers.Builder = Headers.builder() private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() 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 a95c01db..85f99e40 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 @@ -26,7 +26,9 @@ class AccessTokenCreateParamsTest { .clientSecret("") .redirectUri("https://example.com") .build() + val body = params._body() + assertThat(body).isNotNull assertThat(body.code()).isEqualTo("") assertThat(body.clientId()).contains("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") @@ -37,7 +39,9 @@ class AccessTokenCreateParamsTest { @Test fun bodyWithoutOptionalFields() { val params = AccessTokenCreateParams.builder().code("").build() + 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 fa0cbf4b..eb55d9c0 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 @@ -46,7 +46,9 @@ class ConnectSessionNewParamsTest { .redirectUri("redirect_uri") .sandbox(ConnectSessionNewParams.Sandbox.FINCH) .build() + val body = params._body() + assertThat(body).isNotNull assertThat(body.customerId()).isEqualTo("x") assertThat(body.customerName()).isEqualTo("x") @@ -74,7 +76,9 @@ class ConnectSessionNewParamsTest { .customerName("x") .addProduct(ConnectSessionNewParams.ConnectProducts.COMPANY) .build() + 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 8e65bd3a..cb70ff9f 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 @@ -26,7 +26,9 @@ class ConnectSessionReauthenticateParamsTest { .addProduct(ConnectSessionReauthenticateParams.ConnectProducts.COMPANY) .redirectUri("https://example.com") .build() + val body = params._body() + assertThat(body).isNotNull assertThat(body.connectionId()).isEqualTo("connection_id") assertThat(body.minutesToExpire()).contains(0L) @@ -39,7 +41,9 @@ class ConnectSessionReauthenticateParamsTest { fun bodyWithoutOptionalFields() { val params = ConnectSessionReauthenticateParams.builder().connectionId("connection_id").build() + 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 f2041397..2ab6acf8 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 @@ -24,7 +24,9 @@ class HrisBenefitCreateParamsTest { .frequency(BenefitFrequency.ONE_TIME) .type(BenefitType._401K) .build() + val body = params._body() + assertThat(body).isNotNull assertThat(body.description()).contains("description") assertThat(body.frequency()).contains(BenefitFrequency.ONE_TIME) @@ -34,7 +36,9 @@ class HrisBenefitCreateParamsTest { @Test fun bodyWithoutOptionalFields() { val params = HrisBenefitCreateParams.builder().build() + val body = params._body() + assertThat(body).isNotNull } } 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 4c52c39d..ec335459 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 @@ -22,7 +22,9 @@ class HrisBenefitIndividualUnenrollManyParamsTest { .benefitId("benefit_id") .addIndividualId("string") .build() + val body = params._body() + assertThat(body).isNotNull assertThat(body.individualIds()).contains(listOf("string")) } @@ -31,7 +33,9 @@ class HrisBenefitIndividualUnenrollManyParamsTest { fun bodyWithoutOptionalFields() { val params = HrisBenefitIndividualUnenrollManyParams.builder().benefitId("benefit_id").build() + 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 f4adeb22..14ba6378 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 @@ -19,7 +19,9 @@ class HrisBenefitUpdateParamsTest { .benefitId("benefit_id") .description("description") .build() + val body = params._body() + assertThat(body).isNotNull assertThat(body.description()).contains("description") } @@ -27,7 +29,9 @@ class HrisBenefitUpdateParamsTest { @Test fun bodyWithoutOptionalFields() { val params = HrisBenefitUpdateParams.builder().benefitId("benefit_id").build() + val body = params._body() + assertThat(body).isNotNull } 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 2f9ce6e5..f9fe2f93 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 @@ -28,7 +28,9 @@ class HrisEmploymentRetrieveManyParamsTest { .build() ) .build() + val body = params._body() + assertThat(body).isNotNull assertThat(body.requests()) .isEqualTo( @@ -50,7 +52,9 @@ class HrisEmploymentRetrieveManyParamsTest { .build() ) .build() + 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 a3e690dd..54d133cd 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 @@ -34,7 +34,9 @@ class HrisIndividualRetrieveManyParamsTest { .build() ) .build() + val body = params._body() + assertThat(body).isNotNull assertThat(body.options()) .contains( @@ -53,7 +55,9 @@ class HrisIndividualRetrieveManyParamsTest { @Test fun bodyWithoutOptionalFields() { val params = HrisIndividualRetrieveManyParams.builder().build() + 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 350813e1..f782eb92 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 @@ -32,7 +32,9 @@ class HrisPayStatementRetrieveManyParamsTest { .build() ) .build() + val body = params._body() + assertThat(body).isNotNull assertThat(body.requests()) .isEqualTo( @@ -54,7 +56,9 @@ class HrisPayStatementRetrieveManyParamsTest { HrisPayStatementRetrieveManyParams.Request.builder().paymentId("string").build() ) .build() + val body = params._body() + assertThat(body).isNotNull assertThat(body.requests()) .isEqualTo( 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 38a4981e..45f142eb 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 @@ -2,6 +2,7 @@ package com.tryfinch.api.models +import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test class JobAutomatedCreateParamsTest { @@ -9,11 +10,59 @@ class JobAutomatedCreateParamsTest { @Test fun create() { JobAutomatedCreateParams.builder() - .forDataSyncAll( - JobAutomatedCreateParams.DataSyncAll.builder() - .type(JobAutomatedCreateParams.DataSyncAll.Type.DATA_SYNC_ALL) + .body( + JobAutomatedCreateParams.Body.DataSyncAll.builder() + .type(JobAutomatedCreateParams.Body.DataSyncAll.Type.DATA_SYNC_ALL) .build() ) .build() } + + @Test + fun body() { + val params = + JobAutomatedCreateParams.builder() + .body( + JobAutomatedCreateParams.Body.DataSyncAll.builder() + .type(JobAutomatedCreateParams.Body.DataSyncAll.Type.DATA_SYNC_ALL) + .build() + ) + .build() + + val body = params._body() + + assertThat(body).isNotNull + assertThat(body) + .isEqualTo( + JobAutomatedCreateParams.Body.ofDataSyncAll( + JobAutomatedCreateParams.Body.DataSyncAll.builder() + .type(JobAutomatedCreateParams.Body.DataSyncAll.Type.DATA_SYNC_ALL) + .build() + ) + ) + } + + @Test + fun bodyWithoutOptionalFields() { + val params = + JobAutomatedCreateParams.builder() + .body( + JobAutomatedCreateParams.Body.DataSyncAll.builder() + .type(JobAutomatedCreateParams.Body.DataSyncAll.Type.DATA_SYNC_ALL) + .build() + ) + .build() + + val body = params._body() + + assertThat(body).isNotNull + assertThat(body) + .isEqualTo( + JobAutomatedCreateParams.Body.ofDataSyncAll( + JobAutomatedCreateParams.Body.DataSyncAll.builder() + .type(JobAutomatedCreateParams.Body.DataSyncAll.Type.DATA_SYNC_ALL) + .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 ed881128..3826f318 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 @@ -29,7 +29,9 @@ 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._body() + assertThat(body).isNotNull assertThat(body.method()).isEqualTo("POST") assertThat(body.route()).isEqualTo("/people/search") @@ -44,7 +46,9 @@ class RequestForwardingForwardParamsTest { fun bodyWithoutOptionalFields() { val params = RequestForwardingForwardParams.builder().method("POST").route("/people/search").build() + 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 81875a2c..85991f01 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 @@ -98,7 +98,9 @@ class SandboxCompanyUpdateParamsTest { .primaryEmail("primary_email") .primaryPhoneNumber("primary_phone_number") .build() + val body = params._body() + assertThat(body).isNotNull assertThat(body.accounts()) .contains( @@ -166,7 +168,9 @@ class SandboxCompanyUpdateParamsTest { .primaryEmail("primary_email") .primaryPhoneNumber("primary_phone_number") .build() + 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 c45fc37e..9e6f3277 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 @@ -28,7 +28,9 @@ class SandboxConnectionAccountCreateParamsTest { ) .addProduct("string") .build() + val body = params._body() + assertThat(body).isNotNull assertThat(body.companyId()).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") assertThat(body.providerId()).isEqualTo("provider_id") @@ -44,7 +46,9 @@ class SandboxConnectionAccountCreateParamsTest { .companyId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .providerId("provider_id") .build() + 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 c1631000..0222d456 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 @@ -20,7 +20,9 @@ class SandboxConnectionAccountUpdateParamsTest { SandboxConnectionAccountUpdateParams.builder() .connectionStatus(ConnectionStatusType.PENDING) .build() + val body = params._body() + assertThat(body).isNotNull assertThat(body.connectionStatus()).contains(ConnectionStatusType.PENDING) } @@ -28,7 +30,9 @@ class SandboxConnectionAccountUpdateParamsTest { @Test fun bodyWithoutOptionalFields() { val params = SandboxConnectionAccountUpdateParams.builder().build() + 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 bee27d5e..77a802d2 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 @@ -26,7 +26,9 @@ class SandboxConnectionCreateParamsTest { .employeeSize(0L) .addProduct("string") .build() + val body = params._body() + assertThat(body).isNotNull assertThat(body.providerId()).isEqualTo("provider_id") assertThat(body.authenticationType()) @@ -38,7 +40,9 @@ class SandboxConnectionCreateParamsTest { @Test fun bodyWithoutOptionalFields() { val params = SandboxConnectionCreateParams.builder().providerId("provider_id").build() + 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 de96c2df..2f55af18 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 @@ -245,7 +245,9 @@ class SandboxDirectoryCreateParamsTest { .build() ) .build() + val body = params._body() + assertThat(body).isNotNull assertThat(body) .isEqualTo( @@ -375,7 +377,9 @@ class SandboxDirectoryCreateParamsTest { SandboxDirectoryCreateParams.builder() .addBody(SandboxDirectoryCreateParams.IndividualOrEmployment.builder().build()) .build() + 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 317e2067..b6465c8f 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 @@ -127,7 +127,9 @@ class SandboxEmploymentUpdateParamsTest { .startDate("start_date") .title("title") .build() + val body = params._body() + assertThat(body).isNotNull assertThat(body.classCode()).contains("class_code") assertThat(body.customFields()) @@ -199,7 +201,9 @@ class SandboxEmploymentUpdateParamsTest { @Test fun bodyWithoutOptionalFields() { val params = SandboxEmploymentUpdateParams.builder().individualId("individual_id").build() + 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 14801fa5..babc4510 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 @@ -86,7 +86,9 @@ class SandboxIndividualUpdateParamsTest { ) .ssn("ssn") .build() + val body = params._body() + assertThat(body).isNotNull assertThat(body.dob()).contains("dob") assertThat(body.emails()) @@ -133,7 +135,9 @@ class SandboxIndividualUpdateParamsTest { @Test fun bodyWithoutOptionalFields() { val params = SandboxIndividualUpdateParams.builder().individualId("individual_id").build() + 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 3c59ffb1..6a4b5ec1 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 @@ -10,8 +10,12 @@ class SandboxJobConfigurationUpdateParamsTest { @Test fun create() { SandboxJobConfigurationUpdateParams.builder() - .completionStatus(SandboxJobConfigurationUpdateParams.CompletionStatus.COMPLETE) - .type(SandboxJobConfigurationUpdateParams.Type.DATA_SYNC_ALL) + .sandboxJobConfiguration( + SandboxJobConfiguration.builder() + .completionStatus(SandboxJobConfiguration.CompletionStatus.COMPLETE) + .type(SandboxJobConfiguration.Type.DATA_SYNC_ALL) + .build() + ) .build() } @@ -19,27 +23,47 @@ class SandboxJobConfigurationUpdateParamsTest { fun body() { val params = SandboxJobConfigurationUpdateParams.builder() - .completionStatus(SandboxJobConfigurationUpdateParams.CompletionStatus.COMPLETE) - .type(SandboxJobConfigurationUpdateParams.Type.DATA_SYNC_ALL) + .sandboxJobConfiguration( + SandboxJobConfiguration.builder() + .completionStatus(SandboxJobConfiguration.CompletionStatus.COMPLETE) + .type(SandboxJobConfiguration.Type.DATA_SYNC_ALL) + .build() + ) .build() + val body = params._body() + assertThat(body).isNotNull - assertThat(body.completionStatus()) - .isEqualTo(SandboxJobConfigurationUpdateParams.CompletionStatus.COMPLETE) - assertThat(body.type()).isEqualTo(SandboxJobConfigurationUpdateParams.Type.DATA_SYNC_ALL) + assertThat(body) + .isEqualTo( + SandboxJobConfiguration.builder() + .completionStatus(SandboxJobConfiguration.CompletionStatus.COMPLETE) + .type(SandboxJobConfiguration.Type.DATA_SYNC_ALL) + .build() + ) } @Test fun bodyWithoutOptionalFields() { val params = SandboxJobConfigurationUpdateParams.builder() - .completionStatus(SandboxJobConfigurationUpdateParams.CompletionStatus.COMPLETE) - .type(SandboxJobConfigurationUpdateParams.Type.DATA_SYNC_ALL) + .sandboxJobConfiguration( + SandboxJobConfiguration.builder() + .completionStatus(SandboxJobConfiguration.CompletionStatus.COMPLETE) + .type(SandboxJobConfiguration.Type.DATA_SYNC_ALL) + .build() + ) .build() + val body = params._body() + assertThat(body).isNotNull - assertThat(body.completionStatus()) - .isEqualTo(SandboxJobConfigurationUpdateParams.CompletionStatus.COMPLETE) - assertThat(body.type()).isEqualTo(SandboxJobConfigurationUpdateParams.Type.DATA_SYNC_ALL) + assertThat(body) + .isEqualTo( + SandboxJobConfiguration.builder() + .completionStatus(SandboxJobConfiguration.CompletionStatus.COMPLETE) + .type(SandboxJobConfiguration.Type.DATA_SYNC_ALL) + .build() + ) } } 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 8ff44be2..7e673381 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 @@ -16,7 +16,9 @@ class SandboxJobCreateParamsTest { fun body() { val params = SandboxJobCreateParams.builder().type(SandboxJobCreateParams.Type.DATA_SYNC_ALL).build() + val body = params._body() + assertThat(body).isNotNull assertThat(body.type()).isEqualTo(SandboxJobCreateParams.Type.DATA_SYNC_ALL) } @@ -25,7 +27,9 @@ class SandboxJobCreateParamsTest { fun bodyWithoutOptionalFields() { val params = SandboxJobCreateParams.builder().type(SandboxJobCreateParams.Type.DATA_SYNC_ALL).build() + 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 dbc9d664..90aa7917 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 @@ -112,7 +112,9 @@ class SandboxPaymentCreateParamsTest { ) .startDate("start_date") .build() + val body = params._body() + assertThat(body).isNotNull assertThat(body.endDate()).contains("end_date") assertThat(body.payStatements()) @@ -169,7 +171,9 @@ class SandboxPaymentCreateParamsTest { @Test fun bodyWithoutOptionalFields() { val params = SandboxPaymentCreateParams.builder().build() + val body = params._body() + assertThat(body).isNotNull } } diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/jobs/AutomatedServiceTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/jobs/AutomatedServiceTest.kt index 79cba36e..dd612542 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/jobs/AutomatedServiceTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/jobs/AutomatedServiceTest.kt @@ -24,9 +24,9 @@ class AutomatedServiceTest { val automatedCreateResponse = automatedService.create( JobAutomatedCreateParams.builder() - .forDataSyncAll( - JobAutomatedCreateParams.DataSyncAll.builder() - .type(JobAutomatedCreateParams.DataSyncAll.Type.DATA_SYNC_ALL) + .body( + JobAutomatedCreateParams.Body.DataSyncAll.builder() + .type(JobAutomatedCreateParams.Body.DataSyncAll.Type.DATA_SYNC_ALL) .build() ) .build() diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/sandbox/jobs/ConfigurationServiceTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/sandbox/jobs/ConfigurationServiceTest.kt index 75f0e90c..d7c74124 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/sandbox/jobs/ConfigurationServiceTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/sandbox/jobs/ConfigurationServiceTest.kt @@ -40,8 +40,12 @@ class ConfigurationServiceTest { val sandboxJobConfiguration = configurationService.update( SandboxJobConfigurationUpdateParams.builder() - .completionStatus(SandboxJobConfigurationUpdateParams.CompletionStatus.COMPLETE) - .type(SandboxJobConfigurationUpdateParams.Type.DATA_SYNC_ALL) + .sandboxJobConfiguration( + SandboxJobConfiguration.builder() + .completionStatus(SandboxJobConfiguration.CompletionStatus.COMPLETE) + .type(SandboxJobConfiguration.Type.DATA_SYNC_ALL) + .build() + ) .build() ) println(sandboxJobConfiguration) From caffc542b831856cac7e1be5079b03a112b203f7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 17 Feb 2025 23:25:22 +0000 Subject: [PATCH 04/22] feat(client): update enum `asX` methods (#442) --- .../api/models/AccountCreateResponse.kt | 12 ++- .../tryfinch/api/models/AccountUpdateEvent.kt | 26 ++++- .../api/models/AccountUpdateResponse.kt | 12 ++- .../tryfinch/api/models/AutomatedAsyncJob.kt | 24 ++++- .../api/models/BenefitContribution.kt | 12 ++- .../models/BenefitFeaturesAndOperations.kt | 42 +++++++- .../tryfinch/api/models/BenefitFrequency.kt | 12 ++- .../com/tryfinch/api/models/BenefitType.kt | 12 ++- .../kotlin/com/tryfinch/api/models/Company.kt | 42 +++++++- .../com/tryfinch/api/models/CompanyEvent.kt | 12 ++- .../api/models/CompanyUpdateResponse.kt | 42 +++++++- .../api/models/ConnectSessionNewParams.kt | 38 ++++++- .../ConnectSessionReauthenticateParams.kt | 12 ++- .../api/models/ConnectionCreateResponse.kt | 12 ++- .../api/models/ConnectionStatusType.kt | 12 ++- .../api/models/CreateAccessTokenResponse.kt | 24 ++++- .../com/tryfinch/api/models/DirectoryEvent.kt | 12 ++- .../tryfinch/api/models/DocumentResponse.kt | 12 ++- .../com/tryfinch/api/models/EmploymentData.kt | 40 +++++++- .../tryfinch/api/models/EmploymentEvent.kt | 12 ++- .../api/models/EmploymentUpdateResponse.kt | 40 +++++++- .../tryfinch/api/models/EnrolledIndividual.kt | 11 ++- .../api/models/HrisDocumentListParams.kt | 12 ++- .../kotlin/com/tryfinch/api/models/Income.kt | 12 ++- .../com/tryfinch/api/models/Individual.kt | 52 +++++++++- .../tryfinch/api/models/IndividualBenefit.kt | 14 ++- .../tryfinch/api/models/IndividualEvent.kt | 12 ++- .../api/models/IndividualUpdateResponse.kt | 52 +++++++++- .../com/tryfinch/api/models/Introspection.kt | 38 ++++++- .../api/models/JobAutomatedCreateParams.kt | 28 +++++- .../tryfinch/api/models/JobCompletionEvent.kt | 12 ++- .../com/tryfinch/api/models/ManualAsyncJob.kt | 12 ++- .../tryfinch/api/models/OperationSupport.kt | 12 ++- .../api/models/PayGroupListResponse.kt | 12 ++- .../api/models/PayGroupRetrieveResponse.kt | 12 ++- .../com/tryfinch/api/models/PayStatement.kt | 52 +++++++++- .../tryfinch/api/models/PayStatementEvent.kt | 12 ++- .../kotlin/com/tryfinch/api/models/Payment.kt | 12 ++- .../com/tryfinch/api/models/PaymentEvent.kt | 12 ++- .../com/tryfinch/api/models/Provider.kt | 14 ++- .../api/models/SandboxCompanyUpdateParams.kt | 42 +++++++- .../SandboxConnectionAccountCreateParams.kt | 12 ++- .../models/SandboxConnectionCreateParams.kt | 12 ++- .../models/SandboxDirectoryCreateParams.kt | 98 +++++++++++++++++-- .../models/SandboxEmploymentUpdateParams.kt | 40 +++++++- .../models/SandboxIndividualUpdateParams.kt | 52 +++++++++- .../api/models/SandboxJobConfiguration.kt | 24 ++++- .../api/models/SandboxJobCreateParams.kt | 12 ++- .../api/models/SandboxPaymentCreateParams.kt | 56 ++++++++++- .../tryfinch/api/models/SupportedBenefit.kt | 36 ++++++- .../kotlin/com/tryfinch/api/models/W42005.kt | 40 +++++++- .../kotlin/com/tryfinch/api/models/W42020.kt | 26 ++++- 52 files changed, 1204 insertions(+), 101 deletions(-) diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccountCreateResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccountCreateResponse.kt index ef2aee8b..fbbf3441 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 @@ -328,7 +328,17 @@ private constructor( else -> throw FinchInvalidDataException("Unknown AuthenticationType: $value") } - fun asString(): String = _value().asStringOrThrow() + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for debugging + * and generally doesn't throw. + * + * @throws FinchInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { FinchInvalidDataException("Value is not a String") } override fun equals(other: Any?): Boolean { if (this === other) { 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 b47cd3a9..5925dc19 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 @@ -6035,7 +6035,19 @@ private constructor( else -> throw FinchInvalidDataException("Unknown Type: $value") } - fun asString(): String = _value().asStringOrThrow() + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws FinchInvalidDataException if this class instance's value does not have + * the expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + FinchInvalidDataException("Value is not a String") + } override fun equals(other: Any?): Boolean { if (this === other) { @@ -6154,7 +6166,17 @@ private constructor( else -> throw FinchInvalidDataException("Unknown EventType: $value") } - fun asString(): String = _value().asStringOrThrow() + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for debugging + * and generally doesn't throw. + * + * @throws FinchInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { FinchInvalidDataException("Value is not a String") } override fun equals(other: Any?): Boolean { if (this === other) { 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 869a9686..ef5ca08a 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 @@ -313,7 +313,17 @@ private constructor( else -> throw FinchInvalidDataException("Unknown AuthenticationType: $value") } - fun asString(): String = _value().asStringOrThrow() + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for debugging + * and generally doesn't throw. + * + * @throws FinchInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { FinchInvalidDataException("Value is not a String") } override fun equals(other: Any?): Boolean { if (this === other) { 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 7f043a2d..4a7fd197 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 @@ -508,7 +508,17 @@ private constructor( else -> throw FinchInvalidDataException("Unknown Status: $value") } - fun asString(): String = _value().asStringOrThrow() + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for debugging + * and generally doesn't throw. + * + * @throws FinchInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { FinchInvalidDataException("Value is not a String") } override fun equals(other: Any?): Boolean { if (this === other) { @@ -596,7 +606,17 @@ private constructor( else -> throw FinchInvalidDataException("Unknown Type: $value") } - fun asString(): String = _value().asStringOrThrow() + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for debugging + * and generally doesn't throw. + * + * @throws FinchInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { FinchInvalidDataException("Value is not a String") } override fun equals(other: Any?): Boolean { if (this === other) { 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 a4be659e..bfef1c4b 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 @@ -194,7 +194,17 @@ private constructor( else -> throw FinchInvalidDataException("Unknown Type: $value") } - fun asString(): String = _value().asStringOrThrow() + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for debugging + * and generally doesn't throw. + * + * @throws FinchInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { FinchInvalidDataException("Value is not a String") } override fun equals(other: Any?): Boolean { if (this === other) { 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 11fe8c51..e59b1426 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 @@ -571,7 +571,19 @@ private constructor( else -> throw FinchInvalidDataException("Unknown CompanyContribution: $value") } - fun asString(): String = _value().asStringOrThrow() + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws FinchInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + FinchInvalidDataException("Value is not a String") + } override fun equals(other: Any?): Boolean { if (this === other) { @@ -665,7 +677,19 @@ private constructor( else -> throw FinchInvalidDataException("Unknown EmployeeDeduction: $value") } - fun asString(): String = _value().asStringOrThrow() + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws FinchInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + FinchInvalidDataException("Value is not a String") + } override fun equals(other: Any?): Boolean { if (this === other) { @@ -760,7 +784,19 @@ private constructor( else -> throw FinchInvalidDataException("Unknown HsaContributionLimit: $value") } - fun asString(): String = _value().asStringOrThrow() + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws FinchInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + FinchInvalidDataException("Value is not a String") + } override fun equals(other: Any?): Boolean { if (this === other) { 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 07c02684..3a3183a0 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 @@ -87,7 +87,17 @@ class BenefitFrequency @JsonCreator private constructor(private val value: JsonF else -> throw FinchInvalidDataException("Unknown BenefitFrequency: $value") } - fun asString(): String = _value().asStringOrThrow() + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for debugging and + * generally doesn't throw. + * + * @throws FinchInvalidDataException if this class instance's value does not have the expected + * primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { FinchInvalidDataException("Value is not a String") } override fun equals(other: Any?): Boolean { if (this === other) { 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 68849de4..4f7b1a34 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 @@ -181,7 +181,17 @@ class BenefitType @JsonCreator private constructor(private val value: JsonField< else -> throw FinchInvalidDataException("Unknown BenefitType: $value") } - fun asString(): String = _value().asStringOrThrow() + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for debugging and + * generally doesn't throw. + * + * @throws FinchInvalidDataException if this class instance's value does not have the expected + * primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { FinchInvalidDataException("Value is not a String") } override fun equals(other: Any?): Boolean { if (this === other) { 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 2704e01c..4501824b 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 @@ -633,7 +633,19 @@ private constructor( else -> throw FinchInvalidDataException("Unknown AccountType: $value") } - fun asString(): String = _value().asStringOrThrow() + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws FinchInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + FinchInvalidDataException("Value is not a String") + } override fun equals(other: Any?): Boolean { if (this === other) { @@ -1076,7 +1088,19 @@ private constructor( else -> throw FinchInvalidDataException("Unknown Subtype: $value") } - fun asString(): String = _value().asStringOrThrow() + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws FinchInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + FinchInvalidDataException("Value is not a String") + } override fun equals(other: Any?): Boolean { if (this === other) { @@ -1195,7 +1219,19 @@ private constructor( else -> throw FinchInvalidDataException("Unknown Type: $value") } - fun asString(): String = _value().asStringOrThrow() + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws FinchInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + FinchInvalidDataException("Value is not a String") + } override fun equals(other: Any?): Boolean { if (this === other) { 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 5c0ecbf5..160468eb 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 @@ -361,7 +361,17 @@ private constructor( else -> throw FinchInvalidDataException("Unknown EventType: $value") } - fun asString(): String = _value().asStringOrThrow() + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for debugging + * and generally doesn't throw. + * + * @throws FinchInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { FinchInvalidDataException("Value is not a String") } override fun equals(other: Any?): Boolean { if (this === other) { 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 8c03fd72..6e276c55 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 @@ -616,7 +616,19 @@ private constructor( else -> throw FinchInvalidDataException("Unknown AccountType: $value") } - fun asString(): String = _value().asStringOrThrow() + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws FinchInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + FinchInvalidDataException("Value is not a String") + } override fun equals(other: Any?): Boolean { if (this === other) { @@ -1059,7 +1071,19 @@ private constructor( else -> throw FinchInvalidDataException("Unknown Subtype: $value") } - fun asString(): String = _value().asStringOrThrow() + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws FinchInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + FinchInvalidDataException("Value is not a String") + } override fun equals(other: Any?): Boolean { if (this === other) { @@ -1178,7 +1202,19 @@ private constructor( else -> throw FinchInvalidDataException("Unknown Type: $value") } - fun asString(): String = _value().asStringOrThrow() + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws FinchInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + FinchInvalidDataException("Value is not a String") + } override fun equals(other: Any?): Boolean { if (this === other) { 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 6fc524f0..622a3456 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 @@ -727,7 +727,17 @@ private constructor( else -> throw FinchInvalidDataException("Unknown ConnectProducts: $value") } - fun asString(): String = _value().asStringOrThrow() + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for debugging + * and generally doesn't throw. + * + * @throws FinchInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { FinchInvalidDataException("Value is not a String") } override fun equals(other: Any?): Boolean { if (this === other) { @@ -930,7 +940,19 @@ private constructor( else -> throw FinchInvalidDataException("Unknown AuthMethod: $value") } - fun asString(): String = _value().asStringOrThrow() + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws FinchInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + FinchInvalidDataException("Value is not a String") + } override fun equals(other: Any?): Boolean { if (this === other) { @@ -1035,7 +1057,17 @@ private constructor( else -> throw FinchInvalidDataException("Unknown Sandbox: $value") } - fun asString(): String = _value().asStringOrThrow() + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for debugging + * and generally doesn't throw. + * + * @throws FinchInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { FinchInvalidDataException("Value is not a String") } override fun equals(other: Any?): Boolean { if (this === other) { 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 021ffc91..50101242 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 @@ -607,7 +607,17 @@ private constructor( else -> throw FinchInvalidDataException("Unknown ConnectProducts: $value") } - fun asString(): String = _value().asStringOrThrow() + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for debugging + * and generally doesn't throw. + * + * @throws FinchInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { FinchInvalidDataException("Value is not a String") } override fun equals(other: Any?): Boolean { if (this === other) { 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 d98a0dbe..36084ea1 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 @@ -344,7 +344,17 @@ private constructor( else -> throw FinchInvalidDataException("Unknown AuthenticationType: $value") } - fun asString(): String = _value().asStringOrThrow() + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for debugging + * and generally doesn't throw. + * + * @throws FinchInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { FinchInvalidDataException("Value is not a String") } override fun equals(other: Any?): Boolean { if (this === other) { 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 10a9db26..8911a636 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 @@ -106,7 +106,17 @@ class ConnectionStatusType @JsonCreator private constructor(private val value: J else -> throw FinchInvalidDataException("Unknown ConnectionStatusType: $value") } - fun asString(): String = _value().asStringOrThrow() + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for debugging and + * generally doesn't throw. + * + * @throws FinchInvalidDataException if this class instance's value does not have the expected + * primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { FinchInvalidDataException("Value is not a String") } override fun equals(other: Any?): Boolean { if (this === other) { 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 9893ffb1..1030bc51 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 @@ -434,7 +434,17 @@ private constructor( else -> throw FinchInvalidDataException("Unknown ClientType: $value") } - fun asString(): String = _value().asStringOrThrow() + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for debugging + * and generally doesn't throw. + * + * @throws FinchInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { FinchInvalidDataException("Value is not a String") } override fun equals(other: Any?): Boolean { if (this === other) { @@ -530,7 +540,17 @@ private constructor( else -> throw FinchInvalidDataException("Unknown ConnectionType: $value") } - fun asString(): String = _value().asStringOrThrow() + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for debugging + * and generally doesn't throw. + * + * @throws FinchInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { FinchInvalidDataException("Value is not a String") } override fun equals(other: Any?): Boolean { if (this === other) { 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 32d36987..078fdd80 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 @@ -395,7 +395,17 @@ private constructor( else -> throw FinchInvalidDataException("Unknown EventType: $value") } - fun asString(): String = _value().asStringOrThrow() + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for debugging + * and generally doesn't throw. + * + * @throws FinchInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { FinchInvalidDataException("Value is not a String") } override fun equals(other: Any?): Boolean { if (this === other) { 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 d79cfa9a..d0469b43 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 @@ -276,7 +276,17 @@ private constructor( else -> throw FinchInvalidDataException("Unknown Type: $value") } - fun asString(): String = _value().asStringOrThrow() + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for debugging + * and generally doesn't throw. + * + * @throws FinchInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { FinchInvalidDataException("Value is not a String") } override fun equals(other: Any?): Boolean { if (this === other) { 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 5867cea9..75f7e6db 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 @@ -1040,7 +1040,19 @@ private constructor( else -> throw FinchInvalidDataException("Unknown Subtype: $value") } - fun asString(): String = _value().asStringOrThrow() + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws FinchInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + FinchInvalidDataException("Value is not a String") + } override fun equals(other: Any?): Boolean { if (this === other) { @@ -1129,7 +1141,19 @@ private constructor( else -> throw FinchInvalidDataException("Unknown Type: $value") } - fun asString(): String = _value().asStringOrThrow() + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws FinchInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + FinchInvalidDataException("Value is not a String") + } override fun equals(other: Any?): Boolean { if (this === other) { @@ -1272,7 +1296,17 @@ private constructor( else -> throw FinchInvalidDataException("Unknown EmploymentStatus: $value") } - fun asString(): String = _value().asStringOrThrow() + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for debugging + * and generally doesn't throw. + * + * @throws FinchInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { FinchInvalidDataException("Value is not a String") } override fun equals(other: Any?): Boolean { if (this === other) { 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 424082ff..b67ef641 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 @@ -395,7 +395,17 @@ private constructor( else -> throw FinchInvalidDataException("Unknown EventType: $value") } - fun asString(): String = _value().asStringOrThrow() + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for debugging + * and generally doesn't throw. + * + * @throws FinchInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { FinchInvalidDataException("Value is not a String") } override fun equals(other: Any?): Boolean { if (this === other) { 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 afaf2187..f900c3bb 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 @@ -989,7 +989,19 @@ private constructor( else -> throw FinchInvalidDataException("Unknown Subtype: $value") } - fun asString(): String = _value().asStringOrThrow() + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws FinchInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + FinchInvalidDataException("Value is not a String") + } override fun equals(other: Any?): Boolean { if (this === other) { @@ -1078,7 +1090,19 @@ private constructor( else -> throw FinchInvalidDataException("Unknown Type: $value") } - fun asString(): String = _value().asStringOrThrow() + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws FinchInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + FinchInvalidDataException("Value is not a String") + } override fun equals(other: Any?): Boolean { if (this === other) { @@ -1218,7 +1242,17 @@ private constructor( else -> throw FinchInvalidDataException("Unknown EmploymentStatus: $value") } - fun asString(): String = _value().asStringOrThrow() + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for debugging + * and generally doesn't throw. + * + * @throws FinchInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { FinchInvalidDataException("Value is not a String") } override fun equals(other: Any?): Boolean { if (this === other) { 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 6b463cfa..2e1109e9 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 @@ -353,7 +353,16 @@ private constructor( else -> throw FinchInvalidDataException("Unknown Code: $value") } - fun asString(): String = _value().asStringOrThrow() + /** + * Returns this class instance's primitive wire representation. + * + * @throws FinchInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asLong(): Long = + _value().asNumber().orElse(null)?.let { + if (it.toDouble() % 1 == 0.0) it.toLong() else null + } ?: throw FinchInvalidDataException("Value is not a Long") override fun equals(other: Any?): Boolean { if (this === other) { 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 c7cb36e7..28c06a6a 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 @@ -317,7 +317,17 @@ private constructor( else -> throw FinchInvalidDataException("Unknown Type: $value") } - fun asString(): String = _value().asStringOrThrow() + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for debugging + * and generally doesn't throw. + * + * @throws FinchInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { FinchInvalidDataException("Value is not a String") } override fun equals(other: Any?): Boolean { if (this === other) { 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 b83b95f6..b0cf2130 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 @@ -308,7 +308,17 @@ private constructor( else -> throw FinchInvalidDataException("Unknown Unit: $value") } - fun asString(): String = _value().asStringOrThrow() + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for debugging + * and generally doesn't throw. + * + * @throws FinchInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { FinchInvalidDataException("Value is not a String") } override fun equals(other: Any?): Boolean { if (this === other) { 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 3f7d3e4c..e2f8fcb0 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 @@ -587,7 +587,19 @@ private constructor( else -> throw FinchInvalidDataException("Unknown Type: $value") } - fun asString(): String = _value().asStringOrThrow() + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws FinchInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + FinchInvalidDataException("Value is not a String") + } override fun equals(other: Any?): Boolean { if (this === other) { @@ -732,7 +744,17 @@ private constructor( else -> throw FinchInvalidDataException("Unknown Ethnicity: $value") } - fun asString(): String = _value().asStringOrThrow() + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for debugging + * and generally doesn't throw. + * + * @throws FinchInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { FinchInvalidDataException("Value is not a String") } override fun equals(other: Any?): Boolean { if (this === other) { @@ -832,7 +854,17 @@ private constructor( else -> throw FinchInvalidDataException("Unknown Gender: $value") } - fun asString(): String = _value().asStringOrThrow() + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for debugging + * and generally doesn't throw. + * + * @throws FinchInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { FinchInvalidDataException("Value is not a String") } override fun equals(other: Any?): Boolean { if (this === other) { @@ -1011,7 +1043,19 @@ private constructor( else -> throw FinchInvalidDataException("Unknown Type: $value") } - fun asString(): String = _value().asStringOrThrow() + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws FinchInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + FinchInvalidDataException("Value is not a String") + } override fun equals(other: Any?): Boolean { if (this === other) { 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 0f2e9a3a..e760e125 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 @@ -422,7 +422,19 @@ private constructor( else -> throw FinchInvalidDataException("Unknown HsaContributionLimit: $value") } - fun asString(): String = _value().asStringOrThrow() + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws FinchInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + FinchInvalidDataException("Value is not a String") + } override fun equals(other: Any?): Boolean { if (this === other) { 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 3cebd63c..16e4a305 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 @@ -395,7 +395,17 @@ private constructor( else -> throw FinchInvalidDataException("Unknown EventType: $value") } - fun asString(): String = _value().asStringOrThrow() + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for debugging + * and generally doesn't throw. + * + * @throws FinchInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { FinchInvalidDataException("Value is not a String") } override fun equals(other: Any?): Boolean { if (this === other) { 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 66f0ba75..cd046d07 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 @@ -587,7 +587,19 @@ private constructor( else -> throw FinchInvalidDataException("Unknown Type: $value") } - fun asString(): String = _value().asStringOrThrow() + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws FinchInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + FinchInvalidDataException("Value is not a String") + } override fun equals(other: Any?): Boolean { if (this === other) { @@ -732,7 +744,17 @@ private constructor( else -> throw FinchInvalidDataException("Unknown Ethnicity: $value") } - fun asString(): String = _value().asStringOrThrow() + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for debugging + * and generally doesn't throw. + * + * @throws FinchInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { FinchInvalidDataException("Value is not a String") } override fun equals(other: Any?): Boolean { if (this === other) { @@ -832,7 +854,17 @@ private constructor( else -> throw FinchInvalidDataException("Unknown Gender: $value") } - fun asString(): String = _value().asStringOrThrow() + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for debugging + * and generally doesn't throw. + * + * @throws FinchInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { FinchInvalidDataException("Value is not a String") } override fun equals(other: Any?): Boolean { if (this === other) { @@ -1009,7 +1041,19 @@ private constructor( else -> throw FinchInvalidDataException("Unknown Type: $value") } - fun asString(): String = _value().asStringOrThrow() + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws FinchInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + FinchInvalidDataException("Value is not a String") + } override fun equals(other: Any?): Boolean { if (this === other) { 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 63379965..d3ea4304 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 @@ -925,7 +925,19 @@ private constructor( else -> throw FinchInvalidDataException("Unknown Type: $value") } - fun asString(): String = _value().asStringOrThrow() + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws FinchInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + FinchInvalidDataException("Value is not a String") + } override fun equals(other: Any?): Boolean { if (this === other) { @@ -1039,7 +1051,17 @@ private constructor( else -> throw FinchInvalidDataException("Unknown ClientType: $value") } - fun asString(): String = _value().asStringOrThrow() + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for debugging + * and generally doesn't throw. + * + * @throws FinchInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { FinchInvalidDataException("Value is not a String") } override fun equals(other: Any?): Boolean { if (this === other) { @@ -1246,7 +1268,17 @@ private constructor( else -> throw FinchInvalidDataException("Unknown ConnectionType: $value") } - fun asString(): String = _value().asStringOrThrow() + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for debugging + * and generally doesn't throw. + * + * @throws FinchInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { FinchInvalidDataException("Value is not a String") } override fun equals(other: Any?): Boolean { if (this === other) { 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 258cfc63..4a23c57d 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 @@ -365,7 +365,19 @@ private constructor( else -> throw FinchInvalidDataException("Unknown Type: $value") } - fun asString(): String = _value().asStringOrThrow() + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws FinchInvalidDataException if this class instance's value does not have + * the expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + FinchInvalidDataException("Value is not a String") + } override fun equals(other: Any?): Boolean { if (this === other) { @@ -679,7 +691,19 @@ private constructor( else -> throw FinchInvalidDataException("Unknown Type: $value") } - fun asString(): String = _value().asStringOrThrow() + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws FinchInvalidDataException if this class instance's value does not have + * the expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + FinchInvalidDataException("Value is not a String") + } override fun equals(other: Any?): Boolean { if (this === other) { 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 00294490..59f91f23 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 @@ -431,7 +431,17 @@ private constructor( else -> throw FinchInvalidDataException("Unknown EventType: $value") } - fun asString(): String = _value().asStringOrThrow() + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for debugging + * and generally doesn't throw. + * + * @throws FinchInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { FinchInvalidDataException("Value is not a String") } override fun equals(other: Any?): Boolean { if (this === other) { 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 65bc5869..ded94816 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 @@ -232,7 +232,17 @@ private constructor( else -> throw FinchInvalidDataException("Unknown Status: $value") } - fun asString(): String = _value().asStringOrThrow() + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for debugging + * and generally doesn't throw. + * + * @throws FinchInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { FinchInvalidDataException("Value is not a String") } override fun equals(other: Any?): Boolean { if (this === other) { 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 13f54944..2cd1bc73 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 @@ -102,7 +102,17 @@ class OperationSupport @JsonCreator private constructor(private val value: JsonF else -> throw FinchInvalidDataException("Unknown OperationSupport: $value") } - fun asString(): String = _value().asStringOrThrow() + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for debugging and + * generally doesn't throw. + * + * @throws FinchInvalidDataException if this class instance's value does not have the expected + * primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { FinchInvalidDataException("Value is not a String") } override fun equals(other: Any?): Boolean { if (this === other) { 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 47a584fa..55d23e26 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 @@ -271,7 +271,17 @@ private constructor( else -> throw FinchInvalidDataException("Unknown PayFrequency: $value") } - fun asString(): String = _value().asStringOrThrow() + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for debugging + * and generally doesn't throw. + * + * @throws FinchInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { FinchInvalidDataException("Value is not a String") } override fun equals(other: Any?): Boolean { if (this === other) { 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 6eeb325e..40f1c2b2 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 @@ -302,7 +302,17 @@ private constructor( else -> throw FinchInvalidDataException("Unknown PayFrequency: $value") } - fun asString(): String = _value().asStringOrThrow() + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for debugging + * and generally doesn't throw. + * + * @throws FinchInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { FinchInvalidDataException("Value is not a String") } override fun equals(other: Any?): Boolean { if (this === other) { 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 ebefdb09..4e3dbc65 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 @@ -703,7 +703,19 @@ private constructor( else -> throw FinchInvalidDataException("Unknown Type: $value") } - fun asString(): String = _value().asStringOrThrow() + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws FinchInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + FinchInvalidDataException("Value is not a String") + } override fun equals(other: Any?): Boolean { if (this === other) { @@ -1187,7 +1199,17 @@ private constructor( else -> throw FinchInvalidDataException("Unknown PaymentMethod: $value") } - fun asString(): String = _value().asStringOrThrow() + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for debugging + * and generally doesn't throw. + * + * @throws FinchInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { FinchInvalidDataException("Value is not a String") } override fun equals(other: Any?): Boolean { if (this === other) { @@ -1461,7 +1483,19 @@ private constructor( else -> throw FinchInvalidDataException("Unknown Type: $value") } - fun asString(): String = _value().asStringOrThrow() + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws FinchInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + FinchInvalidDataException("Value is not a String") + } override fun equals(other: Any?): Boolean { if (this === other) { @@ -1573,7 +1607,17 @@ private constructor( else -> throw FinchInvalidDataException("Unknown Type: $value") } - fun asString(): String = _value().asStringOrThrow() + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for debugging + * and generally doesn't throw. + * + * @throws FinchInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { FinchInvalidDataException("Value is not a String") } override fun equals(other: Any?): Boolean { if (this === other) { 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 6ed2b6a4..79a6bd0a 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 @@ -413,7 +413,17 @@ private constructor( else -> throw FinchInvalidDataException("Unknown EventType: $value") } - fun asString(): String = _value().asStringOrThrow() + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for debugging + * and generally doesn't throw. + * + * @throws FinchInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { FinchInvalidDataException("Value is not a String") } override fun equals(other: Any?): Boolean { if (this === other) { 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 49c187e4..bc5df509 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 @@ -502,7 +502,17 @@ private constructor( else -> throw FinchInvalidDataException("Unknown PayFrequency: $value") } - fun asString(): String = _value().asStringOrThrow() + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for debugging + * and generally doesn't throw. + * + * @throws FinchInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { FinchInvalidDataException("Value is not a String") } override fun equals(other: Any?): Boolean { if (this === other) { 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 51651333..dcd964b3 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 @@ -415,7 +415,17 @@ private constructor( else -> throw FinchInvalidDataException("Unknown EventType: $value") } - fun asString(): String = _value().asStringOrThrow() + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for debugging + * and generally doesn't throw. + * + * @throws FinchInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { FinchInvalidDataException("Value is not a String") } override fun equals(other: Any?): Boolean { if (this === other) { 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 6fcd5df1..ea274b56 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 @@ -5852,7 +5852,19 @@ private constructor( else -> throw FinchInvalidDataException("Unknown Type: $value") } - fun asString(): String = _value().asStringOrThrow() + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws FinchInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + FinchInvalidDataException("Value is not a String") + } override fun equals(other: Any?): Boolean { if (this === other) { 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 388c14ba..d4593243 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 @@ -943,7 +943,19 @@ private constructor( else -> throw FinchInvalidDataException("Unknown AccountType: $value") } - fun asString(): String = _value().asStringOrThrow() + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws FinchInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + FinchInvalidDataException("Value is not a String") + } override fun equals(other: Any?): Boolean { if (this === other) { @@ -1386,7 +1398,19 @@ private constructor( else -> throw FinchInvalidDataException("Unknown Subtype: $value") } - fun asString(): String = _value().asStringOrThrow() + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws FinchInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + FinchInvalidDataException("Value is not a String") + } override fun equals(other: Any?): Boolean { if (this === other) { @@ -1505,7 +1529,19 @@ private constructor( else -> throw FinchInvalidDataException("Unknown Type: $value") } - fun asString(): String = _value().asStringOrThrow() + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws FinchInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + FinchInvalidDataException("Value is not a String") + } override fun equals(other: Any?): Boolean { if (this === other) { 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 2ea08c1b..e450d723 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 @@ -535,7 +535,17 @@ private constructor( else -> throw FinchInvalidDataException("Unknown AuthenticationType: $value") } - fun asString(): String = _value().asStringOrThrow() + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for debugging + * and generally doesn't throw. + * + * @throws FinchInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { FinchInvalidDataException("Value is not a String") } override fun equals(other: Any?): Boolean { if (this === other) { 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 0c1718a9..cf3c8589 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 @@ -537,7 +537,17 @@ private constructor( else -> throw FinchInvalidDataException("Unknown AuthenticationType: $value") } - fun asString(): String = _value().asStringOrThrow() + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for debugging + * and generally doesn't throw. + * + * @throws FinchInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { FinchInvalidDataException("Value is not a String") } override fun equals(other: Any?): Boolean { if (this === other) { 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 14462260..9aa616be 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 @@ -1206,7 +1206,19 @@ private constructor( else -> throw FinchInvalidDataException("Unknown Type: $value") } - fun asString(): String = _value().asStringOrThrow() + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws FinchInvalidDataException if this class instance's value does not have + * the expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + FinchInvalidDataException("Value is not a String") + } override fun equals(other: Any?): Boolean { if (this === other) { @@ -1467,7 +1479,19 @@ private constructor( else -> throw FinchInvalidDataException("Unknown Subtype: $value") } - fun asString(): String = _value().asStringOrThrow() + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws FinchInvalidDataException if this class instance's value does not have + * the expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + FinchInvalidDataException("Value is not a String") + } override fun equals(other: Any?): Boolean { if (this === other) { @@ -1559,7 +1583,19 @@ private constructor( else -> throw FinchInvalidDataException("Unknown Type: $value") } - fun asString(): String = _value().asStringOrThrow() + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws FinchInvalidDataException if this class instance's value does not have + * the expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + FinchInvalidDataException("Value is not a String") + } override fun equals(other: Any?): Boolean { if (this === other) { @@ -1702,7 +1738,19 @@ private constructor( else -> throw FinchInvalidDataException("Unknown EmploymentStatus: $value") } - fun asString(): String = _value().asStringOrThrow() + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws FinchInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + FinchInvalidDataException("Value is not a String") + } override fun equals(other: Any?): Boolean { if (this === other) { @@ -1833,7 +1881,19 @@ private constructor( else -> throw FinchInvalidDataException("Unknown Ethnicity: $value") } - fun asString(): String = _value().asStringOrThrow() + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws FinchInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + FinchInvalidDataException("Value is not a String") + } override fun equals(other: Any?): Boolean { if (this === other) { @@ -1936,7 +1996,19 @@ private constructor( else -> throw FinchInvalidDataException("Unknown Gender: $value") } - fun asString(): String = _value().asStringOrThrow() + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws FinchInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + FinchInvalidDataException("Value is not a String") + } override fun equals(other: Any?): Boolean { if (this === other) { @@ -2222,7 +2294,19 @@ private constructor( else -> throw FinchInvalidDataException("Unknown Type: $value") } - fun asString(): String = _value().asStringOrThrow() + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws FinchInvalidDataException if this class instance's value does not have + * the expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + FinchInvalidDataException("Value is not a String") + } override fun equals(other: Any?): Boolean { if (this === other) { 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 4bb4060d..0eee4350 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 @@ -1495,7 +1495,19 @@ private constructor( else -> throw FinchInvalidDataException("Unknown Subtype: $value") } - fun asString(): String = _value().asStringOrThrow() + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws FinchInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + FinchInvalidDataException("Value is not a String") + } override fun equals(other: Any?): Boolean { if (this === other) { @@ -1584,7 +1596,19 @@ private constructor( else -> throw FinchInvalidDataException("Unknown Type: $value") } - fun asString(): String = _value().asStringOrThrow() + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws FinchInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + FinchInvalidDataException("Value is not a String") + } override fun equals(other: Any?): Boolean { if (this === other) { @@ -1724,7 +1748,17 @@ private constructor( else -> throw FinchInvalidDataException("Unknown EmploymentStatus: $value") } - fun asString(): String = _value().asStringOrThrow() + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for debugging + * and generally doesn't throw. + * + * @throws FinchInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { FinchInvalidDataException("Value is not a String") } override fun equals(other: Any?): Boolean { if (this === other) { 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 490b56fc..8a1deb50 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 @@ -998,7 +998,19 @@ private constructor( else -> throw FinchInvalidDataException("Unknown Type: $value") } - fun asString(): String = _value().asStringOrThrow() + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws FinchInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + FinchInvalidDataException("Value is not a String") + } override fun equals(other: Any?): Boolean { if (this === other) { @@ -1143,7 +1155,17 @@ private constructor( else -> throw FinchInvalidDataException("Unknown Ethnicity: $value") } - fun asString(): String = _value().asStringOrThrow() + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for debugging + * and generally doesn't throw. + * + * @throws FinchInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { FinchInvalidDataException("Value is not a String") } override fun equals(other: Any?): Boolean { if (this === other) { @@ -1243,7 +1265,17 @@ private constructor( else -> throw FinchInvalidDataException("Unknown Gender: $value") } - fun asString(): String = _value().asStringOrThrow() + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for debugging + * and generally doesn't throw. + * + * @throws FinchInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { FinchInvalidDataException("Value is not a String") } override fun equals(other: Any?): Boolean { if (this === other) { @@ -1420,7 +1452,19 @@ private constructor( else -> throw FinchInvalidDataException("Unknown Type: $value") } - fun asString(): String = _value().asStringOrThrow() + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws FinchInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + FinchInvalidDataException("Value is not a String") + } override fun equals(other: Any?): Boolean { if (this === other) { 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 a8b6125a..28c765c7 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 @@ -202,7 +202,17 @@ private constructor( else -> throw FinchInvalidDataException("Unknown CompletionStatus: $value") } - fun asString(): String = _value().asStringOrThrow() + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for debugging + * and generally doesn't throw. + * + * @throws FinchInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { FinchInvalidDataException("Value is not a String") } override fun equals(other: Any?): Boolean { if (this === other) { @@ -283,7 +293,17 @@ private constructor( else -> throw FinchInvalidDataException("Unknown Type: $value") } - fun asString(): String = _value().asStringOrThrow() + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for debugging + * and generally doesn't throw. + * + * @throws FinchInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { FinchInvalidDataException("Value is not a String") } override fun equals(other: Any?): Boolean { if (this === other) { 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 d06268dd..089b6b57 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 @@ -362,7 +362,17 @@ private constructor( else -> throw FinchInvalidDataException("Unknown Type: $value") } - fun asString(): String = _value().asStringOrThrow() + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for debugging + * and generally doesn't throw. + * + * @throws FinchInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { FinchInvalidDataException("Value is not a String") } override fun equals(other: Any?): Boolean { if (this === other) { 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 53be672c..1d005427 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 @@ -1075,7 +1075,19 @@ private constructor( else -> throw FinchInvalidDataException("Unknown Type: $value") } - fun asString(): String = _value().asStringOrThrow() + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws FinchInvalidDataException if this class instance's value does not have + * the expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + FinchInvalidDataException("Value is not a String") + } override fun equals(other: Any?): Boolean { if (this === other) { @@ -1566,7 +1578,19 @@ private constructor( else -> throw FinchInvalidDataException("Unknown PaymentMethod: $value") } - fun asString(): String = _value().asStringOrThrow() + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws FinchInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + FinchInvalidDataException("Value is not a String") + } override fun equals(other: Any?): Boolean { if (this === other) { @@ -1850,7 +1874,19 @@ private constructor( else -> throw FinchInvalidDataException("Unknown Type: $value") } - fun asString(): String = _value().asStringOrThrow() + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws FinchInvalidDataException if this class instance's value does not have + * the expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + FinchInvalidDataException("Value is not a String") + } override fun equals(other: Any?): Boolean { if (this === other) { @@ -1963,7 +1999,19 @@ private constructor( else -> throw FinchInvalidDataException("Unknown Type: $value") } - fun asString(): String = _value().asStringOrThrow() + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws FinchInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + FinchInvalidDataException("Value is not a String") + } override fun equals(other: Any?): Boolean { if (this === other) { 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 c249b175..b23e5480 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 @@ -471,7 +471,17 @@ private constructor( else -> throw FinchInvalidDataException("Unknown CompanyContribution: $value") } - fun asString(): String = _value().asStringOrThrow() + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for debugging + * and generally doesn't throw. + * + * @throws FinchInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { FinchInvalidDataException("Value is not a String") } override fun equals(other: Any?): Boolean { if (this === other) { @@ -562,7 +572,17 @@ private constructor( else -> throw FinchInvalidDataException("Unknown EmployeeDeduction: $value") } - fun asString(): String = _value().asStringOrThrow() + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for debugging + * and generally doesn't throw. + * + * @throws FinchInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { FinchInvalidDataException("Value is not a String") } override fun equals(other: Any?): Boolean { if (this === other) { @@ -655,7 +675,17 @@ private constructor( else -> throw FinchInvalidDataException("Unknown HsaContributionLimit: $value") } - fun asString(): String = _value().asStringOrThrow() + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for debugging + * and generally doesn't throw. + * + * @throws FinchInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { FinchInvalidDataException("Value is not a String") } override fun equals(other: Any?): Boolean { if (this === other) { 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 eabe083c..4f4b07fe 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 @@ -418,7 +418,19 @@ private constructor( else -> throw FinchInvalidDataException("Unknown Exemption: $value") } - fun asString(): String = _value().asStringOrThrow() + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws FinchInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + FinchInvalidDataException("Value is not a String") + } override fun equals(other: Any?): Boolean { if (this === other) { @@ -521,7 +533,19 @@ private constructor( else -> throw FinchInvalidDataException("Unknown FilingStatus: $value") } - fun asString(): String = _value().asStringOrThrow() + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws FinchInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + FinchInvalidDataException("Value is not a String") + } override fun equals(other: Any?): Boolean { if (this === other) { @@ -621,7 +645,17 @@ private constructor( else -> throw FinchInvalidDataException("Unknown Type: $value") } - fun asString(): String = _value().asStringOrThrow() + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for debugging + * and generally doesn't throw. + * + * @throws FinchInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { FinchInvalidDataException("Value is not a String") } override fun equals(other: Any?): Boolean { if (this === other) { 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 980f4078..42baad1c 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 @@ -563,7 +563,19 @@ private constructor( else -> throw FinchInvalidDataException("Unknown FilingStatus: $value") } - fun asString(): String = _value().asStringOrThrow() + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws FinchInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + FinchInvalidDataException("Value is not a String") + } override fun equals(other: Any?): Boolean { if (this === other) { @@ -663,7 +675,17 @@ private constructor( else -> throw FinchInvalidDataException("Unknown Type: $value") } - fun asString(): String = _value().asStringOrThrow() + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for debugging + * and generally doesn't throw. + * + * @throws FinchInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { FinchInvalidDataException("Value is not a String") } override fun equals(other: Any?): Boolean { if (this === other) { From d2c8ddd34286909b0c77b36a931c7784c6031297 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 17 Feb 2025 23:53:59 +0000 Subject: [PATCH 05/22] feat(client): support `JsonField#asX()` for known values (#443) chore(internal): update some formatting in `Values.kt` --- .../kotlin/com/tryfinch/api/core/Values.kt | 77 +++++++--- .../com/tryfinch/api/core/ValuesTest.kt | 144 ++++++++++++++++++ 2 files changed, 196 insertions(+), 25 deletions(-) create mode 100644 finch-java-core/src/test/kotlin/com/tryfinch/api/core/ValuesTest.kt 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 c4680e54..0879a0f2 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 @@ -59,36 +59,69 @@ sealed class JsonField { fun asBoolean(): Optional = when (this) { is JsonBoolean -> Optional.of(value) + is KnownValue -> Optional.ofNullable(value as? Boolean) else -> Optional.empty() } fun asNumber(): Optional = when (this) { is JsonNumber -> Optional.of(value) + is KnownValue -> Optional.ofNullable(value as? Number) else -> Optional.empty() } fun asString(): Optional = when (this) { is JsonString -> Optional.of(value) + is KnownValue -> Optional.ofNullable(value as? String) else -> Optional.empty() } fun asStringOrThrow(): String = - when (this) { - is JsonString -> value - else -> throw FinchInvalidDataException("Value is not a string") - } + asString().orElseThrow { FinchInvalidDataException("Value is not a string") } fun asArray(): Optional> = when (this) { is JsonArray -> Optional.of(values) + is KnownValue -> + Optional.ofNullable( + (value as? List<*>)?.map { + try { + JsonValue.from(it) + } catch (e: IllegalArgumentException) { + // The known value is a list, but not all values are convertible to + // `JsonValue`. + return Optional.empty() + } + } + ) else -> Optional.empty() } fun asObject(): Optional> = when (this) { is JsonObject -> Optional.of(values) + is KnownValue -> + Optional.ofNullable( + (value as? Map<*, *>) + ?.map { (key, value) -> + if (key !is String) { + return Optional.empty() + } + + val jsonValue = + try { + JsonValue.from(value) + } catch (e: IllegalArgumentException) { + // The known value is a map, but not all items are convertible + // to `JsonValue`. + return Optional.empty() + } + + key to jsonValue + } + ?.toMap() + ) else -> Optional.empty() } @@ -96,9 +129,9 @@ sealed class JsonField { internal fun getRequired(name: String): T = when (this) { is KnownValue -> value - is JsonMissing -> throw FinchInvalidDataException("'${name}' is not set") - is JsonNull -> throw FinchInvalidDataException("'${name}' is null") - else -> throw FinchInvalidDataException("'${name}' is invalid, received ${this}") + is JsonMissing -> throw FinchInvalidDataException("`$name` is not set") + is JsonNull -> throw FinchInvalidDataException("`$name` is null") + else -> throw FinchInvalidDataException("`$name` is invalid, received $this") } @JvmSynthetic @@ -107,7 +140,7 @@ sealed class JsonField { is KnownValue -> value is JsonMissing -> null is JsonNull -> null - else -> throw FinchInvalidDataException("'${name}' is invalid, received ${this}") + else -> throw FinchInvalidDataException("`$name` is invalid, received $this") } @JvmSynthetic @@ -140,8 +173,11 @@ sealed class JsonField { } } - // This class is a Jackson filter that can be used to exclude missing properties from objects - // This filter should not be used directly and should instead use the @ExcludeMissing annotation + /** + * This class is a Jackson filter that can be used to exclude missing properties from objects. + * This filter should not be used directly and should instead use the @ExcludeMissing + * annotation. + */ class IsMissing { override fun equals(other: Any?): Boolean = other is JsonMissing @@ -154,18 +190,13 @@ sealed class JsonField { override fun createContextual( context: DeserializationContext, property: BeanProperty?, - ): JsonDeserializer> { - return Deserializer(context.contextualType?.containedType(0)) - } + ): JsonDeserializer> = Deserializer(context.contextualType?.containedType(0)) - override fun ObjectCodec.deserialize(node: JsonNode): JsonField<*> { - return type?.let { tryDeserialize(node, type) }?.let { of(it) } + override fun ObjectCodec.deserialize(node: JsonNode): JsonField<*> = + type?.let { tryDeserialize(node, type) }?.let { of(it) } ?: JsonValue.fromJsonNode(node) - } - override fun getNullValue(context: DeserializationContext): JsonField<*> { - return JsonNull.of() - } + override fun getNullValue(context: DeserializationContext): JsonField<*> = JsonNull.of() } } @@ -240,13 +271,9 @@ sealed class JsonValue : JsonField() { } class Deserializer : BaseDeserializer(JsonValue::class) { - override fun ObjectCodec.deserialize(node: JsonNode): JsonValue { - return fromJsonNode(node) - } + override fun ObjectCodec.deserialize(node: JsonNode): JsonValue = fromJsonNode(node) - override fun getNullValue(context: DeserializationContext?): JsonValue { - return JsonNull.of() - } + override fun getNullValue(context: DeserializationContext?): JsonValue = JsonNull.of() } } diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/core/ValuesTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/core/ValuesTest.kt new file mode 100644 index 00000000..e5836986 --- /dev/null +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/core/ValuesTest.kt @@ -0,0 +1,144 @@ +package com.tryfinch.api.core + +import java.util.Optional +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.params.ParameterizedTest +import org.junit.jupiter.params.provider.EnumSource + +internal class ValuesTest { + companion object { + private val NON_JSON = Any() + } + + enum class TestCase( + val value: JsonField<*>, + val expectedIsMissing: Boolean = false, + val expectedIsNull: Boolean = false, + val expectedAsKnown: Optional<*> = Optional.empty(), + val expectedAsBoolean: Optional = Optional.empty(), + val expectedAsNumber: Optional = Optional.empty(), + val expectedAsString: Optional = Optional.empty(), + val expectedAsArray: Optional> = Optional.empty(), + val expectedAsObject: Optional> = Optional.empty(), + ) { + MISSING(JsonMissing.of(), expectedIsMissing = true), + NULL(JsonNull.of(), expectedIsNull = true), + KNOWN(KnownValue.of(NON_JSON), expectedAsKnown = Optional.of(NON_JSON)), + KNOWN_BOOLEAN( + KnownValue.of(true), + expectedAsKnown = Optional.of(true), + expectedAsBoolean = Optional.of(true), + ), + BOOLEAN(JsonBoolean.of(true), expectedAsBoolean = Optional.of(true)), + KNOWN_NUMBER( + KnownValue.of(42), + expectedAsKnown = Optional.of(42), + expectedAsNumber = Optional.of(42), + ), + NUMBER(JsonNumber.of(42), expectedAsNumber = Optional.of(42)), + KNOWN_STRING( + KnownValue.of("hello"), + expectedAsKnown = Optional.of("hello"), + expectedAsString = Optional.of("hello"), + ), + STRING(JsonString.of("hello"), expectedAsString = Optional.of("hello")), + KNOWN_ARRAY_NOT_ALL_JSON( + KnownValue.of(listOf("a", "b", NON_JSON)), + expectedAsKnown = Optional.of(listOf("a", "b", NON_JSON)), + ), + KNOWN_ARRAY( + KnownValue.of(listOf("a", "b", "c")), + expectedAsKnown = Optional.of(listOf("a", "b", "c")), + expectedAsArray = + Optional.of(listOf(JsonString.of("a"), JsonString.of("b"), JsonString.of("c"))), + ), + ARRAY( + JsonArray.of(listOf(JsonString.of("a"), JsonString.of("b"), JsonString.of("c"))), + expectedAsArray = + Optional.of(listOf(JsonString.of("a"), JsonString.of("b"), JsonString.of("c"))), + ), + KNOWN_OBJECT_NOT_ALL_STRING_KEYS( + KnownValue.of(mapOf("a" to "b", 42 to "c")), + expectedAsKnown = Optional.of(mapOf("a" to "b", 42 to "c")), + ), + KNOWN_OBJECT_NOT_ALL_JSON( + KnownValue.of(mapOf("a" to "b", "b" to NON_JSON)), + expectedAsKnown = Optional.of(mapOf("a" to "b", "b" to NON_JSON)), + ), + KNOWN_OBJECT( + KnownValue.of(mapOf("a" to "b", "b" to "c")), + expectedAsKnown = Optional.of(mapOf("a" to "b", "b" to "c")), + expectedAsObject = + Optional.of(mapOf("a" to JsonString.of("b"), "b" to JsonString.of("c"))), + ), + OBJECT( + JsonObject.of(mapOf("a" to JsonString.of("b"), "b" to JsonString.of("c"))), + expectedAsObject = + Optional.of(mapOf("a" to JsonString.of("b"), "b" to JsonString.of("c"))), + ), + } + + @ParameterizedTest + @EnumSource + fun isMissing(testCase: TestCase) { + val isMissing = testCase.value.isMissing() + + assertThat(isMissing).isEqualTo(testCase.expectedIsMissing) + } + + @ParameterizedTest + @EnumSource + fun isNull(testCase: TestCase) { + val isNull = testCase.value.isNull() + + assertThat(isNull).isEqualTo(testCase.expectedIsNull) + } + + @ParameterizedTest + @EnumSource + fun asKnown(testCase: TestCase) { + val known = testCase.value.asKnown() + + assertThat(known).isEqualTo(testCase.expectedAsKnown) + } + + @ParameterizedTest + @EnumSource + fun asBoolean(testCase: TestCase) { + val boolean = testCase.value.asBoolean() + + assertThat(boolean).isEqualTo(testCase.expectedAsBoolean) + } + + @ParameterizedTest + @EnumSource + fun asNumber(testCase: TestCase) { + val number = testCase.value.asNumber() + + assertThat(number).isEqualTo(testCase.expectedAsNumber) + } + + @ParameterizedTest + @EnumSource + fun asString(testCase: TestCase) { + val string = testCase.value.asString() + + assertThat(string).isEqualTo(testCase.expectedAsString) + } + + @ParameterizedTest + @EnumSource + fun asArray(testCase: TestCase) { + val array = testCase.value.asArray() + + assertThat(array).isEqualTo(testCase.expectedAsArray) + } + + @ParameterizedTest + @EnumSource + fun asObject(testCase: TestCase) { + val obj = testCase.value.asObject() + + assertThat(obj).isEqualTo(testCase.expectedAsObject) + } +} From 2ce874d8884fdbd03831a9459460cfd0eed0531b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 18 Feb 2025 20:01:40 +0000 Subject: [PATCH 06/22] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 82b11004..55be6996 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-cc4c848e303cfff6aec3e0e300ac1841bdbd34bbe6c72151a1687724caae7c15.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-ca7f774eb91877a7573cadf88c8aa3c26c2e7133ba3855dbca5a434b46c762b5.yml From 5e38d6a432b796a0b6f34029eeac77d29284ab7c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 19 Feb 2025 02:10:10 +0000 Subject: [PATCH 07/22] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 55be6996..881556b4 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-ca7f774eb91877a7573cadf88c8aa3c26c2e7133ba3855dbca5a434b46c762b5.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-8c0cecb28682e8156dc492a0e2ee1c753e74e1fdd962c58e04b02dbcb8ae926b.yml From d84edd364074a2c8940f9790a7d47260f3f967e6 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 19 Feb 2025 03:11:40 +0000 Subject: [PATCH 08/22] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 881556b4..9c29cec0 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-8c0cecb28682e8156dc492a0e2ee1c753e74e1fdd962c58e04b02dbcb8ae926b.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-e43169b1d5fc1a2c0071bfc2a66da57c4d7f89383950a1de885446868161694f.yml From 95d82a2742519ad360c2782269fd275e0385ffdb Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 19 Feb 2025 14:07:25 +0000 Subject: [PATCH 09/22] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 9c29cec0..f7a3dfcb 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-e43169b1d5fc1a2c0071bfc2a66da57c4d7f89383950a1de885446868161694f.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-5c4b5c2d607de0011f124c70df7841b0cf651681ad6f69717b3515bfa4b51bdf.yml From a34264f4f11d18a8322e289f6505cc119853fc68 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Wed, 19 Feb 2025 10:29:22 -0500 Subject: [PATCH 10/22] fix(internal): format code --- .../kotlin/com/tryfinch/api/client/FinchClient.kt | 2 +- .../com/tryfinch/api/client/FinchClientAsync.kt | 2 +- .../com/tryfinch/api/client/FinchClientAsyncImpl.kt | 9 ++------- .../com/tryfinch/api/client/FinchClientImpl.kt | 9 ++------- .../api/services/async/WebhookServiceAsyncImpl.kt | 6 ++---- .../api/services/blocking/WebhookServiceImpl.kt | 8 +++----- .../com/tryfinch/api/client/FinchClientAsyncTest.kt | 2 +- .../com/tryfinch/api/client/FinchClientTest.kt | 2 +- .../api/services/blocking/WebhookServiceTest.kt | 12 ++++++------ 9 files changed, 19 insertions(+), 33 deletions(-) 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 424046b4..bf99f84a 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 @@ -64,7 +64,7 @@ interface FinchClient { clientId: String, clientSecret: String, code: String, - redirectUri: String? + redirectUri: String?, ): String fun getAuthUrl(products: String, redirectUri: String, sandbox: Boolean): String 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 fcba9566..e20d730b 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 @@ -65,7 +65,7 @@ interface FinchClientAsync { clientId: String, clientSecret: String, code: String, - redirectUri: String? + redirectUri: String?, ): CompletableFuture fun getAuthUrl(products: String, redirectUri: String, sandbox: Boolean): String 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 6160acbf..1a33fcc6 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 @@ -119,7 +119,7 @@ class FinchClientAsyncImpl(private val clientOptions: ClientOptions) : FinchClie clientId: String, clientSecret: String, code: String, - redirectUri: String? + redirectUri: String?, ): CompletableFuture { if (clientOptions.clientId == null) { throw FinchException("clientId must be set in order to call getAccessToken") @@ -134,12 +134,7 @@ class FinchClientAsyncImpl(private val clientOptions: ClientOptions) : FinchClie .body( json( clientOptions.jsonMapper, - GetAccessTokenParams( - clientId, - clientSecret, - code, - redirectUri, - ) + GetAccessTokenParams(clientId, clientSecret, code, redirectUri), ) ) .build() diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/client/FinchClientImpl.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/client/FinchClientImpl.kt index 2b555575..3f10b2e8 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 @@ -108,7 +108,7 @@ class FinchClientImpl(private val clientOptions: ClientOptions) : FinchClient { clientId: String, clientSecret: String, code: String, - redirectUri: String? + redirectUri: String?, ): String { if (clientOptions.clientId == null) { throw FinchException("clientId must be set in order to call getAccessToken") @@ -123,12 +123,7 @@ class FinchClientImpl(private val clientOptions: ClientOptions) : FinchClient { .body( json( clientOptions.jsonMapper, - GetAccessTokenParams( - clientId, - clientSecret, - code, - redirectUri, - ) + GetAccessTokenParams(clientId, clientSecret, code, redirectUri), ) ) .build() 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 d85619e0..598b6b8e 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 @@ -18,10 +18,8 @@ import java.util.Base64 import javax.crypto.Mac import javax.crypto.spec.SecretKeySpec -class WebhookServiceAsyncImpl -internal constructor( - private val clientOptions: ClientOptions, -) : WebhookServiceAsync { +class WebhookServiceAsyncImpl internal constructor(private val clientOptions: ClientOptions) : + WebhookServiceAsync { private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) 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 b7698929..6cb6f7b2 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 @@ -18,10 +18,8 @@ import java.util.Base64 import javax.crypto.Mac import javax.crypto.spec.SecretKeySpec -class WebhookServiceImpl -internal constructor( - private val clientOptions: ClientOptions, -) : WebhookService { +class WebhookServiceImpl internal constructor(private val clientOptions: ClientOptions) : + WebhookService { private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) @@ -90,4 +88,4 @@ internal constructor( throw FinchException("None of the given webhook signatures match the expected signature") } -} \ No newline at end of file +} diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/client/FinchClientAsyncTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/client/FinchClientAsyncTest.kt index e71b5843..eddacf85 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/client/FinchClientAsyncTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/client/FinchClientAsyncTest.kt @@ -48,7 +48,7 @@ class FinchClientAsyncTest { "our-client-id", "our-client-secret", "finch-auth-code", - "our-redirect-uri" + "our-redirect-uri", ) .get() ) diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/client/FinchClientTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/client/FinchClientTest.kt index 1d43e67f..9ae63cc9 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/client/FinchClientTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/client/FinchClientTest.kt @@ -47,7 +47,7 @@ class FinchClientTest { "our-client-id", "our-client-secret", "finch-auth-code", - "our-redirect-uri" + "our-redirect-uri", ) ) .isEqualTo(expectedToken) diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/WebhookServiceTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/WebhookServiceTest.kt index fb41874d..794772ee 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/WebhookServiceTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/WebhookServiceTest.kt @@ -70,7 +70,7 @@ class WebhookServiceTest { .put("finch-timestamp", "1676312022") .put("finch-signature", "v1,$webhookSignature") .build(), - null + null, ) } .isInstanceOf(FinchException::class.java) @@ -86,7 +86,7 @@ class WebhookServiceTest { .put("finch-timestamp", "1676312742") .put("finch-signature", "v1,$webhookSignature") .build(), - null + null, ) } .isInstanceOf(FinchException::class.java) @@ -110,7 +110,7 @@ class WebhookServiceTest { .put("finch-timestamp", webhookTimestamp) .put("finch-signature", "v1,$webhookSignature v1,Zm9v") .build(), - null + null, ) } .doesNotThrowAnyException() @@ -125,7 +125,7 @@ class WebhookServiceTest { .put("finch-timestamp", webhookTimestamp) .put("finch-signature", "v2,$webhookSignature") .build(), - null + null, ) } .isInstanceOf(FinchException::class.java) @@ -141,7 +141,7 @@ class WebhookServiceTest { .put("finch-timestamp", webhookTimestamp) .put("finch-signature", "v1,$webhookSignature v2,$webhookSignature") .build(), - null + null, ) } .doesNotThrowAnyException() @@ -156,7 +156,7 @@ class WebhookServiceTest { .put("finch-timestamp", webhookTimestamp) .put("finch-signature", webhookSignature) .build(), - null + null, ) } .isInstanceOf(FinchException::class.java) From 0d383c329ed7f8ef1cbc291efeb4d9e9f18a8de6 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 19 Feb 2025 17:12:11 +0000 Subject: [PATCH 11/22] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index f7a3dfcb..5d256aca 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-5c4b5c2d607de0011f124c70df7841b0cf651681ad6f69717b3515bfa4b51bdf.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-0bd8297838a887e60787ee1eaea3e348e48e8f418e1fb9fefda2e6d845d97432.yml From 164050e39888c30f3c6f38c8b94f31c356813db5 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 20 Feb 2025 17:15:13 +0000 Subject: [PATCH 12/22] chore(docs): reorganize readme (#444) --- README.md | 371 ++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 236 insertions(+), 135 deletions(-) diff --git a/README.md b/README.md index 12b43fd0..42198660 100644 --- a/README.md +++ b/README.md @@ -44,42 +44,17 @@ This library requires Java 8 or later. ## Usage -### Configure the client - -Use `FinchOkHttpClient.builder()` to configure the client. - -Alternately, set the environment with `FINCH_CLIENT_ID`, `FINCH_CLIENT_SECRET` or `FINCH_WEBHOOK_SECRET`, and use `FinchOkHttpClient.fromEnv()` to read from the environment. - ```java import com.tryfinch.api.client.FinchClient; import com.tryfinch.api.client.okhttp.FinchOkHttpClient; +import com.tryfinch.api.models.HrisDirectoryListPage; +import com.tryfinch.api.models.HrisDirectoryListParams; -FinchClient client = FinchOkHttpClient.fromEnv(); - -// Note: you can also call fromEnv() from the client builder, for example if you need to set additional properties FinchClient client = FinchOkHttpClient.builder() + // Configures using the `FINCH_CLIENT_ID`, `FINCH_CLIENT_SECRET` and `FINCH_WEBHOOK_SECRET` environment variables .fromEnv() - // ... set properties on the builder + .accessToken("My Access Token") .build(); -``` - -| Property | Environment variable | Required | Default value | -| ------------- | ---------------------- | -------- | ------------- | -| clientId | `FINCH_CLIENT_ID` | false | — | -| clientSecret | `FINCH_CLIENT_SECRET` | false | — | -| webhookSecret | `FINCH_WEBHOOK_SECRET` | false | — | - -Read the documentation for more configuration options. - ---- - -### Example: creating a resource - -To create a new hris directory, first use the `HrisDirectoryListParams` builder to specify attributes, then pass that to the `list` method of the `directory` service. - -```java -import com.tryfinch.api.models.HrisDirectoryListPage; -import com.tryfinch.api.models.HrisDirectoryListParams; HrisDirectoryListParams params = HrisDirectoryListParams.builder() .candidateId("") @@ -87,100 +62,128 @@ HrisDirectoryListParams params = HrisDirectoryListParams.builder() HrisDirectoryListPage page = client.hris().directory().list(params); ``` -### Example: listing resources +## Client configuration -The Finch API provides a `list` method to get a paginated list of directory. You can retrieve the first page by: +Configure the client using environment variables: ```java -import com.tryfinch.api.models.HrisDirectoryListPage; -import com.tryfinch.api.models.IndividualInDirectory; +import com.tryfinch.api.client.FinchClient; +import com.tryfinch.api.client.okhttp.FinchOkHttpClient; -HrisDirectoryListPage page = client.hris().directory().list(); -for (IndividualInDirectory directory : page.individuals()) { - System.out.println(directory); -} +FinchClient client = FinchOkHttpClient.builder() + // Configures using the `FINCH_CLIENT_ID`, `FINCH_CLIENT_SECRET` and `FINCH_WEBHOOK_SECRET` environment variables + .fromEnv() + .accessToken("My Access Token") + .build(); ``` -Use the `HrisDirectoryListParams` builder to set parameters: +Or manually: ```java -import com.tryfinch.api.models.HrisDirectoryListPage; -import com.tryfinch.api.models.HrisDirectoryListParams; +import com.tryfinch.api.client.FinchClient; +import com.tryfinch.api.client.okhttp.FinchOkHttpClient; -HrisDirectoryListParams params = HrisDirectoryListParams.builder() - .limit(0L) - .offset(0L) +FinchClient client = FinchOkHttpClient.builder() + .accessToken("My Access Token") .build(); -HrisDirectoryListPage page1 = client.hris().directory().list(params); +``` -// Using the `from` method of the builder you can reuse previous params values: -HrisDirectoryListPage page2 = client.hris().directory().list(HrisDirectoryListParams.builder() - .from(params) - .build()); +Or using a combination of the two approaches: -// Or easily get params for the next page by using the helper `getNextPageParams`: -HrisDirectoryListPage page3 = client.hris().directory().list(params.getNextPageParams(page2)); -``` +```java +import com.tryfinch.api.client.FinchClient; +import com.tryfinch.api.client.okhttp.FinchOkHttpClient; -See [Pagination](#pagination) below for more information on transparently working with lists of objects without worrying about fetching each page. +FinchClient client = FinchOkHttpClient.builder() + // Configures using the `FINCH_CLIENT_ID`, `FINCH_CLIENT_SECRET` and `FINCH_WEBHOOK_SECRET` environment variables + .fromEnv() + .accessToken("My Access Token") + .accessToken("My Access Token") + .build(); +``` ---- +See this table for the available options: -## Requests +| Setter | Environment variable | Required | Default value | +| --------------- | ---------------------- | -------- | ------------- | +| `clientId` | `FINCH_CLIENT_ID` | false | - | +| `clientSecret` | `FINCH_CLIENT_SECRET` | false | - | +| `webhookSecret` | `FINCH_WEBHOOK_SECRET` | false | - | -### Parameters and bodies +> [!TIP] +> Don't create more than one client in the same application. Each client has a connection pool and +> thread pools, which are more efficient to share between requests. -To make a request to the Finch API, you generally build an instance of the appropriate `Params` class. +## Requests and responses -See [Undocumented request params](#undocumented-request-params) for how to send arbitrary parameters. +To send a request to the Finch API, build an instance of some `Params` class and pass it to the corresponding client method. When the response is received, it will be deserialized into an instance of a Java class. -## Responses +For example, `client.hris().directory().list(...)` should be called with an instance of `HrisDirectoryListParams`, and it will return an instance of `HrisDirectoryListPage`. -### Response validation +## Asynchronous execution -When receiving a response, the Finch Java SDK will deserialize it into instances of the typed model classes. In rare cases, the API may return a response property that doesn't match the expected Java type. If you directly access the mistaken property, the SDK will throw an unchecked `FinchInvalidDataException` at runtime. If you would prefer to check in advance that that response is completely well-typed, call `.validate()` on the returned model. +The default client is synchronous. To switch to asynchronous execution, call the `async()` method: ```java -import com.tryfinch.api.models.HrisDirectoryListPage; +import com.tryfinch.api.client.FinchClient; +import com.tryfinch.api.client.okhttp.FinchOkHttpClient; +import com.tryfinch.api.models.HrisDirectoryListPageAsync; +import com.tryfinch.api.models.HrisDirectoryListParams; +import java.util.concurrent.CompletableFuture; -HrisDirectoryListPage page = client.hris().directory().list().validate(); -``` +FinchClient client = FinchOkHttpClient.builder() + // Configures using the `FINCH_CLIENT_ID`, `FINCH_CLIENT_SECRET` and `FINCH_WEBHOOK_SECRET` environment variables + .fromEnv() + .accessToken("My Access Token") + .build(); -### Response properties as JSON +HrisDirectoryListParams params = HrisDirectoryListParams.builder().build(); +CompletableFuture page = client.async().hris().directory().list(params); +``` -In rare cases, you may want to access the underlying JSON value for a response property rather than using the typed version provided by this SDK. Each model property has a corresponding JSON version, with an underscore before the method name, which returns a `JsonField` value. +Or create an asynchronous client from the beginning: ```java -import com.tryfinch.api.core.JsonField; -import java.util.Optional; - -JsonField field = responseObj._field(); +import com.tryfinch.api.client.FinchClientAsync; +import com.tryfinch.api.client.okhttp.FinchOkHttpClientAsync; +import com.tryfinch.api.models.HrisDirectoryListPageAsync; +import com.tryfinch.api.models.HrisDirectoryListParams; +import java.util.concurrent.CompletableFuture; -if (field.isMissing()) { - // Value was not specified in the JSON response -} else if (field.isNull()) { - // Value was provided as a literal null -} else { - // See if value was provided as a string - Optional jsonString = field.asString(); +FinchClientAsync client = FinchOkHttpClientAsync.builder() + // Configures using the `FINCH_CLIENT_ID`, `FINCH_CLIENT_SECRET` and `FINCH_WEBHOOK_SECRET` environment variables + .fromEnv() + .accessToken("My Access Token") + .build(); - // If the value given by the API did not match the shape that the SDK expects - // you can deserialise into a custom type - MyClass myObj = responseObj._field().asUnknown().orElseThrow().convert(MyClass.class); -} +HrisDirectoryListParams params = HrisDirectoryListParams.builder().build(); +CompletableFuture page = client.hris().directory().list(params); ``` -### Additional model properties +The asynchronous client supports the same options as the synchronous one, except most methods return `CompletableFuture`s. -Sometimes, the server response may include additional properties that are not yet available in this library's types. You can access them using the model's `_additionalProperties` method: +## Error handling -```java -import com.tryfinch.api.core.JsonValue; +The SDK throws custom unchecked exception types: -JsonValue secret = operationSupportMatrix._additionalProperties().get("secret_field"); -``` +- `FinchServiceException`: Base class for HTTP errors. See this table for which exception subclass is thrown for each HTTP status code: ---- + | Status | Exception | + | ------ | ------------------------------- | + | 400 | `BadRequestException` | + | 401 | `AuthenticationException` | + | 403 | `PermissionDeniedException` | + | 404 | `NotFoundException` | + | 422 | `UnprocessableEntityException` | + | 429 | `RateLimitException` | + | 5xx | `InternalServerException` | + | others | `UnexpectedStatusCodeException` | + +- `FinchIoException`: I/O networking errors. + +- `FinchInvalidDataException`: Failure to interpret successfully parsed data. For example, when accessing a property that's supposed to be required, but the API unexpectedly omitted it from the response. + +- `FinchException`: Base class for all exceptions. Most errors will result in one of the previously mentioned ones, but completely generic errors may be thrown using the base class. ## Pagination @@ -234,9 +237,21 @@ while (page != null) { } ``` ---- +## Logging ---- +The SDK uses the standard [OkHttp logging interceptor](https://github.com/square/okhttp/tree/master/okhttp-logging-interceptor). + +Enable logging by setting the `FINCH_LOG` environment variable to `info`: + +```sh +$ export FINCH_LOG=info +``` + +Or to `debug` for more verbose logging: + +```sh +$ export FINCH_LOG=debug +``` ## Webhook Verification @@ -248,36 +263,23 @@ both of which will raise an error if the signature is invalid. Note that the "body" parameter must be the raw JSON string sent from the server (do not parse it first). The `.unwrap()` method can parse this JSON for you. ---- - -## Error handling - -This library throws exceptions in a single hierarchy for easy handling: - -- **`FinchException`** - Base exception for all exceptions +## Network options -- **`FinchServiceException`** - HTTP errors with a well-formed response body we were able to parse. The exception message and the `.debuggingRequestId()` will be set by the server. +### Retries - | 400 | BadRequestException | - | ------ | ----------------------------- | - | 401 | AuthenticationException | - | 403 | PermissionDeniedException | - | 404 | NotFoundException | - | 422 | UnprocessableEntityException | - | 429 | RateLimitException | - | 5xx | InternalServerException | - | others | UnexpectedStatusCodeException | +The SDK automatically retries 2 times by default, with a short exponential backoff. -- **`FinchIoException`** - I/O networking errors -- **`FinchInvalidDataException`** - any other exceptions on the client side, e.g.: - - We failed to serialize the request body - - We failed to parse the response body (has access to response code and body) +Only the following error types are retried: -## Network options +- Connection errors (for example, due to a network connectivity problem) +- 408 Request Timeout +- 409 Conflict +- 429 Rate Limit +- 5xx Internal -### Retries +The API may also explicitly instruct the SDK to retry or not retry a response. -Requests that experience certain errors are automatically retried 2 times by default, with a short exponential backoff. Connection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict, 429 Rate Limit, and >=500 Internal errors will all be retried by default. You can provide a `maxRetries` on the client builder to configure this: +To set a custom number of retries, configure the client using the `maxRetries` method: ```java import com.tryfinch.api.client.FinchClient; @@ -285,13 +287,27 @@ import com.tryfinch.api.client.okhttp.FinchOkHttpClient; FinchClient client = FinchOkHttpClient.builder() .fromEnv() + .accessToken("My Access Token") .maxRetries(4) .build(); ``` ### Timeouts -Requests time out after 1 minute by default. You can configure this on the client builder: +Requests time out after 1 minute by default. + +To set a custom timeout, configure the method call using the `timeout` method: + +```java +import com.tryfinch.api.models.HrisDirectoryListPage; +import com.tryfinch.api.models.HrisDirectoryListParams; + +HrisDirectoryListPage page = client.hris().directory().list( + params, RequestOptions.builder().timeout(Duration.ofSeconds(30)).build() +); +``` + +Or configure the default for all method calls at the client level: ```java import com.tryfinch.api.client.FinchClient; @@ -300,13 +316,14 @@ import java.time.Duration; FinchClient client = FinchOkHttpClient.builder() .fromEnv() + .accessToken("My Access Token") .timeout(Duration.ofSeconds(30)) .build(); ``` ### Proxies -Requests can be routed through a proxy. You can configure this on the client builder: +To route requests through a proxy, configure the client using the `proxy` method: ```java import com.tryfinch.api.client.FinchClient; @@ -316,51 +333,135 @@ import java.net.Proxy; FinchClient client = FinchOkHttpClient.builder() .fromEnv() - .proxy(new Proxy(Proxy.Type.HTTP, new InetSocketAddress("example.com", 8080))) + .accessToken("My Access Token") + .proxy(new Proxy( + Proxy.Type.HTTP, new InetSocketAddress( + "https://example.com", 8080 + ) + )) .build(); ``` -## Making custom/undocumented requests - -This library is typed for convenient access to the documented API. If you need to access undocumented params or response properties, the library can still be used. +## Undocumented API functionality -### Undocumented request params +The SDK is typed for convenient usage of the documented API. However, it also supports working with undocumented or not yet supported parts of the API. -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. +### Parameters -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: +To set undocumented parameters, call the `putAdditionalHeader`, `putAdditionalQueryParam`, or `putAdditionalBodyProperty` methods on any `Params` class: ```java import com.tryfinch.api.core.JsonValue; -import com.tryfinch.api.models.HrisDirectoryListParams; +import com.tryfinch.api.models.AccessTokenCreateParams; -HrisDirectoryListParams params = HrisDirectoryListParams.builder() +AccessTokenCreateParams params = AccessTokenCreateParams.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. +These can be accessed on the built object later using the `_additionalHeaders()`, `_additionalQueryParams()`, and `_additionalBodyProperties()` methods. You can also set undocumented parameters on nested headers, query params, or body classes using the `putAdditionalProperty` method. These properties can be accessed on the built object later using the `_additionalProperties()` method. -### Undocumented response properties +To set a documented parameter or property to an undocumented or not yet supported _value_, pass a `JsonValue` object to its setter: -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. +```java +import com.tryfinch.api.models.AccessTokenCreateParams; +import com.tryfinch.api.models.HrisDirectoryListParams; -## Logging +AccessTokenCreateParams params = HrisDirectoryListParams.builder().build(); +``` -We use the standard [OkHttp logging interceptor](https://github.com/square/okhttp/tree/master/okhttp-logging-interceptor). +### Response properties -You can enable logging by setting the environment variable `FINCH_LOG` to `info`. +To access undocumented response properties, call the `_additionalProperties()` method: -```sh -$ export FINCH_LOG=info +```java +import com.tryfinch.api.core.JsonValue; +import java.util.Map; + +Map additionalProperties = client.accessTokens().create(params)._additionalProperties(); +JsonValue secretPropertyValue = additionalProperties.get("secretProperty"); + +String result = secretPropertyValue.accept(new JsonValue.Visitor<>() { + @Override + public String visitNull() { + return "It's null!"; + } + + @Override + public String visitBoolean(boolean value) { + return "It's a boolean!"; + } + + @Override + public String visitNumber(Number value) { + return "It's a number!"; + } + + // Other methods include `visitMissing`, `visitString`, `visitArray`, and `visitObject` + // The default implementation of each unimplemented method delegates to `visitDefault`, which throws by default, but can also be overridden +}); ``` -Or to `debug` for more verbose logging. +To access a property's raw JSON value, which may be undocumented, call its `_` prefixed method: -```sh -$ export FINCH_LOG=debug +```java +import com.tryfinch.api.core.JsonField; +import java.util.Optional; + +JsonField code = client.accessTokens().create(params)._code(); + +if (code.isMissing()) { + // The property is absent from the JSON response +} else if (code.isNull()) { + // The property was set to literal null +} else { + // Check if value was provided as a string + // Other methods include `asNumber()`, `asBoolean()`, etc. + Optional jsonString = code.asString(); + + // Try to deserialize into a custom type + MyClass myObject = code.asUnknown().orElseThrow().convert(MyClass.class); +} +``` + +### Response validation + +In rare cases, the API may return a response that doesn't match the expected type. For example, the SDK may expect a property to contain a `String`, but the API could return something else. + +By default, the SDK will not throw an exception in this case. It will throw `FinchInvalidDataException` only if you directly access the property. + +If you would prefer to check that the response is completely well-typed upfront, then either call `validate()`: + +```java +import com.tryfinch.api.models.CreateAccessTokenResponse; + +CreateAccessTokenResponse createAccessTokenResponse = client.accessTokens().create(params).validate(); +``` + +Or configure the method call to validate the response using the `responseValidation` method: + +```java +import com.tryfinch.api.models.HrisDirectoryListPage; +import com.tryfinch.api.models.HrisDirectoryListParams; + +HrisDirectoryListPage page = client.hris().directory().list( + params, RequestOptions.builder().responseValidation(true).build() +); +``` + +Or configure the default for all method calls at the client level: + +```java +import com.tryfinch.api.client.FinchClient; +import com.tryfinch.api.client.okhttp.FinchOkHttpClient; + +FinchClient client = FinchOkHttpClient.builder() + .fromEnv() + .accessToken("My Access Token") + .responseValidation(true) + .build(); ``` ## Semantic versioning From 35edbd85822b3a521077d9d1ac96d5e071d018a5 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 20 Feb 2025 17:28:13 +0000 Subject: [PATCH 13/22] chore(internal): get rid of configuration cache (#446) It's causing release issues in some cases. --- gradle.properties | 1 - 1 file changed, 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index ec5c5092..0c8d4ded 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,3 @@ -org.gradle.configuration-cache=true org.gradle.caching=true org.gradle.parallel=true org.gradle.daemon=false From 97cc45e241bf75d7255ba8fc645975168a944b7d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 20 Feb 2025 17:58:10 +0000 Subject: [PATCH 14/22] chore(ci): update gradle actions to v4 (#447) Note that `setup-gradle@v4` automatically runs wrapper validation. --- .github/workflows/ci.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 71594a4c..121ace97 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,9 +17,6 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Validate Gradle wrapper - uses: gradle/actions/wrapper-validation@v3 - - name: Set up Java uses: actions/setup-java@v4 with: @@ -30,7 +27,7 @@ jobs: cache: gradle - name: Set up Gradle - uses: gradle/gradle-build-action@v2 + uses: gradle/actions/setup-gradle@v4 - name: Run lints run: ./scripts/lint From 6db294858870c374b2cb30bf4fd02a52e66452b6 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 20 Feb 2025 18:25:07 +0000 Subject: [PATCH 15/22] chore(internal): codegen related update (#448) --- README.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 42198660..2ba986ec 100644 --- a/README.md +++ b/README.md @@ -352,9 +352,9 @@ To set undocumented parameters, call the `putAdditionalHeader`, `putAdditionalQu ```java import com.tryfinch.api.core.JsonValue; -import com.tryfinch.api.models.AccessTokenCreateParams; +import com.tryfinch.api.models.HrisDirectoryListParams; -AccessTokenCreateParams params = AccessTokenCreateParams.builder() +HrisDirectoryListParams params = HrisDirectoryListParams.builder() .putAdditionalHeader("Secret-Header", "42") .putAdditionalQueryParam("secret_query_param", "42") .putAdditionalBodyProperty("secretProperty", JsonValue.from("42")) @@ -366,10 +366,9 @@ These can be accessed on the built object later using the `_additionalHeaders()` To set a documented parameter or property to an undocumented or not yet supported _value_, pass a `JsonValue` object to its setter: ```java -import com.tryfinch.api.models.AccessTokenCreateParams; import com.tryfinch.api.models.HrisDirectoryListParams; -AccessTokenCreateParams params = HrisDirectoryListParams.builder().build(); +HrisDirectoryListParams params = HrisDirectoryListParams.builder().build(); ``` ### Response properties From e7312ce5f83cad66a8b1c71697dda825c595480b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 20 Feb 2025 19:16:08 +0000 Subject: [PATCH 16/22] feat(client): get rid of annoying checked exceptions (#449) --- .../src/main/kotlin/com/tryfinch/api/core/http/HttpClient.kt | 3 +++ .../main/kotlin/com/tryfinch/api/core/http/HttpRequestBody.kt | 4 ++-- .../main/kotlin/com/tryfinch/api/core/http/HttpResponse.kt | 3 +++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/core/http/HttpClient.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/core/http/HttpClient.kt index 168c41e9..293114df 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/core/http/HttpClient.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/core/http/HttpClient.kt @@ -19,4 +19,7 @@ interface HttpClient : AutoCloseable { request: HttpRequest, requestOptions: RequestOptions = RequestOptions.none(), ): CompletableFuture + + /** Overridden from [AutoCloseable] to not have a checked exception in its signature. */ + override fun close() } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/core/http/HttpRequestBody.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/core/http/HttpRequestBody.kt index 678c36e2..ac13d310 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/core/http/HttpRequestBody.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/core/http/HttpRequestBody.kt @@ -1,12 +1,11 @@ package com.tryfinch.api.core.http -import java.io.IOException import java.io.OutputStream import java.lang.AutoCloseable interface HttpRequestBody : AutoCloseable { - @Throws(IOException::class) fun writeTo(outputStream: OutputStream) + fun writeTo(outputStream: OutputStream) fun contentType(): String? @@ -21,5 +20,6 @@ interface HttpRequestBody : AutoCloseable { */ fun repeatable(): Boolean + /** Overridden from [AutoCloseable] to not have a checked exception in its signature. */ override fun close() } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/core/http/HttpResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/core/http/HttpResponse.kt index 60280415..ad9844e8 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/core/http/HttpResponse.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/core/http/HttpResponse.kt @@ -11,6 +11,9 @@ interface HttpResponse : AutoCloseable { fun body(): InputStream + /** Overridden from [AutoCloseable] to not have a checked exception in its signature. */ + override fun close() + interface Handler { fun handle(response: HttpResponse): T From fd63219b1fe6bda4743f2150cfa1ee4290e271d9 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 20 Feb 2025 22:13:27 +0000 Subject: [PATCH 17/22] chore(docs): add faq to readme (#450) --- README.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/README.md b/README.md index 2ba986ec..45f45476 100644 --- a/README.md +++ b/README.md @@ -463,6 +463,35 @@ FinchClient client = FinchOkHttpClient.builder() .build(); ``` +## FAQ + +### Why don't you use plain `enum` classes? + +Java `enum` classes are not trivially [forwards compatible](https://www.stainless.com/blog/making-java-enums-forwards-compatible). Using them in the SDK could cause runtime exceptions if the API is updated to respond with a new enum value. + +### Why do you represent fields using `JsonField` instead of just plain `T`? + +Using `JsonField` enables a few features: + +- Allowing usage of [undocumented API functionality](#undocumented-api-functionality) +- Lazily [validating the API response against the expected shape](#response-validation) +- Representing absent vs explicitly null values + +### Why don't you use [`data` classes](https://kotlinlang.org/docs/data-classes.html)? + +It is not [backwards compatible to add new fields to a data class](https://kotlinlang.org/docs/api-guidelines-backward-compatibility.html#avoid-using-data-classes-in-your-api) and we don't want to introduce a breaking change every time we add a field to a class. + +### Why don't you use checked exceptions? + +Checked exceptions are widely considered a mistake in the Java programming language. In fact, they were omitted from Kotlin for this reason. + +Checked exceptions: + +- Are verbose to handle +- Encourage error handling at the wrong level of abstraction, where nothing can be done about the error +- Are tedious to propagate due to the [function coloring problem](https://journal.stuffwithstuff.com/2015/02/01/what-color-is-your-function) +- Don't play well with lambdas (also due to the function coloring problem) + ## Semantic versioning This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions: From 344ac4bd5a99c29f50c8bf62640e536251fc491d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 20 Feb 2025 22:49:52 +0000 Subject: [PATCH 18/22] fix(client): mark some request bodies as optional (#451) chore(internal): use `assertNotNull` in tests for type narrowing chore(internal): remove unnecessary non-null asserts in tests --- .../tryfinch/api/models/EnrolledIndividual.kt | 3 ++- .../api/models/JobAutomatedCreateParams.kt | 16 ++++++------ .../models/SandboxDirectoryCreateParams.kt | 20 +++++++++------ .../async/jobs/AutomatedServiceAsyncImpl.kt | 2 +- .../sandbox/DirectoryServiceAsyncImpl.kt | 2 +- .../blocking/jobs/AutomatedServiceImpl.kt | 2 +- .../blocking/sandbox/DirectoryServiceImpl.kt | 2 +- .../api/models/AccessTokenCreateParamsTest.kt | 5 ++-- .../api/models/ConnectSessionNewParamsTest.kt | 5 ++-- .../ConnectSessionReauthenticateParamsTest.kt | 5 ++-- .../api/models/HrisBenefitCreateParamsTest.kt | 5 ++-- ...BenefitIndividualUnenrollManyParamsTest.kt | 5 ++-- .../api/models/HrisBenefitUpdateParamsTest.kt | 5 ++-- .../HrisEmploymentRetrieveManyParamsTest.kt | 5 ++-- .../HrisIndividualRetrieveManyParamsTest.kt | 5 ++-- .../HrisPayStatementRetrieveManyParamsTest.kt | 5 ++-- .../models/JobAutomatedCreateParamsTest.kt | 25 +++---------------- .../RequestForwardingForwardParamsTest.kt | 5 ++-- .../models/SandboxCompanyUpdateParamsTest.kt | 5 ++-- ...andboxConnectionAccountCreateParamsTest.kt | 5 ++-- ...andboxConnectionAccountUpdateParamsTest.kt | 5 ++-- .../SandboxConnectionCreateParamsTest.kt | 5 ++-- .../SandboxDirectoryCreateParamsTest.kt | 17 +++---------- .../SandboxEmploymentUpdateParamsTest.kt | 5 ++-- .../SandboxIndividualUpdateParamsTest.kt | 5 ++-- ...SandboxJobConfigurationUpdateParamsTest.kt | 2 -- .../api/models/SandboxJobCreateParamsTest.kt | 5 ++-- .../models/SandboxPaymentCreateParamsTest.kt | 5 ++-- 28 files changed, 88 insertions(+), 93 deletions(-) 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 2e1109e9..8f31d858 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 @@ -17,6 +17,7 @@ import com.tryfinch.api.core.toImmutable import com.tryfinch.api.errors.FinchInvalidDataException import java.util.Objects import java.util.Optional +import kotlin.jvm.optionals.getOrNull @NoAutoDetect class EnrolledIndividual @@ -360,7 +361,7 @@ private constructor( * expected primitive type. */ fun asLong(): Long = - _value().asNumber().orElse(null)?.let { + _value().asNumber().getOrNull()?.let { if (it.toDouble() % 1 == 0.0) it.toLong() else null } ?: throw FinchInvalidDataException("Value is not a Long") 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 4a23c57d..187f04d1 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 @@ -50,18 +50,18 @@ import kotlin.jvm.optionals.getOrNull */ class JobAutomatedCreateParams private constructor( - private val body: Body, + private val body: Body?, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, ) : Params { - fun body(): Body = body + fun body(): Optional = Optional.ofNullable(body) fun _additionalHeaders(): Headers = additionalHeaders fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun _body(): Body = body + @JvmSynthetic internal fun _body(): Optional = Optional.ofNullable(body) override fun _headers(): Headers = additionalHeaders @@ -759,7 +759,9 @@ private constructor( additionalQueryParams = jobAutomatedCreateParams.additionalQueryParams.toBuilder() } - fun body(body: Body) = apply { this.body = body } + fun body(body: Body?) = apply { this.body = body } + + fun body(body: Optional) = body(body.orElse(null)) fun body(dataSyncAll: Body.DataSyncAll) = body(Body.ofDataSyncAll(dataSyncAll)) @@ -875,11 +877,7 @@ private constructor( } fun build(): JobAutomatedCreateParams = - JobAutomatedCreateParams( - checkRequired("body", body), - additionalHeaders.build(), - additionalQueryParams.build(), - ) + JobAutomatedCreateParams(body, additionalHeaders.build(), additionalQueryParams.build()) } override fun equals(other: Any?): Boolean { diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxDirectoryCreateParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/SandboxDirectoryCreateParams.kt index 9aa616be..69d1eaeb 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 @@ -13,7 +13,6 @@ 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 import com.tryfinch.api.core.immutableEmptyMap @@ -25,7 +24,7 @@ import java.util.Optional /** Add new individuals to a sandbox company */ class SandboxDirectoryCreateParams private constructor( - private val body: List, + private val body: List?, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, ) : Params { @@ -34,13 +33,14 @@ private constructor( * Array of individuals to create. Takes all combined fields from `/individual` and * `/employment` endpoints. All fields are optional. */ - fun body(): List = body + fun body(): Optional> = Optional.ofNullable(body) fun _additionalHeaders(): Headers = additionalHeaders fun _additionalQueryParams(): QueryParams = additionalQueryParams - @JvmSynthetic internal fun _body(): List = body + @JvmSynthetic + internal fun _body(): Optional> = Optional.ofNullable(body) override fun _headers(): Headers = additionalHeaders @@ -2374,7 +2374,7 @@ private constructor( @JvmSynthetic internal fun from(sandboxDirectoryCreateParams: SandboxDirectoryCreateParams) = apply { - body = sandboxDirectoryCreateParams.body.toMutableList() + body = sandboxDirectoryCreateParams.body?.toMutableList() additionalHeaders = sandboxDirectoryCreateParams.additionalHeaders.toBuilder() additionalQueryParams = sandboxDirectoryCreateParams.additionalQueryParams.toBuilder() } @@ -2383,7 +2383,13 @@ private constructor( * Array of individuals to create. Takes all combined fields from `/individual` and * `/employment` endpoints. All fields are optional. */ - fun body(body: List) = apply { this.body = body.toMutableList() } + fun body(body: List?) = apply { this.body = body?.toMutableList() } + + /** + * Array of individuals to create. Takes all combined fields from `/individual` and + * `/employment` endpoints. All fields are optional. + */ + fun body(body: Optional>) = body(body.orElse(null)) /** * Array of individuals to create. Takes all combined fields from `/individual` and @@ -2493,7 +2499,7 @@ private constructor( fun build(): SandboxDirectoryCreateParams = SandboxDirectoryCreateParams( - checkRequired("body", body).toImmutable(), + body?.toImmutable(), additionalHeaders.build(), additionalQueryParams.build(), ) 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 934af1b6..9a621fc9 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 @@ -53,7 +53,7 @@ class AutomatedServiceAsyncImpl internal constructor(private val clientOptions: HttpRequest.builder() .method(HttpMethod.POST) .addPathSegments("jobs", "automated") - .body(json(clientOptions.jsonMapper, params._body())) + .apply { params._body().ifPresent { body(json(clientOptions.jsonMapper, it)) } } .build() .prepareAsync(clientOptions, params) return request 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 43178f1f..f65ae934 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 @@ -34,7 +34,7 @@ class DirectoryServiceAsyncImpl internal constructor(private val clientOptions: HttpRequest.builder() .method(HttpMethod.POST) .addPathSegments("sandbox", "directory") - .body(json(clientOptions.jsonMapper, params._body())) + .apply { params._body().ifPresent { body(json(clientOptions.jsonMapper, it)) } } .build() .prepareAsync(clientOptions, params) return request 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 ed3b54cc..89ff745a 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 @@ -52,7 +52,7 @@ class AutomatedServiceImpl internal constructor(private val clientOptions: Clien HttpRequest.builder() .method(HttpMethod.POST) .addPathSegments("jobs", "automated") - .body(json(clientOptions.jsonMapper, params._body())) + .apply { params._body().ifPresent { body(json(clientOptions.jsonMapper, it)) } } .build() .prepare(clientOptions, params) val response = clientOptions.httpClient.execute(request, requestOptions) 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 5213cce1..acc30e28 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 @@ -33,7 +33,7 @@ class DirectoryServiceImpl internal constructor(private val clientOptions: Clien HttpRequest.builder() .method(HttpMethod.POST) .addPathSegments("sandbox", "directory") - .body(json(clientOptions.jsonMapper, params._body())) + .apply { params._body().ifPresent { body(json(clientOptions.jsonMapper, it)) } } .build() .prepare(clientOptions, params) val response = clientOptions.httpClient.execute(request, requestOptions) 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 85f99e40..3878dc6a 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 @@ -2,6 +2,7 @@ package com.tryfinch.api.models +import kotlin.test.assertNotNull import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -29,7 +30,7 @@ class AccessTokenCreateParamsTest { val body = params._body() - assertThat(body).isNotNull + assertNotNull(body) assertThat(body.code()).isEqualTo("") assertThat(body.clientId()).contains("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") assertThat(body.clientSecret()).contains("") @@ -42,7 +43,7 @@ class AccessTokenCreateParamsTest { val body = params._body() - assertThat(body).isNotNull + assertNotNull(body) 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 eb55d9c0..ee91137d 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 @@ -2,6 +2,7 @@ package com.tryfinch.api.models +import kotlin.test.assertNotNull import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -49,7 +50,7 @@ class ConnectSessionNewParamsTest { val body = params._body() - assertThat(body).isNotNull + assertNotNull(body) assertThat(body.customerId()).isEqualTo("x") assertThat(body.customerName()).isEqualTo("x") assertThat(body.products()) @@ -79,7 +80,7 @@ class ConnectSessionNewParamsTest { val body = params._body() - assertThat(body).isNotNull + assertNotNull(body) assertThat(body.customerId()).isEqualTo("x") assertThat(body.customerName()).isEqualTo("x") assertThat(body.products()) 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 cb70ff9f..bd7bdfdc 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 @@ -2,6 +2,7 @@ package com.tryfinch.api.models +import kotlin.test.assertNotNull import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -29,7 +30,7 @@ class ConnectSessionReauthenticateParamsTest { val body = params._body() - assertThat(body).isNotNull + assertNotNull(body) assertThat(body.connectionId()).isEqualTo("connection_id") assertThat(body.minutesToExpire()).contains(0L) assertThat(body.products()) @@ -44,7 +45,7 @@ class ConnectSessionReauthenticateParamsTest { val body = params._body() - assertThat(body).isNotNull + assertNotNull(body) 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 2ab6acf8..8255a9c7 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 @@ -2,6 +2,7 @@ package com.tryfinch.api.models +import kotlin.test.assertNotNull import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -27,7 +28,7 @@ class HrisBenefitCreateParamsTest { val body = params._body() - assertThat(body).isNotNull + assertNotNull(body) assertThat(body.description()).contains("description") assertThat(body.frequency()).contains(BenefitFrequency.ONE_TIME) assertThat(body.type()).contains(BenefitType._401K) @@ -39,6 +40,6 @@ class HrisBenefitCreateParamsTest { val body = params._body() - assertThat(body).isNotNull + assertNotNull(body) } } 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 ec335459..9e007c2a 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 @@ -2,6 +2,7 @@ package com.tryfinch.api.models +import kotlin.test.assertNotNull import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -25,7 +26,7 @@ class HrisBenefitIndividualUnenrollManyParamsTest { val body = params._body() - assertThat(body).isNotNull + assertNotNull(body) assertThat(body.individualIds()).contains(listOf("string")) } @@ -36,7 +37,7 @@ class HrisBenefitIndividualUnenrollManyParamsTest { val body = params._body() - assertThat(body).isNotNull + assertNotNull(body) } @Test diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisBenefitUpdateParamsTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisBenefitUpdateParamsTest.kt index 14ba6378..b9074f26 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 @@ -2,6 +2,7 @@ package com.tryfinch.api.models +import kotlin.test.assertNotNull import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -22,7 +23,7 @@ class HrisBenefitUpdateParamsTest { val body = params._body() - assertThat(body).isNotNull + assertNotNull(body) assertThat(body.description()).contains("description") } @@ -32,7 +33,7 @@ class HrisBenefitUpdateParamsTest { val body = params._body() - assertThat(body).isNotNull + assertNotNull(body) } @Test 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 f9fe2f93..c1b825d6 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 @@ -2,6 +2,7 @@ package com.tryfinch.api.models +import kotlin.test.assertNotNull import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -31,7 +32,7 @@ class HrisEmploymentRetrieveManyParamsTest { val body = params._body() - assertThat(body).isNotNull + assertNotNull(body) assertThat(body.requests()) .isEqualTo( listOf( @@ -55,7 +56,7 @@ class HrisEmploymentRetrieveManyParamsTest { val body = params._body() - assertThat(body).isNotNull + assertNotNull(body) assertThat(body.requests()) .isEqualTo( listOf( 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 54d133cd..34340368 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 @@ -2,6 +2,7 @@ package com.tryfinch.api.models +import kotlin.test.assertNotNull import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -37,7 +38,7 @@ class HrisIndividualRetrieveManyParamsTest { val body = params._body() - assertThat(body).isNotNull + assertNotNull(body) assertThat(body.options()) .contains( HrisIndividualRetrieveManyParams.Options.builder().addInclude("string").build() @@ -58,6 +59,6 @@ class HrisIndividualRetrieveManyParamsTest { val body = params._body() - assertThat(body).isNotNull + assertNotNull(body) } } 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 f782eb92..da6b1ccd 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 @@ -2,6 +2,7 @@ package com.tryfinch.api.models +import kotlin.test.assertNotNull import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -35,7 +36,7 @@ class HrisPayStatementRetrieveManyParamsTest { val body = params._body() - assertThat(body).isNotNull + assertNotNull(body) assertThat(body.requests()) .isEqualTo( listOf( @@ -59,7 +60,7 @@ class HrisPayStatementRetrieveManyParamsTest { val body = params._body() - assertThat(body).isNotNull + assertNotNull(body) assertThat(body.requests()) .isEqualTo( listOf( 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 45f142eb..3e50cc29 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 @@ -2,6 +2,7 @@ package com.tryfinch.api.models +import kotlin.jvm.optionals.getOrNull import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -29,9 +30,8 @@ class JobAutomatedCreateParamsTest { ) .build() - val body = params._body() + val body = params._body().getOrNull() - assertThat(body).isNotNull assertThat(body) .isEqualTo( JobAutomatedCreateParams.Body.ofDataSyncAll( @@ -44,25 +44,8 @@ class JobAutomatedCreateParamsTest { @Test fun bodyWithoutOptionalFields() { - val params = - JobAutomatedCreateParams.builder() - .body( - JobAutomatedCreateParams.Body.DataSyncAll.builder() - .type(JobAutomatedCreateParams.Body.DataSyncAll.Type.DATA_SYNC_ALL) - .build() - ) - .build() - - val body = params._body() + val params = JobAutomatedCreateParams.builder().build() - assertThat(body).isNotNull - assertThat(body) - .isEqualTo( - JobAutomatedCreateParams.Body.ofDataSyncAll( - JobAutomatedCreateParams.Body.DataSyncAll.builder() - .type(JobAutomatedCreateParams.Body.DataSyncAll.Type.DATA_SYNC_ALL) - .build() - ) - ) + val body = params._body().getOrNull() } } 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 3826f318..d754bf09 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 @@ -3,6 +3,7 @@ package com.tryfinch.api.models import com.tryfinch.api.core.JsonValue +import kotlin.test.assertNotNull import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -32,7 +33,7 @@ class RequestForwardingForwardParamsTest { val body = params._body() - assertThat(body).isNotNull + assertNotNull(body) assertThat(body.method()).isEqualTo("POST") assertThat(body.route()).isEqualTo("/people/search") assertThat(body.data()).isEmpty @@ -49,7 +50,7 @@ class RequestForwardingForwardParamsTest { val body = params._body() - assertThat(body).isNotNull + assertNotNull(body) 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 85991f01..111736a3 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 @@ -2,6 +2,7 @@ package com.tryfinch.api.models +import kotlin.test.assertNotNull import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -101,7 +102,7 @@ class SandboxCompanyUpdateParamsTest { val body = params._body() - assertThat(body).isNotNull + assertNotNull(body) assertThat(body.accounts()) .contains( listOf( @@ -171,7 +172,7 @@ class SandboxCompanyUpdateParamsTest { val body = params._body() - assertThat(body).isNotNull + assertNotNull(body) assertThat(body.accounts()) .contains(listOf(SandboxCompanyUpdateParams.Account.builder().build())) assertThat(body.departments()) 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 9e6f3277..666843c0 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 @@ -2,6 +2,7 @@ package com.tryfinch.api.models +import kotlin.test.assertNotNull import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -31,7 +32,7 @@ class SandboxConnectionAccountCreateParamsTest { val body = params._body() - assertThat(body).isNotNull + assertNotNull(body) assertThat(body.companyId()).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") assertThat(body.providerId()).isEqualTo("provider_id") assertThat(body.authenticationType()) @@ -49,7 +50,7 @@ class SandboxConnectionAccountCreateParamsTest { val body = params._body() - assertThat(body).isNotNull + assertNotNull(body) 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 0222d456..4a60449c 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 @@ -2,6 +2,7 @@ package com.tryfinch.api.models +import kotlin.test.assertNotNull import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -23,7 +24,7 @@ class SandboxConnectionAccountUpdateParamsTest { val body = params._body() - assertThat(body).isNotNull + assertNotNull(body) assertThat(body.connectionStatus()).contains(ConnectionStatusType.PENDING) } @@ -33,6 +34,6 @@ class SandboxConnectionAccountUpdateParamsTest { val body = params._body() - assertThat(body).isNotNull + assertNotNull(body) } } 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 77a802d2..1e1fc9ac 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 @@ -2,6 +2,7 @@ package com.tryfinch.api.models +import kotlin.test.assertNotNull import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -29,7 +30,7 @@ class SandboxConnectionCreateParamsTest { val body = params._body() - assertThat(body).isNotNull + assertNotNull(body) assertThat(body.providerId()).isEqualTo("provider_id") assertThat(body.authenticationType()) .contains(SandboxConnectionCreateParams.AuthenticationType.CREDENTIAL) @@ -43,7 +44,7 @@ class SandboxConnectionCreateParamsTest { val body = params._body() - assertThat(body).isNotNull + assertNotNull(body) 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 2f55af18..d4b9e47f 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 @@ -3,6 +3,7 @@ package com.tryfinch.api.models import com.tryfinch.api.core.JsonValue +import kotlin.jvm.optionals.getOrNull import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -246,9 +247,8 @@ class SandboxDirectoryCreateParamsTest { ) .build() - val body = params._body() + val body = params._body().getOrNull() - assertThat(body).isNotNull assertThat(body) .isEqualTo( listOf( @@ -373,17 +373,8 @@ class SandboxDirectoryCreateParamsTest { @Test fun bodyWithoutOptionalFields() { - val params = - SandboxDirectoryCreateParams.builder() - .addBody(SandboxDirectoryCreateParams.IndividualOrEmployment.builder().build()) - .build() - - val body = params._body() + val params = SandboxDirectoryCreateParams.builder().build() - assertThat(body).isNotNull - assertThat(body) - .isEqualTo( - listOf(SandboxDirectoryCreateParams.IndividualOrEmployment.builder().build()) - ) + val body = params._body().getOrNull() } } 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 b6465c8f..6e2e0112 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 @@ -3,6 +3,7 @@ package com.tryfinch.api.models import com.tryfinch.api.core.JsonValue +import kotlin.test.assertNotNull import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -130,7 +131,7 @@ class SandboxEmploymentUpdateParamsTest { val body = params._body() - assertThat(body).isNotNull + assertNotNull(body) assertThat(body.classCode()).contains("class_code") assertThat(body.customFields()) .contains( @@ -204,7 +205,7 @@ class SandboxEmploymentUpdateParamsTest { val body = params._body() - assertThat(body).isNotNull + assertNotNull(body) } @Test diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/SandboxIndividualUpdateParamsTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/SandboxIndividualUpdateParamsTest.kt index babc4510..28ebe7b1 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 @@ -2,6 +2,7 @@ package com.tryfinch.api.models +import kotlin.test.assertNotNull import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -89,7 +90,7 @@ class SandboxIndividualUpdateParamsTest { val body = params._body() - assertThat(body).isNotNull + assertNotNull(body) assertThat(body.dob()).contains("dob") assertThat(body.emails()) .contains( @@ -138,7 +139,7 @@ class SandboxIndividualUpdateParamsTest { val body = params._body() - assertThat(body).isNotNull + assertNotNull(body) } @Test 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 6a4b5ec1..6c748f9b 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 @@ -33,7 +33,6 @@ class SandboxJobConfigurationUpdateParamsTest { val body = params._body() - assertThat(body).isNotNull assertThat(body) .isEqualTo( SandboxJobConfiguration.builder() @@ -57,7 +56,6 @@ class SandboxJobConfigurationUpdateParamsTest { val body = params._body() - assertThat(body).isNotNull assertThat(body) .isEqualTo( SandboxJobConfiguration.builder() 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 7e673381..1cd761ec 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 @@ -2,6 +2,7 @@ package com.tryfinch.api.models +import kotlin.test.assertNotNull import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -19,7 +20,7 @@ class SandboxJobCreateParamsTest { val body = params._body() - assertThat(body).isNotNull + assertNotNull(body) assertThat(body.type()).isEqualTo(SandboxJobCreateParams.Type.DATA_SYNC_ALL) } @@ -30,7 +31,7 @@ class SandboxJobCreateParamsTest { val body = params._body() - assertThat(body).isNotNull + assertNotNull(body) 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 90aa7917..b29fa82e 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 @@ -2,6 +2,7 @@ package com.tryfinch.api.models +import kotlin.test.assertNotNull import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -115,7 +116,7 @@ class SandboxPaymentCreateParamsTest { val body = params._body() - assertThat(body).isNotNull + assertNotNull(body) assertThat(body.endDate()).contains("end_date") assertThat(body.payStatements()) .contains( @@ -174,6 +175,6 @@ class SandboxPaymentCreateParamsTest { val body = params._body() - assertThat(body).isNotNull + assertNotNull(body) } } From 8f256fbfc0f39a56d8f416b5ea03e42c3e422c60 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 20 Feb 2025 22:56:36 +0000 Subject: [PATCH 19/22] docs: add immutability explanation to readme (#452) --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 45f45476..86a1b5d2 100644 --- a/README.md +++ b/README.md @@ -120,6 +120,14 @@ To send a request to the Finch API, build an instance of some `Params` class and For example, `client.hris().directory().list(...)` should be called with an instance of `HrisDirectoryListParams`, and it will return an instance of `HrisDirectoryListPage`. +## Immutability + +Each class in the SDK has an associated [builder](https://blogs.oracle.com/javamagazine/post/exploring-joshua-blochs-builder-design-pattern-in-java) or factory method for constructing it. + +Each class is [immutable](https://docs.oracle.com/javase/tutorial/essential/concurrency/immutable.html) once constructed. If the class has an associated builder, then it has a `toBuilder()` method, which can be used to convert it back to a builder for making a modified copy. + +Because each class is immutable, builder modification will _never_ affect already built class instances. + ## Asynchronous execution The default client is synchronous. To switch to asynchronous execution, call the `async()` method: From becaa47cb5fb7138518157dfa92410d268fa55fd Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 24 Feb 2025 19:20:13 +0000 Subject: [PATCH 20/22] docs: add source file links to readme (#453) --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 86a1b5d2..92c47e86 100644 --- a/README.md +++ b/README.md @@ -174,7 +174,7 @@ The asynchronous client supports the same options as the synchronous one, except The SDK throws custom unchecked exception types: -- `FinchServiceException`: Base class for HTTP errors. See this table for which exception subclass is thrown for each HTTP status code: +- [`FinchServiceException`](finch-java-core/src/main/kotlin/com/tryfinch/api/errors/FinchServiceException.kt): Base class for HTTP errors. See this table for which exception subclass is thrown for each HTTP status code: | Status | Exception | | ------ | ------------------------------- | @@ -187,11 +187,11 @@ The SDK throws custom unchecked exception types: | 5xx | `InternalServerException` | | others | `UnexpectedStatusCodeException` | -- `FinchIoException`: I/O networking errors. +- [`FinchIoException`](finch-java-core/src/main/kotlin/com/tryfinch/api/errors/FinchIoException.kt): I/O networking errors. -- `FinchInvalidDataException`: Failure to interpret successfully parsed data. For example, when accessing a property that's supposed to be required, but the API unexpectedly omitted it from the response. +- [`FinchInvalidDataException`](finch-java-core/src/main/kotlin/com/tryfinch/api/errors/FinchInvalidDataException.kt): Failure to interpret successfully parsed data. For example, when accessing a property that's supposed to be required, but the API unexpectedly omitted it from the response. -- `FinchException`: Base class for all exceptions. Most errors will result in one of the previously mentioned ones, but completely generic errors may be thrown using the base class. +- [`FinchException`](finch-java-core/src/main/kotlin/com/tryfinch/api/errors/FinchException.kt): Base class for all exceptions. Most errors will result in one of the previously mentioned ones, but completely generic errors may be thrown using the base class. ## Pagination @@ -371,7 +371,7 @@ HrisDirectoryListParams params = HrisDirectoryListParams.builder() These can be accessed on the built object later using the `_additionalHeaders()`, `_additionalQueryParams()`, and `_additionalBodyProperties()` methods. You can also set undocumented parameters on nested headers, query params, or body classes using the `putAdditionalProperty` method. These properties can be accessed on the built object later using the `_additionalProperties()` method. -To set a documented parameter or property to an undocumented or not yet supported _value_, pass a `JsonValue` object to its setter: +To set a documented parameter or property to an undocumented or not yet supported _value_, pass a [`JsonValue`](finch-java-core/src/main/kotlin/com/tryfinch/api/core/JsonValue.kt) object to its setter: ```java import com.tryfinch.api.models.HrisDirectoryListParams; @@ -437,7 +437,7 @@ if (code.isMissing()) { In rare cases, the API may return a response that doesn't match the expected type. For example, the SDK may expect a property to contain a `String`, but the API could return something else. -By default, the SDK will not throw an exception in this case. It will throw `FinchInvalidDataException` only if you directly access the property. +By default, the SDK will not throw an exception in this case. It will throw [`FinchInvalidDataException`](finch-java-core/src/main/kotlin/com/tryfinch/api/errors/FinchInvalidDataException.kt) only if you directly access the property. If you would prefer to check that the response is completely well-typed upfront, then either call `validate()`: From 6a3631913bea77b83216b72d47bc96fc9381aaa7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 25 Feb 2025 00:04:44 +0000 Subject: [PATCH 21/22] feat(api): api update (#454) --- .stats.yml | 2 +- .../com/tryfinch/api/models/PayStatement.kt | 942 ++++++++++++++++- .../api/models/SandboxPaymentCreateParams.kt | 970 +++++++++++++++++- .../models/PayStatementResponseBodyTest.kt | 77 ++ .../api/models/PayStatementResponseTest.kt | 108 ++ .../tryfinch/api/models/PayStatementTest.kt | 74 ++ .../models/SandboxPaymentCreateParamsTest.kt | 180 +++- .../blocking/sandbox/PaymentServiceTest.kt | 76 +- 8 files changed, 2384 insertions(+), 45 deletions(-) diff --git a/.stats.yml b/.stats.yml index 5d256aca..23dfdad6 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-0bd8297838a887e60787ee1eaea3e348e48e8f418e1fb9fefda2e6d845d97432.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-5d2b3a9cdbcfb6f10b6e621ef7ababbd2701316e5ea1117ced072ab76bdbec34.yml 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 4e3dbc65..359f7437 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 @@ -379,6 +379,9 @@ private constructor( @JsonProperty("amount") @ExcludeMissing private val amount: JsonField = JsonMissing.of(), + @JsonProperty("attributes") + @ExcludeMissing + private val attributes: JsonField = JsonMissing.of(), @JsonProperty("currency") @ExcludeMissing private val currency: JsonField = JsonMissing.of(), @@ -396,6 +399,9 @@ private constructor( /** The earnings amount in cents. */ fun amount(): Optional = Optional.ofNullable(amount.getNullable("amount")) + fun attributes(): Optional = + Optional.ofNullable(attributes.getNullable("attributes")) + /** The earnings currency code. */ fun currency(): Optional = Optional.ofNullable(currency.getNullable("currency")) @@ -414,6 +420,10 @@ private constructor( /** The earnings amount in cents. */ @JsonProperty("amount") @ExcludeMissing fun _amount(): JsonField = amount + @JsonProperty("attributes") + @ExcludeMissing + fun _attributes(): JsonField = attributes + /** The earnings currency code. */ @JsonProperty("currency") @ExcludeMissing fun _currency(): JsonField = currency @@ -441,6 +451,7 @@ private constructor( } amount() + attributes().ifPresent { it.validate() } currency() hours() name() @@ -459,6 +470,7 @@ private constructor( class Builder internal constructor() { private var amount: JsonField = JsonMissing.of() + private var attributes: JsonField = JsonMissing.of() private var currency: JsonField = JsonMissing.of() private var hours: JsonField = JsonMissing.of() private var name: JsonField = JsonMissing.of() @@ -468,6 +480,7 @@ private constructor( @JvmSynthetic internal fun from(earning: Earning) = apply { amount = earning.amount + attributes = earning.attributes currency = earning.currency hours = earning.hours name = earning.name @@ -488,6 +501,12 @@ private constructor( /** The earnings amount in cents. */ fun amount(amount: JsonField) = apply { this.amount = amount } + fun attributes(attributes: Metadata?) = attributes(JsonField.ofNullable(attributes)) + + fun attributes(attributes: Optional) = attributes(attributes.orElse(null)) + + fun attributes(attributes: JsonField) = apply { this.attributes = attributes } + /** The earnings currency code. */ fun currency(currency: String?) = currency(JsonField.ofNullable(currency)) @@ -560,7 +579,220 @@ private constructor( } fun build(): Earning = - Earning(amount, currency, hours, name, type, additionalProperties.toImmutable()) + Earning( + amount, + attributes, + currency, + hours, + name, + type, + additionalProperties.toImmutable(), + ) + } + + @NoAutoDetect + class Metadata + @JsonCreator + private constructor( + @JsonProperty("metadata") + @ExcludeMissing + private val metadata: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), + ) { + + /** + * The metadata to be attached to the entity by existing rules. It is a key-value pairs + * where the values can be of any type (string, number, boolean, object, array, etc.). + */ + fun metadata(): Optional = + Optional.ofNullable(metadata.getNullable("metadata")) + + /** + * The metadata to be attached to the entity by existing rules. It is a key-value pairs + * where the values can be of any type (string, number, boolean, object, array, etc.). + */ + @JsonProperty("metadata") + @ExcludeMissing + fun _metadata(): JsonField = metadata + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + private var validated: Boolean = false + + fun validate(): Metadata = apply { + if (validated) { + return@apply + } + + metadata().ifPresent { it.validate() } + validated = true + } + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Metadata]. */ + class Builder internal constructor() { + + private var metadata: JsonField = JsonMissing.of() + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(metadata: Metadata) = apply { + this.metadata = metadata.metadata + additionalProperties = metadata.additionalProperties.toMutableMap() + } + + /** + * The metadata to be attached to the entity by existing rules. It is a key-value + * pairs where the values can be of any type (string, number, boolean, object, + * array, etc.). + */ + fun metadata(metadata: InnerMetadata) = metadata(JsonField.of(metadata)) + + /** + * The metadata to be attached to the entity by existing rules. It is a key-value + * pairs where the values can be of any type (string, number, boolean, object, + * array, etc.). + */ + fun metadata(metadata: JsonField) = apply { + this.metadata = metadata + } + + 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(): Metadata = Metadata(metadata, additionalProperties.toImmutable()) + } + + /** + * The metadata to be attached to the entity by existing rules. It is a key-value pairs + * where the values can be of any type (string, number, boolean, object, array, etc.). + */ + @NoAutoDetect + class InnerMetadata + @JsonCreator + private constructor( + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap() + ) { + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + private var validated: Boolean = false + + fun validate(): InnerMetadata = apply { + if (validated) { + return@apply + } + + validated = true + } + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + /** A builder for [InnerMetadata]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(innerMetadata: InnerMetadata) = apply { + additionalProperties = innerMetadata.additionalProperties.toMutableMap() + } + + 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(): InnerMetadata = InnerMetadata(additionalProperties.toImmutable()) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is InnerMetadata && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "InnerMetadata{additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Metadata && metadata == other.metadata && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(metadata, additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Metadata{metadata=$metadata, additionalProperties=$additionalProperties}" } /** The type of earning. */ @@ -735,17 +967,17 @@ private constructor( return true } - return /* spotless:off */ other is Earning && amount == other.amount && currency == other.currency && hours == other.hours && name == other.name && type == other.type && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Earning && amount == other.amount && attributes == other.attributes && currency == other.currency && hours == other.hours && name == other.name && type == other.type && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(amount, currency, hours, name, type, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(amount, attributes, currency, hours, name, type, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "Earning{amount=$amount, currency=$currency, hours=$hours, name=$name, type=$type, additionalProperties=$additionalProperties}" + "Earning{amount=$amount, attributes=$attributes, currency=$currency, hours=$hours, name=$name, type=$type, additionalProperties=$additionalProperties}" } @NoAutoDetect @@ -755,6 +987,9 @@ private constructor( @JsonProperty("amount") @ExcludeMissing private val amount: JsonField = JsonMissing.of(), + @JsonProperty("attributes") + @ExcludeMissing + private val attributes: JsonField = JsonMissing.of(), @JsonProperty("currency") @ExcludeMissing private val currency: JsonField = JsonMissing.of(), @@ -774,6 +1009,9 @@ private constructor( /** The deduction amount in cents. */ fun amount(): Optional = Optional.ofNullable(amount.getNullable("amount")) + fun attributes(): Optional = + Optional.ofNullable(attributes.getNullable("attributes")) + /** The deduction currency. */ fun currency(): Optional = Optional.ofNullable(currency.getNullable("currency")) @@ -789,6 +1027,10 @@ private constructor( /** The deduction amount in cents. */ @JsonProperty("amount") @ExcludeMissing fun _amount(): JsonField = amount + @JsonProperty("attributes") + @ExcludeMissing + fun _attributes(): JsonField = attributes + /** The deduction currency. */ @JsonProperty("currency") @ExcludeMissing fun _currency(): JsonField = currency @@ -813,6 +1055,7 @@ private constructor( } amount() + attributes().ifPresent { it.validate() } currency() name() preTax() @@ -831,6 +1074,7 @@ private constructor( class Builder internal constructor() { private var amount: JsonField = JsonMissing.of() + private var attributes: JsonField = JsonMissing.of() private var currency: JsonField = JsonMissing.of() private var name: JsonField = JsonMissing.of() private var preTax: JsonField = JsonMissing.of() @@ -840,6 +1084,7 @@ private constructor( @JvmSynthetic internal fun from(employeeDeduction: EmployeeDeduction) = apply { amount = employeeDeduction.amount + attributes = employeeDeduction.attributes currency = employeeDeduction.currency name = employeeDeduction.name preTax = employeeDeduction.preTax @@ -860,6 +1105,12 @@ private constructor( /** The deduction amount in cents. */ fun amount(amount: JsonField) = apply { this.amount = amount } + fun attributes(attributes: Metadata?) = attributes(JsonField.ofNullable(attributes)) + + fun attributes(attributes: Optional) = attributes(attributes.orElse(null)) + + fun attributes(attributes: JsonField) = apply { this.attributes = attributes } + /** The deduction currency. */ fun currency(currency: String?) = currency(JsonField.ofNullable(currency)) @@ -922,6 +1173,7 @@ private constructor( fun build(): EmployeeDeduction = EmployeeDeduction( amount, + attributes, currency, name, preTax, @@ -930,22 +1182,227 @@ private constructor( ) } + @NoAutoDetect + class Metadata + @JsonCreator + private constructor( + @JsonProperty("metadata") + @ExcludeMissing + private val metadata: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), + ) { + + /** + * The metadata to be attached to the entity by existing rules. It is a key-value pairs + * where the values can be of any type (string, number, boolean, object, array, etc.). + */ + fun metadata(): Optional = + Optional.ofNullable(metadata.getNullable("metadata")) + + /** + * The metadata to be attached to the entity by existing rules. It is a key-value pairs + * where the values can be of any type (string, number, boolean, object, array, etc.). + */ + @JsonProperty("metadata") + @ExcludeMissing + fun _metadata(): JsonField = metadata + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + private var validated: Boolean = false + + fun validate(): Metadata = apply { + if (validated) { + return@apply + } + + metadata().ifPresent { it.validate() } + validated = true + } + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Metadata]. */ + class Builder internal constructor() { + + private var metadata: JsonField = JsonMissing.of() + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(metadata: Metadata) = apply { + this.metadata = metadata.metadata + additionalProperties = metadata.additionalProperties.toMutableMap() + } + + /** + * The metadata to be attached to the entity by existing rules. It is a key-value + * pairs where the values can be of any type (string, number, boolean, object, + * array, etc.). + */ + fun metadata(metadata: InnerMetadata) = metadata(JsonField.of(metadata)) + + /** + * The metadata to be attached to the entity by existing rules. It is a key-value + * pairs where the values can be of any type (string, number, boolean, object, + * array, etc.). + */ + fun metadata(metadata: JsonField) = apply { + this.metadata = metadata + } + + 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(): Metadata = Metadata(metadata, additionalProperties.toImmutable()) + } + + /** + * The metadata to be attached to the entity by existing rules. It is a key-value pairs + * where the values can be of any type (string, number, boolean, object, array, etc.). + */ + @NoAutoDetect + class InnerMetadata + @JsonCreator + private constructor( + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap() + ) { + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + private var validated: Boolean = false + + fun validate(): InnerMetadata = apply { + if (validated) { + return@apply + } + + validated = true + } + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + /** A builder for [InnerMetadata]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(innerMetadata: InnerMetadata) = apply { + additionalProperties = innerMetadata.additionalProperties.toMutableMap() + } + + 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(): InnerMetadata = InnerMetadata(additionalProperties.toImmutable()) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is InnerMetadata && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "InnerMetadata{additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Metadata && metadata == other.metadata && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(metadata, additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Metadata{metadata=$metadata, additionalProperties=$additionalProperties}" + } + override fun equals(other: Any?): Boolean { if (this === other) { return true } - return /* spotless:off */ other is EmployeeDeduction && amount == other.amount && currency == other.currency && name == other.name && preTax == other.preTax && type == other.type && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is EmployeeDeduction && amount == other.amount && attributes == other.attributes && currency == other.currency && name == other.name && preTax == other.preTax && type == other.type && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(amount, currency, name, preTax, type, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(amount, attributes, currency, name, preTax, type, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "EmployeeDeduction{amount=$amount, currency=$currency, name=$name, preTax=$preTax, type=$type, additionalProperties=$additionalProperties}" + "EmployeeDeduction{amount=$amount, attributes=$attributes, currency=$currency, name=$name, preTax=$preTax, type=$type, additionalProperties=$additionalProperties}" } @NoAutoDetect @@ -955,6 +1412,9 @@ private constructor( @JsonProperty("amount") @ExcludeMissing private val amount: JsonField = JsonMissing.of(), + @JsonProperty("attributes") + @ExcludeMissing + private val attributes: JsonField = JsonMissing.of(), @JsonProperty("currency") @ExcludeMissing private val currency: JsonField = JsonMissing.of(), @@ -971,6 +1431,9 @@ private constructor( /** The contribution amount in cents. */ fun amount(): Optional = Optional.ofNullable(amount.getNullable("amount")) + fun attributes(): Optional = + Optional.ofNullable(attributes.getNullable("attributes")) + /** The contribution currency. */ fun currency(): Optional = Optional.ofNullable(currency.getNullable("currency")) @@ -983,6 +1446,10 @@ private constructor( /** The contribution amount in cents. */ @JsonProperty("amount") @ExcludeMissing fun _amount(): JsonField = amount + @JsonProperty("attributes") + @ExcludeMissing + fun _attributes(): JsonField = attributes + /** The contribution currency. */ @JsonProperty("currency") @ExcludeMissing fun _currency(): JsonField = currency @@ -1004,6 +1471,7 @@ private constructor( } amount() + attributes().ifPresent { it.validate() } currency() name() type() @@ -1021,6 +1489,7 @@ private constructor( class Builder internal constructor() { private var amount: JsonField = JsonMissing.of() + private var attributes: JsonField = JsonMissing.of() private var currency: JsonField = JsonMissing.of() private var name: JsonField = JsonMissing.of() private var type: JsonField = JsonMissing.of() @@ -1029,6 +1498,7 @@ private constructor( @JvmSynthetic internal fun from(employerContribution: EmployerContribution) = apply { amount = employerContribution.amount + attributes = employerContribution.attributes currency = employerContribution.currency name = employerContribution.name type = employerContribution.type @@ -1048,6 +1518,12 @@ private constructor( /** The contribution amount in cents. */ fun amount(amount: JsonField) = apply { this.amount = amount } + fun attributes(attributes: Metadata?) = attributes(JsonField.ofNullable(attributes)) + + fun attributes(attributes: Optional) = attributes(attributes.orElse(null)) + + fun attributes(attributes: JsonField) = apply { this.attributes = attributes } + /** The contribution currency. */ fun currency(currency: String?) = currency(JsonField.ofNullable(currency)) @@ -1097,6 +1573,7 @@ private constructor( fun build(): EmployerContribution = EmployerContribution( amount, + attributes, currency, name, type, @@ -1104,22 +1581,227 @@ private constructor( ) } + @NoAutoDetect + class Metadata + @JsonCreator + private constructor( + @JsonProperty("metadata") + @ExcludeMissing + private val metadata: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), + ) { + + /** + * The metadata to be attached to the entity by existing rules. It is a key-value pairs + * where the values can be of any type (string, number, boolean, object, array, etc.). + */ + fun metadata(): Optional = + Optional.ofNullable(metadata.getNullable("metadata")) + + /** + * The metadata to be attached to the entity by existing rules. It is a key-value pairs + * where the values can be of any type (string, number, boolean, object, array, etc.). + */ + @JsonProperty("metadata") + @ExcludeMissing + fun _metadata(): JsonField = metadata + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + private var validated: Boolean = false + + fun validate(): Metadata = apply { + if (validated) { + return@apply + } + + metadata().ifPresent { it.validate() } + validated = true + } + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Metadata]. */ + class Builder internal constructor() { + + private var metadata: JsonField = JsonMissing.of() + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(metadata: Metadata) = apply { + this.metadata = metadata.metadata + additionalProperties = metadata.additionalProperties.toMutableMap() + } + + /** + * The metadata to be attached to the entity by existing rules. It is a key-value + * pairs where the values can be of any type (string, number, boolean, object, + * array, etc.). + */ + fun metadata(metadata: InnerMetadata) = metadata(JsonField.of(metadata)) + + /** + * The metadata to be attached to the entity by existing rules. It is a key-value + * pairs where the values can be of any type (string, number, boolean, object, + * array, etc.). + */ + fun metadata(metadata: JsonField) = apply { + this.metadata = metadata + } + + 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(): Metadata = Metadata(metadata, additionalProperties.toImmutable()) + } + + /** + * The metadata to be attached to the entity by existing rules. It is a key-value pairs + * where the values can be of any type (string, number, boolean, object, array, etc.). + */ + @NoAutoDetect + class InnerMetadata + @JsonCreator + private constructor( + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap() + ) { + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + private var validated: Boolean = false + + fun validate(): InnerMetadata = apply { + if (validated) { + return@apply + } + + validated = true + } + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + /** A builder for [InnerMetadata]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(innerMetadata: InnerMetadata) = apply { + additionalProperties = innerMetadata.additionalProperties.toMutableMap() + } + + 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(): InnerMetadata = InnerMetadata(additionalProperties.toImmutable()) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is InnerMetadata && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "InnerMetadata{additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Metadata && metadata == other.metadata && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(metadata, additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Metadata{metadata=$metadata, additionalProperties=$additionalProperties}" + } + override fun equals(other: Any?): Boolean { if (this === other) { return true } - return /* spotless:off */ other is EmployerContribution && amount == other.amount && currency == other.currency && name == other.name && type == other.type && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is EmployerContribution && amount == other.amount && attributes == other.attributes && currency == other.currency && name == other.name && type == other.type && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(amount, currency, name, type, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(amount, attributes, currency, name, type, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "EmployerContribution{amount=$amount, currency=$currency, name=$name, type=$type, additionalProperties=$additionalProperties}" + "EmployerContribution{amount=$amount, attributes=$attributes, currency=$currency, name=$name, type=$type, additionalProperties=$additionalProperties}" } /** The payment method. */ @@ -1231,6 +1913,9 @@ private constructor( @JsonProperty("amount") @ExcludeMissing private val amount: JsonField = JsonMissing.of(), + @JsonProperty("attributes") + @ExcludeMissing + private val attributes: JsonField = JsonMissing.of(), @JsonProperty("currency") @ExcludeMissing private val currency: JsonField = JsonMissing.of(), @@ -1248,6 +1933,9 @@ private constructor( /** The tax amount in cents. */ fun amount(): Optional = Optional.ofNullable(amount.getNullable("amount")) + fun attributes(): Optional = + Optional.ofNullable(attributes.getNullable("attributes")) + /** The currency code. */ fun currency(): Optional = Optional.ofNullable(currency.getNullable("currency")) @@ -1263,6 +1951,10 @@ private constructor( /** The tax amount in cents. */ @JsonProperty("amount") @ExcludeMissing fun _amount(): JsonField = amount + @JsonProperty("attributes") + @ExcludeMissing + fun _attributes(): JsonField = attributes + /** The currency code. */ @JsonProperty("currency") @ExcludeMissing fun _currency(): JsonField = currency @@ -1287,6 +1979,7 @@ private constructor( } amount() + attributes().ifPresent { it.validate() } currency() employer() name() @@ -1305,6 +1998,7 @@ private constructor( class Builder internal constructor() { private var amount: JsonField = JsonMissing.of() + private var attributes: JsonField = JsonMissing.of() private var currency: JsonField = JsonMissing.of() private var employer: JsonField = JsonMissing.of() private var name: JsonField = JsonMissing.of() @@ -1314,6 +2008,7 @@ private constructor( @JvmSynthetic internal fun from(tax: Tax) = apply { amount = tax.amount + attributes = tax.attributes currency = tax.currency employer = tax.employer name = tax.name @@ -1334,6 +2029,12 @@ private constructor( /** The tax amount in cents. */ fun amount(amount: JsonField) = apply { this.amount = amount } + fun attributes(attributes: Metadata?) = attributes(JsonField.ofNullable(attributes)) + + fun attributes(attributes: Optional) = attributes(attributes.orElse(null)) + + fun attributes(attributes: JsonField) = apply { this.attributes = attributes } + /** The currency code. */ fun currency(currency: String?) = currency(JsonField.ofNullable(currency)) @@ -1394,7 +2095,220 @@ private constructor( } fun build(): Tax = - Tax(amount, currency, employer, name, type, additionalProperties.toImmutable()) + Tax( + amount, + attributes, + currency, + employer, + name, + type, + additionalProperties.toImmutable(), + ) + } + + @NoAutoDetect + class Metadata + @JsonCreator + private constructor( + @JsonProperty("metadata") + @ExcludeMissing + private val metadata: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), + ) { + + /** + * The metadata to be attached to the entity by existing rules. It is a key-value pairs + * where the values can be of any type (string, number, boolean, object, array, etc.). + */ + fun metadata(): Optional = + Optional.ofNullable(metadata.getNullable("metadata")) + + /** + * The metadata to be attached to the entity by existing rules. It is a key-value pairs + * where the values can be of any type (string, number, boolean, object, array, etc.). + */ + @JsonProperty("metadata") + @ExcludeMissing + fun _metadata(): JsonField = metadata + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + private var validated: Boolean = false + + fun validate(): Metadata = apply { + if (validated) { + return@apply + } + + metadata().ifPresent { it.validate() } + validated = true + } + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Metadata]. */ + class Builder internal constructor() { + + private var metadata: JsonField = JsonMissing.of() + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(metadata: Metadata) = apply { + this.metadata = metadata.metadata + additionalProperties = metadata.additionalProperties.toMutableMap() + } + + /** + * The metadata to be attached to the entity by existing rules. It is a key-value + * pairs where the values can be of any type (string, number, boolean, object, + * array, etc.). + */ + fun metadata(metadata: InnerMetadata) = metadata(JsonField.of(metadata)) + + /** + * The metadata to be attached to the entity by existing rules. It is a key-value + * pairs where the values can be of any type (string, number, boolean, object, + * array, etc.). + */ + fun metadata(metadata: JsonField) = apply { + this.metadata = metadata + } + + 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(): Metadata = Metadata(metadata, additionalProperties.toImmutable()) + } + + /** + * The metadata to be attached to the entity by existing rules. It is a key-value pairs + * where the values can be of any type (string, number, boolean, object, array, etc.). + */ + @NoAutoDetect + class InnerMetadata + @JsonCreator + private constructor( + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap() + ) { + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + private var validated: Boolean = false + + fun validate(): InnerMetadata = apply { + if (validated) { + return@apply + } + + validated = true + } + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + /** A builder for [InnerMetadata]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(innerMetadata: InnerMetadata) = apply { + additionalProperties = innerMetadata.additionalProperties.toMutableMap() + } + + 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(): InnerMetadata = InnerMetadata(additionalProperties.toImmutable()) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is InnerMetadata && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "InnerMetadata{additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Metadata && metadata == other.metadata && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(metadata, additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Metadata{metadata=$metadata, additionalProperties=$additionalProperties}" } /** The type of taxes. */ @@ -1515,17 +2429,17 @@ private constructor( return true } - return /* spotless:off */ other is Tax && amount == other.amount && currency == other.currency && employer == other.employer && name == other.name && type == other.type && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Tax && amount == other.amount && attributes == other.attributes && currency == other.currency && employer == other.employer && name == other.name && type == other.type && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(amount, currency, employer, name, type, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(amount, attributes, currency, employer, name, type, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "Tax{amount=$amount, currency=$currency, employer=$employer, name=$name, type=$type, additionalProperties=$additionalProperties}" + "Tax{amount=$amount, attributes=$attributes, currency=$currency, employer=$employer, name=$name, type=$type, additionalProperties=$additionalProperties}" } /** The type of the payment associated with the pay statement. */ 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 1d005427..f28985d0 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 @@ -743,6 +743,9 @@ private constructor( @JsonProperty("amount") @ExcludeMissing private val amount: JsonField = JsonMissing.of(), + @JsonProperty("attributes") + @ExcludeMissing + private val attributes: JsonField = JsonMissing.of(), @JsonProperty("currency") @ExcludeMissing private val currency: JsonField = JsonMissing.of(), @@ -762,6 +765,9 @@ private constructor( /** The earnings amount in cents. */ fun amount(): Optional = Optional.ofNullable(amount.getNullable("amount")) + fun attributes(): Optional = + Optional.ofNullable(attributes.getNullable("attributes")) + /** The earnings currency code. */ fun currency(): Optional = Optional.ofNullable(currency.getNullable("currency")) @@ -780,6 +786,10 @@ private constructor( /** The earnings amount in cents. */ @JsonProperty("amount") @ExcludeMissing fun _amount(): JsonField = amount + @JsonProperty("attributes") + @ExcludeMissing + fun _attributes(): JsonField = attributes + /** The earnings currency code. */ @JsonProperty("currency") @ExcludeMissing fun _currency(): JsonField = currency @@ -807,6 +817,7 @@ private constructor( } amount() + attributes().ifPresent { it.validate() } currency() hours() name() @@ -825,6 +836,7 @@ private constructor( class Builder internal constructor() { private var amount: JsonField = JsonMissing.of() + private var attributes: JsonField = JsonMissing.of() private var currency: JsonField = JsonMissing.of() private var hours: JsonField = JsonMissing.of() private var name: JsonField = JsonMissing.of() @@ -834,6 +846,7 @@ private constructor( @JvmSynthetic internal fun from(earning: Earning) = apply { amount = earning.amount + attributes = earning.attributes currency = earning.currency hours = earning.hours name = earning.name @@ -854,6 +867,14 @@ private constructor( /** The earnings amount in cents. */ fun amount(amount: JsonField) = apply { this.amount = amount } + fun attributes(attributes: Metadata?) = attributes(JsonField.ofNullable(attributes)) + + fun attributes(attributes: Optional) = attributes(attributes.orElse(null)) + + fun attributes(attributes: JsonField) = apply { + this.attributes = attributes + } + /** The earnings currency code. */ fun currency(currency: String?) = currency(JsonField.ofNullable(currency)) @@ -929,7 +950,225 @@ private constructor( } fun build(): Earning = - Earning(amount, currency, hours, name, type, additionalProperties.toImmutable()) + Earning( + amount, + attributes, + currency, + hours, + name, + type, + additionalProperties.toImmutable(), + ) + } + + @NoAutoDetect + class Metadata + @JsonCreator + private constructor( + @JsonProperty("metadata") + @ExcludeMissing + private val metadata: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), + ) { + + /** + * The metadata to be attached to the entity by existing rules. It is a key-value + * pairs where the values can be of any type (string, number, boolean, object, + * array, etc.). + */ + fun metadata(): Optional = + Optional.ofNullable(metadata.getNullable("metadata")) + + /** + * The metadata to be attached to the entity by existing rules. It is a key-value + * pairs where the values can be of any type (string, number, boolean, object, + * array, etc.). + */ + @JsonProperty("metadata") + @ExcludeMissing + fun _metadata(): JsonField = metadata + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + private var validated: Boolean = false + + fun validate(): Metadata = apply { + if (validated) { + return@apply + } + + metadata().ifPresent { it.validate() } + validated = true + } + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Metadata]. */ + class Builder internal constructor() { + + private var metadata: JsonField = JsonMissing.of() + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(metadata: Metadata) = apply { + this.metadata = metadata.metadata + additionalProperties = metadata.additionalProperties.toMutableMap() + } + + /** + * The metadata to be attached to the entity by existing rules. It is a + * key-value pairs where the values can be of any type (string, number, boolean, + * object, array, etc.). + */ + fun metadata(metadata: InnerMetadata) = metadata(JsonField.of(metadata)) + + /** + * The metadata to be attached to the entity by existing rules. It is a + * key-value pairs where the values can be of any type (string, number, boolean, + * object, array, etc.). + */ + fun metadata(metadata: JsonField) = apply { + this.metadata = metadata + } + + 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(): Metadata = Metadata(metadata, additionalProperties.toImmutable()) + } + + /** + * The metadata to be attached to the entity by existing rules. It is a key-value + * pairs where the values can be of any type (string, number, boolean, object, + * array, etc.). + */ + @NoAutoDetect + class InnerMetadata + @JsonCreator + private constructor( + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap() + ) { + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + private var validated: Boolean = false + + fun validate(): InnerMetadata = apply { + if (validated) { + return@apply + } + + validated = true + } + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + /** A builder for [InnerMetadata]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(innerMetadata: InnerMetadata) = apply { + additionalProperties = innerMetadata.additionalProperties.toMutableMap() + } + + 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(): InnerMetadata = + InnerMetadata(additionalProperties.toImmutable()) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is InnerMetadata && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "InnerMetadata{additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Metadata && metadata == other.metadata && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(metadata, additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Metadata{metadata=$metadata, additionalProperties=$additionalProperties}" } /** The type of earning. */ @@ -1107,17 +1346,17 @@ private constructor( return true } - return /* spotless:off */ other is Earning && amount == other.amount && currency == other.currency && hours == other.hours && name == other.name && type == other.type && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Earning && amount == other.amount && attributes == other.attributes && currency == other.currency && hours == other.hours && name == other.name && type == other.type && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(amount, currency, hours, name, type, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(amount, attributes, currency, hours, name, type, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "Earning{amount=$amount, currency=$currency, hours=$hours, name=$name, type=$type, additionalProperties=$additionalProperties}" + "Earning{amount=$amount, attributes=$attributes, currency=$currency, hours=$hours, name=$name, type=$type, additionalProperties=$additionalProperties}" } @NoAutoDetect @@ -1127,6 +1366,9 @@ private constructor( @JsonProperty("amount") @ExcludeMissing private val amount: JsonField = JsonMissing.of(), + @JsonProperty("attributes") + @ExcludeMissing + private val attributes: JsonField = JsonMissing.of(), @JsonProperty("currency") @ExcludeMissing private val currency: JsonField = JsonMissing.of(), @@ -1146,6 +1388,9 @@ private constructor( /** The deduction amount in cents. */ fun amount(): Optional = Optional.ofNullable(amount.getNullable("amount")) + fun attributes(): Optional = + Optional.ofNullable(attributes.getNullable("attributes")) + /** The deduction currency. */ fun currency(): Optional = Optional.ofNullable(currency.getNullable("currency")) @@ -1161,6 +1406,10 @@ private constructor( /** The deduction amount in cents. */ @JsonProperty("amount") @ExcludeMissing fun _amount(): JsonField = amount + @JsonProperty("attributes") + @ExcludeMissing + fun _attributes(): JsonField = attributes + /** The deduction currency. */ @JsonProperty("currency") @ExcludeMissing fun _currency(): JsonField = currency @@ -1185,6 +1434,7 @@ private constructor( } amount() + attributes().ifPresent { it.validate() } currency() name() preTax() @@ -1203,6 +1453,7 @@ private constructor( class Builder internal constructor() { private var amount: JsonField = JsonMissing.of() + private var attributes: JsonField = JsonMissing.of() private var currency: JsonField = JsonMissing.of() private var name: JsonField = JsonMissing.of() private var preTax: JsonField = JsonMissing.of() @@ -1212,6 +1463,7 @@ private constructor( @JvmSynthetic internal fun from(employeeDeduction: EmployeeDeduction) = apply { amount = employeeDeduction.amount + attributes = employeeDeduction.attributes currency = employeeDeduction.currency name = employeeDeduction.name preTax = employeeDeduction.preTax @@ -1232,6 +1484,14 @@ private constructor( /** The deduction amount in cents. */ fun amount(amount: JsonField) = apply { this.amount = amount } + fun attributes(attributes: Metadata?) = attributes(JsonField.ofNullable(attributes)) + + fun attributes(attributes: Optional) = attributes(attributes.orElse(null)) + + fun attributes(attributes: JsonField) = apply { + this.attributes = attributes + } + /** The deduction currency. */ fun currency(currency: String?) = currency(JsonField.ofNullable(currency)) @@ -1297,6 +1557,7 @@ private constructor( fun build(): EmployeeDeduction = EmployeeDeduction( amount, + attributes, currency, name, preTax, @@ -1305,22 +1566,232 @@ private constructor( ) } + @NoAutoDetect + class Metadata + @JsonCreator + private constructor( + @JsonProperty("metadata") + @ExcludeMissing + private val metadata: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), + ) { + + /** + * The metadata to be attached to the entity by existing rules. It is a key-value + * pairs where the values can be of any type (string, number, boolean, object, + * array, etc.). + */ + fun metadata(): Optional = + Optional.ofNullable(metadata.getNullable("metadata")) + + /** + * The metadata to be attached to the entity by existing rules. It is a key-value + * pairs where the values can be of any type (string, number, boolean, object, + * array, etc.). + */ + @JsonProperty("metadata") + @ExcludeMissing + fun _metadata(): JsonField = metadata + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + private var validated: Boolean = false + + fun validate(): Metadata = apply { + if (validated) { + return@apply + } + + metadata().ifPresent { it.validate() } + validated = true + } + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Metadata]. */ + class Builder internal constructor() { + + private var metadata: JsonField = JsonMissing.of() + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(metadata: Metadata) = apply { + this.metadata = metadata.metadata + additionalProperties = metadata.additionalProperties.toMutableMap() + } + + /** + * The metadata to be attached to the entity by existing rules. It is a + * key-value pairs where the values can be of any type (string, number, boolean, + * object, array, etc.). + */ + fun metadata(metadata: InnerMetadata) = metadata(JsonField.of(metadata)) + + /** + * The metadata to be attached to the entity by existing rules. It is a + * key-value pairs where the values can be of any type (string, number, boolean, + * object, array, etc.). + */ + fun metadata(metadata: JsonField) = apply { + this.metadata = metadata + } + + 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(): Metadata = Metadata(metadata, additionalProperties.toImmutable()) + } + + /** + * The metadata to be attached to the entity by existing rules. It is a key-value + * pairs where the values can be of any type (string, number, boolean, object, + * array, etc.). + */ + @NoAutoDetect + class InnerMetadata + @JsonCreator + private constructor( + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap() + ) { + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + private var validated: Boolean = false + + fun validate(): InnerMetadata = apply { + if (validated) { + return@apply + } + + validated = true + } + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + /** A builder for [InnerMetadata]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(innerMetadata: InnerMetadata) = apply { + additionalProperties = innerMetadata.additionalProperties.toMutableMap() + } + + 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(): InnerMetadata = + InnerMetadata(additionalProperties.toImmutable()) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is InnerMetadata && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "InnerMetadata{additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Metadata && metadata == other.metadata && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(metadata, additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Metadata{metadata=$metadata, additionalProperties=$additionalProperties}" + } + override fun equals(other: Any?): Boolean { if (this === other) { return true } - return /* spotless:off */ other is EmployeeDeduction && amount == other.amount && currency == other.currency && name == other.name && preTax == other.preTax && type == other.type && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is EmployeeDeduction && amount == other.amount && attributes == other.attributes && currency == other.currency && name == other.name && preTax == other.preTax && type == other.type && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(amount, currency, name, preTax, type, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(amount, attributes, currency, name, preTax, type, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "EmployeeDeduction{amount=$amount, currency=$currency, name=$name, preTax=$preTax, type=$type, additionalProperties=$additionalProperties}" + "EmployeeDeduction{amount=$amount, attributes=$attributes, currency=$currency, name=$name, preTax=$preTax, type=$type, additionalProperties=$additionalProperties}" } @NoAutoDetect @@ -1330,6 +1801,9 @@ private constructor( @JsonProperty("amount") @ExcludeMissing private val amount: JsonField = JsonMissing.of(), + @JsonProperty("attributes") + @ExcludeMissing + private val attributes: JsonField = JsonMissing.of(), @JsonProperty("currency") @ExcludeMissing private val currency: JsonField = JsonMissing.of(), @@ -1346,6 +1820,9 @@ private constructor( /** The contribution amount in cents. */ fun amount(): Optional = Optional.ofNullable(amount.getNullable("amount")) + fun attributes(): Optional = + Optional.ofNullable(attributes.getNullable("attributes")) + /** The contribution currency. */ fun currency(): Optional = Optional.ofNullable(currency.getNullable("currency")) @@ -1358,6 +1835,10 @@ private constructor( /** The contribution amount in cents. */ @JsonProperty("amount") @ExcludeMissing fun _amount(): JsonField = amount + @JsonProperty("attributes") + @ExcludeMissing + fun _attributes(): JsonField = attributes + /** The contribution currency. */ @JsonProperty("currency") @ExcludeMissing fun _currency(): JsonField = currency @@ -1379,6 +1860,7 @@ private constructor( } amount() + attributes().ifPresent { it.validate() } currency() name() type() @@ -1396,6 +1878,7 @@ private constructor( class Builder internal constructor() { private var amount: JsonField = JsonMissing.of() + private var attributes: JsonField = JsonMissing.of() private var currency: JsonField = JsonMissing.of() private var name: JsonField = JsonMissing.of() private var type: JsonField = JsonMissing.of() @@ -1404,6 +1887,7 @@ private constructor( @JvmSynthetic internal fun from(employerContribution: EmployerContribution) = apply { amount = employerContribution.amount + attributes = employerContribution.attributes currency = employerContribution.currency name = employerContribution.name type = employerContribution.type @@ -1423,6 +1907,14 @@ private constructor( /** The contribution amount in cents. */ fun amount(amount: JsonField) = apply { this.amount = amount } + fun attributes(attributes: Metadata?) = attributes(JsonField.ofNullable(attributes)) + + fun attributes(attributes: Optional) = attributes(attributes.orElse(null)) + + fun attributes(attributes: JsonField) = apply { + this.attributes = attributes + } + /** The contribution currency. */ fun currency(currency: String?) = currency(JsonField.ofNullable(currency)) @@ -1475,6 +1967,7 @@ private constructor( fun build(): EmployerContribution = EmployerContribution( amount, + attributes, currency, name, type, @@ -1482,22 +1975,232 @@ private constructor( ) } + @NoAutoDetect + class Metadata + @JsonCreator + private constructor( + @JsonProperty("metadata") + @ExcludeMissing + private val metadata: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), + ) { + + /** + * The metadata to be attached to the entity by existing rules. It is a key-value + * pairs where the values can be of any type (string, number, boolean, object, + * array, etc.). + */ + fun metadata(): Optional = + Optional.ofNullable(metadata.getNullable("metadata")) + + /** + * The metadata to be attached to the entity by existing rules. It is a key-value + * pairs where the values can be of any type (string, number, boolean, object, + * array, etc.). + */ + @JsonProperty("metadata") + @ExcludeMissing + fun _metadata(): JsonField = metadata + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + private var validated: Boolean = false + + fun validate(): Metadata = apply { + if (validated) { + return@apply + } + + metadata().ifPresent { it.validate() } + validated = true + } + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Metadata]. */ + class Builder internal constructor() { + + private var metadata: JsonField = JsonMissing.of() + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(metadata: Metadata) = apply { + this.metadata = metadata.metadata + additionalProperties = metadata.additionalProperties.toMutableMap() + } + + /** + * The metadata to be attached to the entity by existing rules. It is a + * key-value pairs where the values can be of any type (string, number, boolean, + * object, array, etc.). + */ + fun metadata(metadata: InnerMetadata) = metadata(JsonField.of(metadata)) + + /** + * The metadata to be attached to the entity by existing rules. It is a + * key-value pairs where the values can be of any type (string, number, boolean, + * object, array, etc.). + */ + fun metadata(metadata: JsonField) = apply { + this.metadata = metadata + } + + 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(): Metadata = Metadata(metadata, additionalProperties.toImmutable()) + } + + /** + * The metadata to be attached to the entity by existing rules. It is a key-value + * pairs where the values can be of any type (string, number, boolean, object, + * array, etc.). + */ + @NoAutoDetect + class InnerMetadata + @JsonCreator + private constructor( + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap() + ) { + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + private var validated: Boolean = false + + fun validate(): InnerMetadata = apply { + if (validated) { + return@apply + } + + validated = true + } + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + /** A builder for [InnerMetadata]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(innerMetadata: InnerMetadata) = apply { + additionalProperties = innerMetadata.additionalProperties.toMutableMap() + } + + 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(): InnerMetadata = + InnerMetadata(additionalProperties.toImmutable()) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is InnerMetadata && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "InnerMetadata{additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Metadata && metadata == other.metadata && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(metadata, additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Metadata{metadata=$metadata, additionalProperties=$additionalProperties}" + } + override fun equals(other: Any?): Boolean { if (this === other) { return true } - return /* spotless:off */ other is EmployerContribution && amount == other.amount && currency == other.currency && name == other.name && type == other.type && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is EmployerContribution && amount == other.amount && attributes == other.attributes && currency == other.currency && name == other.name && type == other.type && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(amount, currency, name, type, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(amount, attributes, currency, name, type, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "EmployerContribution{amount=$amount, currency=$currency, name=$name, type=$type, additionalProperties=$additionalProperties}" + "EmployerContribution{amount=$amount, attributes=$attributes, currency=$currency, name=$name, type=$type, additionalProperties=$additionalProperties}" } /** The payment method. */ @@ -1612,6 +2315,9 @@ private constructor( @JsonProperty("amount") @ExcludeMissing private val amount: JsonField = JsonMissing.of(), + @JsonProperty("attributes") + @ExcludeMissing + private val attributes: JsonField = JsonMissing.of(), @JsonProperty("currency") @ExcludeMissing private val currency: JsonField = JsonMissing.of(), @@ -1631,6 +2337,9 @@ private constructor( /** The tax amount in cents. */ fun amount(): Optional = Optional.ofNullable(amount.getNullable("amount")) + fun attributes(): Optional = + Optional.ofNullable(attributes.getNullable("attributes")) + /** The currency code. */ fun currency(): Optional = Optional.ofNullable(currency.getNullable("currency")) @@ -1647,6 +2356,10 @@ private constructor( /** The tax amount in cents. */ @JsonProperty("amount") @ExcludeMissing fun _amount(): JsonField = amount + @JsonProperty("attributes") + @ExcludeMissing + fun _attributes(): JsonField = attributes + /** The currency code. */ @JsonProperty("currency") @ExcludeMissing fun _currency(): JsonField = currency @@ -1671,6 +2384,7 @@ private constructor( } amount() + attributes().ifPresent { it.validate() } currency() employer() name() @@ -1689,6 +2403,7 @@ private constructor( class Builder internal constructor() { private var amount: JsonField = JsonMissing.of() + private var attributes: JsonField = JsonMissing.of() private var currency: JsonField = JsonMissing.of() private var employer: JsonField = JsonMissing.of() private var name: JsonField = JsonMissing.of() @@ -1698,6 +2413,7 @@ private constructor( @JvmSynthetic internal fun from(tax: Tax) = apply { amount = tax.amount + attributes = tax.attributes currency = tax.currency employer = tax.employer name = tax.name @@ -1718,6 +2434,14 @@ private constructor( /** The tax amount in cents. */ fun amount(amount: JsonField) = apply { this.amount = amount } + fun attributes(attributes: Metadata?) = attributes(JsonField.ofNullable(attributes)) + + fun attributes(attributes: Optional) = attributes(attributes.orElse(null)) + + fun attributes(attributes: JsonField) = apply { + this.attributes = attributes + } + /** The currency code. */ fun currency(currency: String?) = currency(JsonField.ofNullable(currency)) @@ -1782,7 +2506,225 @@ private constructor( } fun build(): Tax = - Tax(amount, currency, employer, name, type, additionalProperties.toImmutable()) + Tax( + amount, + attributes, + currency, + employer, + name, + type, + additionalProperties.toImmutable(), + ) + } + + @NoAutoDetect + class Metadata + @JsonCreator + private constructor( + @JsonProperty("metadata") + @ExcludeMissing + private val metadata: JsonField = JsonMissing.of(), + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap(), + ) { + + /** + * The metadata to be attached to the entity by existing rules. It is a key-value + * pairs where the values can be of any type (string, number, boolean, object, + * array, etc.). + */ + fun metadata(): Optional = + Optional.ofNullable(metadata.getNullable("metadata")) + + /** + * The metadata to be attached to the entity by existing rules. It is a key-value + * pairs where the values can be of any type (string, number, boolean, object, + * array, etc.). + */ + @JsonProperty("metadata") + @ExcludeMissing + fun _metadata(): JsonField = metadata + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + private var validated: Boolean = false + + fun validate(): Metadata = apply { + if (validated) { + return@apply + } + + metadata().ifPresent { it.validate() } + validated = true + } + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Metadata]. */ + class Builder internal constructor() { + + private var metadata: JsonField = JsonMissing.of() + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(metadata: Metadata) = apply { + this.metadata = metadata.metadata + additionalProperties = metadata.additionalProperties.toMutableMap() + } + + /** + * The metadata to be attached to the entity by existing rules. It is a + * key-value pairs where the values can be of any type (string, number, boolean, + * object, array, etc.). + */ + fun metadata(metadata: InnerMetadata) = metadata(JsonField.of(metadata)) + + /** + * The metadata to be attached to the entity by existing rules. It is a + * key-value pairs where the values can be of any type (string, number, boolean, + * object, array, etc.). + */ + fun metadata(metadata: JsonField) = apply { + this.metadata = metadata + } + + 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(): Metadata = Metadata(metadata, additionalProperties.toImmutable()) + } + + /** + * The metadata to be attached to the entity by existing rules. It is a key-value + * pairs where the values can be of any type (string, number, boolean, object, + * array, etc.). + */ + @NoAutoDetect + class InnerMetadata + @JsonCreator + private constructor( + @JsonAnySetter + private val additionalProperties: Map = immutableEmptyMap() + ) { + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + private var validated: Boolean = false + + fun validate(): InnerMetadata = apply { + if (validated) { + return@apply + } + + validated = true + } + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + /** A builder for [InnerMetadata]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(innerMetadata: InnerMetadata) = apply { + additionalProperties = innerMetadata.additionalProperties.toMutableMap() + } + + 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(): InnerMetadata = + InnerMetadata(additionalProperties.toImmutable()) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is InnerMetadata && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "InnerMetadata{additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Metadata && metadata == other.metadata && additionalProperties == other.additionalProperties /* spotless:on */ + } + + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(metadata, additionalProperties) } + /* spotless:on */ + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Metadata{metadata=$metadata, additionalProperties=$additionalProperties}" } /** The type of taxes. */ @@ -1906,17 +2848,17 @@ private constructor( return true } - return /* spotless:off */ other is Tax && amount == other.amount && currency == other.currency && employer == other.employer && name == other.name && type == other.type && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Tax && amount == other.amount && attributes == other.attributes && currency == other.currency && employer == other.employer && name == other.name && type == other.type && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(amount, currency, employer, name, type, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(amount, attributes, currency, employer, name, type, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "Tax{amount=$amount, currency=$currency, employer=$employer, name=$name, type=$type, additionalProperties=$additionalProperties}" + "Tax{amount=$amount, attributes=$attributes, currency=$currency, employer=$employer, name=$name, type=$type, additionalProperties=$additionalProperties}" } /** The type of the payment associated with the pay statement. */ 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 f6bfeaa6..554f844e 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 @@ -2,6 +2,7 @@ package com.tryfinch.api.models +import com.tryfinch.api.core.JsonValue import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -17,6 +18,15 @@ class PayStatementResponseBodyTest { .addEarning( PayStatement.Earning.builder() .amount(0L) + .attributes( + PayStatement.Earning.Metadata.builder() + .metadata( + PayStatement.Earning.Metadata.InnerMetadata.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) + .build() + ) .currency("currency") .hours(0.0) .name("name") @@ -26,6 +36,16 @@ class PayStatementResponseBodyTest { .addEmployeeDeduction( PayStatement.EmployeeDeduction.builder() .amount(0L) + .attributes( + PayStatement.EmployeeDeduction.Metadata.builder() + .metadata( + PayStatement.EmployeeDeduction.Metadata.InnerMetadata + .builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) + .build() + ) .currency("currency") .name("name") .preTax(true) @@ -35,6 +55,16 @@ class PayStatementResponseBodyTest { .addEmployerContribution( PayStatement.EmployerContribution.builder() .amount(0L) + .attributes( + PayStatement.EmployerContribution.Metadata.builder() + .metadata( + PayStatement.EmployerContribution.Metadata.InnerMetadata + .builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) + .build() + ) .currency("currency") .name("name") .type(BenefitType._401K) @@ -47,6 +77,15 @@ class PayStatementResponseBodyTest { .addTax( PayStatement.Tax.builder() .amount(0L) + .attributes( + PayStatement.Tax.Metadata.builder() + .metadata( + PayStatement.Tax.Metadata.InnerMetadata.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) + .build() + ) .currency("currency") .employer(true) .name("name") @@ -67,6 +106,15 @@ class PayStatementResponseBodyTest { .addEarning( PayStatement.Earning.builder() .amount(0L) + .attributes( + PayStatement.Earning.Metadata.builder() + .metadata( + PayStatement.Earning.Metadata.InnerMetadata.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) + .build() + ) .currency("currency") .hours(0.0) .name("name") @@ -76,6 +124,16 @@ class PayStatementResponseBodyTest { .addEmployeeDeduction( PayStatement.EmployeeDeduction.builder() .amount(0L) + .attributes( + PayStatement.EmployeeDeduction.Metadata.builder() + .metadata( + PayStatement.EmployeeDeduction.Metadata.InnerMetadata + .builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) + .build() + ) .currency("currency") .name("name") .preTax(true) @@ -85,6 +143,16 @@ class PayStatementResponseBodyTest { .addEmployerContribution( PayStatement.EmployerContribution.builder() .amount(0L) + .attributes( + PayStatement.EmployerContribution.Metadata.builder() + .metadata( + PayStatement.EmployerContribution.Metadata.InnerMetadata + .builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) + .build() + ) .currency("currency") .name("name") .type(BenefitType._401K) @@ -97,6 +165,15 @@ class PayStatementResponseBodyTest { .addTax( PayStatement.Tax.builder() .amount(0L) + .attributes( + PayStatement.Tax.Metadata.builder() + .metadata( + PayStatement.Tax.Metadata.InnerMetadata.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) + .build() + ) .currency("currency") .employer(true) .name("name") 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 6b944e36..f01728a1 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 @@ -2,6 +2,7 @@ package com.tryfinch.api.models +import com.tryfinch.api.core.JsonValue import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -19,6 +20,19 @@ class PayStatementResponseTest { .addEarning( PayStatement.Earning.builder() .amount(0L) + .attributes( + PayStatement.Earning.Metadata.builder() + .metadata( + PayStatement.Earning.Metadata.InnerMetadata + .builder() + .putAdditionalProperty( + "foo", + JsonValue.from("bar"), + ) + .build() + ) + .build() + ) .currency("currency") .hours(0.0) .name("name") @@ -28,6 +42,20 @@ class PayStatementResponseTest { .addEmployeeDeduction( PayStatement.EmployeeDeduction.builder() .amount(0L) + .attributes( + PayStatement.EmployeeDeduction.Metadata.builder() + .metadata( + PayStatement.EmployeeDeduction.Metadata + .InnerMetadata + .builder() + .putAdditionalProperty( + "foo", + JsonValue.from("bar"), + ) + .build() + ) + .build() + ) .currency("currency") .name("name") .preTax(true) @@ -37,6 +65,20 @@ class PayStatementResponseTest { .addEmployerContribution( PayStatement.EmployerContribution.builder() .amount(0L) + .attributes( + PayStatement.EmployerContribution.Metadata.builder() + .metadata( + PayStatement.EmployerContribution.Metadata + .InnerMetadata + .builder() + .putAdditionalProperty( + "foo", + JsonValue.from("bar"), + ) + .build() + ) + .build() + ) .currency("currency") .name("name") .type(BenefitType._401K) @@ -49,6 +91,19 @@ class PayStatementResponseTest { .addTax( PayStatement.Tax.builder() .amount(0L) + .attributes( + PayStatement.Tax.Metadata.builder() + .metadata( + PayStatement.Tax.Metadata.InnerMetadata + .builder() + .putAdditionalProperty( + "foo", + JsonValue.from("bar"), + ) + .build() + ) + .build() + ) .currency("currency") .employer(true) .name("name") @@ -74,6 +129,19 @@ class PayStatementResponseTest { .addEarning( PayStatement.Earning.builder() .amount(0L) + .attributes( + PayStatement.Earning.Metadata.builder() + .metadata( + PayStatement.Earning.Metadata.InnerMetadata + .builder() + .putAdditionalProperty( + "foo", + JsonValue.from("bar"), + ) + .build() + ) + .build() + ) .currency("currency") .hours(0.0) .name("name") @@ -83,6 +151,20 @@ class PayStatementResponseTest { .addEmployeeDeduction( PayStatement.EmployeeDeduction.builder() .amount(0L) + .attributes( + PayStatement.EmployeeDeduction.Metadata.builder() + .metadata( + PayStatement.EmployeeDeduction.Metadata + .InnerMetadata + .builder() + .putAdditionalProperty( + "foo", + JsonValue.from("bar"), + ) + .build() + ) + .build() + ) .currency("currency") .name("name") .preTax(true) @@ -92,6 +174,20 @@ class PayStatementResponseTest { .addEmployerContribution( PayStatement.EmployerContribution.builder() .amount(0L) + .attributes( + PayStatement.EmployerContribution.Metadata.builder() + .metadata( + PayStatement.EmployerContribution.Metadata + .InnerMetadata + .builder() + .putAdditionalProperty( + "foo", + JsonValue.from("bar"), + ) + .build() + ) + .build() + ) .currency("currency") .name("name") .type(BenefitType._401K) @@ -104,6 +200,18 @@ class PayStatementResponseTest { .addTax( PayStatement.Tax.builder() .amount(0L) + .attributes( + PayStatement.Tax.Metadata.builder() + .metadata( + PayStatement.Tax.Metadata.InnerMetadata.builder() + .putAdditionalProperty( + "foo", + JsonValue.from("bar"), + ) + .build() + ) + .build() + ) .currency("currency") .employer(true) .name("name") 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 f6a928ec..4c62f3b0 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 @@ -2,6 +2,7 @@ package com.tryfinch.api.models +import com.tryfinch.api.core.JsonValue import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -14,6 +15,15 @@ class PayStatementTest { .addEarning( PayStatement.Earning.builder() .amount(0L) + .attributes( + PayStatement.Earning.Metadata.builder() + .metadata( + PayStatement.Earning.Metadata.InnerMetadata.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) + .build() + ) .currency("currency") .hours(0.0) .name("name") @@ -23,6 +33,15 @@ class PayStatementTest { .addEmployeeDeduction( PayStatement.EmployeeDeduction.builder() .amount(0L) + .attributes( + PayStatement.EmployeeDeduction.Metadata.builder() + .metadata( + PayStatement.EmployeeDeduction.Metadata.InnerMetadata.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) + .build() + ) .currency("currency") .name("name") .preTax(true) @@ -32,6 +51,16 @@ class PayStatementTest { .addEmployerContribution( PayStatement.EmployerContribution.builder() .amount(0L) + .attributes( + PayStatement.EmployerContribution.Metadata.builder() + .metadata( + PayStatement.EmployerContribution.Metadata.InnerMetadata + .builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) + .build() + ) .currency("currency") .name("name") .type(BenefitType._401K) @@ -44,6 +73,15 @@ class PayStatementTest { .addTax( PayStatement.Tax.builder() .amount(0L) + .attributes( + PayStatement.Tax.Metadata.builder() + .metadata( + PayStatement.Tax.Metadata.InnerMetadata.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) + .build() + ) .currency("currency") .employer(true) .name("name") @@ -58,6 +96,15 @@ class PayStatementTest { .containsExactly( PayStatement.Earning.builder() .amount(0L) + .attributes( + PayStatement.Earning.Metadata.builder() + .metadata( + PayStatement.Earning.Metadata.InnerMetadata.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) + .build() + ) .currency("currency") .hours(0.0) .name("name") @@ -68,6 +115,15 @@ class PayStatementTest { .containsExactly( PayStatement.EmployeeDeduction.builder() .amount(0L) + .attributes( + PayStatement.EmployeeDeduction.Metadata.builder() + .metadata( + PayStatement.EmployeeDeduction.Metadata.InnerMetadata.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) + .build() + ) .currency("currency") .name("name") .preTax(true) @@ -78,6 +134,15 @@ class PayStatementTest { .containsExactly( PayStatement.EmployerContribution.builder() .amount(0L) + .attributes( + PayStatement.EmployerContribution.Metadata.builder() + .metadata( + PayStatement.EmployerContribution.Metadata.InnerMetadata.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) + .build() + ) .currency("currency") .name("name") .type(BenefitType._401K) @@ -93,6 +158,15 @@ class PayStatementTest { .containsExactly( PayStatement.Tax.builder() .amount(0L) + .attributes( + PayStatement.Tax.Metadata.builder() + .metadata( + PayStatement.Tax.Metadata.InnerMetadata.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) + .build() + ) .currency("currency") .employer(true) .name("name") 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 b29fa82e..3e1a17b4 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 @@ -2,6 +2,7 @@ package com.tryfinch.api.models +import com.tryfinch.api.core.JsonValue import kotlin.test.assertNotNull import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -17,6 +18,17 @@ class SandboxPaymentCreateParamsTest { .addEarning( SandboxPaymentCreateParams.PayStatement.Earning.builder() .amount(0L) + .attributes( + SandboxPaymentCreateParams.PayStatement.Earning.Metadata.builder() + .metadata( + SandboxPaymentCreateParams.PayStatement.Earning.Metadata + .InnerMetadata + .builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) + .build() + ) .currency("currency") .hours(0.0) .name("name") @@ -25,9 +37,22 @@ class SandboxPaymentCreateParamsTest { ) .addEmployeeDeduction( SandboxPaymentCreateParams.PayStatement.EmployeeDeduction.builder() - .amount(2000L) - .currency("usd") - .name("401k test") + .amount(0L) + .attributes( + SandboxPaymentCreateParams.PayStatement.EmployeeDeduction.Metadata + .builder() + .metadata( + SandboxPaymentCreateParams.PayStatement.EmployeeDeduction + .Metadata + .InnerMetadata + .builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) + .build() + ) + .currency("currency") + .name("name") .preTax(true) .type(BenefitType._401K) .build() @@ -35,18 +60,43 @@ class SandboxPaymentCreateParamsTest { .addEmployerContribution( SandboxPaymentCreateParams.PayStatement.EmployerContribution.builder() .amount(0L) + .attributes( + SandboxPaymentCreateParams.PayStatement.EmployerContribution + .Metadata + .builder() + .metadata( + SandboxPaymentCreateParams.PayStatement.EmployerContribution + .Metadata + .InnerMetadata + .builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) + .build() + ) .currency("currency") .name("name") .type(BenefitType._401K) .build() ) .grossPay(Money.builder().amount(0L).currency("currency").build()) - .individualId("b2338cfb-472f-4f72-9faa-e028c083144a") + .individualId("individual_id") .netPay(Money.builder().amount(0L).currency("currency").build()) .paymentMethod(SandboxPaymentCreateParams.PayStatement.PaymentMethod.CHECK) .addTax( SandboxPaymentCreateParams.PayStatement.Tax.builder() .amount(0L) + .attributes( + SandboxPaymentCreateParams.PayStatement.Tax.Metadata.builder() + .metadata( + SandboxPaymentCreateParams.PayStatement.Tax.Metadata + .InnerMetadata + .builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) + .build() + ) .currency("currency") .employer(true) .name("name") @@ -71,6 +121,18 @@ class SandboxPaymentCreateParamsTest { .addEarning( SandboxPaymentCreateParams.PayStatement.Earning.builder() .amount(0L) + .attributes( + SandboxPaymentCreateParams.PayStatement.Earning.Metadata + .builder() + .metadata( + SandboxPaymentCreateParams.PayStatement.Earning.Metadata + .InnerMetadata + .builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) + .build() + ) .currency("currency") .hours(0.0) .name("name") @@ -79,9 +141,24 @@ class SandboxPaymentCreateParamsTest { ) .addEmployeeDeduction( SandboxPaymentCreateParams.PayStatement.EmployeeDeduction.builder() - .amount(2000L) - .currency("usd") - .name("401k test") + .amount(0L) + .attributes( + SandboxPaymentCreateParams.PayStatement.EmployeeDeduction + .Metadata + .builder() + .metadata( + SandboxPaymentCreateParams.PayStatement + .EmployeeDeduction + .Metadata + .InnerMetadata + .builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) + .build() + ) + .currency("currency") + .name("name") .preTax(true) .type(BenefitType._401K) .build() @@ -89,18 +166,44 @@ class SandboxPaymentCreateParamsTest { .addEmployerContribution( SandboxPaymentCreateParams.PayStatement.EmployerContribution.builder() .amount(0L) + .attributes( + SandboxPaymentCreateParams.PayStatement.EmployerContribution + .Metadata + .builder() + .metadata( + SandboxPaymentCreateParams.PayStatement + .EmployerContribution + .Metadata + .InnerMetadata + .builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) + .build() + ) .currency("currency") .name("name") .type(BenefitType._401K) .build() ) .grossPay(Money.builder().amount(0L).currency("currency").build()) - .individualId("b2338cfb-472f-4f72-9faa-e028c083144a") + .individualId("individual_id") .netPay(Money.builder().amount(0L).currency("currency").build()) .paymentMethod(SandboxPaymentCreateParams.PayStatement.PaymentMethod.CHECK) .addTax( SandboxPaymentCreateParams.PayStatement.Tax.builder() .amount(0L) + .attributes( + SandboxPaymentCreateParams.PayStatement.Tax.Metadata.builder() + .metadata( + SandboxPaymentCreateParams.PayStatement.Tax.Metadata + .InnerMetadata + .builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) + .build() + ) .currency("currency") .employer(true) .name("name") @@ -125,6 +228,18 @@ class SandboxPaymentCreateParamsTest { .addEarning( SandboxPaymentCreateParams.PayStatement.Earning.builder() .amount(0L) + .attributes( + SandboxPaymentCreateParams.PayStatement.Earning.Metadata + .builder() + .metadata( + SandboxPaymentCreateParams.PayStatement.Earning.Metadata + .InnerMetadata + .builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) + .build() + ) .currency("currency") .hours(0.0) .name("name") @@ -133,9 +248,24 @@ class SandboxPaymentCreateParamsTest { ) .addEmployeeDeduction( SandboxPaymentCreateParams.PayStatement.EmployeeDeduction.builder() - .amount(2000L) - .currency("usd") - .name("401k test") + .amount(0L) + .attributes( + SandboxPaymentCreateParams.PayStatement.EmployeeDeduction + .Metadata + .builder() + .metadata( + SandboxPaymentCreateParams.PayStatement + .EmployeeDeduction + .Metadata + .InnerMetadata + .builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) + .build() + ) + .currency("currency") + .name("name") .preTax(true) .type(BenefitType._401K) .build() @@ -143,18 +273,44 @@ class SandboxPaymentCreateParamsTest { .addEmployerContribution( SandboxPaymentCreateParams.PayStatement.EmployerContribution.builder() .amount(0L) + .attributes( + SandboxPaymentCreateParams.PayStatement.EmployerContribution + .Metadata + .builder() + .metadata( + SandboxPaymentCreateParams.PayStatement + .EmployerContribution + .Metadata + .InnerMetadata + .builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) + .build() + ) .currency("currency") .name("name") .type(BenefitType._401K) .build() ) .grossPay(Money.builder().amount(0L).currency("currency").build()) - .individualId("b2338cfb-472f-4f72-9faa-e028c083144a") + .individualId("individual_id") .netPay(Money.builder().amount(0L).currency("currency").build()) .paymentMethod(SandboxPaymentCreateParams.PayStatement.PaymentMethod.CHECK) .addTax( SandboxPaymentCreateParams.PayStatement.Tax.builder() .amount(0L) + .attributes( + SandboxPaymentCreateParams.PayStatement.Tax.Metadata.builder() + .metadata( + SandboxPaymentCreateParams.PayStatement.Tax.Metadata + .InnerMetadata + .builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) + .build() + ) .currency("currency") .employer(true) .name("name") 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 bbdc3623..a9a6c9e3 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 @@ -4,6 +4,7 @@ package com.tryfinch.api.services.blocking.sandbox import com.tryfinch.api.TestServerExtension import com.tryfinch.api.client.okhttp.FinchOkHttpClient +import com.tryfinch.api.core.JsonValue import com.tryfinch.api.models.BenefitType import com.tryfinch.api.models.Money import com.tryfinch.api.models.SandboxPaymentCreateParams @@ -30,6 +31,22 @@ class PaymentServiceTest { .addEarning( SandboxPaymentCreateParams.PayStatement.Earning.builder() .amount(0L) + .attributes( + SandboxPaymentCreateParams.PayStatement.Earning.Metadata + .builder() + .metadata( + SandboxPaymentCreateParams.PayStatement.Earning + .Metadata + .InnerMetadata + .builder() + .putAdditionalProperty( + "foo", + JsonValue.from("bar"), + ) + .build() + ) + .build() + ) .currency("currency") .hours(0.0) .name("name") @@ -40,9 +57,27 @@ class PaymentServiceTest { ) .addEmployeeDeduction( SandboxPaymentCreateParams.PayStatement.EmployeeDeduction.builder() - .amount(2000L) - .currency("usd") - .name("401k test") + .amount(0L) + .attributes( + SandboxPaymentCreateParams.PayStatement.EmployeeDeduction + .Metadata + .builder() + .metadata( + SandboxPaymentCreateParams.PayStatement + .EmployeeDeduction + .Metadata + .InnerMetadata + .builder() + .putAdditionalProperty( + "foo", + JsonValue.from("bar"), + ) + .build() + ) + .build() + ) + .currency("currency") + .name("name") .preTax(true) .type(BenefitType._401K) .build() @@ -51,13 +86,31 @@ class PaymentServiceTest { SandboxPaymentCreateParams.PayStatement.EmployerContribution .builder() .amount(0L) + .attributes( + SandboxPaymentCreateParams.PayStatement.EmployerContribution + .Metadata + .builder() + .metadata( + SandboxPaymentCreateParams.PayStatement + .EmployerContribution + .Metadata + .InnerMetadata + .builder() + .putAdditionalProperty( + "foo", + JsonValue.from("bar"), + ) + .build() + ) + .build() + ) .currency("currency") .name("name") .type(BenefitType._401K) .build() ) .grossPay(Money.builder().amount(0L).currency("currency").build()) - .individualId("b2338cfb-472f-4f72-9faa-e028c083144a") + .individualId("individual_id") .netPay(Money.builder().amount(0L).currency("currency").build()) .paymentMethod( SandboxPaymentCreateParams.PayStatement.PaymentMethod.CHECK @@ -65,6 +118,21 @@ class PaymentServiceTest { .addTax( SandboxPaymentCreateParams.PayStatement.Tax.builder() .amount(0L) + .attributes( + SandboxPaymentCreateParams.PayStatement.Tax.Metadata + .builder() + .metadata( + SandboxPaymentCreateParams.PayStatement.Tax.Metadata + .InnerMetadata + .builder() + .putAdditionalProperty( + "foo", + JsonValue.from("bar"), + ) + .build() + ) + .build() + ) .currency("currency") .employer(true) .name("name") From dcc69ede58c013366c81d119da773411107cf9ea Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 25 Feb 2025 00:05:09 +0000 Subject: [PATCH 22/22] release: 4.1.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 43 +++++++++++++++++++++++++++++++++++ README.md | 6 ++--- build.gradle.kts | 2 +- 4 files changed, 48 insertions(+), 5 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 51b15c88..3b4c2d4b 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "4.0.2" + ".": "4.1.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 04de6b78..9fe07907 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,48 @@ # Changelog +## 4.1.0 (2025-02-25) + +Full Changelog: [v4.0.2...v4.1.0](https://github.com/Finch-API/finch-api-java/compare/v4.0.2...v4.1.0) + +### Features + +* **api:** api update ([#454](https://github.com/Finch-API/finch-api-java/issues/454)) ([6a36319](https://github.com/Finch-API/finch-api-java/commit/6a3631913bea77b83216b72d47bc96fc9381aaa7)) +* **client:** get rid of annoying checked exceptions ([#449](https://github.com/Finch-API/finch-api-java/issues/449)) ([e7312ce](https://github.com/Finch-API/finch-api-java/commit/e7312ce5f83cad66a8b1c71697dda825c595480b)) +* **client:** support `JsonField#asX()` for known values ([#443](https://github.com/Finch-API/finch-api-java/issues/443)) ([d2c8ddd](https://github.com/Finch-API/finch-api-java/commit/d2c8ddd34286909b0c77b36a931c7784c6031297)) +* **client:** update enum `asX` methods ([#442](https://github.com/Finch-API/finch-api-java/issues/442)) ([caffc54](https://github.com/Finch-API/finch-api-java/commit/caffc542b831856cac7e1be5079b03a112b203f7)) + + +### Bug Fixes + +* **client:** mark some request bodies as optional ([#451](https://github.com/Finch-API/finch-api-java/issues/451)) ([344ac4b](https://github.com/Finch-API/finch-api-java/commit/344ac4bd5a99c29f50c8bf62640e536251fc491d)) +* **internal:** format code ([a34264f](https://github.com/Finch-API/finch-api-java/commit/a34264f4f11d18a8322e289f6505cc119853fc68)) + + +### Chores + +* **ci:** update gradle actions to v4 ([#447](https://github.com/Finch-API/finch-api-java/issues/447)) ([97cc45e](https://github.com/Finch-API/finch-api-java/commit/97cc45e241bf75d7255ba8fc645975168a944b7d)) +* **docs:** add faq to readme ([#450](https://github.com/Finch-API/finch-api-java/issues/450)) ([fd63219](https://github.com/Finch-API/finch-api-java/commit/fd63219b1fe6bda4743f2150cfa1ee4290e271d9)) +* **docs:** reorganize readme ([#444](https://github.com/Finch-API/finch-api-java/issues/444)) ([164050e](https://github.com/Finch-API/finch-api-java/commit/164050e39888c30f3c6f38c8b94f31c356813db5)) +* **internal:** codegen related update ([#448](https://github.com/Finch-API/finch-api-java/issues/448)) ([6db2948](https://github.com/Finch-API/finch-api-java/commit/6db294858870c374b2cb30bf4fd02a52e66452b6)) +* **internal:** get rid of configuration cache ([#446](https://github.com/Finch-API/finch-api-java/issues/446)) ([35edbd8](https://github.com/Finch-API/finch-api-java/commit/35edbd85822b3a521077d9d1ac96d5e071d018a5)) +* **internal:** make body class constructors private ([545758d](https://github.com/Finch-API/finch-api-java/commit/545758da4865c820e81165c78cd9034aa75e0a9b)) +* **internal:** make body classes for multipart requests ([545758d](https://github.com/Finch-API/finch-api-java/commit/545758da4865c820e81165c78cd9034aa75e0a9b)) +* **internal:** misc formatting changes ([545758d](https://github.com/Finch-API/finch-api-java/commit/545758da4865c820e81165c78cd9034aa75e0a9b)) +* **internal:** optimize build and test perf ([54b58c8](https://github.com/Finch-API/finch-api-java/commit/54b58c894270795449f4a4ad42d0bc6ff0448658)) +* **internal:** remove unnecessary non-null asserts in tests ([344ac4b](https://github.com/Finch-API/finch-api-java/commit/344ac4bd5a99c29f50c8bf62640e536251fc491d)) +* **internal:** rename internal body classes ([545758d](https://github.com/Finch-API/finch-api-java/commit/545758da4865c820e81165c78cd9034aa75e0a9b)) +* **internal:** update formatter ([#439](https://github.com/Finch-API/finch-api-java/issues/439)) ([54b58c8](https://github.com/Finch-API/finch-api-java/commit/54b58c894270795449f4a4ad42d0bc6ff0448658)) +* **internal:** update some formatting in `Values.kt` ([d2c8ddd](https://github.com/Finch-API/finch-api-java/commit/d2c8ddd34286909b0c77b36a931c7784c6031297)) +* **internal:** use `assertNotNull` in tests for type narrowing ([344ac4b](https://github.com/Finch-API/finch-api-java/commit/344ac4bd5a99c29f50c8bf62640e536251fc491d)) +* **internal:** use better test example values ([#441](https://github.com/Finch-API/finch-api-java/issues/441)) ([545758d](https://github.com/Finch-API/finch-api-java/commit/545758da4865c820e81165c78cd9034aa75e0a9b)) +* **test:** update some test values ([#437](https://github.com/Finch-API/finch-api-java/issues/437)) ([602f2c0](https://github.com/Finch-API/finch-api-java/commit/602f2c0e0ae1d1351d141faf91e20a3c5e3164eb)) + + +### Documentation + +* add immutability explanation to readme ([#452](https://github.com/Finch-API/finch-api-java/issues/452)) ([8f256fb](https://github.com/Finch-API/finch-api-java/commit/8f256fbfc0f39a56d8f416b5ea03e42c3e422c60)) +* add source file links to readme ([#453](https://github.com/Finch-API/finch-api-java/issues/453)) ([becaa47](https://github.com/Finch-API/finch-api-java/commit/becaa47cb5fb7138518157dfa92410d268fa55fd)) + ## 4.0.2 (2025-02-12) Full Changelog: [v4.0.1...v4.0.2](https://github.com/Finch-API/finch-api-java/compare/v4.0.1...v4.0.2) diff --git a/README.md b/README.md index 92c47e86..d469a892 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/4.0.2) +[![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.1.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:4.0.2") +implementation("com.tryfinch.api:finch-java:4.1.0") ``` ### Maven @@ -32,7 +32,7 @@ implementation("com.tryfinch.api:finch-java:4.0.2") com.tryfinch.api finch-java - 4.0.2 + 4.1.0 ``` diff --git a/build.gradle.kts b/build.gradle.kts index 12e8bf5d..4b46d1a3 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,4 +1,4 @@ allprojects { group = "com.tryfinch.api" - version = "4.0.2" // x-release-please-version + version = "4.1.0" // x-release-please-version }