From 56c3b0bcad2cff10e9b412efe55230544214dfcd Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 29 Jul 2025 14:31:15 +0000 Subject: [PATCH 01/18] feat(client): ensure compat with proguard --- README.md | 6 + .../META-INF/proguard/finch-java-core.pro | 32 ++++ finch-java-proguard-test/build.gradle.kts | 74 +++++++++ .../api/proguard/ProGuardCompatibilityTest.kt | 146 ++++++++++++++++++ finch-java-proguard-test/test.pro | 5 + settings.gradle.kts | 1 + 6 files changed, 264 insertions(+) create mode 100644 finch-java-core/src/main/resources/META-INF/proguard/finch-java-core.pro create mode 100644 finch-java-proguard-test/build.gradle.kts create mode 100644 finch-java-proguard-test/src/test/kotlin/com/tryfinch/api/proguard/ProGuardCompatibilityTest.kt create mode 100644 finch-java-proguard-test/test.pro diff --git a/README.md b/README.md index a6555c8ba..655246c6c 100644 --- a/README.md +++ b/README.md @@ -365,6 +365,12 @@ both of which will raise an error if the signature is invalid. Note that the "body" parameter must be the raw JSON string sent from the server (do not parse it first). The `.unwrap()` method can parse this JSON for you. +## ProGuard and R8 + +Although the SDK uses reflection, it is still usable with [ProGuard](https://github.com/Guardsquare/proguard) and [R8](https://developer.android.com/topic/performance/app-optimization/enable-app-optimization) because `finch-java-core` is published with a [configuration file](finch-java-core/src/main/resources/META-INF/proguard/finch-java-core.pro) containing [keep rules](https://www.guardsquare.com/manual/configuration/usage). + +ProGuard and R8 should automatically detect and use the published rules, but you can also manually copy the keep rules if necessary. + ## Jackson The SDK depends on [Jackson](https://github.com/FasterXML/jackson) for JSON serialization/deserialization. It is compatible with version 2.13.4 or higher, but depends on version 2.18.2 by default. diff --git a/finch-java-core/src/main/resources/META-INF/proguard/finch-java-core.pro b/finch-java-core/src/main/resources/META-INF/proguard/finch-java-core.pro new file mode 100644 index 000000000..4c01ba583 --- /dev/null +++ b/finch-java-core/src/main/resources/META-INF/proguard/finch-java-core.pro @@ -0,0 +1,32 @@ +# Jackson uses reflection and depends heavily on runtime attributes. +-keepattributes + +# Jackson uses Kotlin reflection utilities, which themselves use reflection to access things. +-keep class kotlin.reflect.** { *; } +-keep class kotlin.Metadata { *; } + +# Jackson uses reflection to access enum members (e.g. via `java.lang.Class.getEnumConstants()`). +-keepclassmembers class com.fasterxml.jackson.** extends java.lang.Enum { + ; + public static **[] values(); + public static ** valueOf(java.lang.String); +} + +# Jackson uses reflection to access annotation members. +-keepclassmembers @interface com.fasterxml.jackson.annotation.** { + *; +} + +# Jackson uses reflection to access the default constructors of serializers and deserializers. +-keepclassmembers class * extends com.tryfinch.api.core.BaseSerializer { + (); +} +-keepclassmembers class * extends com.tryfinch.api.core.BaseDeserializer { + (); +} + +# Jackson uses reflection to serialize and deserialize our classes based on their constructors and annotated members. +-keepclassmembers class com.tryfinch.api.** { + (...); + @com.fasterxml.jackson.annotation.* *; +} \ No newline at end of file diff --git a/finch-java-proguard-test/build.gradle.kts b/finch-java-proguard-test/build.gradle.kts new file mode 100644 index 000000000..a1a5b39bd --- /dev/null +++ b/finch-java-proguard-test/build.gradle.kts @@ -0,0 +1,74 @@ +plugins { + id("finch.kotlin") + id("com.gradleup.shadow") version "8.3.8" +} + +buildscript { + dependencies { + classpath("com.guardsquare:proguard-gradle:7.4.2") + } +} + +dependencies { + testImplementation(project(":finch-java")) + testImplementation(kotlin("test")) + testImplementation("org.junit.jupiter:junit-jupiter-api:5.9.3") + testImplementation("org.assertj:assertj-core:3.25.3") + testImplementation("com.fasterxml.jackson.module:jackson-module-kotlin:2.13.4") + testImplementation("org.junit.platform:junit-platform-console:1.10.1") +} + +tasks.shadowJar { + from(sourceSets.test.get().output) + configurations = listOf(project.configurations.testRuntimeClasspath.get()) +} + +val proguardJarPath = "${layout.buildDirectory.get()}/libs/${project.name}-${project.version}-proguard.jar" +val proguardJar by tasks.registering(proguard.gradle.ProGuardTask::class) { + group = "verification" + dependsOn(tasks.shadowJar) + notCompatibleWithConfigurationCache("ProGuard") + + injars(tasks.shadowJar) + outjars(proguardJarPath) + printmapping("${layout.buildDirectory.get()}/proguard-mapping.txt") + + verbose() + dontwarn() + + val javaHome = System.getProperty("java.home") + if (System.getProperty("java.version").startsWith("1.")) { + // Before Java 9, the runtime classes were packaged in a single jar file. + libraryjars("$javaHome/lib/rt.jar") + } else { + // As of Java 9, the runtime classes are packaged in modular jmod files. + libraryjars( + // Filters must be specified first, as a map. + mapOf("jarfilter" to "!**.jar", "filter" to "!module-info.class"), + "$javaHome/jmods/java.base.jmod" + ) + } + + configuration("./test.pro") + configuration("../finch-java-core/src/main/resources/META-INF/proguard/finch-java-core.pro") +} + +val testProGuard by tasks.registering(JavaExec::class) { + group = "verification" + dependsOn(proguardJar) + notCompatibleWithConfigurationCache("ProGuard") + + mainClass.set("org.junit.platform.console.ConsoleLauncher") + classpath = files(proguardJarPath) + args = listOf( + "--classpath", proguardJarPath, + "--scan-classpath", + "--details", "verbose", + ) +} + +tasks.test { + dependsOn(testProGuard) + // We defer to the tests run via the ProGuard JAR. + enabled = false +} diff --git a/finch-java-proguard-test/src/test/kotlin/com/tryfinch/api/proguard/ProGuardCompatibilityTest.kt b/finch-java-proguard-test/src/test/kotlin/com/tryfinch/api/proguard/ProGuardCompatibilityTest.kt new file mode 100644 index 000000000..a84035c14 --- /dev/null +++ b/finch-java-proguard-test/src/test/kotlin/com/tryfinch/api/proguard/ProGuardCompatibilityTest.kt @@ -0,0 +1,146 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.tryfinch.api.proguard + +import com.fasterxml.jackson.module.kotlin.jacksonTypeRef +import com.tryfinch.api.client.okhttp.FinchOkHttpClient +import com.tryfinch.api.core.jsonMapper +import com.tryfinch.api.models.ConnectionStatusType +import com.tryfinch.api.models.Individual +import com.tryfinch.api.models.IndividualInDirectory +import com.tryfinch.api.models.Location +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.BeforeAll +import org.junit.jupiter.api.Test + +internal class ProGuardCompatibilityTest { + + companion object { + + @BeforeAll + @JvmStatic + fun setUp() { + // To debug that we're using the right JAR. + val jarPath = this::class.java.getProtectionDomain().codeSource.location + println("JAR being used: $jarPath") + } + } + + @Test + fun proguardRules() { + val rulesFile = + javaClass.classLoader.getResourceAsStream("META-INF/proguard/finch-java-core.pro") + + assertThat(rulesFile).isNotNull() + } + + @Test + fun client() { + val client = FinchOkHttpClient.builder().accessToken("My Access Token").build() + + assertThat(client).isNotNull() + assertThat(client.accessTokens()).isNotNull() + assertThat(client.hris()).isNotNull() + assertThat(client.providers()).isNotNull() + assertThat(client.account()).isNotNull() + assertThat(client.webhooks()).isNotNull() + assertThat(client.requestForwarding()).isNotNull() + assertThat(client.jobs()).isNotNull() + assertThat(client.sandbox()).isNotNull() + assertThat(client.payroll()).isNotNull() + assertThat(client.connect()).isNotNull() + } + + @Test + fun individualInDirectoryRoundtrip() { + val jsonMapper = jsonMapper() + val individualInDirectory = + IndividualInDirectory.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .department(IndividualInDirectory.Department.builder().name("name").build()) + .firstName("first_name") + .isActive(true) + .lastName("last_name") + .manager( + IndividualInDirectory.Manager.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + ) + .middleName("middle_name") + .build() + + val roundtrippedIndividualInDirectory = + jsonMapper.readValue( + jsonMapper.writeValueAsString(individualInDirectory), + jacksonTypeRef(), + ) + + assertThat(roundtrippedIndividualInDirectory).isEqualTo(individualInDirectory) + } + + @Test + fun individualRoundtrip() { + val jsonMapper = jsonMapper() + val individual = + Individual.ofUnionMember0( + Individual.UnionMember0.builder() + .id("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .dob("dob") + .ethnicity(Individual.UnionMember0.Ethnicity.ASIAN) + .firstName("first_name") + .gender(Individual.UnionMember0.Gender.FEMALE) + .lastName("last_name") + .middleName("middle_name") + .addPhoneNumber( + Individual.UnionMember0.PhoneNumber.builder() + .data("data") + .type(Individual.UnionMember0.PhoneNumber.Type.WORK) + .build() + ) + .preferredName("preferred_name") + .residence( + Location.builder() + .city("city") + .country("country") + .line1("line1") + .line2("line2") + .postalCode("postal_code") + .state("state") + .name("name") + .sourceId("source_id") + .build() + ) + .addEmail( + Individual.UnionMember0.Email.builder() + .data("data") + .type(Individual.UnionMember0.Email.Type.WORK) + .build() + ) + .encryptedSsn("encrypted_ssn") + .ssn("ssn") + .build() + ) + + val roundtrippedIndividual = + jsonMapper.readValue( + jsonMapper.writeValueAsString(individual), + jacksonTypeRef(), + ) + + assertThat(roundtrippedIndividual).isEqualTo(individual) + } + + @Test + fun connectionStatusTypeRoundtrip() { + val jsonMapper = jsonMapper() + val connectionStatusType = ConnectionStatusType.PENDING + + val roundtrippedConnectionStatusType = + jsonMapper.readValue( + jsonMapper.writeValueAsString(connectionStatusType), + jacksonTypeRef(), + ) + + assertThat(roundtrippedConnectionStatusType).isEqualTo(connectionStatusType) + } +} diff --git a/finch-java-proguard-test/test.pro b/finch-java-proguard-test/test.pro new file mode 100644 index 000000000..94e7bd7cb --- /dev/null +++ b/finch-java-proguard-test/test.pro @@ -0,0 +1,5 @@ +# Specify the entrypoint where ProGuard starts to determine what's reachable. +-keep class com.tryfinch.api.proguard.** { *; } + +# For the testing framework. +-keep class org.junit.** { *; } \ No newline at end of file diff --git a/settings.gradle.kts b/settings.gradle.kts index 9bb6bb455..f98679954 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -3,4 +3,5 @@ rootProject.name = "finch-java-root" include("finch-java") include("finch-java-client-okhttp") include("finch-java-core") +include("finch-java-proguard-test") include("finch-java-example") From 451adb3fea351e5e905f4f947b96ffb0692fc381 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 29 Jul 2025 11:50:44 +0000 Subject: [PATCH 02/18] feat: add retryable exception --- README.md | 2 + .../api/core/http/RetryingHttpClient.kt | 8 +- .../api/errors/FinchRetryableException.kt | 14 ++++ .../api/core/http/RetryingHttpClientTest.kt | 77 +++++++++++++++++++ 4 files changed, 98 insertions(+), 3 deletions(-) create mode 100644 finch-java-core/src/main/kotlin/com/tryfinch/api/errors/FinchRetryableException.kt diff --git a/README.md b/README.md index 655246c6c..24b7da707 100644 --- a/README.md +++ b/README.md @@ -235,6 +235,8 @@ The SDK throws custom unchecked exception types: - [`FinchIoException`](finch-java-core/src/main/kotlin/com/tryfinch/api/errors/FinchIoException.kt): I/O networking errors. +- [`FinchRetryableException`](finch-java-core/src/main/kotlin/com/tryfinch/api/errors/FinchRetryableException.kt): Generic error indicating a failure that could be retried by the client. + - [`FinchInvalidDataException`](finch-java-core/src/main/kotlin/com/tryfinch/api/errors/FinchInvalidDataException.kt): Failure to interpret successfully parsed data. For example, when accessing a property that's supposed to be required, but the API unexpectedly omitted it from the response. - [`FinchException`](finch-java-core/src/main/kotlin/com/tryfinch/api/errors/FinchException.kt): Base class for all exceptions. Most errors will result in one of the previously mentioned ones, but completely generic errors may be thrown using the base class. diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/core/http/RetryingHttpClient.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/core/http/RetryingHttpClient.kt index c195f8aab..d4cb1e78b 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/core/http/RetryingHttpClient.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/core/http/RetryingHttpClient.kt @@ -3,6 +3,7 @@ package com.tryfinch.api.core.http import com.tryfinch.api.core.RequestOptions import com.tryfinch.api.core.checkRequired import com.tryfinch.api.errors.FinchIoException +import com.tryfinch.api.errors.FinchRetryableException import java.io.IOException import java.time.Clock import java.time.Duration @@ -176,9 +177,10 @@ private constructor( } private fun shouldRetry(throwable: Throwable): Boolean = - // Only retry IOException and FinchIoException, other exceptions are not intended to be - // retried. - throwable is IOException || throwable is FinchIoException + // Only retry known retryable exceptions, other exceptions are not intended to be retried. + throwable is IOException || + throwable is FinchIoException || + throwable is FinchRetryableException private fun getRetryBackoffDuration(retries: Int, response: HttpResponse?): Duration { // About the Retry-After header: diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/errors/FinchRetryableException.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/errors/FinchRetryableException.kt new file mode 100644 index 000000000..15708e4d7 --- /dev/null +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/errors/FinchRetryableException.kt @@ -0,0 +1,14 @@ +package com.tryfinch.api.errors + +/** + * Exception that indicates a transient error that can be retried. + * + * When this exception is thrown during an HTTP request, the SDK will automatically retry the + * request up to the maximum number of retries. + * + * @param message A descriptive error message + * @param cause The underlying cause of this exception, if any + */ +class FinchRetryableException +@JvmOverloads +constructor(message: String? = null, cause: Throwable? = null) : FinchException(message, cause) diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/core/http/RetryingHttpClientTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/core/http/RetryingHttpClientTest.kt index fd0f5b5f0..c4a3af5b8 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/core/http/RetryingHttpClientTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/core/http/RetryingHttpClientTest.kt @@ -6,6 +6,7 @@ import com.github.tomakehurst.wiremock.junit5.WireMockTest import com.github.tomakehurst.wiremock.stubbing.Scenario import com.tryfinch.api.client.okhttp.OkHttpClient import com.tryfinch.api.core.RequestOptions +import com.tryfinch.api.errors.FinchRetryableException import java.io.InputStream import java.time.Duration import java.util.concurrent.CompletableFuture @@ -251,6 +252,82 @@ internal class RetryingHttpClientTest { assertNoResponseLeaks() } + @ParameterizedTest + @ValueSource(booleans = [false, true]) + fun execute_withRetryableException(async: Boolean) { + stubFor(post(urlPathEqualTo("/something")).willReturn(ok())) + + var callCount = 0 + val failingHttpClient = + object : HttpClient { + override fun execute( + request: HttpRequest, + requestOptions: RequestOptions, + ): HttpResponse { + callCount++ + if (callCount == 1) { + throw FinchRetryableException("Simulated retryable failure") + } + return httpClient.execute(request, requestOptions) + } + + override fun executeAsync( + request: HttpRequest, + requestOptions: RequestOptions, + ): CompletableFuture { + callCount++ + if (callCount == 1) { + val future = CompletableFuture() + future.completeExceptionally( + FinchRetryableException("Simulated retryable failure") + ) + return future + } + return httpClient.executeAsync(request, requestOptions) + } + + override fun close() = httpClient.close() + } + + val retryingClient = + RetryingHttpClient.builder() + .httpClient(failingHttpClient) + .maxRetries(2) + .sleeper( + object : RetryingHttpClient.Sleeper { + + override fun sleep(duration: Duration) {} + + override fun sleepAsync(duration: Duration): CompletableFuture = + CompletableFuture.completedFuture(null) + } + ) + .build() + + val response = + retryingClient.execute( + HttpRequest.builder() + .method(HttpMethod.POST) + .baseUrl(baseUrl) + .addPathSegment("something") + .build(), + async, + ) + + assertThat(response.statusCode()).isEqualTo(200) + verify( + 1, + postRequestedFor(urlPathEqualTo("/something")) + .withHeader("x-stainless-retry-count", equalTo("1")), + ) + verify( + 0, + postRequestedFor(urlPathEqualTo("/something")) + .withHeader("x-stainless-retry-count", equalTo("0")), + ) + assertNoResponseLeaks() + } + private fun retryingHttpClientBuilder() = RetryingHttpClient.builder() .httpClient(httpClient) From 700fb080718f1b339860b9e384f3f359a0e6290f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 31 Jul 2025 21:04:07 +0000 Subject: [PATCH 03/18] fix(client): r8 support --- .../META-INF/proguard/finch-java-core.pro | 16 ++++---- finch-java-proguard-test/build.gradle.kts | 40 ++++++++++++++++--- .../api/proguard/ProGuardCompatibilityTest.kt | 17 ++++++-- finch-java-proguard-test/test.pro | 5 ++- 4 files changed, 61 insertions(+), 17 deletions(-) diff --git a/finch-java-core/src/main/resources/META-INF/proguard/finch-java-core.pro b/finch-java-core/src/main/resources/META-INF/proguard/finch-java-core.pro index 4c01ba583..d0db10fb0 100644 --- a/finch-java-core/src/main/resources/META-INF/proguard/finch-java-core.pro +++ b/finch-java-core/src/main/resources/META-INF/proguard/finch-java-core.pro @@ -1,5 +1,5 @@ # Jackson uses reflection and depends heavily on runtime attributes. --keepattributes +-keepattributes Exceptions,InnerClasses,Signature,Deprecated,*Annotation* # Jackson uses Kotlin reflection utilities, which themselves use reflection to access things. -keep class kotlin.reflect.** { *; } @@ -17,13 +17,13 @@ *; } -# Jackson uses reflection to access the default constructors of serializers and deserializers. --keepclassmembers class * extends com.tryfinch.api.core.BaseSerializer { - (); -} --keepclassmembers class * extends com.tryfinch.api.core.BaseDeserializer { - (); -} +# Jackson uses reified type information to serialize and deserialize our classes (via `TypeReference`). +-keep class com.fasterxml.jackson.core.type.TypeReference { *; } +-keep class * extends com.fasterxml.jackson.core.type.TypeReference { *; } + +# Jackson uses reflection to access our class serializers and deserializers. +-keep @com.fasterxml.jackson.databind.annotation.JsonSerialize class com.tryfinch.api.** { *; } +-keep @com.fasterxml.jackson.databind.annotation.JsonDeserialize class com.tryfinch.api.** { *; } # Jackson uses reflection to serialize and deserialize our classes based on their constructors and annotated members. -keepclassmembers class com.tryfinch.api.** { diff --git a/finch-java-proguard-test/build.gradle.kts b/finch-java-proguard-test/build.gradle.kts index a1a5b39bd..ea2b82edc 100644 --- a/finch-java-proguard-test/build.gradle.kts +++ b/finch-java-proguard-test/build.gradle.kts @@ -4,8 +4,13 @@ plugins { } buildscript { + repositories { + google() + } + dependencies { classpath("com.guardsquare:proguard-gradle:7.4.2") + classpath("com.android.tools:r8:8.3.37") } } @@ -15,7 +20,6 @@ dependencies { testImplementation("org.junit.jupiter:junit-jupiter-api:5.9.3") testImplementation("org.assertj:assertj-core:3.25.3") testImplementation("com.fasterxml.jackson.module:jackson-module-kotlin:2.13.4") - testImplementation("org.junit.platform:junit-platform-console:1.10.1") } tasks.shadowJar { @@ -58,17 +62,43 @@ val testProGuard by tasks.registering(JavaExec::class) { dependsOn(proguardJar) notCompatibleWithConfigurationCache("ProGuard") - mainClass.set("org.junit.platform.console.ConsoleLauncher") + mainClass.set("com.tryfinch.api.proguard.ProGuardCompatibilityTest") classpath = files(proguardJarPath) +} + +val r8JarPath = "${layout.buildDirectory.get()}/libs/${project.name}-${project.version}-r8.jar" +val r8Jar by tasks.registering(JavaExec::class) { + group = "verification" + dependsOn(tasks.shadowJar) + notCompatibleWithConfigurationCache("R8") + + mainClass.set("com.android.tools.r8.R8") + classpath = buildscript.configurations["classpath"] + args = listOf( - "--classpath", proguardJarPath, - "--scan-classpath", - "--details", "verbose", + "--release", + "--classfile", + "--output", r8JarPath, + "--lib", System.getProperty("java.home"), + "--pg-conf", "./test.pro", + "--pg-conf", "../finch-java-core/src/main/resources/META-INF/proguard/finch-java-core.pro", + "--pg-map-output", "${layout.buildDirectory.get()}/r8-mapping.txt", + tasks.shadowJar.get().archiveFile.get().asFile.absolutePath, ) } +val testR8 by tasks.registering(JavaExec::class) { + group = "verification" + dependsOn(r8Jar) + notCompatibleWithConfigurationCache("R8") + + mainClass.set("com.tryfinch.api.proguard.ProGuardCompatibilityTest") + classpath = files(r8JarPath) +} + tasks.test { dependsOn(testProGuard) + dependsOn(testR8) // We defer to the tests run via the ProGuard JAR. enabled = false } diff --git a/finch-java-proguard-test/src/test/kotlin/com/tryfinch/api/proguard/ProGuardCompatibilityTest.kt b/finch-java-proguard-test/src/test/kotlin/com/tryfinch/api/proguard/ProGuardCompatibilityTest.kt index a84035c14..3a0a0cafc 100644 --- a/finch-java-proguard-test/src/test/kotlin/com/tryfinch/api/proguard/ProGuardCompatibilityTest.kt +++ b/finch-java-proguard-test/src/test/kotlin/com/tryfinch/api/proguard/ProGuardCompatibilityTest.kt @@ -9,20 +9,31 @@ import com.tryfinch.api.models.ConnectionStatusType import com.tryfinch.api.models.Individual import com.tryfinch.api.models.IndividualInDirectory import com.tryfinch.api.models.Location +import kotlin.reflect.full.memberFunctions +import kotlin.reflect.jvm.javaMethod import org.assertj.core.api.Assertions.assertThat -import org.junit.jupiter.api.BeforeAll import org.junit.jupiter.api.Test internal class ProGuardCompatibilityTest { companion object { - @BeforeAll @JvmStatic - fun setUp() { + fun main(args: Array) { // To debug that we're using the right JAR. val jarPath = this::class.java.getProtectionDomain().codeSource.location println("JAR being used: $jarPath") + + // We have to manually run the test methods instead of using the JUnit runner because it + // seems impossible to get working with R8. + val test = ProGuardCompatibilityTest() + test::class + .memberFunctions + .asSequence() + .filter { function -> + function.javaMethod?.isAnnotationPresent(Test::class.java) == true + } + .forEach { it.call(test) } } } diff --git a/finch-java-proguard-test/test.pro b/finch-java-proguard-test/test.pro index 94e7bd7cb..b7d5198d0 100644 --- a/finch-java-proguard-test/test.pro +++ b/finch-java-proguard-test/test.pro @@ -2,4 +2,7 @@ -keep class com.tryfinch.api.proguard.** { *; } # For the testing framework. --keep class org.junit.** { *; } \ No newline at end of file +-keep class org.junit.** { *; } + +# Many warnings don't apply for our testing purposes. +-dontwarn \ No newline at end of file From 97228cca761aa1e433639279102a592877e87dca Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 31 Jul 2025 23:27:55 +0000 Subject: [PATCH 04/18] chore(internal): reduce proguard ci logging --- finch-java-proguard-test/build.gradle.kts | 1 - 1 file changed, 1 deletion(-) diff --git a/finch-java-proguard-test/build.gradle.kts b/finch-java-proguard-test/build.gradle.kts index ea2b82edc..e7075df71 100644 --- a/finch-java-proguard-test/build.gradle.kts +++ b/finch-java-proguard-test/build.gradle.kts @@ -37,7 +37,6 @@ val proguardJar by tasks.registering(proguard.gradle.ProGuardTask::class) { outjars(proguardJarPath) printmapping("${layout.buildDirectory.get()}/proguard-mapping.txt") - verbose() dontwarn() val javaHome = System.getProperty("java.home") From 9e577c2f9c082d753abca9d7b2157f5dbc1d3536 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 31 Jul 2025 23:41:26 +0000 Subject: [PATCH 05/18] chore(internal): bump ci test timeout --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2914c6d44..8f6c250b6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,7 @@ on: jobs: lint: - timeout-minutes: 10 + timeout-minutes: 15 name: lint runs-on: ${{ github.repository == 'stainless-sdks/finch-java' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} if: github.event_name == 'push' || github.event.pull_request.head.repo.fork @@ -37,7 +37,7 @@ jobs: - name: Run lints run: ./scripts/lint test: - timeout-minutes: 10 + timeout-minutes: 15 name: test runs-on: ${{ github.repository == 'stainless-sdks/finch-java' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} if: github.event_name == 'push' || github.event.pull_request.head.repo.fork From 290ee954c5520a181678d8472e5849a42485b1ae Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 4 Aug 2025 20:23:06 +0000 Subject: [PATCH 06/18] chore(internal): add async lock helper --- .../kotlin/com/tryfinch/api/core/Utils.kt | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/core/Utils.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/core/Utils.kt index 3acb9ed3e..7580ba7ba 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/core/Utils.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/core/Utils.kt @@ -6,6 +6,8 @@ import com.tryfinch.api.core.http.Headers import com.tryfinch.api.errors.FinchInvalidDataException import java.util.Collections import java.util.SortedMap +import java.util.concurrent.CompletableFuture +import java.util.concurrent.locks.Lock @JvmSynthetic internal fun T?.getOrThrow(name: String): T = @@ -95,3 +97,24 @@ internal fun Headers.getRequiredHeader(name: String): String = values(name).firstOrNull() ?: throw FinchInvalidDataException("Could not find $name header") internal interface Enum + +/** + * Executes the given [action] while holding the lock, returning a [CompletableFuture] with the + * result. + * + * @param action The asynchronous action to execute while holding the lock + * @return A [CompletableFuture] that completes with the result of the action + */ +@JvmSynthetic +internal fun Lock.withLockAsync(action: () -> CompletableFuture): CompletableFuture { + lock() + val future = + try { + action() + } catch (e: Throwable) { + unlock() + throw e + } + future.whenComplete { _, _ -> unlock() } + return future +} From 316356fb19963ef6ef9698102f2f66ea7111d8be Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 5 Aug 2025 19:11:42 +0000 Subject: [PATCH 07/18] chore(example): fix run example comment --- finch-java-example/build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/finch-java-example/build.gradle.kts b/finch-java-example/build.gradle.kts index 286061d09..258807999 100644 --- a/finch-java-example/build.gradle.kts +++ b/finch-java-example/build.gradle.kts @@ -18,7 +18,7 @@ tasks.withType().configureEach { application { // Use `./gradlew :finch-java-example:run` to run `Main` - // Use `./gradlew :finch-java-example:run -Dexample=Something` to run `SomethingExample` + // Use `./gradlew :finch-java-example:run -Pexample=Something` to run `SomethingExample` mainClass = "com.tryfinch.api.example.${ if (project.hasProperty("example")) "${project.property("example")}Example" From 1eed053bef23cc9aa82085af0d17c94adc63e225 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 7 Aug 2025 16:18:34 +0000 Subject: [PATCH 08/18] chore: increase max gradle JVM heap to 8GB --- gradle.properties | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/gradle.properties b/gradle.properties index ff76593f6..6680f9ce9 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,12 +4,13 @@ org.gradle.parallel=true org.gradle.daemon=false # These options improve our compilation and test performance. They are inherited by the Kotlin daemon. org.gradle.jvmargs=\ - -Xms1g \ - -Xmx4g \ + -Xms2g \ + -Xmx8g \ -XX:+UseParallelGC \ -XX:InitialCodeCacheSize=256m \ -XX:ReservedCodeCacheSize=1G \ - -XX:MetaspaceSize=256m \ + -XX:MetaspaceSize=512m \ + -XX:MaxMetaspaceSize=2G \ -XX:TieredStopAtLevel=1 \ -XX:GCTimeRatio=4 \ -XX:CICompilerCount=4 \ From 93387157cbd7f20a97e713952ae8eacd34a6129f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 8 Aug 2025 18:01:25 +0000 Subject: [PATCH 09/18] chore: update @stainless-api/prism-cli to v5.15.0 --- scripts/mock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/mock b/scripts/mock index d2814ae6a..0b28f6ea2 100755 --- a/scripts/mock +++ b/scripts/mock @@ -21,7 +21,7 @@ echo "==> Starting mock server with URL ${URL}" # Run prism mock on the given spec if [ "$1" == "--daemon" ]; then - npm exec --package=@stainless-api/prism-cli@5.8.5 -- prism mock "$URL" &> .prism.log & + npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock "$URL" &> .prism.log & # Wait for server to come online echo -n "Waiting for server" @@ -37,5 +37,5 @@ if [ "$1" == "--daemon" ]; then echo else - npm exec --package=@stainless-api/prism-cli@5.8.5 -- prism mock "$URL" + npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock "$URL" fi From 9a58acbb6d50ac2c08c2a00243fc547d8f6193fe Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 8 Aug 2025 21:27:06 +0000 Subject: [PATCH 10/18] chore(internal): update comment in script --- scripts/test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/test b/scripts/test index 6b750a74e..2177cb8ae 100755 --- a/scripts/test +++ b/scripts/test @@ -43,7 +43,7 @@ elif ! prism_is_running ; then echo -e "To run the server, pass in the path or url of your OpenAPI" echo -e "spec to the prism command:" echo - echo -e " \$ ${YELLOW}npm exec --package=@stoplight/prism-cli@~5.3.2 -- prism mock path/to/your.openapi.yml${NC}" + echo -e " \$ ${YELLOW}npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock path/to/your.openapi.yml${NC}" echo exit 1 From 21029e1962110fd6394a08af08b97ae39e784e79 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 11 Aug 2025 23:12:46 +0000 Subject: [PATCH 11/18] feat(api): api update --- .stats.yml | 4 ++-- .../tryfinch/api/models/AutomatedAsyncJob.kt | 6 ++--- .../com/tryfinch/api/models/ManualAsyncJob.kt | 24 +++++++++---------- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/.stats.yml b/.stats.yml index cedd110a5..1701810f8 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 45 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-73c284d36c1ed2d9963fc733e421005fad76e559de8efe9baa6511a43dd72668.yml -openapi_spec_hash: 1e58c4445919b71c77e5c7f16bd6fa7d +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-d5e464682bd08cc19d0c41aa783238846cdc1162a8765083bd5c7e3ca78655d5.yml +openapi_spec_hash: 40b39b0a6fcd33ce59c96bec3ebb5985 config_hash: 5146b12344dae76238940989dac1e8a0 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 d608907b8..3230e4fa6 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 @@ -108,7 +108,7 @@ private constructor( /** * The datetime a job is scheduled to be run. For scheduled jobs, this datetime can be in the - * future if the job has not yet been enqueued. For ad-hoc jobs, this field will be null. + * future if the job has not yet been enqueued. For ad-hoc jobs, this field will be null. * * @throws FinchInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -342,8 +342,8 @@ private constructor( /** * The datetime a job is scheduled to be run. For scheduled jobs, this datetime can be in - * the future if the job has not yet been enqueued. For ad-hoc jobs, this field will - * be null. + * the future if the job has not yet been enqueued. For ad-hoc jobs, this field will be + * null. */ fun scheduledAt(scheduledAt: OffsetDateTime?) = scheduledAt(JsonField.ofNullable(scheduledAt)) 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 d76f84e3c..2bd6478f8 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ManualAsyncJob.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ManualAsyncJob.kt @@ -22,7 +22,7 @@ import kotlin.jvm.optionals.getOrNull class ManualAsyncJob private constructor( - private val body: JsonField>, + private val body: JsonField>, private val jobId: JsonField, private val status: JsonField, private val additionalProperties: MutableMap, @@ -30,7 +30,7 @@ private constructor( @JsonCreator private constructor( - @JsonProperty("body") @ExcludeMissing body: JsonField> = JsonMissing.of(), + @JsonProperty("body") @ExcludeMissing body: JsonField> = JsonMissing.of(), @JsonProperty("job_id") @ExcludeMissing jobId: JsonField = JsonMissing.of(), @JsonProperty("status") @ExcludeMissing status: JsonField = JsonMissing.of(), ) : this(body, jobId, status, mutableMapOf()) @@ -41,7 +41,7 @@ private constructor( * @throws FinchInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). */ - fun body(): Optional> = body.getOptional("body") + fun body(): Optional> = body.getOptional("body") /** * @throws FinchInvalidDataException if the JSON field has an unexpected type or is unexpectedly @@ -60,7 +60,7 @@ private constructor( * * Unlike [body], this method doesn't throw if the JSON field has an unexpected type. */ - @JsonProperty("body") @ExcludeMissing fun _body(): JsonField> = body + @JsonProperty("body") @ExcludeMissing fun _body(): JsonField> = body /** * Returns the raw JSON value of [jobId]. @@ -106,7 +106,7 @@ private constructor( /** A builder for [ManualAsyncJob]. */ class Builder internal constructor() { - private var body: JsonField>? = null + private var body: JsonField>? = null private var jobId: JsonField? = null private var status: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -120,19 +120,19 @@ private constructor( } /** Specific information about the job, such as individual statuses for batch jobs. */ - fun body(body: List?) = body(JsonField.ofNullable(body)) + fun body(body: List?) = body(JsonField.ofNullable(body)) /** Alias for calling [Builder.body] with `body.orElse(null)`. */ - fun body(body: Optional>) = body(body.getOrNull()) + fun body(body: Optional>) = body(body.getOrNull()) /** * Sets [Builder.body] to an arbitrary JSON value. * - * You should usually call [Builder.body] with a well-typed `List` value instead. - * This method is primarily for setting the field to an undocumented or not yet supported - * value. + * You should usually call [Builder.body] with a well-typed `List` value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. */ - fun body(body: JsonField>) = apply { + fun body(body: JsonField>) = apply { this.body = body.map { it.toMutableList() } } @@ -238,7 +238,7 @@ private constructor( */ @JvmSynthetic internal fun validity(): Int = - (body.asKnown().getOrNull()?.size ?: 0) + + (body.asKnown().getOrNull()?.sumOf { (if (it == null) 0 else 1).toInt() } ?: 0) + (if (jobId.asKnown().isPresent) 1 else 0) + (status.asKnown().getOrNull()?.validity() ?: 0) From e282b93f4af685cb1f90e0d3f625992f2244fca7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 12 Aug 2025 18:43:39 +0000 Subject: [PATCH 12/18] feat(api): api update --- .stats.yml | 4 +- .../tryfinch/api/models/DisconnectResponse.kt | 4 +- .../api/models/JobAutomatedListParams.kt | 28 +++++++++++-- .../api/models/JobAutomatedRetrieveParams.kt | 35 ++++++++++++++-- .../api/models/JobManualRetrieveParams.kt | 41 ++++++++++++++++--- .../models/RequestForwardingForwardParams.kt | 6 +-- .../RequestForwardingForwardResponse.kt | 28 ++++++------- .../async/RequestForwardingServiceAsync.kt | 6 +-- .../blocking/RequestForwardingService.kt | 6 +-- .../api/models/JobAutomatedListParamsTest.kt | 21 ++++++++-- .../models/JobAutomatedRetrieveParamsTest.kt | 33 ++++++++++++++- .../api/models/JobManualRetrieveParamsTest.kt | 33 ++++++++++++++- .../async/jobs/AutomatedServiceAsyncTest.kt | 15 ++++++- .../async/jobs/ManualServiceAsyncTest.kt | 9 +++- .../blocking/jobs/AutomatedServiceTest.kt | 17 +++++++- .../blocking/jobs/ManualServiceTest.kt | 9 +++- 16 files changed, 245 insertions(+), 50 deletions(-) diff --git a/.stats.yml b/.stats.yml index 1701810f8..019c8e662 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 45 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-d5e464682bd08cc19d0c41aa783238846cdc1162a8765083bd5c7e3ca78655d5.yml -openapi_spec_hash: 40b39b0a6fcd33ce59c96bec3ebb5985 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-e8b684dbd61d1724b5e516a573a952bb6906d63840e27ebda7731a2f71061aff.yml +openapi_spec_hash: 8baff9577d4e721d0494ff315da267ca config_hash: 5146b12344dae76238940989dac1e8a0 diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/DisconnectResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/DisconnectResponse.kt index c46c0b60f..ac0d9d735 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/DisconnectResponse.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/DisconnectResponse.kt @@ -27,7 +27,7 @@ private constructor( ) : this(status, mutableMapOf()) /** - * If the request is successful, Finch will return “success” (HTTP 200 status). + * If the request is successful, Finch will return "success" (HTTP 200 status). * * @throws FinchInvalidDataException if the JSON field has an unexpected type or is unexpectedly * missing or null (e.g. if the server responded with an unexpected value). @@ -78,7 +78,7 @@ private constructor( additionalProperties = disconnectResponse.additionalProperties.toMutableMap() } - /** If the request is successful, Finch will return “success” (HTTP 200 status). */ + /** If the request is successful, Finch will return "success" (HTTP 200 status). */ fun status(status: String) = status(JsonField.of(status)) /** 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 66e3c08c5..10f7972ff 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobAutomatedListParams.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/JobAutomatedListParams.kt @@ -16,12 +16,20 @@ import kotlin.jvm.optionals.getOrNull */ class JobAutomatedListParams private constructor( + private val entityId: String?, private val limit: Long?, private val offset: Long?, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, ) : Params { + /** + * The entity ID to use when authenticating with a multi-account token. Required when using a + * multi-account token to specify which entity's data to access. Example: + * `123e4567-e89b-12d3-a456-426614174000` + */ + fun entityId(): Optional = Optional.ofNullable(entityId) + /** Number of items to return */ fun limit(): Optional = Optional.ofNullable(limit) @@ -47,6 +55,7 @@ private constructor( /** A builder for [JobAutomatedListParams]. */ class Builder internal constructor() { + private var entityId: String? = null private var limit: Long? = null private var offset: Long? = null private var additionalHeaders: Headers.Builder = Headers.builder() @@ -54,12 +63,23 @@ private constructor( @JvmSynthetic internal fun from(jobAutomatedListParams: JobAutomatedListParams) = apply { + entityId = jobAutomatedListParams.entityId limit = jobAutomatedListParams.limit offset = jobAutomatedListParams.offset additionalHeaders = jobAutomatedListParams.additionalHeaders.toBuilder() additionalQueryParams = jobAutomatedListParams.additionalQueryParams.toBuilder() } + /** + * The entity ID to use when authenticating with a multi-account token. Required when using + * a multi-account token to specify which entity's data to access. Example: + * `123e4567-e89b-12d3-a456-426614174000` + */ + fun entityId(entityId: String?) = apply { this.entityId = entityId } + + /** Alias for calling [Builder.entityId] with `entityId.orElse(null)`. */ + fun entityId(entityId: Optional) = entityId(entityId.getOrNull()) + /** Number of items to return */ fun limit(limit: Long?) = apply { this.limit = limit } @@ -191,6 +211,7 @@ private constructor( */ fun build(): JobAutomatedListParams = JobAutomatedListParams( + entityId, limit, offset, additionalHeaders.build(), @@ -203,6 +224,7 @@ private constructor( override fun _queryParams(): QueryParams = QueryParams.builder() .apply { + entityId?.let { put("entity_id", it) } limit?.let { put("limit", it.toString()) } offset?.let { put("offset", it.toString()) } putAll(additionalQueryParams) @@ -214,11 +236,11 @@ private constructor( return true } - return /* spotless:off */ other is JobAutomatedListParams && limit == other.limit && offset == other.offset && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams /* spotless:on */ + return /* spotless:off */ other is JobAutomatedListParams && entityId == other.entityId && limit == other.limit && offset == other.offset && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams /* spotless:on */ } - override fun hashCode(): Int = /* spotless:off */ Objects.hash(limit, offset, additionalHeaders, additionalQueryParams) /* spotless:on */ + override fun hashCode(): Int = /* spotless:off */ Objects.hash(entityId, limit, offset, additionalHeaders, additionalQueryParams) /* spotless:on */ override fun toString() = - "JobAutomatedListParams{limit=$limit, offset=$offset, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" + "JobAutomatedListParams{entityId=$entityId, limit=$limit, offset=$offset, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" } 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 a5ccd5826..8afdd20a4 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 @@ -13,12 +13,20 @@ import kotlin.jvm.optionals.getOrNull class JobAutomatedRetrieveParams private constructor( private val jobId: String?, + private val entityId: String?, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, ) : Params { fun jobId(): Optional = Optional.ofNullable(jobId) + /** + * The entity ID to use when authenticating with a multi-account token. Required when using a + * multi-account token to specify which entity's data to access. Example: + * `123e4567-e89b-12d3-a456-426614174000` + */ + fun entityId(): Optional = Optional.ofNullable(entityId) + /** Additional headers to send with the request. */ fun _additionalHeaders(): Headers = additionalHeaders @@ -41,12 +49,14 @@ private constructor( class Builder internal constructor() { private var jobId: String? = null + private var entityId: String? = null private var additionalHeaders: Headers.Builder = Headers.builder() private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() @JvmSynthetic internal fun from(jobAutomatedRetrieveParams: JobAutomatedRetrieveParams) = apply { jobId = jobAutomatedRetrieveParams.jobId + entityId = jobAutomatedRetrieveParams.entityId additionalHeaders = jobAutomatedRetrieveParams.additionalHeaders.toBuilder() additionalQueryParams = jobAutomatedRetrieveParams.additionalQueryParams.toBuilder() } @@ -56,6 +66,16 @@ private constructor( /** Alias for calling [Builder.jobId] with `jobId.orElse(null)`. */ fun jobId(jobId: Optional) = jobId(jobId.getOrNull()) + /** + * The entity ID to use when authenticating with a multi-account token. Required when using + * a multi-account token to specify which entity's data to access. Example: + * `123e4567-e89b-12d3-a456-426614174000` + */ + fun entityId(entityId: String?) = apply { this.entityId = entityId } + + /** Alias for calling [Builder.entityId] with `entityId.orElse(null)`. */ + fun entityId(entityId: Optional) = entityId(entityId.getOrNull()) + fun additionalHeaders(additionalHeaders: Headers) = apply { this.additionalHeaders.clear() putAllAdditionalHeaders(additionalHeaders) @@ -162,6 +182,7 @@ private constructor( fun build(): JobAutomatedRetrieveParams = JobAutomatedRetrieveParams( jobId, + entityId, additionalHeaders.build(), additionalQueryParams.build(), ) @@ -175,18 +196,24 @@ private constructor( override fun _headers(): Headers = additionalHeaders - override fun _queryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = + QueryParams.builder() + .apply { + entityId?.let { put("entity_id", it) } + putAll(additionalQueryParams) + } + .build() override fun equals(other: Any?): Boolean { if (this === other) { return true } - return /* spotless:off */ other is JobAutomatedRetrieveParams && jobId == other.jobId && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams /* spotless:on */ + return /* spotless:off */ other is JobAutomatedRetrieveParams && jobId == other.jobId && entityId == other.entityId && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams /* spotless:on */ } - override fun hashCode(): Int = /* spotless:off */ Objects.hash(jobId, additionalHeaders, additionalQueryParams) /* spotless:on */ + override fun hashCode(): Int = /* spotless:off */ Objects.hash(jobId, entityId, additionalHeaders, additionalQueryParams) /* spotless:on */ override fun toString() = - "JobAutomatedRetrieveParams{jobId=$jobId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" + "JobAutomatedRetrieveParams{jobId=$jobId, entityId=$entityId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" } 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 630bd34ff..1dbae3b7d 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 @@ -16,12 +16,20 @@ import kotlin.jvm.optionals.getOrNull class JobManualRetrieveParams private constructor( private val jobId: String?, + private val entityId: String?, private val additionalHeaders: Headers, private val additionalQueryParams: QueryParams, ) : Params { fun jobId(): Optional = Optional.ofNullable(jobId) + /** + * The entity ID to use when authenticating with a multi-account token. Required when using a + * multi-account token to specify which entity's data to access. Example: + * `123e4567-e89b-12d3-a456-426614174000` + */ + fun entityId(): Optional = Optional.ofNullable(entityId) + /** Additional headers to send with the request. */ fun _additionalHeaders(): Headers = additionalHeaders @@ -42,12 +50,14 @@ private constructor( class Builder internal constructor() { private var jobId: String? = null + private var entityId: String? = null private var additionalHeaders: Headers.Builder = Headers.builder() private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() @JvmSynthetic internal fun from(jobManualRetrieveParams: JobManualRetrieveParams) = apply { jobId = jobManualRetrieveParams.jobId + entityId = jobManualRetrieveParams.entityId additionalHeaders = jobManualRetrieveParams.additionalHeaders.toBuilder() additionalQueryParams = jobManualRetrieveParams.additionalQueryParams.toBuilder() } @@ -57,6 +67,16 @@ private constructor( /** Alias for calling [Builder.jobId] with `jobId.orElse(null)`. */ fun jobId(jobId: Optional) = jobId(jobId.getOrNull()) + /** + * The entity ID to use when authenticating with a multi-account token. Required when using + * a multi-account token to specify which entity's data to access. Example: + * `123e4567-e89b-12d3-a456-426614174000` + */ + fun entityId(entityId: String?) = apply { this.entityId = entityId } + + /** Alias for calling [Builder.entityId] with `entityId.orElse(null)`. */ + fun entityId(entityId: Optional) = entityId(entityId.getOrNull()) + fun additionalHeaders(additionalHeaders: Headers) = apply { this.additionalHeaders.clear() putAllAdditionalHeaders(additionalHeaders) @@ -161,7 +181,12 @@ private constructor( * Further updates to this [Builder] will not mutate the returned instance. */ fun build(): JobManualRetrieveParams = - JobManualRetrieveParams(jobId, additionalHeaders.build(), additionalQueryParams.build()) + JobManualRetrieveParams( + jobId, + entityId, + additionalHeaders.build(), + additionalQueryParams.build(), + ) } fun _pathParam(index: Int): String = @@ -172,18 +197,24 @@ private constructor( override fun _headers(): Headers = additionalHeaders - override fun _queryParams(): QueryParams = additionalQueryParams + override fun _queryParams(): QueryParams = + QueryParams.builder() + .apply { + entityId?.let { put("entity_id", it) } + putAll(additionalQueryParams) + } + .build() override fun equals(other: Any?): Boolean { if (this === other) { return true } - return /* spotless:off */ other is JobManualRetrieveParams && jobId == other.jobId && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams /* spotless:on */ + return /* spotless:off */ other is JobManualRetrieveParams && jobId == other.jobId && entityId == other.entityId && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams /* spotless:on */ } - override fun hashCode(): Int = /* spotless:off */ Objects.hash(jobId, additionalHeaders, additionalQueryParams) /* spotless:on */ + override fun hashCode(): Int = /* spotless:off */ Objects.hash(jobId, entityId, additionalHeaders, additionalQueryParams) /* spotless:on */ override fun toString() = - "JobManualRetrieveParams{jobId=$jobId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" + "JobManualRetrieveParams{jobId=$jobId, entityId=$entityId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" } 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 b2655961a..6e8ae0984 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 @@ -21,9 +21,9 @@ import java.util.Optional import kotlin.jvm.optionals.getOrNull /** - * The Forward API allows you to make direct requests to an employment system. If Finch’s unified - * API doesn’t have a data model that cleanly fits your needs, then Forward allows you to push or - * pull data models directly against an integration’s API. + * The Forward API allows you to make direct requests to an employment system. If Finch's unified + * API doesn't have a data model that cleanly fits your needs, then Forward allows you to push or + * pull data models directly against an integration's API. */ class RequestForwardingForwardParams private constructor( diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/RequestForwardingForwardResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/RequestForwardingForwardResponse.kt index 975d9d298..aa695568d 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/RequestForwardingForwardResponse.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/RequestForwardingForwardResponse.kt @@ -35,9 +35,9 @@ private constructor( ) : this(data, headers, request, statusCode, mutableMapOf()) /** - * A string representation of the HTTP response body of the forwarded request’s response - * received from the underlying integration’s API. This field may be null in the case where the - * upstream system’s response is empty. + * A string representation of the HTTP response body of the forwarded request's response + * received from the underlying integration's API. This field may be null in the case where the + * upstream system's response is empty. * * @throws FinchInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -45,8 +45,8 @@ private constructor( fun data(): Optional = data.getOptional("data") /** - * The HTTP headers of the forwarded request’s response, exactly as received from the underlying - * integration’s API. + * The HTTP headers of the forwarded request's response, exactly as received from the underlying + * integration's API. */ @JsonProperty("headers") @ExcludeMissing fun _headers(): JsonValue = headers @@ -59,8 +59,8 @@ private constructor( fun request(): Request = request.getRequired("request") /** - * The HTTP status code of the forwarded request’s response, exactly received from the - * underlying integration’s API. This value will be returned as an integer. + * The HTTP status code of the forwarded request's response, exactly received from the + * underlying integration's API. This value will be returned as an integer. * * @throws FinchInvalidDataException if the JSON field has an unexpected type or is unexpectedly * missing or null (e.g. if the server responded with an unexpected value). @@ -138,9 +138,9 @@ private constructor( } /** - * A string representation of the HTTP response body of the forwarded request’s response - * received from the underlying integration’s API. This field may be null in the case where - * the upstream system’s response is empty. + * A string representation of the HTTP response body of the forwarded request's response + * received from the underlying integration's API. This field may be null in the case where + * the upstream system's response is empty. */ fun data(data: String?) = data(JsonField.ofNullable(data)) @@ -156,8 +156,8 @@ private constructor( fun data(data: JsonField) = apply { this.data = data } /** - * The HTTP headers of the forwarded request’s response, exactly as received from the - * underlying integration’s API. + * The HTTP headers of the forwarded request's response, exactly as received from the + * underlying integration's API. */ fun headers(headers: JsonValue) = apply { this.headers = headers } @@ -176,8 +176,8 @@ private constructor( fun request(request: JsonField) = apply { this.request = request } /** - * The HTTP status code of the forwarded request’s response, exactly received from the - * underlying integration’s API. This value will be returned as an integer. + * The HTTP status code of the forwarded request's response, exactly received from the + * underlying integration's API. This value will be returned as an integer. */ fun statusCode(statusCode: Long) = statusCode(JsonField.of(statusCode)) diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/RequestForwardingServiceAsync.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/RequestForwardingServiceAsync.kt index 69fe6e0e0..59b316a1c 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/RequestForwardingServiceAsync.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/async/RequestForwardingServiceAsync.kt @@ -25,9 +25,9 @@ interface RequestForwardingServiceAsync { fun withOptions(modifier: Consumer): RequestForwardingServiceAsync /** - * The Forward API allows you to make direct requests to an employment system. If Finch’s - * unified API doesn’t have a data model that cleanly fits your needs, then Forward allows you - * to push or pull data models directly against an integration’s API. + * The Forward API allows you to make direct requests to an employment system. If Finch's + * unified API doesn't have a data model that cleanly fits your needs, then Forward allows you + * to push or pull data models directly against an integration's API. */ fun forward( params: RequestForwardingForwardParams diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/RequestForwardingService.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/RequestForwardingService.kt index a478ebc81..79c524957 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/RequestForwardingService.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/services/blocking/RequestForwardingService.kt @@ -25,9 +25,9 @@ interface RequestForwardingService { fun withOptions(modifier: Consumer): RequestForwardingService /** - * The Forward API allows you to make direct requests to an employment system. If Finch’s - * unified API doesn’t have a data model that cleanly fits your needs, then Forward allows you - * to push or pull data models directly against an integration’s API. + * The Forward API allows you to make direct requests to an employment system. If Finch's + * unified API doesn't have a data model that cleanly fits your needs, then Forward allows you + * to push or pull data models directly against an integration's API. */ fun forward(params: RequestForwardingForwardParams): RequestForwardingForwardResponse = forward(params, RequestOptions.none()) 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 a6a42d5d7..b88567a2d 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 @@ -10,17 +10,32 @@ internal class JobAutomatedListParamsTest { @Test fun create() { - JobAutomatedListParams.builder().limit(0L).offset(0L).build() + JobAutomatedListParams.builder() + .entityId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .limit(0L) + .offset(0L) + .build() } @Test fun queryParams() { - val params = JobAutomatedListParams.builder().limit(0L).offset(0L).build() + val params = + JobAutomatedListParams.builder() + .entityId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .limit(0L) + .offset(0L) + .build() val queryParams = params._queryParams() assertThat(queryParams) - .isEqualTo(QueryParams.builder().put("limit", "0").put("offset", "0").build()) + .isEqualTo( + QueryParams.builder() + .put("entity_id", "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .put("limit", "0") + .put("offset", "0") + .build() + ) } @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 d8c03a77d..389858129 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,6 +2,7 @@ package com.tryfinch.api.models +import com.tryfinch.api.core.http.QueryParams import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -9,7 +10,10 @@ internal class JobAutomatedRetrieveParamsTest { @Test fun create() { - JobAutomatedRetrieveParams.builder().jobId("job_id").build() + JobAutomatedRetrieveParams.builder() + .jobId("job_id") + .entityId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() } @Test @@ -20,4 +24,31 @@ internal class JobAutomatedRetrieveParamsTest { // out-of-bound path param assertThat(params._pathParam(1)).isEqualTo("") } + + @Test + fun queryParams() { + val params = + JobAutomatedRetrieveParams.builder() + .jobId("job_id") + .entityId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + + val queryParams = params._queryParams() + + assertThat(queryParams) + .isEqualTo( + QueryParams.builder() + .put("entity_id", "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + ) + } + + @Test + fun queryParamsWithoutOptionalFields() { + val params = JobAutomatedRetrieveParams.builder().jobId("job_id").build() + + val queryParams = params._queryParams() + + assertThat(queryParams).isEqualTo(QueryParams.builder().build()) + } } diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/models/JobManualRetrieveParamsTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/models/JobManualRetrieveParamsTest.kt index 4d7590ced..42fee7d24 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,6 +2,7 @@ package com.tryfinch.api.models +import com.tryfinch.api.core.http.QueryParams import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -9,7 +10,10 @@ internal class JobManualRetrieveParamsTest { @Test fun create() { - JobManualRetrieveParams.builder().jobId("job_id").build() + JobManualRetrieveParams.builder() + .jobId("job_id") + .entityId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() } @Test @@ -20,4 +24,31 @@ internal class JobManualRetrieveParamsTest { // out-of-bound path param assertThat(params._pathParam(1)).isEqualTo("") } + + @Test + fun queryParams() { + val params = + JobManualRetrieveParams.builder() + .jobId("job_id") + .entityId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + + val queryParams = params._queryParams() + + assertThat(queryParams) + .isEqualTo( + QueryParams.builder() + .put("entity_id", "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + ) + } + + @Test + fun queryParamsWithoutOptionalFields() { + val params = JobManualRetrieveParams.builder().jobId("job_id").build() + + val queryParams = params._queryParams() + + assertThat(queryParams).isEqualTo(QueryParams.builder().build()) + } } diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/services/async/jobs/AutomatedServiceAsyncTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/services/async/jobs/AutomatedServiceAsyncTest.kt index 689095724..7dd78c560 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/services/async/jobs/AutomatedServiceAsyncTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/services/async/jobs/AutomatedServiceAsyncTest.kt @@ -6,6 +6,7 @@ import com.tryfinch.api.TestServerExtension import com.tryfinch.api.client.okhttp.FinchOkHttpClientAsync 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 @@ -39,7 +40,13 @@ internal class AutomatedServiceAsyncTest { .build() val automatedServiceAsync = client.jobs().automated() - val automatedAsyncJobFuture = automatedServiceAsync.retrieve("job_id") + val automatedAsyncJobFuture = + automatedServiceAsync.retrieve( + JobAutomatedRetrieveParams.builder() + .jobId("job_id") + .entityId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + ) val automatedAsyncJob = automatedAsyncJobFuture.get() automatedAsyncJob.validate() @@ -56,7 +63,11 @@ internal class AutomatedServiceAsyncTest { val automatedsFuture = automatedServiceAsync.list( - JobAutomatedListParams.builder().limit(0L).offset(0L).build() + JobAutomatedListParams.builder() + .entityId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .limit(0L) + .offset(0L) + .build() ) val automateds = automatedsFuture.get() diff --git a/finch-java-core/src/test/kotlin/com/tryfinch/api/services/async/jobs/ManualServiceAsyncTest.kt b/finch-java-core/src/test/kotlin/com/tryfinch/api/services/async/jobs/ManualServiceAsyncTest.kt index 87d73cfab..f3aa0c983 100644 --- a/finch-java-core/src/test/kotlin/com/tryfinch/api/services/async/jobs/ManualServiceAsyncTest.kt +++ b/finch-java-core/src/test/kotlin/com/tryfinch/api/services/async/jobs/ManualServiceAsyncTest.kt @@ -4,6 +4,7 @@ package com.tryfinch.api.services.async.jobs import com.tryfinch.api.TestServerExtension import com.tryfinch.api.client.okhttp.FinchOkHttpClientAsync +import com.tryfinch.api.models.JobManualRetrieveParams import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -19,7 +20,13 @@ internal class ManualServiceAsyncTest { .build() val manualServiceAsync = client.jobs().manual() - val manualAsyncJobFuture = manualServiceAsync.retrieve("job_id") + val manualAsyncJobFuture = + manualServiceAsync.retrieve( + JobManualRetrieveParams.builder() + .jobId("job_id") + .entityId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + ) val manualAsyncJob = manualAsyncJobFuture.get() manualAsyncJob.validate() 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 e4121bc5b..6b576c1e8 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 @@ -6,6 +6,7 @@ import com.tryfinch.api.TestServerExtension import com.tryfinch.api.client.okhttp.FinchOkHttpClient 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 @@ -36,7 +37,13 @@ internal class AutomatedServiceTest { .build() val automatedService = client.jobs().automated() - val automatedAsyncJob = automatedService.retrieve("job_id") + val automatedAsyncJob = + automatedService.retrieve( + JobAutomatedRetrieveParams.builder() + .jobId("job_id") + .entityId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + ) automatedAsyncJob.validate() } @@ -51,7 +58,13 @@ internal class AutomatedServiceTest { val automatedService = client.jobs().automated() val automateds = - automatedService.list(JobAutomatedListParams.builder().limit(0L).offset(0L).build()) + automatedService.list( + JobAutomatedListParams.builder() + .entityId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .limit(0L) + .offset(0L) + .build() + ) automateds.validate() } 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 3ee64260e..b3d4fc55c 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,6 +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.JobManualRetrieveParams import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -19,7 +20,13 @@ internal class ManualServiceTest { .build() val manualService = client.jobs().manual() - val manualAsyncJob = manualService.retrieve("job_id") + val manualAsyncJob = + manualService.retrieve( + JobManualRetrieveParams.builder() + .jobId("job_id") + .entityId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + ) manualAsyncJob.validate() } From fee13320c0585e2ff8ac12e08de92619d81504e9 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 13 Aug 2025 00:46:11 +0000 Subject: [PATCH 13/18] chore(internal): format identity methods --- .../kotlin/com/tryfinch/api/core/Timeout.kt | 8 +- .../api/models/AccessTokenCreateParams.kt | 20 +- .../api/models/AccountCreateResponse.kt | 27 +- .../api/models/AccountDisconnectParams.kt | 8 +- .../api/models/AccountIntrospectParams.kt | 6 +- .../tryfinch/api/models/AccountUpdateEvent.kt | 610 +++++++++++++----- .../api/models/AccountUpdateResponse.kt | 25 +- .../tryfinch/api/models/AutomatedAsyncJob.kt | 39 +- .../api/models/AutomatedCreateResponse.kt | 21 +- .../api/models/AutomatedListResponse.kt | 30 +- .../tryfinch/api/models/BaseWebhookEvent.kt | 12 +- .../api/models/BenefitContribution.kt | 9 +- .../models/BenefitFeaturesAndOperations.kt | 11 +- .../tryfinch/api/models/BenefitFrequency.kt | 2 +- .../com/tryfinch/api/models/BenefitType.kt | 2 +- .../tryfinch/api/models/BenefitsSupport.kt | 35 +- .../kotlin/com/tryfinch/api/models/Company.kt | 76 ++- .../com/tryfinch/api/models/CompanyBenefit.kt | 41 +- .../com/tryfinch/api/models/CompanyEvent.kt | 20 +- .../api/models/CompanyUpdateResponse.kt | 74 ++- .../api/models/ConnectSessionNewParams.kt | 53 +- .../ConnectSessionReauthenticateParams.kt | 22 +- .../api/models/ConnectionCreateResponse.kt | 29 +- .../api/models/ConnectionStatusType.kt | 2 +- .../api/models/CreateAccessTokenResponse.kt | 35 +- .../models/CreateCompanyBenefitsResponse.kt | 7 +- .../api/models/DirectoryCreateResponse.kt | 5 +- .../com/tryfinch/api/models/DirectoryEvent.kt | 22 +- .../tryfinch/api/models/DisconnectResponse.kt | 6 +- .../api/models/DocumentListResponse.kt | 7 +- .../tryfinch/api/models/DocumentResponse.kt | 16 +- .../api/models/DocumentRetreiveResponse.kt | 4 +- .../com/tryfinch/api/models/EmploymentData.kt | 111 +++- .../api/models/EmploymentDataResponse.kt | 12 +- .../tryfinch/api/models/EmploymentEvent.kt | 22 +- .../api/models/EmploymentUpdateResponse.kt | 81 ++- .../EnrolledIndividualBenefitResponse.kt | 6 +- .../api/models/HrisBenefitCreateParams.kt | 40 +- .../HrisBenefitIndividualEnrolledIdsParams.kt | 7 +- ...nefitIndividualRetrieveManyBenefitsPage.kt | 7 +- ...IndividualRetrieveManyBenefitsPageAsync.kt | 8 +- ...fitIndividualRetrieveManyBenefitsParams.kt | 9 +- ...HrisBenefitIndividualUnenrollManyParams.kt | 15 +- .../api/models/HrisBenefitListPage.kt | 7 +- .../api/models/HrisBenefitListPageAsync.kt | 8 +- .../api/models/HrisBenefitListParams.kt | 6 +- .../HrisBenefitListSupportedBenefitsPage.kt | 7 +- ...isBenefitListSupportedBenefitsPageAsync.kt | 8 +- .../HrisBenefitListSupportedBenefitsParams.kt | 6 +- .../api/models/HrisBenefitRetrieveParams.kt | 7 +- .../api/models/HrisBenefitUpdateParams.kt | 15 +- .../HrisCompanyPayStatementItemListPage.kt | 7 +- ...risCompanyPayStatementItemListPageAsync.kt | 8 +- ...CompanyPayStatementItemListPageResponse.kt | 6 +- .../HrisCompanyPayStatementItemListParams.kt | 22 +- ...CompanyPayStatementItemRuleCreateParams.kt | 54 +- ...CompanyPayStatementItemRuleDeleteParams.kt | 9 +- ...HrisCompanyPayStatementItemRuleListPage.kt | 7 +- ...ompanyPayStatementItemRuleListPageAsync.kt | 8 +- ...anyPayStatementItemRuleListPageResponse.kt | 6 +- ...isCompanyPayStatementItemRuleListParams.kt | 6 +- ...CompanyPayStatementItemRuleUpdateParams.kt | 15 +- .../api/models/HrisCompanyRetrieveParams.kt | 6 +- .../HrisDirectoryListIndividualsPage.kt | 7 +- .../HrisDirectoryListIndividualsPageAsync.kt | 8 +- ...risDirectoryListIndividualsPageResponse.kt | 7 +- .../HrisDirectoryListIndividualsParams.kt | 9 +- .../api/models/HrisDirectoryListPage.kt | 7 +- .../api/models/HrisDirectoryListPageAsync.kt | 8 +- .../models/HrisDirectoryListPageResponse.kt | 7 +- .../api/models/HrisDirectoryListParams.kt | 9 +- .../api/models/HrisDocumentListParams.kt | 13 +- .../api/models/HrisDocumentRetreiveParams.kt | 8 +- .../models/HrisEmploymentRetrieveManyPage.kt | 7 +- .../HrisEmploymentRetrieveManyPageAsync.kt | 8 +- .../HrisEmploymentRetrieveManyPageResponse.kt | 6 +- .../HrisEmploymentRetrieveManyParams.kt | 19 +- .../models/HrisIndividualRetrieveManyPage.kt | 7 +- .../HrisIndividualRetrieveManyPageAsync.kt | 8 +- .../HrisIndividualRetrieveManyPageResponse.kt | 6 +- .../HrisIndividualRetrieveManyParams.kt | 26 +- .../HrisPayStatementRetrieveManyPage.kt | 7 +- .../HrisPayStatementRetrieveManyPageAsync.kt | 8 +- ...risPayStatementRetrieveManyPageResponse.kt | 6 +- .../HrisPayStatementRetrieveManyParams.kt | 25 +- .../api/models/HrisPaymentListPage.kt | 7 +- .../api/models/HrisPaymentListPageAsync.kt | 8 +- .../api/models/HrisPaymentListParams.kt | 9 +- .../kotlin/com/tryfinch/api/models/Income.kt | 15 +- .../com/tryfinch/api/models/Individual.kt | 78 ++- .../tryfinch/api/models/IndividualBenefit.kt | 54 +- .../models/IndividualEnrolledIdsResponse.kt | 11 +- .../tryfinch/api/models/IndividualEvent.kt | 22 +- .../api/models/IndividualInDirectory.kt | 37 +- .../tryfinch/api/models/IndividualResponse.kt | 12 +- .../api/models/IndividualUpdateResponse.kt | 59 +- .../com/tryfinch/api/models/Introspection.kt | 86 ++- .../api/models/JobAutomatedCreateParams.kt | 30 +- .../api/models/JobAutomatedListParams.kt | 10 +- .../api/models/JobAutomatedRetrieveParams.kt | 9 +- .../tryfinch/api/models/JobCompletionEvent.kt | 23 +- .../tryfinch/api/models/JobCreateResponse.kt | 13 +- .../api/models/JobManualRetrieveParams.kt | 9 +- .../com/tryfinch/api/models/Location.kt | 27 +- .../com/tryfinch/api/models/ManualAsyncJob.kt | 10 +- .../kotlin/com/tryfinch/api/models/Money.kt | 7 +- .../tryfinch/api/models/OperationSupport.kt | 2 +- .../api/models/OperationSupportMatrix.kt | 13 +- .../kotlin/com/tryfinch/api/models/Paging.kt | 7 +- .../api/models/PayGroupListResponse.kt | 14 +- .../api/models/PayGroupRetrieveResponse.kt | 15 +- .../com/tryfinch/api/models/PayStatement.kt | 166 +++-- .../models/PayStatementDataSyncInProgress.kt | 21 +- .../tryfinch/api/models/PayStatementEvent.kt | 27 +- .../models/PayStatementItemListResponse.kt | 31 +- .../api/models/PayStatementResponse.kt | 29 +- .../api/models/PayStatementResponseBody.kt | 14 +- .../kotlin/com/tryfinch/api/models/Payment.kt | 44 +- .../api/models/PaymentCreateResponse.kt | 7 +- .../com/tryfinch/api/models/PaymentEvent.kt | 23 +- .../api/models/PayrollPayGroupListPage.kt | 7 +- .../models/PayrollPayGroupListPageAsync.kt | 8 +- .../api/models/PayrollPayGroupListParams.kt | 9 +- .../models/PayrollPayGroupRetrieveParams.kt | 8 +- .../com/tryfinch/api/models/Provider.kt | 597 +++++++++++++---- .../tryfinch/api/models/ProviderListPage.kt | 7 +- .../api/models/ProviderListPageAsync.kt | 8 +- .../tryfinch/api/models/ProviderListParams.kt | 6 +- .../models/RequestForwardingForwardParams.kt | 21 +- .../RequestForwardingForwardResponse.kt | 27 +- .../tryfinch/api/models/RuleCreateResponse.kt | 55 +- .../tryfinch/api/models/RuleDeleteResponse.kt | 57 +- .../tryfinch/api/models/RuleListResponse.kt | 55 +- .../tryfinch/api/models/RuleUpdateResponse.kt | 55 +- .../api/models/SandboxCompanyUpdateParams.kt | 81 ++- .../SandboxConnectionAccountCreateParams.kt | 22 +- .../SandboxConnectionAccountUpdateParams.kt | 13 +- .../models/SandboxConnectionCreateParams.kt | 30 +- .../models/SandboxDirectoryCreateParams.kt | 124 +++- .../models/SandboxEmploymentUpdateParams.kt | 90 ++- .../models/SandboxIndividualUpdateParams.kt | 66 +- .../api/models/SandboxJobConfiguration.kt | 11 +- .../SandboxJobConfigurationRetrieveParams.kt | 6 +- .../SandboxJobConfigurationUpdateParams.kt | 8 +- .../api/models/SandboxJobCreateParams.kt | 15 +- .../api/models/SandboxPaymentCreateParams.kt | 113 +++- .../tryfinch/api/models/SessionNewResponse.kt | 7 +- .../models/SessionReauthenticateResponse.kt | 7 +- .../api/models/SupportPerBenefitType.kt | 11 +- .../tryfinch/api/models/SupportedBenefit.kt | 31 +- .../UnenrolledIndividualBenefitResponse.kt | 6 +- .../models/UpdateCompanyBenefitResponse.kt | 7 +- .../kotlin/com/tryfinch/api/models/W42005.kt | 35 +- .../kotlin/com/tryfinch/api/models/W42020.kt | 39 +- .../com/tryfinch/api/models/WebhookEvent.kt | 22 +- 155 files changed, 3379 insertions(+), 1270 deletions(-) diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/core/Timeout.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/core/Timeout.kt index eb2f4b953..d3d7c785f 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/core/Timeout.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/core/Timeout.kt @@ -157,10 +157,14 @@ private constructor( return true } - return /* spotless:off */ other is Timeout && connect == other.connect && read == other.read && write == other.write && request == other.request /* spotless:on */ + return other is Timeout && + connect == other.connect && + read == other.read && + write == other.write && + request == other.request } - override fun hashCode(): Int = /* spotless:off */ Objects.hash(connect, read, write, request) /* spotless:on */ + override fun hashCode(): Int = Objects.hash(connect, read, write, request) override fun toString() = "Timeout{connect=$connect, read=$read, write=$write, request=$request}" 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 05e112847..2d1e6f326 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 @@ -567,12 +567,17 @@ private constructor( return true } - return /* spotless:off */ other is Body && code == other.code && clientId == other.clientId && clientSecret == other.clientSecret && redirectUri == other.redirectUri && additionalProperties == other.additionalProperties /* spotless:on */ + return other is Body && + code == other.code && + clientId == other.clientId && + clientSecret == other.clientSecret && + redirectUri == other.redirectUri && + additionalProperties == other.additionalProperties } - /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(code, clientId, clientSecret, redirectUri, additionalProperties) } - /* spotless:on */ + private val hashCode: Int by lazy { + Objects.hash(code, clientId, clientSecret, redirectUri, additionalProperties) + } override fun hashCode(): Int = hashCode @@ -585,10 +590,13 @@ private constructor( return true } - return /* spotless:off */ other is AccessTokenCreateParams && body == other.body && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams /* spotless:on */ + return other is AccessTokenCreateParams && + body == other.body && + additionalHeaders == other.additionalHeaders && + additionalQueryParams == other.additionalQueryParams } - override fun hashCode(): Int = /* spotless:off */ Objects.hash(body, additionalHeaders, additionalQueryParams) /* spotless:on */ + override fun hashCode(): Int = Objects.hash(body, additionalHeaders, additionalQueryParams) override fun toString() = "AccessTokenCreateParams{body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" 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 e54605fa1..053aae245 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 @@ -556,7 +556,7 @@ private constructor( return true } - return /* spotless:off */ other is AuthenticationType && value == other.value /* spotless:on */ + return other is AuthenticationType && value == other.value } override fun hashCode() = value.hashCode() @@ -569,12 +569,29 @@ private constructor( return true } - return /* spotless:off */ other is AccountCreateResponse && accessToken == other.accessToken && accountId == other.accountId && authenticationType == other.authenticationType && companyId == other.companyId && connectionId == other.connectionId && products == other.products && providerId == other.providerId && additionalProperties == other.additionalProperties /* spotless:on */ + return other is AccountCreateResponse && + accessToken == other.accessToken && + accountId == other.accountId && + authenticationType == other.authenticationType && + companyId == other.companyId && + connectionId == other.connectionId && + products == other.products && + providerId == other.providerId && + additionalProperties == other.additionalProperties } - /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(accessToken, accountId, authenticationType, companyId, connectionId, products, providerId, additionalProperties) } - /* spotless:on */ + private val hashCode: Int by lazy { + Objects.hash( + accessToken, + accountId, + authenticationType, + companyId, + connectionId, + products, + providerId, + additionalProperties, + ) + } override fun hashCode(): Int = hashCode 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 72e823e6e..9b5add8a8 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 @@ -197,10 +197,14 @@ private constructor( return true } - return /* spotless:off */ other is AccountDisconnectParams && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams && additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ + return other is AccountDisconnectParams && + additionalHeaders == other.additionalHeaders && + additionalQueryParams == other.additionalQueryParams && + additionalBodyProperties == other.additionalBodyProperties } - override fun hashCode(): Int = /* spotless:off */ Objects.hash(additionalHeaders, additionalQueryParams, additionalBodyProperties) /* spotless:on */ + override fun hashCode(): Int = + Objects.hash(additionalHeaders, additionalQueryParams, additionalBodyProperties) override fun toString() = "AccountDisconnectParams{additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams, additionalBodyProperties=$additionalBodyProperties}" 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 c79e58628..6a07fb42c 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 @@ -158,10 +158,12 @@ private constructor( return true } - return /* spotless:off */ other is AccountIntrospectParams && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams /* spotless:on */ + return other is AccountIntrospectParams && + additionalHeaders == other.additionalHeaders && + additionalQueryParams == other.additionalQueryParams } - override fun hashCode(): Int = /* spotless:off */ Objects.hash(additionalHeaders, additionalQueryParams) /* spotless:on */ + override fun hashCode(): Int = Objects.hash(additionalHeaders, additionalQueryParams) override fun toString() = "AccountIntrospectParams{additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" 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 e6305b425..cb5a9c86b 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 @@ -1894,13 +1894,26 @@ private constructor( return true } - return /* spotless:off */ other is Accounts && accountName == other.accountName && accountNumber == other.accountNumber && accountType == other.accountType && institutionName == other.institutionName && routingNumber == other.routingNumber && additionalProperties == other.additionalProperties /* spotless:on */ + return other is Accounts && + accountName == other.accountName && + accountNumber == other.accountNumber && + accountType == other.accountType && + institutionName == other.institutionName && + routingNumber == other.routingNumber && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash( + accountName, + accountNumber, + accountType, + institutionName, + routingNumber, + additionalProperties, + ) } - /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(accountName, accountNumber, accountType, institutionName, routingNumber, additionalProperties) } - /* spotless:on */ - override fun hashCode(): Int = hashCode override fun toString() = @@ -2217,12 +2230,14 @@ private constructor( return true } - return /* spotless:off */ other is Parent && name == other.name && additionalProperties == other.additionalProperties /* spotless:on */ + return other is Parent && + name == other.name && + additionalProperties == other.additionalProperties } - /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(name, additionalProperties) } - /* spotless:on */ + private val hashCode: Int by lazy { + Objects.hash(name, additionalProperties) + } override fun hashCode(): Int = hashCode @@ -2235,12 +2250,15 @@ private constructor( return true } - return /* spotless:off */ other is Departments && name == other.name && parent == other.parent && additionalProperties == other.additionalProperties /* spotless:on */ + return other is Departments && + name == other.name && + parent == other.parent && + additionalProperties == other.additionalProperties } - /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(name, parent, additionalProperties) } - /* spotless:on */ + private val hashCode: Int by lazy { + Objects.hash(name, parent, additionalProperties) + } override fun hashCode(): Int = hashCode @@ -2422,12 +2440,15 @@ private constructor( return true } - return /* spotless:off */ other is Entity && subtype == other.subtype && type == other.type && additionalProperties == other.additionalProperties /* spotless:on */ + return other is Entity && + subtype == other.subtype && + type == other.type && + additionalProperties == other.additionalProperties } - /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(subtype, type, additionalProperties) } - /* spotless:on */ + private val hashCode: Int by lazy { + Objects.hash(subtype, type, additionalProperties) + } override fun hashCode(): Int = hashCode @@ -2761,13 +2782,28 @@ private constructor( return true } - return /* spotless:off */ other is Locations && city == other.city && country == other.country && line1 == other.line1 && line2 == other.line2 && postalCode == other.postalCode && state == other.state && additionalProperties == other.additionalProperties /* spotless:on */ + return other is Locations && + city == other.city && + country == other.country && + line1 == other.line1 && + line2 == other.line2 && + postalCode == other.postalCode && + state == other.state && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash( + city, + country, + line1, + line2, + postalCode, + state, + additionalProperties, + ) } - /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(city, country, line1, line2, postalCode, state, additionalProperties) } - /* spotless:on */ - override fun hashCode(): Int = hashCode override fun toString() = @@ -2779,12 +2815,33 @@ private constructor( return true } - return /* spotless:off */ other is SupportedCompanyFields && id == other.id && accounts == other.accounts && departments == other.departments && ein == other.ein && entity == other.entity && legalName == other.legalName && locations == other.locations && primaryEmail == other.primaryEmail && primaryPhoneNumber == other.primaryPhoneNumber && additionalProperties == other.additionalProperties /* spotless:on */ + return other is SupportedCompanyFields && + id == other.id && + accounts == other.accounts && + departments == other.departments && + ein == other.ein && + entity == other.entity && + legalName == other.legalName && + locations == other.locations && + primaryEmail == other.primaryEmail && + primaryPhoneNumber == other.primaryPhoneNumber && + additionalProperties == other.additionalProperties } - /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(id, accounts, departments, ein, entity, legalName, locations, primaryEmail, primaryPhoneNumber, additionalProperties) } - /* spotless:on */ + private val hashCode: Int by lazy { + Objects.hash( + id, + accounts, + departments, + ein, + entity, + legalName, + locations, + primaryEmail, + primaryPhoneNumber, + additionalProperties, + ) + } override fun hashCode(): Int = hashCode @@ -3486,12 +3543,14 @@ private constructor( return true } - return /* spotless:off */ other is Manager && id == other.id && additionalProperties == other.additionalProperties /* spotless:on */ + return other is Manager && + id == other.id && + additionalProperties == other.additionalProperties } - /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(id, additionalProperties) } - /* spotless:on */ + private val hashCode: Int by lazy { + Objects.hash(id, additionalProperties) + } override fun hashCode(): Int = hashCode @@ -3504,12 +3563,29 @@ private constructor( return true } - return /* spotless:off */ other is Individuals && id == other.id && department == other.department && firstName == other.firstName && isActive == other.isActive && lastName == other.lastName && manager == other.manager && middleName == other.middleName && additionalProperties == other.additionalProperties /* spotless:on */ + return other is Individuals && + id == other.id && + department == other.department && + firstName == other.firstName && + isActive == other.isActive && + lastName == other.lastName && + manager == other.manager && + middleName == other.middleName && + additionalProperties == other.additionalProperties } - /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(id, department, firstName, isActive, lastName, manager, middleName, additionalProperties) } - /* spotless:on */ + private val hashCode: Int by lazy { + Objects.hash( + id, + department, + firstName, + isActive, + lastName, + manager, + middleName, + additionalProperties, + ) + } override fun hashCode(): Int = hashCode @@ -3691,12 +3767,15 @@ private constructor( return true } - return /* spotless:off */ other is Paging && count == other.count && offset == other.offset && additionalProperties == other.additionalProperties /* spotless:on */ + return other is Paging && + count == other.count && + offset == other.offset && + additionalProperties == other.additionalProperties } - /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(count, offset, additionalProperties) } - /* spotless:on */ + private val hashCode: Int by lazy { + Objects.hash(count, offset, additionalProperties) + } override fun hashCode(): Int = hashCode @@ -3709,12 +3788,15 @@ private constructor( return true } - return /* spotless:off */ other is SupportedDirectoryFields && individuals == other.individuals && paging == other.paging && additionalProperties == other.additionalProperties /* spotless:on */ + return other is SupportedDirectoryFields && + individuals == other.individuals && + paging == other.paging && + additionalProperties == other.additionalProperties } - /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(individuals, paging, additionalProperties) } - /* spotless:on */ + private val hashCode: Int by lazy { + Objects.hash(individuals, paging, additionalProperties) + } override fun hashCode(): Int = hashCode @@ -4622,12 +4704,14 @@ private constructor( return true } - return /* spotless:off */ other is Department && name == other.name && additionalProperties == other.additionalProperties /* spotless:on */ + return other is Department && + name == other.name && + additionalProperties == other.additionalProperties } - /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(name, additionalProperties) } - /* spotless:on */ + private val hashCode: Int by lazy { + Objects.hash(name, additionalProperties) + } override fun hashCode(): Int = hashCode @@ -4811,12 +4895,15 @@ private constructor( return true } - return /* spotless:off */ other is Employment && subtype == other.subtype && type == other.type && additionalProperties == other.additionalProperties /* spotless:on */ + return other is Employment && + subtype == other.subtype && + type == other.type && + additionalProperties == other.additionalProperties } - /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(subtype, type, additionalProperties) } - /* spotless:on */ + private val hashCode: Int by lazy { + Objects.hash(subtype, type, additionalProperties) + } override fun hashCode(): Int = hashCode @@ -5033,12 +5120,16 @@ private constructor( return true } - return /* spotless:off */ other is Income && amount == other.amount && currency == other.currency && unit == other.unit && additionalProperties == other.additionalProperties /* spotless:on */ + return other is Income && + amount == other.amount && + currency == other.currency && + unit == other.unit && + additionalProperties == other.additionalProperties } - /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(amount, currency, unit, additionalProperties) } - /* spotless:on */ + private val hashCode: Int by lazy { + Objects.hash(amount, currency, unit, additionalProperties) + } override fun hashCode(): Int = hashCode @@ -5371,13 +5462,28 @@ private constructor( return true } - return /* spotless:off */ other is Location && city == other.city && country == other.country && line1 == other.line1 && line2 == other.line2 && postalCode == other.postalCode && state == other.state && additionalProperties == other.additionalProperties /* spotless:on */ + return other is Location && + city == other.city && + country == other.country && + line1 == other.line1 && + line2 == other.line2 && + postalCode == other.postalCode && + state == other.state && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash( + city, + country, + line1, + line2, + postalCode, + state, + additionalProperties, + ) } - /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(city, country, line1, line2, postalCode, state, additionalProperties) } - /* spotless:on */ - override fun hashCode(): Int = hashCode override fun toString() = @@ -5519,12 +5625,12 @@ private constructor( return true } - return /* spotless:off */ other is Manager && id == other.id && additionalProperties == other.additionalProperties /* spotless:on */ + return other is Manager && + id == other.id && + additionalProperties == other.additionalProperties } - /* spotless:off */ private val hashCode: Int by lazy { Objects.hash(id, additionalProperties) } - /* spotless:on */ override fun hashCode(): Int = hashCode @@ -5537,12 +5643,49 @@ private constructor( return true } - return /* spotless:off */ other is SupportedEmploymentFields && id == other.id && classCode == other.classCode && customFields == other.customFields && department == other.department && employment == other.employment && employmentStatus == other.employmentStatus && endDate == other.endDate && firstName == other.firstName && income == other.income && incomeHistory == other.incomeHistory && isActive == other.isActive && lastName == other.lastName && location == other.location && manager == other.manager && middleName == other.middleName && startDate == other.startDate && title == other.title && additionalProperties == other.additionalProperties /* spotless:on */ + return other is SupportedEmploymentFields && + id == other.id && + classCode == other.classCode && + customFields == other.customFields && + department == other.department && + employment == other.employment && + employmentStatus == other.employmentStatus && + endDate == other.endDate && + firstName == other.firstName && + income == other.income && + incomeHistory == other.incomeHistory && + isActive == other.isActive && + lastName == other.lastName && + location == other.location && + manager == other.manager && + middleName == other.middleName && + startDate == other.startDate && + title == other.title && + additionalProperties == other.additionalProperties } - /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(id, classCode, customFields, department, employment, employmentStatus, endDate, firstName, income, incomeHistory, isActive, lastName, location, manager, middleName, startDate, title, additionalProperties) } - /* spotless:on */ + private val hashCode: Int by lazy { + Objects.hash( + id, + classCode, + customFields, + department, + employment, + employmentStatus, + endDate, + firstName, + income, + incomeHistory, + isActive, + lastName, + location, + manager, + middleName, + startDate, + title, + additionalProperties, + ) + } override fun hashCode(): Int = hashCode @@ -6322,12 +6465,15 @@ private constructor( return true } - return /* spotless:off */ other is Emails && data == other.data && type == other.type && additionalProperties == other.additionalProperties /* spotless:on */ + return other is Emails && + data == other.data && + type == other.type && + additionalProperties == other.additionalProperties } - /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(data, type, additionalProperties) } - /* spotless:on */ + private val hashCode: Int by lazy { + Objects.hash(data, type, additionalProperties) + } override fun hashCode(): Int = hashCode @@ -6507,12 +6653,15 @@ private constructor( return true } - return /* spotless:off */ other is PhoneNumbers && data == other.data && type == other.type && additionalProperties == other.additionalProperties /* spotless:on */ + return other is PhoneNumbers && + data == other.data && + type == other.type && + additionalProperties == other.additionalProperties } - /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(data, type, additionalProperties) } - /* spotless:on */ + private val hashCode: Int by lazy { + Objects.hash(data, type, additionalProperties) + } override fun hashCode(): Int = hashCode @@ -6846,13 +6995,28 @@ private constructor( return true } - return /* spotless:off */ other is Residence && city == other.city && country == other.country && line1 == other.line1 && line2 == other.line2 && postalCode == other.postalCode && state == other.state && additionalProperties == other.additionalProperties /* spotless:on */ + return other is Residence && + city == other.city && + country == other.country && + line1 == other.line1 && + line2 == other.line2 && + postalCode == other.postalCode && + state == other.state && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash( + city, + country, + line1, + line2, + postalCode, + state, + additionalProperties, + ) } - /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(city, country, line1, line2, postalCode, state, additionalProperties) } - /* spotless:on */ - override fun hashCode(): Int = hashCode override fun toString() = @@ -6864,12 +7028,41 @@ private constructor( return true } - return /* spotless:off */ other is SupportedIndividualFields && id == other.id && dob == other.dob && emails == other.emails && encryptedSsn == other.encryptedSsn && ethnicity == other.ethnicity && firstName == other.firstName && gender == other.gender && lastName == other.lastName && middleName == other.middleName && phoneNumbers == other.phoneNumbers && preferredName == other.preferredName && residence == other.residence && ssn == other.ssn && additionalProperties == other.additionalProperties /* spotless:on */ + return other is SupportedIndividualFields && + id == other.id && + dob == other.dob && + emails == other.emails && + encryptedSsn == other.encryptedSsn && + ethnicity == other.ethnicity && + firstName == other.firstName && + gender == other.gender && + lastName == other.lastName && + middleName == other.middleName && + phoneNumbers == other.phoneNumbers && + preferredName == other.preferredName && + residence == other.residence && + ssn == other.ssn && + additionalProperties == other.additionalProperties } - /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(id, dob, emails, encryptedSsn, ethnicity, firstName, gender, lastName, middleName, phoneNumbers, preferredName, residence, ssn, additionalProperties) } - /* spotless:on */ + private val hashCode: Int by lazy { + Objects.hash( + id, + dob, + emails, + encryptedSsn, + ethnicity, + firstName, + gender, + lastName, + middleName, + phoneNumbers, + preferredName, + residence, + ssn, + additionalProperties, + ) + } override fun hashCode(): Int = hashCode @@ -7133,12 +7326,17 @@ private constructor( return true } - return /* spotless:off */ other is SupportedPayGroupFields && id == other.id && individualIds == other.individualIds && name == other.name && payFrequencies == other.payFrequencies && additionalProperties == other.additionalProperties /* spotless:on */ + return other is SupportedPayGroupFields && + id == other.id && + individualIds == other.individualIds && + name == other.name && + payFrequencies == other.payFrequencies && + additionalProperties == other.additionalProperties } - /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(id, individualIds, name, payFrequencies, additionalProperties) } - /* spotless:on */ + private val hashCode: Int by lazy { + Objects.hash(id, individualIds, name, payFrequencies, additionalProperties) + } override fun hashCode(): Int = hashCode @@ -7520,12 +7718,15 @@ private constructor( return true } - return /* spotless:off */ other is Paging && count == other.count && offset == other.offset && additionalProperties == other.additionalProperties /* spotless:on */ + return other is Paging && + count == other.count && + offset == other.offset && + additionalProperties == other.additionalProperties } - /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(count, offset, additionalProperties) } - /* spotless:on */ + private val hashCode: Int by lazy { + Objects.hash(count, offset, additionalProperties) + } override fun hashCode(): Int = hashCode @@ -8294,12 +8495,17 @@ private constructor( return true } - return /* spotless:off */ other is Earnings && amount == other.amount && currency == other.currency && name == other.name && type == other.type && additionalProperties == other.additionalProperties /* spotless:on */ + return other is Earnings && + amount == other.amount && + currency == other.currency && + name == other.name && + type == other.type && + additionalProperties == other.additionalProperties } - /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(amount, currency, name, type, additionalProperties) } - /* spotless:on */ + private val hashCode: Int by lazy { + Objects.hash(amount, currency, name, type, additionalProperties) + } override fun hashCode(): Int = hashCode @@ -8602,13 +8808,26 @@ private constructor( return true } - return /* spotless:off */ other is EmployeeDeductions && amount == other.amount && currency == other.currency && name == other.name && preTax == other.preTax && type == other.type && additionalProperties == other.additionalProperties /* spotless:on */ + return other is EmployeeDeductions && + amount == other.amount && + currency == other.currency && + name == other.name && + preTax == other.preTax && + type == other.type && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash( + amount, + currency, + name, + preTax, + type, + additionalProperties, + ) } - /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(amount, currency, name, preTax, type, additionalProperties) } - /* spotless:on */ - override fun hashCode(): Int = hashCode override fun toString() = @@ -8838,12 +9057,16 @@ private constructor( return true } - return /* spotless:off */ other is EmployerContributions && amount == other.amount && currency == other.currency && name == other.name && additionalProperties == other.additionalProperties /* spotless:on */ + return other is EmployerContributions && + amount == other.amount && + currency == other.currency && + name == other.name && + additionalProperties == other.additionalProperties } - /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(amount, currency, name, additionalProperties) } - /* spotless:on */ + private val hashCode: Int by lazy { + Objects.hash(amount, currency, name, additionalProperties) + } override fun hashCode(): Int = hashCode @@ -9145,13 +9368,26 @@ private constructor( return true } - return /* spotless:off */ other is Taxes && amount == other.amount && currency == other.currency && employer == other.employer && name == other.name && type == other.type && additionalProperties == other.additionalProperties /* spotless:on */ + return other is Taxes && + amount == other.amount && + currency == other.currency && + employer == other.employer && + name == other.name && + type == other.type && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash( + amount, + currency, + employer, + name, + type, + additionalProperties, + ) } - /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(amount, currency, employer, name, type, additionalProperties) } - /* spotless:on */ - override fun hashCode(): Int = hashCode override fun toString() = @@ -9163,13 +9399,36 @@ private constructor( return true } - return /* spotless:off */ other is PayStatements && earnings == other.earnings && employeeDeductions == other.employeeDeductions && employerContributions == other.employerContributions && grossPay == other.grossPay && individualId == other.individualId && netPay == other.netPay && paymentMethod == other.paymentMethod && taxes == other.taxes && totalHours == other.totalHours && type == other.type && additionalProperties == other.additionalProperties /* spotless:on */ + return other is PayStatements && + earnings == other.earnings && + employeeDeductions == other.employeeDeductions && + employerContributions == other.employerContributions && + grossPay == other.grossPay && + individualId == other.individualId && + netPay == other.netPay && + paymentMethod == other.paymentMethod && + taxes == other.taxes && + totalHours == other.totalHours && + type == other.type && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash( + earnings, + employeeDeductions, + employerContributions, + grossPay, + individualId, + netPay, + paymentMethod, + taxes, + totalHours, + type, + additionalProperties, + ) } - /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(earnings, employeeDeductions, employerContributions, grossPay, individualId, netPay, paymentMethod, taxes, totalHours, type, additionalProperties) } - /* spotless:on */ - override fun hashCode(): Int = hashCode override fun toString() = @@ -9181,12 +9440,15 @@ private constructor( return true } - return /* spotless:off */ other is SupportedPayStatementFields && paging == other.paging && payStatements == other.payStatements && additionalProperties == other.additionalProperties /* spotless:on */ + return other is SupportedPayStatementFields && + paging == other.paging && + payStatements == other.payStatements && + additionalProperties == other.additionalProperties } - /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(paging, payStatements, additionalProperties) } - /* spotless:on */ + private val hashCode: Int by lazy { + Objects.hash(paging, payStatements, additionalProperties) + } override fun hashCode(): Int = hashCode @@ -9948,12 +10210,15 @@ private constructor( return true } - return /* spotless:off */ other is PayPeriod && endDate == other.endDate && startDate == other.startDate && additionalProperties == other.additionalProperties /* spotless:on */ + return other is PayPeriod && + endDate == other.endDate && + startDate == other.startDate && + additionalProperties == other.additionalProperties } - /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(endDate, startDate, additionalProperties) } - /* spotless:on */ + private val hashCode: Int by lazy { + Objects.hash(endDate, startDate, additionalProperties) + } override fun hashCode(): Int = hashCode @@ -9966,12 +10231,39 @@ private constructor( return true } - return /* spotless:off */ other is SupportedPaymentFields && id == other.id && companyDebit == other.companyDebit && debitDate == other.debitDate && employeeTaxes == other.employeeTaxes && employerTaxes == other.employerTaxes && grossPay == other.grossPay && individualIds == other.individualIds && netPay == other.netPay && payDate == other.payDate && payFrequencies == other.payFrequencies && payGroupIds == other.payGroupIds && payPeriod == other.payPeriod && additionalProperties == other.additionalProperties /* spotless:on */ + return other is SupportedPaymentFields && + id == other.id && + companyDebit == other.companyDebit && + debitDate == other.debitDate && + employeeTaxes == other.employeeTaxes && + employerTaxes == other.employerTaxes && + grossPay == other.grossPay && + individualIds == other.individualIds && + netPay == other.netPay && + payDate == other.payDate && + payFrequencies == other.payFrequencies && + payGroupIds == other.payGroupIds && + payPeriod == other.payPeriod && + additionalProperties == other.additionalProperties } - /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(id, companyDebit, debitDate, employeeTaxes, employerTaxes, grossPay, individualIds, netPay, payDate, payFrequencies, payGroupIds, payPeriod, additionalProperties) } - /* spotless:on */ + private val hashCode: Int by lazy { + Objects.hash( + id, + companyDebit, + debitDate, + employeeTaxes, + employerTaxes, + grossPay, + individualIds, + netPay, + payDate, + payFrequencies, + payGroupIds, + payPeriod, + additionalProperties, + ) + } override fun hashCode(): Int = hashCode @@ -9984,12 +10276,29 @@ private constructor( return true } - return /* spotless:off */ other is SupportedFields && company == other.company && directory == other.directory && employment == other.employment && individual == other.individual && payGroup == other.payGroup && payStatement == other.payStatement && payment == other.payment && additionalProperties == other.additionalProperties /* spotless:on */ + return other is SupportedFields && + company == other.company && + directory == other.directory && + employment == other.employment && + individual == other.individual && + payGroup == other.payGroup && + payStatement == other.payStatement && + payment == other.payment && + additionalProperties == other.additionalProperties } - /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(company, directory, employment, individual, payGroup, payStatement, payment, additionalProperties) } - /* spotless:on */ + private val hashCode: Int by lazy { + Objects.hash( + company, + directory, + employment, + individual, + payGroup, + payStatement, + payment, + additionalProperties, + ) + } override fun hashCode(): Int = hashCode @@ -10138,7 +10447,7 @@ private constructor( return true } - return /* spotless:off */ other is Type && value == other.value /* spotless:on */ + return other is Type && value == other.value } override fun hashCode() = value.hashCode() @@ -10151,12 +10460,16 @@ private constructor( return true } - return /* spotless:off */ other is AuthenticationMethod && benefitsSupport == other.benefitsSupport && supportedFields == other.supportedFields && type == other.type && additionalProperties == other.additionalProperties /* spotless:on */ + return other is AuthenticationMethod && + benefitsSupport == other.benefitsSupport && + supportedFields == other.supportedFields && + type == other.type && + additionalProperties == other.additionalProperties } - /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(benefitsSupport, supportedFields, type, additionalProperties) } - /* spotless:on */ + private val hashCode: Int by lazy { + Objects.hash(benefitsSupport, supportedFields, type, additionalProperties) + } override fun hashCode(): Int = hashCode @@ -10169,12 +10482,15 @@ private constructor( return true } - return /* spotless:off */ other is Data && authenticationMethod == other.authenticationMethod && status == other.status && additionalProperties == other.additionalProperties /* spotless:on */ + return other is Data && + authenticationMethod == other.authenticationMethod && + status == other.status && + additionalProperties == other.additionalProperties } - /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(authenticationMethod, status, additionalProperties) } - /* spotless:on */ + private val hashCode: Int by lazy { + Objects.hash(authenticationMethod, status, additionalProperties) + } override fun hashCode(): Int = hashCode @@ -10294,7 +10610,7 @@ private constructor( return true } - return /* spotless:off */ other is EventType && value == other.value /* spotless:on */ + return other is EventType && value == other.value } override fun hashCode() = value.hashCode() @@ -10307,12 +10623,18 @@ private constructor( return true } - return /* spotless:off */ other is AccountUpdateEvent && accountId == other.accountId && companyId == other.companyId && connectionId == other.connectionId && data == other.data && eventType == other.eventType && additionalProperties == other.additionalProperties /* spotless:on */ + return other is AccountUpdateEvent && + accountId == other.accountId && + companyId == other.companyId && + connectionId == other.connectionId && + data == other.data && + eventType == other.eventType && + additionalProperties == other.additionalProperties } - /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(accountId, companyId, connectionId, data, eventType, additionalProperties) } - /* spotless:on */ + private val hashCode: Int by lazy { + Objects.hash(accountId, companyId, connectionId, data, eventType, additionalProperties) + } override fun hashCode(): Int = hashCode 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 cbbb1e2d2..1a6dadca5 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 @@ -517,7 +517,7 @@ private constructor( return true } - return /* spotless:off */ other is AuthenticationType && value == other.value /* spotless:on */ + return other is AuthenticationType && value == other.value } override fun hashCode() = value.hashCode() @@ -530,12 +530,27 @@ private constructor( return true } - return /* spotless:off */ other is AccountUpdateResponse && accountId == other.accountId && authenticationType == other.authenticationType && companyId == other.companyId && products == other.products && providerId == other.providerId && connectionId == other.connectionId && additionalProperties == other.additionalProperties /* spotless:on */ + return other is AccountUpdateResponse && + accountId == other.accountId && + authenticationType == other.authenticationType && + companyId == other.companyId && + products == other.products && + providerId == other.providerId && + connectionId == other.connectionId && + additionalProperties == other.additionalProperties } - /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(accountId, authenticationType, companyId, products, providerId, connectionId, additionalProperties) } - /* spotless:on */ + private val hashCode: Int by lazy { + Objects.hash( + accountId, + authenticationType, + companyId, + products, + providerId, + connectionId, + additionalProperties, + ) + } override fun hashCode(): Int = hashCode 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 3230e4fa6..00b3d3a85 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 @@ -633,12 +633,12 @@ private constructor( return true } - return /* spotless:off */ other is Params && individualId == other.individualId && additionalProperties == other.additionalProperties /* spotless:on */ + return other is Params && + individualId == other.individualId && + additionalProperties == other.additionalProperties } - /* spotless:off */ private val hashCode: Int by lazy { Objects.hash(individualId, additionalProperties) } - /* spotless:on */ override fun hashCode(): Int = hashCode @@ -786,7 +786,7 @@ private constructor( return true } - return /* spotless:off */ other is Status && value == other.value /* spotless:on */ + return other is Status && value == other.value } override fun hashCode() = value.hashCode() @@ -911,7 +911,7 @@ private constructor( return true } - return /* spotless:off */ other is Type && value == other.value /* spotless:on */ + return other is Type && value == other.value } override fun hashCode() = value.hashCode() @@ -924,12 +924,33 @@ private constructor( return true } - return /* spotless:off */ other is AutomatedAsyncJob && completedAt == other.completedAt && createdAt == other.createdAt && jobId == other.jobId && jobUrl == other.jobUrl && params == other.params && scheduledAt == other.scheduledAt && startedAt == other.startedAt && status == other.status && type == other.type && additionalProperties == other.additionalProperties /* spotless:on */ + return other is AutomatedAsyncJob && + completedAt == other.completedAt && + createdAt == other.createdAt && + jobId == other.jobId && + jobUrl == other.jobUrl && + params == other.params && + scheduledAt == other.scheduledAt && + startedAt == other.startedAt && + status == other.status && + type == other.type && + additionalProperties == other.additionalProperties } - /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(completedAt, createdAt, jobId, jobUrl, params, scheduledAt, startedAt, status, type, additionalProperties) } - /* spotless:on */ + private val hashCode: Int by lazy { + Objects.hash( + completedAt, + createdAt, + jobId, + jobUrl, + params, + scheduledAt, + startedAt, + status, + type, + additionalProperties, + ) + } override fun hashCode(): Int = hashCode diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AutomatedCreateResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AutomatedCreateResponse.kt index a4273f990..4d246ec39 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AutomatedCreateResponse.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AutomatedCreateResponse.kt @@ -313,12 +313,25 @@ private constructor( return true } - return /* spotless:off */ other is AutomatedCreateResponse && allowedRefreshes == other.allowedRefreshes && remainingRefreshes == other.remainingRefreshes && jobId == other.jobId && jobUrl == other.jobUrl && retryAt == other.retryAt && additionalProperties == other.additionalProperties /* spotless:on */ + return other is AutomatedCreateResponse && + allowedRefreshes == other.allowedRefreshes && + remainingRefreshes == other.remainingRefreshes && + jobId == other.jobId && + jobUrl == other.jobUrl && + retryAt == other.retryAt && + additionalProperties == other.additionalProperties } - /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(allowedRefreshes, remainingRefreshes, jobId, jobUrl, retryAt, additionalProperties) } - /* spotless:on */ + private val hashCode: Int by lazy { + Objects.hash( + allowedRefreshes, + remainingRefreshes, + jobId, + jobUrl, + retryAt, + additionalProperties, + ) + } override fun hashCode(): Int = hashCode diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AutomatedListResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AutomatedListResponse.kt index d93686fc6..512ce448a 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AutomatedListResponse.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/AutomatedListResponse.kt @@ -650,12 +650,15 @@ private constructor( return true } - return /* spotless:off */ other is DataSyncAll && allowedRefreshes == other.allowedRefreshes && remainingRefreshes == other.remainingRefreshes && additionalProperties == other.additionalProperties /* spotless:on */ + return other is DataSyncAll && + allowedRefreshes == other.allowedRefreshes && + remainingRefreshes == other.remainingRefreshes && + additionalProperties == other.additionalProperties } - /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(allowedRefreshes, remainingRefreshes, additionalProperties) } - /* spotless:on */ + private val hashCode: Int by lazy { + Objects.hash(allowedRefreshes, remainingRefreshes, additionalProperties) + } override fun hashCode(): Int = hashCode @@ -668,12 +671,12 @@ private constructor( return true } - return /* spotless:off */ other is Quotas && dataSyncAll == other.dataSyncAll && additionalProperties == other.additionalProperties /* spotless:on */ + return other is Quotas && + dataSyncAll == other.dataSyncAll && + additionalProperties == other.additionalProperties } - /* spotless:off */ private val hashCode: Int by lazy { Objects.hash(dataSyncAll, additionalProperties) } - /* spotless:on */ override fun hashCode(): Int = hashCode @@ -686,12 +689,12 @@ private constructor( return true } - return /* spotless:off */ other is Meta && quotas == other.quotas && additionalProperties == other.additionalProperties /* spotless:on */ + return other is Meta && + quotas == other.quotas && + additionalProperties == other.additionalProperties } - /* spotless:off */ private val hashCode: Int by lazy { Objects.hash(quotas, additionalProperties) } - /* spotless:on */ override fun hashCode(): Int = hashCode @@ -703,12 +706,13 @@ private constructor( return true } - return /* spotless:off */ other is AutomatedListResponse && data == other.data && meta == other.meta && additionalProperties == other.additionalProperties /* spotless:on */ + return other is AutomatedListResponse && + data == other.data && + meta == other.meta && + additionalProperties == other.additionalProperties } - /* spotless:off */ private val hashCode: Int by lazy { Objects.hash(data, meta, additionalProperties) } - /* spotless:on */ override fun hashCode(): Int = hashCode diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/BaseWebhookEvent.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/BaseWebhookEvent.kt index 509f3391e..5b8d2c6d1 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/BaseWebhookEvent.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/BaseWebhookEvent.kt @@ -256,12 +256,16 @@ private constructor( return true } - return /* spotless:off */ other is BaseWebhookEvent && accountId == other.accountId && companyId == other.companyId && connectionId == other.connectionId && additionalProperties == other.additionalProperties /* spotless:on */ + return other is BaseWebhookEvent && + accountId == other.accountId && + companyId == other.companyId && + connectionId == other.connectionId && + additionalProperties == other.additionalProperties } - /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(accountId, companyId, connectionId, additionalProperties) } - /* spotless:on */ + private val hashCode: Int by lazy { + Objects.hash(accountId, companyId, connectionId, additionalProperties) + } override fun hashCode(): Int = hashCode 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 9d1e4808e..17245a560 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 @@ -322,7 +322,7 @@ private constructor( return true } - return /* spotless:off */ other is Type && value == other.value /* spotless:on */ + return other is Type && value == other.value } override fun hashCode() = value.hashCode() @@ -335,12 +335,13 @@ private constructor( return true } - return /* spotless:off */ other is BenefitContribution && amount == other.amount && type == other.type && additionalProperties == other.additionalProperties /* spotless:on */ + return other is BenefitContribution && + amount == other.amount && + type == other.type && + additionalProperties == other.additionalProperties } - /* spotless:off */ private val hashCode: Int by lazy { Objects.hash(amount, type, additionalProperties) } - /* spotless:on */ override fun hashCode(): Int = hashCode 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 b7429b6f7..8eca97227 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 @@ -196,12 +196,15 @@ private constructor( return true } - return /* spotless:off */ other is BenefitFeaturesAndOperations && supportedFeatures == other.supportedFeatures && supportedOperations == other.supportedOperations && additionalProperties == other.additionalProperties /* spotless:on */ + return other is BenefitFeaturesAndOperations && + supportedFeatures == other.supportedFeatures && + supportedOperations == other.supportedOperations && + additionalProperties == other.additionalProperties } - /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(supportedFeatures, supportedOperations, additionalProperties) } - /* spotless:on */ + private val hashCode: Int by lazy { + Objects.hash(supportedFeatures, supportedOperations, additionalProperties) + } override fun hashCode(): Int = hashCode 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 fcb26d329..e6bdb44f8 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 @@ -131,7 +131,7 @@ class BenefitFrequency @JsonCreator private constructor(private val value: JsonF return true } - return /* spotless:off */ other is BenefitFrequency && value == other.value /* spotless:on */ + return other is BenefitFrequency && value == other.value } override fun hashCode() = value.hashCode() 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 b85263457..e7edd4239 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 @@ -224,7 +224,7 @@ class BenefitType @JsonCreator private constructor(private val value: JsonField< return true } - return /* spotless:off */ other is BenefitType && value == other.value /* spotless:on */ + return other is BenefitType && value == other.value } override fun hashCode() = value.hashCode() diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/BenefitsSupport.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/BenefitsSupport.kt index b0b0c886e..bd48977c1 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/BenefitsSupport.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/BenefitsSupport.kt @@ -631,12 +631,39 @@ private constructor( return true } - return /* spotless:off */ other is BenefitsSupport && commuter == other.commuter && customPostTax == other.customPostTax && customPreTax == other.customPreTax && fsaDependentCare == other.fsaDependentCare && fsaMedical == other.fsaMedical && hsaPost == other.hsaPost && hsaPre == other.hsaPre && s125Dental == other.s125Dental && s125Medical == other.s125Medical && s125Vision == other.s125Vision && simple == other.simple && simpleIra == other.simpleIra && additionalProperties == other.additionalProperties /* spotless:on */ + return other is BenefitsSupport && + commuter == other.commuter && + customPostTax == other.customPostTax && + customPreTax == other.customPreTax && + fsaDependentCare == other.fsaDependentCare && + fsaMedical == other.fsaMedical && + hsaPost == other.hsaPost && + hsaPre == other.hsaPre && + s125Dental == other.s125Dental && + s125Medical == other.s125Medical && + s125Vision == other.s125Vision && + simple == other.simple && + simpleIra == other.simpleIra && + additionalProperties == other.additionalProperties } - /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(commuter, customPostTax, customPreTax, fsaDependentCare, fsaMedical, hsaPost, hsaPre, s125Dental, s125Medical, s125Vision, simple, simpleIra, additionalProperties) } - /* spotless:on */ + private val hashCode: Int by lazy { + Objects.hash( + commuter, + customPostTax, + customPreTax, + fsaDependentCare, + fsaMedical, + hsaPost, + hsaPre, + s125Dental, + s125Medical, + s125Vision, + simple, + simpleIra, + additionalProperties, + ) + } override fun hashCode(): Int = hashCode 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 647a3af39..e045475f9 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 @@ -1030,7 +1030,7 @@ private constructor( return true } - return /* spotless:off */ other is AccountType && value == other.value /* spotless:on */ + return other is AccountType && value == other.value } override fun hashCode() = value.hashCode() @@ -1043,12 +1043,25 @@ private constructor( return true } - return /* spotless:off */ other is Account && accountName == other.accountName && accountNumber == other.accountNumber && accountType == other.accountType && institutionName == other.institutionName && routingNumber == other.routingNumber && additionalProperties == other.additionalProperties /* spotless:on */ + return other is Account && + accountName == other.accountName && + accountNumber == other.accountNumber && + accountType == other.accountType && + institutionName == other.institutionName && + routingNumber == other.routingNumber && + additionalProperties == other.additionalProperties } - /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(accountName, accountNumber, accountType, institutionName, routingNumber, additionalProperties) } - /* spotless:on */ + private val hashCode: Int by lazy { + Objects.hash( + accountName, + accountNumber, + accountType, + institutionName, + routingNumber, + additionalProperties, + ) + } override fun hashCode(): Int = hashCode @@ -1389,12 +1402,12 @@ private constructor( return true } - return /* spotless:off */ other is Parent && name == other.name && additionalProperties == other.additionalProperties /* spotless:on */ + return other is Parent && + name == other.name && + additionalProperties == other.additionalProperties } - /* spotless:off */ private val hashCode: Int by lazy { Objects.hash(name, additionalProperties) } - /* spotless:on */ override fun hashCode(): Int = hashCode @@ -1407,12 +1420,13 @@ private constructor( return true } - return /* spotless:off */ other is Department && name == other.name && parent == other.parent && additionalProperties == other.additionalProperties /* spotless:on */ + return other is Department && + name == other.name && + parent == other.parent && + additionalProperties == other.additionalProperties } - /* spotless:off */ private val hashCode: Int by lazy { Objects.hash(name, parent, additionalProperties) } - /* spotless:on */ override fun hashCode(): Int = hashCode @@ -1734,7 +1748,7 @@ private constructor( return true } - return /* spotless:off */ other is Subtype && value == other.value /* spotless:on */ + return other is Subtype && value == other.value } override fun hashCode() = value.hashCode() @@ -1892,7 +1906,7 @@ private constructor( return true } - return /* spotless:off */ other is Type && value == other.value /* spotless:on */ + return other is Type && value == other.value } override fun hashCode() = value.hashCode() @@ -1905,12 +1919,13 @@ private constructor( return true } - return /* spotless:off */ other is Entity && subtype == other.subtype && type == other.type && additionalProperties == other.additionalProperties /* spotless:on */ + return other is Entity && + subtype == other.subtype && + type == other.type && + additionalProperties == other.additionalProperties } - /* spotless:off */ private val hashCode: Int by lazy { Objects.hash(subtype, type, additionalProperties) } - /* spotless:on */ override fun hashCode(): Int = hashCode @@ -1923,12 +1938,33 @@ private constructor( return true } - return /* spotless:off */ other is Company && id == other.id && accounts == other.accounts && departments == other.departments && ein == other.ein && entity == other.entity && legalName == other.legalName && locations == other.locations && primaryEmail == other.primaryEmail && primaryPhoneNumber == other.primaryPhoneNumber && additionalProperties == other.additionalProperties /* spotless:on */ + return other is Company && + id == other.id && + accounts == other.accounts && + departments == other.departments && + ein == other.ein && + entity == other.entity && + legalName == other.legalName && + locations == other.locations && + primaryEmail == other.primaryEmail && + primaryPhoneNumber == other.primaryPhoneNumber && + additionalProperties == other.additionalProperties } - /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(id, accounts, departments, ein, entity, legalName, locations, primaryEmail, primaryPhoneNumber, additionalProperties) } - /* spotless:on */ + private val hashCode: Int by lazy { + Objects.hash( + id, + accounts, + departments, + ein, + entity, + legalName, + locations, + primaryEmail, + primaryPhoneNumber, + additionalProperties, + ) + } override fun hashCode(): Int = hashCode diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/CompanyBenefit.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/CompanyBenefit.kt index d9abb7557..34a008e90 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/CompanyBenefit.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/CompanyBenefit.kt @@ -707,12 +707,15 @@ private constructor( return true } - return /* spotless:off */ other is Tier && match == other.match && threshold == other.threshold && additionalProperties == other.additionalProperties /* spotless:on */ + return other is Tier && + match == other.match && + threshold == other.threshold && + additionalProperties == other.additionalProperties } - /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(match, threshold, additionalProperties) } - /* spotless:on */ + private val hashCode: Int by lazy { + Objects.hash(match, threshold, additionalProperties) + } override fun hashCode(): Int = hashCode @@ -833,7 +836,7 @@ private constructor( return true } - return /* spotless:off */ other is Type && value == other.value /* spotless:on */ + return other is Type && value == other.value } override fun hashCode() = value.hashCode() @@ -846,12 +849,13 @@ private constructor( return true } - return /* spotless:off */ other is BenefitCompanyMatchContribution && tiers == other.tiers && type == other.type && additionalProperties == other.additionalProperties /* spotless:on */ + return other is BenefitCompanyMatchContribution && + tiers == other.tiers && + type == other.type && + additionalProperties == other.additionalProperties } - /* spotless:off */ private val hashCode: Int by lazy { Objects.hash(tiers, type, additionalProperties) } - /* spotless:on */ override fun hashCode(): Int = hashCode @@ -864,12 +868,25 @@ private constructor( return true } - return /* spotless:off */ other is CompanyBenefit && benefitId == other.benefitId && description == other.description && frequency == other.frequency && type == other.type && companyContribution == other.companyContribution && additionalProperties == other.additionalProperties /* spotless:on */ + return other is CompanyBenefit && + benefitId == other.benefitId && + description == other.description && + frequency == other.frequency && + type == other.type && + companyContribution == other.companyContribution && + additionalProperties == other.additionalProperties } - /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(benefitId, description, frequency, type, companyContribution, additionalProperties) } - /* spotless:on */ + private val hashCode: Int by lazy { + Objects.hash( + benefitId, + description, + frequency, + type, + companyContribution, + additionalProperties, + ) + } override fun hashCode(): Int = hashCode 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 ce97497c3..f5ac8559a 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 @@ -416,12 +416,10 @@ private constructor( return true } - return /* spotless:off */ other is Data && additionalProperties == other.additionalProperties /* spotless:on */ + return other is Data && additionalProperties == other.additionalProperties } - /* spotless:off */ private val hashCode: Int by lazy { Objects.hash(additionalProperties) } - /* spotless:on */ override fun hashCode(): Int = hashCode @@ -540,7 +538,7 @@ private constructor( return true } - return /* spotless:off */ other is EventType && value == other.value /* spotless:on */ + return other is EventType && value == other.value } override fun hashCode() = value.hashCode() @@ -553,12 +551,18 @@ private constructor( return true } - return /* spotless:off */ other is CompanyEvent && accountId == other.accountId && companyId == other.companyId && connectionId == other.connectionId && data == other.data && eventType == other.eventType && additionalProperties == other.additionalProperties /* spotless:on */ + return other is CompanyEvent && + accountId == other.accountId && + companyId == other.companyId && + connectionId == other.connectionId && + data == other.data && + eventType == other.eventType && + additionalProperties == other.additionalProperties } - /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(accountId, companyId, connectionId, data, eventType, additionalProperties) } - /* spotless:on */ + private val hashCode: Int by lazy { + Objects.hash(accountId, companyId, connectionId, data, eventType, additionalProperties) + } override fun hashCode(): Int = hashCode 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 7b15b8ddc..e2e427f3d 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 @@ -972,7 +972,7 @@ private constructor( return true } - return /* spotless:off */ other is AccountType && value == other.value /* spotless:on */ + return other is AccountType && value == other.value } override fun hashCode() = value.hashCode() @@ -985,12 +985,25 @@ private constructor( return true } - return /* spotless:off */ other is Account && accountName == other.accountName && accountNumber == other.accountNumber && accountType == other.accountType && institutionName == other.institutionName && routingNumber == other.routingNumber && additionalProperties == other.additionalProperties /* spotless:on */ + return other is Account && + accountName == other.accountName && + accountNumber == other.accountNumber && + accountType == other.accountType && + institutionName == other.institutionName && + routingNumber == other.routingNumber && + additionalProperties == other.additionalProperties } - /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(accountName, accountNumber, accountType, institutionName, routingNumber, additionalProperties) } - /* spotless:on */ + private val hashCode: Int by lazy { + Objects.hash( + accountName, + accountNumber, + accountType, + institutionName, + routingNumber, + additionalProperties, + ) + } override fun hashCode(): Int = hashCode @@ -1295,12 +1308,12 @@ private constructor( return true } - return /* spotless:off */ other is Parent && name == other.name && additionalProperties == other.additionalProperties /* spotless:on */ + return other is Parent && + name == other.name && + additionalProperties == other.additionalProperties } - /* spotless:off */ private val hashCode: Int by lazy { Objects.hash(name, additionalProperties) } - /* spotless:on */ override fun hashCode(): Int = hashCode @@ -1313,12 +1326,13 @@ private constructor( return true } - return /* spotless:off */ other is Department && name == other.name && parent == other.parent && additionalProperties == other.additionalProperties /* spotless:on */ + return other is Department && + name == other.name && + parent == other.parent && + additionalProperties == other.additionalProperties } - /* spotless:off */ private val hashCode: Int by lazy { Objects.hash(name, parent, additionalProperties) } - /* spotless:on */ override fun hashCode(): Int = hashCode @@ -1619,7 +1633,7 @@ private constructor( return true } - return /* spotless:off */ other is Subtype && value == other.value /* spotless:on */ + return other is Subtype && value == other.value } override fun hashCode() = value.hashCode() @@ -1777,7 +1791,7 @@ private constructor( return true } - return /* spotless:off */ other is Type && value == other.value /* spotless:on */ + return other is Type && value == other.value } override fun hashCode() = value.hashCode() @@ -1790,12 +1804,13 @@ private constructor( return true } - return /* spotless:off */ other is Entity && subtype == other.subtype && type == other.type && additionalProperties == other.additionalProperties /* spotless:on */ + return other is Entity && + subtype == other.subtype && + type == other.type && + additionalProperties == other.additionalProperties } - /* spotless:off */ private val hashCode: Int by lazy { Objects.hash(subtype, type, additionalProperties) } - /* spotless:on */ override fun hashCode(): Int = hashCode @@ -1808,12 +1823,31 @@ private constructor( return true } - return /* spotless:off */ other is CompanyUpdateResponse && accounts == other.accounts && departments == other.departments && ein == other.ein && entity == other.entity && legalName == other.legalName && locations == other.locations && primaryEmail == other.primaryEmail && primaryPhoneNumber == other.primaryPhoneNumber && additionalProperties == other.additionalProperties /* spotless:on */ + return other is CompanyUpdateResponse && + accounts == other.accounts && + departments == other.departments && + ein == other.ein && + entity == other.entity && + legalName == other.legalName && + locations == other.locations && + primaryEmail == other.primaryEmail && + primaryPhoneNumber == other.primaryPhoneNumber && + additionalProperties == other.additionalProperties } - /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(accounts, departments, ein, entity, legalName, locations, primaryEmail, primaryPhoneNumber, additionalProperties) } - /* spotless:on */ + private val hashCode: Int by lazy { + Objects.hash( + accounts, + departments, + ein, + entity, + legalName, + locations, + primaryEmail, + primaryPhoneNumber, + additionalProperties, + ) + } override fun hashCode(): Int = hashCode 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 4f01e4c26..7c557b64b 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 @@ -1006,12 +1006,33 @@ private constructor( return true } - return /* spotless:off */ other is Body && customerId == other.customerId && customerName == other.customerName && products == other.products && customerEmail == other.customerEmail && integration == other.integration && manual == other.manual && minutesToExpire == other.minutesToExpire && redirectUri == other.redirectUri && sandbox == other.sandbox && additionalProperties == other.additionalProperties /* spotless:on */ + return other is Body && + customerId == other.customerId && + customerName == other.customerName && + products == other.products && + customerEmail == other.customerEmail && + integration == other.integration && + manual == other.manual && + minutesToExpire == other.minutesToExpire && + redirectUri == other.redirectUri && + sandbox == other.sandbox && + additionalProperties == other.additionalProperties } - /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(customerId, customerName, products, customerEmail, integration, manual, minutesToExpire, redirectUri, sandbox, additionalProperties) } - /* spotless:on */ + private val hashCode: Int by lazy { + Objects.hash( + customerId, + customerName, + products, + customerEmail, + integration, + manual, + minutesToExpire, + redirectUri, + sandbox, + additionalProperties, + ) + } override fun hashCode(): Int = hashCode @@ -1188,7 +1209,7 @@ private constructor( return true } - return /* spotless:off */ other is ConnectProducts && value == other.value /* spotless:on */ + return other is ConnectProducts && value == other.value } override fun hashCode() = value.hashCode() @@ -1495,7 +1516,7 @@ private constructor( return true } - return /* spotless:off */ other is AuthMethod && value == other.value /* spotless:on */ + return other is AuthMethod && value == other.value } override fun hashCode() = value.hashCode() @@ -1508,12 +1529,15 @@ private constructor( return true } - return /* spotless:off */ other is Integration && authMethod == other.authMethod && provider == other.provider && additionalProperties == other.additionalProperties /* spotless:on */ + return other is Integration && + authMethod == other.authMethod && + provider == other.provider && + additionalProperties == other.additionalProperties } - /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(authMethod, provider, additionalProperties) } - /* spotless:on */ + private val hashCode: Int by lazy { + Objects.hash(authMethod, provider, additionalProperties) + } override fun hashCode(): Int = hashCode @@ -1637,7 +1661,7 @@ private constructor( return true } - return /* spotless:off */ other is Sandbox && value == other.value /* spotless:on */ + return other is Sandbox && value == other.value } override fun hashCode() = value.hashCode() @@ -1650,10 +1674,13 @@ private constructor( return true } - return /* spotless:off */ other is ConnectSessionNewParams && body == other.body && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams /* spotless:on */ + return other is ConnectSessionNewParams && + body == other.body && + additionalHeaders == other.additionalHeaders && + additionalQueryParams == other.additionalQueryParams } - override fun hashCode(): Int = /* spotless:off */ Objects.hash(body, additionalHeaders, additionalQueryParams) /* spotless:on */ + override fun hashCode(): Int = Objects.hash(body, additionalHeaders, additionalQueryParams) override fun toString() = "ConnectSessionNewParams{body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ConnectSessionReauthenticateParams.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/ConnectSessionReauthenticateParams.kt index f005460b4..8d695b3c3 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 @@ -675,12 +675,17 @@ private constructor( return true } - return /* spotless:off */ other is Body && connectionId == other.connectionId && minutesToExpire == other.minutesToExpire && products == other.products && redirectUri == other.redirectUri && additionalProperties == other.additionalProperties /* spotless:on */ + return other is Body && + connectionId == other.connectionId && + minutesToExpire == other.minutesToExpire && + products == other.products && + redirectUri == other.redirectUri && + additionalProperties == other.additionalProperties } - /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(connectionId, minutesToExpire, products, redirectUri, additionalProperties) } - /* spotless:on */ + private val hashCode: Int by lazy { + Objects.hash(connectionId, minutesToExpire, products, redirectUri, additionalProperties) + } override fun hashCode(): Int = hashCode @@ -857,7 +862,7 @@ private constructor( return true } - return /* spotless:off */ other is ConnectProducts && value == other.value /* spotless:on */ + return other is ConnectProducts && value == other.value } override fun hashCode() = value.hashCode() @@ -870,10 +875,13 @@ private constructor( return true } - return /* spotless:off */ other is ConnectSessionReauthenticateParams && body == other.body && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams /* spotless:on */ + return other is ConnectSessionReauthenticateParams && + body == other.body && + additionalHeaders == other.additionalHeaders && + additionalQueryParams == other.additionalQueryParams } - override fun hashCode(): Int = /* spotless:off */ Objects.hash(body, additionalHeaders, additionalQueryParams) /* spotless:on */ + override fun hashCode(): Int = Objects.hash(body, additionalHeaders, additionalQueryParams) override fun toString() = "ConnectSessionReauthenticateParams{body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" 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 0bc058801..0049ee7b3 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 @@ -589,7 +589,7 @@ private constructor( return true } - return /* spotless:off */ other is AuthenticationType && value == other.value /* spotless:on */ + return other is AuthenticationType && value == other.value } override fun hashCode() = value.hashCode() @@ -602,12 +602,31 @@ private constructor( return true } - return /* spotless:off */ other is ConnectionCreateResponse && accessToken == other.accessToken && accountId == other.accountId && authenticationType == other.authenticationType && companyId == other.companyId && connectionId == other.connectionId && products == other.products && providerId == other.providerId && tokenType == other.tokenType && additionalProperties == other.additionalProperties /* spotless:on */ + return other is ConnectionCreateResponse && + accessToken == other.accessToken && + accountId == other.accountId && + authenticationType == other.authenticationType && + companyId == other.companyId && + connectionId == other.connectionId && + products == other.products && + providerId == other.providerId && + tokenType == other.tokenType && + additionalProperties == other.additionalProperties } - /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(accessToken, accountId, authenticationType, companyId, connectionId, products, providerId, tokenType, additionalProperties) } - /* spotless:on */ + private val hashCode: Int by lazy { + Objects.hash( + accessToken, + accountId, + authenticationType, + companyId, + connectionId, + products, + providerId, + tokenType, + additionalProperties, + ) + } override fun hashCode(): Int = hashCode 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 08471c422..d6b4b286d 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 @@ -149,7 +149,7 @@ class ConnectionStatusType @JsonCreator private constructor(private val value: J return true } - return /* spotless:off */ other is ConnectionStatusType && value == other.value /* spotless:on */ + return other is ConnectionStatusType && value == other.value } override fun hashCode() = value.hashCode() 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 02a73edfe..1815b1495 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 @@ -686,7 +686,7 @@ private constructor( return true } - return /* spotless:off */ other is ClientType && value == other.value /* spotless:on */ + return other is ClientType && value == other.value } override fun hashCode() = value.hashCode() @@ -819,7 +819,7 @@ private constructor( return true } - return /* spotless:off */ other is ConnectionType && value == other.value /* spotless:on */ + return other is ConnectionType && value == other.value } override fun hashCode() = value.hashCode() @@ -832,12 +832,35 @@ private constructor( return true } - return /* spotless:off */ other is CreateAccessTokenResponse && accessToken == other.accessToken && accountId == other.accountId && clientType == other.clientType && companyId == other.companyId && connectionId == other.connectionId && connectionType == other.connectionType && products == other.products && providerId == other.providerId && customerId == other.customerId && tokenType == other.tokenType && additionalProperties == other.additionalProperties /* spotless:on */ + return other is CreateAccessTokenResponse && + accessToken == other.accessToken && + accountId == other.accountId && + clientType == other.clientType && + companyId == other.companyId && + connectionId == other.connectionId && + connectionType == other.connectionType && + products == other.products && + providerId == other.providerId && + customerId == other.customerId && + tokenType == other.tokenType && + additionalProperties == other.additionalProperties } - /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(accessToken, accountId, clientType, companyId, connectionId, connectionType, products, providerId, customerId, tokenType, additionalProperties) } - /* spotless:on */ + private val hashCode: Int by lazy { + Objects.hash( + accessToken, + accountId, + clientType, + companyId, + connectionId, + connectionType, + products, + providerId, + customerId, + tokenType, + additionalProperties, + ) + } override fun hashCode(): Int = hashCode diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/CreateCompanyBenefitsResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/CreateCompanyBenefitsResponse.kt index a65b38d4a..7a86b89af 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/CreateCompanyBenefitsResponse.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/CreateCompanyBenefitsResponse.kt @@ -193,12 +193,13 @@ private constructor( return true } - return /* spotless:off */ other is CreateCompanyBenefitsResponse && benefitId == other.benefitId && jobId == other.jobId && additionalProperties == other.additionalProperties /* spotless:on */ + return other is CreateCompanyBenefitsResponse && + benefitId == other.benefitId && + jobId == other.jobId && + additionalProperties == other.additionalProperties } - /* spotless:off */ private val hashCode: Int by lazy { Objects.hash(benefitId, jobId, additionalProperties) } - /* spotless:on */ override fun hashCode(): Int = hashCode diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/DirectoryCreateResponse.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/DirectoryCreateResponse.kt index 0efe98711..0a8f737b4 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/models/DirectoryCreateResponse.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/models/DirectoryCreateResponse.kt @@ -102,12 +102,11 @@ private constructor(private val additionalProperties: MutableMap Date: Wed, 13 Aug 2025 16:52:28 +0000 Subject: [PATCH 14/18] chore(internal): dynamically determine included projects --- settings.gradle.kts | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/settings.gradle.kts b/settings.gradle.kts index f98679954..0d8d4c7c5 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,7 +1,14 @@ rootProject.name = "finch-java-root" -include("finch-java") -include("finch-java-client-okhttp") -include("finch-java-core") -include("finch-java-proguard-test") -include("finch-java-example") +val projectNames = rootDir.listFiles() + ?.asSequence() + .orEmpty() + .filter { file -> + file.isDirectory && + file.name.startsWith("finch-java") && + file.listFiles()?.asSequence().orEmpty().any { it.name == "build.gradle.kts" } + } + .map { it.name } + .toList() +println("projects: $projectNames") +projectNames.forEach { include(it) } From ed21d5f3060c72300e10783daa1845c2b05fb30b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 13 Aug 2025 18:45:53 +0000 Subject: [PATCH 15/18] chore(internal): support passing arguments to test script --- scripts/test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/test b/scripts/test index 2177cb8ae..047bc1dbb 100755 --- a/scripts/test +++ b/scripts/test @@ -53,4 +53,4 @@ else fi echo "==> Running tests" -./gradlew test +./gradlew test "$@" From 6c97cb5e79daab075eb43efb35ab992baa011770 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 13 Aug 2025 21:37:37 +0000 Subject: [PATCH 16/18] perf(internal): make formatting faster Running the formatter through Spotless is slow because Spotless synchronously runs the formatter on each file. Running the formatter directly parallelizes the formatting across cores. --- .gitignore | 2 +- build.gradle.kts | 13 +++ buildSrc/build.gradle.kts | 1 - .../src/main/kotlin/finch.java.gradle.kts | 94 ++++++++++++++++--- .../src/main/kotlin/finch.kotlin.gradle.kts | 82 ++++++++++++++-- scripts/build | 8 ++ scripts/format | 4 +- scripts/lint | 4 +- 8 files changed, 183 insertions(+), 25 deletions(-) create mode 100755 scripts/build diff --git a/.gitignore b/.gitignore index 4e81838d6..b1346e6d1 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,6 @@ .gradle .idea .kotlin -build +build/ codegen.log kls_database.db diff --git a/build.gradle.kts b/build.gradle.kts index 82ff7f2fb..d83471720 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -11,6 +11,19 @@ allprojects { version = "7.4.0" // x-release-please-version } +subprojects { + // These are populated with dependencies by `buildSrc` scripts. + tasks.register("format") { + group = "Verification" + description = "Formats all source files." + } + tasks.register("lint") { + group = "Verification" + description = "Verifies all source files are formatted." + } + apply(plugin = "org.jetbrains.dokka") +} + subprojects { apply(plugin = "org.jetbrains.dokka") } diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index 778c89de5..c6dc92ec5 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -10,7 +10,6 @@ repositories { } dependencies { - implementation("com.diffplug.spotless:spotless-plugin-gradle:7.0.2") implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.20") implementation("com.vanniktech:gradle-maven-publish-plugin:0.28.0") } diff --git a/buildSrc/src/main/kotlin/finch.java.gradle.kts b/buildSrc/src/main/kotlin/finch.java.gradle.kts index dfbacb86e..70fc33f41 100644 --- a/buildSrc/src/main/kotlin/finch.java.gradle.kts +++ b/buildSrc/src/main/kotlin/finch.java.gradle.kts @@ -1,24 +1,13 @@ -import com.diffplug.gradle.spotless.SpotlessExtension import org.gradle.api.tasks.testing.logging.TestExceptionFormat plugins { `java-library` - id("com.diffplug.spotless") } repositories { mavenCentral() } -configure { - java { - importOrder() - removeUnusedImports() - palantirJavaFormat() - toggleOffOn() - } -} - java { toolchain { languageVersion.set(JavaLanguageVersion.of(21)) @@ -53,3 +42,86 @@ tasks.withType().configureEach { exceptionFormat = TestExceptionFormat.FULL } } + +val palantir by configurations.creating +dependencies { + palantir("com.palantir.javaformat:palantir-java-format:2.73.0") +} + +fun registerPalantir( + name: String, + description: String, +) { + val javaName = "${name}Java" + tasks.register(javaName) { + group = "Verification" + this.description = description + + classpath = palantir + mainClass = "com.palantir.javaformat.java.Main" + + // Avoid an `IllegalAccessError` on Java 9+. + jvmArgs( + "--add-exports", "jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED", + "--add-exports", "jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED", + "--add-exports", "jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED", + "--add-exports", "jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED", + "--add-exports", "jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED", + ) + + // Use paths relative to the current module. + val argumentFile = + project.layout.buildDirectory.file("palantir-$name-args.txt").get().asFile + val lastRunTimeFile = + project.layout.buildDirectory.file("palantir-$name-last-run.txt").get().asFile + + // Read the time when this task was last executed for this module (if ever). + val lastRunTime = lastRunTimeFile.takeIf { it.exists() }?.readText()?.toLongOrNull() ?: 0L + + // Use a `fileTree` relative to the module's source directory. + val javaFiles = project.fileTree("src") { include("**/*.java") } + + // Determine if any files need to be formatted or linted and continue only if there is at least + // one file. + onlyIf { javaFiles.any { it.lastModified() > lastRunTime } } + + inputs.files(javaFiles) + + doFirst { + // Create the argument file and set the preferred formatting style. + argumentFile.parentFile.mkdirs() + argumentFile.writeText("--palantir\n") + + if (name == "lint") { + // For lint, do a dry run, so no files are modified. Set the exit code to 1 (instead of + // the default 0) if any files need to be formatted, indicating that linting has failed. + argumentFile.appendText("--dry-run\n") + argumentFile.appendText("--set-exit-if-changed\n") + } else { + // `--dry-run` and `--replace` (for in-place formatting) are mutually exclusive. + argumentFile.appendText("--replace\n") + } + + // Write the modified files to the argument file. + javaFiles.filter { it.lastModified() > lastRunTime } + .forEach { argumentFile.appendText("${it.absolutePath}\n") } + } + + doLast { + // Record the last execution time for later up-to-date checking. + lastRunTimeFile.writeText(System.currentTimeMillis().toString()) + } + + // Pass the argument file using the @ symbol + args = listOf("@${argumentFile.absolutePath}") + + outputs.upToDateWhen { javaFiles.none { it.lastModified() > lastRunTime } } + } + + tasks.named(name) { + dependsOn(tasks.named(javaName)) + } +} + +registerPalantir(name = "format", description = "Formats all Java source files.") +registerPalantir(name = "lint", description = "Verifies all Java source files are formatted.") diff --git a/buildSrc/src/main/kotlin/finch.kotlin.gradle.kts b/buildSrc/src/main/kotlin/finch.kotlin.gradle.kts index f3f20e2b4..bf2f1f05b 100644 --- a/buildSrc/src/main/kotlin/finch.kotlin.gradle.kts +++ b/buildSrc/src/main/kotlin/finch.kotlin.gradle.kts @@ -1,4 +1,3 @@ -import com.diffplug.gradle.spotless.SpotlessExtension import org.jetbrains.kotlin.gradle.dsl.JvmTarget import org.jetbrains.kotlin.gradle.dsl.KotlinVersion @@ -7,6 +6,10 @@ plugins { kotlin("jvm") } +repositories { + mavenCentral() +} + kotlin { jvmToolchain { languageVersion.set(JavaLanguageVersion.of(21)) @@ -27,14 +30,77 @@ kotlin { } } -configure { - kotlin { - ktfmt().kotlinlangStyle() - toggleOffOn() - } -} - tasks.withType().configureEach { systemProperty("junit.jupiter.execution.parallel.enabled", true) systemProperty("junit.jupiter.execution.parallel.mode.default", "concurrent") } + +val ktfmt by configurations.creating +dependencies { + ktfmt("com.facebook:ktfmt:0.56") +} + +fun registerKtfmt( + name: String, + description: String, +) { + val kotlinName = "${name}Kotlin" + tasks.register(kotlinName) { + group = "Verification" + this.description = description + + classpath = ktfmt + mainClass = "com.facebook.ktfmt.cli.Main" + + // Use paths relative to the current module. + val argumentFile = project.layout.buildDirectory.file("ktfmt-$name-args.txt").get().asFile + val lastRunTimeFile = + project.layout.buildDirectory.file("ktfmt-$name-last-run.txt").get().asFile + + // Read the time when this task was last executed for this module (if ever). + val lastRunTime = lastRunTimeFile.takeIf { it.exists() }?.readText()?.toLongOrNull() ?: 0L + + // Use a `fileTree` relative to the module's source directory. + val kotlinFiles = project.fileTree("src") { include("**/*.kt") } + + // Determine if any files need to be formatted or linted and continue only if there is at least + // one file (otherwise Ktfmt will fail). + onlyIf { kotlinFiles.any { it.lastModified() > lastRunTime } } + + inputs.files(kotlinFiles) + + doFirst { + // Create the argument file and set the preferred formatting style. + argumentFile.parentFile.mkdirs() + argumentFile.writeText("--kotlinlang-style\n") + + if (name == "lint") { + // For lint, do a dry run, so no files are modified. Set the exit code to 1 (instead of + // the default 0) if any files need to be formatted, indicating that linting has failed. + argumentFile.appendText("--dry-run\n") + argumentFile.appendText("--set-exit-if-changed\n") + } + + // Write the modified files to the argument file. + kotlinFiles.filter { it.lastModified() > lastRunTime } + .forEach { argumentFile.appendText("${it.absolutePath}\n") } + } + + doLast { + // Record the last execution time for later up-to-date checking. + lastRunTimeFile.writeText(System.currentTimeMillis().toString()) + } + + // Pass the argument file using the @ symbol + args = listOf("@${argumentFile.absolutePath}") + + outputs.upToDateWhen { kotlinFiles.none { it.lastModified() > lastRunTime } } + } + + tasks.named(name) { + dependsOn(tasks.named(kotlinName)) + } +} + +registerKtfmt(name = "format", description = "Formats all Kotlin source files.") +registerKtfmt(name = "lint", description = "Verifies all Kotlin source files are formatted.") diff --git a/scripts/build b/scripts/build new file mode 100755 index 000000000..f40634826 --- /dev/null +++ b/scripts/build @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +set -e + +cd "$(dirname "$0")/.." + +echo "==> Building classes" +./gradlew build testClasses -x test diff --git a/scripts/format b/scripts/format index 456a69db9..7c0be4d57 100755 --- a/scripts/format +++ b/scripts/format @@ -4,5 +4,5 @@ set -e cd "$(dirname "$0")/.." -echo "==> Running spotlessApply" -./gradlew spotlessApply +echo "==> Running formatters" +./gradlew format diff --git a/scripts/lint b/scripts/lint index e3a5f5e24..aea8af713 100755 --- a/scripts/lint +++ b/scripts/lint @@ -4,5 +4,5 @@ set -e cd "$(dirname "$0")/.." -echo "==> Build classes" -./gradlew build testClasses -x test +echo "==> Running lints" +./gradlew lint From 3e8af3ad0b7ba3f17f845da25205fcd12df9389e Mon Sep 17 00:00:00 2001 From: Robert Craigie Date: Thu, 14 Aug 2025 17:14:05 +0100 Subject: [PATCH 17/18] fix(client): prioritise bearer auth --- .../main/kotlin/com/tryfinch/api/core/ClientOptions.kt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/finch-java-core/src/main/kotlin/com/tryfinch/api/core/ClientOptions.kt b/finch-java-core/src/main/kotlin/com/tryfinch/api/core/ClientOptions.kt index 4412cdc0e..6e4b29474 100644 --- a/finch-java-core/src/main/kotlin/com/tryfinch/api/core/ClientOptions.kt +++ b/finch-java-core/src/main/kotlin/com/tryfinch/api/core/ClientOptions.kt @@ -437,11 +437,6 @@ private constructor( headers.put("X-Stainless-Runtime", "JRE") headers.put("X-Stainless-Runtime-Version", getJavaVersion()) headers.put("Finch-API-Version", "2020-09-17") - accessToken?.let { - if (!it.isEmpty()) { - headers.put("Authorization", "Bearer $it") - } - } clientId?.let { username -> clientSecret?.let { password -> if (!username.isEmpty() && !password.isEmpty()) { @@ -452,6 +447,11 @@ private constructor( } } } + accessToken?.let { + if (!it.isEmpty()) { + headers.put("Authorization", "Bearer $it") + } + } headers.replaceAll(this.headers.build()) queryParams.replaceAll(this.queryParams.build()) From 526d12baa725b72e2a725d9e292e3a4f902fc262 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 14 Aug 2025 16:14:31 +0000 Subject: [PATCH 18/18] release: 7.5.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 36 +++++++++++++++++++++++++++++++++++ README.md | 10 +++++----- build.gradle.kts | 2 +- 4 files changed, 43 insertions(+), 7 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 037c241f3..a391b13b8 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "7.4.0" + ".": "7.5.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index f847bdfbb..24da6e9f6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,41 @@ # Changelog +## 7.5.0 (2025-08-14) + +Full Changelog: [v7.4.0...v7.5.0](https://github.com/Finch-API/finch-api-java/compare/v7.4.0...v7.5.0) + +### Features + +* add retryable exception ([451adb3](https://github.com/Finch-API/finch-api-java/commit/451adb3fea351e5e905f4f947b96ffb0692fc381)) +* **api:** api update ([e282b93](https://github.com/Finch-API/finch-api-java/commit/e282b93f4af685cb1f90e0d3f625992f2244fca7)) +* **api:** api update ([21029e1](https://github.com/Finch-API/finch-api-java/commit/21029e1962110fd6394a08af08b97ae39e784e79)) +* **client:** ensure compat with proguard ([56c3b0b](https://github.com/Finch-API/finch-api-java/commit/56c3b0bcad2cff10e9b412efe55230544214dfcd)) + + +### Bug Fixes + +* **client:** prioritise bearer auth ([3e8af3a](https://github.com/Finch-API/finch-api-java/commit/3e8af3ad0b7ba3f17f845da25205fcd12df9389e)) +* **client:** r8 support ([700fb08](https://github.com/Finch-API/finch-api-java/commit/700fb080718f1b339860b9e384f3f359a0e6290f)) + + +### Performance Improvements + +* **internal:** make formatting faster ([6c97cb5](https://github.com/Finch-API/finch-api-java/commit/6c97cb5e79daab075eb43efb35ab992baa011770)) + + +### Chores + +* **example:** fix run example comment ([316356f](https://github.com/Finch-API/finch-api-java/commit/316356fb19963ef6ef9698102f2f66ea7111d8be)) +* increase max gradle JVM heap to 8GB ([1eed053](https://github.com/Finch-API/finch-api-java/commit/1eed053bef23cc9aa82085af0d17c94adc63e225)) +* **internal:** add async lock helper ([290ee95](https://github.com/Finch-API/finch-api-java/commit/290ee954c5520a181678d8472e5849a42485b1ae)) +* **internal:** bump ci test timeout ([9e577c2](https://github.com/Finch-API/finch-api-java/commit/9e577c2f9c082d753abca9d7b2157f5dbc1d3536)) +* **internal:** dynamically determine included projects ([a9f3ad6](https://github.com/Finch-API/finch-api-java/commit/a9f3ad61141a729a69b5482e65537af3f247fe75)) +* **internal:** format identity methods ([fee1332](https://github.com/Finch-API/finch-api-java/commit/fee13320c0585e2ff8ac12e08de92619d81504e9)) +* **internal:** reduce proguard ci logging ([97228cc](https://github.com/Finch-API/finch-api-java/commit/97228cca761aa1e433639279102a592877e87dca)) +* **internal:** support passing arguments to test script ([ed21d5f](https://github.com/Finch-API/finch-api-java/commit/ed21d5f3060c72300e10783daa1845c2b05fb30b)) +* **internal:** update comment in script ([9a58acb](https://github.com/Finch-API/finch-api-java/commit/9a58acbb6d50ac2c08c2a00243fc547d8f6193fe)) +* update @stainless-api/prism-cli to v5.15.0 ([9338715](https://github.com/Finch-API/finch-api-java/commit/93387157cbd7f20a97e713952ae8eacd34a6129f)) + ## 7.4.0 (2025-07-24) Full Changelog: [v7.3.1...v7.4.0](https://github.com/Finch-API/finch-api-java/compare/v7.3.1...v7.4.0) diff --git a/README.md b/README.md index 24b7da707..091dc9a0f 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,8 @@ -[![Maven Central](https://img.shields.io/maven-central/v/com.tryfinch.api/finch-java)](https://central.sonatype.com/artifact/com.tryfinch.api/finch-java/7.4.0) -[![javadoc](https://javadoc.io/badge2/com.tryfinch.api/finch-java/7.4.0/javadoc.svg)](https://javadoc.io/doc/com.tryfinch.api/finch-java/7.4.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/7.5.0) +[![javadoc](https://javadoc.io/badge2/com.tryfinch.api/finch-java/7.5.0/javadoc.svg)](https://javadoc.io/doc/com.tryfinch.api/finch-java/7.5.0) @@ -15,7 +15,7 @@ It is generated with [Stainless](https://www.stainless.com/). -The REST API documentation can be found on [developer.tryfinch.com](https://developer.tryfinch.com/). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.tryfinch.api/finch-java/7.4.0). +The REST API documentation can be found on [developer.tryfinch.com](https://developer.tryfinch.com/). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.tryfinch.api/finch-java/7.5.0). @@ -26,7 +26,7 @@ The REST API documentation can be found on [developer.tryfinch.com](https://deve ### Gradle ```kotlin -implementation("com.tryfinch.api:finch-java:7.4.0") +implementation("com.tryfinch.api:finch-java:7.5.0") ``` ### Maven @@ -35,7 +35,7 @@ implementation("com.tryfinch.api:finch-java:7.4.0") com.tryfinch.api finch-java - 7.4.0 + 7.5.0 ``` diff --git a/build.gradle.kts b/build.gradle.kts index d83471720..0f4d3aa8f 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -8,7 +8,7 @@ repositories { allprojects { group = "com.tryfinch.api" - version = "7.4.0" // x-release-please-version + version = "7.5.0" // x-release-please-version } subprojects {