diff --git a/.release-please-manifest.json b/.release-please-manifest.json index de0960ab..65f558e7 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.12.0" + ".": "2.0.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index eacfbb3f..05eb3d27 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 38 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-2526a31a361274411e6cfc64858b1b084a22ffb491a9490374b717534827b3e1.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-cf610d4dbb7e3d84161b5783a0861b2e551422eb5cf727dde86a839325d7ef76.yml diff --git a/CHANGELOG.md b/CHANGELOG.md index 37cc93e3..ff9c78f6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,47 @@ # Changelog +## 2.0.0 (2024-12-19) + +Full Changelog: [v1.12.0...v2.0.0](https://github.com/Finch-API/finch-api-java/compare/v1.12.0...v2.0.0) + +### ⚠ BREAKING CHANGES + +* **client:** numeric enum member type ([#349](https://github.com/Finch-API/finch-api-java/issues/349)) + +### Features + +* **api:** api update ([#348](https://github.com/Finch-API/finch-api-java/issues/348)) ([1f7f08f](https://github.com/Finch-API/finch-api-java/commit/1f7f08fdb0fac4043baa61ea2153529fad1fe8a1)) +* **api:** api update ([#350](https://github.com/Finch-API/finch-api-java/issues/350)) ([76486fd](https://github.com/Finch-API/finch-api-java/commit/76486fd74b4c69f1c1e758226877c50876e4e1dd)) +* **api:** api update ([#358](https://github.com/Finch-API/finch-api-java/issues/358)) ([aef03b5](https://github.com/Finch-API/finch-api-java/commit/aef03b5cab006660274c63214e6900a3659ab54d)) +* **api:** api update ([#363](https://github.com/Finch-API/finch-api-java/issues/363)) ([1f2e37b](https://github.com/Finch-API/finch-api-java/commit/1f2e37bd6728a70c0c3a5eb5ddf4485183ea30b7)) + + +### Bug Fixes + +* **client:** numeric enum member type ([#349](https://github.com/Finch-API/finch-api-java/issues/349)) ([7705d87](https://github.com/Finch-API/finch-api-java/commit/7705d87e122e0d06a8b88ac45ccca67a96521562)) + + +### Chores + +* **docs:** add example project ([#367](https://github.com/Finch-API/finch-api-java/issues/367)) ([7801ba2](https://github.com/Finch-API/finch-api-java/commit/7801ba2d49fc9131e28ac3c6aeffa719efaa1289)) +* **docs:** fix code block language ([#368](https://github.com/Finch-API/finch-api-java/issues/368)) ([723c35a](https://github.com/Finch-API/finch-api-java/commit/723c35a6b2f504bb3a480e0154537190515d0f1a)) +* **docs:** update readme ([#365](https://github.com/Finch-API/finch-api-java/issues/365)) ([fc4a2ac](https://github.com/Finch-API/finch-api-java/commit/fc4a2aceea8968037cc11a2300bdb2f3296d93d4)) +* **internal:** codegen related update ([#346](https://github.com/Finch-API/finch-api-java/issues/346)) ([90f7c99](https://github.com/Finch-API/finch-api-java/commit/90f7c993a426713f980b561f8ea0410f6e4079e5)) +* **internal:** codegen related update ([#355](https://github.com/Finch-API/finch-api-java/issues/355)) ([1a5d595](https://github.com/Finch-API/finch-api-java/commit/1a5d59579770cb25845c8047e43681aebf457480)) +* **internal:** remove unused and expand used wildcard imports ([#359](https://github.com/Finch-API/finch-api-java/issues/359)) ([c825267](https://github.com/Finch-API/finch-api-java/commit/c825267ecf91ac10db7738b6df7f350d4f36d390)) +* **internal:** remove unused and expand used wildcard imports ([#361](https://github.com/Finch-API/finch-api-java/issues/361)) ([3c80b52](https://github.com/Finch-API/finch-api-java/commit/3c80b52b83abfcce2f99cb3203b0008c02a35d0f)) +* **internal:** remove unused imports ([#354](https://github.com/Finch-API/finch-api-java/issues/354)) ([cddb901](https://github.com/Finch-API/finch-api-java/commit/cddb901f2e7ec7c266ee535511325ff753402384)) +* **test:** remove unused imports ([#356](https://github.com/Finch-API/finch-api-java/issues/356)) ([a313b58](https://github.com/Finch-API/finch-api-java/commit/a313b580708ec7885eb574610b84a1b139202bcf)) +* **test:** use `JsonValue` instead of `JsonString` ([#357](https://github.com/Finch-API/finch-api-java/issues/357)) ([d336f7d](https://github.com/Finch-API/finch-api-java/commit/d336f7d962bea0a56d89a553faf8cc2b1339556a)) +* update example values in tests and docs ([#351](https://github.com/Finch-API/finch-api-java/issues/351)) ([792f3f7](https://github.com/Finch-API/finch-api-java/commit/792f3f76ae6584f9f83924b4cbee31a6067a0b18)) +* update parameter examples in tests and docs ([#364](https://github.com/Finch-API/finch-api-java/issues/364)) ([5fb0cac](https://github.com/Finch-API/finch-api-java/commit/5fb0cac8da7fd4957fbaaacdbc8b46255740b6ce)) + + +### Styles + +* **internal:** make enum value definitions less verbose ([#352](https://github.com/Finch-API/finch-api-java/issues/352)) ([08a5c64](https://github.com/Finch-API/finch-api-java/commit/08a5c64440d627e115c0cd360675292cab9b53b5)) +* **internal:** move enum identity methods to bottom of class ([#353](https://github.com/Finch-API/finch-api-java/issues/353)) ([bd29c58](https://github.com/Finch-API/finch-api-java/commit/bd29c58c914b831560d94ad7cd60a3ae6cb79742)) + ## 1.12.0 (2024-11-27) Full Changelog: [v1.11.1...v1.12.0](https://github.com/Finch-API/finch-api-java/compare/v1.11.1...v1.12.0) diff --git a/README.md b/README.md index fb49b052..cb2abde7 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/1.12.0) +[![Maven Central](https://img.shields.io/maven-central/v/com.tryfinch.api/finch-java)](https://central.sonatype.com/artifact/com.tryfinch.api/finch-java/2.0.0) @@ -27,7 +27,7 @@ The REST API documentation can be found [in the Finch Documentation Center](htt ```kotlin -implementation("com.tryfinch.api:finch-java:1.12.0") +implementation("com.tryfinch.api:finch-java:2.0.0") ``` #### Maven @@ -36,7 +36,7 @@ implementation("com.tryfinch.api:finch-java:1.12.0") com.tryfinch.api finch-java - 1.12.0 + 2.0.0 ``` @@ -49,6 +49,9 @@ 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; + FinchClient client = FinchOkHttpClient.fromEnv(); // Note: you can also call fromEnv() from the client builder, for example if you need to set additional properties @@ -70,13 +73,11 @@ 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. +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; -import com.tryfinch.api.models.Page; HrisDirectoryListParams params = HrisDirectoryListParams.builder() .candidateId("") @@ -86,12 +87,11 @@ HrisDirectoryListPage page = client.hris().directory().list(params); ### Example: listing resources -The Finch API provides a `list` method to get a paginated list of directory. -You can retrieve the first page by: +The Finch API provides a `list` method to get a paginated list of directory. You can retrieve the first page by: ```java +import com.tryfinch.api.models.HrisDirectoryListPage; import com.tryfinch.api.models.IndividualInDirectory; -import com.tryfinch.api.models.Page; HrisDirectoryListPage page = client.hris().directory().list(); for (IndividualInDirectory directory : page.individuals()) { @@ -99,6 +99,27 @@ for (IndividualInDirectory directory : page.individuals()) { } ``` +Use the `HrisDirectoryListParams` builder to set parameters: + +```java +import com.tryfinch.api.models.HrisDirectoryListPage; +import com.tryfinch.api.models.HrisDirectoryListParams; + +HrisDirectoryListParams params = HrisDirectoryListParams.builder() + .limit(0L) + .offset(0L) + .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 easily get params for the next page by using the helper `getNextPageParams`: +HrisDirectoryListPage page3 = client.hris().directory().list(params.getNextPageParams(page2)); +``` + See [Pagination](#pagination) below for more information on transparently working with lists of objects without worrying about fetching each page. --- @@ -109,14 +130,14 @@ See [Pagination](#pagination) below for more information on transparently workin To make a request to the Finch API, you generally build an instance of the appropriate `Params` class. -In [Example: creating a resource](#example-creating-a-resource) above, we used the `HrisDirectoryListParams.builder()` to pass to -the `list` method of the `directory` service. +In [Example: creating a resource](#example-creating-a-resource) above, we used the `HrisDirectoryListParams.builder()` to pass to the `list` method of the `directory` service. -Sometimes, the API may support other properties that are not yet supported in the Java SDK types. In that case, -you can attach them using the `putAdditionalProperty` method. +Sometimes, the API may support other properties that are not yet supported in the Java SDK types. In that case, you can attach them using the `putAdditionalProperty` method. ```java -import com.tryfinch.api.models.core.JsonValue; +import com.tryfinch.api.core.JsonValue; +import com.tryfinch.api.models.HrisDirectoryListParams; + HrisDirectoryListParams params = HrisDirectoryListParams.builder() // ... normal properties .putAdditionalProperty("secret_param", JsonValue.from("4242")) @@ -130,15 +151,19 @@ HrisDirectoryListParams params = HrisDirectoryListParams.builder() 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. ```java +import com.tryfinch.api.models.HrisDirectoryListPage; + HrisDirectoryListPage page = client.hris().directory().list().validate(); ``` ### Response properties as JSON -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. +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. ```java +import com.tryfinch.api.core.JsonField; +import java.util.Optional; + JsonField field = responseObj._field(); if (field.isMissing()) { @@ -160,6 +185,8 @@ if (field.isMissing()) { 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: ```java +import com.tryfinch.api.core.JsonValue; + JsonValue secret = operationSupportMatrix._additionalProperties().get("secret_field"); ``` @@ -167,17 +194,18 @@ JsonValue secret = operationSupportMatrix._additionalProperties().get("secret_fi ## Pagination -For methods that return a paginated list of results, this library provides convenient ways access -the results either one page at a time, or item-by-item across all pages. +For methods that return a paginated list of results, this library provides convenient ways access the results either one page at a time, or item-by-item across all pages. ### Auto-pagination -To iterate through all results across all pages, you can use `autoPager`, -which automatically handles fetching more pages for you: +To iterate through all results across all pages, you can use `autoPager`, which automatically handles fetching more pages for you: ### Synchronous ```java +import com.tryfinch.api.models.HrisDirectoryListPage; +import com.tryfinch.api.models.IndividualInDirectory; + // As an Iterable: HrisDirectoryListPage page = client.hris().directory().list(params); for (IndividualInDirectory directory : page.autoPager()) { @@ -200,12 +228,12 @@ asyncClient.hris().directory().list(params).autoPager() ### Manual pagination -If none of the above helpers meet your needs, you can also manually request pages one-by-one. -A page of results has a `data()` method to fetch the list of objects, as well as top-level -`response` and other methods to fetch top-level data about the page. It also has methods -`hasNextPage`, `getNextPage`, and `getNextPageParams` methods to help with pagination. +If none of the above helpers meet your needs, you can also manually request pages one-by-one. A page of results has a `data()` method to fetch the list of objects, as well as top-level `response` and other methods to fetch top-level data about the page. It also has methods `hasNextPage`, `getNextPage`, and `getNextPageParams` methods to help with pagination. ```java +import com.tryfinch.api.models.HrisDirectoryListPage; +import com.tryfinch.api.models.IndividualInDirectory; + HrisDirectoryListPage page = client.hris().directory().list(params); while (page != null) { for (IndividualInDirectory directory : page.individuals()) { @@ -238,31 +266,33 @@ This library throws exceptions in a single hierarchy for easy handling: - **`FinchException`** - Base exception for all exceptions - - **`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. +- **`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. - | 400 | BadRequestException | - | ------ | ----------------------------- | - | 401 | AuthenticationException | - | 403 | PermissionDeniedException | - | 404 | NotFoundException | - | 422 | UnprocessableEntityException | - | 429 | RateLimitException | - | 5xx | InternalServerException | - | others | UnexpectedStatusCodeException | + | 400 | BadRequestException | + | ------ | ----------------------------- | + | 401 | AuthenticationException | + | 403 | PermissionDeniedException | + | 404 | NotFoundException | + | 422 | UnprocessableEntityException | + | 429 | RateLimitException | + | 5xx | InternalServerException | + | others | UnexpectedStatusCodeException | - - **`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) +- **`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) ## Network options ### Retries -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: +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: ```java +import com.tryfinch.api.client.FinchClient; +import com.tryfinch.api.client.okhttp.FinchOkHttpClient; + FinchClient client = FinchOkHttpClient.builder() .fromEnv() .maxRetries(4) @@ -274,6 +304,10 @@ FinchClient client = FinchOkHttpClient.builder() Requests time out after 1 minute by default. You can configure this on the client builder: ```java +import com.tryfinch.api.client.FinchClient; +import com.tryfinch.api.client.okhttp.FinchOkHttpClient; +import java.time.Duration; + FinchClient client = FinchOkHttpClient.builder() .fromEnv() .timeout(Duration.ofSeconds(30)) @@ -285,15 +319,36 @@ FinchClient client = FinchOkHttpClient.builder() Requests can be routed through a proxy. You can configure this on the client builder: ```java +import com.tryfinch.api.client.FinchClient; +import com.tryfinch.api.client.okhttp.FinchOkHttpClient; +import java.net.InetSocketAddress; +import java.net.Proxy; + FinchClient client = FinchOkHttpClient.builder() .fromEnv() - .proxy(new Proxy( - Type.HTTP, - new InetSocketAddress("proxy.com", 8080) - )) + .proxy(new Proxy(Proxy.Type.HTTP, new InetSocketAddress("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 request params + +To make requests using undocumented parameters, you can provide or override parameters on the params object while building it. + +```java +FooCreateParams address = FooCreateParams.builder() + .id("my_id") + .putAdditionalProperty("secret_prop", JsonValue.from("hello")) + .build(); +``` + +### Undocumented response properties + +To access undocumented response properties, you can use `res._additionalProperties()` on a response object to get a map of untyped fields of type `Map`. You can then access fields like `._additionalProperties().get("secret_prop").asString()` or use other helpers defined on the `JsonValue` class to extract it to a desired type. + ## Logging We use the standard [OkHttp logging interceptor](https://github.com/square/okhttp/tree/master/okhttp-logging-interceptor). diff --git a/build.gradle.kts b/build.gradle.kts index 1c0d6a5c..b4f521ea 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -4,7 +4,7 @@ plugins { allprojects { group = "com.tryfinch.api" - version = "1.12.0" // x-release-please-version + version = "2.0.0" // x-release-please-version } 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 a67ca859..a1518f6a 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 @@ -3,8 +3,16 @@ package com.tryfinch.api.client import com.fasterxml.jackson.annotation.JsonProperty -import com.tryfinch.api.models.* -import com.tryfinch.api.services.blocking.* +import com.tryfinch.api.services.blocking.AccessTokenService +import com.tryfinch.api.services.blocking.AccountService +import com.tryfinch.api.services.blocking.ConnectService +import com.tryfinch.api.services.blocking.HrisService +import com.tryfinch.api.services.blocking.JobService +import com.tryfinch.api.services.blocking.PayrollService +import com.tryfinch.api.services.blocking.ProviderService +import com.tryfinch.api.services.blocking.RequestForwardingService +import com.tryfinch.api.services.blocking.SandboxService +import com.tryfinch.api.services.blocking.WebhookService interface FinchClient { 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 3df9bbd9..6f57c432 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 @@ -3,8 +3,16 @@ package com.tryfinch.api.client import com.fasterxml.jackson.annotation.JsonProperty -import com.tryfinch.api.models.* -import com.tryfinch.api.services.async.* +import com.tryfinch.api.services.async.AccessTokenServiceAsync +import com.tryfinch.api.services.async.AccountServiceAsync +import com.tryfinch.api.services.async.ConnectServiceAsync +import com.tryfinch.api.services.async.HrisServiceAsync +import com.tryfinch.api.services.async.JobServiceAsync +import com.tryfinch.api.services.async.PayrollServiceAsync +import com.tryfinch.api.services.async.ProviderServiceAsync +import com.tryfinch.api.services.async.RequestForwardingServiceAsync +import com.tryfinch.api.services.async.SandboxServiceAsync +import com.tryfinch.api.services.async.WebhookServiceAsync import java.util.concurrent.CompletableFuture interface FinchClientAsync { 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 a7a6672a..ecf0193b 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 @@ -15,7 +15,26 @@ import com.tryfinch.api.core.json import com.tryfinch.api.errors.FinchError import com.tryfinch.api.errors.FinchException import com.tryfinch.api.models.* -import com.tryfinch.api.services.async.* +import com.tryfinch.api.services.async.AccessTokenServiceAsync +import com.tryfinch.api.services.async.AccessTokenServiceAsyncImpl +import com.tryfinch.api.services.async.AccountServiceAsync +import com.tryfinch.api.services.async.AccountServiceAsyncImpl +import com.tryfinch.api.services.async.ConnectServiceAsync +import com.tryfinch.api.services.async.ConnectServiceAsyncImpl +import com.tryfinch.api.services.async.HrisServiceAsync +import com.tryfinch.api.services.async.HrisServiceAsyncImpl +import com.tryfinch.api.services.async.JobServiceAsync +import com.tryfinch.api.services.async.JobServiceAsyncImpl +import com.tryfinch.api.services.async.PayrollServiceAsync +import com.tryfinch.api.services.async.PayrollServiceAsyncImpl +import com.tryfinch.api.services.async.ProviderServiceAsync +import com.tryfinch.api.services.async.ProviderServiceAsyncImpl +import com.tryfinch.api.services.async.RequestForwardingServiceAsync +import com.tryfinch.api.services.async.RequestForwardingServiceAsyncImpl +import com.tryfinch.api.services.async.SandboxServiceAsync +import com.tryfinch.api.services.async.SandboxServiceAsyncImpl +import com.tryfinch.api.services.async.WebhookServiceAsync +import com.tryfinch.api.services.async.WebhookServiceAsyncImpl import java.net.URLEncoder import java.util.concurrent.CompletableFuture 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 117694a7..bb24b79b 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 @@ -15,7 +15,26 @@ import com.tryfinch.api.core.json import com.tryfinch.api.errors.FinchError import com.tryfinch.api.errors.FinchException import com.tryfinch.api.models.* -import com.tryfinch.api.services.blocking.* +import com.tryfinch.api.services.blocking.AccessTokenService +import com.tryfinch.api.services.blocking.AccessTokenServiceImpl +import com.tryfinch.api.services.blocking.AccountService +import com.tryfinch.api.services.blocking.AccountServiceImpl +import com.tryfinch.api.services.blocking.ConnectService +import com.tryfinch.api.services.blocking.ConnectServiceImpl +import com.tryfinch.api.services.blocking.HrisService +import com.tryfinch.api.services.blocking.HrisServiceImpl +import com.tryfinch.api.services.blocking.JobService +import com.tryfinch.api.services.blocking.JobServiceImpl +import com.tryfinch.api.services.blocking.PayrollService +import com.tryfinch.api.services.blocking.PayrollServiceImpl +import com.tryfinch.api.services.blocking.ProviderService +import com.tryfinch.api.services.blocking.ProviderServiceImpl +import com.tryfinch.api.services.blocking.RequestForwardingService +import com.tryfinch.api.services.blocking.RequestForwardingServiceImpl +import com.tryfinch.api.services.blocking.SandboxService +import com.tryfinch.api.services.blocking.SandboxServiceImpl +import com.tryfinch.api.services.blocking.WebhookService +import com.tryfinch.api.services.blocking.WebhookServiceImpl import java.net.URLEncoder class FinchClientImpl 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 5ee50b30..876f7a57 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 @@ -12,7 +12,6 @@ import com.tryfinch.api.core.NoAutoDetect import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams import com.tryfinch.api.core.toImmutable -import com.tryfinch.api.models.* import java.util.Objects import java.util.Optional 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 533e3693..0b5b001e 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 @@ -209,27 +209,15 @@ private constructor( @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return /* spotless:off */ other is AuthenticationType && value == other.value /* spotless:on */ - } - - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() - companion object { - @JvmField val CREDENTIAL = AuthenticationType(JsonField.of("credential")) + @JvmField val CREDENTIAL = of("credential") - @JvmField val API_TOKEN = AuthenticationType(JsonField.of("api_token")) + @JvmField val API_TOKEN = of("api_token") - @JvmField val OAUTH = AuthenticationType(JsonField.of("oauth")) + @JvmField val OAUTH = of("oauth") - @JvmField val ASSISTED = AuthenticationType(JsonField.of("assisted")) + @JvmField val ASSISTED = of("assisted") @JvmStatic fun of(value: String) = AuthenticationType(JsonField.of(value)) } @@ -268,6 +256,18 @@ private constructor( } fun asString(): String = _value().asStringOrThrow() + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is AuthenticationType && value == other.value /* spotless:on */ + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() } override fun equals(other: Any?): Boolean { diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccountDisconnectParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccountDisconnectParams.kt index fc26161d..e88964ff 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccountDisconnectParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccountDisconnectParams.kt @@ -7,7 +7,6 @@ import com.tryfinch.api.core.NoAutoDetect import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams import com.tryfinch.api.core.toImmutable -import com.tryfinch.api.models.* import java.util.Objects import java.util.Optional diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccountIntrospectParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccountIntrospectParams.kt index 50b8cf1f..1f07bed2 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccountIntrospectParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AccountIntrospectParams.kt @@ -5,7 +5,6 @@ package com.tryfinch.api.models import com.tryfinch.api.core.NoAutoDetect import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams -import com.tryfinch.api.models.* import java.util.Objects class AccountIntrospectParams 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 0602e000..7ae91c5d 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 @@ -2029,6 +2029,7 @@ private constructor( private val startDate: JsonField, private val endDate: JsonField, private val isActive: JsonField, + private val employmentStatus: JsonField, private val incomeHistory: JsonField, private val classCode: JsonField, private val customFields: JsonField, @@ -2064,6 +2065,9 @@ private constructor( fun isActive(): Optional = Optional.ofNullable(isActive.getNullable("is_active")) + fun employmentStatus(): Optional = + Optional.ofNullable(employmentStatus.getNullable("employment_status")) + fun incomeHistory(): Optional = Optional.ofNullable(incomeHistory.getNullable("income_history")) @@ -2104,6 +2108,10 @@ private constructor( @JsonProperty("is_active") @ExcludeMissing fun _isActive() = isActive + @JsonProperty("employment_status") + @ExcludeMissing + fun _employmentStatus() = employmentStatus + @JsonProperty("income_history") @ExcludeMissing fun _incomeHistory() = incomeHistory @@ -2138,6 +2146,7 @@ private constructor( startDate() endDate() isActive() + employmentStatus() incomeHistory() classCode() customFields() @@ -2167,6 +2176,7 @@ private constructor( private var startDate: JsonField = JsonMissing.of() private var endDate: JsonField = JsonMissing.of() private var isActive: JsonField = JsonMissing.of() + private var employmentStatus: JsonField = JsonMissing.of() private var incomeHistory: JsonField = JsonMissing.of() private var classCode: JsonField = JsonMissing.of() private var customFields: JsonField = JsonMissing.of() @@ -2189,6 +2199,7 @@ private constructor( this.startDate = supportedEmploymentFields.startDate this.endDate = supportedEmploymentFields.endDate this.isActive = supportedEmploymentFields.isActive + this.employmentStatus = supportedEmploymentFields.employmentStatus this.incomeHistory = supportedEmploymentFields.incomeHistory this.classCode = supportedEmploymentFields.classCode this.customFields = supportedEmploymentFields.customFields @@ -2258,6 +2269,15 @@ private constructor( this.isActive = isActive } + fun employmentStatus(employmentStatus: Boolean) = + employmentStatus(JsonField.of(employmentStatus)) + + @JsonProperty("employment_status") + @ExcludeMissing + fun employmentStatus(employmentStatus: JsonField) = apply { + this.employmentStatus = employmentStatus + } + fun incomeHistory(incomeHistory: Boolean) = incomeHistory(JsonField.of(incomeHistory)) @@ -2347,6 +2367,7 @@ private constructor( startDate, endDate, isActive, + employmentStatus, incomeHistory, classCode, customFields, @@ -2948,17 +2969,17 @@ private constructor( return true } - return /* spotless:off */ other is SupportedEmploymentFields && id == other.id && firstName == other.firstName && middleName == other.middleName && lastName == other.lastName && title == other.title && startDate == other.startDate && endDate == other.endDate && isActive == other.isActive && incomeHistory == other.incomeHistory && classCode == other.classCode && customFields == other.customFields && department == other.department && employment == other.employment && income == other.income && location == other.location && manager == other.manager && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is SupportedEmploymentFields && id == other.id && firstName == other.firstName && middleName == other.middleName && lastName == other.lastName && title == other.title && startDate == other.startDate && endDate == other.endDate && isActive == other.isActive && employmentStatus == other.employmentStatus && incomeHistory == other.incomeHistory && classCode == other.classCode && customFields == other.customFields && department == other.department && employment == other.employment && income == other.income && location == other.location && manager == other.manager && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(id, firstName, middleName, lastName, title, startDate, endDate, isActive, incomeHistory, classCode, customFields, department, employment, income, location, manager, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, firstName, middleName, lastName, title, startDate, endDate, isActive, employmentStatus, incomeHistory, classCode, customFields, department, employment, income, location, manager, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "SupportedEmploymentFields{id=$id, firstName=$firstName, middleName=$middleName, lastName=$lastName, title=$title, startDate=$startDate, endDate=$endDate, isActive=$isActive, incomeHistory=$incomeHistory, classCode=$classCode, customFields=$customFields, department=$department, employment=$employment, income=$income, location=$location, manager=$manager, additionalProperties=$additionalProperties}" + "SupportedEmploymentFields{id=$id, firstName=$firstName, middleName=$middleName, lastName=$lastName, title=$title, startDate=$startDate, endDate=$endDate, isActive=$isActive, employmentStatus=$employmentStatus, incomeHistory=$incomeHistory, classCode=$classCode, customFields=$customFields, department=$department, employment=$employment, income=$income, location=$location, manager=$manager, additionalProperties=$additionalProperties}" } @JsonDeserialize(builder = SupportedIndividualFields.Builder::class) @@ -5333,29 +5354,17 @@ private constructor( @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - 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() - companion object { - @JvmField val ASSISTED = Type(JsonField.of("assisted")) + @JvmField val ASSISTED = of("assisted") - @JvmField val CREDENTIAL = Type(JsonField.of("credential")) + @JvmField val CREDENTIAL = of("credential") - @JvmField val API_TOKEN = Type(JsonField.of("api_token")) + @JvmField val API_TOKEN = of("api_token") - @JvmField val API_CREDENTIAL = Type(JsonField.of("api_credential")) + @JvmField val API_CREDENTIAL = of("api_credential") - @JvmField val OAUTH = Type(JsonField.of("oauth")) + @JvmField val OAUTH = of("oauth") @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } @@ -5398,6 +5407,18 @@ private constructor( } 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 { @@ -5444,21 +5465,9 @@ private constructor( @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return /* spotless:off */ other is EventType && value == other.value /* spotless:on */ - } - - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() - companion object { - @JvmField val ACCOUNT_UPDATED = EventType(JsonField.of("account.updated")) + @JvmField val ACCOUNT_UPDATED = of("account.updated") @JvmStatic fun of(value: String) = EventType(JsonField.of(value)) } @@ -5485,6 +5494,18 @@ private constructor( } fun asString(): String = _value().asStringOrThrow() + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is EventType && value == other.value /* spotless:on */ + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() } override fun equals(other: Any?): Boolean { 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 ab6ad06f..f3003216 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 @@ -196,27 +196,15 @@ private constructor( @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return /* spotless:off */ other is AuthenticationType && value == other.value /* spotless:on */ - } - - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() - companion object { - @JvmField val CREDENTIAL = AuthenticationType(JsonField.of("credential")) + @JvmField val CREDENTIAL = of("credential") - @JvmField val API_TOKEN = AuthenticationType(JsonField.of("api_token")) + @JvmField val API_TOKEN = of("api_token") - @JvmField val OAUTH = AuthenticationType(JsonField.of("oauth")) + @JvmField val OAUTH = of("oauth") - @JvmField val ASSISTED = AuthenticationType(JsonField.of("assisted")) + @JvmField val ASSISTED = of("assisted") @JvmStatic fun of(value: String) = AuthenticationType(JsonField.of(value)) } @@ -255,6 +243,18 @@ private constructor( } fun asString(): String = _value().asStringOrThrow() + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is AuthenticationType && value == other.value /* spotless:on */ + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() } override fun equals(other: Any?): Boolean { 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 248ef3dc..384f7e45 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 @@ -265,31 +265,19 @@ private constructor( @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return /* spotless:off */ other is Status && value == other.value /* spotless:on */ - } - - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() - companion object { - @JvmField val PENDING = Status(JsonField.of("pending")) + @JvmField val PENDING = of("pending") - @JvmField val IN_PROGRESS = Status(JsonField.of("in_progress")) + @JvmField val IN_PROGRESS = of("in_progress") - @JvmField val COMPLETE = Status(JsonField.of("complete")) + @JvmField val COMPLETE = of("complete") - @JvmField val ERROR = Status(JsonField.of("error")) + @JvmField val ERROR = of("error") - @JvmField val REAUTH_ERROR = Status(JsonField.of("reauth_error")) + @JvmField val REAUTH_ERROR = of("reauth_error") - @JvmField val PERMISSIONS_ERROR = Status(JsonField.of("permissions_error")) + @JvmField val PERMISSIONS_ERROR = of("permissions_error") @JvmStatic fun of(value: String) = Status(JsonField.of(value)) } @@ -336,31 +324,31 @@ private constructor( } fun asString(): String = _value().asStringOrThrow() - } - - class Type - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { - - @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value override fun equals(other: Any?): Boolean { if (this === other) { return true } - return /* spotless:off */ other is Type && value == other.value /* spotless:on */ + return /* spotless:off */ other is Status && 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 { + + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { - @JvmField val DATA_SYNC_ALL = Type(JsonField.of("data_sync_all")) + @JvmField val DATA_SYNC_ALL = of("data_sync_all") @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } @@ -387,6 +375,18 @@ private constructor( } 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 { 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 659c4cf1..7bdc455e 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 @@ -119,23 +119,11 @@ private constructor( @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - 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() - companion object { - @JvmField val FIXED = Type(JsonField.of("fixed")) + @JvmField val FIXED = of("fixed") - @JvmField val PERCENT = Type(JsonField.of("percent")) + @JvmField val PERCENT = of("percent") @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } @@ -166,6 +154,18 @@ private constructor( } 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 { 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 28dc51f1..7a05587b 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 @@ -371,23 +371,11 @@ private constructor( @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return /* spotless:off */ other is CompanyContribution && value == other.value /* spotless:on */ - } - - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() - companion object { - @JvmField val FIXED = CompanyContribution(JsonField.of("fixed")) + @JvmField val FIXED = of("fixed") - @JvmField val PERCENT = CompanyContribution(JsonField.of("percent")) + @JvmField val PERCENT = of("percent") @JvmStatic fun of(value: String) = CompanyContribution(JsonField.of(value)) } @@ -418,33 +406,33 @@ private constructor( } fun asString(): String = _value().asStringOrThrow() - } - - class EmployeeDeduction - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { - - @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value override fun equals(other: Any?): Boolean { if (this === other) { return true } - return /* spotless:off */ other is EmployeeDeduction && value == other.value /* spotless:on */ + return /* spotless:off */ other is CompanyContribution && value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() override fun toString() = value.toString() + } + + class EmployeeDeduction + @JsonCreator + private constructor( + private val value: JsonField, + ) : Enum { + + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { - @JvmField val FIXED = EmployeeDeduction(JsonField.of("fixed")) + @JvmField val FIXED = of("fixed") - @JvmField val PERCENT = EmployeeDeduction(JsonField.of("percent")) + @JvmField val PERCENT = of("percent") @JvmStatic fun of(value: String) = EmployeeDeduction(JsonField.of(value)) } @@ -475,33 +463,33 @@ private constructor( } fun asString(): String = _value().asStringOrThrow() - } - - class HsaContributionLimit - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { - - @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value override fun equals(other: Any?): Boolean { if (this === other) { return true } - return /* spotless:off */ other is HsaContributionLimit && value == other.value /* spotless:on */ + return /* spotless:off */ other is EmployeeDeduction && value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() override fun toString() = value.toString() + } + + class HsaContributionLimit + @JsonCreator + private constructor( + private val value: JsonField, + ) : Enum { + + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { - @JvmField val INDIVIDUAL = HsaContributionLimit(JsonField.of("individual")) + @JvmField val INDIVIDUAL = of("individual") - @JvmField val FAMILY = HsaContributionLimit(JsonField.of("family")) + @JvmField val FAMILY = of("family") @JvmStatic fun of(value: String) = HsaContributionLimit(JsonField.of(value)) } @@ -532,6 +520,18 @@ private constructor( } fun asString(): String = _value().asStringOrThrow() + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is HsaContributionLimit && value == other.value /* spotless:on */ + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() } override fun equals(other: Any?): Boolean { 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 fb17c9c1..9a552373 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 @@ -5,7 +5,6 @@ package com.tryfinch.api.models import com.fasterxml.jackson.annotation.JsonCreator import com.tryfinch.api.core.Enum import com.tryfinch.api.core.JsonField -import com.tryfinch.api.core.JsonValue import com.tryfinch.api.errors.FinchInvalidDataException class BenefitFrequency @@ -16,25 +15,13 @@ private constructor( @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return /* spotless:off */ other is BenefitFrequency && value == other.value /* spotless:on */ - } - - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() - companion object { - @JvmField val ONE_TIME = BenefitFrequency(JsonField.of("one_time")) + @JvmField val ONE_TIME = of("one_time") - @JvmField val EVERY_PAYCHECK = BenefitFrequency(JsonField.of("every_paycheck")) + @JvmField val EVERY_PAYCHECK = of("every_paycheck") - @JvmField val MONTHLY = BenefitFrequency(JsonField.of("monthly")) + @JvmField val MONTHLY = of("monthly") @JvmStatic fun of(value: String) = BenefitFrequency(JsonField.of(value)) } @@ -69,4 +56,16 @@ private constructor( } fun asString(): String = _value().asStringOrThrow() + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is BenefitFrequency && value == other.value /* spotless:on */ + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() } 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 138757ab..baaacc1b 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 @@ -5,7 +5,6 @@ package com.tryfinch.api.models import com.fasterxml.jackson.annotation.JsonCreator import com.tryfinch.api.core.Enum import com.tryfinch.api.core.JsonField -import com.tryfinch.api.core.JsonValue import com.tryfinch.api.errors.FinchInvalidDataException class BenefitType @@ -16,57 +15,45 @@ private constructor( @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return /* spotless:off */ other is BenefitType && value == other.value /* spotless:on */ - } - - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() - companion object { - @JvmField val _401K = BenefitType(JsonField.of("401k")) + @JvmField val _401K = of("401k") - @JvmField val _401K_ROTH = BenefitType(JsonField.of("401k_roth")) + @JvmField val _401K_ROTH = of("401k_roth") - @JvmField val _401K_LOAN = BenefitType(JsonField.of("401k_loan")) + @JvmField val _401K_LOAN = of("401k_loan") - @JvmField val _403B = BenefitType(JsonField.of("403b")) + @JvmField val _403B = of("403b") - @JvmField val _403B_ROTH = BenefitType(JsonField.of("403b_roth")) + @JvmField val _403B_ROTH = of("403b_roth") - @JvmField val _457 = BenefitType(JsonField.of("457")) + @JvmField val _457 = of("457") - @JvmField val _457_ROTH = BenefitType(JsonField.of("457_roth")) + @JvmField val _457_ROTH = of("457_roth") - @JvmField val S125_MEDICAL = BenefitType(JsonField.of("s125_medical")) + @JvmField val S125_MEDICAL = of("s125_medical") - @JvmField val S125_DENTAL = BenefitType(JsonField.of("s125_dental")) + @JvmField val S125_DENTAL = of("s125_dental") - @JvmField val S125_VISION = BenefitType(JsonField.of("s125_vision")) + @JvmField val S125_VISION = of("s125_vision") - @JvmField val HSA_PRE = BenefitType(JsonField.of("hsa_pre")) + @JvmField val HSA_PRE = of("hsa_pre") - @JvmField val HSA_POST = BenefitType(JsonField.of("hsa_post")) + @JvmField val HSA_POST = of("hsa_post") - @JvmField val FSA_MEDICAL = BenefitType(JsonField.of("fsa_medical")) + @JvmField val FSA_MEDICAL = of("fsa_medical") - @JvmField val FSA_DEPENDENT_CARE = BenefitType(JsonField.of("fsa_dependent_care")) + @JvmField val FSA_DEPENDENT_CARE = of("fsa_dependent_care") - @JvmField val SIMPLE_IRA = BenefitType(JsonField.of("simple_ira")) + @JvmField val SIMPLE_IRA = of("simple_ira") - @JvmField val SIMPLE = BenefitType(JsonField.of("simple")) + @JvmField val SIMPLE = of("simple") - @JvmField val COMMUTER = BenefitType(JsonField.of("commuter")) + @JvmField val COMMUTER = of("commuter") - @JvmField val CUSTOM_POST_TAX = BenefitType(JsonField.of("custom_post_tax")) + @JvmField val CUSTOM_POST_TAX = of("custom_post_tax") - @JvmField val CUSTOM_PRE_TAX = BenefitType(JsonField.of("custom_pre_tax")) + @JvmField val CUSTOM_PRE_TAX = of("custom_pre_tax") @JvmStatic fun of(value: String) = BenefitType(JsonField.of(value)) } @@ -165,4 +152,16 @@ private constructor( } fun asString(): String = _value().asStringOrThrow() + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is BenefitType && value == other.value /* spotless:on */ + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() } 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 6399dc55..03b210ac 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 @@ -435,23 +435,11 @@ private constructor( @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return /* spotless:off */ other is AccountType && value == other.value /* spotless:on */ - } - - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() - companion object { - @JvmField val CHECKING = AccountType(JsonField.of("checking")) + @JvmField val CHECKING = of("checking") - @JvmField val SAVINGS = AccountType(JsonField.of("savings")) + @JvmField val SAVINGS = of("savings") @JvmStatic fun of(value: String) = AccountType(JsonField.of(value)) } @@ -482,6 +470,18 @@ private constructor( } fun asString(): String = _value().asStringOrThrow() + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is AccountType && value == other.value /* spotless:on */ + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() } override fun equals(other: Any?): Boolean { @@ -805,25 +805,13 @@ private constructor( @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return /* spotless:off */ other is Subtype && value == other.value /* spotless:on */ - } - - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() - companion object { - @JvmField val S_CORPORATION = Subtype(JsonField.of("s_corporation")) + @JvmField val S_CORPORATION = of("s_corporation") - @JvmField val C_CORPORATION = Subtype(JsonField.of("c_corporation")) + @JvmField val C_CORPORATION = of("c_corporation") - @JvmField val B_CORPORATION = Subtype(JsonField.of("b_corporation")) + @JvmField val B_CORPORATION = of("b_corporation") @JvmStatic fun of(value: String) = Subtype(JsonField.of(value)) } @@ -858,43 +846,43 @@ private constructor( } fun asString(): String = _value().asStringOrThrow() - } - - class Type - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { - - @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value override fun equals(other: Any?): Boolean { if (this === other) { return true } - return /* spotless:off */ other is Type && value == other.value /* spotless:on */ + return /* spotless:off */ other is Subtype && 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 { + + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { - @JvmField val LLC = Type(JsonField.of("llc")) + @JvmField val LLC = of("llc") - @JvmField val LP = Type(JsonField.of("lp")) + @JvmField val LP = of("lp") - @JvmField val CORPORATION = Type(JsonField.of("corporation")) + @JvmField val CORPORATION = of("corporation") - @JvmField val SOLE_PROPRIETOR = Type(JsonField.of("sole_proprietor")) + @JvmField val SOLE_PROPRIETOR = of("sole_proprietor") - @JvmField val NON_PROFIT = Type(JsonField.of("non_profit")) + @JvmField val NON_PROFIT = of("non_profit") - @JvmField val PARTNERSHIP = Type(JsonField.of("partnership")) + @JvmField val PARTNERSHIP = of("partnership") - @JvmField val COOPERATIVE = Type(JsonField.of("cooperative")) + @JvmField val COOPERATIVE = of("cooperative") @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } @@ -945,6 +933,18 @@ private constructor( } 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 { 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 9cf78267..513dfd54 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 @@ -271,21 +271,9 @@ private constructor( @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return /* spotless:off */ other is EventType && value == other.value /* spotless:on */ - } - - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() - companion object { - @JvmField val COMPANY_UPDATED = EventType(JsonField.of("company.updated")) + @JvmField val COMPANY_UPDATED = of("company.updated") @JvmStatic fun of(value: String) = EventType(JsonField.of(value)) } @@ -312,6 +300,18 @@ private constructor( } fun asString(): String = _value().asStringOrThrow() + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is EventType && value == other.value /* spotless:on */ + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() } override fun equals(other: Any?): Boolean { 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 7cc46c5e..0883a88f 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 @@ -418,23 +418,11 @@ private constructor( @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return /* spotless:off */ other is AccountType && value == other.value /* spotless:on */ - } - - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() - companion object { - @JvmField val CHECKING = AccountType(JsonField.of("checking")) + @JvmField val CHECKING = of("checking") - @JvmField val SAVINGS = AccountType(JsonField.of("savings")) + @JvmField val SAVINGS = of("savings") @JvmStatic fun of(value: String) = AccountType(JsonField.of(value)) } @@ -465,6 +453,18 @@ private constructor( } fun asString(): String = _value().asStringOrThrow() + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is AccountType && value == other.value /* spotless:on */ + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() } override fun equals(other: Any?): Boolean { @@ -788,25 +788,13 @@ private constructor( @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return /* spotless:off */ other is Subtype && value == other.value /* spotless:on */ - } - - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() - companion object { - @JvmField val S_CORPORATION = Subtype(JsonField.of("s_corporation")) + @JvmField val S_CORPORATION = of("s_corporation") - @JvmField val C_CORPORATION = Subtype(JsonField.of("c_corporation")) + @JvmField val C_CORPORATION = of("c_corporation") - @JvmField val B_CORPORATION = Subtype(JsonField.of("b_corporation")) + @JvmField val B_CORPORATION = of("b_corporation") @JvmStatic fun of(value: String) = Subtype(JsonField.of(value)) } @@ -841,43 +829,43 @@ private constructor( } fun asString(): String = _value().asStringOrThrow() - } - - class Type - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { - - @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value override fun equals(other: Any?): Boolean { if (this === other) { return true } - return /* spotless:off */ other is Type && value == other.value /* spotless:on */ + return /* spotless:off */ other is Subtype && 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 { + + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { - @JvmField val LLC = Type(JsonField.of("llc")) + @JvmField val LLC = of("llc") - @JvmField val LP = Type(JsonField.of("lp")) + @JvmField val LP = of("lp") - @JvmField val CORPORATION = Type(JsonField.of("corporation")) + @JvmField val CORPORATION = of("corporation") - @JvmField val SOLE_PROPRIETOR = Type(JsonField.of("sole_proprietor")) + @JvmField val SOLE_PROPRIETOR = of("sole_proprietor") - @JvmField val NON_PROFIT = Type(JsonField.of("non_profit")) + @JvmField val NON_PROFIT = of("non_profit") - @JvmField val PARTNERSHIP = Type(JsonField.of("partnership")) + @JvmField val PARTNERSHIP = of("partnership") - @JvmField val COOPERATIVE = Type(JsonField.of("cooperative")) + @JvmField val COOPERATIVE = of("cooperative") @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } @@ -928,6 +916,18 @@ private constructor( } 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 { 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 f11e6122..7b723f01 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 @@ -16,7 +16,6 @@ import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams import com.tryfinch.api.core.toImmutable import com.tryfinch.api.errors.FinchInvalidDataException -import com.tryfinch.api.models.* import java.util.Objects import java.util.Optional @@ -448,35 +447,23 @@ constructor( @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return /* spotless:off */ other is ConnectProducts && value == other.value /* spotless:on */ - } - - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() - companion object { - @JvmField val COMPANY = ConnectProducts(JsonField.of("company")) + @JvmField val COMPANY = of("company") - @JvmField val DIRECTORY = ConnectProducts(JsonField.of("directory")) + @JvmField val DIRECTORY = of("directory") - @JvmField val INDIVIDUAL = ConnectProducts(JsonField.of("individual")) + @JvmField val INDIVIDUAL = of("individual") - @JvmField val EMPLOYMENT = ConnectProducts(JsonField.of("employment")) + @JvmField val EMPLOYMENT = of("employment") - @JvmField val PAYMENT = ConnectProducts(JsonField.of("payment")) + @JvmField val PAYMENT = of("payment") - @JvmField val PAY_STATEMENT = ConnectProducts(JsonField.of("pay_statement")) + @JvmField val PAY_STATEMENT = of("pay_statement") - @JvmField val BENEFITS = ConnectProducts(JsonField.of("benefits")) + @JvmField val BENEFITS = of("benefits") - @JvmField val SSN = ConnectProducts(JsonField.of("ssn")) + @JvmField val SSN = of("ssn") @JvmStatic fun of(value: String) = ConnectProducts(JsonField.of(value)) } @@ -531,6 +518,18 @@ constructor( } fun asString(): String = _value().asStringOrThrow() + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is ConnectProducts && value == other.value /* spotless:on */ + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() } @JsonDeserialize(builder = Integration.Builder::class) @@ -606,27 +605,15 @@ constructor( @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return /* spotless:off */ other is AuthMethod && value == other.value /* spotless:on */ - } - - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() - companion object { - @JvmField val ASSISTED = AuthMethod(JsonField.of("assisted")) + @JvmField val ASSISTED = of("assisted") - @JvmField val CREDENTIAL = AuthMethod(JsonField.of("credential")) + @JvmField val CREDENTIAL = of("credential") - @JvmField val OAUTH = AuthMethod(JsonField.of("oauth")) + @JvmField val OAUTH = of("oauth") - @JvmField val API_TOKEN = AuthMethod(JsonField.of("api_token")) + @JvmField val API_TOKEN = of("api_token") @JvmStatic fun of(value: String) = AuthMethod(JsonField.of(value)) } @@ -665,6 +652,18 @@ constructor( } fun asString(): String = _value().asStringOrThrow() + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is AuthMethod && value == other.value /* spotless:on */ + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() } override fun equals(other: Any?): Boolean { @@ -693,23 +692,11 @@ constructor( @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return /* spotless:off */ other is Sandbox && value == other.value /* spotless:on */ - } - - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() - companion object { - @JvmField val FINCH = Sandbox(JsonField.of("finch")) + @JvmField val FINCH = of("finch") - @JvmField val PROVIDER = Sandbox(JsonField.of("provider")) + @JvmField val PROVIDER = of("provider") @JvmStatic fun of(value: String) = Sandbox(JsonField.of(value)) } @@ -740,6 +727,18 @@ constructor( } fun asString(): String = _value().asStringOrThrow() + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Sandbox && value == other.value /* spotless:on */ + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() } override fun equals(other: Any?): Boolean { 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 cc61aad6..60a3ba1a 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 @@ -16,7 +16,6 @@ import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams import com.tryfinch.api.core.toImmutable import com.tryfinch.api.errors.FinchInvalidDataException -import com.tryfinch.api.models.* import java.util.Objects import java.util.Optional @@ -372,35 +371,23 @@ constructor( @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return /* spotless:off */ other is ConnectProducts && value == other.value /* spotless:on */ - } - - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() - companion object { - @JvmField val COMPANY = ConnectProducts(JsonField.of("company")) + @JvmField val COMPANY = of("company") - @JvmField val DIRECTORY = ConnectProducts(JsonField.of("directory")) + @JvmField val DIRECTORY = of("directory") - @JvmField val INDIVIDUAL = ConnectProducts(JsonField.of("individual")) + @JvmField val INDIVIDUAL = of("individual") - @JvmField val EMPLOYMENT = ConnectProducts(JsonField.of("employment")) + @JvmField val EMPLOYMENT = of("employment") - @JvmField val PAYMENT = ConnectProducts(JsonField.of("payment")) + @JvmField val PAYMENT = of("payment") - @JvmField val PAY_STATEMENT = ConnectProducts(JsonField.of("pay_statement")) + @JvmField val PAY_STATEMENT = of("pay_statement") - @JvmField val BENEFITS = ConnectProducts(JsonField.of("benefits")) + @JvmField val BENEFITS = of("benefits") - @JvmField val SSN = ConnectProducts(JsonField.of("ssn")) + @JvmField val SSN = of("ssn") @JvmStatic fun of(value: String) = ConnectProducts(JsonField.of(value)) } @@ -455,6 +442,18 @@ constructor( } fun asString(): String = _value().asStringOrThrow() + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is ConnectProducts && value == other.value /* spotless:on */ + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() } override fun equals(other: Any?): Boolean { 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 22109b19..0cf71949 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 @@ -16,6 +16,7 @@ import com.tryfinch.api.core.NoAutoDetect import com.tryfinch.api.core.toImmutable import com.tryfinch.api.errors.FinchInvalidDataException import java.util.Objects +import java.util.Optional @JsonDeserialize(builder = ConnectionCreateResponse.Builder::class) @NoAutoDetect @@ -28,6 +29,7 @@ private constructor( private val authenticationType: JsonField, private val products: JsonField>, private val accessToken: JsonField, + private val tokenType: JsonField, private val additionalProperties: Map, ) { @@ -52,6 +54,8 @@ private constructor( fun accessToken(): String = accessToken.getRequired("access_token") + fun tokenType(): Optional = Optional.ofNullable(tokenType.getNullable("token_type")) + /** The ID of the new connection */ @JsonProperty("connection_id") @ExcludeMissing fun _connectionId() = connectionId @@ -72,6 +76,8 @@ private constructor( @JsonProperty("access_token") @ExcludeMissing fun _accessToken() = accessToken + @JsonProperty("token_type") @ExcludeMissing fun _tokenType() = tokenType + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -85,6 +91,7 @@ private constructor( authenticationType() products() accessToken() + tokenType() validated = true } } @@ -105,6 +112,7 @@ private constructor( private var authenticationType: JsonField = JsonMissing.of() private var products: JsonField> = JsonMissing.of() private var accessToken: JsonField = JsonMissing.of() + private var tokenType: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -116,6 +124,7 @@ private constructor( this.authenticationType = connectionCreateResponse.authenticationType this.products = connectionCreateResponse.products this.accessToken = connectionCreateResponse.accessToken + this.tokenType = connectionCreateResponse.tokenType additionalProperties(connectionCreateResponse.additionalProperties) } @@ -174,6 +183,12 @@ private constructor( @ExcludeMissing fun accessToken(accessToken: JsonField) = apply { this.accessToken = accessToken } + fun tokenType(tokenType: String) = tokenType(JsonField.of(tokenType)) + + @JsonProperty("token_type") + @ExcludeMissing + fun tokenType(tokenType: JsonField) = apply { this.tokenType = tokenType } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() this.additionalProperties.putAll(additionalProperties) @@ -197,6 +212,7 @@ private constructor( authenticationType, products.map { it.toImmutable() }, accessToken, + tokenType, additionalProperties.toImmutable(), ) } @@ -209,27 +225,15 @@ private constructor( @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return /* spotless:off */ other is AuthenticationType && value == other.value /* spotless:on */ - } - - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() - companion object { - @JvmField val CREDENTIAL = AuthenticationType(JsonField.of("credential")) + @JvmField val CREDENTIAL = of("credential") - @JvmField val API_TOKEN = AuthenticationType(JsonField.of("api_token")) + @JvmField val API_TOKEN = of("api_token") - @JvmField val OAUTH = AuthenticationType(JsonField.of("oauth")) + @JvmField val OAUTH = of("oauth") - @JvmField val ASSISTED = AuthenticationType(JsonField.of("assisted")) + @JvmField val ASSISTED = of("assisted") @JvmStatic fun of(value: String) = AuthenticationType(JsonField.of(value)) } @@ -268,6 +272,18 @@ private constructor( } fun asString(): String = _value().asStringOrThrow() + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is AuthenticationType && value == other.value /* spotless:on */ + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() } override fun equals(other: Any?): Boolean { @@ -275,15 +291,15 @@ private constructor( return true } - return /* spotless:off */ other is ConnectionCreateResponse && connectionId == other.connectionId && companyId == other.companyId && providerId == other.providerId && accountId == other.accountId && authenticationType == other.authenticationType && products == other.products && accessToken == other.accessToken && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is ConnectionCreateResponse && connectionId == other.connectionId && companyId == other.companyId && providerId == other.providerId && accountId == other.accountId && authenticationType == other.authenticationType && products == other.products && accessToken == other.accessToken && tokenType == other.tokenType && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(connectionId, companyId, providerId, accountId, authenticationType, products, accessToken, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(connectionId, companyId, providerId, accountId, authenticationType, products, accessToken, tokenType, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "ConnectionCreateResponse{connectionId=$connectionId, companyId=$companyId, providerId=$providerId, accountId=$accountId, authenticationType=$authenticationType, products=$products, accessToken=$accessToken, additionalProperties=$additionalProperties}" + "ConnectionCreateResponse{connectionId=$connectionId, companyId=$companyId, providerId=$providerId, accountId=$accountId, authenticationType=$authenticationType, products=$products, accessToken=$accessToken, tokenType=$tokenType, additionalProperties=$additionalProperties}" } 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 253106a4..e926f102 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 @@ -5,7 +5,6 @@ package com.tryfinch.api.models import com.fasterxml.jackson.annotation.JsonCreator import com.tryfinch.api.core.Enum import com.tryfinch.api.core.JsonField -import com.tryfinch.api.core.JsonValue import com.tryfinch.api.errors.FinchInvalidDataException class ConnectionStatusType @@ -16,32 +15,19 @@ private constructor( @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return /* spotless:off */ other is ConnectionStatusType && value == other.value /* spotless:on */ - } - - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() - companion object { - @JvmField val PENDING = ConnectionStatusType(JsonField.of("pending")) + @JvmField val PENDING = of("pending") - @JvmField val PROCESSING = ConnectionStatusType(JsonField.of("processing")) + @JvmField val PROCESSING = of("processing") - @JvmField val CONNECTED = ConnectionStatusType(JsonField.of("connected")) + @JvmField val CONNECTED = of("connected") - @JvmField - val ERROR_NO_ACCOUNT_SETUP = ConnectionStatusType(JsonField.of("error_no_account_setup")) + @JvmField val ERROR_NO_ACCOUNT_SETUP = of("error_no_account_setup") - @JvmField val ERROR_PERMISSIONS = ConnectionStatusType(JsonField.of("error_permissions")) + @JvmField val ERROR_PERMISSIONS = of("error_permissions") - @JvmField val REAUTH = ConnectionStatusType(JsonField.of("reauth")) + @JvmField val REAUTH = of("reauth") @JvmStatic fun of(value: String) = ConnectionStatusType(JsonField.of(value)) } @@ -88,4 +74,16 @@ private constructor( } fun asString(): String = _value().asStringOrThrow() + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is ConnectionStatusType && value == other.value /* spotless:on */ + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() } 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 afefcfed..e9d348c3 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 @@ -23,6 +23,7 @@ import java.util.Optional class CreateAccessTokenResponse private constructor( private val accessToken: JsonField, + private val tokenType: JsonField, private val connectionId: JsonField, private val customerId: JsonField, private val accountId: JsonField, @@ -39,6 +40,9 @@ private constructor( /** The access token for the connection. */ fun accessToken(): String = accessToken.getRequired("access_token") + /** The RFC 8693 token type (Finch uses `bearer` tokens) */ + fun tokenType(): Optional = Optional.ofNullable(tokenType.getNullable("token_type")) + /** The Finch UUID of the connection associated with the `access_token`. */ fun connectionId(): String = connectionId.getRequired("connection_id") @@ -73,6 +77,9 @@ private constructor( /** The access token for the connection. */ @JsonProperty("access_token") @ExcludeMissing fun _accessToken() = accessToken + /** The RFC 8693 token type (Finch uses `bearer` tokens) */ + @JsonProperty("token_type") @ExcludeMissing fun _tokenType() = tokenType + /** The Finch UUID of the connection associated with the `access_token`. */ @JsonProperty("connection_id") @ExcludeMissing fun _connectionId() = connectionId @@ -111,6 +118,7 @@ private constructor( fun validate(): CreateAccessTokenResponse = apply { if (!validated) { accessToken() + tokenType() connectionId() customerId() accountId() @@ -133,6 +141,7 @@ private constructor( class Builder { private var accessToken: JsonField = JsonMissing.of() + private var tokenType: JsonField = JsonMissing.of() private var connectionId: JsonField = JsonMissing.of() private var customerId: JsonField = JsonMissing.of() private var accountId: JsonField = JsonMissing.of() @@ -146,6 +155,7 @@ private constructor( @JvmSynthetic internal fun from(createAccessTokenResponse: CreateAccessTokenResponse) = apply { this.accessToken = createAccessTokenResponse.accessToken + this.tokenType = createAccessTokenResponse.tokenType this.connectionId = createAccessTokenResponse.connectionId this.customerId = createAccessTokenResponse.customerId this.accountId = createAccessTokenResponse.accountId @@ -165,6 +175,14 @@ private constructor( @ExcludeMissing fun accessToken(accessToken: JsonField) = apply { this.accessToken = accessToken } + /** The RFC 8693 token type (Finch uses `bearer` tokens) */ + fun tokenType(tokenType: String) = tokenType(JsonField.of(tokenType)) + + /** The RFC 8693 token type (Finch uses `bearer` tokens) */ + @JsonProperty("token_type") + @ExcludeMissing + fun tokenType(tokenType: JsonField) = apply { this.tokenType = tokenType } + /** The Finch UUID of the connection associated with the `access_token`. */ fun connectionId(connectionId: String) = connectionId(JsonField.of(connectionId)) @@ -273,6 +291,7 @@ private constructor( fun build(): CreateAccessTokenResponse = CreateAccessTokenResponse( accessToken, + tokenType, connectionId, customerId, accountId, @@ -293,25 +312,13 @@ private constructor( @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return /* spotless:off */ other is ClientType && value == other.value /* spotless:on */ - } - - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() - companion object { - @JvmField val PRODUCTION = ClientType(JsonField.of("production")) + @JvmField val PRODUCTION = of("production") - @JvmField val DEVELOPMENT = ClientType(JsonField.of("development")) + @JvmField val DEVELOPMENT = of("development") - @JvmField val SANDBOX = ClientType(JsonField.of("sandbox")) + @JvmField val SANDBOX = of("sandbox") @JvmStatic fun of(value: String) = ClientType(JsonField.of(value)) } @@ -346,33 +353,33 @@ private constructor( } fun asString(): String = _value().asStringOrThrow() - } - - class ConnectionType - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { - - @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value override fun equals(other: Any?): Boolean { if (this === other) { return true } - return /* spotless:off */ other is ConnectionType && value == other.value /* spotless:on */ + return /* spotless:off */ other is ClientType && value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() override fun toString() = value.toString() + } + + class ConnectionType + @JsonCreator + private constructor( + private val value: JsonField, + ) : Enum { + + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { - @JvmField val PROVIDER = ConnectionType(JsonField.of("provider")) + @JvmField val PROVIDER = of("provider") - @JvmField val FINCH = ConnectionType(JsonField.of("finch")) + @JvmField val FINCH = of("finch") @JvmStatic fun of(value: String) = ConnectionType(JsonField.of(value)) } @@ -403,6 +410,18 @@ private constructor( } fun asString(): String = _value().asStringOrThrow() + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is ConnectionType && value == other.value /* spotless:on */ + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() } override fun equals(other: Any?): Boolean { @@ -410,15 +429,15 @@ private constructor( return true } - return /* spotless:off */ other is CreateAccessTokenResponse && accessToken == other.accessToken && connectionId == other.connectionId && customerId == other.customerId && accountId == other.accountId && clientType == other.clientType && companyId == other.companyId && connectionType == other.connectionType && products == other.products && providerId == other.providerId && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is CreateAccessTokenResponse && accessToken == other.accessToken && tokenType == other.tokenType && connectionId == other.connectionId && customerId == other.customerId && accountId == other.accountId && clientType == other.clientType && companyId == other.companyId && connectionType == other.connectionType && products == other.products && providerId == other.providerId && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(accessToken, connectionId, customerId, accountId, clientType, companyId, connectionType, products, providerId, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(accessToken, tokenType, connectionId, customerId, accountId, clientType, companyId, connectionType, products, providerId, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "CreateAccessTokenResponse{accessToken=$accessToken, connectionId=$connectionId, customerId=$customerId, accountId=$accountId, clientType=$clientType, companyId=$companyId, connectionType=$connectionType, products=$products, providerId=$providerId, additionalProperties=$additionalProperties}" + "CreateAccessTokenResponse{accessToken=$accessToken, tokenType=$tokenType, connectionId=$connectionId, customerId=$customerId, accountId=$accountId, clientType=$clientType, companyId=$companyId, connectionType=$connectionType, products=$products, providerId=$providerId, additionalProperties=$additionalProperties}" } diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/DirectoryEvent.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/DirectoryEvent.kt index ec17e3fc..910a494f 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 @@ -293,25 +293,13 @@ private constructor( @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return /* spotless:off */ other is EventType && value == other.value /* spotless:on */ - } - - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() - companion object { - @JvmField val DIRECTORY_CREATED = EventType(JsonField.of("directory.created")) + @JvmField val DIRECTORY_CREATED = of("directory.created") - @JvmField val DIRECTORY_UPDATED = EventType(JsonField.of("directory.updated")) + @JvmField val DIRECTORY_UPDATED = of("directory.updated") - @JvmField val DIRECTORY_DELETED = EventType(JsonField.of("directory.deleted")) + @JvmField val DIRECTORY_DELETED = of("directory.deleted") @JvmStatic fun of(value: String) = EventType(JsonField.of(value)) } @@ -346,6 +334,18 @@ private constructor( } fun asString(): String = _value().asStringOrThrow() + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is EventType && value == other.value /* spotless:on */ + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() } override fun equals(other: Any?): Boolean { diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/EmploymentData.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/EmploymentData.kt index dda7c866..13b45119 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 @@ -34,6 +34,7 @@ private constructor( private val endDate: JsonField, private val latestRehireDate: JsonField, private val isActive: JsonField, + private val employmentStatus: JsonField, private val classCode: JsonField, private val location: JsonField, private val income: JsonField, @@ -82,6 +83,13 @@ private constructor( /** `true` if the individual an an active employee or contractor at the company. */ fun isActive(): Optional = Optional.ofNullable(isActive.getNullable("is_active")) + /** + * The detailed employment status of the individual. Available options: `active`, `deceased`, + * `leave`, `onboarding`, `prehire`, `retired`, `terminated`. + */ + fun employmentStatus(): Optional = + Optional.ofNullable(employmentStatus.getNullable("employment_status")) + /** Worker's compensation classification code for this employee */ fun classCode(): Optional = Optional.ofNullable(classCode.getNullable("class_code")) @@ -144,6 +152,12 @@ private constructor( /** `true` if the individual an an active employee or contractor at the company. */ @JsonProperty("is_active") @ExcludeMissing fun _isActive() = isActive + /** + * The detailed employment status of the individual. Available options: `active`, `deceased`, + * `leave`, `onboarding`, `prehire`, `retired`, `terminated`. + */ + @JsonProperty("employment_status") @ExcludeMissing fun _employmentStatus() = employmentStatus + /** Worker's compensation classification code for this employee */ @JsonProperty("class_code") @ExcludeMissing fun _classCode() = classCode @@ -189,6 +203,7 @@ private constructor( endDate() latestRehireDate() isActive() + employmentStatus() classCode() location().map { it.validate() } income().map { it.validate() } @@ -221,6 +236,7 @@ private constructor( private var endDate: JsonField = JsonMissing.of() private var latestRehireDate: JsonField = JsonMissing.of() private var isActive: JsonField = JsonMissing.of() + private var employmentStatus: JsonField = JsonMissing.of() private var classCode: JsonField = JsonMissing.of() private var location: JsonField = JsonMissing.of() private var income: JsonField = JsonMissing.of() @@ -244,6 +260,7 @@ private constructor( this.endDate = employmentData.endDate this.latestRehireDate = employmentData.latestRehireDate this.isActive = employmentData.isActive + this.employmentStatus = employmentData.employmentStatus this.classCode = employmentData.classCode this.location = employmentData.location this.income = employmentData.income @@ -345,6 +362,23 @@ private constructor( @ExcludeMissing fun isActive(isActive: JsonField) = apply { this.isActive = isActive } + /** + * The detailed employment status of the individual. Available options: `active`, + * `deceased`, `leave`, `onboarding`, `prehire`, `retired`, `terminated`. + */ + fun employmentStatus(employmentStatus: EmploymentStatus) = + employmentStatus(JsonField.of(employmentStatus)) + + /** + * The detailed employment status of the individual. Available options: `active`, + * `deceased`, `leave`, `onboarding`, `prehire`, `retired`, `terminated`. + */ + @JsonProperty("employment_status") + @ExcludeMissing + fun employmentStatus(employmentStatus: JsonField) = apply { + this.employmentStatus = employmentStatus + } + /** Worker's compensation classification code for this employee */ fun classCode(classCode: String) = classCode(JsonField.of(classCode)) @@ -445,6 +479,7 @@ private constructor( endDate, latestRehireDate, isActive, + employmentStatus, classCode, location, income, @@ -757,31 +792,19 @@ private constructor( @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return /* spotless:off */ other is Subtype && value == other.value /* spotless:on */ - } - - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() - companion object { - @JvmField val FULL_TIME = Subtype(JsonField.of("full_time")) + @JvmField val FULL_TIME = of("full_time") - @JvmField val INTERN = Subtype(JsonField.of("intern")) + @JvmField val INTERN = of("intern") - @JvmField val PART_TIME = Subtype(JsonField.of("part_time")) + @JvmField val PART_TIME = of("part_time") - @JvmField val TEMP = Subtype(JsonField.of("temp")) + @JvmField val TEMP = of("temp") - @JvmField val SEASONAL = Subtype(JsonField.of("seasonal")) + @JvmField val SEASONAL = of("seasonal") - @JvmField val INDIVIDUAL_CONTRACTOR = Subtype(JsonField.of("individual_contractor")) + @JvmField val INDIVIDUAL_CONTRACTOR = of("individual_contractor") @JvmStatic fun of(value: String) = Subtype(JsonField.of(value)) } @@ -828,33 +851,33 @@ private constructor( } fun asString(): String = _value().asStringOrThrow() - } - - class Type - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { - - @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value override fun equals(other: Any?): Boolean { if (this === other) { return true } - return /* spotless:off */ other is Type && value == other.value /* spotless:on */ + return /* spotless:off */ other is Subtype && 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 { + + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { - @JvmField val EMPLOYEE = Type(JsonField.of("employee")) + @JvmField val EMPLOYEE = of("employee") - @JvmField val CONTRACTOR = Type(JsonField.of("contractor")) + @JvmField val CONTRACTOR = of("contractor") @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } @@ -885,6 +908,18 @@ private constructor( } 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 { @@ -905,6 +940,93 @@ private constructor( "Employment{type=$type, subtype=$subtype, additionalProperties=$additionalProperties}" } + class EmploymentStatus + @JsonCreator + private constructor( + private val value: JsonField, + ) : Enum { + + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + @JvmField val ACTIVE = of("active") + + @JvmField val DECEASED = of("deceased") + + @JvmField val LEAVE = of("leave") + + @JvmField val ONBOARDING = of("onboarding") + + @JvmField val PREHIRE = of("prehire") + + @JvmField val RETIRED = of("retired") + + @JvmField val TERMINATED = of("terminated") + + @JvmStatic fun of(value: String) = EmploymentStatus(JsonField.of(value)) + } + + enum class Known { + ACTIVE, + DECEASED, + LEAVE, + ONBOARDING, + PREHIRE, + RETIRED, + TERMINATED, + } + + enum class Value { + ACTIVE, + DECEASED, + LEAVE, + ONBOARDING, + PREHIRE, + RETIRED, + TERMINATED, + _UNKNOWN, + } + + fun value(): Value = + when (this) { + ACTIVE -> Value.ACTIVE + DECEASED -> Value.DECEASED + LEAVE -> Value.LEAVE + ONBOARDING -> Value.ONBOARDING + PREHIRE -> Value.PREHIRE + RETIRED -> Value.RETIRED + TERMINATED -> Value.TERMINATED + else -> Value._UNKNOWN + } + + fun known(): Known = + when (this) { + ACTIVE -> Known.ACTIVE + DECEASED -> Known.DECEASED + LEAVE -> Known.LEAVE + ONBOARDING -> Known.ONBOARDING + PREHIRE -> Known.PREHIRE + RETIRED -> Known.RETIRED + TERMINATED -> Known.TERMINATED + else -> throw FinchInvalidDataException("Unknown EmploymentStatus: $value") + } + + fun asString(): String = _value().asStringOrThrow() + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is EmploymentStatus && value == other.value /* spotless:on */ + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + /** The manager object representing the manager of the individual within the org. */ @JsonDeserialize(builder = Manager.Builder::class) @NoAutoDetect @@ -998,15 +1120,15 @@ private constructor( return true } - return /* spotless:off */ other is EmploymentData && id == other.id && firstName == other.firstName && middleName == other.middleName && lastName == other.lastName && title == other.title && manager == other.manager && department == other.department && employment == other.employment && startDate == other.startDate && endDate == other.endDate && latestRehireDate == other.latestRehireDate && isActive == other.isActive && classCode == other.classCode && location == other.location && income == other.income && incomeHistory == other.incomeHistory && customFields == other.customFields && sourceId == other.sourceId && workId == other.workId && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is EmploymentData && id == other.id && firstName == other.firstName && middleName == other.middleName && lastName == other.lastName && title == other.title && manager == other.manager && department == other.department && employment == other.employment && startDate == other.startDate && endDate == other.endDate && latestRehireDate == other.latestRehireDate && isActive == other.isActive && employmentStatus == other.employmentStatus && classCode == other.classCode && location == other.location && income == other.income && incomeHistory == other.incomeHistory && customFields == other.customFields && sourceId == other.sourceId && workId == other.workId && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(id, firstName, middleName, lastName, title, manager, department, employment, startDate, endDate, latestRehireDate, isActive, classCode, location, income, incomeHistory, customFields, sourceId, workId, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, firstName, middleName, lastName, title, manager, department, employment, startDate, endDate, latestRehireDate, isActive, employmentStatus, classCode, location, income, incomeHistory, customFields, sourceId, workId, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "EmploymentData{id=$id, firstName=$firstName, middleName=$middleName, lastName=$lastName, title=$title, manager=$manager, department=$department, employment=$employment, startDate=$startDate, endDate=$endDate, latestRehireDate=$latestRehireDate, isActive=$isActive, classCode=$classCode, location=$location, income=$income, incomeHistory=$incomeHistory, customFields=$customFields, sourceId=$sourceId, workId=$workId, additionalProperties=$additionalProperties}" + "EmploymentData{id=$id, firstName=$firstName, middleName=$middleName, lastName=$lastName, title=$title, manager=$manager, department=$department, employment=$employment, startDate=$startDate, endDate=$endDate, latestRehireDate=$latestRehireDate, isActive=$isActive, employmentStatus=$employmentStatus, classCode=$classCode, location=$location, income=$income, incomeHistory=$incomeHistory, customFields=$customFields, sourceId=$sourceId, workId=$workId, additionalProperties=$additionalProperties}" } 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 2bab196a..b81081b9 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 @@ -293,25 +293,13 @@ private constructor( @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return /* spotless:off */ other is EventType && value == other.value /* spotless:on */ - } - - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() - companion object { - @JvmField val EMPLOYMENT_CREATED = EventType(JsonField.of("employment.created")) + @JvmField val EMPLOYMENT_CREATED = of("employment.created") - @JvmField val EMPLOYMENT_UPDATED = EventType(JsonField.of("employment.updated")) + @JvmField val EMPLOYMENT_UPDATED = of("employment.updated") - @JvmField val EMPLOYMENT_DELETED = EventType(JsonField.of("employment.deleted")) + @JvmField val EMPLOYMENT_DELETED = of("employment.deleted") @JvmStatic fun of(value: String) = EventType(JsonField.of(value)) } @@ -346,6 +334,18 @@ private constructor( } fun asString(): String = _value().asStringOrThrow() + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is EventType && value == other.value /* spotless:on */ + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() } override fun equals(other: Any?): Boolean { 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 9a68fa76..35be88e0 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 @@ -33,6 +33,7 @@ private constructor( private val endDate: JsonField, private val latestRehireDate: JsonField, private val isActive: JsonField, + private val employmentStatus: JsonField, private val classCode: JsonField, private val location: JsonField, private val income: JsonField, @@ -78,6 +79,10 @@ private constructor( /** `true` if the individual an an active employee or contractor at the company. */ fun isActive(): Optional = Optional.ofNullable(isActive.getNullable("is_active")) + /** The detailed employment status of the individual. */ + fun employmentStatus(): Optional = + Optional.ofNullable(employmentStatus.getNullable("employment_status")) + /** Worker's compensation classification code for this employee */ fun classCode(): Optional = Optional.ofNullable(classCode.getNullable("class_code")) @@ -137,6 +142,9 @@ private constructor( /** `true` if the individual an an active employee or contractor at the company. */ @JsonProperty("is_active") @ExcludeMissing fun _isActive() = isActive + /** The detailed employment status of the individual. */ + @JsonProperty("employment_status") @ExcludeMissing fun _employmentStatus() = employmentStatus + /** Worker's compensation classification code for this employee */ @JsonProperty("class_code") @ExcludeMissing fun _classCode() = classCode @@ -181,6 +189,7 @@ private constructor( endDate() latestRehireDate() isActive() + employmentStatus() classCode() location().map { it.validate() } income().map { it.validate() } @@ -212,6 +221,7 @@ private constructor( private var endDate: JsonField = JsonMissing.of() private var latestRehireDate: JsonField = JsonMissing.of() private var isActive: JsonField = JsonMissing.of() + private var employmentStatus: JsonField = JsonMissing.of() private var classCode: JsonField = JsonMissing.of() private var location: JsonField = JsonMissing.of() private var income: JsonField = JsonMissing.of() @@ -234,6 +244,7 @@ private constructor( this.endDate = employmentUpdateResponse.endDate this.latestRehireDate = employmentUpdateResponse.latestRehireDate this.isActive = employmentUpdateResponse.isActive + this.employmentStatus = employmentUpdateResponse.employmentStatus this.classCode = employmentUpdateResponse.classCode this.location = employmentUpdateResponse.location this.income = employmentUpdateResponse.income @@ -329,6 +340,17 @@ private constructor( @ExcludeMissing fun isActive(isActive: JsonField) = apply { this.isActive = isActive } + /** The detailed employment status of the individual. */ + fun employmentStatus(employmentStatus: EmploymentStatus) = + employmentStatus(JsonField.of(employmentStatus)) + + /** The detailed employment status of the individual. */ + @JsonProperty("employment_status") + @ExcludeMissing + fun employmentStatus(employmentStatus: JsonField) = apply { + this.employmentStatus = employmentStatus + } + /** Worker's compensation classification code for this employee */ fun classCode(classCode: String) = classCode(JsonField.of(classCode)) @@ -426,6 +448,7 @@ private constructor( endDate, latestRehireDate, isActive, + employmentStatus, classCode, location, income, @@ -738,31 +761,19 @@ private constructor( @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return /* spotless:off */ other is Subtype && value == other.value /* spotless:on */ - } - - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() - companion object { - @JvmField val FULL_TIME = Subtype(JsonField.of("full_time")) + @JvmField val FULL_TIME = of("full_time") - @JvmField val INTERN = Subtype(JsonField.of("intern")) + @JvmField val INTERN = of("intern") - @JvmField val PART_TIME = Subtype(JsonField.of("part_time")) + @JvmField val PART_TIME = of("part_time") - @JvmField val TEMP = Subtype(JsonField.of("temp")) + @JvmField val TEMP = of("temp") - @JvmField val SEASONAL = Subtype(JsonField.of("seasonal")) + @JvmField val SEASONAL = of("seasonal") - @JvmField val INDIVIDUAL_CONTRACTOR = Subtype(JsonField.of("individual_contractor")) + @JvmField val INDIVIDUAL_CONTRACTOR = of("individual_contractor") @JvmStatic fun of(value: String) = Subtype(JsonField.of(value)) } @@ -809,33 +820,33 @@ private constructor( } fun asString(): String = _value().asStringOrThrow() - } - - class Type - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { - - @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value override fun equals(other: Any?): Boolean { if (this === other) { return true } - return /* spotless:off */ other is Type && value == other.value /* spotless:on */ + return /* spotless:off */ other is Subtype && 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 { + + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { - @JvmField val EMPLOYEE = Type(JsonField.of("employee")) + @JvmField val EMPLOYEE = of("employee") - @JvmField val CONTRACTOR = Type(JsonField.of("contractor")) + @JvmField val CONTRACTOR = of("contractor") @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } @@ -866,6 +877,18 @@ private constructor( } 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 { @@ -886,6 +909,93 @@ private constructor( "Employment{type=$type, subtype=$subtype, additionalProperties=$additionalProperties}" } + class EmploymentStatus + @JsonCreator + private constructor( + private val value: JsonField, + ) : Enum { + + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + @JvmField val ACTIVE = of("active") + + @JvmField val DECEASED = of("deceased") + + @JvmField val LEAVE = of("leave") + + @JvmField val ONBOARDING = of("onboarding") + + @JvmField val PREHIRE = of("prehire") + + @JvmField val RETIRED = of("retired") + + @JvmField val TERMINATED = of("terminated") + + @JvmStatic fun of(value: String) = EmploymentStatus(JsonField.of(value)) + } + + enum class Known { + ACTIVE, + DECEASED, + LEAVE, + ONBOARDING, + PREHIRE, + RETIRED, + TERMINATED, + } + + enum class Value { + ACTIVE, + DECEASED, + LEAVE, + ONBOARDING, + PREHIRE, + RETIRED, + TERMINATED, + _UNKNOWN, + } + + fun value(): Value = + when (this) { + ACTIVE -> Value.ACTIVE + DECEASED -> Value.DECEASED + LEAVE -> Value.LEAVE + ONBOARDING -> Value.ONBOARDING + PREHIRE -> Value.PREHIRE + RETIRED -> Value.RETIRED + TERMINATED -> Value.TERMINATED + else -> Value._UNKNOWN + } + + fun known(): Known = + when (this) { + ACTIVE -> Known.ACTIVE + DECEASED -> Known.DECEASED + LEAVE -> Known.LEAVE + ONBOARDING -> Known.ONBOARDING + PREHIRE -> Known.PREHIRE + RETIRED -> Known.RETIRED + TERMINATED -> Known.TERMINATED + else -> throw FinchInvalidDataException("Unknown EmploymentStatus: $value") + } + + fun asString(): String = _value().asStringOrThrow() + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is EmploymentStatus && value == other.value /* spotless:on */ + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + /** The manager object representing the manager of the individual within the org. */ @JsonDeserialize(builder = Manager.Builder::class) @NoAutoDetect @@ -979,15 +1089,15 @@ private constructor( return true } - return /* spotless:off */ other is EmploymentUpdateResponse && firstName == other.firstName && middleName == other.middleName && lastName == other.lastName && title == other.title && manager == other.manager && department == other.department && employment == other.employment && startDate == other.startDate && endDate == other.endDate && latestRehireDate == other.latestRehireDate && isActive == other.isActive && classCode == other.classCode && location == other.location && income == other.income && incomeHistory == other.incomeHistory && customFields == other.customFields && sourceId == other.sourceId && id == other.id && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is EmploymentUpdateResponse && firstName == other.firstName && middleName == other.middleName && lastName == other.lastName && title == other.title && manager == other.manager && department == other.department && employment == other.employment && startDate == other.startDate && endDate == other.endDate && latestRehireDate == other.latestRehireDate && isActive == other.isActive && employmentStatus == other.employmentStatus && classCode == other.classCode && location == other.location && income == other.income && incomeHistory == other.incomeHistory && customFields == other.customFields && sourceId == other.sourceId && id == other.id && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(firstName, middleName, lastName, title, manager, department, employment, startDate, endDate, latestRehireDate, isActive, classCode, location, income, incomeHistory, customFields, sourceId, id, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(firstName, middleName, lastName, title, manager, department, employment, startDate, endDate, latestRehireDate, isActive, employmentStatus, classCode, location, income, incomeHistory, customFields, sourceId, id, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "EmploymentUpdateResponse{firstName=$firstName, middleName=$middleName, lastName=$lastName, title=$title, manager=$manager, department=$department, employment=$employment, startDate=$startDate, endDate=$endDate, latestRehireDate=$latestRehireDate, isActive=$isActive, classCode=$classCode, location=$location, income=$income, incomeHistory=$incomeHistory, customFields=$customFields, sourceId=$sourceId, id=$id, additionalProperties=$additionalProperties}" + "EmploymentUpdateResponse{firstName=$firstName, middleName=$middleName, lastName=$lastName, title=$title, manager=$manager, department=$department, employment=$employment, startDate=$startDate, endDate=$endDate, latestRehireDate=$latestRehireDate, isActive=$isActive, employmentStatus=$employmentStatus, classCode=$classCode, location=$location, income=$income, incomeHistory=$incomeHistory, customFields=$customFields, sourceId=$sourceId, id=$id, additionalProperties=$additionalProperties}" } 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 c2b0cf42..9b8a7819 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 @@ -258,34 +258,22 @@ private constructor( class Code @JsonCreator private constructor( - private val value: JsonField, + private val value: JsonField, ) : Enum { - @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return /* spotless:off */ other is Code && value == other.value /* spotless:on */ - } - - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { - @JvmField val OK = Code(JsonField.of(200)) + @JvmField val OK = of(200) - @JvmField val CREATED = Code(JsonField.of(201)) + @JvmField val CREATED = of(201) - @JvmField val NOT_FOUND = Code(JsonField.of(404)) + @JvmField val NOT_FOUND = of(404) - @JvmField val FORBIDDEN = Code(JsonField.of(403)) + @JvmField val FORBIDDEN = of(403) - @JvmStatic fun of(value: Int) = Code(JsonField.of(value)) + @JvmStatic fun of(value: Long) = Code(JsonField.of(value)) } enum class Known { @@ -322,6 +310,18 @@ private constructor( } fun asString(): String = _value().asStringOrThrow() + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Code && value == other.value /* spotless:on */ + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() } override fun equals(other: Any?): Boolean { 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 1790e378..d8c1576e 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 @@ -12,7 +12,6 @@ import com.tryfinch.api.core.NoAutoDetect import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams import com.tryfinch.api.core.toImmutable -import com.tryfinch.api.models.* import java.util.Objects import java.util.Optional diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitIndividualEnrolledIdsParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitIndividualEnrolledIdsParams.kt index 69e5e18b..f9ce3ac5 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitIndividualEnrolledIdsParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitIndividualEnrolledIdsParams.kt @@ -5,7 +5,6 @@ package com.tryfinch.api.models import com.tryfinch.api.core.NoAutoDetect import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams -import com.tryfinch.api.models.* import java.util.Objects class HrisBenefitIndividualEnrolledIdsParams diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitIndividualRetrieveManyBenefitsParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitIndividualRetrieveManyBenefitsParams.kt index 9e129990..b9d639fb 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitIndividualRetrieveManyBenefitsParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitIndividualRetrieveManyBenefitsParams.kt @@ -5,7 +5,6 @@ package com.tryfinch.api.models import com.tryfinch.api.core.NoAutoDetect import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams -import com.tryfinch.api.models.* import java.util.Objects import java.util.Optional 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 1b3b20b8..b88ad19a 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 @@ -12,7 +12,6 @@ import com.tryfinch.api.core.NoAutoDetect import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams import com.tryfinch.api.core.toImmutable -import com.tryfinch.api.models.* import java.util.Objects import java.util.Optional diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitListParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitListParams.kt index a253da32..3f3f8c2d 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitListParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitListParams.kt @@ -5,7 +5,6 @@ package com.tryfinch.api.models import com.tryfinch.api.core.NoAutoDetect import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams -import com.tryfinch.api.models.* import java.util.Objects class HrisBenefitListParams 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 8b0db972..69e36505 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 @@ -5,7 +5,6 @@ package com.tryfinch.api.models import com.tryfinch.api.core.NoAutoDetect import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams -import com.tryfinch.api.models.* import java.util.Objects class HrisBenefitListSupportedBenefitsParams diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitRetrieveParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitRetrieveParams.kt index 52e390f2..d97a7bce 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitRetrieveParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisBenefitRetrieveParams.kt @@ -5,7 +5,6 @@ package com.tryfinch.api.models import com.tryfinch.api.core.NoAutoDetect import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams -import com.tryfinch.api.models.* import java.util.Objects class HrisBenefitRetrieveParams 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 36fb1cf9..34ef135d 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 @@ -12,7 +12,6 @@ import com.tryfinch.api.core.NoAutoDetect import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams import com.tryfinch.api.core.toImmutable -import com.tryfinch.api.models.* import java.util.Objects import java.util.Optional diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisCompanyRetrieveParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisCompanyRetrieveParams.kt index b04ee9a6..0ce8199f 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisCompanyRetrieveParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisCompanyRetrieveParams.kt @@ -5,7 +5,6 @@ package com.tryfinch.api.models import com.tryfinch.api.core.NoAutoDetect import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams -import com.tryfinch.api.models.* import java.util.Objects class HrisCompanyRetrieveParams 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 06a17fa0..9ab6f318 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 @@ -45,12 +45,7 @@ private constructor( "HrisDirectoryListIndividualsPage{directoryService=$directoryService, params=$params, response=$response}" fun hasNextPage(): Boolean { - if (individuals().isEmpty()) { - return false - } - - return paging().offset().orElse(0) + individuals().count() < - paging().count().orElse(Long.MAX_VALUE) + return !individuals().isEmpty() } fun getNextPageParams(): Optional { diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisDirectoryListIndividualsPageAsync.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisDirectoryListIndividualsPageAsync.kt index b5ea48eb..347dc98e 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 @@ -46,12 +46,7 @@ private constructor( "HrisDirectoryListIndividualsPageAsync{directoryService=$directoryService, params=$params, response=$response}" fun hasNextPage(): Boolean { - if (individuals().isEmpty()) { - return false - } - - return paging().offset().orElse(0) + individuals().count() < - paging().count().orElse(Long.MAX_VALUE) + return !individuals().isEmpty() } fun getNextPageParams(): Optional { diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisDirectoryListIndividualsParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisDirectoryListIndividualsParams.kt index 7ee0d705..2c09b00e 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisDirectoryListIndividualsParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisDirectoryListIndividualsParams.kt @@ -5,7 +5,6 @@ package com.tryfinch.api.models import com.tryfinch.api.core.NoAutoDetect import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams -import com.tryfinch.api.models.* import java.util.Objects import java.util.Optional diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisDirectoryListPage.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisDirectoryListPage.kt index cb1901ea..a72ee4ff 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 @@ -45,12 +45,7 @@ private constructor( "HrisDirectoryListPage{directoryService=$directoryService, params=$params, response=$response}" fun hasNextPage(): Boolean { - if (individuals().isEmpty()) { - return false - } - - return paging().offset().orElse(0) + individuals().count() < - paging().count().orElse(Long.MAX_VALUE) + return !individuals().isEmpty() } fun getNextPageParams(): Optional { diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisDirectoryListPageAsync.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisDirectoryListPageAsync.kt index 4177505f..3ab7e847 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 @@ -46,12 +46,7 @@ private constructor( "HrisDirectoryListPageAsync{directoryService=$directoryService, params=$params, response=$response}" fun hasNextPage(): Boolean { - if (individuals().isEmpty()) { - return false - } - - return paging().offset().orElse(0) + individuals().count() < - paging().count().orElse(Long.MAX_VALUE) + return !individuals().isEmpty() } fun getNextPageParams(): Optional { diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisDirectoryListParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisDirectoryListParams.kt index 0912e775..ffc4b4bd 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisDirectoryListParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisDirectoryListParams.kt @@ -5,7 +5,6 @@ package com.tryfinch.api.models import com.tryfinch.api.core.NoAutoDetect import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams -import com.tryfinch.api.models.* import java.util.Objects import java.util.Optional 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 0d40d3c8..191b1fd6 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 @@ -12,7 +12,6 @@ import com.tryfinch.api.core.NoAutoDetect import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams import com.tryfinch.api.core.toImmutable -import com.tryfinch.api.models.* import java.util.Objects class HrisEmploymentRetrieveManyParams 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 ab7c89bb..1d9659f6 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 @@ -12,7 +12,6 @@ import com.tryfinch.api.core.NoAutoDetect import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams import com.tryfinch.api.core.toImmutable -import com.tryfinch.api.models.* import java.util.Objects import java.util.Optional 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 f8512da0..bb509264 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 @@ -12,7 +12,6 @@ import com.tryfinch.api.core.NoAutoDetect import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams import com.tryfinch.api.core.toImmutable -import com.tryfinch.api.models.* import java.util.Objects class HrisPayStatementRetrieveManyParams diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisPaymentListParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisPaymentListParams.kt index df559364..19dd3c8c 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisPaymentListParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/HrisPaymentListParams.kt @@ -5,7 +5,6 @@ package com.tryfinch.api.models import com.tryfinch.api.core.NoAutoDetect import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams -import com.tryfinch.api.models.* import java.time.LocalDate import java.util.Objects 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 46d55876..bff3cbf8 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 @@ -177,37 +177,25 @@ private constructor( @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return /* spotless:off */ other is Unit && value == other.value /* spotless:on */ - } - - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() - companion object { - @JvmField val YEARLY = Unit(JsonField.of("yearly")) + @JvmField val YEARLY = of("yearly") - @JvmField val QUARTERLY = Unit(JsonField.of("quarterly")) + @JvmField val QUARTERLY = of("quarterly") - @JvmField val MONTHLY = Unit(JsonField.of("monthly")) + @JvmField val MONTHLY = of("monthly") - @JvmField val SEMI_MONTHLY = Unit(JsonField.of("semi_monthly")) + @JvmField val SEMI_MONTHLY = of("semi_monthly") - @JvmField val BI_WEEKLY = Unit(JsonField.of("bi_weekly")) + @JvmField val BI_WEEKLY = of("bi_weekly") - @JvmField val WEEKLY = Unit(JsonField.of("weekly")) + @JvmField val WEEKLY = of("weekly") - @JvmField val DAILY = Unit(JsonField.of("daily")) + @JvmField val DAILY = of("daily") - @JvmField val HOURLY = Unit(JsonField.of("hourly")) + @JvmField val HOURLY = of("hourly") - @JvmField val FIXED = Unit(JsonField.of("fixed")) + @JvmField val FIXED = of("fixed") @JvmStatic fun of(value: String) = Unit(JsonField.of(value)) } @@ -266,6 +254,18 @@ private constructor( } fun asString(): String = _value().asStringOrThrow() + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Unit && value == other.value /* spotless:on */ + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() } override fun equals(other: Any?): Boolean { 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 07f9fa9c..13788acc 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 @@ -437,23 +437,11 @@ private constructor( @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - 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() - companion object { - @JvmField val WORK = Type(JsonField.of("work")) + @JvmField val WORK = of("work") - @JvmField val PERSONAL = Type(JsonField.of("personal")) + @JvmField val PERSONAL = of("personal") @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } @@ -484,6 +472,18 @@ private constructor( } 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 { @@ -512,40 +512,24 @@ private constructor( @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return /* spotless:off */ other is Ethnicity && value == other.value /* spotless:on */ - } - - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() - companion object { - @JvmField val ASIAN = Ethnicity(JsonField.of("asian")) + @JvmField val ASIAN = of("asian") - @JvmField val WHITE = Ethnicity(JsonField.of("white")) + @JvmField val WHITE = of("white") - @JvmField - val BLACK_OR_AFRICAN_AMERICAN = Ethnicity(JsonField.of("black_or_african_american")) + @JvmField val BLACK_OR_AFRICAN_AMERICAN = of("black_or_african_american") @JvmField - val NATIVE_HAWAIIAN_OR_PACIFIC_ISLANDER = - Ethnicity(JsonField.of("native_hawaiian_or_pacific_islander")) + val NATIVE_HAWAIIAN_OR_PACIFIC_ISLANDER = of("native_hawaiian_or_pacific_islander") - @JvmField - val AMERICAN_INDIAN_OR_ALASKA_NATIVE = - Ethnicity(JsonField.of("american_indian_or_alaska_native")) + @JvmField val AMERICAN_INDIAN_OR_ALASKA_NATIVE = of("american_indian_or_alaska_native") - @JvmField val HISPANIC_OR_LATINO = Ethnicity(JsonField.of("hispanic_or_latino")) + @JvmField val HISPANIC_OR_LATINO = of("hispanic_or_latino") - @JvmField val TWO_OR_MORE_RACES = Ethnicity(JsonField.of("two_or_more_races")) + @JvmField val TWO_OR_MORE_RACES = of("two_or_more_races") - @JvmField val DECLINE_TO_SPECIFY = Ethnicity(JsonField.of("decline_to_specify")) + @JvmField val DECLINE_TO_SPECIFY = of("decline_to_specify") @JvmStatic fun of(value: String) = Ethnicity(JsonField.of(value)) } @@ -600,37 +584,37 @@ private constructor( } fun asString(): String = _value().asStringOrThrow() - } - - class Gender - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { - - @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value override fun equals(other: Any?): Boolean { if (this === other) { return true } - return /* spotless:off */ other is Gender && value == other.value /* spotless:on */ + return /* spotless:off */ other is Ethnicity && value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() override fun toString() = value.toString() + } + + class Gender + @JsonCreator + private constructor( + private val value: JsonField, + ) : Enum { + + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { - @JvmField val FEMALE = Gender(JsonField.of("female")) + @JvmField val FEMALE = of("female") - @JvmField val MALE = Gender(JsonField.of("male")) + @JvmField val MALE = of("male") - @JvmField val OTHER = Gender(JsonField.of("other")) + @JvmField val OTHER = of("other") - @JvmField val DECLINE_TO_SPECIFY = Gender(JsonField.of("decline_to_specify")) + @JvmField val DECLINE_TO_SPECIFY = of("decline_to_specify") @JvmStatic fun of(value: String) = Gender(JsonField.of(value)) } @@ -669,6 +653,18 @@ private constructor( } fun asString(): String = _value().asStringOrThrow() + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Gender && value == other.value /* spotless:on */ + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() } @JsonDeserialize(builder = PhoneNumber.Builder::class) @@ -764,23 +760,11 @@ private constructor( @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - 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() - companion object { - @JvmField val WORK = Type(JsonField.of("work")) + @JvmField val WORK = of("work") - @JvmField val PERSONAL = Type(JsonField.of("personal")) + @JvmField val PERSONAL = of("personal") @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } @@ -811,6 +795,18 @@ private constructor( } 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 { 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 31baddd4..00e6373e 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 @@ -305,23 +305,11 @@ private constructor( @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return /* spotless:off */ other is HsaContributionLimit && value == other.value /* spotless:on */ - } - - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() - companion object { - @JvmField val INDIVIDUAL = HsaContributionLimit(JsonField.of("individual")) + @JvmField val INDIVIDUAL = of("individual") - @JvmField val FAMILY = HsaContributionLimit(JsonField.of("family")) + @JvmField val FAMILY = of("family") @JvmStatic fun of(value: String) = HsaContributionLimit(JsonField.of(value)) } @@ -352,6 +340,18 @@ private constructor( } fun asString(): String = _value().asStringOrThrow() + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is HsaContributionLimit && value == other.value /* spotless:on */ + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() } override fun equals(other: Any?): Boolean { 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 c4015f99..f2bb419c 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 @@ -293,25 +293,13 @@ private constructor( @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return /* spotless:off */ other is EventType && value == other.value /* spotless:on */ - } - - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() - companion object { - @JvmField val INDIVIDUAL_CREATED = EventType(JsonField.of("individual.created")) + @JvmField val INDIVIDUAL_CREATED = of("individual.created") - @JvmField val INDIVIDUAL_UPDATED = EventType(JsonField.of("individual.updated")) + @JvmField val INDIVIDUAL_UPDATED = of("individual.updated") - @JvmField val INDIVIDUAL_DELETED = EventType(JsonField.of("individual.deleted")) + @JvmField val INDIVIDUAL_DELETED = of("individual.deleted") @JvmStatic fun of(value: String) = EventType(JsonField.of(value)) } @@ -346,6 +334,18 @@ private constructor( } fun asString(): String = _value().asStringOrThrow() + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is EventType && value == other.value /* spotless:on */ + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() } 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 cbcea3dc..84d086e5 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 @@ -437,23 +437,11 @@ private constructor( @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - 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() - companion object { - @JvmField val WORK = Type(JsonField.of("work")) + @JvmField val WORK = of("work") - @JvmField val PERSONAL = Type(JsonField.of("personal")) + @JvmField val PERSONAL = of("personal") @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } @@ -484,6 +472,18 @@ private constructor( } 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 { @@ -512,40 +512,24 @@ private constructor( @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return /* spotless:off */ other is Ethnicity && value == other.value /* spotless:on */ - } - - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() - companion object { - @JvmField val ASIAN = Ethnicity(JsonField.of("asian")) + @JvmField val ASIAN = of("asian") - @JvmField val WHITE = Ethnicity(JsonField.of("white")) + @JvmField val WHITE = of("white") - @JvmField - val BLACK_OR_AFRICAN_AMERICAN = Ethnicity(JsonField.of("black_or_african_american")) + @JvmField val BLACK_OR_AFRICAN_AMERICAN = of("black_or_african_american") @JvmField - val NATIVE_HAWAIIAN_OR_PACIFIC_ISLANDER = - Ethnicity(JsonField.of("native_hawaiian_or_pacific_islander")) + val NATIVE_HAWAIIAN_OR_PACIFIC_ISLANDER = of("native_hawaiian_or_pacific_islander") - @JvmField - val AMERICAN_INDIAN_OR_ALASKA_NATIVE = - Ethnicity(JsonField.of("american_indian_or_alaska_native")) + @JvmField val AMERICAN_INDIAN_OR_ALASKA_NATIVE = of("american_indian_or_alaska_native") - @JvmField val HISPANIC_OR_LATINO = Ethnicity(JsonField.of("hispanic_or_latino")) + @JvmField val HISPANIC_OR_LATINO = of("hispanic_or_latino") - @JvmField val TWO_OR_MORE_RACES = Ethnicity(JsonField.of("two_or_more_races")) + @JvmField val TWO_OR_MORE_RACES = of("two_or_more_races") - @JvmField val DECLINE_TO_SPECIFY = Ethnicity(JsonField.of("decline_to_specify")) + @JvmField val DECLINE_TO_SPECIFY = of("decline_to_specify") @JvmStatic fun of(value: String) = Ethnicity(JsonField.of(value)) } @@ -600,37 +584,37 @@ private constructor( } fun asString(): String = _value().asStringOrThrow() - } - - class Gender - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { - - @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value override fun equals(other: Any?): Boolean { if (this === other) { return true } - return /* spotless:off */ other is Gender && value == other.value /* spotless:on */ + return /* spotless:off */ other is Ethnicity && value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() override fun toString() = value.toString() + } + + class Gender + @JsonCreator + private constructor( + private val value: JsonField, + ) : Enum { + + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { - @JvmField val FEMALE = Gender(JsonField.of("female")) + @JvmField val FEMALE = of("female") - @JvmField val MALE = Gender(JsonField.of("male")) + @JvmField val MALE = of("male") - @JvmField val OTHER = Gender(JsonField.of("other")) + @JvmField val OTHER = of("other") - @JvmField val DECLINE_TO_SPECIFY = Gender(JsonField.of("decline_to_specify")) + @JvmField val DECLINE_TO_SPECIFY = of("decline_to_specify") @JvmStatic fun of(value: String) = Gender(JsonField.of(value)) } @@ -669,6 +653,18 @@ private constructor( } fun asString(): String = _value().asStringOrThrow() + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Gender && value == other.value /* spotless:on */ + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() } @JsonDeserialize(builder = PhoneNumber.Builder::class) @@ -764,23 +760,11 @@ private constructor( @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - 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() - companion object { - @JvmField val WORK = Type(JsonField.of("work")) + @JvmField val WORK = of("work") - @JvmField val PERSONAL = Type(JsonField.of("personal")) + @JvmField val PERSONAL = of("personal") @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } @@ -811,6 +795,18 @@ private constructor( } 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 { 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 6f9167b7..e4203f0b 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 @@ -721,29 +721,17 @@ private constructor( @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - 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() - companion object { - @JvmField val ASSISTED = Type(JsonField.of("assisted")) + @JvmField val ASSISTED = of("assisted") - @JvmField val CREDENTIAL = Type(JsonField.of("credential")) + @JvmField val CREDENTIAL = of("credential") - @JvmField val API_TOKEN = Type(JsonField.of("api_token")) + @JvmField val API_TOKEN = of("api_token") - @JvmField val API_CREDENTIAL = Type(JsonField.of("api_credential")) + @JvmField val API_CREDENTIAL = of("api_credential") - @JvmField val OAUTH = Type(JsonField.of("oauth")) + @JvmField val OAUTH = of("oauth") @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } @@ -786,6 +774,18 @@ private constructor( } 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 { @@ -814,25 +814,13 @@ private constructor( @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return /* spotless:off */ other is ClientType && value == other.value /* spotless:on */ - } - - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() - companion object { - @JvmField val PRODUCTION = ClientType(JsonField.of("production")) + @JvmField val PRODUCTION = of("production") - @JvmField val DEVELOPMENT = ClientType(JsonField.of("development")) + @JvmField val DEVELOPMENT = of("development") - @JvmField val SANDBOX = ClientType(JsonField.of("sandbox")) + @JvmField val SANDBOX = of("sandbox") @JvmStatic fun of(value: String) = ClientType(JsonField.of(value)) } @@ -867,6 +855,18 @@ private constructor( } fun asString(): String = _value().asStringOrThrow() + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is ClientType && value == other.value /* spotless:on */ + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() } @JsonDeserialize(builder = ConnectionStatus.Builder::class) @@ -981,23 +981,11 @@ private constructor( @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return /* spotless:off */ other is ConnectionType && value == other.value /* spotless:on */ - } - - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() - companion object { - @JvmField val PROVIDER = ConnectionType(JsonField.of("provider")) + @JvmField val PROVIDER = of("provider") - @JvmField val FINCH = ConnectionType(JsonField.of("finch")) + @JvmField val FINCH = of("finch") @JvmStatic fun of(value: String) = ConnectionType(JsonField.of(value)) } @@ -1028,6 +1016,18 @@ private constructor( } fun asString(): String = _value().asStringOrThrow() + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is ConnectionType && value == other.value /* spotless:on */ + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() } override fun equals(other: Any?): Boolean { 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 fb33c269..fc7ae8b8 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 @@ -25,7 +25,6 @@ import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams import com.tryfinch.api.core.toImmutable import com.tryfinch.api.errors.FinchInvalidDataException -import com.tryfinch.api.models.* import java.util.Objects import java.util.Optional import kotlin.jvm.optionals.getOrNull @@ -376,21 +375,9 @@ constructor( @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - 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() - companion object { - @JvmField val DATA_SYNC_ALL = Type(JsonField.of("data_sync_all")) + @JvmField val DATA_SYNC_ALL = of("data_sync_all") @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } @@ -417,6 +404,18 @@ constructor( } 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 { @@ -513,21 +512,9 @@ constructor( @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - 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() - companion object { - @JvmField val W4_FORM_EMPLOYEE_SYNC = Type(JsonField.of("w4_form_employee_sync")) + @JvmField val W4_FORM_EMPLOYEE_SYNC = of("w4_form_employee_sync") @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } @@ -554,6 +541,18 @@ constructor( } 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 { 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 ccc8bf1c..a83fe3eb 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 @@ -45,12 +45,7 @@ private constructor( "JobAutomatedListPage{automatedService=$automatedService, params=$params, response=$response}" fun hasNextPage(): Boolean { - if (data().isEmpty()) { - return false - } - - return paging().offset().orElse(0) + data().count() < - paging().count().orElse(Long.MAX_VALUE) + return !data().isEmpty() } fun getNextPageParams(): Optional { diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobAutomatedListPageAsync.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobAutomatedListPageAsync.kt index f7e942bb..aca6d42c 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 @@ -46,12 +46,7 @@ private constructor( "JobAutomatedListPageAsync{automatedService=$automatedService, params=$params, response=$response}" fun hasNextPage(): Boolean { - if (data().isEmpty()) { - return false - } - - return paging().offset().orElse(0) + data().count() < - paging().count().orElse(Long.MAX_VALUE) + return !data().isEmpty() } fun getNextPageParams(): Optional { diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobAutomatedListParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobAutomatedListParams.kt index 87f58414..3eb94cf4 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobAutomatedListParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobAutomatedListParams.kt @@ -5,7 +5,6 @@ package com.tryfinch.api.models import com.tryfinch.api.core.NoAutoDetect import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams -import com.tryfinch.api.models.* import java.util.Objects import java.util.Optional diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobAutomatedRetrieveParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobAutomatedRetrieveParams.kt index 6b746f4d..f8454fe4 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobAutomatedRetrieveParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobAutomatedRetrieveParams.kt @@ -5,7 +5,6 @@ package com.tryfinch.api.models import com.tryfinch.api.core.NoAutoDetect import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams -import com.tryfinch.api.models.* import java.util.Objects class JobAutomatedRetrieveParams 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 1bc6c5df..ffc7fa45 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 @@ -313,42 +313,19 @@ private constructor( @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return /* spotless:off */ other is EventType && value == other.value /* spotless:on */ - } - - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() - companion object { - @JvmField - val JOB_BENEFIT_CREATE_COMPLETED = - EventType(JsonField.of("job.benefit_create.completed")) + @JvmField val JOB_BENEFIT_CREATE_COMPLETED = of("job.benefit_create.completed") - @JvmField - val JOB_BENEFIT_ENROLL_COMPLETED = - EventType(JsonField.of("job.benefit_enroll.completed")) + @JvmField val JOB_BENEFIT_ENROLL_COMPLETED = of("job.benefit_enroll.completed") - @JvmField - val JOB_BENEFIT_REGISTER_COMPLETED = - EventType(JsonField.of("job.benefit_register.completed")) + @JvmField val JOB_BENEFIT_REGISTER_COMPLETED = of("job.benefit_register.completed") - @JvmField - val JOB_BENEFIT_UNENROLL_COMPLETED = - EventType(JsonField.of("job.benefit_unenroll.completed")) + @JvmField val JOB_BENEFIT_UNENROLL_COMPLETED = of("job.benefit_unenroll.completed") - @JvmField - val JOB_BENEFIT_UPDATE_COMPLETED = - EventType(JsonField.of("job.benefit_update.completed")) + @JvmField val JOB_BENEFIT_UPDATE_COMPLETED = of("job.benefit_update.completed") - @JvmField - val JOB_DATA_SYNC_ALL_COMPLETED = EventType(JsonField.of("job.data_sync_all.completed")) + @JvmField val JOB_DATA_SYNC_ALL_COMPLETED = of("job.data_sync_all.completed") @JvmStatic fun of(value: String) = EventType(JsonField.of(value)) } @@ -395,6 +372,18 @@ private constructor( } fun asString(): String = _value().asStringOrThrow() + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is EventType && value == other.value /* spotless:on */ + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() } override fun equals(other: Any?): Boolean { diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobManualRetrieveParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobManualRetrieveParams.kt index 0dc90dbb..ae0b8f0b 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobManualRetrieveParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobManualRetrieveParams.kt @@ -5,7 +5,6 @@ package com.tryfinch.api.models import com.tryfinch.api.core.NoAutoDetect import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams -import com.tryfinch.api.models.* import java.util.Objects class JobManualRetrieveParams 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 0798bd9a..9ff5e5f5 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 @@ -130,27 +130,15 @@ private constructor( @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return /* spotless:off */ other is Status && value == other.value /* spotless:on */ - } - - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() - companion object { - @JvmField val PENDING = Status(JsonField.of("pending")) + @JvmField val PENDING = of("pending") - @JvmField val IN_PROGRESS = Status(JsonField.of("in_progress")) + @JvmField val IN_PROGRESS = of("in_progress") - @JvmField val ERROR = Status(JsonField.of("error")) + @JvmField val ERROR = of("error") - @JvmField val COMPLETE = Status(JsonField.of("complete")) + @JvmField val COMPLETE = of("complete") @JvmStatic fun of(value: String) = Status(JsonField.of(value)) } @@ -189,6 +177,18 @@ private constructor( } fun asString(): String = _value().asStringOrThrow() + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Status && value == other.value /* spotless:on */ + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() } 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 cd3bf015..784345dc 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 @@ -5,7 +5,6 @@ package com.tryfinch.api.models import com.fasterxml.jackson.annotation.JsonCreator import com.tryfinch.api.core.Enum import com.tryfinch.api.core.JsonField -import com.tryfinch.api.core.JsonValue import com.tryfinch.api.errors.FinchInvalidDataException class OperationSupport @@ -16,29 +15,15 @@ private constructor( @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return /* spotless:off */ other is OperationSupport && value == other.value /* spotless:on */ - } - - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() - companion object { - @JvmField val SUPPORTED = OperationSupport(JsonField.of("supported")) + @JvmField val SUPPORTED = of("supported") - @JvmField - val NOT_SUPPORTED_BY_FINCH = OperationSupport(JsonField.of("not_supported_by_finch")) + @JvmField val NOT_SUPPORTED_BY_FINCH = of("not_supported_by_finch") - @JvmField - val NOT_SUPPORTED_BY_PROVIDER = OperationSupport(JsonField.of("not_supported_by_provider")) + @JvmField val NOT_SUPPORTED_BY_PROVIDER = of("not_supported_by_provider") - @JvmField val CLIENT_ACCESS_ONLY = OperationSupport(JsonField.of("client_access_only")) + @JvmField val CLIENT_ACCESS_ONLY = of("client_access_only") @JvmStatic fun of(value: String) = OperationSupport(JsonField.of(value)) } @@ -77,4 +62,16 @@ private constructor( } fun asString(): String = _value().asStringOrThrow() + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is OperationSupport && value == other.value /* spotless:on */ + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() } 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 72227b93..f58c2517 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 @@ -140,37 +140,25 @@ private constructor( @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return /* spotless:off */ other is PayFrequency && value == other.value /* spotless:on */ - } - - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() - companion object { - @JvmField val ANNUALLY = PayFrequency(JsonField.of("annually")) + @JvmField val ANNUALLY = of("annually") - @JvmField val SEMI_ANNUALLY = PayFrequency(JsonField.of("semi_annually")) + @JvmField val SEMI_ANNUALLY = of("semi_annually") - @JvmField val QUARTERLY = PayFrequency(JsonField.of("quarterly")) + @JvmField val QUARTERLY = of("quarterly") - @JvmField val MONTHLY = PayFrequency(JsonField.of("monthly")) + @JvmField val MONTHLY = of("monthly") - @JvmField val SEMI_MONTHLY = PayFrequency(JsonField.of("semi_monthly")) + @JvmField val SEMI_MONTHLY = of("semi_monthly") - @JvmField val BI_WEEKLY = PayFrequency(JsonField.of("bi_weekly")) + @JvmField val BI_WEEKLY = of("bi_weekly") - @JvmField val WEEKLY = PayFrequency(JsonField.of("weekly")) + @JvmField val WEEKLY = of("weekly") - @JvmField val DAILY = PayFrequency(JsonField.of("daily")) + @JvmField val DAILY = of("daily") - @JvmField val OTHER = PayFrequency(JsonField.of("other")) + @JvmField val OTHER = of("other") @JvmStatic fun of(value: String) = PayFrequency(JsonField.of(value)) } @@ -229,6 +217,18 @@ private constructor( } fun asString(): String = _value().asStringOrThrow() + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is PayFrequency && value == other.value /* spotless:on */ + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() } override fun equals(other: Any?): Boolean { 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 e119b5be..c96f9aee 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 @@ -155,37 +155,25 @@ private constructor( @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return /* spotless:off */ other is PayFrequency && value == other.value /* spotless:on */ - } - - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() - companion object { - @JvmField val ANNUALLY = PayFrequency(JsonField.of("annually")) + @JvmField val ANNUALLY = of("annually") - @JvmField val SEMI_ANNUALLY = PayFrequency(JsonField.of("semi_annually")) + @JvmField val SEMI_ANNUALLY = of("semi_annually") - @JvmField val QUARTERLY = PayFrequency(JsonField.of("quarterly")) + @JvmField val QUARTERLY = of("quarterly") - @JvmField val MONTHLY = PayFrequency(JsonField.of("monthly")) + @JvmField val MONTHLY = of("monthly") - @JvmField val SEMI_MONTHLY = PayFrequency(JsonField.of("semi_monthly")) + @JvmField val SEMI_MONTHLY = of("semi_monthly") - @JvmField val BI_WEEKLY = PayFrequency(JsonField.of("bi_weekly")) + @JvmField val BI_WEEKLY = of("bi_weekly") - @JvmField val WEEKLY = PayFrequency(JsonField.of("weekly")) + @JvmField val WEEKLY = of("weekly") - @JvmField val DAILY = PayFrequency(JsonField.of("daily")) + @JvmField val DAILY = of("daily") - @JvmField val OTHER = PayFrequency(JsonField.of("other")) + @JvmField val OTHER = of("other") @JvmStatic fun of(value: String) = PayFrequency(JsonField.of(value)) } @@ -244,6 +232,18 @@ private constructor( } fun asString(): String = _value().asStringOrThrow() + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is PayFrequency && value == other.value /* spotless:on */ + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() } override fun equals(other: Any?): Boolean { 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 ecd56450..38a7fe1a 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 @@ -440,45 +440,33 @@ private constructor( @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - 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() - companion object { - @JvmField val SALARY = Type(JsonField.of("salary")) + @JvmField val SALARY = of("salary") - @JvmField val WAGE = Type(JsonField.of("wage")) + @JvmField val WAGE = of("wage") - @JvmField val REIMBURSEMENT = Type(JsonField.of("reimbursement")) + @JvmField val REIMBURSEMENT = of("reimbursement") - @JvmField val OVERTIME = Type(JsonField.of("overtime")) + @JvmField val OVERTIME = of("overtime") - @JvmField val SEVERANCE = Type(JsonField.of("severance")) + @JvmField val SEVERANCE = of("severance") - @JvmField val DOUBLE_OVERTIME = Type(JsonField.of("double_overtime")) + @JvmField val DOUBLE_OVERTIME = of("double_overtime") - @JvmField val PTO = Type(JsonField.of("pto")) + @JvmField val PTO = of("pto") - @JvmField val SICK = Type(JsonField.of("sick")) + @JvmField val SICK = of("sick") - @JvmField val BONUS = Type(JsonField.of("bonus")) + @JvmField val BONUS = of("bonus") - @JvmField val COMMISSION = Type(JsonField.of("commission")) + @JvmField val COMMISSION = of("commission") - @JvmField val TIPS = Type(JsonField.of("tips")) + @JvmField val TIPS = of("tips") - @JvmField val _1099 = Type(JsonField.of("1099")) + @JvmField val _1099 = of("1099") - @JvmField val OTHER = Type(JsonField.of("other")) + @JvmField val OTHER = of("other") @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } @@ -553,6 +541,18 @@ private constructor( } 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 { @@ -898,23 +898,11 @@ private constructor( @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return /* spotless:off */ other is PaymentMethod && value == other.value /* spotless:on */ - } - - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() - companion object { - @JvmField val CHECK = PaymentMethod(JsonField.of("check")) + @JvmField val CHECK = of("check") - @JvmField val DIRECT_DEPOSIT = PaymentMethod(JsonField.of("direct_deposit")) + @JvmField val DIRECT_DEPOSIT = of("direct_deposit") @JvmStatic fun of(value: String) = PaymentMethod(JsonField.of(value)) } @@ -945,6 +933,18 @@ private constructor( } fun asString(): String = _value().asStringOrThrow() + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is PaymentMethod && value == other.value /* spotless:on */ + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() } @JsonDeserialize(builder = Tax.Builder::class) @@ -1105,27 +1105,15 @@ private constructor( @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - 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() - companion object { - @JvmField val STATE = Type(JsonField.of("state")) + @JvmField val STATE = of("state") - @JvmField val FEDERAL = Type(JsonField.of("federal")) + @JvmField val FEDERAL = of("federal") - @JvmField val LOCAL = Type(JsonField.of("local")) + @JvmField val LOCAL = of("local") - @JvmField val FICA = Type(JsonField.of("fica")) + @JvmField val FICA = of("fica") @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } @@ -1164,6 +1152,18 @@ private constructor( } 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 { @@ -1192,25 +1192,13 @@ private constructor( @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - 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() - companion object { - @JvmField val REGULAR_PAYROLL = Type(JsonField.of("regular_payroll")) + @JvmField val REGULAR_PAYROLL = of("regular_payroll") - @JvmField val OFF_CYCLE_PAYROLL = Type(JsonField.of("off_cycle_payroll")) + @JvmField val OFF_CYCLE_PAYROLL = of("off_cycle_payroll") - @JvmField val ONE_TIME_PAYMENT = Type(JsonField.of("one_time_payment")) + @JvmField val ONE_TIME_PAYMENT = of("one_time_payment") @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } @@ -1245,6 +1233,18 @@ private constructor( } 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 { 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 b8ee9567..031b2f99 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 @@ -316,25 +316,13 @@ private constructor( @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return /* spotless:off */ other is EventType && value == other.value /* spotless:on */ - } - - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() - companion object { - @JvmField val PAY_STATEMENT_CREATED = EventType(JsonField.of("pay_statement.created")) + @JvmField val PAY_STATEMENT_CREATED = of("pay_statement.created") - @JvmField val PAY_STATEMENT_UPDATED = EventType(JsonField.of("pay_statement.updated")) + @JvmField val PAY_STATEMENT_UPDATED = of("pay_statement.updated") - @JvmField val PAY_STATEMENT_DELETED = EventType(JsonField.of("pay_statement.deleted")) + @JvmField val PAY_STATEMENT_DELETED = of("pay_statement.deleted") @JvmStatic fun of(value: String) = EventType(JsonField.of(value)) } @@ -369,6 +357,18 @@ private constructor( } fun asString(): String = _value().asStringOrThrow() + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is EventType && value == other.value /* spotless:on */ + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() } 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 701bd06d..3d3fab02 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 @@ -298,37 +298,25 @@ private constructor( @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return /* spotless:off */ other is PayFrequency && value == other.value /* spotless:on */ - } - - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() - companion object { - @JvmField val ANNUALLY = PayFrequency(JsonField.of("annually")) + @JvmField val ANNUALLY = of("annually") - @JvmField val SEMI_ANNUALLY = PayFrequency(JsonField.of("semi_annually")) + @JvmField val SEMI_ANNUALLY = of("semi_annually") - @JvmField val QUARTERLY = PayFrequency(JsonField.of("quarterly")) + @JvmField val QUARTERLY = of("quarterly") - @JvmField val MONTHLY = PayFrequency(JsonField.of("monthly")) + @JvmField val MONTHLY = of("monthly") - @JvmField val SEMI_MONTHLY = PayFrequency(JsonField.of("semi_monthly")) + @JvmField val SEMI_MONTHLY = of("semi_monthly") - @JvmField val BI_WEEKLY = PayFrequency(JsonField.of("bi_weekly")) + @JvmField val BI_WEEKLY = of("bi_weekly") - @JvmField val WEEKLY = PayFrequency(JsonField.of("weekly")) + @JvmField val WEEKLY = of("weekly") - @JvmField val DAILY = PayFrequency(JsonField.of("daily")) + @JvmField val DAILY = of("daily") - @JvmField val OTHER = PayFrequency(JsonField.of("other")) + @JvmField val OTHER = of("other") @JvmStatic fun of(value: String) = PayFrequency(JsonField.of(value)) } @@ -387,6 +375,18 @@ private constructor( } fun asString(): String = _value().asStringOrThrow() + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is PayFrequency && value == other.value /* spotless:on */ + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() } /** The pay period object. */ 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 02d64e4d..1be91fee 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 @@ -313,25 +313,13 @@ private constructor( @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return /* spotless:off */ other is EventType && value == other.value /* spotless:on */ - } - - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() - companion object { - @JvmField val PAYMENT_CREATED = EventType(JsonField.of("payment.created")) + @JvmField val PAYMENT_CREATED = of("payment.created") - @JvmField val PAYMENT_UPDATED = EventType(JsonField.of("payment.updated")) + @JvmField val PAYMENT_UPDATED = of("payment.updated") - @JvmField val PAYMENT_DELETED = EventType(JsonField.of("payment.deleted")) + @JvmField val PAYMENT_DELETED = of("payment.deleted") @JvmStatic fun of(value: String) = EventType(JsonField.of(value)) } @@ -366,6 +354,18 @@ private constructor( } fun asString(): String = _value().asStringOrThrow() + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is EventType && value == other.value /* spotless:on */ + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() } override fun equals(other: Any?): Boolean { diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayrollPayGroupListParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayrollPayGroupListParams.kt index fbafe465..96fa9258 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayrollPayGroupListParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayrollPayGroupListParams.kt @@ -6,7 +6,6 @@ import com.tryfinch.api.core.NoAutoDetect import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams import com.tryfinch.api.core.toImmutable -import com.tryfinch.api.models.* import java.util.Objects import java.util.Optional diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayrollPayGroupRetrieveParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayrollPayGroupRetrieveParams.kt index 0397d454..a82ebf0b 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayrollPayGroupRetrieveParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/PayrollPayGroupRetrieveParams.kt @@ -5,7 +5,6 @@ package com.tryfinch.api.models import com.tryfinch.api.core.NoAutoDetect import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams -import com.tryfinch.api.models.* import java.util.Objects class PayrollPayGroupRetrieveParams 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 5528ce08..d42d4889 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 @@ -1990,6 +1990,7 @@ private constructor( private val startDate: JsonField, private val endDate: JsonField, private val isActive: JsonField, + private val employmentStatus: JsonField, private val incomeHistory: JsonField, private val classCode: JsonField, private val customFields: JsonField, @@ -2025,6 +2026,9 @@ private constructor( fun isActive(): Optional = Optional.ofNullable(isActive.getNullable("is_active")) + fun employmentStatus(): Optional = + Optional.ofNullable(employmentStatus.getNullable("employment_status")) + fun incomeHistory(): Optional = Optional.ofNullable(incomeHistory.getNullable("income_history")) @@ -2064,6 +2068,10 @@ private constructor( @JsonProperty("is_active") @ExcludeMissing fun _isActive() = isActive + @JsonProperty("employment_status") + @ExcludeMissing + fun _employmentStatus() = employmentStatus + @JsonProperty("income_history") @ExcludeMissing fun _incomeHistory() = incomeHistory @JsonProperty("class_code") @ExcludeMissing fun _classCode() = classCode @@ -2094,6 +2102,7 @@ private constructor( startDate() endDate() isActive() + employmentStatus() incomeHistory() classCode() customFields() @@ -2123,6 +2132,7 @@ private constructor( private var startDate: JsonField = JsonMissing.of() private var endDate: JsonField = JsonMissing.of() private var isActive: JsonField = JsonMissing.of() + private var employmentStatus: JsonField = JsonMissing.of() private var incomeHistory: JsonField = JsonMissing.of() private var classCode: JsonField = JsonMissing.of() private var customFields: JsonField = JsonMissing.of() @@ -2144,6 +2154,7 @@ private constructor( this.startDate = supportedEmploymentFields.startDate this.endDate = supportedEmploymentFields.endDate this.isActive = supportedEmploymentFields.isActive + this.employmentStatus = supportedEmploymentFields.employmentStatus this.incomeHistory = supportedEmploymentFields.incomeHistory this.classCode = supportedEmploymentFields.classCode this.customFields = supportedEmploymentFields.customFields @@ -2209,6 +2220,15 @@ private constructor( @ExcludeMissing fun isActive(isActive: JsonField) = apply { this.isActive = isActive } + fun employmentStatus(employmentStatus: Boolean) = + employmentStatus(JsonField.of(employmentStatus)) + + @JsonProperty("employment_status") + @ExcludeMissing + fun employmentStatus(employmentStatus: JsonField) = apply { + this.employmentStatus = employmentStatus + } + fun incomeHistory(incomeHistory: Boolean) = incomeHistory(JsonField.of(incomeHistory)) @@ -2294,6 +2314,7 @@ private constructor( startDate, endDate, isActive, + employmentStatus, incomeHistory, classCode, customFields, @@ -2883,17 +2904,17 @@ private constructor( return true } - return /* spotless:off */ other is SupportedEmploymentFields && id == other.id && firstName == other.firstName && middleName == other.middleName && lastName == other.lastName && title == other.title && startDate == other.startDate && endDate == other.endDate && isActive == other.isActive && incomeHistory == other.incomeHistory && classCode == other.classCode && customFields == other.customFields && department == other.department && employment == other.employment && income == other.income && location == other.location && manager == other.manager && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is SupportedEmploymentFields && id == other.id && firstName == other.firstName && middleName == other.middleName && lastName == other.lastName && title == other.title && startDate == other.startDate && endDate == other.endDate && isActive == other.isActive && employmentStatus == other.employmentStatus && incomeHistory == other.incomeHistory && classCode == other.classCode && customFields == other.customFields && department == other.department && employment == other.employment && income == other.income && location == other.location && manager == other.manager && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(id, firstName, middleName, lastName, title, startDate, endDate, isActive, incomeHistory, classCode, customFields, department, employment, income, location, manager, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, firstName, middleName, lastName, title, startDate, endDate, isActive, employmentStatus, incomeHistory, classCode, customFields, department, employment, income, location, manager, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "SupportedEmploymentFields{id=$id, firstName=$firstName, middleName=$middleName, lastName=$lastName, title=$title, startDate=$startDate, endDate=$endDate, isActive=$isActive, incomeHistory=$incomeHistory, classCode=$classCode, customFields=$customFields, department=$department, employment=$employment, income=$income, location=$location, manager=$manager, additionalProperties=$additionalProperties}" + "SupportedEmploymentFields{id=$id, firstName=$firstName, middleName=$middleName, lastName=$lastName, title=$title, startDate=$startDate, endDate=$endDate, isActive=$isActive, employmentStatus=$employmentStatus, incomeHistory=$incomeHistory, classCode=$classCode, customFields=$customFields, department=$department, employment=$employment, income=$income, location=$location, manager=$manager, additionalProperties=$additionalProperties}" } @JsonDeserialize(builder = SupportedIndividualFields.Builder::class) @@ -5197,29 +5218,17 @@ private constructor( @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - 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() - companion object { - @JvmField val ASSISTED = Type(JsonField.of("assisted")) + @JvmField val ASSISTED = of("assisted") - @JvmField val CREDENTIAL = Type(JsonField.of("credential")) + @JvmField val CREDENTIAL = of("credential") - @JvmField val API_TOKEN = Type(JsonField.of("api_token")) + @JvmField val API_TOKEN = of("api_token") - @JvmField val API_CREDENTIAL = Type(JsonField.of("api_credential")) + @JvmField val API_CREDENTIAL = of("api_credential") - @JvmField val OAUTH = Type(JsonField.of("oauth")) + @JvmField val OAUTH = of("oauth") @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } @@ -5262,6 +5271,18 @@ private constructor( } 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 { diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ProviderListParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ProviderListParams.kt index adeb608e..5b6d393d 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ProviderListParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ProviderListParams.kt @@ -5,7 +5,6 @@ package com.tryfinch.api.models import com.tryfinch.api.core.NoAutoDetect import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams -import com.tryfinch.api.models.* import java.util.Objects class ProviderListParams 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 31fb11cd..674264ae 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 @@ -12,7 +12,6 @@ import com.tryfinch.api.core.NoAutoDetect import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams import com.tryfinch.api.core.toImmutable -import com.tryfinch.api.models.* import java.util.Objects import java.util.Optional 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 587b47f6..6b1ffd95 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 @@ -16,7 +16,6 @@ import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams import com.tryfinch.api.core.toImmutable import com.tryfinch.api.errors.FinchInvalidDataException -import com.tryfinch.api.models.* import java.util.Objects import java.util.Optional @@ -562,23 +561,11 @@ constructor( @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return /* spotless:off */ other is AccountType && value == other.value /* spotless:on */ - } - - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() - companion object { - @JvmField val CHECKING = AccountType(JsonField.of("checking")) + @JvmField val CHECKING = of("checking") - @JvmField val SAVINGS = AccountType(JsonField.of("savings")) + @JvmField val SAVINGS = of("savings") @JvmStatic fun of(value: String) = AccountType(JsonField.of(value)) } @@ -609,6 +596,18 @@ constructor( } fun asString(): String = _value().asStringOrThrow() + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is AccountType && value == other.value /* spotless:on */ + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() } override fun equals(other: Any?): Boolean { @@ -864,25 +863,13 @@ constructor( @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return /* spotless:off */ other is Subtype && value == other.value /* spotless:on */ - } - - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() - companion object { - @JvmField val S_CORPORATION = Subtype(JsonField.of("s_corporation")) + @JvmField val S_CORPORATION = of("s_corporation") - @JvmField val C_CORPORATION = Subtype(JsonField.of("c_corporation")) + @JvmField val C_CORPORATION = of("c_corporation") - @JvmField val B_CORPORATION = Subtype(JsonField.of("b_corporation")) + @JvmField val B_CORPORATION = of("b_corporation") @JvmStatic fun of(value: String) = Subtype(JsonField.of(value)) } @@ -917,43 +904,43 @@ constructor( } fun asString(): String = _value().asStringOrThrow() - } - - class Type - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { - - @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value override fun equals(other: Any?): Boolean { if (this === other) { return true } - return /* spotless:off */ other is Type && value == other.value /* spotless:on */ + return /* spotless:off */ other is Subtype && 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 { + + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { - @JvmField val LLC = Type(JsonField.of("llc")) + @JvmField val LLC = of("llc") - @JvmField val LP = Type(JsonField.of("lp")) + @JvmField val LP = of("lp") - @JvmField val CORPORATION = Type(JsonField.of("corporation")) + @JvmField val CORPORATION = of("corporation") - @JvmField val SOLE_PROPRIETOR = Type(JsonField.of("sole_proprietor")) + @JvmField val SOLE_PROPRIETOR = of("sole_proprietor") - @JvmField val NON_PROFIT = Type(JsonField.of("non_profit")) + @JvmField val NON_PROFIT = of("non_profit") - @JvmField val PARTNERSHIP = Type(JsonField.of("partnership")) + @JvmField val PARTNERSHIP = of("partnership") - @JvmField val COOPERATIVE = Type(JsonField.of("cooperative")) + @JvmField val COOPERATIVE = of("cooperative") @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } @@ -1004,6 +991,18 @@ constructor( } 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 { 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 fcd9f008..67ef1401 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 @@ -16,7 +16,6 @@ import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams import com.tryfinch.api.core.toImmutable import com.tryfinch.api.errors.FinchInvalidDataException -import com.tryfinch.api.models.* import java.util.Objects import java.util.Optional @@ -374,27 +373,15 @@ constructor( @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return /* spotless:off */ other is AuthenticationType && value == other.value /* spotless:on */ - } - - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() - companion object { - @JvmField val CREDENTIAL = AuthenticationType(JsonField.of("credential")) + @JvmField val CREDENTIAL = of("credential") - @JvmField val API_TOKEN = AuthenticationType(JsonField.of("api_token")) + @JvmField val API_TOKEN = of("api_token") - @JvmField val OAUTH = AuthenticationType(JsonField.of("oauth")) + @JvmField val OAUTH = of("oauth") - @JvmField val ASSISTED = AuthenticationType(JsonField.of("assisted")) + @JvmField val ASSISTED = of("assisted") @JvmStatic fun of(value: String) = AuthenticationType(JsonField.of(value)) } @@ -433,6 +420,18 @@ constructor( } fun asString(): String = _value().asStringOrThrow() + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is AuthenticationType && value == other.value /* spotless:on */ + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() } override fun equals(other: Any?): Boolean { 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 37a2baab..0d332a03 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 @@ -12,7 +12,6 @@ import com.tryfinch.api.core.NoAutoDetect import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams import com.tryfinch.api.core.toImmutable -import com.tryfinch.api.models.* import java.util.Objects import java.util.Optional 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 23a29139..21767bea 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 @@ -16,7 +16,6 @@ import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams import com.tryfinch.api.core.toImmutable import com.tryfinch.api.errors.FinchInvalidDataException -import com.tryfinch.api.models.* import java.util.Objects import java.util.Optional @@ -367,27 +366,15 @@ constructor( @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return /* spotless:off */ other is AuthenticationType && value == other.value /* spotless:on */ - } - - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() - companion object { - @JvmField val CREDENTIAL = AuthenticationType(JsonField.of("credential")) + @JvmField val CREDENTIAL = of("credential") - @JvmField val API_TOKEN = AuthenticationType(JsonField.of("api_token")) + @JvmField val API_TOKEN = of("api_token") - @JvmField val OAUTH = AuthenticationType(JsonField.of("oauth")) + @JvmField val OAUTH = of("oauth") - @JvmField val ASSISTED = AuthenticationType(JsonField.of("assisted")) + @JvmField val ASSISTED = of("assisted") @JvmStatic fun of(value: String) = AuthenticationType(JsonField.of(value)) } @@ -426,6 +413,18 @@ constructor( } fun asString(): String = _value().asStringOrThrow() + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is AuthenticationType && value == other.value /* spotless:on */ + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() } 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 148b2f54..ad31e5b4 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 @@ -16,7 +16,6 @@ import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams import com.tryfinch.api.core.toImmutable import com.tryfinch.api.errors.FinchInvalidDataException -import com.tryfinch.api.models.* import java.util.Objects class SandboxDirectoryCreateParams @@ -265,6 +264,7 @@ constructor( private val endDate: String?, private val latestRehireDate: String?, private val isActive: Boolean?, + private val employmentStatus: EmploymentStatus?, private val classCode: String?, private val location: Location?, private val income: Income?, @@ -335,6 +335,10 @@ constructor( /** `true` if the individual an an active employee or contractor at the company. */ @JsonProperty("is_active") fun isActive(): Boolean? = isActive + /** The detailed employment status of the individual. */ + @JsonProperty("employment_status") + fun employmentStatus(): EmploymentStatus? = employmentStatus + /** Worker's compensation classification code for this employee */ @JsonProperty("class_code") fun classCode(): String? = classCode @@ -392,6 +396,7 @@ constructor( private var endDate: String? = null private var latestRehireDate: String? = null private var isActive: Boolean? = null + private var employmentStatus: EmploymentStatus? = null private var classCode: String? = null private var location: Location? = null private var income: Income? = null @@ -422,6 +427,7 @@ constructor( this.endDate = individualOrEmployment.endDate this.latestRehireDate = individualOrEmployment.latestRehireDate this.isActive = individualOrEmployment.isActive + this.employmentStatus = individualOrEmployment.employmentStatus this.classCode = individualOrEmployment.classCode this.location = individualOrEmployment.location this.income = individualOrEmployment.income @@ -511,6 +517,12 @@ constructor( @JsonProperty("is_active") fun isActive(isActive: Boolean) = apply { this.isActive = isActive } + /** The detailed employment status of the individual. */ + @JsonProperty("employment_status") + fun employmentStatus(employmentStatus: EmploymentStatus) = apply { + this.employmentStatus = employmentStatus + } + /** Worker's compensation classification code for this employee */ @JsonProperty("class_code") fun classCode(classCode: String) = apply { this.classCode = classCode } @@ -580,6 +592,7 @@ constructor( endDate, latestRehireDate, isActive, + employmentStatus, classCode, location, income, @@ -817,23 +830,11 @@ constructor( @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - 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() - companion object { - @JvmField val WORK = Type(JsonField.of("work")) + @JvmField val WORK = of("work") - @JvmField val PERSONAL = Type(JsonField.of("personal")) + @JvmField val PERSONAL = of("personal") @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } @@ -864,6 +865,18 @@ constructor( } 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 { @@ -968,32 +981,19 @@ constructor( @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return /* spotless:off */ other is Subtype && value == other.value /* spotless:on */ - } - - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() - companion object { - @JvmField val FULL_TIME = Subtype(JsonField.of("full_time")) + @JvmField val FULL_TIME = of("full_time") - @JvmField val INTERN = Subtype(JsonField.of("intern")) + @JvmField val INTERN = of("intern") - @JvmField val PART_TIME = Subtype(JsonField.of("part_time")) + @JvmField val PART_TIME = of("part_time") - @JvmField val TEMP = Subtype(JsonField.of("temp")) + @JvmField val TEMP = of("temp") - @JvmField val SEASONAL = Subtype(JsonField.of("seasonal")) + @JvmField val SEASONAL = of("seasonal") - @JvmField - val INDIVIDUAL_CONTRACTOR = Subtype(JsonField.of("individual_contractor")) + @JvmField val INDIVIDUAL_CONTRACTOR = of("individual_contractor") @JvmStatic fun of(value: String) = Subtype(JsonField.of(value)) } @@ -1040,33 +1040,33 @@ constructor( } fun asString(): String = _value().asStringOrThrow() - } - - class Type - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { - - @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value override fun equals(other: Any?): Boolean { if (this === other) { return true } - return /* spotless:off */ other is Type && value == other.value /* spotless:on */ + return /* spotless:off */ other is Subtype && 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 { + + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { - @JvmField val EMPLOYEE = Type(JsonField.of("employee")) + @JvmField val EMPLOYEE = of("employee") - @JvmField val CONTRACTOR = Type(JsonField.of("contractor")) + @JvmField val CONTRACTOR = of("contractor") @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } @@ -1097,6 +1097,18 @@ constructor( } 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 { @@ -1117,7 +1129,7 @@ constructor( "Employment{type=$type, subtype=$subtype, additionalProperties=$additionalProperties}" } - class Ethnicity + class EmploymentStatus @JsonCreator private constructor( private val value: JsonField, @@ -1125,40 +1137,112 @@ constructor( @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + companion object { + + @JvmField val ACTIVE = of("active") + + @JvmField val DECEASED = of("deceased") + + @JvmField val LEAVE = of("leave") + + @JvmField val ONBOARDING = of("onboarding") + + @JvmField val PREHIRE = of("prehire") + + @JvmField val RETIRED = of("retired") + + @JvmField val TERMINATED = of("terminated") + + @JvmStatic fun of(value: String) = EmploymentStatus(JsonField.of(value)) + } + + enum class Known { + ACTIVE, + DECEASED, + LEAVE, + ONBOARDING, + PREHIRE, + RETIRED, + TERMINATED, + } + + enum class Value { + ACTIVE, + DECEASED, + LEAVE, + ONBOARDING, + PREHIRE, + RETIRED, + TERMINATED, + _UNKNOWN, + } + + fun value(): Value = + when (this) { + ACTIVE -> Value.ACTIVE + DECEASED -> Value.DECEASED + LEAVE -> Value.LEAVE + ONBOARDING -> Value.ONBOARDING + PREHIRE -> Value.PREHIRE + RETIRED -> Value.RETIRED + TERMINATED -> Value.TERMINATED + else -> Value._UNKNOWN + } + + fun known(): Known = + when (this) { + ACTIVE -> Known.ACTIVE + DECEASED -> Known.DECEASED + LEAVE -> Known.LEAVE + ONBOARDING -> Known.ONBOARDING + PREHIRE -> Known.PREHIRE + RETIRED -> Known.RETIRED + TERMINATED -> Known.TERMINATED + else -> throw FinchInvalidDataException("Unknown EmploymentStatus: $value") + } + + fun asString(): String = _value().asStringOrThrow() + override fun equals(other: Any?): Boolean { if (this === other) { return true } - return /* spotless:off */ other is Ethnicity && value == other.value /* spotless:on */ + return /* spotless:off */ other is EmploymentStatus && value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() override fun toString() = value.toString() + } + + class Ethnicity + @JsonCreator + private constructor( + private val value: JsonField, + ) : Enum { + + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { - @JvmField val ASIAN = Ethnicity(JsonField.of("asian")) + @JvmField val ASIAN = of("asian") - @JvmField val WHITE = Ethnicity(JsonField.of("white")) + @JvmField val WHITE = of("white") - @JvmField - val BLACK_OR_AFRICAN_AMERICAN = Ethnicity(JsonField.of("black_or_african_american")) + @JvmField val BLACK_OR_AFRICAN_AMERICAN = of("black_or_african_american") @JvmField - val NATIVE_HAWAIIAN_OR_PACIFIC_ISLANDER = - Ethnicity(JsonField.of("native_hawaiian_or_pacific_islander")) + val NATIVE_HAWAIIAN_OR_PACIFIC_ISLANDER = of("native_hawaiian_or_pacific_islander") @JvmField - val AMERICAN_INDIAN_OR_ALASKA_NATIVE = - Ethnicity(JsonField.of("american_indian_or_alaska_native")) + val AMERICAN_INDIAN_OR_ALASKA_NATIVE = of("american_indian_or_alaska_native") - @JvmField val HISPANIC_OR_LATINO = Ethnicity(JsonField.of("hispanic_or_latino")) + @JvmField val HISPANIC_OR_LATINO = of("hispanic_or_latino") - @JvmField val TWO_OR_MORE_RACES = Ethnicity(JsonField.of("two_or_more_races")) + @JvmField val TWO_OR_MORE_RACES = of("two_or_more_races") - @JvmField val DECLINE_TO_SPECIFY = Ethnicity(JsonField.of("decline_to_specify")) + @JvmField val DECLINE_TO_SPECIFY = of("decline_to_specify") @JvmStatic fun of(value: String) = Ethnicity(JsonField.of(value)) } @@ -1213,37 +1297,37 @@ constructor( } fun asString(): String = _value().asStringOrThrow() - } - - class Gender - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { - - @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value override fun equals(other: Any?): Boolean { if (this === other) { return true } - return /* spotless:off */ other is Gender && value == other.value /* spotless:on */ + return /* spotless:off */ other is Ethnicity && value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() override fun toString() = value.toString() + } + + class Gender + @JsonCreator + private constructor( + private val value: JsonField, + ) : Enum { + + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { - @JvmField val FEMALE = Gender(JsonField.of("female")) + @JvmField val FEMALE = of("female") - @JvmField val MALE = Gender(JsonField.of("male")) + @JvmField val MALE = of("male") - @JvmField val OTHER = Gender(JsonField.of("other")) + @JvmField val OTHER = of("other") - @JvmField val DECLINE_TO_SPECIFY = Gender(JsonField.of("decline_to_specify")) + @JvmField val DECLINE_TO_SPECIFY = of("decline_to_specify") @JvmStatic fun of(value: String) = Gender(JsonField.of(value)) } @@ -1282,6 +1366,18 @@ constructor( } fun asString(): String = _value().asStringOrThrow() + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Gender && value == other.value /* spotless:on */ + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() } /** The manager object representing the manager of the individual within the org. */ @@ -1428,23 +1524,11 @@ constructor( @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - 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() - companion object { - @JvmField val WORK = Type(JsonField.of("work")) + @JvmField val WORK = of("work") - @JvmField val PERSONAL = Type(JsonField.of("personal")) + @JvmField val PERSONAL = of("personal") @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } @@ -1475,6 +1559,18 @@ constructor( } 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 { @@ -1500,17 +1596,17 @@ constructor( return true } - return /* spotless:off */ other is IndividualOrEmployment && firstName == other.firstName && middleName == other.middleName && lastName == other.lastName && preferredName == other.preferredName && emails == other.emails && phoneNumbers == other.phoneNumbers && gender == other.gender && ethnicity == other.ethnicity && dob == other.dob && ssn == other.ssn && encryptedSsn == other.encryptedSsn && residence == other.residence && title == other.title && manager == other.manager && department == other.department && employment == other.employment && startDate == other.startDate && endDate == other.endDate && latestRehireDate == other.latestRehireDate && isActive == other.isActive && classCode == other.classCode && location == other.location && income == other.income && incomeHistory == other.incomeHistory && customFields == other.customFields && sourceId == other.sourceId && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is IndividualOrEmployment && firstName == other.firstName && middleName == other.middleName && lastName == other.lastName && preferredName == other.preferredName && emails == other.emails && phoneNumbers == other.phoneNumbers && gender == other.gender && ethnicity == other.ethnicity && dob == other.dob && ssn == other.ssn && encryptedSsn == other.encryptedSsn && residence == other.residence && title == other.title && manager == other.manager && department == other.department && employment == other.employment && startDate == other.startDate && endDate == other.endDate && latestRehireDate == other.latestRehireDate && isActive == other.isActive && employmentStatus == other.employmentStatus && classCode == other.classCode && location == other.location && income == other.income && incomeHistory == other.incomeHistory && customFields == other.customFields && sourceId == other.sourceId && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(firstName, middleName, lastName, preferredName, emails, phoneNumbers, gender, ethnicity, dob, ssn, encryptedSsn, residence, title, manager, department, employment, startDate, endDate, latestRehireDate, isActive, classCode, location, income, incomeHistory, customFields, sourceId, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(firstName, middleName, lastName, preferredName, emails, phoneNumbers, gender, ethnicity, dob, ssn, encryptedSsn, residence, title, manager, department, employment, startDate, endDate, latestRehireDate, isActive, employmentStatus, classCode, location, income, incomeHistory, customFields, sourceId, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "IndividualOrEmployment{firstName=$firstName, middleName=$middleName, lastName=$lastName, preferredName=$preferredName, emails=$emails, phoneNumbers=$phoneNumbers, gender=$gender, ethnicity=$ethnicity, dob=$dob, ssn=$ssn, encryptedSsn=$encryptedSsn, residence=$residence, title=$title, manager=$manager, department=$department, employment=$employment, startDate=$startDate, endDate=$endDate, latestRehireDate=$latestRehireDate, isActive=$isActive, classCode=$classCode, location=$location, income=$income, incomeHistory=$incomeHistory, customFields=$customFields, sourceId=$sourceId, additionalProperties=$additionalProperties}" + "IndividualOrEmployment{firstName=$firstName, middleName=$middleName, lastName=$lastName, preferredName=$preferredName, emails=$emails, phoneNumbers=$phoneNumbers, gender=$gender, ethnicity=$ethnicity, dob=$dob, ssn=$ssn, encryptedSsn=$encryptedSsn, residence=$residence, title=$title, manager=$manager, department=$department, employment=$employment, startDate=$startDate, endDate=$endDate, latestRehireDate=$latestRehireDate, isActive=$isActive, employmentStatus=$employmentStatus, classCode=$classCode, location=$location, income=$income, incomeHistory=$incomeHistory, customFields=$customFields, sourceId=$sourceId, additionalProperties=$additionalProperties}" } 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 c7e1f146..475f1af2 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 @@ -16,7 +16,6 @@ import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams import com.tryfinch.api.core.toImmutable import com.tryfinch.api.errors.FinchInvalidDataException -import com.tryfinch.api.models.* import java.util.Objects import java.util.Optional @@ -27,6 +26,7 @@ constructor( private val customFields: List?, private val department: Department?, private val employment: Employment?, + private val employmentStatus: EmploymentStatus?, private val endDate: String?, private val firstName: String?, private val income: Income?, @@ -55,6 +55,8 @@ constructor( fun employment(): Optional = Optional.ofNullable(employment) + fun employmentStatus(): Optional = Optional.ofNullable(employmentStatus) + fun endDate(): Optional = Optional.ofNullable(endDate) fun firstName(): Optional = Optional.ofNullable(firstName) @@ -94,6 +96,7 @@ constructor( customFields, department, employment, + employmentStatus, endDate, firstName, income, @@ -130,6 +133,7 @@ constructor( private val customFields: List?, private val department: Department?, private val employment: Employment?, + private val employmentStatus: EmploymentStatus?, private val endDate: String?, private val firstName: String?, private val income: Income?, @@ -161,6 +165,10 @@ constructor( /** The employment object. */ @JsonProperty("employment") fun employment(): Employment? = employment + /** The detailed employment status of the individual. */ + @JsonProperty("employment_status") + fun employmentStatus(): EmploymentStatus? = employmentStatus + @JsonProperty("end_date") fun endDate(): String? = endDate /** The legal first name of the individual. */ @@ -217,6 +225,7 @@ constructor( private var customFields: List? = null private var department: Department? = null private var employment: Employment? = null + private var employmentStatus: EmploymentStatus? = null private var endDate: String? = null private var firstName: String? = null private var income: Income? = null @@ -238,6 +247,7 @@ constructor( this.customFields = sandboxEmploymentUpdateBody.customFields this.department = sandboxEmploymentUpdateBody.department this.employment = sandboxEmploymentUpdateBody.employment + this.employmentStatus = sandboxEmploymentUpdateBody.employmentStatus this.endDate = sandboxEmploymentUpdateBody.endDate this.firstName = sandboxEmploymentUpdateBody.firstName this.income = sandboxEmploymentUpdateBody.income @@ -275,6 +285,12 @@ constructor( @JsonProperty("employment") fun employment(employment: Employment) = apply { this.employment = employment } + /** The detailed employment status of the individual. */ + @JsonProperty("employment_status") + fun employmentStatus(employmentStatus: EmploymentStatus) = apply { + this.employmentStatus = employmentStatus + } + @JsonProperty("end_date") fun endDate(endDate: String) = apply { this.endDate = endDate } @@ -349,6 +365,7 @@ constructor( customFields?.toImmutable(), department, employment, + employmentStatus, endDate, firstName, income, @@ -371,17 +388,17 @@ constructor( return true } - return /* spotless:off */ other is SandboxEmploymentUpdateBody && classCode == other.classCode && customFields == other.customFields && department == other.department && employment == other.employment && 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 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 */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(classCode, customFields, department, employment, endDate, firstName, income, incomeHistory, isActive, lastName, latestRehireDate, location, manager, middleName, sourceId, startDate, title, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(classCode, customFields, department, employment, employmentStatus, endDate, firstName, income, incomeHistory, isActive, lastName, latestRehireDate, location, manager, middleName, sourceId, startDate, title, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "SandboxEmploymentUpdateBody{classCode=$classCode, customFields=$customFields, department=$department, employment=$employment, 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}" + "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}" } fun toBuilder() = Builder().from(this) @@ -399,6 +416,7 @@ constructor( private var customFields: MutableList = mutableListOf() private var department: Department? = null private var employment: Employment? = null + private var employmentStatus: EmploymentStatus? = null private var endDate: String? = null private var firstName: String? = null private var income: Income? = null @@ -424,6 +442,7 @@ constructor( sandboxEmploymentUpdateParams.customFields?.toMutableList() ?: mutableListOf() department = sandboxEmploymentUpdateParams.department employment = sandboxEmploymentUpdateParams.employment + employmentStatus = sandboxEmploymentUpdateParams.employmentStatus endDate = sandboxEmploymentUpdateParams.endDate firstName = sandboxEmploymentUpdateParams.firstName income = sandboxEmploymentUpdateParams.income @@ -470,6 +489,11 @@ constructor( /** The employment object. */ fun employment(employment: Employment) = apply { this.employment = employment } + /** The detailed employment status of the individual. */ + fun employmentStatus(employmentStatus: EmploymentStatus) = apply { + this.employmentStatus = employmentStatus + } + fun endDate(endDate: String) = apply { this.endDate = endDate } /** The legal first name of the individual. */ @@ -646,6 +670,7 @@ constructor( customFields.toImmutable().ifEmpty { null }, department, employment, + employmentStatus, endDate, firstName, income, @@ -901,31 +926,19 @@ constructor( @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return /* spotless:off */ other is Subtype && value == other.value /* spotless:on */ - } - - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() - companion object { - @JvmField val FULL_TIME = Subtype(JsonField.of("full_time")) + @JvmField val FULL_TIME = of("full_time") - @JvmField val INTERN = Subtype(JsonField.of("intern")) + @JvmField val INTERN = of("intern") - @JvmField val PART_TIME = Subtype(JsonField.of("part_time")) + @JvmField val PART_TIME = of("part_time") - @JvmField val TEMP = Subtype(JsonField.of("temp")) + @JvmField val TEMP = of("temp") - @JvmField val SEASONAL = Subtype(JsonField.of("seasonal")) + @JvmField val SEASONAL = of("seasonal") - @JvmField val INDIVIDUAL_CONTRACTOR = Subtype(JsonField.of("individual_contractor")) + @JvmField val INDIVIDUAL_CONTRACTOR = of("individual_contractor") @JvmStatic fun of(value: String) = Subtype(JsonField.of(value)) } @@ -972,33 +985,33 @@ constructor( } fun asString(): String = _value().asStringOrThrow() - } - - class Type - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { - - @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value override fun equals(other: Any?): Boolean { if (this === other) { return true } - return /* spotless:off */ other is Type && value == other.value /* spotless:on */ + return /* spotless:off */ other is Subtype && 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 { + + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { - @JvmField val EMPLOYEE = Type(JsonField.of("employee")) + @JvmField val EMPLOYEE = of("employee") - @JvmField val CONTRACTOR = Type(JsonField.of("contractor")) + @JvmField val CONTRACTOR = of("contractor") @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } @@ -1029,6 +1042,18 @@ constructor( } 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 { @@ -1049,6 +1074,93 @@ constructor( "Employment{type=$type, subtype=$subtype, additionalProperties=$additionalProperties}" } + class EmploymentStatus + @JsonCreator + private constructor( + private val value: JsonField, + ) : Enum { + + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + @JvmField val ACTIVE = of("active") + + @JvmField val DECEASED = of("deceased") + + @JvmField val LEAVE = of("leave") + + @JvmField val ONBOARDING = of("onboarding") + + @JvmField val PREHIRE = of("prehire") + + @JvmField val RETIRED = of("retired") + + @JvmField val TERMINATED = of("terminated") + + @JvmStatic fun of(value: String) = EmploymentStatus(JsonField.of(value)) + } + + enum class Known { + ACTIVE, + DECEASED, + LEAVE, + ONBOARDING, + PREHIRE, + RETIRED, + TERMINATED, + } + + enum class Value { + ACTIVE, + DECEASED, + LEAVE, + ONBOARDING, + PREHIRE, + RETIRED, + TERMINATED, + _UNKNOWN, + } + + fun value(): Value = + when (this) { + ACTIVE -> Value.ACTIVE + DECEASED -> Value.DECEASED + LEAVE -> Value.LEAVE + ONBOARDING -> Value.ONBOARDING + PREHIRE -> Value.PREHIRE + RETIRED -> Value.RETIRED + TERMINATED -> Value.TERMINATED + else -> Value._UNKNOWN + } + + fun known(): Known = + when (this) { + ACTIVE -> Known.ACTIVE + DECEASED -> Known.DECEASED + LEAVE -> Known.LEAVE + ONBOARDING -> Known.ONBOARDING + PREHIRE -> Known.PREHIRE + RETIRED -> Known.RETIRED + TERMINATED -> Known.TERMINATED + else -> throw FinchInvalidDataException("Unknown EmploymentStatus: $value") + } + + fun asString(): String = _value().asStringOrThrow() + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is EmploymentStatus && value == other.value /* spotless:on */ + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + /** The manager object representing the manager of the individual within the org. */ @JsonDeserialize(builder = Manager.Builder::class) @NoAutoDetect @@ -1125,11 +1237,11 @@ constructor( return true } - return /* spotless:off */ other is SandboxEmploymentUpdateParams && individualId == other.individualId && classCode == other.classCode && customFields == other.customFields && department == other.department && employment == other.employment && endDate == other.endDate && firstName == other.firstName && income == other.income && incomeHistory == other.incomeHistory && isActive == other.isActive && lastName == other.lastName && latestRehireDate == other.latestRehireDate && location == other.location && manager == other.manager && middleName == other.middleName && sourceId == other.sourceId && startDate == other.startDate && title == other.title && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams && additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ + return /* spotless:off */ other is SandboxEmploymentUpdateParams && individualId == other.individualId && classCode == other.classCode && customFields == other.customFields && department == other.department && employment == other.employment && employmentStatus == other.employmentStatus && endDate == other.endDate && firstName == other.firstName && income == other.income && incomeHistory == other.incomeHistory && isActive == other.isActive && lastName == other.lastName && latestRehireDate == other.latestRehireDate && location == other.location && manager == other.manager && middleName == other.middleName && sourceId == other.sourceId && startDate == other.startDate && title == other.title && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams && additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ } - override fun hashCode(): Int = /* spotless:off */ Objects.hash(individualId, classCode, customFields, department, employment, endDate, firstName, income, incomeHistory, isActive, lastName, latestRehireDate, location, manager, middleName, sourceId, startDate, title, additionalHeaders, additionalQueryParams, additionalBodyProperties) /* spotless:on */ + override fun hashCode(): Int = /* spotless:off */ Objects.hash(individualId, classCode, customFields, department, employment, employmentStatus, endDate, firstName, income, incomeHistory, isActive, lastName, latestRehireDate, location, manager, middleName, sourceId, startDate, title, additionalHeaders, additionalQueryParams, additionalBodyProperties) /* spotless:on */ override fun toString() = - "SandboxEmploymentUpdateParams{individualId=$individualId, classCode=$classCode, customFields=$customFields, department=$department, employment=$employment, endDate=$endDate, firstName=$firstName, income=$income, incomeHistory=$incomeHistory, isActive=$isActive, lastName=$lastName, latestRehireDate=$latestRehireDate, location=$location, manager=$manager, middleName=$middleName, sourceId=$sourceId, startDate=$startDate, title=$title, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams, additionalBodyProperties=$additionalBodyProperties}" + "SandboxEmploymentUpdateParams{individualId=$individualId, classCode=$classCode, customFields=$customFields, department=$department, employment=$employment, employmentStatus=$employmentStatus, endDate=$endDate, firstName=$firstName, income=$income, incomeHistory=$incomeHistory, isActive=$isActive, lastName=$lastName, latestRehireDate=$latestRehireDate, location=$location, manager=$manager, middleName=$middleName, sourceId=$sourceId, startDate=$startDate, title=$title, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams, additionalBodyProperties=$additionalBodyProperties}" } 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 b4c5774b..983accde 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 @@ -16,7 +16,6 @@ import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams import com.tryfinch.api.core.toImmutable import com.tryfinch.api.errors.FinchInvalidDataException -import com.tryfinch.api.models.* import java.util.Objects import java.util.Optional @@ -618,23 +617,11 @@ constructor( @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - 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() - companion object { - @JvmField val WORK = Type(JsonField.of("work")) + @JvmField val WORK = of("work") - @JvmField val PERSONAL = Type(JsonField.of("personal")) + @JvmField val PERSONAL = of("personal") @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } @@ -665,6 +652,18 @@ constructor( } 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 { @@ -693,40 +692,24 @@ constructor( @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return /* spotless:off */ other is Ethnicity && value == other.value /* spotless:on */ - } - - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() - companion object { - @JvmField val ASIAN = Ethnicity(JsonField.of("asian")) + @JvmField val ASIAN = of("asian") - @JvmField val WHITE = Ethnicity(JsonField.of("white")) + @JvmField val WHITE = of("white") - @JvmField - val BLACK_OR_AFRICAN_AMERICAN = Ethnicity(JsonField.of("black_or_african_american")) + @JvmField val BLACK_OR_AFRICAN_AMERICAN = of("black_or_african_american") @JvmField - val NATIVE_HAWAIIAN_OR_PACIFIC_ISLANDER = - Ethnicity(JsonField.of("native_hawaiian_or_pacific_islander")) + val NATIVE_HAWAIIAN_OR_PACIFIC_ISLANDER = of("native_hawaiian_or_pacific_islander") - @JvmField - val AMERICAN_INDIAN_OR_ALASKA_NATIVE = - Ethnicity(JsonField.of("american_indian_or_alaska_native")) + @JvmField val AMERICAN_INDIAN_OR_ALASKA_NATIVE = of("american_indian_or_alaska_native") - @JvmField val HISPANIC_OR_LATINO = Ethnicity(JsonField.of("hispanic_or_latino")) + @JvmField val HISPANIC_OR_LATINO = of("hispanic_or_latino") - @JvmField val TWO_OR_MORE_RACES = Ethnicity(JsonField.of("two_or_more_races")) + @JvmField val TWO_OR_MORE_RACES = of("two_or_more_races") - @JvmField val DECLINE_TO_SPECIFY = Ethnicity(JsonField.of("decline_to_specify")) + @JvmField val DECLINE_TO_SPECIFY = of("decline_to_specify") @JvmStatic fun of(value: String) = Ethnicity(JsonField.of(value)) } @@ -781,37 +764,37 @@ constructor( } fun asString(): String = _value().asStringOrThrow() - } - - class Gender - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { - - @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value override fun equals(other: Any?): Boolean { if (this === other) { return true } - return /* spotless:off */ other is Gender && value == other.value /* spotless:on */ + return /* spotless:off */ other is Ethnicity && value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() override fun toString() = value.toString() + } + + class Gender + @JsonCreator + private constructor( + private val value: JsonField, + ) : Enum { + + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { - @JvmField val FEMALE = Gender(JsonField.of("female")) + @JvmField val FEMALE = of("female") - @JvmField val MALE = Gender(JsonField.of("male")) + @JvmField val MALE = of("male") - @JvmField val OTHER = Gender(JsonField.of("other")) + @JvmField val OTHER = of("other") - @JvmField val DECLINE_TO_SPECIFY = Gender(JsonField.of("decline_to_specify")) + @JvmField val DECLINE_TO_SPECIFY = of("decline_to_specify") @JvmStatic fun of(value: String) = Gender(JsonField.of(value)) } @@ -850,6 +833,18 @@ constructor( } fun asString(): String = _value().asStringOrThrow() + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Gender && value == other.value /* spotless:on */ + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() } @JsonDeserialize(builder = PhoneNumber.Builder::class) @@ -923,23 +918,11 @@ constructor( @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - 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() - companion object { - @JvmField val WORK = Type(JsonField.of("work")) + @JvmField val WORK = of("work") - @JvmField val PERSONAL = Type(JsonField.of("personal")) + @JvmField val PERSONAL = of("personal") @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } @@ -970,6 +953,18 @@ constructor( } 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 { 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 40cfdba5..1412fc7a 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 @@ -113,27 +113,15 @@ private constructor( @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - 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() - companion object { - @JvmField val COMPLETE = CompletionStatus(JsonField.of("complete")) + @JvmField val COMPLETE = of("complete") - @JvmField val REAUTH_ERROR = CompletionStatus(JsonField.of("reauth_error")) + @JvmField val REAUTH_ERROR = of("reauth_error") - @JvmField val PERMISSIONS_ERROR = CompletionStatus(JsonField.of("permissions_error")) + @JvmField val PERMISSIONS_ERROR = of("permissions_error") - @JvmField val ERROR = CompletionStatus(JsonField.of("error")) + @JvmField val ERROR = of("error") @JvmStatic fun of(value: String) = CompletionStatus(JsonField.of(value)) } @@ -172,31 +160,31 @@ private constructor( } fun asString(): String = _value().asStringOrThrow() - } - - class Type - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { - - @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value override fun equals(other: Any?): Boolean { if (this === other) { return true } - return /* spotless:off */ other is Type && value == other.value /* spotless:on */ + 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 { + + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { - @JvmField val DATA_SYNC_ALL = Type(JsonField.of("data_sync_all")) + @JvmField val DATA_SYNC_ALL = of("data_sync_all") @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } @@ -223,6 +211,18 @@ private constructor( } 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 { 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 9b1dd705..37c5fc5c 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 @@ -5,7 +5,6 @@ package com.tryfinch.api.models import com.tryfinch.api.core.NoAutoDetect import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams -import com.tryfinch.api.models.* import java.util.Objects class SandboxJobConfigurationRetrieveParams 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 17b433ed..cca375a1 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 @@ -16,7 +16,6 @@ import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams import com.tryfinch.api.core.toImmutable import com.tryfinch.api.errors.FinchInvalidDataException -import com.tryfinch.api.models.* import java.util.Objects class SandboxJobConfigurationUpdateParams @@ -313,27 +312,15 @@ constructor( @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - 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() - companion object { - @JvmField val COMPLETE = CompletionStatus(JsonField.of("complete")) + @JvmField val COMPLETE = of("complete") - @JvmField val REAUTH_ERROR = CompletionStatus(JsonField.of("reauth_error")) + @JvmField val REAUTH_ERROR = of("reauth_error") - @JvmField val PERMISSIONS_ERROR = CompletionStatus(JsonField.of("permissions_error")) + @JvmField val PERMISSIONS_ERROR = of("permissions_error") - @JvmField val ERROR = CompletionStatus(JsonField.of("error")) + @JvmField val ERROR = of("error") @JvmStatic fun of(value: String) = CompletionStatus(JsonField.of(value)) } @@ -372,31 +359,31 @@ constructor( } fun asString(): String = _value().asStringOrThrow() - } - - class Type - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { - - @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value override fun equals(other: Any?): Boolean { if (this === other) { return true } - return /* spotless:off */ other is Type && value == other.value /* spotless:on */ + 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 { + + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { - @JvmField val DATA_SYNC_ALL = Type(JsonField.of("data_sync_all")) + @JvmField val DATA_SYNC_ALL = of("data_sync_all") @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } @@ -423,6 +410,18 @@ constructor( } 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 { 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 f3842a65..5cbc45ea 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 @@ -16,7 +16,6 @@ import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams import com.tryfinch.api.core.toImmutable import com.tryfinch.api.errors.FinchInvalidDataException -import com.tryfinch.api.models.* import java.util.Objects class SandboxJobCreateParams @@ -283,21 +282,9 @@ constructor( @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - 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() - companion object { - @JvmField val DATA_SYNC_ALL = Type(JsonField.of("data_sync_all")) + @JvmField val DATA_SYNC_ALL = of("data_sync_all") @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } @@ -324,6 +311,18 @@ constructor( } 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 { 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 a105dc4c..fedfbba1 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 @@ -16,7 +16,6 @@ import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.http.QueryParams import com.tryfinch.api.core.toImmutable import com.tryfinch.api.errors.FinchInvalidDataException -import com.tryfinch.api.models.* import java.util.Objects import java.util.Optional @@ -596,45 +595,33 @@ constructor( @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - 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() - companion object { - @JvmField val SALARY = Type(JsonField.of("salary")) + @JvmField val SALARY = of("salary") - @JvmField val WAGE = Type(JsonField.of("wage")) + @JvmField val WAGE = of("wage") - @JvmField val REIMBURSEMENT = Type(JsonField.of("reimbursement")) + @JvmField val REIMBURSEMENT = of("reimbursement") - @JvmField val OVERTIME = Type(JsonField.of("overtime")) + @JvmField val OVERTIME = of("overtime") - @JvmField val SEVERANCE = Type(JsonField.of("severance")) + @JvmField val SEVERANCE = of("severance") - @JvmField val DOUBLE_OVERTIME = Type(JsonField.of("double_overtime")) + @JvmField val DOUBLE_OVERTIME = of("double_overtime") - @JvmField val PTO = Type(JsonField.of("pto")) + @JvmField val PTO = of("pto") - @JvmField val SICK = Type(JsonField.of("sick")) + @JvmField val SICK = of("sick") - @JvmField val BONUS = Type(JsonField.of("bonus")) + @JvmField val BONUS = of("bonus") - @JvmField val COMMISSION = Type(JsonField.of("commission")) + @JvmField val COMMISSION = of("commission") - @JvmField val TIPS = Type(JsonField.of("tips")) + @JvmField val TIPS = of("tips") - @JvmField val _1099 = Type(JsonField.of("1099")) + @JvmField val _1099 = of("1099") - @JvmField val OTHER = Type(JsonField.of("other")) + @JvmField val OTHER = of("other") @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } @@ -709,6 +696,18 @@ constructor( } 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 { @@ -962,23 +961,11 @@ constructor( @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return /* spotless:off */ other is PaymentMethod && value == other.value /* spotless:on */ - } - - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() - companion object { - @JvmField val CHECK = PaymentMethod(JsonField.of("check")) + @JvmField val CHECK = of("check") - @JvmField val DIRECT_DEPOSIT = PaymentMethod(JsonField.of("direct_deposit")) + @JvmField val DIRECT_DEPOSIT = of("direct_deposit") @JvmStatic fun of(value: String) = PaymentMethod(JsonField.of(value)) } @@ -1009,6 +996,18 @@ constructor( } fun asString(): String = _value().asStringOrThrow() + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is PaymentMethod && value == other.value /* spotless:on */ + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() } @JsonDeserialize(builder = Tax.Builder::class) @@ -1119,27 +1118,15 @@ constructor( @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - 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() - companion object { - @JvmField val STATE = Type(JsonField.of("state")) + @JvmField val STATE = of("state") - @JvmField val FEDERAL = Type(JsonField.of("federal")) + @JvmField val FEDERAL = of("federal") - @JvmField val LOCAL = Type(JsonField.of("local")) + @JvmField val LOCAL = of("local") - @JvmField val FICA = Type(JsonField.of("fica")) + @JvmField val FICA = of("fica") @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } @@ -1178,6 +1165,18 @@ constructor( } 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 { @@ -1206,25 +1205,13 @@ constructor( @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - 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() - companion object { - @JvmField val REGULAR_PAYROLL = Type(JsonField.of("regular_payroll")) + @JvmField val REGULAR_PAYROLL = of("regular_payroll") - @JvmField val OFF_CYCLE_PAYROLL = Type(JsonField.of("off_cycle_payroll")) + @JvmField val OFF_CYCLE_PAYROLL = of("off_cycle_payroll") - @JvmField val ONE_TIME_PAYMENT = Type(JsonField.of("one_time_payment")) + @JvmField val ONE_TIME_PAYMENT = of("one_time_payment") @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } @@ -1259,6 +1246,18 @@ constructor( } 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 { 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 e1878699..670fdc1e 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 @@ -283,23 +283,11 @@ private constructor( @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return /* spotless:off */ other is CompanyContribution && value == other.value /* spotless:on */ - } - - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() - companion object { - @JvmField val FIXED = CompanyContribution(JsonField.of("fixed")) + @JvmField val FIXED = of("fixed") - @JvmField val PERCENT = CompanyContribution(JsonField.of("percent")) + @JvmField val PERCENT = of("percent") @JvmStatic fun of(value: String) = CompanyContribution(JsonField.of(value)) } @@ -330,33 +318,33 @@ private constructor( } fun asString(): String = _value().asStringOrThrow() - } - - class EmployeeDeduction - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { - - @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value override fun equals(other: Any?): Boolean { if (this === other) { return true } - return /* spotless:off */ other is EmployeeDeduction && value == other.value /* spotless:on */ + return /* spotless:off */ other is CompanyContribution && value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() override fun toString() = value.toString() + } + + class EmployeeDeduction + @JsonCreator + private constructor( + private val value: JsonField, + ) : Enum { + + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { - @JvmField val FIXED = EmployeeDeduction(JsonField.of("fixed")) + @JvmField val FIXED = of("fixed") - @JvmField val PERCENT = EmployeeDeduction(JsonField.of("percent")) + @JvmField val PERCENT = of("percent") @JvmStatic fun of(value: String) = EmployeeDeduction(JsonField.of(value)) } @@ -387,33 +375,33 @@ private constructor( } fun asString(): String = _value().asStringOrThrow() - } - - class HsaContributionLimit - @JsonCreator - private constructor( - private val value: JsonField, - ) : Enum { - - @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value override fun equals(other: Any?): Boolean { if (this === other) { return true } - return /* spotless:off */ other is HsaContributionLimit && value == other.value /* spotless:on */ + return /* spotless:off */ other is EmployeeDeduction && value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() override fun toString() = value.toString() + } + + class HsaContributionLimit + @JsonCreator + private constructor( + private val value: JsonField, + ) : Enum { + + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value companion object { - @JvmField val INDIVIDUAL = HsaContributionLimit(JsonField.of("individual")) + @JvmField val INDIVIDUAL = of("individual") - @JvmField val FAMILY = HsaContributionLimit(JsonField.of("family")) + @JvmField val FAMILY = of("family") @JvmStatic fun of(value: String) = HsaContributionLimit(JsonField.of(value)) } @@ -444,6 +432,18 @@ private constructor( } fun asString(): String = _value().asStringOrThrow() + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is HsaContributionLimit && value == other.value /* spotless:on */ + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() } override fun equals(other: Any?): Boolean { 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 bed3ad2f..a853a057 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,7 +2,6 @@ package com.tryfinch.api.models -import com.tryfinch.api.models.* import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/AccountDisconnectParamsTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/AccountDisconnectParamsTest.kt index cbd37eeb..03b7bffb 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/AccountDisconnectParamsTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/AccountDisconnectParamsTest.kt @@ -2,7 +2,6 @@ package com.tryfinch.api.models -import com.tryfinch.api.models.* import org.junit.jupiter.api.Test class AccountDisconnectParamsTest { diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/AccountIntrospectParamsTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/AccountIntrospectParamsTest.kt index 334b6c9f..c886e760 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/AccountIntrospectParamsTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/AccountIntrospectParamsTest.kt @@ -2,7 +2,6 @@ package com.tryfinch.api.models -import com.tryfinch.api.models.* import org.junit.jupiter.api.Test class AccountIntrospectParamsTest { 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 551c64df..5ab13be5 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,7 +2,6 @@ package com.tryfinch.api.models -import com.tryfinch.api.models.* import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/ConnectSessionReauthenticateParamsTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/ConnectSessionReauthenticateParamsTest.kt index 1f04736a..6e091f6c 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,7 +2,6 @@ package com.tryfinch.api.models -import com.tryfinch.api.models.* import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/ConnectionCreateResponseTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/ConnectionCreateResponseTest.kt index eef19a23..887d1fc3 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/ConnectionCreateResponseTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/ConnectionCreateResponseTest.kt @@ -18,6 +18,7 @@ class ConnectionCreateResponseTest { .connectionId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .products(listOf("string")) .providerId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .tokenType("token_type") .build() assertThat(connectionCreateResponse).isNotNull assertThat(connectionCreateResponse.accessToken()) @@ -33,5 +34,6 @@ class ConnectionCreateResponseTest { assertThat(connectionCreateResponse.products()).containsExactly("string") assertThat(connectionCreateResponse.providerId()) .isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + assertThat(connectionCreateResponse.tokenType()).contains("token_type") } } diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/CreateAccessTokenResponseTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/CreateAccessTokenResponseTest.kt index d4f3dd5c..6ad1c497 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/CreateAccessTokenResponseTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/CreateAccessTokenResponseTest.kt @@ -20,6 +20,7 @@ class CreateAccessTokenResponseTest { .products(listOf("string")) .providerId("provider_id") .customerId("customer_id") + .tokenType("token_type") .build() assertThat(createAccessTokenResponse).isNotNull assertThat(createAccessTokenResponse.accessToken()).isEqualTo("access_token") @@ -33,5 +34,6 @@ class CreateAccessTokenResponseTest { assertThat(createAccessTokenResponse.products()).containsExactly("string") assertThat(createAccessTokenResponse.providerId()).isEqualTo("provider_id") assertThat(createAccessTokenResponse.customerId()).contains("customer_id") + assertThat(createAccessTokenResponse.tokenType()).contains("token_type") } } diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/EmploymentDataResponseTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/EmploymentDataResponseTest.kt index b6970cb2..b09c2cae 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/EmploymentDataResponseTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/EmploymentDataResponseTest.kt @@ -31,6 +31,7 @@ class EmploymentDataResponseTest { .type(EmploymentData.Employment.Type.EMPLOYEE) .build() ) + .employmentStatus(EmploymentData.EmploymentStatus.ACTIVE) .endDate("end_date") .firstName("first_name") .income( @@ -98,6 +99,7 @@ class EmploymentDataResponseTest { .type(EmploymentData.Employment.Type.EMPLOYEE) .build() ) + .employmentStatus(EmploymentData.EmploymentStatus.ACTIVE) .endDate("end_date") .firstName("first_name") .income( diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/EmploymentDataTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/EmploymentDataTest.kt index 7df0aa35..e941eb13 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/EmploymentDataTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/EmploymentDataTest.kt @@ -29,6 +29,7 @@ class EmploymentDataTest { .type(EmploymentData.Employment.Type.EMPLOYEE) .build() ) + .employmentStatus(EmploymentData.EmploymentStatus.ACTIVE) .endDate("end_date") .firstName("first_name") .income( @@ -90,6 +91,8 @@ class EmploymentDataTest { .type(EmploymentData.Employment.Type.EMPLOYEE) .build() ) + assertThat(employmentData.employmentStatus()) + .contains(EmploymentData.EmploymentStatus.ACTIVE) assertThat(employmentData.endDate()).contains("end_date") assertThat(employmentData.firstName()).contains("first_name") assertThat(employmentData.income()) diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/EmploymentUpdateResponseTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/EmploymentUpdateResponseTest.kt index dc8e1154..0c0a48d3 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/EmploymentUpdateResponseTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/EmploymentUpdateResponseTest.kt @@ -29,6 +29,7 @@ class EmploymentUpdateResponseTest { .type(EmploymentUpdateResponse.Employment.Type.EMPLOYEE) .build() ) + .employmentStatus(EmploymentUpdateResponse.EmploymentStatus.ACTIVE) .endDate("end_date") .firstName("first_name") .income( @@ -89,6 +90,8 @@ class EmploymentUpdateResponseTest { .type(EmploymentUpdateResponse.Employment.Type.EMPLOYEE) .build() ) + assertThat(employmentUpdateResponse.employmentStatus()) + .contains(EmploymentUpdateResponse.EmploymentStatus.ACTIVE) assertThat(employmentUpdateResponse.endDate()).contains("end_date") assertThat(employmentUpdateResponse.firstName()).contains("first_name") assertThat(employmentUpdateResponse.income()) 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 10d1ae93..0e43ccd7 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,7 +2,6 @@ package com.tryfinch.api.models -import com.tryfinch.api.models.* import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisBenefitIndividualEnrolledIdsParamsTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisBenefitIndividualEnrolledIdsParamsTest.kt index 351aef35..a1e82c83 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisBenefitIndividualEnrolledIdsParamsTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisBenefitIndividualEnrolledIdsParamsTest.kt @@ -2,7 +2,6 @@ package com.tryfinch.api.models -import com.tryfinch.api.models.* import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test 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 a5f013ec..a49f8c39 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 @@ -3,7 +3,6 @@ package com.tryfinch.api.models import com.tryfinch.api.core.http.QueryParams -import com.tryfinch.api.models.* import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisBenefitIndividualUnenrollManyParamsTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisBenefitIndividualUnenrollManyParamsTest.kt index 31af1067..31c8d60c 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,7 +2,6 @@ package com.tryfinch.api.models -import com.tryfinch.api.models.* import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisBenefitListParamsTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisBenefitListParamsTest.kt index e2934653..ed540958 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisBenefitListParamsTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisBenefitListParamsTest.kt @@ -2,7 +2,6 @@ package com.tryfinch.api.models -import com.tryfinch.api.models.* import org.junit.jupiter.api.Test class HrisBenefitListParamsTest { diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisBenefitListSupportedBenefitsParamsTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisBenefitListSupportedBenefitsParamsTest.kt index e3606cca..4f8d686e 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisBenefitListSupportedBenefitsParamsTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisBenefitListSupportedBenefitsParamsTest.kt @@ -2,7 +2,6 @@ package com.tryfinch.api.models -import com.tryfinch.api.models.* import org.junit.jupiter.api.Test class HrisBenefitListSupportedBenefitsParamsTest { diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisBenefitRetrieveParamsTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisBenefitRetrieveParamsTest.kt index 2a29a115..44a855b3 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisBenefitRetrieveParamsTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisBenefitRetrieveParamsTest.kt @@ -2,7 +2,6 @@ package com.tryfinch.api.models -import com.tryfinch.api.models.* import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.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 5038bd02..7d964aac 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,7 +2,6 @@ package com.tryfinch.api.models -import com.tryfinch.api.models.* import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisCompanyRetrieveParamsTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisCompanyRetrieveParamsTest.kt index 3eab3a0c..5ee3d609 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisCompanyRetrieveParamsTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisCompanyRetrieveParamsTest.kt @@ -2,7 +2,6 @@ package com.tryfinch.api.models -import com.tryfinch.api.models.* import org.junit.jupiter.api.Test class HrisCompanyRetrieveParamsTest { diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisDirectoryListIndividualsParamsTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisDirectoryListIndividualsParamsTest.kt index 61b10594..1b52e5af 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisDirectoryListIndividualsParamsTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisDirectoryListIndividualsParamsTest.kt @@ -3,7 +3,6 @@ package com.tryfinch.api.models import com.tryfinch.api.core.http.QueryParams -import com.tryfinch.api.models.* import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisDirectoryListParamsTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisDirectoryListParamsTest.kt index bbc93aad..bf7133bb 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisDirectoryListParamsTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisDirectoryListParamsTest.kt @@ -3,7 +3,6 @@ package com.tryfinch.api.models import com.tryfinch.api.core.http.QueryParams -import com.tryfinch.api.models.* import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.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 9bf66a4d..f601384d 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,7 +2,6 @@ package com.tryfinch.api.models -import com.tryfinch.api.models.* import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisIndividualRetrieveManyParamsTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisIndividualRetrieveManyParamsTest.kt index c8c629ec..b6c3d852 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,7 +2,6 @@ package com.tryfinch.api.models -import com.tryfinch.api.models.* import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test 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 5377d2a2..178ecd14 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,7 +2,6 @@ package com.tryfinch.api.models -import com.tryfinch.api.models.* import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -14,7 +13,7 @@ class HrisPayStatementRetrieveManyParamsTest { .requests( listOf( HrisPayStatementRetrieveManyParams.Request.builder() - .paymentId("payment_id") + .paymentId("string") .limit(0L) .offset(0L) .build() @@ -30,7 +29,7 @@ class HrisPayStatementRetrieveManyParamsTest { .requests( listOf( HrisPayStatementRetrieveManyParams.Request.builder() - .paymentId("payment_id") + .paymentId("string") .limit(0L) .offset(0L) .build() @@ -43,7 +42,7 @@ class HrisPayStatementRetrieveManyParamsTest { .isEqualTo( listOf( HrisPayStatementRetrieveManyParams.Request.builder() - .paymentId("payment_id") + .paymentId("string") .limit(0L) .offset(0L) .build() @@ -58,7 +57,7 @@ class HrisPayStatementRetrieveManyParamsTest { .requests( listOf( HrisPayStatementRetrieveManyParams.Request.builder() - .paymentId("payment_id") + .paymentId("string") .build() ) ) @@ -68,9 +67,7 @@ class HrisPayStatementRetrieveManyParamsTest { assertThat(body.requests()) .isEqualTo( listOf( - HrisPayStatementRetrieveManyParams.Request.builder() - .paymentId("payment_id") - .build() + HrisPayStatementRetrieveManyParams.Request.builder().paymentId("string").build() ) ) } diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisPaymentListParamsTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisPaymentListParamsTest.kt index 696bc8c4..ba8f5d39 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisPaymentListParamsTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/HrisPaymentListParamsTest.kt @@ -3,7 +3,6 @@ package com.tryfinch.api.models import com.tryfinch.api.core.http.QueryParams -import com.tryfinch.api.models.* import java.time.LocalDate import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test 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 d57c9f1c..d481de8a 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,7 +2,6 @@ package com.tryfinch.api.models -import com.tryfinch.api.models.* import org.junit.jupiter.api.Test class JobAutomatedCreateParamsTest { diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/JobAutomatedListParamsTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/JobAutomatedListParamsTest.kt index 5d49c993..9716e659 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/JobAutomatedListParamsTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/JobAutomatedListParamsTest.kt @@ -3,7 +3,6 @@ package com.tryfinch.api.models import com.tryfinch.api.core.http.QueryParams -import com.tryfinch.api.models.* import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/JobAutomatedRetrieveParamsTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/JobAutomatedRetrieveParamsTest.kt index b629959c..68d537ec 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/JobAutomatedRetrieveParamsTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/JobAutomatedRetrieveParamsTest.kt @@ -2,7 +2,6 @@ package com.tryfinch.api.models -import com.tryfinch.api.models.* import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/JobManualRetrieveParamsTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/JobManualRetrieveParamsTest.kt index bf27a411..e917ef1f 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/JobManualRetrieveParamsTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/JobManualRetrieveParamsTest.kt @@ -2,7 +2,6 @@ package com.tryfinch.api.models -import com.tryfinch.api.models.* import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/PayrollPayGroupListParamsTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/PayrollPayGroupListParamsTest.kt index 7bee1f76..041f8109 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/PayrollPayGroupListParamsTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/PayrollPayGroupListParamsTest.kt @@ -3,7 +3,6 @@ package com.tryfinch.api.models import com.tryfinch.api.core.http.QueryParams -import com.tryfinch.api.models.* import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/PayrollPayGroupRetrieveParamsTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/PayrollPayGroupRetrieveParamsTest.kt index 760c2868..306dc8fc 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/PayrollPayGroupRetrieveParamsTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/PayrollPayGroupRetrieveParamsTest.kt @@ -2,7 +2,6 @@ package com.tryfinch.api.models -import com.tryfinch.api.models.* import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/ProviderListParamsTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/ProviderListParamsTest.kt index a0bd62c4..01b1f155 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/ProviderListParamsTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/ProviderListParamsTest.kt @@ -2,7 +2,6 @@ package com.tryfinch.api.models -import com.tryfinch.api.models.* import org.junit.jupiter.api.Test class ProviderListParamsTest { diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/ProviderTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/ProviderTest.kt index 54086d9b..56d8dcc5 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/ProviderTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/ProviderTest.kt @@ -830,6 +830,7 @@ class ProviderTest { .type(true) .build() ) + .employmentStatus(true) .endDate(true) .firstName(true) .income( @@ -1819,6 +1820,7 @@ class ProviderTest { .type(true) .build() ) + .employmentStatus(true) .endDate(true) .firstName(true) .income( 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 b95c04dd..ca20418f 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 @@ -2,8 +2,7 @@ package com.tryfinch.api.models -import com.tryfinch.api.core.JsonNull -import com.tryfinch.api.models.* +import com.tryfinch.api.core.JsonValue import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -12,11 +11,10 @@ class RequestForwardingForwardParamsTest { @Test fun createRequestForwardingForwardParams() { RequestForwardingForwardParams.builder() - .method("method") - .route("route") - .data("data") - .headers(JsonNull.of()) - .params(JsonNull.of()) + .method("POST") + .route("/people/search") + .headers(JsonValue.from(mapOf("content-type" to "application/json"))) + .params(JsonValue.from(mapOf("showInactive" to true, "humanReadable" to true))) .build() } @@ -24,28 +22,28 @@ class RequestForwardingForwardParamsTest { fun getBody() { val params = RequestForwardingForwardParams.builder() - .method("method") - .route("route") - .data("data") - .headers(JsonNull.of()) - .params(JsonNull.of()) + .method("POST") + .route("/people/search") + .headers(JsonValue.from(mapOf("content-type" to "application/json"))) + .params(JsonValue.from(mapOf("showInactive" to true, "humanReadable" to true))) .build() val body = params.getBody() assertThat(body).isNotNull - assertThat(body.method()).isEqualTo("method") - assertThat(body.route()).isEqualTo("route") - assertThat(body.data()).isEqualTo("data") - assertThat(body.headers()).isEqualTo(JsonNull.of()) - assertThat(body.params()).isEqualTo(JsonNull.of()) + assertThat(body.method()).isEqualTo("POST") + assertThat(body.route()).isEqualTo("/people/search") + assertThat(body.headers()) + .isEqualTo(JsonValue.from(mapOf("content-type" to "application/json"))) + assertThat(body.params()) + .isEqualTo(JsonValue.from(mapOf("showInactive" to true, "humanReadable" to true))) } @Test fun getBodyWithoutOptionalFields() { val params = - RequestForwardingForwardParams.builder().method("method").route("route").build() + RequestForwardingForwardParams.builder().method("POST").route("/people/search").build() val body = params.getBody() assertThat(body).isNotNull - assertThat(body.method()).isEqualTo("method") - assertThat(body.route()).isEqualTo("route") + assertThat(body.method()).isEqualTo("POST") + assertThat(body.route()).isEqualTo("/people/search") } } diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/RequestForwardingForwardResponseTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/RequestForwardingForwardResponseTest.kt index 27866e1e..c08f7e8f 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/RequestForwardingForwardResponseTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/RequestForwardingForwardResponseTest.kt @@ -2,7 +2,7 @@ package com.tryfinch.api.models -import com.tryfinch.api.core.JsonNull +import com.tryfinch.api.core.JsonValue import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -13,13 +13,13 @@ class RequestForwardingForwardResponseTest { val requestForwardingForwardResponse = RequestForwardingForwardResponse.builder() .data("data") - .headers(JsonNull.of()) + .headers(JsonValue.from(mapOf())) .request( RequestForwardingForwardResponse.Request.builder() .data("data") - .headers(JsonNull.of()) + .headers(JsonValue.from(mapOf())) .method("method") - .params(JsonNull.of()) + .params(JsonValue.from(mapOf())) .route("route") .build() ) @@ -27,14 +27,15 @@ class RequestForwardingForwardResponseTest { .build() assertThat(requestForwardingForwardResponse).isNotNull assertThat(requestForwardingForwardResponse.data()).contains("data") - assertThat(requestForwardingForwardResponse._headers()).isEqualTo(JsonNull.of()) + assertThat(requestForwardingForwardResponse._headers()) + .isEqualTo(JsonValue.from(mapOf())) assertThat(requestForwardingForwardResponse.request()) .isEqualTo( RequestForwardingForwardResponse.Request.builder() .data("data") - .headers(JsonNull.of()) + .headers(JsonValue.from(mapOf())) .method("method") - .params(JsonNull.of()) + .params(JsonValue.from(mapOf())) .route("route") .build() ) diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/SandboxCompanyUpdateParamsTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/SandboxCompanyUpdateParamsTest.kt index da387e9d..31a66c38 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,7 +2,6 @@ package com.tryfinch.api.models -import com.tryfinch.api.models.* import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/SandboxConnectionAccountCreateParamsTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/SandboxConnectionAccountCreateParamsTest.kt index 8298a992..baae8277 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,7 +2,6 @@ package com.tryfinch.api.models -import com.tryfinch.api.models.* import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/SandboxConnectionAccountUpdateParamsTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/SandboxConnectionAccountUpdateParamsTest.kt index 1f9cca22..a152cf9e 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,7 +2,6 @@ package com.tryfinch.api.models -import com.tryfinch.api.models.* import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/SandboxConnectionCreateParamsTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/SandboxConnectionCreateParamsTest.kt index ccd07bab..074f1205 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,7 +2,6 @@ package com.tryfinch.api.models -import com.tryfinch.api.models.* import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test 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 295706c9..7097786b 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,7 +3,6 @@ package com.tryfinch.api.models import com.tryfinch.api.core.JsonValue -import com.tryfinch.api.models.* import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -30,7 +29,7 @@ class SandboxDirectoryCreateParamsTest { .name("name") .build() ) - .dob("dob") + .dob("01/01/2000") .emails( listOf( SandboxDirectoryCreateParams.IndividualOrEmployment.Email.builder() @@ -57,12 +56,16 @@ class SandboxDirectoryCreateParamsTest { ) .build() ) + .employmentStatus( + SandboxDirectoryCreateParams.IndividualOrEmployment.EmploymentStatus + .ACTIVE + ) .encryptedSsn("encrypted_ssn") .endDate("end_date") .ethnicity( SandboxDirectoryCreateParams.IndividualOrEmployment.Ethnicity.ASIAN ) - .firstName("first_name") + .firstName("John") .gender(SandboxDirectoryCreateParams.IndividualOrEmployment.Gender.FEMALE) .income( Income.builder() @@ -83,7 +86,7 @@ class SandboxDirectoryCreateParamsTest { ) ) .isActive(true) - .lastName("last_name") + .lastName("Smith") .latestRehireDate("latest_rehire_date") .location( Location.builder() @@ -163,7 +166,7 @@ class SandboxDirectoryCreateParamsTest { .name("name") .build() ) - .dob("dob") + .dob("01/01/2000") .emails( listOf( SandboxDirectoryCreateParams.IndividualOrEmployment.Email @@ -195,12 +198,16 @@ class SandboxDirectoryCreateParamsTest { ) .build() ) + .employmentStatus( + SandboxDirectoryCreateParams.IndividualOrEmployment.EmploymentStatus + .ACTIVE + ) .encryptedSsn("encrypted_ssn") .endDate("end_date") .ethnicity( SandboxDirectoryCreateParams.IndividualOrEmployment.Ethnicity.ASIAN ) - .firstName("first_name") + .firstName("John") .gender( SandboxDirectoryCreateParams.IndividualOrEmployment.Gender.FEMALE ) @@ -223,7 +230,7 @@ class SandboxDirectoryCreateParamsTest { ) ) .isActive(true) - .lastName("last_name") + .lastName("Smith") .latestRehireDate("latest_rehire_date") .location( Location.builder() @@ -300,7 +307,7 @@ class SandboxDirectoryCreateParamsTest { .name("name") .build() ) - .dob("dob") + .dob("01/01/2000") .emails( listOf( SandboxDirectoryCreateParams.IndividualOrEmployment.Email.builder() @@ -327,12 +334,16 @@ class SandboxDirectoryCreateParamsTest { ) .build() ) + .employmentStatus( + SandboxDirectoryCreateParams.IndividualOrEmployment.EmploymentStatus + .ACTIVE + ) .encryptedSsn("encrypted_ssn") .endDate("end_date") .ethnicity( SandboxDirectoryCreateParams.IndividualOrEmployment.Ethnicity.ASIAN ) - .firstName("first_name") + .firstName("John") .gender(SandboxDirectoryCreateParams.IndividualOrEmployment.Gender.FEMALE) .income( Income.builder() @@ -353,7 +364,7 @@ class SandboxDirectoryCreateParamsTest { ) ) .isActive(true) - .lastName("last_name") + .lastName("Smith") .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 a8f9263b..ba6698c7 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,7 +3,6 @@ package com.tryfinch.api.models import com.tryfinch.api.core.JsonValue -import com.tryfinch.api.models.* import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -29,6 +28,7 @@ class SandboxEmploymentUpdateParamsTest { .type(SandboxEmploymentUpdateParams.Employment.Type.EMPLOYEE) .build() ) + .employmentStatus(SandboxEmploymentUpdateParams.EmploymentStatus.ACTIVE) .endDate("end_date") .firstName("first_name") .income( @@ -67,7 +67,7 @@ class SandboxEmploymentUpdateParamsTest { .manager(SandboxEmploymentUpdateParams.Manager.builder().id("id").build()) .middleName("middle_name") .sourceId("source_id") - .startDate("start_date") + .startDate("3/4/2020") .title("title") .build() } @@ -93,6 +93,7 @@ class SandboxEmploymentUpdateParamsTest { .type(SandboxEmploymentUpdateParams.Employment.Type.EMPLOYEE) .build() ) + .employmentStatus(SandboxEmploymentUpdateParams.EmploymentStatus.ACTIVE) .endDate("end_date") .firstName("first_name") .income( @@ -131,7 +132,7 @@ class SandboxEmploymentUpdateParamsTest { .manager(SandboxEmploymentUpdateParams.Manager.builder().id("id").build()) .middleName("middle_name") .sourceId("source_id") - .startDate("start_date") + .startDate("3/4/2020") .title("title") .build() val body = params.getBody() @@ -155,6 +156,8 @@ class SandboxEmploymentUpdateParamsTest { .type(SandboxEmploymentUpdateParams.Employment.Type.EMPLOYEE) .build() ) + assertThat(body.employmentStatus()) + .isEqualTo(SandboxEmploymentUpdateParams.EmploymentStatus.ACTIVE) assertThat(body.endDate()).isEqualTo("end_date") assertThat(body.firstName()).isEqualTo("first_name") assertThat(body.income()) @@ -197,7 +200,7 @@ class SandboxEmploymentUpdateParamsTest { .isEqualTo(SandboxEmploymentUpdateParams.Manager.builder().id("id").build()) assertThat(body.middleName()).isEqualTo("middle_name") assertThat(body.sourceId()).isEqualTo("source_id") - assertThat(body.startDate()).isEqualTo("start_date") + assertThat(body.startDate()).isEqualTo("3/4/2020") assertThat(body.title()).isEqualTo("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 bb222149..35fa8848 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,7 +2,6 @@ package com.tryfinch.api.models -import com.tryfinch.api.models.* import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -12,7 +11,7 @@ class SandboxIndividualUpdateParamsTest { fun createSandboxIndividualUpdateParams() { SandboxIndividualUpdateParams.builder() .individualId("individual_id") - .dob("dob") + .dob("12/20/1989") .emails( listOf( SandboxIndividualUpdateParams.Email.builder() @@ -57,7 +56,7 @@ class SandboxIndividualUpdateParamsTest { val params = SandboxIndividualUpdateParams.builder() .individualId("individual_id") - .dob("dob") + .dob("12/20/1989") .emails( listOf( SandboxIndividualUpdateParams.Email.builder() @@ -97,7 +96,7 @@ class SandboxIndividualUpdateParamsTest { .build() val body = params.getBody() assertThat(body).isNotNull - assertThat(body.dob()).isEqualTo("dob") + assertThat(body.dob()).isEqualTo("12/20/1989") assertThat(body.emails()) .isEqualTo( listOf( diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/SandboxJobConfigurationRetrieveParamsTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/SandboxJobConfigurationRetrieveParamsTest.kt index 76a31055..fcb649d8 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/SandboxJobConfigurationRetrieveParamsTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/SandboxJobConfigurationRetrieveParamsTest.kt @@ -2,7 +2,6 @@ package com.tryfinch.api.models -import com.tryfinch.api.models.* import org.junit.jupiter.api.Test class SandboxJobConfigurationRetrieveParamsTest { 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 1ec12528..0396c389 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 @@ -2,7 +2,6 @@ package com.tryfinch.api.models -import com.tryfinch.api.models.* import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test 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 927a89f5..dadcf231 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,7 +2,6 @@ package com.tryfinch.api.models -import com.tryfinch.api.models.* import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/SandboxPaymentCreateParamsTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/SandboxPaymentCreateParamsTest.kt index feb52a81..c5af6b03 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,7 +2,6 @@ package com.tryfinch.api.models -import com.tryfinch.api.models.* import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -31,9 +30,9 @@ class SandboxPaymentCreateParamsTest { .employeeDeductions( listOf( SandboxPaymentCreateParams.PayStatement.EmployeeDeduction.builder() - .amount(0L) - .currency("currency") - .name("name") + .amount(2000L) + .currency("usd") + .name("401k test") .preTax(true) .type(BenefitType._401K) .build() @@ -51,7 +50,7 @@ class SandboxPaymentCreateParamsTest { ) ) .grossPay(Money.builder().amount(0L).currency("currency").build()) - .individualId("individual_id") + .individualId("b2338cfb-472f-4f72-9faa-e028c083144a") .netPay(Money.builder().amount(0L).currency("currency").build()) .paymentMethod(SandboxPaymentCreateParams.PayStatement.PaymentMethod.CHECK) .taxes( @@ -100,9 +99,9 @@ class SandboxPaymentCreateParamsTest { listOf( SandboxPaymentCreateParams.PayStatement.EmployeeDeduction .builder() - .amount(0L) - .currency("currency") - .name("name") + .amount(2000L) + .currency("usd") + .name("401k test") .preTax(true) .type(BenefitType._401K) .build() @@ -120,7 +119,7 @@ class SandboxPaymentCreateParamsTest { ) ) .grossPay(Money.builder().amount(0L).currency("currency").build()) - .individualId("individual_id") + .individualId("b2338cfb-472f-4f72-9faa-e028c083144a") .netPay(Money.builder().amount(0L).currency("currency").build()) .paymentMethod( SandboxPaymentCreateParams.PayStatement.PaymentMethod.CHECK @@ -168,9 +167,9 @@ class SandboxPaymentCreateParamsTest { .employeeDeductions( listOf( SandboxPaymentCreateParams.PayStatement.EmployeeDeduction.builder() - .amount(0L) - .currency("currency") - .name("name") + .amount(2000L) + .currency("usd") + .name("401k test") .preTax(true) .type(BenefitType._401K) .build() @@ -188,7 +187,7 @@ class SandboxPaymentCreateParamsTest { ) ) .grossPay(Money.builder().amount(0L).currency("currency").build()) - .individualId("individual_id") + .individualId("b2338cfb-472f-4f72-9faa-e028c083144a") .netPay(Money.builder().amount(0L).currency("currency").build()) .paymentMethod(SandboxPaymentCreateParams.PayStatement.PaymentMethod.CHECK) .taxes( 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 8b5503c4..7e131b2d 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 @@ -6,14 +6,13 @@ import com.fasterxml.jackson.databind.json.JsonMapper import com.github.tomakehurst.wiremock.client.WireMock.anyUrl import com.github.tomakehurst.wiremock.client.WireMock.get import com.github.tomakehurst.wiremock.client.WireMock.ok -import com.github.tomakehurst.wiremock.client.WireMock.put import com.github.tomakehurst.wiremock.client.WireMock.status import com.github.tomakehurst.wiremock.client.WireMock.stubFor import com.github.tomakehurst.wiremock.junit5.WireMockRuntimeInfo import com.github.tomakehurst.wiremock.junit5.WireMockTest import com.tryfinch.api.client.FinchClient import com.tryfinch.api.client.okhttp.FinchOkHttpClient -import com.tryfinch.api.core.JsonString +import com.tryfinch.api.core.JsonValue import com.tryfinch.api.core.http.Headers import com.tryfinch.api.core.jsonMapper import com.tryfinch.api.errors.BadRequestException @@ -26,7 +25,9 @@ import com.tryfinch.api.errors.RateLimitException import com.tryfinch.api.errors.UnauthorizedException import com.tryfinch.api.errors.UnexpectedStatusCodeException import com.tryfinch.api.errors.UnprocessableEntityException -import com.tryfinch.api.models.* +import com.tryfinch.api.models.Company +import com.tryfinch.api.models.HrisCompanyRetrieveParams +import com.tryfinch.api.models.Location import org.assertj.core.api.Assertions.assertThat import org.assertj.core.api.Assertions.assertThatThrownBy import org.assertj.core.api.InstanceOfAssertFactories @@ -39,7 +40,7 @@ class ErrorHandlingTest { private val JSON_MAPPER: JsonMapper = jsonMapper() private val FINCH_ERROR: FinchError = - FinchError.builder().putAdditionalProperty("key", JsonString.of("value")).build() + FinchError.builder().putAdditionalProperty("key", JsonValue.from("value")).build() private lateinit var client: FinchClient diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/services/ServiceParamsTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/services/ServiceParamsTest.kt index 5c4e5abb..555e8b13 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/services/ServiceParamsTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/services/ServiceParamsTest.kt @@ -8,7 +8,6 @@ import com.github.tomakehurst.wiremock.client.WireMock.equalTo import com.github.tomakehurst.wiremock.client.WireMock.get import com.github.tomakehurst.wiremock.client.WireMock.getRequestedFor import com.github.tomakehurst.wiremock.client.WireMock.ok -import com.github.tomakehurst.wiremock.client.WireMock.put import com.github.tomakehurst.wiremock.client.WireMock.stubFor import com.github.tomakehurst.wiremock.client.WireMock.verify import com.github.tomakehurst.wiremock.junit5.WireMockRuntimeInfo @@ -16,9 +15,10 @@ import com.github.tomakehurst.wiremock.junit5.WireMockTest import com.tryfinch.api.client.FinchClient import com.tryfinch.api.client.okhttp.FinchOkHttpClient import com.tryfinch.api.core.jsonMapper -import com.tryfinch.api.models.* import com.tryfinch.api.models.HrisDirectoryListPage import com.tryfinch.api.models.HrisDirectoryListParams +import com.tryfinch.api.models.IndividualInDirectory +import com.tryfinch.api.models.Paging import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.Test diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/AccessTokenServiceTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/AccessTokenServiceTest.kt index 38137dd8..258b40b3 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/AccessTokenServiceTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/AccessTokenServiceTest.kt @@ -4,7 +4,7 @@ package com.tryfinch.api.services.blocking import com.tryfinch.api.TestServerExtension import com.tryfinch.api.client.okhttp.FinchOkHttpClient -import com.tryfinch.api.models.* +import com.tryfinch.api.models.AccessTokenCreateParams import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/AccountServiceTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/AccountServiceTest.kt index 4a26a609..722ea7d8 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/AccountServiceTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/AccountServiceTest.kt @@ -4,7 +4,8 @@ package com.tryfinch.api.services.blocking import com.tryfinch.api.TestServerExtension import com.tryfinch.api.client.okhttp.FinchOkHttpClient -import com.tryfinch.api.models.* +import com.tryfinch.api.models.AccountDisconnectParams +import com.tryfinch.api.models.AccountIntrospectParams import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/ProviderServiceTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/ProviderServiceTest.kt index a2db24db..55efec7e 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/ProviderServiceTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/ProviderServiceTest.kt @@ -4,7 +4,6 @@ package com.tryfinch.api.services.blocking import com.tryfinch.api.TestServerExtension import com.tryfinch.api.client.okhttp.FinchOkHttpClient -import com.tryfinch.api.models.* import com.tryfinch.api.models.ProviderListParams import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/RequestForwardingServiceTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/RequestForwardingServiceTest.kt index ae7e1426..2e70f732 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/RequestForwardingServiceTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/RequestForwardingServiceTest.kt @@ -4,8 +4,8 @@ package com.tryfinch.api.services.blocking import com.tryfinch.api.TestServerExtension import com.tryfinch.api.client.okhttp.FinchOkHttpClient -import com.tryfinch.api.core.JsonNull -import com.tryfinch.api.models.* +import com.tryfinch.api.core.JsonValue +import com.tryfinch.api.models.RequestForwardingForwardParams import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -23,11 +23,10 @@ class RequestForwardingServiceTest { val requestForwardingForwardResponse = requestForwardingService.forward( RequestForwardingForwardParams.builder() - .method("method") - .route("route") - .data("data") - .headers(JsonNull.of()) - .params(JsonNull.of()) + .method("POST") + .route("/people/search") + .headers(JsonValue.from(mapOf("content-type" to "application/json"))) + .params(JsonValue.from(mapOf("showInactive" to true, "humanReadable" to true))) .build() ) println(requestForwardingForwardResponse) diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/connect/SessionServiceTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/connect/SessionServiceTest.kt index d4831db2..1e47f3b5 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/connect/SessionServiceTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/connect/SessionServiceTest.kt @@ -4,7 +4,8 @@ package com.tryfinch.api.services.blocking.connect import com.tryfinch.api.TestServerExtension import com.tryfinch.api.client.okhttp.FinchOkHttpClient -import com.tryfinch.api.models.* +import com.tryfinch.api.models.ConnectSessionNewParams +import com.tryfinch.api.models.ConnectSessionReauthenticateParams import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/hris/BenefitServiceTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/hris/BenefitServiceTest.kt index 9b3db79d..aa9964e9 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/hris/BenefitServiceTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/hris/BenefitServiceTest.kt @@ -4,9 +4,13 @@ package com.tryfinch.api.services.blocking.hris import com.tryfinch.api.TestServerExtension import com.tryfinch.api.client.okhttp.FinchOkHttpClient -import com.tryfinch.api.models.* +import com.tryfinch.api.models.BenefitFrequency +import com.tryfinch.api.models.BenefitType +import com.tryfinch.api.models.HrisBenefitCreateParams import com.tryfinch.api.models.HrisBenefitListParams import com.tryfinch.api.models.HrisBenefitListSupportedBenefitsParams +import com.tryfinch.api.models.HrisBenefitRetrieveParams +import com.tryfinch.api.models.HrisBenefitUpdateParams import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/hris/CompanyServiceTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/hris/CompanyServiceTest.kt index f9c5e1b4..8d94efc7 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/hris/CompanyServiceTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/hris/CompanyServiceTest.kt @@ -4,7 +4,7 @@ package com.tryfinch.api.services.blocking.hris import com.tryfinch.api.TestServerExtension import com.tryfinch.api.client.okhttp.FinchOkHttpClient -import com.tryfinch.api.models.* +import com.tryfinch.api.models.HrisCompanyRetrieveParams import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/hris/DirectoryServiceTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/hris/DirectoryServiceTest.kt index b9873802..8ab41102 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/hris/DirectoryServiceTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/hris/DirectoryServiceTest.kt @@ -4,7 +4,6 @@ package com.tryfinch.api.services.blocking.hris import com.tryfinch.api.TestServerExtension import com.tryfinch.api.client.okhttp.FinchOkHttpClient -import com.tryfinch.api.models.* import com.tryfinch.api.models.HrisDirectoryListIndividualsParams import com.tryfinch.api.models.HrisDirectoryListParams import org.junit.jupiter.api.Test diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/hris/EmploymentServiceTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/hris/EmploymentServiceTest.kt index 52d72f98..72c101cf 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/hris/EmploymentServiceTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/hris/EmploymentServiceTest.kt @@ -4,7 +4,6 @@ package com.tryfinch.api.services.blocking.hris import com.tryfinch.api.TestServerExtension import com.tryfinch.api.client.okhttp.FinchOkHttpClient -import com.tryfinch.api.models.* import com.tryfinch.api.models.HrisEmploymentRetrieveManyParams import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/hris/IndividualServiceTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/hris/IndividualServiceTest.kt index 41620c4f..3aef212f 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/hris/IndividualServiceTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/hris/IndividualServiceTest.kt @@ -4,7 +4,6 @@ package com.tryfinch.api.services.blocking.hris import com.tryfinch.api.TestServerExtension import com.tryfinch.api.client.okhttp.FinchOkHttpClient -import com.tryfinch.api.models.* import com.tryfinch.api.models.HrisIndividualRetrieveManyParams import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/hris/PayStatementServiceTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/hris/PayStatementServiceTest.kt index 57a63c98..b46fe04e 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/hris/PayStatementServiceTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/hris/PayStatementServiceTest.kt @@ -4,7 +4,6 @@ package com.tryfinch.api.services.blocking.hris import com.tryfinch.api.TestServerExtension import com.tryfinch.api.client.okhttp.FinchOkHttpClient -import com.tryfinch.api.models.* import com.tryfinch.api.models.HrisPayStatementRetrieveManyParams import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -26,7 +25,7 @@ class PayStatementServiceTest { .requests( listOf( HrisPayStatementRetrieveManyParams.Request.builder() - .paymentId("payment_id") + .paymentId("string") .build() ) ) diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/hris/PaymentServiceTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/hris/PaymentServiceTest.kt index 72d063b7..35cc4d01 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/hris/PaymentServiceTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/hris/PaymentServiceTest.kt @@ -4,7 +4,6 @@ package com.tryfinch.api.services.blocking.hris import com.tryfinch.api.TestServerExtension import com.tryfinch.api.client.okhttp.FinchOkHttpClient -import com.tryfinch.api.models.* import com.tryfinch.api.models.HrisPaymentListParams import java.time.LocalDate import org.junit.jupiter.api.Test diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/hris/benefits/IndividualServiceTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/hris/benefits/IndividualServiceTest.kt index 61dc541a..61091aa9 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/hris/benefits/IndividualServiceTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/hris/benefits/IndividualServiceTest.kt @@ -4,7 +4,7 @@ package com.tryfinch.api.services.blocking.hris.benefits import com.tryfinch.api.TestServerExtension import com.tryfinch.api.client.okhttp.FinchOkHttpClient -import com.tryfinch.api.models.* +import com.tryfinch.api.models.HrisBenefitIndividualEnrolledIdsParams import com.tryfinch.api.models.HrisBenefitIndividualRetrieveManyBenefitsParams import com.tryfinch.api.models.HrisBenefitIndividualUnenrollManyParams import org.junit.jupiter.api.Test 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 bb9fa5a9..79cba36e 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 @@ -4,8 +4,9 @@ package com.tryfinch.api.services.blocking.jobs import com.tryfinch.api.TestServerExtension import com.tryfinch.api.client.okhttp.FinchOkHttpClient -import com.tryfinch.api.models.* +import com.tryfinch.api.models.JobAutomatedCreateParams import com.tryfinch.api.models.JobAutomatedListParams +import com.tryfinch.api.models.JobAutomatedRetrieveParams import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/jobs/ManualServiceTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/jobs/ManualServiceTest.kt index ff0e3d04..ef763502 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/jobs/ManualServiceTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/jobs/ManualServiceTest.kt @@ -4,7 +4,7 @@ package com.tryfinch.api.services.blocking.jobs import com.tryfinch.api.TestServerExtension import com.tryfinch.api.client.okhttp.FinchOkHttpClient -import com.tryfinch.api.models.* +import com.tryfinch.api.models.JobManualRetrieveParams import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/payroll/PayGroupServiceTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/payroll/PayGroupServiceTest.kt index 21179249..c9fe1035 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/payroll/PayGroupServiceTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/payroll/PayGroupServiceTest.kt @@ -4,8 +4,8 @@ package com.tryfinch.api.services.blocking.payroll import com.tryfinch.api.TestServerExtension import com.tryfinch.api.client.okhttp.FinchOkHttpClient -import com.tryfinch.api.models.* import com.tryfinch.api.models.PayrollPayGroupListParams +import com.tryfinch.api.models.PayrollPayGroupRetrieveParams import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/sandbox/CompanyServiceTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/sandbox/CompanyServiceTest.kt index 6b956776..1ecbae71 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/sandbox/CompanyServiceTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/sandbox/CompanyServiceTest.kt @@ -4,7 +4,8 @@ package com.tryfinch.api.services.blocking.sandbox import com.tryfinch.api.TestServerExtension import com.tryfinch.api.client.okhttp.FinchOkHttpClient -import com.tryfinch.api.models.* +import com.tryfinch.api.models.Location +import com.tryfinch.api.models.SandboxCompanyUpdateParams import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/sandbox/ConnectionServiceTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/sandbox/ConnectionServiceTest.kt index 59da45e0..b8834168 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/sandbox/ConnectionServiceTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/sandbox/ConnectionServiceTest.kt @@ -4,7 +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.models.* +import com.tryfinch.api.models.SandboxConnectionCreateParams import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith 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 a5af1399..dad8dab1 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 @@ -5,7 +5,9 @@ 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.* +import com.tryfinch.api.models.Income +import com.tryfinch.api.models.Location +import com.tryfinch.api.models.SandboxDirectoryCreateParams import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -43,7 +45,7 @@ class DirectoryServiceTest { .name("name") .build() ) - .dob("dob") + .dob("01/01/2000") .emails( listOf( SandboxDirectoryCreateParams.IndividualOrEmployment.Email @@ -75,13 +77,18 @@ class DirectoryServiceTest { ) .build() ) + .employmentStatus( + SandboxDirectoryCreateParams.IndividualOrEmployment + .EmploymentStatus + .ACTIVE + ) .encryptedSsn("encrypted_ssn") .endDate("end_date") .ethnicity( SandboxDirectoryCreateParams.IndividualOrEmployment.Ethnicity .ASIAN ) - .firstName("first_name") + .firstName("John") .gender( SandboxDirectoryCreateParams.IndividualOrEmployment.Gender .FEMALE @@ -105,7 +112,7 @@ class DirectoryServiceTest { ) ) .isActive(true) - .lastName("last_name") + .lastName("Smith") .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 9b1bea7f..c6842b48 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 @@ -5,7 +5,9 @@ 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.* +import com.tryfinch.api.models.Income +import com.tryfinch.api.models.Location +import com.tryfinch.api.models.SandboxEmploymentUpdateParams import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -42,6 +44,7 @@ class EmploymentServiceTest { .type(SandboxEmploymentUpdateParams.Employment.Type.EMPLOYEE) .build() ) + .employmentStatus(SandboxEmploymentUpdateParams.EmploymentStatus.ACTIVE) .endDate("end_date") .firstName("first_name") .income( @@ -80,7 +83,7 @@ class EmploymentServiceTest { .manager(SandboxEmploymentUpdateParams.Manager.builder().id("id").build()) .middleName("middle_name") .sourceId("source_id") - .startDate("start_date") + .startDate("3/4/2020") .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 5bfe218b..46747df2 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 @@ -4,7 +4,8 @@ package com.tryfinch.api.services.blocking.sandbox import com.tryfinch.api.TestServerExtension import com.tryfinch.api.client.okhttp.FinchOkHttpClient -import com.tryfinch.api.models.* +import com.tryfinch.api.models.Location +import com.tryfinch.api.models.SandboxIndividualUpdateParams import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -23,7 +24,7 @@ class IndividualServiceTest { individualService.update( SandboxIndividualUpdateParams.builder() .individualId("individual_id") - .dob("dob") + .dob("12/20/1989") .emails( listOf( SandboxIndividualUpdateParams.Email.builder() diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/sandbox/JobServiceTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/sandbox/JobServiceTest.kt index a7d5aaf5..c462ab1e 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/sandbox/JobServiceTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/sandbox/JobServiceTest.kt @@ -4,7 +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.models.* +import com.tryfinch.api.models.SandboxJobCreateParams import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith 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 01442f8a..45615a60 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,7 +4,9 @@ package com.tryfinch.api.services.blocking.sandbox import com.tryfinch.api.TestServerExtension import com.tryfinch.api.client.okhttp.FinchOkHttpClient -import com.tryfinch.api.models.* +import com.tryfinch.api.models.BenefitType +import com.tryfinch.api.models.Money +import com.tryfinch.api.models.SandboxPaymentCreateParams import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -44,9 +46,9 @@ class PaymentServiceTest { listOf( SandboxPaymentCreateParams.PayStatement.EmployeeDeduction .builder() - .amount(0L) - .currency("currency") - .name("name") + .amount(2000L) + .currency("usd") + .name("401k test") .preTax(true) .type(BenefitType._401K) .build() @@ -64,7 +66,7 @@ class PaymentServiceTest { ) ) .grossPay(Money.builder().amount(0L).currency("currency").build()) - .individualId("individual_id") + .individualId("b2338cfb-472f-4f72-9faa-e028c083144a") .netPay(Money.builder().amount(0L).currency("currency").build()) .paymentMethod( SandboxPaymentCreateParams.PayStatement.PaymentMethod.CHECK diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/sandbox/connections/AccountServiceTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/sandbox/connections/AccountServiceTest.kt index 3537f190..ba50d5ed 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/sandbox/connections/AccountServiceTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/services/blocking/sandbox/connections/AccountServiceTest.kt @@ -4,7 +4,9 @@ package com.tryfinch.api.services.blocking.sandbox.connections import com.tryfinch.api.TestServerExtension import com.tryfinch.api.client.okhttp.FinchOkHttpClient -import com.tryfinch.api.models.* +import com.tryfinch.api.models.ConnectionStatusType +import com.tryfinch.api.models.SandboxConnectionAccountCreateParams +import com.tryfinch.api.models.SandboxConnectionAccountUpdateParams import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith 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 ceccf5a6..75f0e90c 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 @@ -4,7 +4,9 @@ package com.tryfinch.api.services.blocking.sandbox.jobs import com.tryfinch.api.TestServerExtension import com.tryfinch.api.client.okhttp.FinchOkHttpClient -import com.tryfinch.api.models.* +import com.tryfinch.api.models.SandboxJobConfiguration +import com.tryfinch.api.models.SandboxJobConfigurationRetrieveParams +import com.tryfinch.api.models.SandboxJobConfigurationUpdateParams import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith diff --git a/finch-java-example/build.gradle.kts b/finch-java-example/build.gradle.kts index 67603e35..29e65075 100644 --- a/finch-java-example/build.gradle.kts +++ b/finch-java-example/build.gradle.kts @@ -1,12 +1,18 @@ plugins { - id("application") - id("finch.java") + id("finch.kotlin") + id("java") + application } dependencies { implementation(project(":finch-java")) } +tasks.withType().configureEach { + // Allow using more modern APIs, like `List.of` and `Map.of`, in examples. + options.release.set(9) +} + application { - mainClass.set("com.tryfinch.api.example.Main") + mainClass = "com.tryfinch.api.example.Main" }