diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 3acb1b7..7376b4b 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -36,6 +36,31 @@ jobs:
- name: Run lints
run: ./scripts/lint
+
+ build:
+ timeout-minutes: 15
+ name: build
+ runs-on: ${{ github.repository == 'stainless-sdks/scrapegraphai-java' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
+ if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
+
+ steps:
+ - uses: actions/checkout@v4
+
+ - name: Set up Java
+ uses: actions/setup-java@v4
+ with:
+ distribution: temurin
+ java-version: |
+ 8
+ 21
+ cache: gradle
+
+ - name: Set up Gradle
+ uses: gradle/actions/setup-gradle@v4
+
+ - name: Build SDK
+ run: ./scripts/build
+
test:
timeout-minutes: 15
name: test
diff --git a/.github/workflows/publish-sonatype.yml b/.github/workflows/publish-sonatype.yml
index 2357f84..008184d 100644
--- a/.github/workflows/publish-sonatype.yml
+++ b/.github/workflows/publish-sonatype.yml
@@ -22,7 +22,7 @@ jobs:
distribution: temurin
java-version: |
8
- 17
+ 21
cache: gradle
- name: Set up Gradle
diff --git a/.gitignore b/.gitignore
index 4e81838..b1346e6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,6 +2,6 @@
.gradle
.idea
.kotlin
-build
+build/
codegen.log
kls_database.db
diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index c7159c1..3d2ac0b 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.0.2"
+ ".": "0.1.0"
}
\ No newline at end of file
diff --git a/.stats.yml b/.stats.yml
index 561b1cc..6804ffb 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 15
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/scrapegraphai%2Fscrapegraphai-969ebada41127057e4cda129b2e7206224743b5c7fd33aa8ae062ff71b775ac9.yml
-openapi_spec_hash: 2b2c2c684e6f6885398efca5f2b1f854
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/scrapegraphai%2Fscrapegraphai-633fdeab6abaefbe666099e8f86ce6b2acc9dacff1c33a80813bb04e8e437229.yml
+openapi_spec_hash: f41ec90694ca8e7233bd20cc7ff1afbf
config_hash: 6889576ba0fdc14f2c71cea09a60a0f6
diff --git a/CHANGELOG.md b/CHANGELOG.md
index aaf888d..ef4fb63 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,42 @@
# Changelog
+## 0.1.0 (2025-09-26)
+
+Full Changelog: [v0.0.2...v0.1.0](https://github.com/ScrapeGraphAI/scrapegraphai-java/compare/v0.0.2...v0.1.0)
+
+### Features
+
+* add examples ([244ec60](https://github.com/ScrapeGraphAI/scrapegraphai-java/commit/244ec60f134d22f802e6bd85085e793116f7cd15))
+* **client:** expose sleeper option ([31498f9](https://github.com/ScrapeGraphAI/scrapegraphai-java/commit/31498f9086172ba6d321db51a111b5560c6b458e))
+
+
+### Bug Fixes
+
+* **ci:** use java-version 21 for publish step ([7fec339](https://github.com/ScrapeGraphAI/scrapegraphai-java/commit/7fec3394bb6955ef587400b910645422df75f25b))
+* **client:** deserialization of empty objects ([e38e49a](https://github.com/ScrapeGraphAI/scrapegraphai-java/commit/e38e49aecbc41f8ad39a708c368b0d96f5e0ad41))
+* **client:** ensure single timer is created per client ([31498f9](https://github.com/ScrapeGraphAI/scrapegraphai-java/commit/31498f9086172ba6d321db51a111b5560c6b458e))
+* **client:** incorrect `getPackageVersion` impl ([2816d70](https://github.com/ScrapeGraphAI/scrapegraphai-java/commit/2816d70a176089871b1f30ae72729722acc7e3fb))
+
+
+### Performance Improvements
+
+* **internal:** make formatting faster ([962b633](https://github.com/ScrapeGraphAI/scrapegraphai-java/commit/962b633969301291f5a1e27e44e75507657f19c3))
+
+
+### Chores
+
+* **ci:** add build job ([b160680](https://github.com/ScrapeGraphAI/scrapegraphai-java/commit/b160680211abc84f1767ac89a134c1c9bbfa33b4))
+* **ci:** reduce log noise ([11577b5](https://github.com/ScrapeGraphAI/scrapegraphai-java/commit/11577b5546813200fa5d4da6c2445bc59ab48cf7))
+* **client:** refactor closing / shutdown ([a9a7732](https://github.com/ScrapeGraphAI/scrapegraphai-java/commit/a9a773243446462114da094d98419dcc771c05a9))
+* improve formatter performance ([edb9343](https://github.com/ScrapeGraphAI/scrapegraphai-java/commit/edb93433720d26221871ad438df547b5b1d5fb11))
+* **internal:** codegen related update ([e79ba3b](https://github.com/ScrapeGraphAI/scrapegraphai-java/commit/e79ba3bb42bbfe1971d42793fa4670382f1b1c85))
+* **internal:** codegen related update ([bba3567](https://github.com/ScrapeGraphAI/scrapegraphai-java/commit/bba35670aa34c9bb0f89cbb278522d3b661f0c4a))
+* **internal:** codegen related update ([54c20de](https://github.com/ScrapeGraphAI/scrapegraphai-java/commit/54c20de03a87907f8988f131eb5ab4e7813fd303))
+* **internal:** codegen related update ([5177422](https://github.com/ScrapeGraphAI/scrapegraphai-java/commit/5177422b248308d811474d9085e698fa24604b4e))
+* **internal:** dynamically determine included projects ([6ef030b](https://github.com/ScrapeGraphAI/scrapegraphai-java/commit/6ef030b80d8d31189ed7060c45b6cafc9c3f45c7))
+* **internal:** support passing arguments to test script ([e858395](https://github.com/ScrapeGraphAI/scrapegraphai-java/commit/e8583958a6302c87d5474e18ac06ff0c6505df0d))
+* **internal:** support running formatters directly ([62f3ad9](https://github.com/ScrapeGraphAI/scrapegraphai-java/commit/62f3ad9598e6787adbc0ac247e6ba65a1745312d))
+
## 0.0.2 (2025-08-12)
Full Changelog: [v0.0.1...v0.0.2](https://github.com/ScrapeGraphAI/scrapegraphai-java/compare/v0.0.1...v0.0.2)
diff --git a/README.md b/README.md
index f58f67c..b843289 100644
--- a/README.md
+++ b/README.md
@@ -2,8 +2,8 @@
-[](https://central.sonatype.com/artifact/com.scrapegraphai.api/scrapegraphai-java/0.0.2)
-[](https://javadoc.io/doc/com.scrapegraphai.api/scrapegraphai-java/0.0.2)
+[](https://central.sonatype.com/artifact/com.scrapegraphai.api/scrapegraphai-java/0.1.0)
+[](https://javadoc.io/doc/com.scrapegraphai.api/scrapegraphai-java/0.1.0)
@@ -13,7 +13,7 @@ It is generated with [Stainless](https://www.stainless.com/).
-The REST API documentation can be found on [scrapegraphai.com](https://scrapegraphai.com). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.scrapegraphai.api/scrapegraphai-java/0.0.2).
+The REST API documentation can be found on [scrapegraphai.com](https://scrapegraphai.com). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.scrapegraphai.api/scrapegraphai-java/0.1.0).
@@ -24,7 +24,7 @@ The REST API documentation can be found on [scrapegraphai.com](https://scrapegra
### Gradle
```kotlin
-implementation("com.scrapegraphai.api:scrapegraphai-java:0.0.2")
+implementation("com.scrapegraphai.api:scrapegraphai-java:0.1.0")
```
### Maven
@@ -33,7 +33,7 @@ implementation("com.scrapegraphai.api:scrapegraphai-java:0.0.2")
com.scrapegraphai.api
scrapegraphai-java
- 0.0.2
+ 0.1.0
```
diff --git a/build.gradle.kts b/build.gradle.kts
index 365828f..7ab1249 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -9,7 +9,20 @@ repositories {
allprojects {
group = "com.scrapegraphai.api"
- version = "0.0.2" // x-release-please-version
+ version = "0.1.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 {
diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts
index af99bd1..0b14135 100644
--- a/buildSrc/build.gradle.kts
+++ b/buildSrc/build.gradle.kts
@@ -8,6 +8,5 @@ repositories {
}
dependencies {
- implementation("com.diffplug.spotless:spotless-plugin-gradle:7.0.2")
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.20")
}
diff --git a/buildSrc/src/main/kotlin/scrapegraphai.java.gradle.kts b/buildSrc/src/main/kotlin/scrapegraphai.java.gradle.kts
index 2f37756..81d5d32 100644
--- a/buildSrc/src/main/kotlin/scrapegraphai.java.gradle.kts
+++ b/buildSrc/src/main/kotlin/scrapegraphai.java.gradle.kts
@@ -1,9 +1,7 @@
-import com.diffplug.gradle.spotless.SpotlessExtension
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
plugins {
`java-library`
- id("com.diffplug.spotless")
}
repositories {
@@ -15,15 +13,6 @@ configure {
withSourcesJar()
}
-configure {
- java {
- importOrder()
- removeUnusedImports()
- palantirJavaFormat()
- toggleOffOn()
- }
-}
-
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(21))
@@ -62,3 +51,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/scrapegraphai.kotlin.gradle.kts b/buildSrc/src/main/kotlin/scrapegraphai.kotlin.gradle.kts
index 8c797cc..0505677 100644
--- a/buildSrc/src/main/kotlin/scrapegraphai.kotlin.gradle.kts
+++ b/buildSrc/src/main/kotlin/scrapegraphai.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/scrapegraphai-java-client-okhttp/src/main/kotlin/com/scrapegraphai/api/client/okhttp/ScrapegraphaiOkHttpClient.kt b/scrapegraphai-java-client-okhttp/src/main/kotlin/com/scrapegraphai/api/client/okhttp/ScrapegraphaiOkHttpClient.kt
index d78c7a4..09de345 100644
--- a/scrapegraphai-java-client-okhttp/src/main/kotlin/com/scrapegraphai/api/client/okhttp/ScrapegraphaiOkHttpClient.kt
+++ b/scrapegraphai-java-client-okhttp/src/main/kotlin/com/scrapegraphai/api/client/okhttp/ScrapegraphaiOkHttpClient.kt
@@ -6,6 +6,7 @@ import com.fasterxml.jackson.databind.json.JsonMapper
import com.scrapegraphai.api.client.ScrapegraphaiClient
import com.scrapegraphai.api.client.ScrapegraphaiClientImpl
import com.scrapegraphai.api.core.ClientOptions
+import com.scrapegraphai.api.core.Sleeper
import com.scrapegraphai.api.core.Timeout
import com.scrapegraphai.api.core.http.Headers
import com.scrapegraphai.api.core.http.HttpClient
@@ -120,6 +121,17 @@ class ScrapegraphaiOkHttpClient private constructor() {
*/
fun jsonMapper(jsonMapper: JsonMapper) = apply { clientOptions.jsonMapper(jsonMapper) }
+ /**
+ * The interface to use for delaying execution, like during retries.
+ *
+ * This is primarily useful for using fake delays in tests.
+ *
+ * Defaults to real execution delays.
+ *
+ * This class takes ownership of the sleeper and closes it when closed.
+ */
+ fun sleeper(sleeper: Sleeper) = apply { clientOptions.sleeper(sleeper) }
+
/**
* The clock to use for operations that require timing, like retries.
*
diff --git a/scrapegraphai-java-client-okhttp/src/main/kotlin/com/scrapegraphai/api/client/okhttp/ScrapegraphaiOkHttpClientAsync.kt b/scrapegraphai-java-client-okhttp/src/main/kotlin/com/scrapegraphai/api/client/okhttp/ScrapegraphaiOkHttpClientAsync.kt
index 1ca330d..eb93fdc 100644
--- a/scrapegraphai-java-client-okhttp/src/main/kotlin/com/scrapegraphai/api/client/okhttp/ScrapegraphaiOkHttpClientAsync.kt
+++ b/scrapegraphai-java-client-okhttp/src/main/kotlin/com/scrapegraphai/api/client/okhttp/ScrapegraphaiOkHttpClientAsync.kt
@@ -6,6 +6,7 @@ import com.fasterxml.jackson.databind.json.JsonMapper
import com.scrapegraphai.api.client.ScrapegraphaiClientAsync
import com.scrapegraphai.api.client.ScrapegraphaiClientAsyncImpl
import com.scrapegraphai.api.core.ClientOptions
+import com.scrapegraphai.api.core.Sleeper
import com.scrapegraphai.api.core.Timeout
import com.scrapegraphai.api.core.http.Headers
import com.scrapegraphai.api.core.http.HttpClient
@@ -120,6 +121,17 @@ class ScrapegraphaiOkHttpClientAsync private constructor() {
*/
fun jsonMapper(jsonMapper: JsonMapper) = apply { clientOptions.jsonMapper(jsonMapper) }
+ /**
+ * The interface to use for delaying execution, like during retries.
+ *
+ * This is primarily useful for using fake delays in tests.
+ *
+ * Defaults to real execution delays.
+ *
+ * This class takes ownership of the sleeper and closes it when closed.
+ */
+ fun sleeper(sleeper: Sleeper) = apply { clientOptions.sleeper(sleeper) }
+
/**
* The clock to use for operations that require timing, like retries.
*
diff --git a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/client/ScrapegraphaiClientAsyncImpl.kt b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/client/ScrapegraphaiClientAsyncImpl.kt
index 389a8b9..26d5c9f 100644
--- a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/client/ScrapegraphaiClientAsyncImpl.kt
+++ b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/client/ScrapegraphaiClientAsyncImpl.kt
@@ -103,7 +103,7 @@ class ScrapegraphaiClientAsyncImpl(private val clientOptions: ClientOptions) :
override fun healthz(): HealthzServiceAsync = healthz
- override fun close() = clientOptions.httpClient.close()
+ override fun close() = clientOptions.close()
class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) :
ScrapegraphaiClientAsync.WithRawResponse {
diff --git a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/client/ScrapegraphaiClientImpl.kt b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/client/ScrapegraphaiClientImpl.kt
index a9fb4e5..9f6a3da 100644
--- a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/client/ScrapegraphaiClientImpl.kt
+++ b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/client/ScrapegraphaiClientImpl.kt
@@ -98,7 +98,7 @@ class ScrapegraphaiClientImpl(private val clientOptions: ClientOptions) : Scrape
override fun healthz(): HealthzService = healthz
- override fun close() = clientOptions.httpClient.close()
+ override fun close() = clientOptions.close()
class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) :
ScrapegraphaiClient.WithRawResponse {
diff --git a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/core/ClientOptions.kt b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/core/ClientOptions.kt
index 16cc411..73ef888 100644
--- a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/core/ClientOptions.kt
+++ b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/core/ClientOptions.kt
@@ -21,6 +21,8 @@ private constructor(
* The HTTP client to use in the SDK.
*
* Use the one published in `scrapegraphai-java-client-okhttp` or implement your own.
+ *
+ * This class takes ownership of the client and closes it when closed.
*/
@get:JvmName("httpClient") val httpClient: HttpClient,
/**
@@ -38,6 +40,16 @@ private constructor(
* rarely needs to be overridden.
*/
@get:JvmName("jsonMapper") val jsonMapper: JsonMapper,
+ /**
+ * The interface to use for delaying execution, like during retries.
+ *
+ * This is primarily useful for using fake delays in tests.
+ *
+ * Defaults to real execution delays.
+ *
+ * This class takes ownership of the sleeper and closes it when closed.
+ */
+ @get:JvmName("sleeper") val sleeper: Sleeper,
/**
* The clock to use for operations that require timing, like retries.
*
@@ -134,6 +146,7 @@ private constructor(
private var httpClient: HttpClient? = null
private var checkJacksonVersionCompatibility: Boolean = true
private var jsonMapper: JsonMapper = jsonMapper()
+ private var sleeper: Sleeper? = null
private var clock: Clock = Clock.systemUTC()
private var baseUrl: String? = null
private var headers: Headers.Builder = Headers.builder()
@@ -148,6 +161,7 @@ private constructor(
httpClient = clientOptions.originalHttpClient
checkJacksonVersionCompatibility = clientOptions.checkJacksonVersionCompatibility
jsonMapper = clientOptions.jsonMapper
+ sleeper = clientOptions.sleeper
clock = clientOptions.clock
baseUrl = clientOptions.baseUrl
headers = clientOptions.headers.toBuilder()
@@ -162,6 +176,8 @@ private constructor(
* The HTTP client to use in the SDK.
*
* Use the one published in `scrapegraphai-java-client-okhttp` or implement your own.
+ *
+ * This class takes ownership of the client and closes it when closed.
*/
fun httpClient(httpClient: HttpClient) = apply {
this.httpClient = PhantomReachableClosingHttpClient(httpClient)
@@ -186,6 +202,17 @@ private constructor(
*/
fun jsonMapper(jsonMapper: JsonMapper) = apply { this.jsonMapper = jsonMapper }
+ /**
+ * The interface to use for delaying execution, like during retries.
+ *
+ * This is primarily useful for using fake delays in tests.
+ *
+ * Defaults to real execution delays.
+ *
+ * This class takes ownership of the sleeper and closes it when closed.
+ */
+ fun sleeper(sleeper: Sleeper) = apply { this.sleeper = PhantomReachableSleeper(sleeper) }
+
/**
* The clock to use for operations that require timing, like retries.
*
@@ -374,6 +401,7 @@ private constructor(
*/
fun build(): ClientOptions {
val httpClient = checkRequired("httpClient", httpClient)
+ val sleeper = sleeper ?: PhantomReachableSleeper(DefaultSleeper())
val apiKey = checkRequired("apiKey", apiKey)
val headers = Headers.builder()
@@ -397,11 +425,13 @@ private constructor(
httpClient,
RetryingHttpClient.builder()
.httpClient(httpClient)
+ .sleeper(sleeper)
.clock(clock)
.maxRetries(maxRetries)
.build(),
checkJacksonVersionCompatibility,
jsonMapper,
+ sleeper,
clock,
baseUrl,
headers.build(),
@@ -413,4 +443,19 @@ private constructor(
)
}
}
+
+ /**
+ * Closes these client options, relinquishing any underlying resources.
+ *
+ * This is purposefully not inherited from [AutoCloseable] because the client options are
+ * long-lived and usually should not be synchronously closed via try-with-resources.
+ *
+ * It's also usually not necessary to call this method at all. the default client automatically
+ * releases threads and connections if they remain idle, but if you are writing an application
+ * that needs to aggressively release unused resources, then you may call this method.
+ */
+ fun close() {
+ httpClient.close()
+ sleeper.close()
+ }
}
diff --git a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/core/DefaultSleeper.kt b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/core/DefaultSleeper.kt
new file mode 100644
index 0000000..28ee198
--- /dev/null
+++ b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/core/DefaultSleeper.kt
@@ -0,0 +1,28 @@
+package com.scrapegraphai.api.core
+
+import java.time.Duration
+import java.util.Timer
+import java.util.TimerTask
+import java.util.concurrent.CompletableFuture
+
+class DefaultSleeper : Sleeper {
+
+ private val timer = Timer("DefaultSleeper", true)
+
+ override fun sleep(duration: Duration) = Thread.sleep(duration.toMillis())
+
+ override fun sleepAsync(duration: Duration): CompletableFuture {
+ val future = CompletableFuture()
+ timer.schedule(
+ object : TimerTask() {
+ override fun run() {
+ future.complete(null)
+ }
+ },
+ duration.toMillis(),
+ )
+ return future
+ }
+
+ override fun close() = timer.cancel()
+}
diff --git a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/core/PhantomReachableExecutorService.kt b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/core/PhantomReachableExecutorService.kt
new file mode 100644
index 0000000..401e601
--- /dev/null
+++ b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/core/PhantomReachableExecutorService.kt
@@ -0,0 +1,58 @@
+package com.scrapegraphai.api.core
+
+import java.util.concurrent.Callable
+import java.util.concurrent.ExecutorService
+import java.util.concurrent.Future
+import java.util.concurrent.TimeUnit
+
+/**
+ * A delegating wrapper around an [ExecutorService] that shuts it down once it's only phantom
+ * reachable.
+ *
+ * This class ensures the [ExecutorService] is shut down even if the user forgets to do it.
+ */
+internal class PhantomReachableExecutorService(private val executorService: ExecutorService) :
+ ExecutorService {
+ init {
+ closeWhenPhantomReachable(this) { executorService.shutdown() }
+ }
+
+ override fun execute(command: Runnable) = executorService.execute(command)
+
+ override fun shutdown() = executorService.shutdown()
+
+ override fun shutdownNow(): MutableList = executorService.shutdownNow()
+
+ override fun isShutdown(): Boolean = executorService.isShutdown
+
+ override fun isTerminated(): Boolean = executorService.isTerminated
+
+ override fun awaitTermination(timeout: Long, unit: TimeUnit): Boolean =
+ executorService.awaitTermination(timeout, unit)
+
+ override fun submit(task: Callable): Future = executorService.submit(task)
+
+ override fun submit(task: Runnable, result: T): Future =
+ executorService.submit(task, result)
+
+ override fun submit(task: Runnable): Future<*> = executorService.submit(task)
+
+ override fun invokeAll(
+ tasks: MutableCollection>
+ ): MutableList> = executorService.invokeAll(tasks)
+
+ override fun invokeAll(
+ tasks: MutableCollection>,
+ timeout: Long,
+ unit: TimeUnit,
+ ): MutableList> = executorService.invokeAll(tasks, timeout, unit)
+
+ override fun invokeAny(tasks: MutableCollection>): T =
+ executorService.invokeAny(tasks)
+
+ override fun invokeAny(
+ tasks: MutableCollection>,
+ timeout: Long,
+ unit: TimeUnit,
+ ): T = executorService.invokeAny(tasks, timeout, unit)
+}
diff --git a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/core/PhantomReachableSleeper.kt b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/core/PhantomReachableSleeper.kt
new file mode 100644
index 0000000..164612d
--- /dev/null
+++ b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/core/PhantomReachableSleeper.kt
@@ -0,0 +1,23 @@
+package com.scrapegraphai.api.core
+
+import java.time.Duration
+import java.util.concurrent.CompletableFuture
+
+/**
+ * A delegating wrapper around a [Sleeper] that closes it once it's only phantom reachable.
+ *
+ * This class ensures the [Sleeper] is closed even if the user forgets to do it.
+ */
+internal class PhantomReachableSleeper(private val sleeper: Sleeper) : Sleeper {
+
+ init {
+ closeWhenPhantomReachable(this, sleeper)
+ }
+
+ override fun sleep(duration: Duration) = sleeper.sleep(duration)
+
+ override fun sleepAsync(duration: Duration): CompletableFuture =
+ sleeper.sleepAsync(duration)
+
+ override fun close() = sleeper.close()
+}
diff --git a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/core/Properties.kt b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/core/Properties.kt
index 30222d5..fcf3b08 100644
--- a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/core/Properties.kt
+++ b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/core/Properties.kt
@@ -2,7 +2,7 @@
package com.scrapegraphai.api.core
-import java.util.Properties
+import com.scrapegraphai.api.client.ScrapegraphaiClient
fun getOsArch(): String {
val osArch = System.getProperty("os.arch")
@@ -16,7 +16,7 @@ fun getOsArch(): String {
"x86_64" -> "x64"
"arm" -> "arm"
"aarch64" -> "arm64"
- else -> "other:${osArch}"
+ else -> "other:$osArch"
}
}
@@ -30,13 +30,13 @@ fun getOsName(): String {
osName.startsWith("Linux") -> "Linux"
osName.startsWith("Mac OS") -> "MacOS"
osName.startsWith("Windows") -> "Windows"
- else -> "Other:${osName}"
+ else -> "Other:$osName"
}
}
fun getOsVersion(): String = System.getProperty("os.version", "unknown")
fun getPackageVersion(): String =
- Properties::class.java.`package`.implementationVersion ?: "unknown"
+ ScrapegraphaiClient::class.java.`package`.implementationVersion ?: "unknown"
fun getJavaVersion(): String = System.getProperty("java.version", "unknown")
diff --git a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/core/Sleeper.kt b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/core/Sleeper.kt
new file mode 100644
index 0000000..b97f11e
--- /dev/null
+++ b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/core/Sleeper.kt
@@ -0,0 +1,21 @@
+package com.scrapegraphai.api.core
+
+import java.time.Duration
+import java.util.concurrent.CompletableFuture
+
+/**
+ * An interface for delaying execution for a specified amount of time.
+ *
+ * Useful for testing and cleaning up resources.
+ */
+interface Sleeper : AutoCloseable {
+
+ /** Synchronously pauses execution for the given [duration]. */
+ fun sleep(duration: Duration)
+
+ /** Asynchronously pauses execution for the given [duration]. */
+ fun sleepAsync(duration: Duration): CompletableFuture
+
+ /** Overridden from [AutoCloseable] to not have a checked exception in its signature. */
+ override fun close()
+}
diff --git a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/core/Timeout.kt b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/core/Timeout.kt
index fdc209d..b9469fe 100644
--- a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/core/Timeout.kt
+++ b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/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/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/core/http/RetryingHttpClient.kt b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/core/http/RetryingHttpClient.kt
index bf1362a..f1ef3ae 100644
--- a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/core/http/RetryingHttpClient.kt
+++ b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/core/http/RetryingHttpClient.kt
@@ -1,6 +1,8 @@
package com.scrapegraphai.api.core.http
+import com.scrapegraphai.api.core.DefaultSleeper
import com.scrapegraphai.api.core.RequestOptions
+import com.scrapegraphai.api.core.Sleeper
import com.scrapegraphai.api.core.checkRequired
import com.scrapegraphai.api.errors.ScrapegraphaiIoException
import com.scrapegraphai.api.errors.ScrapegraphaiRetryableException
@@ -11,8 +13,6 @@ import java.time.OffsetDateTime
import java.time.format.DateTimeFormatter
import java.time.format.DateTimeParseException
import java.time.temporal.ChronoUnit
-import java.util.Timer
-import java.util.TimerTask
import java.util.UUID
import java.util.concurrent.CompletableFuture
import java.util.concurrent.ThreadLocalRandom
@@ -130,7 +130,10 @@ private constructor(
return executeWithRetries(modifiedRequest, requestOptions)
}
- override fun close() = httpClient.close()
+ override fun close() {
+ httpClient.close()
+ sleeper.close()
+ }
private fun isRetryable(request: HttpRequest): Boolean =
// Some requests, such as when a request body is being streamed, cannot be retried because
@@ -235,33 +238,14 @@ private constructor(
class Builder internal constructor() {
private var httpClient: HttpClient? = null
- private var sleeper: Sleeper =
- object : Sleeper {
-
- private val timer = Timer("RetryingHttpClient", true)
-
- override fun sleep(duration: Duration) = Thread.sleep(duration.toMillis())
-
- override fun sleepAsync(duration: Duration): CompletableFuture {
- val future = CompletableFuture()
- timer.schedule(
- object : TimerTask() {
- override fun run() {
- future.complete(null)
- }
- },
- duration.toMillis(),
- )
- return future
- }
- }
+ private var sleeper: Sleeper? = null
private var clock: Clock = Clock.systemUTC()
private var maxRetries: Int = 2
private var idempotencyHeader: String? = null
fun httpClient(httpClient: HttpClient) = apply { this.httpClient = httpClient }
- @JvmSynthetic internal fun sleeper(sleeper: Sleeper) = apply { this.sleeper = sleeper }
+ fun sleeper(sleeper: Sleeper) = apply { this.sleeper = sleeper }
fun clock(clock: Clock) = apply { this.clock = clock }
@@ -272,17 +256,10 @@ private constructor(
fun build(): HttpClient =
RetryingHttpClient(
checkRequired("httpClient", httpClient),
- sleeper,
+ sleeper ?: DefaultSleeper(),
clock,
maxRetries,
idempotencyHeader,
)
}
-
- internal interface Sleeper {
-
- fun sleep(duration: Duration)
-
- fun sleepAsync(duration: Duration): CompletableFuture
- }
}
diff --git a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/crawl/CrawlRetrieveResultsParams.kt b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/crawl/CrawlRetrieveResultsParams.kt
index caf81a9..12211cc 100644
--- a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/crawl/CrawlRetrieveResultsParams.kt
+++ b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/crawl/CrawlRetrieveResultsParams.kt
@@ -182,10 +182,13 @@ private constructor(
return true
}
- return /* spotless:off */ other is CrawlRetrieveResultsParams && taskId == other.taskId && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams /* spotless:on */
+ return other is CrawlRetrieveResultsParams &&
+ taskId == other.taskId &&
+ additionalHeaders == other.additionalHeaders &&
+ additionalQueryParams == other.additionalQueryParams
}
- override fun hashCode(): Int = /* spotless:off */ Objects.hash(taskId, additionalHeaders, additionalQueryParams) /* spotless:on */
+ override fun hashCode(): Int = Objects.hash(taskId, additionalHeaders, additionalQueryParams)
override fun toString() =
"CrawlRetrieveResultsParams{taskId=$taskId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}"
diff --git a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/crawl/CrawlRetrieveResultsResponse.kt b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/crawl/CrawlRetrieveResultsResponse.kt
index bb9abd5..d2e70b8 100644
--- a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/crawl/CrawlRetrieveResultsResponse.kt
+++ b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/crawl/CrawlRetrieveResultsResponse.kt
@@ -29,6 +29,7 @@ import java.util.Optional
import kotlin.jvm.optionals.getOrNull
class CrawlRetrieveResultsResponse
+@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val result: JsonField,
private val status: JsonField,
@@ -342,10 +343,10 @@ private constructor(
return true
}
- return /* spotless:off */ other is Result && jsonValue == other.jsonValue && string == other.string /* spotless:on */
+ return other is Result && jsonValue == other.jsonValue && string == other.string
}
- override fun hashCode(): Int = /* spotless:off */ Objects.hash(jsonValue, string) /* spotless:on */
+ override fun hashCode(): Int = Objects.hash(jsonValue, string)
override fun toString(): String =
when {
@@ -578,7 +579,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()
@@ -591,12 +592,17 @@ private constructor(
return true
}
- return /* spotless:off */ other is CrawlRetrieveResultsResponse && result == other.result && status == other.status && taskId == other.taskId && traceback == other.traceback && additionalProperties == other.additionalProperties /* spotless:on */
+ return other is CrawlRetrieveResultsResponse &&
+ result == other.result &&
+ status == other.status &&
+ taskId == other.taskId &&
+ traceback == other.traceback &&
+ additionalProperties == other.additionalProperties
}
- /* spotless:off */
- private val hashCode: Int by lazy { Objects.hash(result, status, taskId, traceback, additionalProperties) }
- /* spotless:on */
+ private val hashCode: Int by lazy {
+ Objects.hash(result, status, taskId, traceback, additionalProperties)
+ }
override fun hashCode(): Int = hashCode
diff --git a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/crawl/CrawlStartParams.kt b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/crawl/CrawlStartParams.kt
index ad5dcef..491d928 100644
--- a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/crawl/CrawlStartParams.kt
+++ b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/crawl/CrawlStartParams.kt
@@ -444,6 +444,7 @@ private constructor(
override fun _queryParams(): QueryParams = additionalQueryParams
class Body
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val url: JsonField,
private val depth: JsonField,
@@ -865,12 +866,33 @@ private constructor(
return true
}
- return /* spotless:off */ other is Body && url == other.url && depth == other.depth && extractionMode == other.extractionMode && maxPages == other.maxPages && prompt == other.prompt && renderHeavyJs == other.renderHeavyJs && rules == other.rules && schema == other.schema && sitemap == other.sitemap && additionalProperties == other.additionalProperties /* spotless:on */
+ return other is Body &&
+ url == other.url &&
+ depth == other.depth &&
+ extractionMode == other.extractionMode &&
+ maxPages == other.maxPages &&
+ prompt == other.prompt &&
+ renderHeavyJs == other.renderHeavyJs &&
+ rules == other.rules &&
+ schema == other.schema &&
+ sitemap == other.sitemap &&
+ additionalProperties == other.additionalProperties
}
- /* spotless:off */
- private val hashCode: Int by lazy { Objects.hash(url, depth, extractionMode, maxPages, prompt, renderHeavyJs, rules, schema, sitemap, additionalProperties) }
- /* spotless:on */
+ private val hashCode: Int by lazy {
+ Objects.hash(
+ url,
+ depth,
+ extractionMode,
+ maxPages,
+ prompt,
+ renderHeavyJs,
+ rules,
+ schema,
+ sitemap,
+ additionalProperties,
+ )
+ }
override fun hashCode(): Int = hashCode
@@ -879,6 +901,7 @@ private constructor(
}
class Rules
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val exclude: JsonField>,
private val sameDomain: JsonField,
@@ -1065,12 +1088,15 @@ private constructor(
return true
}
- return /* spotless:off */ other is Rules && exclude == other.exclude && sameDomain == other.sameDomain && additionalProperties == other.additionalProperties /* spotless:on */
+ return other is Rules &&
+ exclude == other.exclude &&
+ sameDomain == other.sameDomain &&
+ additionalProperties == other.additionalProperties
}
- /* spotless:off */
- private val hashCode: Int by lazy { Objects.hash(exclude, sameDomain, additionalProperties) }
- /* spotless:on */
+ private val hashCode: Int by lazy {
+ Objects.hash(exclude, sameDomain, additionalProperties)
+ }
override fun hashCode(): Int = hashCode
@@ -1083,10 +1109,13 @@ private constructor(
return true
}
- return /* spotless:off */ other is CrawlStartParams && body == other.body && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams /* spotless:on */
+ return other is CrawlStartParams &&
+ 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() =
"CrawlStartParams{body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}"
diff --git a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/crawl/CrawlStartResponse.kt b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/crawl/CrawlStartResponse.kt
index d1fe021..fa9ba43 100644
--- a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/crawl/CrawlStartResponse.kt
+++ b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/crawl/CrawlStartResponse.kt
@@ -16,6 +16,7 @@ import java.util.Objects
import java.util.Optional
class CrawlStartResponse
+@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val taskId: JsonField,
private val additionalProperties: MutableMap,
@@ -141,12 +142,12 @@ private constructor(
return true
}
- return /* spotless:off */ other is CrawlStartResponse && taskId == other.taskId && additionalProperties == other.additionalProperties /* spotless:on */
+ return other is CrawlStartResponse &&
+ taskId == other.taskId &&
+ additionalProperties == other.additionalProperties
}
- /* spotless:off */
private val hashCode: Int by lazy { Objects.hash(taskId, additionalProperties) }
- /* spotless:on */
override fun hashCode(): Int = hashCode
diff --git a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/credits/CreditRetrieveParams.kt b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/credits/CreditRetrieveParams.kt
index 9e67ba1..c3713d7 100644
--- a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/credits/CreditRetrieveParams.kt
+++ b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/credits/CreditRetrieveParams.kt
@@ -158,10 +158,12 @@ private constructor(
return true
}
- return /* spotless:off */ other is CreditRetrieveParams && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams /* spotless:on */
+ return other is CreditRetrieveParams &&
+ 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() =
"CreditRetrieveParams{additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}"
diff --git a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/credits/CreditRetrieveResponse.kt b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/credits/CreditRetrieveResponse.kt
index 4cc086f..254e1c8 100644
--- a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/credits/CreditRetrieveResponse.kt
+++ b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/credits/CreditRetrieveResponse.kt
@@ -16,6 +16,7 @@ import java.util.Objects
import java.util.Optional
class CreditRetrieveResponse
+@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val remainingCredits: JsonField,
private val totalCreditsUsed: JsonField,
@@ -197,12 +198,15 @@ private constructor(
return true
}
- return /* spotless:off */ other is CreditRetrieveResponse && remainingCredits == other.remainingCredits && totalCreditsUsed == other.totalCreditsUsed && additionalProperties == other.additionalProperties /* spotless:on */
+ return other is CreditRetrieveResponse &&
+ remainingCredits == other.remainingCredits &&
+ totalCreditsUsed == other.totalCreditsUsed &&
+ additionalProperties == other.additionalProperties
}
- /* spotless:off */
- private val hashCode: Int by lazy { Objects.hash(remainingCredits, totalCreditsUsed, additionalProperties) }
- /* spotless:on */
+ private val hashCode: Int by lazy {
+ Objects.hash(remainingCredits, totalCreditsUsed, additionalProperties)
+ }
override fun hashCode(): Int = hashCode
diff --git a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/feedback/FeedbackSubmitParams.kt b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/feedback/FeedbackSubmitParams.kt
index 1f44b55..65c4ff4 100644
--- a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/feedback/FeedbackSubmitParams.kt
+++ b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/feedback/FeedbackSubmitParams.kt
@@ -307,6 +307,7 @@ private constructor(
override fun _queryParams(): QueryParams = additionalQueryParams
class Body
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val rating: JsonField,
private val requestId: JsonField,
@@ -537,12 +538,16 @@ private constructor(
return true
}
- return /* spotless:off */ other is Body && rating == other.rating && requestId == other.requestId && feedbackText == other.feedbackText && additionalProperties == other.additionalProperties /* spotless:on */
+ return other is Body &&
+ rating == other.rating &&
+ requestId == other.requestId &&
+ feedbackText == other.feedbackText &&
+ additionalProperties == other.additionalProperties
}
- /* spotless:off */
- private val hashCode: Int by lazy { Objects.hash(rating, requestId, feedbackText, additionalProperties) }
- /* spotless:on */
+ private val hashCode: Int by lazy {
+ Objects.hash(rating, requestId, feedbackText, additionalProperties)
+ }
override fun hashCode(): Int = hashCode
@@ -555,10 +560,13 @@ private constructor(
return true
}
- return /* spotless:off */ other is FeedbackSubmitParams && body == other.body && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams /* spotless:on */
+ return other is FeedbackSubmitParams &&
+ 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() =
"FeedbackSubmitParams{body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}"
diff --git a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/feedback/FeedbackSubmitResponse.kt b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/feedback/FeedbackSubmitResponse.kt
index 15653ce..98b3898 100644
--- a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/feedback/FeedbackSubmitResponse.kt
+++ b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/feedback/FeedbackSubmitResponse.kt
@@ -17,6 +17,7 @@ import java.util.Objects
import java.util.Optional
class FeedbackSubmitResponse
+@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val feedbackId: JsonField,
private val feedbackTimestamp: JsonField,
@@ -248,12 +249,17 @@ private constructor(
return true
}
- return /* spotless:off */ other is FeedbackSubmitResponse && feedbackId == other.feedbackId && feedbackTimestamp == other.feedbackTimestamp && message == other.message && requestId == other.requestId && additionalProperties == other.additionalProperties /* spotless:on */
+ return other is FeedbackSubmitResponse &&
+ feedbackId == other.feedbackId &&
+ feedbackTimestamp == other.feedbackTimestamp &&
+ message == other.message &&
+ requestId == other.requestId &&
+ additionalProperties == other.additionalProperties
}
- /* spotless:off */
- private val hashCode: Int by lazy { Objects.hash(feedbackId, feedbackTimestamp, message, requestId, additionalProperties) }
- /* spotless:on */
+ private val hashCode: Int by lazy {
+ Objects.hash(feedbackId, feedbackTimestamp, message, requestId, additionalProperties)
+ }
override fun hashCode(): Int = hashCode
diff --git a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/generateschema/GenerateSchemaCreateParams.kt b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/generateschema/GenerateSchemaCreateParams.kt
index 547dd12..4678306 100644
--- a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/generateschema/GenerateSchemaCreateParams.kt
+++ b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/generateschema/GenerateSchemaCreateParams.kt
@@ -255,6 +255,7 @@ private constructor(
override fun _queryParams(): QueryParams = additionalQueryParams
class Body
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val userPrompt: JsonField,
private val existingSchema: JsonValue,
@@ -420,12 +421,15 @@ private constructor(
return true
}
- return /* spotless:off */ other is Body && userPrompt == other.userPrompt && existingSchema == other.existingSchema && additionalProperties == other.additionalProperties /* spotless:on */
+ return other is Body &&
+ userPrompt == other.userPrompt &&
+ existingSchema == other.existingSchema &&
+ additionalProperties == other.additionalProperties
}
- /* spotless:off */
- private val hashCode: Int by lazy { Objects.hash(userPrompt, existingSchema, additionalProperties) }
- /* spotless:on */
+ private val hashCode: Int by lazy {
+ Objects.hash(userPrompt, existingSchema, additionalProperties)
+ }
override fun hashCode(): Int = hashCode
@@ -438,10 +442,13 @@ private constructor(
return true
}
- return /* spotless:off */ other is GenerateSchemaCreateParams && body == other.body && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams /* spotless:on */
+ return other is GenerateSchemaCreateParams &&
+ 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() =
"GenerateSchemaCreateParams{body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}"
diff --git a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/generateschema/GenerateSchemaCreateResponse.kt b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/generateschema/GenerateSchemaCreateResponse.kt
index 1cce93c..321437a 100644
--- a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/generateschema/GenerateSchemaCreateResponse.kt
+++ b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/generateschema/GenerateSchemaCreateResponse.kt
@@ -18,6 +18,7 @@ import java.util.Optional
import kotlin.jvm.optionals.getOrNull
class GenerateSchemaCreateResponse
+@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val error: JsonField,
private val generatedSchema: JsonValue,
@@ -409,7 +410,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()
@@ -422,12 +423,27 @@ private constructor(
return true
}
- return /* spotless:off */ other is GenerateSchemaCreateResponse && error == other.error && generatedSchema == other.generatedSchema && refinedPrompt == other.refinedPrompt && requestId == other.requestId && status == other.status && userPrompt == other.userPrompt && additionalProperties == other.additionalProperties /* spotless:on */
+ return other is GenerateSchemaCreateResponse &&
+ error == other.error &&
+ generatedSchema == other.generatedSchema &&
+ refinedPrompt == other.refinedPrompt &&
+ requestId == other.requestId &&
+ status == other.status &&
+ userPrompt == other.userPrompt &&
+ additionalProperties == other.additionalProperties
}
- /* spotless:off */
- private val hashCode: Int by lazy { Objects.hash(error, generatedSchema, refinedPrompt, requestId, status, userPrompt, additionalProperties) }
- /* spotless:on */
+ private val hashCode: Int by lazy {
+ Objects.hash(
+ error,
+ generatedSchema,
+ refinedPrompt,
+ requestId,
+ status,
+ userPrompt,
+ additionalProperties,
+ )
+ }
override fun hashCode(): Int = hashCode
diff --git a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/generateschema/GenerateSchemaRetrieveParams.kt b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/generateschema/GenerateSchemaRetrieveParams.kt
index c4396a3..bb08721 100644
--- a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/generateschema/GenerateSchemaRetrieveParams.kt
+++ b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/generateschema/GenerateSchemaRetrieveParams.kt
@@ -182,10 +182,13 @@ private constructor(
return true
}
- return /* spotless:off */ other is GenerateSchemaRetrieveParams && requestId == other.requestId && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams /* spotless:on */
+ return other is GenerateSchemaRetrieveParams &&
+ requestId == other.requestId &&
+ additionalHeaders == other.additionalHeaders &&
+ additionalQueryParams == other.additionalQueryParams
}
- override fun hashCode(): Int = /* spotless:off */ Objects.hash(requestId, additionalHeaders, additionalQueryParams) /* spotless:on */
+ override fun hashCode(): Int = Objects.hash(requestId, additionalHeaders, additionalQueryParams)
override fun toString() =
"GenerateSchemaRetrieveParams{requestId=$requestId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}"
diff --git a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/generateschema/GenerateSchemaRetrieveResponse.kt b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/generateschema/GenerateSchemaRetrieveResponse.kt
index ccc296d..4bba8a6 100644
--- a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/generateschema/GenerateSchemaRetrieveResponse.kt
+++ b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/generateschema/GenerateSchemaRetrieveResponse.kt
@@ -123,10 +123,12 @@ private constructor(
return true
}
- return /* spotless:off */ other is GenerateSchemaRetrieveResponse && completedSchemaGeneration == other.completedSchemaGeneration && failedSchemaGeneration == other.failedSchemaGeneration /* spotless:on */
+ return other is GenerateSchemaRetrieveResponse &&
+ completedSchemaGeneration == other.completedSchemaGeneration &&
+ failedSchemaGeneration == other.failedSchemaGeneration
}
- override fun hashCode(): Int = /* spotless:off */ Objects.hash(completedSchemaGeneration, failedSchemaGeneration) /* spotless:on */
+ override fun hashCode(): Int = Objects.hash(completedSchemaGeneration, failedSchemaGeneration)
override fun toString(): String =
when {
@@ -235,6 +237,7 @@ private constructor(
}
class CompletedSchemaGenerationResponse
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val error: JsonField,
private val generatedSchema: JsonValue,
@@ -643,7 +646,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()
@@ -656,12 +659,27 @@ private constructor(
return true
}
- return /* spotless:off */ other is CompletedSchemaGenerationResponse && error == other.error && generatedSchema == other.generatedSchema && refinedPrompt == other.refinedPrompt && requestId == other.requestId && status == other.status && userPrompt == other.userPrompt && additionalProperties == other.additionalProperties /* spotless:on */
+ return other is CompletedSchemaGenerationResponse &&
+ error == other.error &&
+ generatedSchema == other.generatedSchema &&
+ refinedPrompt == other.refinedPrompt &&
+ requestId == other.requestId &&
+ status == other.status &&
+ userPrompt == other.userPrompt &&
+ additionalProperties == other.additionalProperties
}
- /* spotless:off */
- private val hashCode: Int by lazy { Objects.hash(error, generatedSchema, refinedPrompt, requestId, status, userPrompt, additionalProperties) }
- /* spotless:on */
+ private val hashCode: Int by lazy {
+ Objects.hash(
+ error,
+ generatedSchema,
+ refinedPrompt,
+ requestId,
+ status,
+ userPrompt,
+ additionalProperties,
+ )
+ }
override fun hashCode(): Int = hashCode
@@ -670,6 +688,7 @@ private constructor(
}
class FailedSchemaGenerationResponse
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val error: JsonField,
private val generatedSchema: JsonValue,
@@ -1079,7 +1098,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()
@@ -1092,12 +1111,27 @@ private constructor(
return true
}
- return /* spotless:off */ other is FailedSchemaGenerationResponse && error == other.error && generatedSchema == other.generatedSchema && refinedPrompt == other.refinedPrompt && requestId == other.requestId && status == other.status && userPrompt == other.userPrompt && additionalProperties == other.additionalProperties /* spotless:on */
+ return other is FailedSchemaGenerationResponse &&
+ error == other.error &&
+ generatedSchema == other.generatedSchema &&
+ refinedPrompt == other.refinedPrompt &&
+ requestId == other.requestId &&
+ status == other.status &&
+ userPrompt == other.userPrompt &&
+ additionalProperties == other.additionalProperties
}
- /* spotless:off */
- private val hashCode: Int by lazy { Objects.hash(error, generatedSchema, refinedPrompt, requestId, status, userPrompt, additionalProperties) }
- /* spotless:on */
+ private val hashCode: Int by lazy {
+ Objects.hash(
+ error,
+ generatedSchema,
+ refinedPrompt,
+ requestId,
+ status,
+ userPrompt,
+ additionalProperties,
+ )
+ }
override fun hashCode(): Int = hashCode
diff --git a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/healthz/HealthzCheckParams.kt b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/healthz/HealthzCheckParams.kt
index aec4a7f..e642d48 100644
--- a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/healthz/HealthzCheckParams.kt
+++ b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/healthz/HealthzCheckParams.kt
@@ -158,10 +158,12 @@ private constructor(
return true
}
- return /* spotless:off */ other is HealthzCheckParams && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams /* spotless:on */
+ return other is HealthzCheckParams &&
+ 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() =
"HealthzCheckParams{additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}"
diff --git a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/healthz/HealthzCheckResponse.kt b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/healthz/HealthzCheckResponse.kt
index 9112276..73fb976 100644
--- a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/healthz/HealthzCheckResponse.kt
+++ b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/healthz/HealthzCheckResponse.kt
@@ -18,6 +18,7 @@ import java.util.Optional
import kotlin.jvm.optionals.getOrNull
class HealthzCheckResponse
+@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val services: JsonField,
private val status: JsonField,
@@ -256,12 +257,10 @@ private constructor(
return true
}
- return /* spotless:off */ other is Services && additionalProperties == other.additionalProperties /* spotless:on */
+ return other is Services && additionalProperties == other.additionalProperties
}
- /* spotless:off */
private val hashCode: Int by lazy { Objects.hash(additionalProperties) }
- /* spotless:on */
override fun hashCode(): Int = hashCode
@@ -273,12 +272,13 @@ private constructor(
return true
}
- return /* spotless:off */ other is HealthzCheckResponse && services == other.services && status == other.status && additionalProperties == other.additionalProperties /* spotless:on */
+ return other is HealthzCheckResponse &&
+ services == other.services &&
+ status == other.status &&
+ additionalProperties == other.additionalProperties
}
- /* spotless:off */
private val hashCode: Int by lazy { Objects.hash(services, status, additionalProperties) }
- /* spotless:on */
override fun hashCode(): Int = hashCode
diff --git a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/markdownify/CompletedMarkdownify.kt b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/markdownify/CompletedMarkdownify.kt
index b26c1c8..c2311c2 100644
--- a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/markdownify/CompletedMarkdownify.kt
+++ b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/markdownify/CompletedMarkdownify.kt
@@ -18,6 +18,7 @@ import java.util.Optional
import kotlin.jvm.optionals.getOrNull
class CompletedMarkdownify
+@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val error: JsonField,
private val requestId: JsonField,
@@ -395,7 +396,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()
@@ -408,12 +409,18 @@ private constructor(
return true
}
- return /* spotless:off */ other is CompletedMarkdownify && error == other.error && requestId == other.requestId && result == other.result && status == other.status && websiteUrl == other.websiteUrl && additionalProperties == other.additionalProperties /* spotless:on */
+ return other is CompletedMarkdownify &&
+ error == other.error &&
+ requestId == other.requestId &&
+ result == other.result &&
+ status == other.status &&
+ websiteUrl == other.websiteUrl &&
+ additionalProperties == other.additionalProperties
}
- /* spotless:off */
- private val hashCode: Int by lazy { Objects.hash(error, requestId, result, status, websiteUrl, additionalProperties) }
- /* spotless:on */
+ private val hashCode: Int by lazy {
+ Objects.hash(error, requestId, result, status, websiteUrl, additionalProperties)
+ }
override fun hashCode(): Int = hashCode
diff --git a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/markdownify/MarkdownifyConvertParams.kt b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/markdownify/MarkdownifyConvertParams.kt
index aafcdcc..de3b5bc 100644
--- a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/markdownify/MarkdownifyConvertParams.kt
+++ b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/markdownify/MarkdownifyConvertParams.kt
@@ -306,6 +306,7 @@ private constructor(
override fun _queryParams(): QueryParams = additionalQueryParams
class Body
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val websiteUrl: JsonField,
private val headers: JsonField,
@@ -535,12 +536,16 @@ private constructor(
return true
}
- return /* spotless:off */ other is Body && websiteUrl == other.websiteUrl && headers == other.headers && steps == other.steps && additionalProperties == other.additionalProperties /* spotless:on */
+ return other is Body &&
+ websiteUrl == other.websiteUrl &&
+ headers == other.headers &&
+ steps == other.steps &&
+ additionalProperties == other.additionalProperties
}
- /* spotless:off */
- private val hashCode: Int by lazy { Objects.hash(websiteUrl, headers, steps, additionalProperties) }
- /* spotless:on */
+ private val hashCode: Int by lazy {
+ Objects.hash(websiteUrl, headers, steps, additionalProperties)
+ }
override fun hashCode(): Int = hashCode
@@ -637,12 +642,10 @@ private constructor(
return true
}
- return /* spotless:off */ other is Headers && additionalProperties == other.additionalProperties /* spotless:on */
+ return other is Headers && additionalProperties == other.additionalProperties
}
- /* spotless:off */
private val hashCode: Int by lazy { Objects.hash(additionalProperties) }
- /* spotless:on */
override fun hashCode(): Int = hashCode
@@ -654,10 +657,13 @@ private constructor(
return true
}
- return /* spotless:off */ other is MarkdownifyConvertParams && body == other.body && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams /* spotless:on */
+ return other is MarkdownifyConvertParams &&
+ 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() =
"MarkdownifyConvertParams{body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}"
diff --git a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/markdownify/MarkdownifyRetrieveStatusParams.kt b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/markdownify/MarkdownifyRetrieveStatusParams.kt
index 5c1b65b..5a0e03b 100644
--- a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/markdownify/MarkdownifyRetrieveStatusParams.kt
+++ b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/markdownify/MarkdownifyRetrieveStatusParams.kt
@@ -185,10 +185,13 @@ private constructor(
return true
}
- return /* spotless:off */ other is MarkdownifyRetrieveStatusParams && requestId == other.requestId && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams /* spotless:on */
+ return other is MarkdownifyRetrieveStatusParams &&
+ requestId == other.requestId &&
+ additionalHeaders == other.additionalHeaders &&
+ additionalQueryParams == other.additionalQueryParams
}
- override fun hashCode(): Int = /* spotless:off */ Objects.hash(requestId, additionalHeaders, additionalQueryParams) /* spotless:on */
+ override fun hashCode(): Int = Objects.hash(requestId, additionalHeaders, additionalQueryParams)
override fun toString() =
"MarkdownifyRetrieveStatusParams{requestId=$requestId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}"
diff --git a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/markdownify/MarkdownifyRetrieveStatusResponse.kt b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/markdownify/MarkdownifyRetrieveStatusResponse.kt
index f552cb4..251aeae 100644
--- a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/markdownify/MarkdownifyRetrieveStatusResponse.kt
+++ b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/markdownify/MarkdownifyRetrieveStatusResponse.kt
@@ -115,10 +115,12 @@ private constructor(
return true
}
- return /* spotless:off */ other is MarkdownifyRetrieveStatusResponse && completedMarkdownify == other.completedMarkdownify && failedMarkdownify == other.failedMarkdownify /* spotless:on */
+ return other is MarkdownifyRetrieveStatusResponse &&
+ completedMarkdownify == other.completedMarkdownify &&
+ failedMarkdownify == other.failedMarkdownify
}
- override fun hashCode(): Int = /* spotless:off */ Objects.hash(completedMarkdownify, failedMarkdownify) /* spotless:on */
+ override fun hashCode(): Int = Objects.hash(completedMarkdownify, failedMarkdownify)
override fun toString(): String =
when {
@@ -224,6 +226,7 @@ private constructor(
}
class FailedMarkdownifyResponse
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val error: JsonField,
private val requestId: JsonField,
@@ -599,7 +602,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()
@@ -612,12 +615,18 @@ private constructor(
return true
}
- return /* spotless:off */ other is FailedMarkdownifyResponse && error == other.error && requestId == other.requestId && result == other.result && status == other.status && websiteUrl == other.websiteUrl && additionalProperties == other.additionalProperties /* spotless:on */
+ return other is FailedMarkdownifyResponse &&
+ error == other.error &&
+ requestId == other.requestId &&
+ result == other.result &&
+ status == other.status &&
+ websiteUrl == other.websiteUrl &&
+ additionalProperties == other.additionalProperties
}
- /* spotless:off */
- private val hashCode: Int by lazy { Objects.hash(error, requestId, result, status, websiteUrl, additionalProperties) }
- /* spotless:on */
+ private val hashCode: Int by lazy {
+ Objects.hash(error, requestId, result, status, websiteUrl, additionalProperties)
+ }
override fun hashCode(): Int = hashCode
diff --git a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/searchscraper/CompletedSearchScraper.kt b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/searchscraper/CompletedSearchScraper.kt
index 30dc9c0..da2e6e2 100644
--- a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/searchscraper/CompletedSearchScraper.kt
+++ b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/searchscraper/CompletedSearchScraper.kt
@@ -20,6 +20,7 @@ import java.util.Optional
import kotlin.jvm.optionals.getOrNull
class CompletedSearchScraper
+@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val error: JsonField,
private val numResults: JsonField,
@@ -466,7 +467,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()
@@ -479,12 +480,29 @@ private constructor(
return true
}
- return /* spotless:off */ other is CompletedSearchScraper && error == other.error && numResults == other.numResults && referenceUrls == other.referenceUrls && requestId == other.requestId && result == other.result && status == other.status && userPrompt == other.userPrompt && additionalProperties == other.additionalProperties /* spotless:on */
+ return other is CompletedSearchScraper &&
+ error == other.error &&
+ numResults == other.numResults &&
+ referenceUrls == other.referenceUrls &&
+ requestId == other.requestId &&
+ result == other.result &&
+ status == other.status &&
+ userPrompt == other.userPrompt &&
+ additionalProperties == other.additionalProperties
}
- /* spotless:off */
- private val hashCode: Int by lazy { Objects.hash(error, numResults, referenceUrls, requestId, result, status, userPrompt, additionalProperties) }
- /* spotless:on */
+ private val hashCode: Int by lazy {
+ Objects.hash(
+ error,
+ numResults,
+ referenceUrls,
+ requestId,
+ result,
+ status,
+ userPrompt,
+ additionalProperties,
+ )
+ }
override fun hashCode(): Int = hashCode
diff --git a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/searchscraper/SearchscraperCreateParams.kt b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/searchscraper/SearchscraperCreateParams.kt
index 1298623..c66ac9b 100644
--- a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/searchscraper/SearchscraperCreateParams.kt
+++ b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/searchscraper/SearchscraperCreateParams.kt
@@ -307,6 +307,7 @@ private constructor(
override fun _queryParams(): QueryParams = additionalQueryParams
class Body
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val userPrompt: JsonField,
private val headers: JsonField,
@@ -537,12 +538,17 @@ private constructor(
return true
}
- return /* spotless:off */ other is Body && userPrompt == other.userPrompt && headers == other.headers && numResults == other.numResults && outputSchema == other.outputSchema && additionalProperties == other.additionalProperties /* spotless:on */
+ return other is Body &&
+ userPrompt == other.userPrompt &&
+ headers == other.headers &&
+ numResults == other.numResults &&
+ outputSchema == other.outputSchema &&
+ additionalProperties == other.additionalProperties
}
- /* spotless:off */
- private val hashCode: Int by lazy { Objects.hash(userPrompt, headers, numResults, outputSchema, additionalProperties) }
- /* spotless:on */
+ private val hashCode: Int by lazy {
+ Objects.hash(userPrompt, headers, numResults, outputSchema, additionalProperties)
+ }
override fun hashCode(): Int = hashCode
@@ -639,12 +645,10 @@ private constructor(
return true
}
- return /* spotless:off */ other is Headers && additionalProperties == other.additionalProperties /* spotless:on */
+ return other is Headers && additionalProperties == other.additionalProperties
}
- /* spotless:off */
private val hashCode: Int by lazy { Objects.hash(additionalProperties) }
- /* spotless:on */
override fun hashCode(): Int = hashCode
@@ -656,10 +660,13 @@ private constructor(
return true
}
- return /* spotless:off */ other is SearchscraperCreateParams && body == other.body && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams /* spotless:on */
+ return other is SearchscraperCreateParams &&
+ 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() =
"SearchscraperCreateParams{body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}"
diff --git a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/searchscraper/SearchscraperRetrieveStatusParams.kt b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/searchscraper/SearchscraperRetrieveStatusParams.kt
index 1e8c091..8fe6310 100644
--- a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/searchscraper/SearchscraperRetrieveStatusParams.kt
+++ b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/searchscraper/SearchscraperRetrieveStatusParams.kt
@@ -185,10 +185,13 @@ private constructor(
return true
}
- return /* spotless:off */ other is SearchscraperRetrieveStatusParams && requestId == other.requestId && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams /* spotless:on */
+ return other is SearchscraperRetrieveStatusParams &&
+ requestId == other.requestId &&
+ additionalHeaders == other.additionalHeaders &&
+ additionalQueryParams == other.additionalQueryParams
}
- override fun hashCode(): Int = /* spotless:off */ Objects.hash(requestId, additionalHeaders, additionalQueryParams) /* spotless:on */
+ override fun hashCode(): Int = Objects.hash(requestId, additionalHeaders, additionalQueryParams)
override fun toString() =
"SearchscraperRetrieveStatusParams{requestId=$requestId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}"
diff --git a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/searchscraper/SearchscraperRetrieveStatusResponse.kt b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/searchscraper/SearchscraperRetrieveStatusResponse.kt
index aa8a8ac..74162af 100644
--- a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/searchscraper/SearchscraperRetrieveStatusResponse.kt
+++ b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/searchscraper/SearchscraperRetrieveStatusResponse.kt
@@ -124,10 +124,12 @@ private constructor(
return true
}
- return /* spotless:off */ other is SearchscraperRetrieveStatusResponse && completedSearchScraper == other.completedSearchScraper && failedSearchScraper == other.failedSearchScraper /* spotless:on */
+ return other is SearchscraperRetrieveStatusResponse &&
+ completedSearchScraper == other.completedSearchScraper &&
+ failedSearchScraper == other.failedSearchScraper
}
- override fun hashCode(): Int = /* spotless:off */ Objects.hash(completedSearchScraper, failedSearchScraper) /* spotless:on */
+ override fun hashCode(): Int = Objects.hash(completedSearchScraper, failedSearchScraper)
override fun toString(): String =
when {
@@ -237,6 +239,7 @@ private constructor(
}
class FailedSearchScraperResponse
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val error: JsonField,
private val numResults: JsonField,
@@ -681,7 +684,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()
@@ -694,12 +697,29 @@ private constructor(
return true
}
- return /* spotless:off */ other is FailedSearchScraperResponse && error == other.error && numResults == other.numResults && referenceUrls == other.referenceUrls && requestId == other.requestId && result == other.result && status == other.status && userPrompt == other.userPrompt && additionalProperties == other.additionalProperties /* spotless:on */
+ return other is FailedSearchScraperResponse &&
+ error == other.error &&
+ numResults == other.numResults &&
+ referenceUrls == other.referenceUrls &&
+ requestId == other.requestId &&
+ result == other.result &&
+ status == other.status &&
+ userPrompt == other.userPrompt &&
+ additionalProperties == other.additionalProperties
}
- /* spotless:off */
- private val hashCode: Int by lazy { Objects.hash(error, numResults, referenceUrls, requestId, result, status, userPrompt, additionalProperties) }
- /* spotless:on */
+ private val hashCode: Int by lazy {
+ Objects.hash(
+ error,
+ numResults,
+ referenceUrls,
+ requestId,
+ result,
+ status,
+ userPrompt,
+ additionalProperties,
+ )
+ }
override fun hashCode(): Int = hashCode
diff --git a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/smartscraper/CompletedSmartscraper.kt b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/smartscraper/CompletedSmartscraper.kt
index 9735224..c936d2e 100644
--- a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/smartscraper/CompletedSmartscraper.kt
+++ b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/smartscraper/CompletedSmartscraper.kt
@@ -18,6 +18,7 @@ import java.util.Optional
import kotlin.jvm.optionals.getOrNull
class CompletedSmartscraper
+@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val error: JsonField,
private val requestId: JsonField,
@@ -416,7 +417,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()
@@ -429,12 +430,19 @@ private constructor(
return true
}
- return /* spotless:off */ other is CompletedSmartscraper && error == other.error && requestId == other.requestId && result == other.result && status == other.status && userPrompt == other.userPrompt && websiteUrl == other.websiteUrl && additionalProperties == other.additionalProperties /* spotless:on */
+ return other is CompletedSmartscraper &&
+ error == other.error &&
+ requestId == other.requestId &&
+ result == other.result &&
+ status == other.status &&
+ userPrompt == other.userPrompt &&
+ websiteUrl == other.websiteUrl &&
+ additionalProperties == other.additionalProperties
}
- /* spotless:off */
- private val hashCode: Int by lazy { Objects.hash(error, requestId, result, status, userPrompt, websiteUrl, additionalProperties) }
- /* spotless:on */
+ private val hashCode: Int by lazy {
+ Objects.hash(error, requestId, result, status, userPrompt, websiteUrl, additionalProperties)
+ }
override fun hashCode(): Int = hashCode
diff --git a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/smartscraper/FailedSmartscraper.kt b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/smartscraper/FailedSmartscraper.kt
index 6f4d8be..04a59f1 100644
--- a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/smartscraper/FailedSmartscraper.kt
+++ b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/smartscraper/FailedSmartscraper.kt
@@ -18,6 +18,7 @@ import java.util.Optional
import kotlin.jvm.optionals.getOrNull
class FailedSmartscraper
+@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val error: JsonField,
private val requestId: JsonField,
@@ -395,7 +396,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()
@@ -408,12 +409,19 @@ private constructor(
return true
}
- return /* spotless:off */ other is FailedSmartscraper && error == other.error && requestId == other.requestId && result == other.result && status == other.status && userPrompt == other.userPrompt && websiteUrl == other.websiteUrl && additionalProperties == other.additionalProperties /* spotless:on */
+ return other is FailedSmartscraper &&
+ error == other.error &&
+ requestId == other.requestId &&
+ result == other.result &&
+ status == other.status &&
+ userPrompt == other.userPrompt &&
+ websiteUrl == other.websiteUrl &&
+ additionalProperties == other.additionalProperties
}
- /* spotless:off */
- private val hashCode: Int by lazy { Objects.hash(error, requestId, result, status, userPrompt, websiteUrl, additionalProperties) }
- /* spotless:on */
+ private val hashCode: Int by lazy {
+ Objects.hash(error, requestId, result, status, userPrompt, websiteUrl, additionalProperties)
+ }
override fun hashCode(): Int = hashCode
diff --git a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/smartscraper/SmartscraperCreateParams.kt b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/smartscraper/SmartscraperCreateParams.kt
index b09d5c5..ab64a82 100644
--- a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/smartscraper/SmartscraperCreateParams.kt
+++ b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/smartscraper/SmartscraperCreateParams.kt
@@ -485,6 +485,7 @@ private constructor(
override fun _queryParams(): QueryParams = additionalQueryParams
class Body
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val userPrompt: JsonField,
private val cookies: JsonField,
@@ -975,12 +976,35 @@ private constructor(
return true
}
- return /* spotless:off */ other is Body && userPrompt == other.userPrompt && cookies == other.cookies && headers == other.headers && numberOfScrolls == other.numberOfScrolls && outputSchema == other.outputSchema && renderHeavyJs == other.renderHeavyJs && steps == other.steps && totalPages == other.totalPages && websiteHtml == other.websiteHtml && websiteUrl == other.websiteUrl && additionalProperties == other.additionalProperties /* spotless:on */
+ return other is Body &&
+ userPrompt == other.userPrompt &&
+ cookies == other.cookies &&
+ headers == other.headers &&
+ numberOfScrolls == other.numberOfScrolls &&
+ outputSchema == other.outputSchema &&
+ renderHeavyJs == other.renderHeavyJs &&
+ steps == other.steps &&
+ totalPages == other.totalPages &&
+ websiteHtml == other.websiteHtml &&
+ websiteUrl == other.websiteUrl &&
+ additionalProperties == other.additionalProperties
}
- /* spotless:off */
- private val hashCode: Int by lazy { Objects.hash(userPrompt, cookies, headers, numberOfScrolls, outputSchema, renderHeavyJs, steps, totalPages, websiteHtml, websiteUrl, additionalProperties) }
- /* spotless:on */
+ private val hashCode: Int by lazy {
+ Objects.hash(
+ userPrompt,
+ cookies,
+ headers,
+ numberOfScrolls,
+ outputSchema,
+ renderHeavyJs,
+ steps,
+ totalPages,
+ websiteHtml,
+ websiteUrl,
+ additionalProperties,
+ )
+ }
override fun hashCode(): Int = hashCode
@@ -1078,12 +1102,10 @@ private constructor(
return true
}
- return /* spotless:off */ other is Cookies && additionalProperties == other.additionalProperties /* spotless:on */
+ return other is Cookies && additionalProperties == other.additionalProperties
}
- /* spotless:off */
private val hashCode: Int by lazy { Objects.hash(additionalProperties) }
- /* spotless:on */
override fun hashCode(): Int = hashCode
@@ -1180,12 +1202,10 @@ private constructor(
return true
}
- return /* spotless:off */ other is Headers && additionalProperties == other.additionalProperties /* spotless:on */
+ return other is Headers && additionalProperties == other.additionalProperties
}
- /* spotless:off */
private val hashCode: Int by lazy { Objects.hash(additionalProperties) }
- /* spotless:on */
override fun hashCode(): Int = hashCode
@@ -1197,10 +1217,13 @@ private constructor(
return true
}
- return /* spotless:off */ other is SmartscraperCreateParams && body == other.body && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams /* spotless:on */
+ return other is SmartscraperCreateParams &&
+ 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() =
"SmartscraperCreateParams{body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}"
diff --git a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/smartscraper/SmartscraperListParams.kt b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/smartscraper/SmartscraperListParams.kt
index 740f197..bfe95ea 100644
--- a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/smartscraper/SmartscraperListParams.kt
+++ b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/smartscraper/SmartscraperListParams.kt
@@ -158,10 +158,12 @@ private constructor(
return true
}
- return /* spotless:off */ other is SmartscraperListParams && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams /* spotless:on */
+ return other is SmartscraperListParams &&
+ 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() =
"SmartscraperListParams{additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}"
diff --git a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/smartscraper/SmartscraperListResponse.kt b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/smartscraper/SmartscraperListResponse.kt
index fa068b1..28d498b 100644
--- a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/smartscraper/SmartscraperListResponse.kt
+++ b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/smartscraper/SmartscraperListResponse.kt
@@ -108,10 +108,12 @@ private constructor(
return true
}
- return /* spotless:off */ other is SmartscraperListResponse && completedSmartscraper == other.completedSmartscraper && failedSmartscraper == other.failedSmartscraper /* spotless:on */
+ return other is SmartscraperListResponse &&
+ completedSmartscraper == other.completedSmartscraper &&
+ failedSmartscraper == other.failedSmartscraper
}
- override fun hashCode(): Int = /* spotless:off */ Objects.hash(completedSmartscraper, failedSmartscraper) /* spotless:on */
+ override fun hashCode(): Int = Objects.hash(completedSmartscraper, failedSmartscraper)
override fun toString(): String =
when {
diff --git a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/smartscraper/SmartscraperRetrieveParams.kt b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/smartscraper/SmartscraperRetrieveParams.kt
index 20eb68f..e85ca95 100644
--- a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/smartscraper/SmartscraperRetrieveParams.kt
+++ b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/smartscraper/SmartscraperRetrieveParams.kt
@@ -182,10 +182,13 @@ private constructor(
return true
}
- return /* spotless:off */ other is SmartscraperRetrieveParams && requestId == other.requestId && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams /* spotless:on */
+ return other is SmartscraperRetrieveParams &&
+ requestId == other.requestId &&
+ additionalHeaders == other.additionalHeaders &&
+ additionalQueryParams == other.additionalQueryParams
}
- override fun hashCode(): Int = /* spotless:off */ Objects.hash(requestId, additionalHeaders, additionalQueryParams) /* spotless:on */
+ override fun hashCode(): Int = Objects.hash(requestId, additionalHeaders, additionalQueryParams)
override fun toString() =
"SmartscraperRetrieveParams{requestId=$requestId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}"
diff --git a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/smartscraper/SmartscraperRetrieveResponse.kt b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/smartscraper/SmartscraperRetrieveResponse.kt
index c9e93d2..d0e37e7 100644
--- a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/smartscraper/SmartscraperRetrieveResponse.kt
+++ b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/smartscraper/SmartscraperRetrieveResponse.kt
@@ -108,10 +108,12 @@ private constructor(
return true
}
- return /* spotless:off */ other is SmartscraperRetrieveResponse && completedSmartscraper == other.completedSmartscraper && failedSmartscraper == other.failedSmartscraper /* spotless:on */
+ return other is SmartscraperRetrieveResponse &&
+ completedSmartscraper == other.completedSmartscraper &&
+ failedSmartscraper == other.failedSmartscraper
}
- override fun hashCode(): Int = /* spotless:off */ Objects.hash(completedSmartscraper, failedSmartscraper) /* spotless:on */
+ override fun hashCode(): Int = Objects.hash(completedSmartscraper, failedSmartscraper)
override fun toString(): String =
when {
diff --git a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/validate/ValidateApiKeyParams.kt b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/validate/ValidateApiKeyParams.kt
index 1ebc3e6..03ef3ce 100644
--- a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/validate/ValidateApiKeyParams.kt
+++ b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/validate/ValidateApiKeyParams.kt
@@ -158,10 +158,12 @@ private constructor(
return true
}
- return /* spotless:off */ other is ValidateApiKeyParams && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams /* spotless:on */
+ return other is ValidateApiKeyParams &&
+ 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() =
"ValidateApiKeyParams{additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}"
diff --git a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/validate/ValidateApiKeyResponse.kt b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/validate/ValidateApiKeyResponse.kt
index 56a55cb..a0478df 100644
--- a/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/validate/ValidateApiKeyResponse.kt
+++ b/scrapegraphai-java-core/src/main/kotlin/com/scrapegraphai/api/models/validate/ValidateApiKeyResponse.kt
@@ -16,6 +16,7 @@ import java.util.Objects
import java.util.Optional
class ValidateApiKeyResponse
+@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val email: JsonField,
private val additionalProperties: MutableMap,
@@ -138,12 +139,12 @@ private constructor(
return true
}
- return /* spotless:off */ other is ValidateApiKeyResponse && email == other.email && additionalProperties == other.additionalProperties /* spotless:on */
+ return other is ValidateApiKeyResponse &&
+ email == other.email &&
+ additionalProperties == other.additionalProperties
}
- /* spotless:off */
private val hashCode: Int by lazy { Objects.hash(email, additionalProperties) }
- /* spotless:on */
override fun hashCode(): Int = hashCode
diff --git a/scrapegraphai-java-core/src/test/kotlin/com/scrapegraphai/api/core/http/RetryingHttpClientTest.kt b/scrapegraphai-java-core/src/test/kotlin/com/scrapegraphai/api/core/http/RetryingHttpClientTest.kt
index cfd3fe1..0b793d5 100644
--- a/scrapegraphai-java-core/src/test/kotlin/com/scrapegraphai/api/core/http/RetryingHttpClientTest.kt
+++ b/scrapegraphai-java-core/src/test/kotlin/com/scrapegraphai/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.scrapegraphai.api.client.okhttp.OkHttpClient
import com.scrapegraphai.api.core.RequestOptions
+import com.scrapegraphai.api.core.Sleeper
import com.scrapegraphai.api.errors.ScrapegraphaiRetryableException
import java.io.InputStream
import java.time.Duration
@@ -294,12 +295,14 @@ internal class RetryingHttpClientTest {
.httpClient(failingHttpClient)
.maxRetries(2)
.sleeper(
- object : RetryingHttpClient.Sleeper {
+ object : Sleeper {
override fun sleep(duration: Duration) {}
override fun sleepAsync(duration: Duration): CompletableFuture =
CompletableFuture.completedFuture(null)
+
+ override fun close() {}
}
)
.build()
@@ -333,12 +336,14 @@ internal class RetryingHttpClientTest {
.httpClient(httpClient)
// Use a no-op `Sleeper` to make the test fast.
.sleeper(
- object : RetryingHttpClient.Sleeper {
+ object : Sleeper {
override fun sleep(duration: Duration) {}
override fun sleepAsync(duration: Duration): CompletableFuture =
CompletableFuture.completedFuture(null)
+
+ override fun close() {}
}
)
diff --git a/scrapegraphai-java-proguard-test/build.gradle.kts b/scrapegraphai-java-proguard-test/build.gradle.kts
index 4263540..5692fa8 100644
--- a/scrapegraphai-java-proguard-test/build.gradle.kts
+++ b/scrapegraphai-java-proguard-test/build.gradle.kts
@@ -37,8 +37,6 @@ val proguardJar by tasks.registering(proguard.gradle.ProGuardTask::class) {
outjars(proguardJarPath)
printmapping("${layout.buildDirectory.get()}/proguard-mapping.txt")
- 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.
diff --git a/scrapegraphai-java-proguard-test/test.pro b/scrapegraphai-java-proguard-test/test.pro
index 85644d1..f0afc79 100644
--- a/scrapegraphai-java-proguard-test/test.pro
+++ b/scrapegraphai-java-proguard-test/test.pro
@@ -5,4 +5,5 @@
-keep class org.junit.** { *; }
# Many warnings don't apply for our testing purposes.
+-dontnote
-dontwarn
\ No newline at end of file
diff --git a/scripts/build b/scripts/build
new file mode 100755
index 0000000..f406348
--- /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/fast-format b/scripts/fast-format
new file mode 100755
index 0000000..1b3bc47
--- /dev/null
+++ b/scripts/fast-format
@@ -0,0 +1,46 @@
+#!/usr/bin/env bash
+
+set -euo pipefail
+
+echo "Script started with $# arguments"
+echo "Arguments: $*"
+echo "Script location: $(dirname "$0")"
+
+cd "$(dirname "$0")/.."
+echo "Changed to directory: $(pwd)"
+
+if [ $# -eq 0 ]; then
+ echo "Usage: $0 [additional-formatter-args...]"
+ echo "The file should contain one file path per line"
+ exit 1
+fi
+
+FILE_LIST="$1"
+
+echo "Looking for file: $FILE_LIST"
+
+if [ ! -f "$FILE_LIST" ]; then
+ echo "Error: File '$FILE_LIST' not found"
+ exit 1
+fi
+
+if ! command -v ktfmt-fast-format &> /dev/null; then
+ echo "Error: ktfmt-fast-format not found"
+ exit 1
+fi
+
+# Process Kotlin files
+echo "==> Looking for Kotlin files"
+kt_files=$(grep -E '\.kt$' "$FILE_LIST" | grep -v './buildSrc/build/' || true)
+echo "==> Done looking for Kotlin files"
+
+if [[ -n "$kt_files" ]]; then
+ echo "==> will format Kotlin files"
+ echo "$kt_files" | tr '\n' '\0' | xargs -0 ktfmt-fast-format --kotlinlang-style "$@"
+else
+ echo "No Kotlin files to format -- expected outcome during incremental formatting"
+fi
+
+# TODO(mbudayr): support palantir-java-format
+# Process Java files
+# grep -E '\.java$' "$FILE_LIST" | grep -v './buildSrc/build/' | tr '\n' '\0' | xargs -0 -r palantir-java-format --palantir --replace "$@"
diff --git a/scripts/format b/scripts/format
index 456a69d..65db176 100755
--- a/scripts/format
+++ b/scripts/format
@@ -4,5 +4,18 @@ set -e
cd "$(dirname "$0")/.."
-echo "==> Running spotlessApply"
-./gradlew spotlessApply
+if command -v ktfmt &> /dev/null; then
+ echo "==> Running ktfmt"
+ ./scripts/kotlin-format
+else
+ echo "==> Running gradlew formatKotlin"
+ ./gradlew formatKotlin
+fi
+
+if command -v palantir-java-format &> /dev/null; then
+ echo "==> Running palantir-java-format"
+ ./scripts/java-format
+else
+ echo "==> Running gradlew formatJava"
+ ./gradlew formatJava
+fi
diff --git a/scripts/java-format b/scripts/java-format
new file mode 100755
index 0000000..ad5febc
--- /dev/null
+++ b/scripts/java-format
@@ -0,0 +1,7 @@
+#!/usr/bin/env bash
+
+set -e
+
+cd "$(dirname "$0")/.."
+
+find . -name "*.java" -not -path "./buildSrc/build/*" -print0 | xargs -0 -r palantir-java-format --palantir --replace "$@"
diff --git a/scripts/kotlin-format b/scripts/kotlin-format
new file mode 100755
index 0000000..3b8be9e
--- /dev/null
+++ b/scripts/kotlin-format
@@ -0,0 +1,7 @@
+#!/usr/bin/env bash
+
+set -e
+
+cd "$(dirname "$0")/.."
+
+find . -name "*.kt" -not -path "./buildSrc/build/*" -print0 | xargs -0 -r ktfmt --kotlinlang-style "$@"
diff --git a/scripts/lint b/scripts/lint
index e3a5f5e..dbc8f77 100755
--- a/scripts/lint
+++ b/scripts/lint
@@ -4,5 +4,20 @@ set -e
cd "$(dirname "$0")/.."
-echo "==> Build classes"
-./gradlew build testClasses -x test
+echo "==> Running lints"
+
+if command -v ktfmt &> /dev/null; then
+ echo "==> Checking ktfmt"
+ ./scripts/kotlin-format --dry-run --set-exit-if-changed
+else
+ echo "==> Running gradlew lintKotlin"
+ ./gradlew lintKotlin
+fi
+
+if command -v palantir-java-format &> /dev/null; then
+ echo "==> Checking palantir-java-format"
+ ./scripts/java-format --dry-run --set-exit-if-changed
+else
+ echo "==> Running gradlew lintJava"
+ ./gradlew lintJava
+fi
diff --git a/scripts/test b/scripts/test
index 2177cb8..047bc1d 100755
--- a/scripts/test
+++ b/scripts/test
@@ -53,4 +53,4 @@ else
fi
echo "==> Running tests"
-./gradlew test
+./gradlew test "$@"
diff --git a/settings.gradle.kts b/settings.gradle.kts
index e2941f7..2043e76 100644
--- a/settings.gradle.kts
+++ b/settings.gradle.kts
@@ -1,7 +1,14 @@
rootProject.name = "scrapegraphai-java-root"
-include("scrapegraphai-java")
-include("scrapegraphai-java-client-okhttp")
-include("scrapegraphai-java-core")
-include("scrapegraphai-java-proguard-test")
-include("scrapegraphai-java-example")
+val projectNames = rootDir.listFiles()
+ ?.asSequence()
+ .orEmpty()
+ .filter { file ->
+ file.isDirectory &&
+ file.name.startsWith("scrapegraphai-java") &&
+ file.listFiles()?.asSequence().orEmpty().any { it.name == "build.gradle.kts" }
+ }
+ .map { it.name }
+ .toList()
+println("projects: $projectNames")
+projectNames.forEach { include(it) }