diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 10f309169..6b7b74c5f 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.2.0" + ".": "0.3.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 393c909c5..63fe34126 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 24 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai-fb9db2d2c1f0d6b39d8ee042db5d5c59acba6ad1daf47c18792c1f5fb24b3401.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai-aa9b01fc0c17eb0cbc200533fc20d6a49c5e764ceaf8049e08b294532be6e9ff.yml diff --git a/CHANGELOG.md b/CHANGELOG.md index 28e24b76e..bd0b5c69d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,19 @@ # Changelog +## 0.3.0 (2024-11-20) + +Full Changelog: [v0.2.0...v0.3.0](https://github.com/openai/openai-java/compare/v0.2.0...v0.3.0) + +### Features + +* **api:** add gpt-4o-2024-11-20 model ([#13](https://github.com/openai/openai-java/issues/13)) ([3263126](https://github.com/openai/openai-java/commit/3263126a59cb63be0b6842fa16b0466feb71d44b)) + + +### Styles + +* **internal:** move identity methods to bottom of error class ([#12](https://github.com/openai/openai-java/issues/12)) ([f3ff42a](https://github.com/openai/openai-java/commit/f3ff42a3c4d3821949af7ad43e03dac8b061825b)) +* **internal:** reduce verbosity of identity methods ([#10](https://github.com/openai/openai-java/issues/10)) ([9ef03ed](https://github.com/openai/openai-java/commit/9ef03eda541a878b4ef9df0c3845a63e1f9cc44d)) + ## 0.2.0 (2024-11-20) Full Changelog: [v0.1.0...v0.2.0](https://github.com/openai/openai-java/compare/v0.1.0...v0.2.0) diff --git a/README.md b/README.md index 033bbea25..9511b4247 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ -[![Maven Central](https://img.shields.io/maven-central/v/com.openai/openai-java)](https://central.sonatype.com/artifact/com.openai/openai-java/0.2.0) +[![Maven Central](https://img.shields.io/maven-central/v/com.openai/openai-java)](https://central.sonatype.com/artifact/com.openai/openai-java/0.3.0) @@ -25,7 +25,7 @@ The REST API documentation can be foundĀ on [platform.openai.com](https://platfo ```kotlin -implementation("com.openai:openai-java:0.2.0") +implementation("com.openai:openai-java:0.3.0") ``` #### Maven @@ -34,7 +34,7 @@ implementation("com.openai:openai-java:0.2.0") com.openai openai-java - 0.2.0 + 0.3.0 ``` diff --git a/build.gradle.kts b/build.gradle.kts index e24561d6f..282a07960 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -4,7 +4,7 @@ plugins { allprojects { group = "com.openai" - version = "0.2.0" // x-release-please-version + version = "0.3.0" // x-release-please-version } nexusPublishing { diff --git a/openai-java-core/src/main/kotlin/com/openai/errors/OpenAIError.kt b/openai-java-core/src/main/kotlin/com/openai/errors/OpenAIError.kt index 3f27cd426..ca3ce7404 100644 --- a/openai-java-core/src/main/kotlin/com/openai/errors/OpenAIError.kt +++ b/openai-java-core/src/main/kotlin/com/openai/errors/OpenAIError.kt @@ -19,20 +19,6 @@ private constructor( val additionalProperties: Map, ) { - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return /* spotless:off */ other is OpenAIError && this.additionalProperties == other.additionalProperties /* spotless:on */ - } - - override fun hashCode(): Int { - return /* spotless:off */ Objects.hash(additionalProperties) /* spotless:on */ - } - - override fun toString() = "OpenAIError{additionalProperties=$additionalProperties}" - fun toBuilder() = Builder().from(this) companion object { @@ -71,4 +57,16 @@ private constructor( fun build(): OpenAIError = OpenAIError(additionalProperties.toImmutable()) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is OpenAIError && additionalProperties == other.additionalProperties /* spotless:on */ + } + + override fun hashCode(): Int = /* spotless:off */ Objects.hash(additionalProperties) /* spotless:on */ + + override fun toString() = "OpenAIError{additionalProperties=$additionalProperties}" } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/Batch.kt b/openai-java-core/src/main/kotlin/com/openai/models/Batch.kt index dc2a7de4e..43c5f2bd4 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/Batch.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/Batch.kt @@ -471,7 +471,7 @@ private constructor( return true } - return /* spotless:off */ other is Object && this.value == other.value /* spotless:on */ + return /* spotless:off */ other is Object && value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -522,7 +522,7 @@ private constructor( return true } - return /* spotless:off */ other is Status && this.value == other.value /* spotless:on */ + return /* spotless:off */ other is Status && value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -696,17 +696,14 @@ private constructor( return true } - return /* spotless:off */ other is Errors && this.object_ == other.object_ && this.data == other.data && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Errors && object_ == other.object_ && data == other.data && additionalProperties == other.additionalProperties /* spotless:on */ } - private var hashCode: Int = 0 + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(object_, data, additionalProperties) } + /* spotless:on */ - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = /* spotless:off */ Objects.hash(object_, data, additionalProperties) /* spotless:on */ - } - return hashCode - } + override fun hashCode(): Int = hashCode override fun toString() = "Errors{object_=$object_, data=$data, additionalProperties=$additionalProperties}" @@ -717,17 +714,14 @@ private constructor( return true } - return /* spotless:off */ other is Batch && this.id == other.id && this.object_ == other.object_ && this.endpoint == other.endpoint && this.errors == other.errors && this.inputFileId == other.inputFileId && this.completionWindow == other.completionWindow && this.status == other.status && this.outputFileId == other.outputFileId && this.errorFileId == other.errorFileId && this.createdAt == other.createdAt && this.inProgressAt == other.inProgressAt && this.expiresAt == other.expiresAt && this.finalizingAt == other.finalizingAt && this.completedAt == other.completedAt && this.failedAt == other.failedAt && this.expiredAt == other.expiredAt && this.cancellingAt == other.cancellingAt && this.cancelledAt == other.cancelledAt && this.requestCounts == other.requestCounts && this.metadata == other.metadata && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Batch && id == other.id && object_ == other.object_ && endpoint == other.endpoint && errors == other.errors && inputFileId == other.inputFileId && completionWindow == other.completionWindow && status == other.status && outputFileId == other.outputFileId && errorFileId == other.errorFileId && createdAt == other.createdAt && inProgressAt == other.inProgressAt && expiresAt == other.expiresAt && finalizingAt == other.finalizingAt && completedAt == other.completedAt && failedAt == other.failedAt && expiredAt == other.expiredAt && cancellingAt == other.cancellingAt && cancelledAt == other.cancelledAt && requestCounts == other.requestCounts && metadata == other.metadata && additionalProperties == other.additionalProperties /* spotless:on */ } - private var hashCode: Int = 0 + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(id, object_, endpoint, errors, inputFileId, completionWindow, status, outputFileId, errorFileId, createdAt, inProgressAt, expiresAt, finalizingAt, completedAt, failedAt, expiredAt, cancellingAt, cancelledAt, requestCounts, metadata, additionalProperties) } + /* spotless:on */ - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = /* spotless:off */ Objects.hash(id, object_, endpoint, errors, inputFileId, completionWindow, status, outputFileId, errorFileId, createdAt, inProgressAt, expiresAt, finalizingAt, completedAt, failedAt, expiredAt, cancellingAt, cancelledAt, requestCounts, metadata, additionalProperties) /* spotless:on */ - } - return hashCode - } + override fun hashCode(): Int = hashCode override fun toString() = "Batch{id=$id, object_=$object_, endpoint=$endpoint, errors=$errors, inputFileId=$inputFileId, completionWindow=$completionWindow, status=$status, outputFileId=$outputFileId, errorFileId=$errorFileId, createdAt=$createdAt, inProgressAt=$inProgressAt, expiresAt=$expiresAt, finalizingAt=$finalizingAt, completedAt=$completedAt, failedAt=$failedAt, expiredAt=$expiredAt, cancellingAt=$cancellingAt, cancelledAt=$cancelledAt, requestCounts=$requestCounts, metadata=$metadata, additionalProperties=$additionalProperties}" diff --git a/openai-java-core/src/main/kotlin/com/openai/models/BatchCancelParams.kt b/openai-java-core/src/main/kotlin/com/openai/models/BatchCancelParams.kt index f1b1684e1..0cbcd1e36 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/BatchCancelParams.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/BatchCancelParams.kt @@ -48,12 +48,10 @@ constructor( return true } - return /* spotless:off */ other is BatchCancelParams && this.batchId == other.batchId && this.additionalHeaders == other.additionalHeaders && this.additionalQueryParams == other.additionalQueryParams && this.additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ + return /* spotless:off */ other is BatchCancelParams && batchId == other.batchId && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams && additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ } - override fun hashCode(): Int { - return /* spotless:off */ Objects.hash(batchId, additionalHeaders, additionalQueryParams, additionalBodyProperties) /* spotless:on */ - } + override fun hashCode(): Int = /* spotless:off */ Objects.hash(batchId, additionalHeaders, additionalQueryParams, additionalBodyProperties) /* spotless:on */ override fun toString() = "BatchCancelParams{batchId=$batchId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams, additionalBodyProperties=$additionalBodyProperties}" diff --git a/openai-java-core/src/main/kotlin/com/openai/models/BatchCreateParams.kt b/openai-java-core/src/main/kotlin/com/openai/models/BatchCreateParams.kt index f857ebf56..b3a00834b 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/BatchCreateParams.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/BatchCreateParams.kt @@ -89,7 +89,7 @@ constructor( * Your input file must be formatted as a * [JSONL file](https://platform.openai.com/docs/api-reference/batch/request-input), and * must be uploaded with the purpose `batch`. The file can contain up to 50,000 requests, - * and can be up to 100 MB in size. + * and can be up to 200 MB in size. */ @JsonProperty("input_file_id") fun inputFileId(): String? = inputFileId @@ -151,7 +151,7 @@ constructor( * Your input file must be formatted as a * [JSONL file](https://platform.openai.com/docs/api-reference/batch/request-input), and * must be uploaded with the purpose `batch`. The file can contain up to 50,000 - * requests, and can be up to 100 MB in size. + * requests, and can be up to 200 MB in size. */ @JsonProperty("input_file_id") fun inputFileId(inputFileId: String) = apply { this.inputFileId = inputFileId } @@ -191,17 +191,14 @@ constructor( return true } - return /* spotless:off */ other is BatchCreateBody && this.completionWindow == other.completionWindow && this.endpoint == other.endpoint && this.inputFileId == other.inputFileId && this.metadata == other.metadata && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is BatchCreateBody && completionWindow == other.completionWindow && endpoint == other.endpoint && inputFileId == other.inputFileId && metadata == other.metadata && additionalProperties == other.additionalProperties /* spotless:on */ } - private var hashCode: Int = 0 + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(completionWindow, endpoint, inputFileId, metadata, additionalProperties) } + /* spotless:on */ - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = /* spotless:off */ Objects.hash(completionWindow, endpoint, inputFileId, metadata, additionalProperties) /* spotless:on */ - } - return hashCode - } + override fun hashCode(): Int = hashCode override fun toString() = "BatchCreateBody{completionWindow=$completionWindow, endpoint=$endpoint, inputFileId=$inputFileId, metadata=$metadata, additionalProperties=$additionalProperties}" @@ -218,12 +215,10 @@ constructor( return true } - return /* spotless:off */ other is BatchCreateParams && this.completionWindow == other.completionWindow && this.endpoint == other.endpoint && this.inputFileId == other.inputFileId && this.metadata == other.metadata && this.additionalHeaders == other.additionalHeaders && this.additionalQueryParams == other.additionalQueryParams && this.additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ + return /* spotless:off */ other is BatchCreateParams && completionWindow == other.completionWindow && endpoint == other.endpoint && inputFileId == other.inputFileId && metadata == other.metadata && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams && additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ } - override fun hashCode(): Int { - return /* spotless:off */ Objects.hash(completionWindow, endpoint, inputFileId, metadata, additionalHeaders, additionalQueryParams, additionalBodyProperties) /* spotless:on */ - } + override fun hashCode(): Int = /* spotless:off */ Objects.hash(completionWindow, endpoint, inputFileId, metadata, additionalHeaders, additionalQueryParams, additionalBodyProperties) /* spotless:on */ override fun toString() = "BatchCreateParams{completionWindow=$completionWindow, endpoint=$endpoint, inputFileId=$inputFileId, metadata=$metadata, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams, additionalBodyProperties=$additionalBodyProperties}" @@ -282,7 +277,7 @@ constructor( * Your input file must be formatted as a * [JSONL file](https://platform.openai.com/docs/api-reference/batch/request-input), and * must be uploaded with the purpose `batch`. The file can contain up to 50,000 requests, - * and can be up to 100 MB in size. + * and can be up to 200 MB in size. */ fun inputFileId(inputFileId: String) = apply { this.inputFileId = inputFileId } @@ -434,7 +429,7 @@ constructor( return true } - return /* spotless:off */ other is CompletionWindow && this.value == other.value /* spotless:on */ + return /* spotless:off */ other is CompletionWindow && value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -485,7 +480,7 @@ constructor( return true } - return /* spotless:off */ other is Endpoint && this.value == other.value /* spotless:on */ + return /* spotless:off */ other is Endpoint && value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -585,17 +580,14 @@ constructor( return true } - return /* spotless:off */ other is Metadata && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Metadata && additionalProperties == other.additionalProperties /* spotless:on */ } - private var hashCode: Int = 0 + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + /* spotless:on */ - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = /* spotless:off */ Objects.hash(additionalProperties) /* spotless:on */ - } - return hashCode - } + override fun hashCode(): Int = hashCode override fun toString() = "Metadata{additionalProperties=$additionalProperties}" } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/BatchError.kt b/openai-java-core/src/main/kotlin/com/openai/models/BatchError.kt index 856b006ef..5dc77defa 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/BatchError.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/BatchError.kt @@ -151,17 +151,14 @@ private constructor( return true } - return /* spotless:off */ other is BatchError && this.code == other.code && this.message == other.message && this.param == other.param && this.line == other.line && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is BatchError && code == other.code && message == other.message && param == other.param && line == other.line && additionalProperties == other.additionalProperties /* spotless:on */ } - private var hashCode: Int = 0 + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(code, message, param, line, additionalProperties) } + /* spotless:on */ - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = /* spotless:off */ Objects.hash(code, message, param, line, additionalProperties) /* spotless:on */ - } - return hashCode - } + override fun hashCode(): Int = hashCode override fun toString() = "BatchError{code=$code, message=$message, param=$param, line=$line, additionalProperties=$additionalProperties}" diff --git a/openai-java-core/src/main/kotlin/com/openai/models/BatchListPage.kt b/openai-java-core/src/main/kotlin/com/openai/models/BatchListPage.kt index 9abb6a09f..4e9146304 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/BatchListPage.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/BatchListPage.kt @@ -34,12 +34,10 @@ private constructor( return true } - return /* spotless:off */ other is BatchListPage && this.batchesService == other.batchesService && this.params == other.params && this.response == other.response /* spotless:on */ + return /* spotless:off */ other is BatchListPage && batchesService == other.batchesService && params == other.params && response == other.response /* spotless:on */ } - override fun hashCode(): Int { - return /* spotless:off */ Objects.hash(batchesService, params, response) /* spotless:on */ - } + override fun hashCode(): Int = /* spotless:off */ Objects.hash(batchesService, params, response) /* spotless:on */ override fun toString() = "BatchListPage{batchesService=$batchesService, params=$params, response=$response}" @@ -106,15 +104,12 @@ private constructor( return true } - return /* spotless:off */ other is Response && this.data == other.data && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Response && data == other.data && additionalProperties == other.additionalProperties /* spotless:on */ } - override fun hashCode(): Int { - return /* spotless:off */ Objects.hash(data, additionalProperties) /* spotless:on */ - } + override fun hashCode(): Int = /* spotless:off */ Objects.hash(data, additionalProperties) /* spotless:on */ - override fun toString() = - "BatchListPage.Response{data=$data, additionalProperties=$additionalProperties}" + override fun toString() = "Response{data=$data, additionalProperties=$additionalProperties}" companion object { diff --git a/openai-java-core/src/main/kotlin/com/openai/models/BatchListPageAsync.kt b/openai-java-core/src/main/kotlin/com/openai/models/BatchListPageAsync.kt index f58571b99..5e4b7b4cc 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/BatchListPageAsync.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/BatchListPageAsync.kt @@ -35,12 +35,10 @@ private constructor( return true } - return /* spotless:off */ other is BatchListPageAsync && this.batchesService == other.batchesService && this.params == other.params && this.response == other.response /* spotless:on */ + return /* spotless:off */ other is BatchListPageAsync && batchesService == other.batchesService && params == other.params && response == other.response /* spotless:on */ } - override fun hashCode(): Int { - return /* spotless:off */ Objects.hash(batchesService, params, response) /* spotless:on */ - } + override fun hashCode(): Int = /* spotless:off */ Objects.hash(batchesService, params, response) /* spotless:on */ override fun toString() = "BatchListPageAsync{batchesService=$batchesService, params=$params, response=$response}" @@ -109,15 +107,12 @@ private constructor( return true } - return /* spotless:off */ other is Response && this.data == other.data && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Response && data == other.data && additionalProperties == other.additionalProperties /* spotless:on */ } - override fun hashCode(): Int { - return /* spotless:off */ Objects.hash(data, additionalProperties) /* spotless:on */ - } + override fun hashCode(): Int = /* spotless:off */ Objects.hash(data, additionalProperties) /* spotless:on */ - override fun toString() = - "BatchListPageAsync.Response{data=$data, additionalProperties=$additionalProperties}" + override fun toString() = "Response{data=$data, additionalProperties=$additionalProperties}" companion object { diff --git a/openai-java-core/src/main/kotlin/com/openai/models/BatchListParams.kt b/openai-java-core/src/main/kotlin/com/openai/models/BatchListParams.kt index b7ee84240..4603a417d 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/BatchListParams.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/BatchListParams.kt @@ -41,12 +41,10 @@ constructor( return true } - return /* spotless:off */ other is BatchListParams && this.after == other.after && this.limit == other.limit && this.additionalHeaders == other.additionalHeaders && this.additionalQueryParams == other.additionalQueryParams /* spotless:on */ + return /* spotless:off */ other is BatchListParams && after == other.after && limit == other.limit && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams /* spotless:on */ } - override fun hashCode(): Int { - return /* spotless:off */ Objects.hash(after, limit, additionalHeaders, additionalQueryParams) /* spotless:on */ - } + override fun hashCode(): Int = /* spotless:off */ Objects.hash(after, limit, additionalHeaders, additionalQueryParams) /* spotless:on */ override fun toString() = "BatchListParams{after=$after, limit=$limit, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" diff --git a/openai-java-core/src/main/kotlin/com/openai/models/BatchRequestCounts.kt b/openai-java-core/src/main/kotlin/com/openai/models/BatchRequestCounts.kt index 1cbb1ce40..9b5d4b697 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/BatchRequestCounts.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/BatchRequestCounts.kt @@ -132,17 +132,14 @@ private constructor( return true } - return /* spotless:off */ other is BatchRequestCounts && this.total == other.total && this.completed == other.completed && this.failed == other.failed && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is BatchRequestCounts && total == other.total && completed == other.completed && failed == other.failed && additionalProperties == other.additionalProperties /* spotless:on */ } - private var hashCode: Int = 0 + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(total, completed, failed, additionalProperties) } + /* spotless:on */ - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = /* spotless:off */ Objects.hash(total, completed, failed, additionalProperties) /* spotless:on */ - } - return hashCode - } + override fun hashCode(): Int = hashCode override fun toString() = "BatchRequestCounts{total=$total, completed=$completed, failed=$failed, additionalProperties=$additionalProperties}" diff --git a/openai-java-core/src/main/kotlin/com/openai/models/BatchRetrieveParams.kt b/openai-java-core/src/main/kotlin/com/openai/models/BatchRetrieveParams.kt index 08071ec36..af8a9898d 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/BatchRetrieveParams.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/BatchRetrieveParams.kt @@ -37,12 +37,10 @@ constructor( return true } - return /* spotless:off */ other is BatchRetrieveParams && this.batchId == other.batchId && this.additionalHeaders == other.additionalHeaders && this.additionalQueryParams == other.additionalQueryParams /* spotless:on */ + return /* spotless:off */ other is BatchRetrieveParams && batchId == other.batchId && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams /* spotless:on */ } - override fun hashCode(): Int { - return /* spotless:off */ Objects.hash(batchId, additionalHeaders, additionalQueryParams) /* spotless:on */ - } + override fun hashCode(): Int = /* spotless:off */ Objects.hash(batchId, additionalHeaders, additionalQueryParams) /* spotless:on */ override fun toString() = "BatchRetrieveParams{batchId=$batchId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" diff --git a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletion.kt b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletion.kt index 354f70a65..3c62de316 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletion.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletion.kt @@ -435,7 +435,7 @@ private constructor( return true } - return /* spotless:off */ other is FinishReason && this.value == other.value /* spotless:on */ + return /* spotless:off */ other is FinishReason && value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -605,17 +605,14 @@ private constructor( return true } - return /* spotless:off */ other is Logprobs && this.content == other.content && this.refusal == other.refusal && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Logprobs && content == other.content && refusal == other.refusal && additionalProperties == other.additionalProperties /* spotless:on */ } - private var hashCode: Int = 0 + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(content, refusal, additionalProperties) } + /* spotless:on */ - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = /* spotless:off */ Objects.hash(content, refusal, additionalProperties) /* spotless:on */ - } - return hashCode - } + override fun hashCode(): Int = hashCode override fun toString() = "Logprobs{content=$content, refusal=$refusal, additionalProperties=$additionalProperties}" @@ -626,17 +623,14 @@ private constructor( return true } - return /* spotless:off */ other is Choice && this.finishReason == other.finishReason && this.index == other.index && this.message == other.message && this.logprobs == other.logprobs && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Choice && finishReason == other.finishReason && index == other.index && message == other.message && logprobs == other.logprobs && additionalProperties == other.additionalProperties /* spotless:on */ } - private var hashCode: Int = 0 + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(finishReason, index, message, logprobs, additionalProperties) } + /* spotless:on */ - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = /* spotless:off */ Objects.hash(finishReason, index, message, logprobs, additionalProperties) /* spotless:on */ - } - return hashCode - } + override fun hashCode(): Int = hashCode override fun toString() = "Choice{finishReason=$finishReason, index=$index, message=$message, logprobs=$logprobs, additionalProperties=$additionalProperties}" @@ -655,7 +649,7 @@ private constructor( return true } - return /* spotless:off */ other is Object && this.value == other.value /* spotless:on */ + return /* spotless:off */ other is Object && value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -706,7 +700,7 @@ private constructor( return true } - return /* spotless:off */ other is ServiceTier && this.value == other.value /* spotless:on */ + return /* spotless:off */ other is ServiceTier && value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -755,17 +749,14 @@ private constructor( return true } - return /* spotless:off */ other is ChatCompletion && this.id == other.id && this.choices == other.choices && this.created == other.created && this.model == other.model && this.serviceTier == other.serviceTier && this.systemFingerprint == other.systemFingerprint && this.object_ == other.object_ && this.usage == other.usage && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is ChatCompletion && id == other.id && choices == other.choices && created == other.created && model == other.model && serviceTier == other.serviceTier && systemFingerprint == other.systemFingerprint && object_ == other.object_ && usage == other.usage && additionalProperties == other.additionalProperties /* spotless:on */ } - private var hashCode: Int = 0 + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(id, choices, created, model, serviceTier, systemFingerprint, object_, usage, additionalProperties) } + /* spotless:on */ - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = /* spotless:off */ Objects.hash(id, choices, created, model, serviceTier, systemFingerprint, object_, usage, additionalProperties) /* spotless:on */ - } - return hashCode - } + override fun hashCode(): Int = hashCode override fun toString() = "ChatCompletion{id=$id, choices=$choices, created=$created, model=$model, serviceTier=$serviceTier, systemFingerprint=$systemFingerprint, object_=$object_, usage=$usage, additionalProperties=$additionalProperties}" diff --git a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionAssistantMessageParam.kt b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionAssistantMessageParam.kt index be8c44ac4..ae9861f22 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionAssistantMessageParam.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionAssistantMessageParam.kt @@ -286,7 +286,7 @@ private constructor( return true } - return /* spotless:off */ other is Role && this.value == other.value /* spotless:on */ + return /* spotless:off */ other is Role && value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -403,17 +403,14 @@ private constructor( return true } - return /* spotless:off */ other is Audio && this.id == other.id && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Audio && id == other.id && additionalProperties == other.additionalProperties /* spotless:on */ } - private var hashCode: Int = 0 + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(id, additionalProperties) } + /* spotless:on */ - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = /* spotless:off */ Objects.hash(id, additionalProperties) /* spotless:on */ - } - return hashCode - } + override fun hashCode(): Int = hashCode override fun toString() = "Audio{id=$id, additionalProperties=$additionalProperties}" } @@ -473,21 +470,18 @@ private constructor( return true } - return /* spotless:off */ other is Content && this.textContent == other.textContent && this.arrayOfContentParts == other.arrayOfContentParts /* spotless:on */ + return /* spotless:off */ other is Content && textContent == other.textContent && arrayOfContentParts == other.arrayOfContentParts /* spotless:on */ } - override fun hashCode(): Int { - return /* spotless:off */ Objects.hash(textContent, arrayOfContentParts) /* spotless:on */ - } + override fun hashCode(): Int = /* spotless:off */ Objects.hash(textContent, arrayOfContentParts) /* spotless:on */ - override fun toString(): String { - return when { + override fun toString(): String = + when { textContent != null -> "Content{textContent=$textContent}" arrayOfContentParts != null -> "Content{arrayOfContentParts=$arrayOfContentParts}" _json != null -> "Content{_unknown=$_json}" else -> throw IllegalStateException("Invalid Content") } - } companion object { @@ -617,15 +611,13 @@ private constructor( return true } - return /* spotless:off */ other is ChatCompletionRequestAssistantMessageContentPart && this.chatCompletionContentPartText == other.chatCompletionContentPartText && this.chatCompletionContentPartRefusal == other.chatCompletionContentPartRefusal /* spotless:on */ + return /* spotless:off */ other is ChatCompletionRequestAssistantMessageContentPart && chatCompletionContentPartText == other.chatCompletionContentPartText && chatCompletionContentPartRefusal == other.chatCompletionContentPartRefusal /* spotless:on */ } - override fun hashCode(): Int { - return /* spotless:off */ Objects.hash(chatCompletionContentPartText, chatCompletionContentPartRefusal) /* spotless:on */ - } + override fun hashCode(): Int = /* spotless:off */ Objects.hash(chatCompletionContentPartText, chatCompletionContentPartRefusal) /* spotless:on */ - override fun toString(): String { - return when { + override fun toString(): String = + when { chatCompletionContentPartText != null -> "ChatCompletionRequestAssistantMessageContentPart{chatCompletionContentPartText=$chatCompletionContentPartText}" chatCompletionContentPartRefusal != null -> @@ -637,7 +629,6 @@ private constructor( "Invalid ChatCompletionRequestAssistantMessageContentPart" ) } - } companion object { @@ -866,17 +857,14 @@ private constructor( return true } - return /* spotless:off */ other is FunctionCall && this.arguments == other.arguments && this.name == other.name && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is FunctionCall && arguments == other.arguments && name == other.name && additionalProperties == other.additionalProperties /* spotless:on */ } - private var hashCode: Int = 0 + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(arguments, name, additionalProperties) } + /* spotless:on */ - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = /* spotless:off */ Objects.hash(arguments, name, additionalProperties) /* spotless:on */ - } - return hashCode - } + override fun hashCode(): Int = hashCode override fun toString() = "FunctionCall{arguments=$arguments, name=$name, additionalProperties=$additionalProperties}" @@ -887,17 +875,14 @@ private constructor( return true } - return /* spotless:off */ other is ChatCompletionAssistantMessageParam && this.content == other.content && this.refusal == other.refusal && this.role == other.role && this.name == other.name && this.audio == other.audio && this.toolCalls == other.toolCalls && this.functionCall == other.functionCall && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is ChatCompletionAssistantMessageParam && content == other.content && refusal == other.refusal && role == other.role && name == other.name && audio == other.audio && toolCalls == other.toolCalls && functionCall == other.functionCall && additionalProperties == other.additionalProperties /* spotless:on */ } - private var hashCode: Int = 0 + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(content, refusal, role, name, audio, toolCalls, functionCall, additionalProperties) } + /* spotless:on */ - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = /* spotless:off */ Objects.hash(content, refusal, role, name, audio, toolCalls, functionCall, additionalProperties) /* spotless:on */ - } - return hashCode - } + override fun hashCode(): Int = hashCode override fun toString() = "ChatCompletionAssistantMessageParam{content=$content, refusal=$refusal, role=$role, name=$name, audio=$audio, toolCalls=$toolCalls, functionCall=$functionCall, additionalProperties=$additionalProperties}" diff --git a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionAudio.kt b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionAudio.kt index 11d9fc151..7efacfe1b 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionAudio.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionAudio.kt @@ -174,17 +174,14 @@ private constructor( return true } - return /* spotless:off */ other is ChatCompletionAudio && this.id == other.id && this.expiresAt == other.expiresAt && this.data == other.data && this.transcript == other.transcript && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is ChatCompletionAudio && id == other.id && expiresAt == other.expiresAt && data == other.data && transcript == other.transcript && additionalProperties == other.additionalProperties /* spotless:on */ } - private var hashCode: Int = 0 + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(id, expiresAt, data, transcript, additionalProperties) } + /* spotless:on */ - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = /* spotless:off */ Objects.hash(id, expiresAt, data, transcript, additionalProperties) /* spotless:on */ - } - return hashCode - } + override fun hashCode(): Int = hashCode override fun toString() = "ChatCompletionAudio{id=$id, expiresAt=$expiresAt, data=$data, transcript=$transcript, additionalProperties=$additionalProperties}" diff --git a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionAudioParam.kt b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionAudioParam.kt index b4b3c2db5..f954c7a71 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionAudioParam.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionAudioParam.kt @@ -33,8 +33,9 @@ private constructor( private var validated: Boolean = false /** - * The voice the model uses to respond. Supported voices are `alloy`, `ash`, `ballad`, `coral`, - * `echo`, `sage`, `shimmer`, and `verse`. + * The voice the model uses to respond. Supported voices are `ash`, `ballad`, `coral`, `sage`, + * and `verse` (also supported but not recommended are `alloy`, `echo`, and `shimmer`; these + * voices are less expressive). */ fun voice(): Voice = voice.getRequired("voice") @@ -44,8 +45,9 @@ private constructor( fun format(): Format = format.getRequired("format") /** - * The voice the model uses to respond. Supported voices are `alloy`, `ash`, `ballad`, `coral`, - * `echo`, `sage`, `shimmer`, and `verse`. + * The voice the model uses to respond. Supported voices are `ash`, `ballad`, `coral`, `sage`, + * and `verse` (also supported but not recommended are `alloy`, `echo`, and `shimmer`; these + * voices are less expressive). */ @JsonProperty("voice") @ExcludeMissing fun _voice() = voice @@ -87,14 +89,16 @@ private constructor( } /** - * The voice the model uses to respond. Supported voices are `alloy`, `ash`, `ballad`, - * `coral`, `echo`, `sage`, `shimmer`, and `verse`. + * The voice the model uses to respond. Supported voices are `ash`, `ballad`, `coral`, + * `sage`, and `verse` (also supported but not recommended are `alloy`, `echo`, and + * `shimmer`; these voices are less expressive). */ fun voice(voice: Voice) = voice(JsonField.of(voice)) /** - * The voice the model uses to respond. Supported voices are `alloy`, `ash`, `ballad`, - * `coral`, `echo`, `sage`, `shimmer`, and `verse`. + * The voice the model uses to respond. Supported voices are `ash`, `ballad`, `coral`, + * `sage`, and `verse` (also supported but not recommended are `alloy`, `echo`, and + * `shimmer`; these voices are less expressive). */ @JsonProperty("voice") @ExcludeMissing @@ -149,7 +153,7 @@ private constructor( return true } - return /* spotless:off */ other is Format && this.value == other.value /* spotless:on */ + return /* spotless:off */ other is Format && value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -224,7 +228,7 @@ private constructor( return true } - return /* spotless:off */ other is Voice && this.value == other.value /* spotless:on */ + return /* spotless:off */ other is Voice && value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -309,17 +313,14 @@ private constructor( return true } - return /* spotless:off */ other is ChatCompletionAudioParam && this.voice == other.voice && this.format == other.format && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is ChatCompletionAudioParam && voice == other.voice && format == other.format && additionalProperties == other.additionalProperties /* spotless:on */ } - private var hashCode: Int = 0 + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(voice, format, additionalProperties) } + /* spotless:on */ - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = /* spotless:off */ Objects.hash(voice, format, additionalProperties) /* spotless:on */ - } - return hashCode - } + override fun hashCode(): Int = hashCode override fun toString() = "ChatCompletionAudioParam{voice=$voice, format=$format, additionalProperties=$additionalProperties}" diff --git a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionChunk.kt b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionChunk.kt index 9899f68bb..c32925320 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionChunk.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionChunk.kt @@ -757,17 +757,14 @@ private constructor( return true } - return /* spotless:off */ other is FunctionCall && this.arguments == other.arguments && this.name == other.name && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is FunctionCall && arguments == other.arguments && name == other.name && additionalProperties == other.additionalProperties /* spotless:on */ } - private var hashCode: Int = 0 + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(arguments, name, additionalProperties) } + /* spotless:on */ - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = /* spotless:off */ Objects.hash(arguments, name, additionalProperties) /* spotless:on */ - } - return hashCode - } + override fun hashCode(): Int = hashCode override fun toString() = "FunctionCall{arguments=$arguments, name=$name, additionalProperties=$additionalProperties}" @@ -786,7 +783,7 @@ private constructor( return true } - return /* spotless:off */ other is Role && this.value == other.value /* spotless:on */ + return /* spotless:off */ other is Role && value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -1090,17 +1087,14 @@ private constructor( return true } - return /* spotless:off */ other is Function && this.name == other.name && this.arguments == other.arguments && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Function && name == other.name && arguments == other.arguments && additionalProperties == other.additionalProperties /* spotless:on */ } - private var hashCode: Int = 0 + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(name, arguments, additionalProperties) } + /* spotless:on */ - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = /* spotless:off */ Objects.hash(name, arguments, additionalProperties) /* spotless:on */ - } - return hashCode - } + override fun hashCode(): Int = hashCode override fun toString() = "Function{name=$name, arguments=$arguments, additionalProperties=$additionalProperties}" @@ -1120,7 +1114,7 @@ private constructor( return true } - return /* spotless:off */ other is Type && this.value == other.value /* spotless:on */ + return /* spotless:off */ other is Type && value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -1163,17 +1157,14 @@ private constructor( return true } - return /* spotless:off */ other is ToolCall && this.index == other.index && this.id == other.id && this.type == other.type && this.function == other.function && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is ToolCall && index == other.index && id == other.id && type == other.type && function == other.function && additionalProperties == other.additionalProperties /* spotless:on */ } - private var hashCode: Int = 0 + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(index, id, type, function, additionalProperties) } + /* spotless:on */ - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = /* spotless:off */ Objects.hash(index, id, type, function, additionalProperties) /* spotless:on */ - } - return hashCode - } + override fun hashCode(): Int = hashCode override fun toString() = "ToolCall{index=$index, id=$id, type=$type, function=$function, additionalProperties=$additionalProperties}" @@ -1184,17 +1175,14 @@ private constructor( return true } - return /* spotless:off */ other is Delta && this.content == other.content && this.functionCall == other.functionCall && this.toolCalls == other.toolCalls && this.role == other.role && this.refusal == other.refusal && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Delta && content == other.content && functionCall == other.functionCall && toolCalls == other.toolCalls && role == other.role && refusal == other.refusal && additionalProperties == other.additionalProperties /* spotless:on */ } - private var hashCode: Int = 0 + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(content, functionCall, toolCalls, role, refusal, additionalProperties) } + /* spotless:on */ - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = /* spotless:off */ Objects.hash(content, functionCall, toolCalls, role, refusal, additionalProperties) /* spotless:on */ - } - return hashCode - } + override fun hashCode(): Int = hashCode override fun toString() = "Delta{content=$content, functionCall=$functionCall, toolCalls=$toolCalls, role=$role, refusal=$refusal, additionalProperties=$additionalProperties}" @@ -1213,7 +1201,7 @@ private constructor( return true } - return /* spotless:off */ other is FinishReason && this.value == other.value /* spotless:on */ + return /* spotless:off */ other is FinishReason && value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -1383,17 +1371,14 @@ private constructor( return true } - return /* spotless:off */ other is Logprobs && this.content == other.content && this.refusal == other.refusal && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Logprobs && content == other.content && refusal == other.refusal && additionalProperties == other.additionalProperties /* spotless:on */ } - private var hashCode: Int = 0 + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(content, refusal, additionalProperties) } + /* spotless:on */ - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = /* spotless:off */ Objects.hash(content, refusal, additionalProperties) /* spotless:on */ - } - return hashCode - } + override fun hashCode(): Int = hashCode override fun toString() = "Logprobs{content=$content, refusal=$refusal, additionalProperties=$additionalProperties}" @@ -1404,17 +1389,14 @@ private constructor( return true } - return /* spotless:off */ other is Choice && this.delta == other.delta && this.logprobs == other.logprobs && this.finishReason == other.finishReason && this.index == other.index && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Choice && delta == other.delta && logprobs == other.logprobs && finishReason == other.finishReason && index == other.index && additionalProperties == other.additionalProperties /* spotless:on */ } - private var hashCode: Int = 0 + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(delta, logprobs, finishReason, index, additionalProperties) } + /* spotless:on */ - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = /* spotless:off */ Objects.hash(delta, logprobs, finishReason, index, additionalProperties) /* spotless:on */ - } - return hashCode - } + override fun hashCode(): Int = hashCode override fun toString() = "Choice{delta=$delta, logprobs=$logprobs, finishReason=$finishReason, index=$index, additionalProperties=$additionalProperties}" @@ -1433,7 +1415,7 @@ private constructor( return true } - return /* spotless:off */ other is Object && this.value == other.value /* spotless:on */ + return /* spotless:off */ other is Object && value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -1484,7 +1466,7 @@ private constructor( return true } - return /* spotless:off */ other is ServiceTier && this.value == other.value /* spotless:on */ + return /* spotless:off */ other is ServiceTier && value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -1533,17 +1515,14 @@ private constructor( return true } - return /* spotless:off */ other is ChatCompletionChunk && this.id == other.id && this.choices == other.choices && this.created == other.created && this.model == other.model && this.serviceTier == other.serviceTier && this.systemFingerprint == other.systemFingerprint && this.object_ == other.object_ && this.usage == other.usage && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is ChatCompletionChunk && id == other.id && choices == other.choices && created == other.created && model == other.model && serviceTier == other.serviceTier && systemFingerprint == other.systemFingerprint && object_ == other.object_ && usage == other.usage && additionalProperties == other.additionalProperties /* spotless:on */ } - private var hashCode: Int = 0 + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(id, choices, created, model, serviceTier, systemFingerprint, object_, usage, additionalProperties) } + /* spotless:on */ - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = /* spotless:off */ Objects.hash(id, choices, created, model, serviceTier, systemFingerprint, object_, usage, additionalProperties) /* spotless:on */ - } - return hashCode - } + override fun hashCode(): Int = hashCode override fun toString() = "ChatCompletionChunk{id=$id, choices=$choices, created=$created, model=$model, serviceTier=$serviceTier, systemFingerprint=$systemFingerprint, object_=$object_, usage=$usage, additionalProperties=$additionalProperties}" diff --git a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionContentPart.kt b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionContentPart.kt index c423e4e96..91358cd4f 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionContentPart.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionContentPart.kt @@ -93,15 +93,13 @@ private constructor( return true } - return /* spotless:off */ other is ChatCompletionContentPart && this.chatCompletionContentPartText == other.chatCompletionContentPartText && this.chatCompletionContentPartImage == other.chatCompletionContentPartImage && this.chatCompletionContentPartInputAudio == other.chatCompletionContentPartInputAudio /* spotless:on */ + return /* spotless:off */ other is ChatCompletionContentPart && chatCompletionContentPartText == other.chatCompletionContentPartText && chatCompletionContentPartImage == other.chatCompletionContentPartImage && chatCompletionContentPartInputAudio == other.chatCompletionContentPartInputAudio /* spotless:on */ } - override fun hashCode(): Int { - return /* spotless:off */ Objects.hash(chatCompletionContentPartText, chatCompletionContentPartImage, chatCompletionContentPartInputAudio) /* spotless:on */ - } + override fun hashCode(): Int = /* spotless:off */ Objects.hash(chatCompletionContentPartText, chatCompletionContentPartImage, chatCompletionContentPartInputAudio) /* spotless:on */ - override fun toString(): String { - return when { + override fun toString(): String = + when { chatCompletionContentPartText != null -> "ChatCompletionContentPart{chatCompletionContentPartText=$chatCompletionContentPartText}" chatCompletionContentPartImage != null -> @@ -111,7 +109,6 @@ private constructor( _json != null -> "ChatCompletionContentPart{_unknown=$_json}" else -> throw IllegalStateException("Invalid ChatCompletionContentPart") } - } companion object { diff --git a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionContentPartImage.kt b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionContentPartImage.kt index ddaf38f49..c2b07a3b9 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionContentPartImage.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionContentPartImage.kt @@ -226,7 +226,7 @@ private constructor( return true } - return /* spotless:off */ other is Detail && this.value == other.value /* spotless:on */ + return /* spotless:off */ other is Detail && value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -281,17 +281,14 @@ private constructor( return true } - return /* spotless:off */ other is ImageUrl && this.url == other.url && this.detail == other.detail && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is ImageUrl && url == other.url && detail == other.detail && additionalProperties == other.additionalProperties /* spotless:on */ } - private var hashCode: Int = 0 + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(url, detail, additionalProperties) } + /* spotless:on */ - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = /* spotless:off */ Objects.hash(url, detail, additionalProperties) /* spotless:on */ - } - return hashCode - } + override fun hashCode(): Int = hashCode override fun toString() = "ImageUrl{url=$url, detail=$detail, additionalProperties=$additionalProperties}" @@ -310,7 +307,7 @@ private constructor( return true } - return /* spotless:off */ other is Type && this.value == other.value /* spotless:on */ + return /* spotless:off */ other is Type && value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -353,17 +350,14 @@ private constructor( return true } - return /* spotless:off */ other is ChatCompletionContentPartImage && this.type == other.type && this.imageUrl == other.imageUrl && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is ChatCompletionContentPartImage && type == other.type && imageUrl == other.imageUrl && additionalProperties == other.additionalProperties /* spotless:on */ } - private var hashCode: Int = 0 + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(type, imageUrl, additionalProperties) } + /* spotless:on */ - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = /* spotless:off */ Objects.hash(type, imageUrl, additionalProperties) /* spotless:on */ - } - return hashCode - } + override fun hashCode(): Int = hashCode override fun toString() = "ChatCompletionContentPartImage{type=$type, imageUrl=$imageUrl, additionalProperties=$additionalProperties}" diff --git a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionContentPartInputAudio.kt b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionContentPartInputAudio.kt index bcaee4685..55196eb62 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionContentPartInputAudio.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionContentPartInputAudio.kt @@ -215,7 +215,7 @@ private constructor( return true } - return /* spotless:off */ other is Format && this.value == other.value /* spotless:on */ + return /* spotless:off */ other is Format && value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -264,17 +264,14 @@ private constructor( return true } - return /* spotless:off */ other is InputAudio && this.data == other.data && this.format == other.format && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is InputAudio && data == other.data && format == other.format && additionalProperties == other.additionalProperties /* spotless:on */ } - private var hashCode: Int = 0 + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(data, format, additionalProperties) } + /* spotless:on */ - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = /* spotless:off */ Objects.hash(data, format, additionalProperties) /* spotless:on */ - } - return hashCode - } + override fun hashCode(): Int = hashCode override fun toString() = "InputAudio{data=$data, format=$format, additionalProperties=$additionalProperties}" @@ -293,7 +290,7 @@ private constructor( return true } - return /* spotless:off */ other is Type && this.value == other.value /* spotless:on */ + return /* spotless:off */ other is Type && value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -336,17 +333,14 @@ private constructor( return true } - return /* spotless:off */ other is ChatCompletionContentPartInputAudio && this.type == other.type && this.inputAudio == other.inputAudio && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is ChatCompletionContentPartInputAudio && type == other.type && inputAudio == other.inputAudio && additionalProperties == other.additionalProperties /* spotless:on */ } - private var hashCode: Int = 0 + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(type, inputAudio, additionalProperties) } + /* spotless:on */ - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = /* spotless:off */ Objects.hash(type, inputAudio, additionalProperties) /* spotless:on */ - } - return hashCode - } + override fun hashCode(): Int = hashCode override fun toString() = "ChatCompletionContentPartInputAudio{type=$type, inputAudio=$inputAudio, additionalProperties=$additionalProperties}" diff --git a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionContentPartRefusal.kt b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionContentPartRefusal.kt index b9d504faa..fde7193a7 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionContentPartRefusal.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionContentPartRefusal.kt @@ -124,7 +124,7 @@ private constructor( return true } - return /* spotless:off */ other is Type && this.value == other.value /* spotless:on */ + return /* spotless:off */ other is Type && value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -167,17 +167,14 @@ private constructor( return true } - return /* spotless:off */ other is ChatCompletionContentPartRefusal && this.type == other.type && this.refusal == other.refusal && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is ChatCompletionContentPartRefusal && type == other.type && refusal == other.refusal && additionalProperties == other.additionalProperties /* spotless:on */ } - private var hashCode: Int = 0 + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(type, refusal, additionalProperties) } + /* spotless:on */ - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = /* spotless:off */ Objects.hash(type, refusal, additionalProperties) /* spotless:on */ - } - return hashCode - } + override fun hashCode(): Int = hashCode override fun toString() = "ChatCompletionContentPartRefusal{type=$type, refusal=$refusal, additionalProperties=$additionalProperties}" diff --git a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionContentPartText.kt b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionContentPartText.kt index 04cabe8b6..deca739b7 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionContentPartText.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionContentPartText.kt @@ -124,7 +124,7 @@ private constructor( return true } - return /* spotless:off */ other is Type && this.value == other.value /* spotless:on */ + return /* spotless:off */ other is Type && value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -167,17 +167,14 @@ private constructor( return true } - return /* spotless:off */ other is ChatCompletionContentPartText && this.type == other.type && this.text == other.text && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is ChatCompletionContentPartText && type == other.type && text == other.text && additionalProperties == other.additionalProperties /* spotless:on */ } - private var hashCode: Int = 0 + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(type, text, additionalProperties) } + /* spotless:on */ - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = /* spotless:off */ Objects.hash(type, text, additionalProperties) /* spotless:on */ - } - return hashCode - } + override fun hashCode(): Int = hashCode override fun toString() = "ChatCompletionContentPartText{type=$type, text=$text, additionalProperties=$additionalProperties}" diff --git a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionCreateParams.kt b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionCreateParams.kt index 72dedc7c9..44ed9fe97 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionCreateParams.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionCreateParams.kt @@ -868,17 +868,14 @@ constructor( return true } - return /* spotless:off */ other is ChatCompletionCreateBody && this.messages == other.messages && this.model == other.model && this.audio == other.audio && this.frequencyPenalty == other.frequencyPenalty && this.functionCall == other.functionCall && this.functions == other.functions && this.logitBias == other.logitBias && this.logprobs == other.logprobs && this.maxCompletionTokens == other.maxCompletionTokens && this.maxTokens == other.maxTokens && this.metadata == other.metadata && this.modalities == other.modalities && this.n == other.n && this.parallelToolCalls == other.parallelToolCalls && this.prediction == other.prediction && this.presencePenalty == other.presencePenalty && this.responseFormat == other.responseFormat && this.seed == other.seed && this.serviceTier == other.serviceTier && this.stop == other.stop && this.store == other.store && this.streamOptions == other.streamOptions && this.temperature == other.temperature && this.toolChoice == other.toolChoice && this.tools == other.tools && this.topLogprobs == other.topLogprobs && this.topP == other.topP && this.user == other.user && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is ChatCompletionCreateBody && messages == other.messages && model == other.model && audio == other.audio && frequencyPenalty == other.frequencyPenalty && functionCall == other.functionCall && functions == other.functions && logitBias == other.logitBias && logprobs == other.logprobs && maxCompletionTokens == other.maxCompletionTokens && maxTokens == other.maxTokens && metadata == other.metadata && modalities == other.modalities && n == other.n && parallelToolCalls == other.parallelToolCalls && prediction == other.prediction && presencePenalty == other.presencePenalty && responseFormat == other.responseFormat && seed == other.seed && serviceTier == other.serviceTier && stop == other.stop && store == other.store && streamOptions == other.streamOptions && temperature == other.temperature && toolChoice == other.toolChoice && tools == other.tools && topLogprobs == other.topLogprobs && topP == other.topP && user == other.user && additionalProperties == other.additionalProperties /* spotless:on */ } - private var hashCode: Int = 0 + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(messages, model, audio, frequencyPenalty, functionCall, functions, logitBias, logprobs, maxCompletionTokens, maxTokens, metadata, modalities, n, parallelToolCalls, prediction, presencePenalty, responseFormat, seed, serviceTier, stop, store, streamOptions, temperature, toolChoice, tools, topLogprobs, topP, user, additionalProperties) } + /* spotless:on */ - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = /* spotless:off */ Objects.hash(messages, model, audio, frequencyPenalty, functionCall, functions, logitBias, logprobs, maxCompletionTokens, maxTokens, metadata, modalities, n, parallelToolCalls, prediction, presencePenalty, responseFormat, seed, serviceTier, stop, store, streamOptions, temperature, toolChoice, tools, topLogprobs, topP, user, additionalProperties) /* spotless:on */ - } - return hashCode - } + override fun hashCode(): Int = hashCode override fun toString() = "ChatCompletionCreateBody{messages=$messages, model=$model, audio=$audio, frequencyPenalty=$frequencyPenalty, functionCall=$functionCall, functions=$functions, logitBias=$logitBias, logprobs=$logprobs, maxCompletionTokens=$maxCompletionTokens, maxTokens=$maxTokens, metadata=$metadata, modalities=$modalities, n=$n, parallelToolCalls=$parallelToolCalls, prediction=$prediction, presencePenalty=$presencePenalty, responseFormat=$responseFormat, seed=$seed, serviceTier=$serviceTier, stop=$stop, store=$store, streamOptions=$streamOptions, temperature=$temperature, toolChoice=$toolChoice, tools=$tools, topLogprobs=$topLogprobs, topP=$topP, user=$user, additionalProperties=$additionalProperties}" @@ -895,12 +892,10 @@ constructor( return true } - return /* spotless:off */ other is ChatCompletionCreateParams && this.messages == other.messages && this.model == other.model && this.audio == other.audio && this.frequencyPenalty == other.frequencyPenalty && this.functionCall == other.functionCall && this.functions == other.functions && this.logitBias == other.logitBias && this.logprobs == other.logprobs && this.maxCompletionTokens == other.maxCompletionTokens && this.maxTokens == other.maxTokens && this.metadata == other.metadata && this.modalities == other.modalities && this.n == other.n && this.parallelToolCalls == other.parallelToolCalls && this.prediction == other.prediction && this.presencePenalty == other.presencePenalty && this.responseFormat == other.responseFormat && this.seed == other.seed && this.serviceTier == other.serviceTier && this.stop == other.stop && this.store == other.store && this.streamOptions == other.streamOptions && this.temperature == other.temperature && this.toolChoice == other.toolChoice && this.tools == other.tools && this.topLogprobs == other.topLogprobs && this.topP == other.topP && this.user == other.user && this.additionalHeaders == other.additionalHeaders && this.additionalQueryParams == other.additionalQueryParams && this.additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ + return /* spotless:off */ other is ChatCompletionCreateParams && messages == other.messages && model == other.model && audio == other.audio && frequencyPenalty == other.frequencyPenalty && functionCall == other.functionCall && functions == other.functions && logitBias == other.logitBias && logprobs == other.logprobs && maxCompletionTokens == other.maxCompletionTokens && maxTokens == other.maxTokens && metadata == other.metadata && modalities == other.modalities && n == other.n && parallelToolCalls == other.parallelToolCalls && prediction == other.prediction && presencePenalty == other.presencePenalty && responseFormat == other.responseFormat && seed == other.seed && serviceTier == other.serviceTier && stop == other.stop && store == other.store && streamOptions == other.streamOptions && temperature == other.temperature && toolChoice == other.toolChoice && tools == other.tools && topLogprobs == other.topLogprobs && topP == other.topP && user == other.user && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams && additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ } - override fun hashCode(): Int { - return /* spotless:off */ Objects.hash(messages, model, audio, frequencyPenalty, functionCall, functions, logitBias, logprobs, maxCompletionTokens, maxTokens, metadata, modalities, n, parallelToolCalls, prediction, presencePenalty, responseFormat, seed, serviceTier, stop, store, streamOptions, temperature, toolChoice, tools, topLogprobs, topP, user, additionalHeaders, additionalQueryParams, additionalBodyProperties) /* spotless:on */ - } + override fun hashCode(): Int = /* spotless:off */ Objects.hash(messages, model, audio, frequencyPenalty, functionCall, functions, logitBias, logprobs, maxCompletionTokens, maxTokens, metadata, modalities, n, parallelToolCalls, prediction, presencePenalty, responseFormat, seed, serviceTier, stop, store, streamOptions, temperature, toolChoice, tools, topLogprobs, topP, user, additionalHeaders, additionalQueryParams, additionalBodyProperties) /* spotless:on */ override fun toString() = "ChatCompletionCreateParams{messages=$messages, model=$model, audio=$audio, frequencyPenalty=$frequencyPenalty, functionCall=$functionCall, functions=$functions, logitBias=$logitBias, logprobs=$logprobs, maxCompletionTokens=$maxCompletionTokens, maxTokens=$maxTokens, metadata=$metadata, modalities=$modalities, n=$n, parallelToolCalls=$parallelToolCalls, prediction=$prediction, presencePenalty=$presencePenalty, responseFormat=$responseFormat, seed=$seed, serviceTier=$serviceTier, stop=$stop, store=$store, streamOptions=$streamOptions, temperature=$temperature, toolChoice=$toolChoice, tools=$tools, topLogprobs=$topLogprobs, topP=$topP, user=$user, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams, additionalBodyProperties=$additionalBodyProperties}" @@ -1615,7 +1610,7 @@ constructor( return true } - return /* spotless:off */ other is Model && this.value == other.value /* spotless:on */ + return /* spotless:off */ other is Model && value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -1634,6 +1629,8 @@ constructor( @JvmField val GPT_4O = Model(JsonField.of("gpt-4o")) + @JvmField val GPT_4O_2024_11_20 = Model(JsonField.of("gpt-4o-2024-11-20")) + @JvmField val GPT_4O_2024_08_06 = Model(JsonField.of("gpt-4o-2024-08-06")) @JvmField val GPT_4O_2024_05_13 = Model(JsonField.of("gpt-4o-2024-05-13")) @@ -1703,6 +1700,7 @@ constructor( O1_MINI, O1_MINI_2024_09_12, GPT_4O, + GPT_4O_2024_11_20, GPT_4O_2024_08_06, GPT_4O_2024_05_13, GPT_4O_REALTIME_PREVIEW, @@ -1739,6 +1737,7 @@ constructor( O1_MINI, O1_MINI_2024_09_12, GPT_4O, + GPT_4O_2024_11_20, GPT_4O_2024_08_06, GPT_4O_2024_05_13, GPT_4O_REALTIME_PREVIEW, @@ -1777,6 +1776,7 @@ constructor( O1_MINI -> Value.O1_MINI O1_MINI_2024_09_12 -> Value.O1_MINI_2024_09_12 GPT_4O -> Value.GPT_4O + GPT_4O_2024_11_20 -> Value.GPT_4O_2024_11_20 GPT_4O_2024_08_06 -> Value.GPT_4O_2024_08_06 GPT_4O_2024_05_13 -> Value.GPT_4O_2024_05_13 GPT_4O_REALTIME_PREVIEW -> Value.GPT_4O_REALTIME_PREVIEW @@ -1815,6 +1815,7 @@ constructor( O1_MINI -> Known.O1_MINI O1_MINI_2024_09_12 -> Known.O1_MINI_2024_09_12 GPT_4O -> Known.GPT_4O + GPT_4O_2024_11_20 -> Known.GPT_4O_2024_11_20 GPT_4O_2024_08_06 -> Known.GPT_4O_2024_08_06 GPT_4O_2024_05_13 -> Known.GPT_4O_2024_05_13 GPT_4O_REALTIME_PREVIEW -> Known.GPT_4O_REALTIME_PREVIEW @@ -1906,21 +1907,18 @@ constructor( return true } - return /* spotless:off */ other is FunctionCall && this.behavior == other.behavior && this.functionCallOption == other.functionCallOption /* spotless:on */ + return /* spotless:off */ other is FunctionCall && behavior == other.behavior && functionCallOption == other.functionCallOption /* spotless:on */ } - override fun hashCode(): Int { - return /* spotless:off */ Objects.hash(behavior, functionCallOption) /* spotless:on */ - } + override fun hashCode(): Int = /* spotless:off */ Objects.hash(behavior, functionCallOption) /* spotless:on */ - override fun toString(): String { - return when { + override fun toString(): String = + when { behavior != null -> "FunctionCall{behavior=$behavior}" functionCallOption != null -> "FunctionCall{functionCallOption=$functionCallOption}" _json != null -> "FunctionCall{_unknown=$_json}" else -> throw IllegalStateException("Invalid FunctionCall") } - } companion object { @@ -1991,7 +1989,7 @@ constructor( return true } - return /* spotless:off */ other is Behavior && this.value == other.value /* spotless:on */ + return /* spotless:off */ other is Behavior && value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -2146,17 +2144,14 @@ constructor( return true } - return /* spotless:off */ other is Function && this.description == other.description && this.name == other.name && this.parameters == other.parameters && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Function && description == other.description && name == other.name && parameters == other.parameters && additionalProperties == other.additionalProperties /* spotless:on */ } - private var hashCode: Int = 0 + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(description, name, parameters, additionalProperties) } + /* spotless:on */ - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = /* spotless:off */ Objects.hash(description, name, parameters, additionalProperties) /* spotless:on */ - } - return hashCode - } + override fun hashCode(): Int = hashCode override fun toString() = "Function{description=$description, name=$name, parameters=$parameters, additionalProperties=$additionalProperties}" @@ -2220,17 +2215,14 @@ constructor( return true } - return /* spotless:off */ other is LogitBias && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is LogitBias && additionalProperties == other.additionalProperties /* spotless:on */ } - private var hashCode: Int = 0 + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + /* spotless:on */ - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = /* spotless:off */ Objects.hash(additionalProperties) /* spotless:on */ - } - return hashCode - } + override fun hashCode(): Int = hashCode override fun toString() = "LogitBias{additionalProperties=$additionalProperties}" } @@ -2288,17 +2280,14 @@ constructor( return true } - return /* spotless:off */ other is Metadata && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Metadata && additionalProperties == other.additionalProperties /* spotless:on */ } - private var hashCode: Int = 0 + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + /* spotless:on */ - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = /* spotless:off */ Objects.hash(additionalProperties) /* spotless:on */ - } - return hashCode - } + override fun hashCode(): Int = hashCode override fun toString() = "Metadata{additionalProperties=$additionalProperties}" } @@ -2373,15 +2362,13 @@ constructor( return true } - return /* spotless:off */ other is ResponseFormat && this.responseFormatText == other.responseFormatText && this.responseFormatJsonObject == other.responseFormatJsonObject && this.responseFormatJsonSchema == other.responseFormatJsonSchema /* spotless:on */ + return /* spotless:off */ other is ResponseFormat && responseFormatText == other.responseFormatText && responseFormatJsonObject == other.responseFormatJsonObject && responseFormatJsonSchema == other.responseFormatJsonSchema /* spotless:on */ } - override fun hashCode(): Int { - return /* spotless:off */ Objects.hash(responseFormatText, responseFormatJsonObject, responseFormatJsonSchema) /* spotless:on */ - } + override fun hashCode(): Int = /* spotless:off */ Objects.hash(responseFormatText, responseFormatJsonObject, responseFormatJsonSchema) /* spotless:on */ - override fun toString(): String { - return when { + override fun toString(): String = + when { responseFormatText != null -> "ResponseFormat{responseFormatText=$responseFormatText}" responseFormatJsonObject != null -> @@ -2391,7 +2378,6 @@ constructor( _json != null -> "ResponseFormat{_unknown=$_json}" else -> throw IllegalStateException("Invalid ResponseFormat") } - } companion object { @@ -2477,7 +2463,7 @@ constructor( return true } - return /* spotless:off */ other is ServiceTier && this.value == other.value /* spotless:on */ + return /* spotless:off */ other is ServiceTier && value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -2568,21 +2554,18 @@ constructor( return true } - return /* spotless:off */ other is Stop && this.string == other.string && this.strings == other.strings /* spotless:on */ + return /* spotless:off */ other is Stop && string == other.string && strings == other.strings /* spotless:on */ } - override fun hashCode(): Int { - return /* spotless:off */ Objects.hash(string, strings) /* spotless:on */ - } + override fun hashCode(): Int = /* spotless:off */ Objects.hash(string, strings) /* spotless:on */ - override fun toString(): String { - return when { + override fun toString(): String = + when { string != null -> "Stop{string=$string}" strings != null -> "Stop{strings=$strings}" _json != null -> "Stop{_unknown=$_json}" else -> throw IllegalStateException("Invalid Stop") } - } companion object { diff --git a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionFunctionCallOption.kt b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionFunctionCallOption.kt index e6f2f30ca..7535abbfd 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionFunctionCallOption.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionFunctionCallOption.kt @@ -95,17 +95,14 @@ private constructor( return true } - return /* spotless:off */ other is ChatCompletionFunctionCallOption && this.name == other.name && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is ChatCompletionFunctionCallOption && name == other.name && additionalProperties == other.additionalProperties /* spotless:on */ } - private var hashCode: Int = 0 + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(name, additionalProperties) } + /* spotless:on */ - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = /* spotless:off */ Objects.hash(name, additionalProperties) /* spotless:on */ - } - return hashCode - } + override fun hashCode(): Int = hashCode override fun toString() = "ChatCompletionFunctionCallOption{name=$name, additionalProperties=$additionalProperties}" diff --git a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionFunctionMessageParam.kt b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionFunctionMessageParam.kt index c63a68ecd..97d8e1550 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionFunctionMessageParam.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionFunctionMessageParam.kt @@ -144,7 +144,7 @@ private constructor( return true } - return /* spotless:off */ other is Role && this.value == other.value /* spotless:on */ + return /* spotless:off */ other is Role && value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -187,17 +187,14 @@ private constructor( return true } - return /* spotless:off */ other is ChatCompletionFunctionMessageParam && this.role == other.role && this.content == other.content && this.name == other.name && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is ChatCompletionFunctionMessageParam && role == other.role && content == other.content && name == other.name && additionalProperties == other.additionalProperties /* spotless:on */ } - private var hashCode: Int = 0 + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(role, content, name, additionalProperties) } + /* spotless:on */ - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = /* spotless:off */ Objects.hash(role, content, name, additionalProperties) /* spotless:on */ - } - return hashCode - } + override fun hashCode(): Int = hashCode override fun toString() = "ChatCompletionFunctionMessageParam{role=$role, content=$content, name=$name, additionalProperties=$additionalProperties}" diff --git a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionMessage.kt b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionMessage.kt index 73013b840..caf5e8fa4 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionMessage.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionMessage.kt @@ -232,7 +232,7 @@ private constructor( return true } - return /* spotless:off */ other is Role && this.value == other.value /* spotless:on */ + return /* spotless:off */ other is Role && value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -392,17 +392,14 @@ private constructor( return true } - return /* spotless:off */ other is FunctionCall && this.arguments == other.arguments && this.name == other.name && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is FunctionCall && arguments == other.arguments && name == other.name && additionalProperties == other.additionalProperties /* spotless:on */ } - private var hashCode: Int = 0 + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(arguments, name, additionalProperties) } + /* spotless:on */ - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = /* spotless:off */ Objects.hash(arguments, name, additionalProperties) /* spotless:on */ - } - return hashCode - } + override fun hashCode(): Int = hashCode override fun toString() = "FunctionCall{arguments=$arguments, name=$name, additionalProperties=$additionalProperties}" @@ -413,17 +410,14 @@ private constructor( return true } - return /* spotless:off */ other is ChatCompletionMessage && this.content == other.content && this.refusal == other.refusal && this.toolCalls == other.toolCalls && this.role == other.role && this.functionCall == other.functionCall && this.audio == other.audio && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is ChatCompletionMessage && content == other.content && refusal == other.refusal && toolCalls == other.toolCalls && role == other.role && functionCall == other.functionCall && audio == other.audio && additionalProperties == other.additionalProperties /* spotless:on */ } - private var hashCode: Int = 0 + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(content, refusal, toolCalls, role, functionCall, audio, additionalProperties) } + /* spotless:on */ - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = /* spotless:off */ Objects.hash(content, refusal, toolCalls, role, functionCall, audio, additionalProperties) /* spotless:on */ - } - return hashCode - } + override fun hashCode(): Int = hashCode override fun toString() = "ChatCompletionMessage{content=$content, refusal=$refusal, toolCalls=$toolCalls, role=$role, functionCall=$functionCall, audio=$audio, additionalProperties=$additionalProperties}" diff --git a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionMessageParam.kt b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionMessageParam.kt index 778b94168..4dbda1733 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionMessageParam.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionMessageParam.kt @@ -118,15 +118,13 @@ private constructor( return true } - return /* spotless:off */ other is ChatCompletionMessageParam && this.chatCompletionSystemMessageParam == other.chatCompletionSystemMessageParam && this.chatCompletionUserMessageParam == other.chatCompletionUserMessageParam && this.chatCompletionAssistantMessageParam == other.chatCompletionAssistantMessageParam && this.chatCompletionToolMessageParam == other.chatCompletionToolMessageParam && this.chatCompletionFunctionMessageParam == other.chatCompletionFunctionMessageParam /* spotless:on */ + return /* spotless:off */ other is ChatCompletionMessageParam && chatCompletionSystemMessageParam == other.chatCompletionSystemMessageParam && chatCompletionUserMessageParam == other.chatCompletionUserMessageParam && chatCompletionAssistantMessageParam == other.chatCompletionAssistantMessageParam && chatCompletionToolMessageParam == other.chatCompletionToolMessageParam && chatCompletionFunctionMessageParam == other.chatCompletionFunctionMessageParam /* spotless:on */ } - override fun hashCode(): Int { - return /* spotless:off */ Objects.hash(chatCompletionSystemMessageParam, chatCompletionUserMessageParam, chatCompletionAssistantMessageParam, chatCompletionToolMessageParam, chatCompletionFunctionMessageParam) /* spotless:on */ - } + override fun hashCode(): Int = /* spotless:off */ Objects.hash(chatCompletionSystemMessageParam, chatCompletionUserMessageParam, chatCompletionAssistantMessageParam, chatCompletionToolMessageParam, chatCompletionFunctionMessageParam) /* spotless:on */ - override fun toString(): String { - return when { + override fun toString(): String = + when { chatCompletionSystemMessageParam != null -> "ChatCompletionMessageParam{chatCompletionSystemMessageParam=$chatCompletionSystemMessageParam}" chatCompletionUserMessageParam != null -> @@ -140,7 +138,6 @@ private constructor( _json != null -> "ChatCompletionMessageParam{_unknown=$_json}" else -> throw IllegalStateException("Invalid ChatCompletionMessageParam") } - } companion object { diff --git a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionMessageToolCall.kt b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionMessageToolCall.kt index 0316a49d0..7a6a29f65 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionMessageToolCall.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionMessageToolCall.kt @@ -246,17 +246,14 @@ private constructor( return true } - return /* spotless:off */ other is Function && this.name == other.name && this.arguments == other.arguments && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Function && name == other.name && arguments == other.arguments && additionalProperties == other.additionalProperties /* spotless:on */ } - private var hashCode: Int = 0 + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(name, arguments, additionalProperties) } + /* spotless:on */ - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = /* spotless:off */ Objects.hash(name, arguments, additionalProperties) /* spotless:on */ - } - return hashCode - } + override fun hashCode(): Int = hashCode override fun toString() = "Function{name=$name, arguments=$arguments, additionalProperties=$additionalProperties}" @@ -275,7 +272,7 @@ private constructor( return true } - return /* spotless:off */ other is Type && this.value == other.value /* spotless:on */ + return /* spotless:off */ other is Type && value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -318,17 +315,14 @@ private constructor( return true } - return /* spotless:off */ other is ChatCompletionMessageToolCall && this.id == other.id && this.type == other.type && this.function == other.function && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is ChatCompletionMessageToolCall && id == other.id && type == other.type && function == other.function && additionalProperties == other.additionalProperties /* spotless:on */ } - private var hashCode: Int = 0 + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(id, type, function, additionalProperties) } + /* spotless:on */ - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = /* spotless:off */ Objects.hash(id, type, function, additionalProperties) /* spotless:on */ - } - return hashCode - } + override fun hashCode(): Int = hashCode override fun toString() = "ChatCompletionMessageToolCall{id=$id, type=$type, function=$function, additionalProperties=$additionalProperties}" diff --git a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionModality.kt b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionModality.kt index ee5f2635f..dce38f716 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionModality.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionModality.kt @@ -21,7 +21,7 @@ private constructor( return true } - return /* spotless:off */ other is ChatCompletionModality && this.value == other.value /* spotless:on */ + return /* spotless:off */ other is ChatCompletionModality && value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() diff --git a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionNamedToolChoice.kt b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionNamedToolChoice.kt index cbad6cc55..83d9a1450 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionNamedToolChoice.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionNamedToolChoice.kt @@ -182,17 +182,14 @@ private constructor( return true } - return /* spotless:off */ other is Function && this.name == other.name && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Function && name == other.name && additionalProperties == other.additionalProperties /* spotless:on */ } - private var hashCode: Int = 0 + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(name, additionalProperties) } + /* spotless:on */ - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = /* spotless:off */ Objects.hash(name, additionalProperties) /* spotless:on */ - } - return hashCode - } + override fun hashCode(): Int = hashCode override fun toString() = "Function{name=$name, additionalProperties=$additionalProperties}" } @@ -210,7 +207,7 @@ private constructor( return true } - return /* spotless:off */ other is Type && this.value == other.value /* spotless:on */ + return /* spotless:off */ other is Type && value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -253,17 +250,14 @@ private constructor( return true } - return /* spotless:off */ other is ChatCompletionNamedToolChoice && this.type == other.type && this.function == other.function && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is ChatCompletionNamedToolChoice && type == other.type && function == other.function && additionalProperties == other.additionalProperties /* spotless:on */ } - private var hashCode: Int = 0 + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(type, function, additionalProperties) } + /* spotless:on */ - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = /* spotless:off */ Objects.hash(type, function, additionalProperties) /* spotless:on */ - } - return hashCode - } + override fun hashCode(): Int = hashCode override fun toString() = "ChatCompletionNamedToolChoice{type=$type, function=$function, additionalProperties=$additionalProperties}" diff --git a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionPredictionContent.kt b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionPredictionContent.kt index 0e27ce5f1..1ee12d152 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionPredictionContent.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionPredictionContent.kt @@ -206,21 +206,18 @@ private constructor( return true } - return /* spotless:off */ other is Content && this.textContent == other.textContent && this.arrayOfContentParts == other.arrayOfContentParts /* spotless:on */ + return /* spotless:off */ other is Content && textContent == other.textContent && arrayOfContentParts == other.arrayOfContentParts /* spotless:on */ } - override fun hashCode(): Int { - return /* spotless:off */ Objects.hash(textContent, arrayOfContentParts) /* spotless:on */ - } + override fun hashCode(): Int = /* spotless:off */ Objects.hash(textContent, arrayOfContentParts) /* spotless:on */ - override fun toString(): String { - return when { + override fun toString(): String = + when { textContent != null -> "Content{textContent=$textContent}" arrayOfContentParts != null -> "Content{arrayOfContentParts=$arrayOfContentParts}" _json != null -> "Content{_unknown=$_json}" else -> throw IllegalStateException("Invalid Content") } - } companion object { @@ -294,7 +291,7 @@ private constructor( return true } - return /* spotless:off */ other is Type && this.value == other.value /* spotless:on */ + return /* spotless:off */ other is Type && value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -337,17 +334,14 @@ private constructor( return true } - return /* spotless:off */ other is ChatCompletionPredictionContent && this.type == other.type && this.content == other.content && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is ChatCompletionPredictionContent && type == other.type && content == other.content && additionalProperties == other.additionalProperties /* spotless:on */ } - private var hashCode: Int = 0 + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(type, content, additionalProperties) } + /* spotless:on */ - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = /* spotless:off */ Objects.hash(type, content, additionalProperties) /* spotless:on */ - } - return hashCode - } + override fun hashCode(): Int = hashCode override fun toString() = "ChatCompletionPredictionContent{type=$type, content=$content, additionalProperties=$additionalProperties}" diff --git a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionRole.kt b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionRole.kt index b3bdc4fec..8b32335e7 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionRole.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionRole.kt @@ -21,7 +21,7 @@ private constructor( return true } - return /* spotless:off */ other is ChatCompletionRole && this.value == other.value /* spotless:on */ + return /* spotless:off */ other is ChatCompletionRole && value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() diff --git a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionStreamOptions.kt b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionStreamOptions.kt index 2825e36ad..ff1c5506b 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionStreamOptions.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionStreamOptions.kt @@ -115,17 +115,14 @@ private constructor( return true } - return /* spotless:off */ other is ChatCompletionStreamOptions && this.includeUsage == other.includeUsage && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is ChatCompletionStreamOptions && includeUsage == other.includeUsage && additionalProperties == other.additionalProperties /* spotless:on */ } - private var hashCode: Int = 0 + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(includeUsage, additionalProperties) } + /* spotless:on */ - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = /* spotless:off */ Objects.hash(includeUsage, additionalProperties) /* spotless:on */ - } - return hashCode - } + override fun hashCode(): Int = hashCode override fun toString() = "ChatCompletionStreamOptions{includeUsage=$includeUsage, additionalProperties=$additionalProperties}" diff --git a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionSystemMessageParam.kt b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionSystemMessageParam.kt index 5cbd25f59..c23734457 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionSystemMessageParam.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionSystemMessageParam.kt @@ -206,21 +206,18 @@ private constructor( return true } - return /* spotless:off */ other is Content && this.textContent == other.textContent && this.arrayOfContentParts == other.arrayOfContentParts /* spotless:on */ + return /* spotless:off */ other is Content && textContent == other.textContent && arrayOfContentParts == other.arrayOfContentParts /* spotless:on */ } - override fun hashCode(): Int { - return /* spotless:off */ Objects.hash(textContent, arrayOfContentParts) /* spotless:on */ - } + override fun hashCode(): Int = /* spotless:off */ Objects.hash(textContent, arrayOfContentParts) /* spotless:on */ - override fun toString(): String { - return when { + override fun toString(): String = + when { textContent != null -> "Content{textContent=$textContent}" arrayOfContentParts != null -> "Content{arrayOfContentParts=$arrayOfContentParts}" _json != null -> "Content{_unknown=$_json}" else -> throw IllegalStateException("Invalid Content") } - } companion object { @@ -294,7 +291,7 @@ private constructor( return true } - return /* spotless:off */ other is Role && this.value == other.value /* spotless:on */ + return /* spotless:off */ other is Role && value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -337,17 +334,14 @@ private constructor( return true } - return /* spotless:off */ other is ChatCompletionSystemMessageParam && this.content == other.content && this.role == other.role && this.name == other.name && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is ChatCompletionSystemMessageParam && content == other.content && role == other.role && name == other.name && additionalProperties == other.additionalProperties /* spotless:on */ } - private var hashCode: Int = 0 + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(content, role, name, additionalProperties) } + /* spotless:on */ - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = /* spotless:off */ Objects.hash(content, role, name, additionalProperties) /* spotless:on */ - } - return hashCode - } + override fun hashCode(): Int = hashCode override fun toString() = "ChatCompletionSystemMessageParam{content=$content, role=$role, name=$name, additionalProperties=$additionalProperties}" diff --git a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionTokenLogprob.kt b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionTokenLogprob.kt index d6cb4874b..ee476074d 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionTokenLogprob.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionTokenLogprob.kt @@ -341,17 +341,14 @@ private constructor( return true } - return /* spotless:off */ other is TopLogprob && this.token == other.token && this.logprob == other.logprob && this.bytes == other.bytes && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is TopLogprob && token == other.token && logprob == other.logprob && bytes == other.bytes && additionalProperties == other.additionalProperties /* spotless:on */ } - private var hashCode: Int = 0 + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(token, logprob, bytes, additionalProperties) } + /* spotless:on */ - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = /* spotless:off */ Objects.hash(token, logprob, bytes, additionalProperties) /* spotless:on */ - } - return hashCode - } + override fun hashCode(): Int = hashCode override fun toString() = "TopLogprob{token=$token, logprob=$logprob, bytes=$bytes, additionalProperties=$additionalProperties}" @@ -362,17 +359,14 @@ private constructor( return true } - return /* spotless:off */ other is ChatCompletionTokenLogprob && this.token == other.token && this.logprob == other.logprob && this.bytes == other.bytes && this.topLogprobs == other.topLogprobs && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is ChatCompletionTokenLogprob && token == other.token && logprob == other.logprob && bytes == other.bytes && topLogprobs == other.topLogprobs && additionalProperties == other.additionalProperties /* spotless:on */ } - private var hashCode: Int = 0 + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(token, logprob, bytes, topLogprobs, additionalProperties) } + /* spotless:on */ - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = /* spotless:off */ Objects.hash(token, logprob, bytes, topLogprobs, additionalProperties) /* spotless:on */ - } - return hashCode - } + override fun hashCode(): Int = hashCode override fun toString() = "ChatCompletionTokenLogprob{token=$token, logprob=$logprob, bytes=$bytes, topLogprobs=$topLogprobs, additionalProperties=$additionalProperties}" diff --git a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionTool.kt b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionTool.kt index 017d04bbf..7b769ef10 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionTool.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionTool.kt @@ -119,7 +119,7 @@ private constructor( return true } - return /* spotless:off */ other is Type && this.value == other.value /* spotless:on */ + return /* spotless:off */ other is Type && value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -162,17 +162,14 @@ private constructor( return true } - return /* spotless:off */ other is ChatCompletionTool && this.type == other.type && this.function == other.function && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is ChatCompletionTool && type == other.type && function == other.function && additionalProperties == other.additionalProperties /* spotless:on */ } - private var hashCode: Int = 0 + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(type, function, additionalProperties) } + /* spotless:on */ - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = /* spotless:off */ Objects.hash(type, function, additionalProperties) /* spotless:on */ - } - return hashCode - } + override fun hashCode(): Int = hashCode override fun toString() = "ChatCompletionTool{type=$type, function=$function, additionalProperties=$additionalProperties}" diff --git a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionToolChoiceOption.kt b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionToolChoiceOption.kt index 879da2a1f..5519ea0cf 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionToolChoiceOption.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionToolChoiceOption.kt @@ -78,22 +78,19 @@ private constructor( return true } - return /* spotless:off */ other is ChatCompletionToolChoiceOption && this.behavior == other.behavior && this.chatCompletionNamedToolChoice == other.chatCompletionNamedToolChoice /* spotless:on */ + return /* spotless:off */ other is ChatCompletionToolChoiceOption && behavior == other.behavior && chatCompletionNamedToolChoice == other.chatCompletionNamedToolChoice /* spotless:on */ } - override fun hashCode(): Int { - return /* spotless:off */ Objects.hash(behavior, chatCompletionNamedToolChoice) /* spotless:on */ - } + override fun hashCode(): Int = /* spotless:off */ Objects.hash(behavior, chatCompletionNamedToolChoice) /* spotless:on */ - override fun toString(): String { - return when { + override fun toString(): String = + when { behavior != null -> "ChatCompletionToolChoiceOption{behavior=$behavior}" chatCompletionNamedToolChoice != null -> "ChatCompletionToolChoiceOption{chatCompletionNamedToolChoice=$chatCompletionNamedToolChoice}" _json != null -> "ChatCompletionToolChoiceOption{_unknown=$_json}" else -> throw IllegalStateException("Invalid ChatCompletionToolChoiceOption") } - } companion object { @@ -174,7 +171,7 @@ private constructor( return true } - return /* spotless:off */ other is Behavior && this.value == other.value /* spotless:on */ + return /* spotless:off */ other is Behavior && value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() diff --git a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionToolMessageParam.kt b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionToolMessageParam.kt index 452698f16..8e16bbf26 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionToolMessageParam.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionToolMessageParam.kt @@ -193,21 +193,18 @@ private constructor( return true } - return /* spotless:off */ other is Content && this.textContent == other.textContent && this.arrayOfContentParts == other.arrayOfContentParts /* spotless:on */ + return /* spotless:off */ other is Content && textContent == other.textContent && arrayOfContentParts == other.arrayOfContentParts /* spotless:on */ } - override fun hashCode(): Int { - return /* spotless:off */ Objects.hash(textContent, arrayOfContentParts) /* spotless:on */ - } + override fun hashCode(): Int = /* spotless:off */ Objects.hash(textContent, arrayOfContentParts) /* spotless:on */ - override fun toString(): String { - return when { + override fun toString(): String = + when { textContent != null -> "Content{textContent=$textContent}" arrayOfContentParts != null -> "Content{arrayOfContentParts=$arrayOfContentParts}" _json != null -> "Content{_unknown=$_json}" else -> throw IllegalStateException("Invalid Content") } - } companion object { @@ -281,7 +278,7 @@ private constructor( return true } - return /* spotless:off */ other is Role && this.value == other.value /* spotless:on */ + return /* spotless:off */ other is Role && value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -324,17 +321,14 @@ private constructor( return true } - return /* spotless:off */ other is ChatCompletionToolMessageParam && this.role == other.role && this.content == other.content && this.toolCallId == other.toolCallId && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is ChatCompletionToolMessageParam && role == other.role && content == other.content && toolCallId == other.toolCallId && additionalProperties == other.additionalProperties /* spotless:on */ } - private var hashCode: Int = 0 + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(role, content, toolCallId, additionalProperties) } + /* spotless:on */ - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = /* spotless:off */ Objects.hash(role, content, toolCallId, additionalProperties) /* spotless:on */ - } - return hashCode - } + override fun hashCode(): Int = hashCode override fun toString() = "ChatCompletionToolMessageParam{role=$role, content=$content, toolCallId=$toolCallId, additionalProperties=$additionalProperties}" diff --git a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionUserMessageParam.kt b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionUserMessageParam.kt index fa7a4d0f0..5257b2cb2 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionUserMessageParam.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/ChatCompletionUserMessageParam.kt @@ -205,21 +205,18 @@ private constructor( return true } - return /* spotless:off */ other is Content && this.textContent == other.textContent && this.arrayOfContentParts == other.arrayOfContentParts /* spotless:on */ + return /* spotless:off */ other is Content && textContent == other.textContent && arrayOfContentParts == other.arrayOfContentParts /* spotless:on */ } - override fun hashCode(): Int { - return /* spotless:off */ Objects.hash(textContent, arrayOfContentParts) /* spotless:on */ - } + override fun hashCode(): Int = /* spotless:off */ Objects.hash(textContent, arrayOfContentParts) /* spotless:on */ - override fun toString(): String { - return when { + override fun toString(): String = + when { textContent != null -> "Content{textContent=$textContent}" arrayOfContentParts != null -> "Content{arrayOfContentParts=$arrayOfContentParts}" _json != null -> "Content{_unknown=$_json}" else -> throw IllegalStateException("Invalid Content") } - } companion object { @@ -288,7 +285,7 @@ private constructor( return true } - return /* spotless:off */ other is Role && this.value == other.value /* spotless:on */ + return /* spotless:off */ other is Role && value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -331,17 +328,14 @@ private constructor( return true } - return /* spotless:off */ other is ChatCompletionUserMessageParam && this.content == other.content && this.role == other.role && this.name == other.name && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is ChatCompletionUserMessageParam && content == other.content && role == other.role && name == other.name && additionalProperties == other.additionalProperties /* spotless:on */ } - private var hashCode: Int = 0 + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(content, role, name, additionalProperties) } + /* spotless:on */ - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = /* spotless:off */ Objects.hash(content, role, name, additionalProperties) /* spotless:on */ - } - return hashCode - } + override fun hashCode(): Int = hashCode override fun toString() = "ChatCompletionUserMessageParam{content=$content, role=$role, name=$name, additionalProperties=$additionalProperties}" diff --git a/openai-java-core/src/main/kotlin/com/openai/models/ChatModel.kt b/openai-java-core/src/main/kotlin/com/openai/models/ChatModel.kt index cfec25f63..2e8840da0 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/ChatModel.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/ChatModel.kt @@ -21,7 +21,7 @@ private constructor( return true } - return /* spotless:off */ other is ChatModel && this.value == other.value /* spotless:on */ + return /* spotless:off */ other is ChatModel && value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -40,6 +40,8 @@ private constructor( @JvmField val GPT_4O = ChatModel(JsonField.of("gpt-4o")) + @JvmField val GPT_4O_2024_11_20 = ChatModel(JsonField.of("gpt-4o-2024-11-20")) + @JvmField val GPT_4O_2024_08_06 = ChatModel(JsonField.of("gpt-4o-2024-08-06")) @JvmField val GPT_4O_2024_05_13 = ChatModel(JsonField.of("gpt-4o-2024-05-13")) @@ -109,6 +111,7 @@ private constructor( O1_MINI, O1_MINI_2024_09_12, GPT_4O, + GPT_4O_2024_11_20, GPT_4O_2024_08_06, GPT_4O_2024_05_13, GPT_4O_REALTIME_PREVIEW, @@ -145,6 +148,7 @@ private constructor( O1_MINI, O1_MINI_2024_09_12, GPT_4O, + GPT_4O_2024_11_20, GPT_4O_2024_08_06, GPT_4O_2024_05_13, GPT_4O_REALTIME_PREVIEW, @@ -183,6 +187,7 @@ private constructor( O1_MINI -> Value.O1_MINI O1_MINI_2024_09_12 -> Value.O1_MINI_2024_09_12 GPT_4O -> Value.GPT_4O + GPT_4O_2024_11_20 -> Value.GPT_4O_2024_11_20 GPT_4O_2024_08_06 -> Value.GPT_4O_2024_08_06 GPT_4O_2024_05_13 -> Value.GPT_4O_2024_05_13 GPT_4O_REALTIME_PREVIEW -> Value.GPT_4O_REALTIME_PREVIEW @@ -221,6 +226,7 @@ private constructor( O1_MINI -> Known.O1_MINI O1_MINI_2024_09_12 -> Known.O1_MINI_2024_09_12 GPT_4O -> Known.GPT_4O + GPT_4O_2024_11_20 -> Known.GPT_4O_2024_11_20 GPT_4O_2024_08_06 -> Known.GPT_4O_2024_08_06 GPT_4O_2024_05_13 -> Known.GPT_4O_2024_05_13 GPT_4O_REALTIME_PREVIEW -> Known.GPT_4O_REALTIME_PREVIEW diff --git a/openai-java-core/src/main/kotlin/com/openai/models/Completion.kt b/openai-java-core/src/main/kotlin/com/openai/models/Completion.kt index c85cfb7a8..439f45be7 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/Completion.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/Completion.kt @@ -245,7 +245,7 @@ private constructor( return true } - return /* spotless:off */ other is Object && this.value == other.value /* spotless:on */ + return /* spotless:off */ other is Object && value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -288,17 +288,14 @@ private constructor( return true } - return /* spotless:off */ other is Completion && this.id == other.id && this.choices == other.choices && this.created == other.created && this.model == other.model && this.systemFingerprint == other.systemFingerprint && this.object_ == other.object_ && this.usage == other.usage && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Completion && id == other.id && choices == other.choices && created == other.created && model == other.model && systemFingerprint == other.systemFingerprint && object_ == other.object_ && usage == other.usage && additionalProperties == other.additionalProperties /* spotless:on */ } - private var hashCode: Int = 0 + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(id, choices, created, model, systemFingerprint, object_, usage, additionalProperties) } + /* spotless:on */ - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = /* spotless:off */ Objects.hash(id, choices, created, model, systemFingerprint, object_, usage, additionalProperties) /* spotless:on */ - } - return hashCode - } + override fun hashCode(): Int = hashCode override fun toString() = "Completion{id=$id, choices=$choices, created=$created, model=$model, systemFingerprint=$systemFingerprint, object_=$object_, usage=$usage, additionalProperties=$additionalProperties}" diff --git a/openai-java-core/src/main/kotlin/com/openai/models/CompletionChoice.kt b/openai-java-core/src/main/kotlin/com/openai/models/CompletionChoice.kt index b4c5119cc..8fa768549 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/CompletionChoice.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/CompletionChoice.kt @@ -172,7 +172,7 @@ private constructor( return true } - return /* spotless:off */ other is FinishReason && this.value == other.value /* spotless:on */ + return /* spotless:off */ other is FinishReason && value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -405,17 +405,14 @@ private constructor( return true } - return /* spotless:off */ other is TopLogprob && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is TopLogprob && additionalProperties == other.additionalProperties /* spotless:on */ } - private var hashCode: Int = 0 + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + /* spotless:on */ - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = /* spotless:off */ Objects.hash(additionalProperties) /* spotless:on */ - } - return hashCode - } + override fun hashCode(): Int = hashCode override fun toString() = "TopLogprob{additionalProperties=$additionalProperties}" } @@ -425,17 +422,14 @@ private constructor( return true } - return /* spotless:off */ other is Logprobs && this.textOffset == other.textOffset && this.tokenLogprobs == other.tokenLogprobs && this.tokens == other.tokens && this.topLogprobs == other.topLogprobs && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Logprobs && textOffset == other.textOffset && tokenLogprobs == other.tokenLogprobs && tokens == other.tokens && topLogprobs == other.topLogprobs && additionalProperties == other.additionalProperties /* spotless:on */ } - private var hashCode: Int = 0 + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(textOffset, tokenLogprobs, tokens, topLogprobs, additionalProperties) } + /* spotless:on */ - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = /* spotless:off */ Objects.hash(textOffset, tokenLogprobs, tokens, topLogprobs, additionalProperties) /* spotless:on */ - } - return hashCode - } + override fun hashCode(): Int = hashCode override fun toString() = "Logprobs{textOffset=$textOffset, tokenLogprobs=$tokenLogprobs, tokens=$tokens, topLogprobs=$topLogprobs, additionalProperties=$additionalProperties}" @@ -446,17 +440,14 @@ private constructor( return true } - return /* spotless:off */ other is CompletionChoice && this.finishReason == other.finishReason && this.index == other.index && this.logprobs == other.logprobs && this.text == other.text && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is CompletionChoice && finishReason == other.finishReason && index == other.index && logprobs == other.logprobs && text == other.text && additionalProperties == other.additionalProperties /* spotless:on */ } - private var hashCode: Int = 0 + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(finishReason, index, logprobs, text, additionalProperties) } + /* spotless:on */ - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = /* spotless:off */ Objects.hash(finishReason, index, logprobs, text, additionalProperties) /* spotless:on */ - } - return hashCode - } + override fun hashCode(): Int = hashCode override fun toString() = "CompletionChoice{finishReason=$finishReason, index=$index, logprobs=$logprobs, text=$text, additionalProperties=$additionalProperties}" diff --git a/openai-java-core/src/main/kotlin/com/openai/models/CompletionCreateParams.kt b/openai-java-core/src/main/kotlin/com/openai/models/CompletionCreateParams.kt index 160269df4..944f82c80 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/CompletionCreateParams.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/CompletionCreateParams.kt @@ -547,17 +547,14 @@ constructor( return true } - return /* spotless:off */ other is CompletionCreateBody && this.model == other.model && this.prompt == other.prompt && this.bestOf == other.bestOf && this.echo == other.echo && this.frequencyPenalty == other.frequencyPenalty && this.logitBias == other.logitBias && this.logprobs == other.logprobs && this.maxTokens == other.maxTokens && this.n == other.n && this.presencePenalty == other.presencePenalty && this.seed == other.seed && this.stop == other.stop && this.streamOptions == other.streamOptions && this.suffix == other.suffix && this.temperature == other.temperature && this.topP == other.topP && this.user == other.user && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is CompletionCreateBody && model == other.model && prompt == other.prompt && bestOf == other.bestOf && echo == other.echo && frequencyPenalty == other.frequencyPenalty && logitBias == other.logitBias && logprobs == other.logprobs && maxTokens == other.maxTokens && n == other.n && presencePenalty == other.presencePenalty && seed == other.seed && stop == other.stop && streamOptions == other.streamOptions && suffix == other.suffix && temperature == other.temperature && topP == other.topP && user == other.user && additionalProperties == other.additionalProperties /* spotless:on */ } - private var hashCode: Int = 0 + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(model, prompt, bestOf, echo, frequencyPenalty, logitBias, logprobs, maxTokens, n, presencePenalty, seed, stop, streamOptions, suffix, temperature, topP, user, additionalProperties) } + /* spotless:on */ - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = /* spotless:off */ Objects.hash(model, prompt, bestOf, echo, frequencyPenalty, logitBias, logprobs, maxTokens, n, presencePenalty, seed, stop, streamOptions, suffix, temperature, topP, user, additionalProperties) /* spotless:on */ - } - return hashCode - } + override fun hashCode(): Int = hashCode override fun toString() = "CompletionCreateBody{model=$model, prompt=$prompt, bestOf=$bestOf, echo=$echo, frequencyPenalty=$frequencyPenalty, logitBias=$logitBias, logprobs=$logprobs, maxTokens=$maxTokens, n=$n, presencePenalty=$presencePenalty, seed=$seed, stop=$stop, streamOptions=$streamOptions, suffix=$suffix, temperature=$temperature, topP=$topP, user=$user, additionalProperties=$additionalProperties}" @@ -574,12 +571,10 @@ constructor( return true } - return /* spotless:off */ other is CompletionCreateParams && this.model == other.model && this.prompt == other.prompt && this.bestOf == other.bestOf && this.echo == other.echo && this.frequencyPenalty == other.frequencyPenalty && this.logitBias == other.logitBias && this.logprobs == other.logprobs && this.maxTokens == other.maxTokens && this.n == other.n && this.presencePenalty == other.presencePenalty && this.seed == other.seed && this.stop == other.stop && this.streamOptions == other.streamOptions && this.suffix == other.suffix && this.temperature == other.temperature && this.topP == other.topP && this.user == other.user && this.additionalHeaders == other.additionalHeaders && this.additionalQueryParams == other.additionalQueryParams && this.additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ + return /* spotless:off */ other is CompletionCreateParams && model == other.model && prompt == other.prompt && bestOf == other.bestOf && echo == other.echo && frequencyPenalty == other.frequencyPenalty && logitBias == other.logitBias && logprobs == other.logprobs && maxTokens == other.maxTokens && n == other.n && presencePenalty == other.presencePenalty && seed == other.seed && stop == other.stop && streamOptions == other.streamOptions && suffix == other.suffix && temperature == other.temperature && topP == other.topP && user == other.user && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams && additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ } - override fun hashCode(): Int { - return /* spotless:off */ Objects.hash(model, prompt, bestOf, echo, frequencyPenalty, logitBias, logprobs, maxTokens, n, presencePenalty, seed, stop, streamOptions, suffix, temperature, topP, user, additionalHeaders, additionalQueryParams, additionalBodyProperties) /* spotless:on */ - } + override fun hashCode(): Int = /* spotless:off */ Objects.hash(model, prompt, bestOf, echo, frequencyPenalty, logitBias, logprobs, maxTokens, n, presencePenalty, seed, stop, streamOptions, suffix, temperature, topP, user, additionalHeaders, additionalQueryParams, additionalBodyProperties) /* spotless:on */ override fun toString() = "CompletionCreateParams{model=$model, prompt=$prompt, bestOf=$bestOf, echo=$echo, frequencyPenalty=$frequencyPenalty, logitBias=$logitBias, logprobs=$logprobs, maxTokens=$maxTokens, n=$n, presencePenalty=$presencePenalty, seed=$seed, stop=$stop, streamOptions=$streamOptions, suffix=$suffix, temperature=$temperature, topP=$topP, user=$user, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams, additionalBodyProperties=$additionalBodyProperties}" @@ -1017,7 +1012,7 @@ constructor( return true } - return /* spotless:off */ other is Model && this.value == other.value /* spotless:on */ + return /* spotless:off */ other is Model && value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -1137,15 +1132,13 @@ constructor( return true } - return /* spotless:off */ other is Prompt && this.string == other.string && this.arrayOfStrings == other.arrayOfStrings && this.arrayOfTokens == other.arrayOfTokens && this.arrayOfTokenArrays == other.arrayOfTokenArrays /* spotless:on */ + return /* spotless:off */ other is Prompt && string == other.string && arrayOfStrings == other.arrayOfStrings && arrayOfTokens == other.arrayOfTokens && arrayOfTokenArrays == other.arrayOfTokenArrays /* spotless:on */ } - override fun hashCode(): Int { - return /* spotless:off */ Objects.hash(string, arrayOfStrings, arrayOfTokens, arrayOfTokenArrays) /* spotless:on */ - } + override fun hashCode(): Int = /* spotless:off */ Objects.hash(string, arrayOfStrings, arrayOfTokens, arrayOfTokenArrays) /* spotless:on */ - override fun toString(): String { - return when { + override fun toString(): String = + when { string != null -> "Prompt{string=$string}" arrayOfStrings != null -> "Prompt{arrayOfStrings=$arrayOfStrings}" arrayOfTokens != null -> "Prompt{arrayOfTokens=$arrayOfTokens}" @@ -1153,7 +1146,6 @@ constructor( _json != null -> "Prompt{_unknown=$_json}" else -> throw IllegalStateException("Invalid Prompt") } - } companion object { @@ -1290,17 +1282,14 @@ constructor( return true } - return /* spotless:off */ other is LogitBias && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is LogitBias && additionalProperties == other.additionalProperties /* spotless:on */ } - private var hashCode: Int = 0 + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + /* spotless:on */ - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = /* spotless:off */ Objects.hash(additionalProperties) /* spotless:on */ - } - return hashCode - } + override fun hashCode(): Int = hashCode override fun toString() = "LogitBias{additionalProperties=$additionalProperties}" } @@ -1352,21 +1341,18 @@ constructor( return true } - return /* spotless:off */ other is Stop && this.string == other.string && this.strings == other.strings /* spotless:on */ + return /* spotless:off */ other is Stop && string == other.string && strings == other.strings /* spotless:on */ } - override fun hashCode(): Int { - return /* spotless:off */ Objects.hash(string, strings) /* spotless:on */ - } + override fun hashCode(): Int = /* spotless:off */ Objects.hash(string, strings) /* spotless:on */ - override fun toString(): String { - return when { + override fun toString(): String = + when { string != null -> "Stop{string=$string}" strings != null -> "Stop{strings=$strings}" _json != null -> "Stop{_unknown=$_json}" else -> throw IllegalStateException("Invalid Stop") } - } companion object { diff --git a/openai-java-core/src/main/kotlin/com/openai/models/CompletionUsage.kt b/openai-java-core/src/main/kotlin/com/openai/models/CompletionUsage.kt index ab6861e78..922b62fab 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/CompletionUsage.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/CompletionUsage.kt @@ -366,17 +366,14 @@ private constructor( return true } - return /* spotless:off */ other is CompletionTokensDetails && this.acceptedPredictionTokens == other.acceptedPredictionTokens && this.audioTokens == other.audioTokens && this.reasoningTokens == other.reasoningTokens && this.rejectedPredictionTokens == other.rejectedPredictionTokens && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is CompletionTokensDetails && acceptedPredictionTokens == other.acceptedPredictionTokens && audioTokens == other.audioTokens && reasoningTokens == other.reasoningTokens && rejectedPredictionTokens == other.rejectedPredictionTokens && additionalProperties == other.additionalProperties /* spotless:on */ } - private var hashCode: Int = 0 + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(acceptedPredictionTokens, audioTokens, reasoningTokens, rejectedPredictionTokens, additionalProperties) } + /* spotless:on */ - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = /* spotless:off */ Objects.hash(acceptedPredictionTokens, audioTokens, reasoningTokens, rejectedPredictionTokens, additionalProperties) /* spotless:on */ - } - return hashCode - } + override fun hashCode(): Int = hashCode override fun toString() = "CompletionTokensDetails{acceptedPredictionTokens=$acceptedPredictionTokens, audioTokens=$audioTokens, reasoningTokens=$reasoningTokens, rejectedPredictionTokens=$rejectedPredictionTokens, additionalProperties=$additionalProperties}" @@ -485,17 +482,14 @@ private constructor( return true } - return /* spotless:off */ other is PromptTokensDetails && this.audioTokens == other.audioTokens && this.cachedTokens == other.cachedTokens && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is PromptTokensDetails && audioTokens == other.audioTokens && cachedTokens == other.cachedTokens && additionalProperties == other.additionalProperties /* spotless:on */ } - private var hashCode: Int = 0 + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(audioTokens, cachedTokens, additionalProperties) } + /* spotless:on */ - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = /* spotless:off */ Objects.hash(audioTokens, cachedTokens, additionalProperties) /* spotless:on */ - } - return hashCode - } + override fun hashCode(): Int = hashCode override fun toString() = "PromptTokensDetails{audioTokens=$audioTokens, cachedTokens=$cachedTokens, additionalProperties=$additionalProperties}" @@ -506,17 +500,14 @@ private constructor( return true } - return /* spotless:off */ other is CompletionUsage && this.completionTokens == other.completionTokens && this.promptTokens == other.promptTokens && this.totalTokens == other.totalTokens && this.completionTokensDetails == other.completionTokensDetails && this.promptTokensDetails == other.promptTokensDetails && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is CompletionUsage && completionTokens == other.completionTokens && promptTokens == other.promptTokens && totalTokens == other.totalTokens && completionTokensDetails == other.completionTokensDetails && promptTokensDetails == other.promptTokensDetails && additionalProperties == other.additionalProperties /* spotless:on */ } - private var hashCode: Int = 0 + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(completionTokens, promptTokens, totalTokens, completionTokensDetails, promptTokensDetails, additionalProperties) } + /* spotless:on */ - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = /* spotless:off */ Objects.hash(completionTokens, promptTokens, totalTokens, completionTokensDetails, promptTokensDetails, additionalProperties) /* spotless:on */ - } - return hashCode - } + override fun hashCode(): Int = hashCode override fun toString() = "CompletionUsage{completionTokens=$completionTokens, promptTokens=$promptTokens, totalTokens=$totalTokens, completionTokensDetails=$completionTokensDetails, promptTokensDetails=$promptTokensDetails, additionalProperties=$additionalProperties}" diff --git a/openai-java-core/src/main/kotlin/com/openai/models/CreateEmbeddingResponse.kt b/openai-java-core/src/main/kotlin/com/openai/models/CreateEmbeddingResponse.kt index d365a1d2a..b2d8fbf51 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/CreateEmbeddingResponse.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/CreateEmbeddingResponse.kt @@ -161,7 +161,7 @@ private constructor( return true } - return /* spotless:off */ other is Object && this.value == other.value /* spotless:on */ + return /* spotless:off */ other is Object && value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -300,17 +300,14 @@ private constructor( return true } - return /* spotless:off */ other is Usage && this.promptTokens == other.promptTokens && this.totalTokens == other.totalTokens && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Usage && promptTokens == other.promptTokens && totalTokens == other.totalTokens && additionalProperties == other.additionalProperties /* spotless:on */ } - private var hashCode: Int = 0 + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(promptTokens, totalTokens, additionalProperties) } + /* spotless:on */ - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = /* spotless:off */ Objects.hash(promptTokens, totalTokens, additionalProperties) /* spotless:on */ - } - return hashCode - } + override fun hashCode(): Int = hashCode override fun toString() = "Usage{promptTokens=$promptTokens, totalTokens=$totalTokens, additionalProperties=$additionalProperties}" @@ -321,17 +318,14 @@ private constructor( return true } - return /* spotless:off */ other is CreateEmbeddingResponse && this.data == other.data && this.model == other.model && this.object_ == other.object_ && this.usage == other.usage && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is CreateEmbeddingResponse && data == other.data && model == other.model && object_ == other.object_ && usage == other.usage && additionalProperties == other.additionalProperties /* spotless:on */ } - private var hashCode: Int = 0 + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(data, model, object_, usage, additionalProperties) } + /* spotless:on */ - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = /* spotless:off */ Objects.hash(data, model, object_, usage, additionalProperties) /* spotless:on */ - } - return hashCode - } + override fun hashCode(): Int = hashCode override fun toString() = "CreateEmbeddingResponse{data=$data, model=$model, object_=$object_, usage=$usage, additionalProperties=$additionalProperties}" diff --git a/openai-java-core/src/main/kotlin/com/openai/models/Embedding.kt b/openai-java-core/src/main/kotlin/com/openai/models/Embedding.kt index 2d0629270..c8a6e9ccd 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/Embedding.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/Embedding.kt @@ -157,7 +157,7 @@ private constructor( return true } - return /* spotless:off */ other is Object && this.value == other.value /* spotless:on */ + return /* spotless:off */ other is Object && value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -200,17 +200,14 @@ private constructor( return true } - return /* spotless:off */ other is Embedding && this.index == other.index && this.embedding == other.embedding && this.object_ == other.object_ && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Embedding && index == other.index && embedding == other.embedding && object_ == other.object_ && additionalProperties == other.additionalProperties /* spotless:on */ } - private var hashCode: Int = 0 + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(index, embedding, object_, additionalProperties) } + /* spotless:on */ - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = /* spotless:off */ Objects.hash(index, embedding, object_, additionalProperties) /* spotless:on */ - } - return hashCode - } + override fun hashCode(): Int = hashCode override fun toString() = "Embedding{index=$index, embedding=$embedding, object_=$object_, additionalProperties=$additionalProperties}" diff --git a/openai-java-core/src/main/kotlin/com/openai/models/EmbeddingCreateParams.kt b/openai-java-core/src/main/kotlin/com/openai/models/EmbeddingCreateParams.kt index 623c90652..d1920aadd 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/EmbeddingCreateParams.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/EmbeddingCreateParams.kt @@ -218,17 +218,14 @@ constructor( return true } - return /* spotless:off */ other is EmbeddingCreateBody && this.input == other.input && this.model == other.model && this.dimensions == other.dimensions && this.encodingFormat == other.encodingFormat && this.user == other.user && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is EmbeddingCreateBody && input == other.input && model == other.model && dimensions == other.dimensions && encodingFormat == other.encodingFormat && user == other.user && additionalProperties == other.additionalProperties /* spotless:on */ } - private var hashCode: Int = 0 + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(input, model, dimensions, encodingFormat, user, additionalProperties) } + /* spotless:on */ - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = /* spotless:off */ Objects.hash(input, model, dimensions, encodingFormat, user, additionalProperties) /* spotless:on */ - } - return hashCode - } + override fun hashCode(): Int = hashCode override fun toString() = "EmbeddingCreateBody{input=$input, model=$model, dimensions=$dimensions, encodingFormat=$encodingFormat, user=$user, additionalProperties=$additionalProperties}" @@ -245,12 +242,10 @@ constructor( return true } - return /* spotless:off */ other is EmbeddingCreateParams && this.input == other.input && this.model == other.model && this.dimensions == other.dimensions && this.encodingFormat == other.encodingFormat && this.user == other.user && this.additionalHeaders == other.additionalHeaders && this.additionalQueryParams == other.additionalQueryParams && this.additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ + return /* spotless:off */ other is EmbeddingCreateParams && input == other.input && model == other.model && dimensions == other.dimensions && encodingFormat == other.encodingFormat && user == other.user && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams && additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ } - override fun hashCode(): Int { - return /* spotless:off */ Objects.hash(input, model, dimensions, encodingFormat, user, additionalHeaders, additionalQueryParams, additionalBodyProperties) /* spotless:on */ - } + override fun hashCode(): Int = /* spotless:off */ Objects.hash(input, model, dimensions, encodingFormat, user, additionalHeaders, additionalQueryParams, additionalBodyProperties) /* spotless:on */ override fun toString() = "EmbeddingCreateParams{input=$input, model=$model, dimensions=$dimensions, encodingFormat=$encodingFormat, user=$user, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams, additionalBodyProperties=$additionalBodyProperties}" @@ -583,15 +578,13 @@ constructor( return true } - return /* spotless:off */ other is Input && this.string == other.string && this.arrayOfStrings == other.arrayOfStrings && this.arrayOfTokens == other.arrayOfTokens && this.arrayOfTokenArrays == other.arrayOfTokenArrays /* spotless:on */ + return /* spotless:off */ other is Input && string == other.string && arrayOfStrings == other.arrayOfStrings && arrayOfTokens == other.arrayOfTokens && arrayOfTokenArrays == other.arrayOfTokenArrays /* spotless:on */ } - override fun hashCode(): Int { - return /* spotless:off */ Objects.hash(string, arrayOfStrings, arrayOfTokens, arrayOfTokenArrays) /* spotless:on */ - } + override fun hashCode(): Int = /* spotless:off */ Objects.hash(string, arrayOfStrings, arrayOfTokens, arrayOfTokenArrays) /* spotless:on */ - override fun toString(): String { - return when { + override fun toString(): String = + when { string != null -> "Input{string=$string}" arrayOfStrings != null -> "Input{arrayOfStrings=$arrayOfStrings}" arrayOfTokens != null -> "Input{arrayOfTokens=$arrayOfTokens}" @@ -599,7 +592,6 @@ constructor( _json != null -> "Input{_unknown=$_json}" else -> throw IllegalStateException("Invalid Input") } - } companion object { @@ -687,7 +679,7 @@ constructor( return true } - return /* spotless:off */ other is Model && this.value == other.value /* spotless:on */ + return /* spotless:off */ other is Model && value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -750,7 +742,7 @@ constructor( return true } - return /* spotless:off */ other is EncodingFormat && this.value == other.value /* spotless:on */ + return /* spotless:off */ other is EncodingFormat && value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() diff --git a/openai-java-core/src/main/kotlin/com/openai/models/EmbeddingModel.kt b/openai-java-core/src/main/kotlin/com/openai/models/EmbeddingModel.kt index e3e748f20..cac9df22c 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/EmbeddingModel.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/EmbeddingModel.kt @@ -21,7 +21,7 @@ private constructor( return true } - return /* spotless:off */ other is EmbeddingModel && this.value == other.value /* spotless:on */ + return /* spotless:off */ other is EmbeddingModel && value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() diff --git a/openai-java-core/src/main/kotlin/com/openai/models/ErrorObject.kt b/openai-java-core/src/main/kotlin/com/openai/models/ErrorObject.kt index 971262223..31ee0d40a 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/ErrorObject.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/ErrorObject.kt @@ -135,17 +135,14 @@ private constructor( return true } - return /* spotless:off */ other is ErrorObject && this.code == other.code && this.message == other.message && this.param == other.param && this.type == other.type && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is ErrorObject && code == other.code && message == other.message && param == other.param && type == other.type && additionalProperties == other.additionalProperties /* spotless:on */ } - private var hashCode: Int = 0 + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(code, message, param, type, additionalProperties) } + /* spotless:on */ - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = /* spotless:off */ Objects.hash(code, message, param, type, additionalProperties) /* spotless:on */ - } - return hashCode - } + override fun hashCode(): Int = hashCode override fun toString() = "ErrorObject{code=$code, message=$message, param=$param, type=$type, additionalProperties=$additionalProperties}" diff --git a/openai-java-core/src/main/kotlin/com/openai/models/FileDeleteParams.kt b/openai-java-core/src/main/kotlin/com/openai/models/FileDeleteParams.kt index fbc22690d..a69aa9b44 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/FileDeleteParams.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/FileDeleteParams.kt @@ -48,12 +48,10 @@ constructor( return true } - return /* spotless:off */ other is FileDeleteParams && this.fileId == other.fileId && this.additionalHeaders == other.additionalHeaders && this.additionalQueryParams == other.additionalQueryParams && this.additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ + return /* spotless:off */ other is FileDeleteParams && fileId == other.fileId && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams && additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ } - override fun hashCode(): Int { - return /* spotless:off */ Objects.hash(fileId, additionalHeaders, additionalQueryParams, additionalBodyProperties) /* spotless:on */ - } + override fun hashCode(): Int = /* spotless:off */ Objects.hash(fileId, additionalHeaders, additionalQueryParams, additionalBodyProperties) /* spotless:on */ override fun toString() = "FileDeleteParams{fileId=$fileId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams, additionalBodyProperties=$additionalBodyProperties}" diff --git a/openai-java-core/src/main/kotlin/com/openai/models/FileDeleted.kt b/openai-java-core/src/main/kotlin/com/openai/models/FileDeleted.kt index 71ec722b4..6c290c493 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/FileDeleted.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/FileDeleted.kt @@ -128,7 +128,7 @@ private constructor( return true } - return /* spotless:off */ other is Object && this.value == other.value /* spotless:on */ + return /* spotless:off */ other is Object && value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -171,17 +171,14 @@ private constructor( return true } - return /* spotless:off */ other is FileDeleted && this.id == other.id && this.object_ == other.object_ && this.deleted == other.deleted && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is FileDeleted && id == other.id && object_ == other.object_ && deleted == other.deleted && additionalProperties == other.additionalProperties /* spotless:on */ } - private var hashCode: Int = 0 + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(id, object_, deleted, additionalProperties) } + /* spotless:on */ - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = /* spotless:off */ Objects.hash(id, object_, deleted, additionalProperties) /* spotless:on */ - } - return hashCode - } + override fun hashCode(): Int = hashCode override fun toString() = "FileDeleted{id=$id, object_=$object_, deleted=$deleted, additionalProperties=$additionalProperties}" diff --git a/openai-java-core/src/main/kotlin/com/openai/models/FileListPage.kt b/openai-java-core/src/main/kotlin/com/openai/models/FileListPage.kt index 964d459a2..83bc1f6d4 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/FileListPage.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/FileListPage.kt @@ -34,12 +34,10 @@ private constructor( return true } - return /* spotless:off */ other is FileListPage && this.filesService == other.filesService && this.params == other.params && this.response == other.response /* spotless:on */ + return /* spotless:off */ other is FileListPage && filesService == other.filesService && params == other.params && response == other.response /* spotless:on */ } - override fun hashCode(): Int { - return /* spotless:off */ Objects.hash(filesService, params, response) /* spotless:on */ - } + override fun hashCode(): Int = /* spotless:off */ Objects.hash(filesService, params, response) /* spotless:on */ override fun toString() = "FileListPage{filesService=$filesService, params=$params, response=$response}" @@ -106,15 +104,12 @@ private constructor( return true } - return /* spotless:off */ other is Response && this.data == other.data && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Response && data == other.data && additionalProperties == other.additionalProperties /* spotless:on */ } - override fun hashCode(): Int { - return /* spotless:off */ Objects.hash(data, additionalProperties) /* spotless:on */ - } + override fun hashCode(): Int = /* spotless:off */ Objects.hash(data, additionalProperties) /* spotless:on */ - override fun toString() = - "FileListPage.Response{data=$data, additionalProperties=$additionalProperties}" + override fun toString() = "Response{data=$data, additionalProperties=$additionalProperties}" companion object { diff --git a/openai-java-core/src/main/kotlin/com/openai/models/FileListPageAsync.kt b/openai-java-core/src/main/kotlin/com/openai/models/FileListPageAsync.kt index 63e3cbb71..8239e71b7 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/FileListPageAsync.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/FileListPageAsync.kt @@ -35,12 +35,10 @@ private constructor( return true } - return /* spotless:off */ other is FileListPageAsync && this.filesService == other.filesService && this.params == other.params && this.response == other.response /* spotless:on */ + return /* spotless:off */ other is FileListPageAsync && filesService == other.filesService && params == other.params && response == other.response /* spotless:on */ } - override fun hashCode(): Int { - return /* spotless:off */ Objects.hash(filesService, params, response) /* spotless:on */ - } + override fun hashCode(): Int = /* spotless:off */ Objects.hash(filesService, params, response) /* spotless:on */ override fun toString() = "FileListPageAsync{filesService=$filesService, params=$params, response=$response}" @@ -109,15 +107,12 @@ private constructor( return true } - return /* spotless:off */ other is Response && this.data == other.data && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Response && data == other.data && additionalProperties == other.additionalProperties /* spotless:on */ } - override fun hashCode(): Int { - return /* spotless:off */ Objects.hash(data, additionalProperties) /* spotless:on */ - } + override fun hashCode(): Int = /* spotless:off */ Objects.hash(data, additionalProperties) /* spotless:on */ - override fun toString() = - "FileListPageAsync.Response{data=$data, additionalProperties=$additionalProperties}" + override fun toString() = "Response{data=$data, additionalProperties=$additionalProperties}" companion object { diff --git a/openai-java-core/src/main/kotlin/com/openai/models/FileListParams.kt b/openai-java-core/src/main/kotlin/com/openai/models/FileListParams.kt index fc73facd4..7daa59f61 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/FileListParams.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/FileListParams.kt @@ -54,12 +54,10 @@ constructor( return true } - return /* spotless:off */ other is FileListParams && this.after == other.after && this.limit == other.limit && this.order == other.order && this.purpose == other.purpose && this.additionalHeaders == other.additionalHeaders && this.additionalQueryParams == other.additionalQueryParams /* spotless:on */ + return /* spotless:off */ other is FileListParams && after == other.after && limit == other.limit && order == other.order && purpose == other.purpose && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams /* spotless:on */ } - override fun hashCode(): Int { - return /* spotless:off */ Objects.hash(after, limit, order, purpose, additionalHeaders, additionalQueryParams) /* spotless:on */ - } + override fun hashCode(): Int = /* spotless:off */ Objects.hash(after, limit, order, purpose, additionalHeaders, additionalQueryParams) /* spotless:on */ override fun toString() = "FileListParams{after=$after, limit=$limit, order=$order, purpose=$purpose, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" @@ -236,7 +234,7 @@ constructor( return true } - return /* spotless:off */ other is Order && this.value == other.value /* spotless:on */ + return /* spotless:off */ other is Order && value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() diff --git a/openai-java-core/src/main/kotlin/com/openai/models/FileObject.kt b/openai-java-core/src/main/kotlin/com/openai/models/FileObject.kt index ecc67571f..cd38e262a 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/FileObject.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/FileObject.kt @@ -276,7 +276,7 @@ private constructor( return true } - return /* spotless:off */ other is Object && this.value == other.value /* spotless:on */ + return /* spotless:off */ other is Object && value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -327,7 +327,7 @@ private constructor( return true } - return /* spotless:off */ other is Purpose && this.value == other.value /* spotless:on */ + return /* spotless:off */ other is Purpose && value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -414,7 +414,7 @@ private constructor( return true } - return /* spotless:off */ other is Status && this.value == other.value /* spotless:on */ + return /* spotless:off */ other is Status && value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -469,17 +469,14 @@ private constructor( return true } - return /* spotless:off */ other is FileObject && this.id == other.id && this.bytes == other.bytes && this.createdAt == other.createdAt && this.filename == other.filename && this.object_ == other.object_ && this.purpose == other.purpose && this.status == other.status && this.statusDetails == other.statusDetails && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is FileObject && id == other.id && bytes == other.bytes && createdAt == other.createdAt && filename == other.filename && object_ == other.object_ && purpose == other.purpose && status == other.status && statusDetails == other.statusDetails && additionalProperties == other.additionalProperties /* spotless:on */ } - private var hashCode: Int = 0 + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(id, bytes, createdAt, filename, object_, purpose, status, statusDetails, additionalProperties) } + /* spotless:on */ - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = /* spotless:off */ Objects.hash(id, bytes, createdAt, filename, object_, purpose, status, statusDetails, additionalProperties) /* spotless:on */ - } - return hashCode - } + override fun hashCode(): Int = hashCode override fun toString() = "FileObject{id=$id, bytes=$bytes, createdAt=$createdAt, filename=$filename, object_=$object_, purpose=$purpose, status=$status, statusDetails=$statusDetails, additionalProperties=$additionalProperties}" diff --git a/openai-java-core/src/main/kotlin/com/openai/models/FilePurpose.kt b/openai-java-core/src/main/kotlin/com/openai/models/FilePurpose.kt index 16ec87bae..79ff551f1 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/FilePurpose.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/FilePurpose.kt @@ -21,7 +21,7 @@ private constructor( return true } - return /* spotless:off */ other is FilePurpose && this.value == other.value /* spotless:on */ + return /* spotless:off */ other is FilePurpose && value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() diff --git a/openai-java-core/src/main/kotlin/com/openai/models/FileRetrieveParams.kt b/openai-java-core/src/main/kotlin/com/openai/models/FileRetrieveParams.kt index 35bcbf452..5922b5443 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/FileRetrieveParams.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/FileRetrieveParams.kt @@ -37,12 +37,10 @@ constructor( return true } - return /* spotless:off */ other is FileRetrieveParams && this.fileId == other.fileId && this.additionalHeaders == other.additionalHeaders && this.additionalQueryParams == other.additionalQueryParams /* spotless:on */ + return /* spotless:off */ other is FileRetrieveParams && fileId == other.fileId && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams /* spotless:on */ } - override fun hashCode(): Int { - return /* spotless:off */ Objects.hash(fileId, additionalHeaders, additionalQueryParams) /* spotless:on */ - } + override fun hashCode(): Int = /* spotless:off */ Objects.hash(fileId, additionalHeaders, additionalQueryParams) /* spotless:on */ override fun toString() = "FileRetrieveParams{fileId=$fileId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" diff --git a/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJob.kt b/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJob.kt index a2397bd70..cd3cdf96d 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJob.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJob.kt @@ -690,17 +690,14 @@ private constructor( return true } - return /* spotless:off */ other is Error && this.code == other.code && this.message == other.message && this.param == other.param && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Error && code == other.code && message == other.message && param == other.param && additionalProperties == other.additionalProperties /* spotless:on */ } - private var hashCode: Int = 0 + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(code, message, param, additionalProperties) } + /* spotless:on */ - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = /* spotless:off */ Objects.hash(code, message, param, additionalProperties) /* spotless:on */ - } - return hashCode - } + override fun hashCode(): Int = hashCode override fun toString() = "Error{code=$code, message=$message, param=$param, additionalProperties=$additionalProperties}" @@ -848,21 +845,18 @@ private constructor( return true } - return /* spotless:off */ other is NEpochs && this.behavior == other.behavior && this.integer == other.integer /* spotless:on */ + return /* spotless:off */ other is NEpochs && behavior == other.behavior && integer == other.integer /* spotless:on */ } - override fun hashCode(): Int { - return /* spotless:off */ Objects.hash(behavior, integer) /* spotless:on */ - } + override fun hashCode(): Int = /* spotless:off */ Objects.hash(behavior, integer) /* spotless:on */ - override fun toString(): String { - return when { + override fun toString(): String = + when { behavior != null -> "NEpochs{behavior=$behavior}" integer != null -> "NEpochs{integer=$integer}" _json != null -> "NEpochs{_unknown=$_json}" else -> throw IllegalStateException("Invalid NEpochs") } - } companion object { @@ -927,7 +921,7 @@ private constructor( return true } - return /* spotless:off */ other is Behavior && this.value == other.value /* spotless:on */ + return /* spotless:off */ other is Behavior && value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -971,17 +965,14 @@ private constructor( return true } - return /* spotless:off */ other is Hyperparameters && this.nEpochs == other.nEpochs && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Hyperparameters && nEpochs == other.nEpochs && additionalProperties == other.additionalProperties /* spotless:on */ } - private var hashCode: Int = 0 + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(nEpochs, additionalProperties) } + /* spotless:on */ - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = /* spotless:off */ Objects.hash(nEpochs, additionalProperties) /* spotless:on */ - } - return hashCode - } + override fun hashCode(): Int = hashCode override fun toString() = "Hyperparameters{nEpochs=$nEpochs, additionalProperties=$additionalProperties}" @@ -1000,7 +991,7 @@ private constructor( return true } - return /* spotless:off */ other is Object && this.value == other.value /* spotless:on */ + return /* spotless:off */ other is Object && value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -1051,7 +1042,7 @@ private constructor( return true } - return /* spotless:off */ other is Status && this.value == other.value /* spotless:on */ + return /* spotless:off */ other is Status && value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -1124,17 +1115,14 @@ private constructor( return true } - return /* spotless:off */ other is FineTuningJob && this.id == other.id && this.createdAt == other.createdAt && this.error == other.error && this.fineTunedModel == other.fineTunedModel && this.finishedAt == other.finishedAt && this.hyperparameters == other.hyperparameters && this.model == other.model && this.object_ == other.object_ && this.organizationId == other.organizationId && this.resultFiles == other.resultFiles && this.status == other.status && this.trainedTokens == other.trainedTokens && this.trainingFile == other.trainingFile && this.validationFile == other.validationFile && this.integrations == other.integrations && this.seed == other.seed && this.estimatedFinish == other.estimatedFinish && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is FineTuningJob && id == other.id && createdAt == other.createdAt && error == other.error && fineTunedModel == other.fineTunedModel && finishedAt == other.finishedAt && hyperparameters == other.hyperparameters && model == other.model && object_ == other.object_ && organizationId == other.organizationId && resultFiles == other.resultFiles && status == other.status && trainedTokens == other.trainedTokens && trainingFile == other.trainingFile && validationFile == other.validationFile && integrations == other.integrations && seed == other.seed && estimatedFinish == other.estimatedFinish && additionalProperties == other.additionalProperties /* spotless:on */ } - private var hashCode: Int = 0 + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(id, createdAt, error, fineTunedModel, finishedAt, hyperparameters, model, object_, organizationId, resultFiles, status, trainedTokens, trainingFile, validationFile, integrations, seed, estimatedFinish, additionalProperties) } + /* spotless:on */ - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = /* spotless:off */ Objects.hash(id, createdAt, error, fineTunedModel, finishedAt, hyperparameters, model, object_, organizationId, resultFiles, status, trainedTokens, trainingFile, validationFile, integrations, seed, estimatedFinish, additionalProperties) /* spotless:on */ - } - return hashCode - } + override fun hashCode(): Int = hashCode override fun toString() = "FineTuningJob{id=$id, createdAt=$createdAt, error=$error, fineTunedModel=$fineTunedModel, finishedAt=$finishedAt, hyperparameters=$hyperparameters, model=$model, object_=$object_, organizationId=$organizationId, resultFiles=$resultFiles, status=$status, trainedTokens=$trainedTokens, trainingFile=$trainingFile, validationFile=$validationFile, integrations=$integrations, seed=$seed, estimatedFinish=$estimatedFinish, additionalProperties=$additionalProperties}" diff --git a/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJobCancelParams.kt b/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJobCancelParams.kt index 3a2eb89b6..8c20c5783 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJobCancelParams.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJobCancelParams.kt @@ -48,12 +48,10 @@ constructor( return true } - return /* spotless:off */ other is FineTuningJobCancelParams && this.fineTuningJobId == other.fineTuningJobId && this.additionalHeaders == other.additionalHeaders && this.additionalQueryParams == other.additionalQueryParams && this.additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ + return /* spotless:off */ other is FineTuningJobCancelParams && fineTuningJobId == other.fineTuningJobId && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams && additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ } - override fun hashCode(): Int { - return /* spotless:off */ Objects.hash(fineTuningJobId, additionalHeaders, additionalQueryParams, additionalBodyProperties) /* spotless:on */ - } + override fun hashCode(): Int = /* spotless:off */ Objects.hash(fineTuningJobId, additionalHeaders, additionalQueryParams, additionalBodyProperties) /* spotless:on */ override fun toString() = "FineTuningJobCancelParams{fineTuningJobId=$fineTuningJobId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams, additionalBodyProperties=$additionalBodyProperties}" diff --git a/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJobCheckpoint.kt b/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJobCheckpoint.kt index 2430799eb..5900e1a00 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJobCheckpoint.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJobCheckpoint.kt @@ -406,17 +406,14 @@ private constructor( return true } - return /* spotless:off */ other is Metrics && this.step == other.step && this.trainLoss == other.trainLoss && this.trainMeanTokenAccuracy == other.trainMeanTokenAccuracy && this.validLoss == other.validLoss && this.validMeanTokenAccuracy == other.validMeanTokenAccuracy && this.fullValidLoss == other.fullValidLoss && this.fullValidMeanTokenAccuracy == other.fullValidMeanTokenAccuracy && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Metrics && step == other.step && trainLoss == other.trainLoss && trainMeanTokenAccuracy == other.trainMeanTokenAccuracy && validLoss == other.validLoss && validMeanTokenAccuracy == other.validMeanTokenAccuracy && fullValidLoss == other.fullValidLoss && fullValidMeanTokenAccuracy == other.fullValidMeanTokenAccuracy && additionalProperties == other.additionalProperties /* spotless:on */ } - private var hashCode: Int = 0 + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(step, trainLoss, trainMeanTokenAccuracy, validLoss, validMeanTokenAccuracy, fullValidLoss, fullValidMeanTokenAccuracy, additionalProperties) } + /* spotless:on */ - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = /* spotless:off */ Objects.hash(step, trainLoss, trainMeanTokenAccuracy, validLoss, validMeanTokenAccuracy, fullValidLoss, fullValidMeanTokenAccuracy, additionalProperties) /* spotless:on */ - } - return hashCode - } + override fun hashCode(): Int = hashCode override fun toString() = "Metrics{step=$step, trainLoss=$trainLoss, trainMeanTokenAccuracy=$trainMeanTokenAccuracy, validLoss=$validLoss, validMeanTokenAccuracy=$validMeanTokenAccuracy, fullValidLoss=$fullValidLoss, fullValidMeanTokenAccuracy=$fullValidMeanTokenAccuracy, additionalProperties=$additionalProperties}" @@ -435,7 +432,7 @@ private constructor( return true } - return /* spotless:off */ other is Object && this.value == other.value /* spotless:on */ + return /* spotless:off */ other is Object && value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -479,17 +476,14 @@ private constructor( return true } - return /* spotless:off */ other is FineTuningJobCheckpoint && this.id == other.id && this.createdAt == other.createdAt && this.fineTunedModelCheckpoint == other.fineTunedModelCheckpoint && this.stepNumber == other.stepNumber && this.metrics == other.metrics && this.fineTuningJobId == other.fineTuningJobId && this.object_ == other.object_ && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is FineTuningJobCheckpoint && id == other.id && createdAt == other.createdAt && fineTunedModelCheckpoint == other.fineTunedModelCheckpoint && stepNumber == other.stepNumber && metrics == other.metrics && fineTuningJobId == other.fineTuningJobId && object_ == other.object_ && additionalProperties == other.additionalProperties /* spotless:on */ } - private var hashCode: Int = 0 + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(id, createdAt, fineTunedModelCheckpoint, stepNumber, metrics, fineTuningJobId, object_, additionalProperties) } + /* spotless:on */ - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = /* spotless:off */ Objects.hash(id, createdAt, fineTunedModelCheckpoint, stepNumber, metrics, fineTuningJobId, object_, additionalProperties) /* spotless:on */ - } - return hashCode - } + override fun hashCode(): Int = hashCode override fun toString() = "FineTuningJobCheckpoint{id=$id, createdAt=$createdAt, fineTunedModelCheckpoint=$fineTunedModelCheckpoint, stepNumber=$stepNumber, metrics=$metrics, fineTuningJobId=$fineTuningJobId, object_=$object_, additionalProperties=$additionalProperties}" diff --git a/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJobCheckpointListPage.kt b/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJobCheckpointListPage.kt index 6eee9eb60..c2fe63fe1 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJobCheckpointListPage.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJobCheckpointListPage.kt @@ -34,12 +34,10 @@ private constructor( return true } - return /* spotless:off */ other is FineTuningJobCheckpointListPage && this.checkpointsService == other.checkpointsService && this.params == other.params && this.response == other.response /* spotless:on */ + return /* spotless:off */ other is FineTuningJobCheckpointListPage && checkpointsService == other.checkpointsService && params == other.params && response == other.response /* spotless:on */ } - override fun hashCode(): Int { - return /* spotless:off */ Objects.hash(checkpointsService, params, response) /* spotless:on */ - } + override fun hashCode(): Int = /* spotless:off */ Objects.hash(checkpointsService, params, response) /* spotless:on */ override fun toString() = "FineTuningJobCheckpointListPage{checkpointsService=$checkpointsService, params=$params, response=$response}" @@ -115,15 +113,12 @@ private constructor( return true } - return /* spotless:off */ other is Response && this.data == other.data && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Response && data == other.data && additionalProperties == other.additionalProperties /* spotless:on */ } - override fun hashCode(): Int { - return /* spotless:off */ Objects.hash(data, additionalProperties) /* spotless:on */ - } + override fun hashCode(): Int = /* spotless:off */ Objects.hash(data, additionalProperties) /* spotless:on */ - override fun toString() = - "FineTuningJobCheckpointListPage.Response{data=$data, additionalProperties=$additionalProperties}" + override fun toString() = "Response{data=$data, additionalProperties=$additionalProperties}" companion object { diff --git a/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJobCheckpointListPageAsync.kt b/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJobCheckpointListPageAsync.kt index 5a210fb52..641c3e2d7 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJobCheckpointListPageAsync.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJobCheckpointListPageAsync.kt @@ -35,12 +35,10 @@ private constructor( return true } - return /* spotless:off */ other is FineTuningJobCheckpointListPageAsync && this.checkpointsService == other.checkpointsService && this.params == other.params && this.response == other.response /* spotless:on */ + return /* spotless:off */ other is FineTuningJobCheckpointListPageAsync && checkpointsService == other.checkpointsService && params == other.params && response == other.response /* spotless:on */ } - override fun hashCode(): Int { - return /* spotless:off */ Objects.hash(checkpointsService, params, response) /* spotless:on */ - } + override fun hashCode(): Int = /* spotless:off */ Objects.hash(checkpointsService, params, response) /* spotless:on */ override fun toString() = "FineTuningJobCheckpointListPageAsync{checkpointsService=$checkpointsService, params=$params, response=$response}" @@ -118,15 +116,12 @@ private constructor( return true } - return /* spotless:off */ other is Response && this.data == other.data && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Response && data == other.data && additionalProperties == other.additionalProperties /* spotless:on */ } - override fun hashCode(): Int { - return /* spotless:off */ Objects.hash(data, additionalProperties) /* spotless:on */ - } + override fun hashCode(): Int = /* spotless:off */ Objects.hash(data, additionalProperties) /* spotless:on */ - override fun toString() = - "FineTuningJobCheckpointListPageAsync.Response{data=$data, additionalProperties=$additionalProperties}" + override fun toString() = "Response{data=$data, additionalProperties=$additionalProperties}" companion object { diff --git a/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJobCheckpointListParams.kt b/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJobCheckpointListParams.kt index 4679552f8..aebdee673 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJobCheckpointListParams.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJobCheckpointListParams.kt @@ -51,12 +51,10 @@ constructor( return true } - return /* spotless:off */ other is FineTuningJobCheckpointListParams && this.fineTuningJobId == other.fineTuningJobId && this.after == other.after && this.limit == other.limit && this.additionalHeaders == other.additionalHeaders && this.additionalQueryParams == other.additionalQueryParams /* spotless:on */ + return /* spotless:off */ other is FineTuningJobCheckpointListParams && fineTuningJobId == other.fineTuningJobId && after == other.after && limit == other.limit && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams /* spotless:on */ } - override fun hashCode(): Int { - return /* spotless:off */ Objects.hash(fineTuningJobId, after, limit, additionalHeaders, additionalQueryParams) /* spotless:on */ - } + override fun hashCode(): Int = /* spotless:off */ Objects.hash(fineTuningJobId, after, limit, additionalHeaders, additionalQueryParams) /* spotless:on */ override fun toString() = "FineTuningJobCheckpointListParams{fineTuningJobId=$fineTuningJobId, after=$after, limit=$limit, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" diff --git a/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJobCreateParams.kt b/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJobCreateParams.kt index b3664f3e9..ee821c6f7 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJobCreateParams.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJobCreateParams.kt @@ -287,17 +287,14 @@ constructor( return true } - return /* spotless:off */ other is FineTuningJobCreateBody && this.model == other.model && this.trainingFile == other.trainingFile && this.hyperparameters == other.hyperparameters && this.integrations == other.integrations && this.seed == other.seed && this.suffix == other.suffix && this.validationFile == other.validationFile && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is FineTuningJobCreateBody && model == other.model && trainingFile == other.trainingFile && hyperparameters == other.hyperparameters && integrations == other.integrations && seed == other.seed && suffix == other.suffix && validationFile == other.validationFile && additionalProperties == other.additionalProperties /* spotless:on */ } - private var hashCode: Int = 0 + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(model, trainingFile, hyperparameters, integrations, seed, suffix, validationFile, additionalProperties) } + /* spotless:on */ - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = /* spotless:off */ Objects.hash(model, trainingFile, hyperparameters, integrations, seed, suffix, validationFile, additionalProperties) /* spotless:on */ - } - return hashCode - } + override fun hashCode(): Int = hashCode override fun toString() = "FineTuningJobCreateBody{model=$model, trainingFile=$trainingFile, hyperparameters=$hyperparameters, integrations=$integrations, seed=$seed, suffix=$suffix, validationFile=$validationFile, additionalProperties=$additionalProperties}" @@ -314,12 +311,10 @@ constructor( return true } - return /* spotless:off */ other is FineTuningJobCreateParams && this.model == other.model && this.trainingFile == other.trainingFile && this.hyperparameters == other.hyperparameters && this.integrations == other.integrations && this.seed == other.seed && this.suffix == other.suffix && this.validationFile == other.validationFile && this.additionalHeaders == other.additionalHeaders && this.additionalQueryParams == other.additionalQueryParams && this.additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ + return /* spotless:off */ other is FineTuningJobCreateParams && model == other.model && trainingFile == other.trainingFile && hyperparameters == other.hyperparameters && integrations == other.integrations && seed == other.seed && suffix == other.suffix && validationFile == other.validationFile && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams && additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ } - override fun hashCode(): Int { - return /* spotless:off */ Objects.hash(model, trainingFile, hyperparameters, integrations, seed, suffix, validationFile, additionalHeaders, additionalQueryParams, additionalBodyProperties) /* spotless:on */ - } + override fun hashCode(): Int = /* spotless:off */ Objects.hash(model, trainingFile, hyperparameters, integrations, seed, suffix, validationFile, additionalHeaders, additionalQueryParams, additionalBodyProperties) /* spotless:on */ override fun toString() = "FineTuningJobCreateParams{model=$model, trainingFile=$trainingFile, hyperparameters=$hyperparameters, integrations=$integrations, seed=$seed, suffix=$suffix, validationFile=$validationFile, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams, additionalBodyProperties=$additionalBodyProperties}" @@ -582,7 +577,7 @@ constructor( return true } - return /* spotless:off */ other is Model && this.value == other.value /* spotless:on */ + return /* spotless:off */ other is Model && value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -787,21 +782,18 @@ constructor( return true } - return /* spotless:off */ other is BatchSize && this.behavior == other.behavior && this.integer == other.integer /* spotless:on */ + return /* spotless:off */ other is BatchSize && behavior == other.behavior && integer == other.integer /* spotless:on */ } - override fun hashCode(): Int { - return /* spotless:off */ Objects.hash(behavior, integer) /* spotless:on */ - } + override fun hashCode(): Int = /* spotless:off */ Objects.hash(behavior, integer) /* spotless:on */ - override fun toString(): String { - return when { + override fun toString(): String = + when { behavior != null -> "BatchSize{behavior=$behavior}" integer != null -> "BatchSize{integer=$integer}" _json != null -> "BatchSize{_unknown=$_json}" else -> throw IllegalStateException("Invalid BatchSize") } - } companion object { @@ -866,7 +858,7 @@ constructor( return true } - return /* spotless:off */ other is Behavior && this.value == other.value /* spotless:on */ + return /* spotless:off */ other is Behavior && value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -952,21 +944,18 @@ constructor( return true } - return /* spotless:off */ other is LearningRateMultiplier && this.behavior == other.behavior && this.number == other.number /* spotless:on */ + return /* spotless:off */ other is LearningRateMultiplier && behavior == other.behavior && number == other.number /* spotless:on */ } - override fun hashCode(): Int { - return /* spotless:off */ Objects.hash(behavior, number) /* spotless:on */ - } + override fun hashCode(): Int = /* spotless:off */ Objects.hash(behavior, number) /* spotless:on */ - override fun toString(): String { - return when { + override fun toString(): String = + when { behavior != null -> "LearningRateMultiplier{behavior=$behavior}" number != null -> "LearningRateMultiplier{number=$number}" _json != null -> "LearningRateMultiplier{_unknown=$_json}" else -> throw IllegalStateException("Invalid LearningRateMultiplier") } - } companion object { @@ -1034,7 +1023,7 @@ constructor( return true } - return /* spotless:off */ other is Behavior && this.value == other.value /* spotless:on */ + return /* spotless:off */ other is Behavior && value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -1120,21 +1109,18 @@ constructor( return true } - return /* spotless:off */ other is NEpochs && this.behavior == other.behavior && this.integer == other.integer /* spotless:on */ + return /* spotless:off */ other is NEpochs && behavior == other.behavior && integer == other.integer /* spotless:on */ } - override fun hashCode(): Int { - return /* spotless:off */ Objects.hash(behavior, integer) /* spotless:on */ - } + override fun hashCode(): Int = /* spotless:off */ Objects.hash(behavior, integer) /* spotless:on */ - override fun toString(): String { - return when { + override fun toString(): String = + when { behavior != null -> "NEpochs{behavior=$behavior}" integer != null -> "NEpochs{integer=$integer}" _json != null -> "NEpochs{_unknown=$_json}" else -> throw IllegalStateException("Invalid NEpochs") } - } companion object { @@ -1199,7 +1185,7 @@ constructor( return true } - return /* spotless:off */ other is Behavior && this.value == other.value /* spotless:on */ + return /* spotless:off */ other is Behavior && value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -1243,17 +1229,14 @@ constructor( return true } - return /* spotless:off */ other is Hyperparameters && this.batchSize == other.batchSize && this.learningRateMultiplier == other.learningRateMultiplier && this.nEpochs == other.nEpochs && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Hyperparameters && batchSize == other.batchSize && learningRateMultiplier == other.learningRateMultiplier && nEpochs == other.nEpochs && additionalProperties == other.additionalProperties /* spotless:on */ } - private var hashCode: Int = 0 + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(batchSize, learningRateMultiplier, nEpochs, additionalProperties) } + /* spotless:on */ - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = /* spotless:off */ Objects.hash(batchSize, learningRateMultiplier, nEpochs, additionalProperties) /* spotless:on */ - } - return hashCode - } + override fun hashCode(): Int = hashCode override fun toString() = "Hyperparameters{batchSize=$batchSize, learningRateMultiplier=$learningRateMultiplier, nEpochs=$nEpochs, additionalProperties=$additionalProperties}" @@ -1355,7 +1338,7 @@ constructor( return true } - return /* spotless:off */ other is Type && this.value == other.value /* spotless:on */ + return /* spotless:off */ other is Type && value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -1514,17 +1497,14 @@ constructor( return true } - return /* spotless:off */ other is Wandb && this.project == other.project && this.name == other.name && this.entity == other.entity && this.tags == other.tags && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Wandb && project == other.project && name == other.name && entity == other.entity && tags == other.tags && additionalProperties == other.additionalProperties /* spotless:on */ } - private var hashCode: Int = 0 + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(project, name, entity, tags, additionalProperties) } + /* spotless:on */ - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = /* spotless:off */ Objects.hash(project, name, entity, tags, additionalProperties) /* spotless:on */ - } - return hashCode - } + override fun hashCode(): Int = hashCode override fun toString() = "Wandb{project=$project, name=$name, entity=$entity, tags=$tags, additionalProperties=$additionalProperties}" @@ -1535,17 +1515,14 @@ constructor( return true } - return /* spotless:off */ other is Integration && this.type == other.type && this.wandb == other.wandb && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Integration && type == other.type && wandb == other.wandb && additionalProperties == other.additionalProperties /* spotless:on */ } - private var hashCode: Int = 0 + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(type, wandb, additionalProperties) } + /* spotless:on */ - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = /* spotless:off */ Objects.hash(type, wandb, additionalProperties) /* spotless:on */ - } - return hashCode - } + override fun hashCode(): Int = hashCode override fun toString() = "Integration{type=$type, wandb=$wandb, additionalProperties=$additionalProperties}" diff --git a/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJobEvent.kt b/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJobEvent.kt index 77ea70b64..26d94ad82 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJobEvent.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJobEvent.kt @@ -159,7 +159,7 @@ private constructor( return true } - return /* spotless:off */ other is Level && this.value == other.value /* spotless:on */ + return /* spotless:off */ other is Level && value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -222,7 +222,7 @@ private constructor( return true } - return /* spotless:off */ other is Object && this.value == other.value /* spotless:on */ + return /* spotless:off */ other is Object && value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -265,17 +265,14 @@ private constructor( return true } - return /* spotless:off */ other is FineTuningJobEvent && this.id == other.id && this.createdAt == other.createdAt && this.level == other.level && this.message == other.message && this.object_ == other.object_ && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is FineTuningJobEvent && id == other.id && createdAt == other.createdAt && level == other.level && message == other.message && object_ == other.object_ && additionalProperties == other.additionalProperties /* spotless:on */ } - private var hashCode: Int = 0 + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(id, createdAt, level, message, object_, additionalProperties) } + /* spotless:on */ - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = /* spotless:off */ Objects.hash(id, createdAt, level, message, object_, additionalProperties) /* spotless:on */ - } - return hashCode - } + override fun hashCode(): Int = hashCode override fun toString() = "FineTuningJobEvent{id=$id, createdAt=$createdAt, level=$level, message=$message, object_=$object_, additionalProperties=$additionalProperties}" diff --git a/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJobListEventsPage.kt b/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJobListEventsPage.kt index ce0a3f70e..01539155a 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJobListEventsPage.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJobListEventsPage.kt @@ -34,12 +34,10 @@ private constructor( return true } - return /* spotless:off */ other is FineTuningJobListEventsPage && this.jobsService == other.jobsService && this.params == other.params && this.response == other.response /* spotless:on */ + return /* spotless:off */ other is FineTuningJobListEventsPage && jobsService == other.jobsService && params == other.params && response == other.response /* spotless:on */ } - override fun hashCode(): Int { - return /* spotless:off */ Objects.hash(jobsService, params, response) /* spotless:on */ - } + override fun hashCode(): Int = /* spotless:off */ Objects.hash(jobsService, params, response) /* spotless:on */ override fun toString() = "FineTuningJobListEventsPage{jobsService=$jobsService, params=$params, response=$response}" @@ -108,15 +106,12 @@ private constructor( return true } - return /* spotless:off */ other is Response && this.data == other.data && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Response && data == other.data && additionalProperties == other.additionalProperties /* spotless:on */ } - override fun hashCode(): Int { - return /* spotless:off */ Objects.hash(data, additionalProperties) /* spotless:on */ - } + override fun hashCode(): Int = /* spotless:off */ Objects.hash(data, additionalProperties) /* spotless:on */ - override fun toString() = - "FineTuningJobListEventsPage.Response{data=$data, additionalProperties=$additionalProperties}" + override fun toString() = "Response{data=$data, additionalProperties=$additionalProperties}" companion object { diff --git a/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJobListEventsPageAsync.kt b/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJobListEventsPageAsync.kt index 2c200b347..dc1fb2431 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJobListEventsPageAsync.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJobListEventsPageAsync.kt @@ -35,12 +35,10 @@ private constructor( return true } - return /* spotless:off */ other is FineTuningJobListEventsPageAsync && this.jobsService == other.jobsService && this.params == other.params && this.response == other.response /* spotless:on */ + return /* spotless:off */ other is FineTuningJobListEventsPageAsync && jobsService == other.jobsService && params == other.params && response == other.response /* spotless:on */ } - override fun hashCode(): Int { - return /* spotless:off */ Objects.hash(jobsService, params, response) /* spotless:on */ - } + override fun hashCode(): Int = /* spotless:off */ Objects.hash(jobsService, params, response) /* spotless:on */ override fun toString() = "FineTuningJobListEventsPageAsync{jobsService=$jobsService, params=$params, response=$response}" @@ -115,15 +113,12 @@ private constructor( return true } - return /* spotless:off */ other is Response && this.data == other.data && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Response && data == other.data && additionalProperties == other.additionalProperties /* spotless:on */ } - override fun hashCode(): Int { - return /* spotless:off */ Objects.hash(data, additionalProperties) /* spotless:on */ - } + override fun hashCode(): Int = /* spotless:off */ Objects.hash(data, additionalProperties) /* spotless:on */ - override fun toString() = - "FineTuningJobListEventsPageAsync.Response{data=$data, additionalProperties=$additionalProperties}" + override fun toString() = "Response{data=$data, additionalProperties=$additionalProperties}" companion object { diff --git a/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJobListEventsParams.kt b/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJobListEventsParams.kt index 55f06aa55..3c2b3b3a9 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJobListEventsParams.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJobListEventsParams.kt @@ -51,12 +51,10 @@ constructor( return true } - return /* spotless:off */ other is FineTuningJobListEventsParams && this.fineTuningJobId == other.fineTuningJobId && this.after == other.after && this.limit == other.limit && this.additionalHeaders == other.additionalHeaders && this.additionalQueryParams == other.additionalQueryParams /* spotless:on */ + return /* spotless:off */ other is FineTuningJobListEventsParams && fineTuningJobId == other.fineTuningJobId && after == other.after && limit == other.limit && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams /* spotless:on */ } - override fun hashCode(): Int { - return /* spotless:off */ Objects.hash(fineTuningJobId, after, limit, additionalHeaders, additionalQueryParams) /* spotless:on */ - } + override fun hashCode(): Int = /* spotless:off */ Objects.hash(fineTuningJobId, after, limit, additionalHeaders, additionalQueryParams) /* spotless:on */ override fun toString() = "FineTuningJobListEventsParams{fineTuningJobId=$fineTuningJobId, after=$after, limit=$limit, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" diff --git a/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJobListPage.kt b/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJobListPage.kt index 2d35486b9..11705464d 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJobListPage.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJobListPage.kt @@ -34,12 +34,10 @@ private constructor( return true } - return /* spotless:off */ other is FineTuningJobListPage && this.jobsService == other.jobsService && this.params == other.params && this.response == other.response /* spotless:on */ + return /* spotless:off */ other is FineTuningJobListPage && jobsService == other.jobsService && params == other.params && response == other.response /* spotless:on */ } - override fun hashCode(): Int { - return /* spotless:off */ Objects.hash(jobsService, params, response) /* spotless:on */ - } + override fun hashCode(): Int = /* spotless:off */ Objects.hash(jobsService, params, response) /* spotless:on */ override fun toString() = "FineTuningJobListPage{jobsService=$jobsService, params=$params, response=$response}" @@ -108,15 +106,12 @@ private constructor( return true } - return /* spotless:off */ other is Response && this.data == other.data && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Response && data == other.data && additionalProperties == other.additionalProperties /* spotless:on */ } - override fun hashCode(): Int { - return /* spotless:off */ Objects.hash(data, additionalProperties) /* spotless:on */ - } + override fun hashCode(): Int = /* spotless:off */ Objects.hash(data, additionalProperties) /* spotless:on */ - override fun toString() = - "FineTuningJobListPage.Response{data=$data, additionalProperties=$additionalProperties}" + override fun toString() = "Response{data=$data, additionalProperties=$additionalProperties}" companion object { diff --git a/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJobListPageAsync.kt b/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJobListPageAsync.kt index 3337585d2..99e2b1508 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJobListPageAsync.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJobListPageAsync.kt @@ -35,12 +35,10 @@ private constructor( return true } - return /* spotless:off */ other is FineTuningJobListPageAsync && this.jobsService == other.jobsService && this.params == other.params && this.response == other.response /* spotless:on */ + return /* spotless:off */ other is FineTuningJobListPageAsync && jobsService == other.jobsService && params == other.params && response == other.response /* spotless:on */ } - override fun hashCode(): Int { - return /* spotless:off */ Objects.hash(jobsService, params, response) /* spotless:on */ - } + override fun hashCode(): Int = /* spotless:off */ Objects.hash(jobsService, params, response) /* spotless:on */ override fun toString() = "FineTuningJobListPageAsync{jobsService=$jobsService, params=$params, response=$response}" @@ -111,15 +109,12 @@ private constructor( return true } - return /* spotless:off */ other is Response && this.data == other.data && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Response && data == other.data && additionalProperties == other.additionalProperties /* spotless:on */ } - override fun hashCode(): Int { - return /* spotless:off */ Objects.hash(data, additionalProperties) /* spotless:on */ - } + override fun hashCode(): Int = /* spotless:off */ Objects.hash(data, additionalProperties) /* spotless:on */ - override fun toString() = - "FineTuningJobListPageAsync.Response{data=$data, additionalProperties=$additionalProperties}" + override fun toString() = "Response{data=$data, additionalProperties=$additionalProperties}" companion object { diff --git a/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJobListParams.kt b/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJobListParams.kt index 242c8dc32..2591dbc93 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJobListParams.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJobListParams.kt @@ -41,12 +41,10 @@ constructor( return true } - return /* spotless:off */ other is FineTuningJobListParams && this.after == other.after && this.limit == other.limit && this.additionalHeaders == other.additionalHeaders && this.additionalQueryParams == other.additionalQueryParams /* spotless:on */ + return /* spotless:off */ other is FineTuningJobListParams && after == other.after && limit == other.limit && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams /* spotless:on */ } - override fun hashCode(): Int { - return /* spotless:off */ Objects.hash(after, limit, additionalHeaders, additionalQueryParams) /* spotless:on */ - } + override fun hashCode(): Int = /* spotless:off */ Objects.hash(after, limit, additionalHeaders, additionalQueryParams) /* spotless:on */ override fun toString() = "FineTuningJobListParams{after=$after, limit=$limit, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" diff --git a/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJobRetrieveParams.kt b/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJobRetrieveParams.kt index acb35562a..e8d1fde84 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJobRetrieveParams.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJobRetrieveParams.kt @@ -37,12 +37,10 @@ constructor( return true } - return /* spotless:off */ other is FineTuningJobRetrieveParams && this.fineTuningJobId == other.fineTuningJobId && this.additionalHeaders == other.additionalHeaders && this.additionalQueryParams == other.additionalQueryParams /* spotless:on */ + return /* spotless:off */ other is FineTuningJobRetrieveParams && fineTuningJobId == other.fineTuningJobId && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams /* spotless:on */ } - override fun hashCode(): Int { - return /* spotless:off */ Objects.hash(fineTuningJobId, additionalHeaders, additionalQueryParams) /* spotless:on */ - } + override fun hashCode(): Int = /* spotless:off */ Objects.hash(fineTuningJobId, additionalHeaders, additionalQueryParams) /* spotless:on */ override fun toString() = "FineTuningJobRetrieveParams{fineTuningJobId=$fineTuningJobId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" diff --git a/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJobWandbIntegration.kt b/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJobWandbIntegration.kt index 5c448b907..4a975dbc3 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJobWandbIntegration.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJobWandbIntegration.kt @@ -188,17 +188,14 @@ private constructor( return true } - return /* spotless:off */ other is FineTuningJobWandbIntegration && this.project == other.project && this.name == other.name && this.entity == other.entity && this.tags == other.tags && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is FineTuningJobWandbIntegration && project == other.project && name == other.name && entity == other.entity && tags == other.tags && additionalProperties == other.additionalProperties /* spotless:on */ } - private var hashCode: Int = 0 + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(project, name, entity, tags, additionalProperties) } + /* spotless:on */ - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = /* spotless:off */ Objects.hash(project, name, entity, tags, additionalProperties) /* spotless:on */ - } - return hashCode - } + override fun hashCode(): Int = hashCode override fun toString() = "FineTuningJobWandbIntegration{project=$project, name=$name, entity=$entity, tags=$tags, additionalProperties=$additionalProperties}" diff --git a/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJobWandbIntegrationObject.kt b/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJobWandbIntegrationObject.kt index fe5d5eb9e..e6b27f8b8 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJobWandbIntegrationObject.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/FineTuningJobWandbIntegrationObject.kt @@ -145,7 +145,7 @@ private constructor( return true } - return /* spotless:off */ other is Type && this.value == other.value /* spotless:on */ + return /* spotless:off */ other is Type && value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -188,17 +188,14 @@ private constructor( return true } - return /* spotless:off */ other is FineTuningJobWandbIntegrationObject && this.type == other.type && this.wandb == other.wandb && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is FineTuningJobWandbIntegrationObject && type == other.type && wandb == other.wandb && additionalProperties == other.additionalProperties /* spotless:on */ } - private var hashCode: Int = 0 + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(type, wandb, additionalProperties) } + /* spotless:on */ - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = /* spotless:off */ Objects.hash(type, wandb, additionalProperties) /* spotless:on */ - } - return hashCode - } + override fun hashCode(): Int = hashCode override fun toString() = "FineTuningJobWandbIntegrationObject{type=$type, wandb=$wandb, additionalProperties=$additionalProperties}" diff --git a/openai-java-core/src/main/kotlin/com/openai/models/FunctionDefinition.kt b/openai-java-core/src/main/kotlin/com/openai/models/FunctionDefinition.kt index b3aacef0b..3f7f29b47 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/FunctionDefinition.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/FunctionDefinition.kt @@ -227,17 +227,14 @@ private constructor( return true } - return /* spotless:off */ other is FunctionDefinition && this.description == other.description && this.name == other.name && this.parameters == other.parameters && this.strict == other.strict && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is FunctionDefinition && description == other.description && name == other.name && parameters == other.parameters && strict == other.strict && additionalProperties == other.additionalProperties /* spotless:on */ } - private var hashCode: Int = 0 + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(description, name, parameters, strict, additionalProperties) } + /* spotless:on */ - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = /* spotless:off */ Objects.hash(description, name, parameters, strict, additionalProperties) /* spotless:on */ - } - return hashCode - } + override fun hashCode(): Int = hashCode override fun toString() = "FunctionDefinition{description=$description, name=$name, parameters=$parameters, strict=$strict, additionalProperties=$additionalProperties}" diff --git a/openai-java-core/src/main/kotlin/com/openai/models/FunctionParameters.kt b/openai-java-core/src/main/kotlin/com/openai/models/FunctionParameters.kt index a0fbf2fad..99616c8cc 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/FunctionParameters.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/FunctionParameters.kt @@ -76,17 +76,14 @@ private constructor( return true } - return /* spotless:off */ other is FunctionParameters && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is FunctionParameters && additionalProperties == other.additionalProperties /* spotless:on */ } - private var hashCode: Int = 0 + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + /* spotless:on */ - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = /* spotless:off */ Objects.hash(additionalProperties) /* spotless:on */ - } - return hashCode - } + override fun hashCode(): Int = hashCode override fun toString() = "FunctionParameters{additionalProperties=$additionalProperties}" } diff --git a/openai-java-core/src/main/kotlin/com/openai/models/Image.kt b/openai-java-core/src/main/kotlin/com/openai/models/Image.kt index 66ab39bd3..73693ef09 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/Image.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/Image.kt @@ -140,17 +140,14 @@ private constructor( return true } - return /* spotless:off */ other is Image && this.b64Json == other.b64Json && this.url == other.url && this.revisedPrompt == other.revisedPrompt && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Image && b64Json == other.b64Json && url == other.url && revisedPrompt == other.revisedPrompt && additionalProperties == other.additionalProperties /* spotless:on */ } - private var hashCode: Int = 0 + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(b64Json, url, revisedPrompt, additionalProperties) } + /* spotless:on */ - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = /* spotless:off */ Objects.hash(b64Json, url, revisedPrompt, additionalProperties) /* spotless:on */ - } - return hashCode - } + override fun hashCode(): Int = hashCode override fun toString() = "Image{b64Json=$b64Json, url=$url, revisedPrompt=$revisedPrompt, additionalProperties=$additionalProperties}" diff --git a/openai-java-core/src/main/kotlin/com/openai/models/ImageGenerateParams.kt b/openai-java-core/src/main/kotlin/com/openai/models/ImageGenerateParams.kt index 461cabcf1..fa6339c2e 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/ImageGenerateParams.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/ImageGenerateParams.kt @@ -257,17 +257,14 @@ constructor( return true } - return /* spotless:off */ other is ImageGenerateBody && this.prompt == other.prompt && this.model == other.model && this.n == other.n && this.quality == other.quality && this.responseFormat == other.responseFormat && this.size == other.size && this.style == other.style && this.user == other.user && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is ImageGenerateBody && prompt == other.prompt && model == other.model && n == other.n && quality == other.quality && responseFormat == other.responseFormat && size == other.size && style == other.style && user == other.user && additionalProperties == other.additionalProperties /* spotless:on */ } - private var hashCode: Int = 0 + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(prompt, model, n, quality, responseFormat, size, style, user, additionalProperties) } + /* spotless:on */ - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = /* spotless:off */ Objects.hash(prompt, model, n, quality, responseFormat, size, style, user, additionalProperties) /* spotless:on */ - } - return hashCode - } + override fun hashCode(): Int = hashCode override fun toString() = "ImageGenerateBody{prompt=$prompt, model=$model, n=$n, quality=$quality, responseFormat=$responseFormat, size=$size, style=$style, user=$user, additionalProperties=$additionalProperties}" @@ -284,12 +281,10 @@ constructor( return true } - return /* spotless:off */ other is ImageGenerateParams && this.prompt == other.prompt && this.model == other.model && this.n == other.n && this.quality == other.quality && this.responseFormat == other.responseFormat && this.size == other.size && this.style == other.style && this.user == other.user && this.additionalHeaders == other.additionalHeaders && this.additionalQueryParams == other.additionalQueryParams && this.additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ + return /* spotless:off */ other is ImageGenerateParams && prompt == other.prompt && model == other.model && n == other.n && quality == other.quality && responseFormat == other.responseFormat && size == other.size && style == other.style && user == other.user && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams && additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ } - override fun hashCode(): Int { - return /* spotless:off */ Objects.hash(prompt, model, n, quality, responseFormat, size, style, user, additionalHeaders, additionalQueryParams, additionalBodyProperties) /* spotless:on */ - } + override fun hashCode(): Int = /* spotless:off */ Objects.hash(prompt, model, n, quality, responseFormat, size, style, user, additionalHeaders, additionalQueryParams, additionalBodyProperties) /* spotless:on */ override fun toString() = "ImageGenerateParams{prompt=$prompt, model=$model, n=$n, quality=$quality, responseFormat=$responseFormat, size=$size, style=$style, user=$user, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams, additionalBodyProperties=$additionalBodyProperties}" @@ -534,7 +529,7 @@ constructor( return true } - return /* spotless:off */ other is Model && this.value == other.value /* spotless:on */ + return /* spotless:off */ other is Model && value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -591,7 +586,7 @@ constructor( return true } - return /* spotless:off */ other is Quality && this.value == other.value /* spotless:on */ + return /* spotless:off */ other is Quality && value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -648,7 +643,7 @@ constructor( return true } - return /* spotless:off */ other is ResponseFormat && this.value == other.value /* spotless:on */ + return /* spotless:off */ other is ResponseFormat && value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -705,7 +700,7 @@ constructor( return true } - return /* spotless:off */ other is Size && this.value == other.value /* spotless:on */ + return /* spotless:off */ other is Size && value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -780,7 +775,7 @@ constructor( return true } - return /* spotless:off */ other is Style && this.value == other.value /* spotless:on */ + return /* spotless:off */ other is Style && value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() diff --git a/openai-java-core/src/main/kotlin/com/openai/models/ImageModel.kt b/openai-java-core/src/main/kotlin/com/openai/models/ImageModel.kt index 1dafbd83a..af0bf357b 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/ImageModel.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/ImageModel.kt @@ -21,7 +21,7 @@ private constructor( return true } - return /* spotless:off */ other is ImageModel && this.value == other.value /* spotless:on */ + return /* spotless:off */ other is ImageModel && value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() diff --git a/openai-java-core/src/main/kotlin/com/openai/models/ImagesResponse.kt b/openai-java-core/src/main/kotlin/com/openai/models/ImagesResponse.kt index 0e611d85f..aae53b1b1 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/ImagesResponse.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/ImagesResponse.kt @@ -104,17 +104,14 @@ private constructor( return true } - return /* spotless:off */ other is ImagesResponse && this.created == other.created && this.data == other.data && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is ImagesResponse && created == other.created && data == other.data && additionalProperties == other.additionalProperties /* spotless:on */ } - private var hashCode: Int = 0 + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(created, data, additionalProperties) } + /* spotless:on */ - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = /* spotless:off */ Objects.hash(created, data, additionalProperties) /* spotless:on */ - } - return hashCode - } + override fun hashCode(): Int = hashCode override fun toString() = "ImagesResponse{created=$created, data=$data, additionalProperties=$additionalProperties}" diff --git a/openai-java-core/src/main/kotlin/com/openai/models/Model.kt b/openai-java-core/src/main/kotlin/com/openai/models/Model.kt index 5b559a147..575c7272d 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/Model.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/Model.kt @@ -160,7 +160,7 @@ private constructor( return true } - return /* spotless:off */ other is Object && this.value == other.value /* spotless:on */ + return /* spotless:off */ other is Object && value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -203,17 +203,14 @@ private constructor( return true } - return /* spotless:off */ other is Model && this.id == other.id && this.created == other.created && this.object_ == other.object_ && this.ownedBy == other.ownedBy && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Model && id == other.id && created == other.created && object_ == other.object_ && ownedBy == other.ownedBy && additionalProperties == other.additionalProperties /* spotless:on */ } - private var hashCode: Int = 0 + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(id, created, object_, ownedBy, additionalProperties) } + /* spotless:on */ - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = /* spotless:off */ Objects.hash(id, created, object_, ownedBy, additionalProperties) /* spotless:on */ - } - return hashCode - } + override fun hashCode(): Int = hashCode override fun toString() = "Model{id=$id, created=$created, object_=$object_, ownedBy=$ownedBy, additionalProperties=$additionalProperties}" diff --git a/openai-java-core/src/main/kotlin/com/openai/models/ModelDeleteParams.kt b/openai-java-core/src/main/kotlin/com/openai/models/ModelDeleteParams.kt index 4caafe0b7..257d3ec95 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/ModelDeleteParams.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/ModelDeleteParams.kt @@ -48,12 +48,10 @@ constructor( return true } - return /* spotless:off */ other is ModelDeleteParams && this.model == other.model && this.additionalHeaders == other.additionalHeaders && this.additionalQueryParams == other.additionalQueryParams && this.additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ + return /* spotless:off */ other is ModelDeleteParams && model == other.model && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams && additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ } - override fun hashCode(): Int { - return /* spotless:off */ Objects.hash(model, additionalHeaders, additionalQueryParams, additionalBodyProperties) /* spotless:on */ - } + override fun hashCode(): Int = /* spotless:off */ Objects.hash(model, additionalHeaders, additionalQueryParams, additionalBodyProperties) /* spotless:on */ override fun toString() = "ModelDeleteParams{model=$model, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams, additionalBodyProperties=$additionalBodyProperties}" diff --git a/openai-java-core/src/main/kotlin/com/openai/models/ModelDeleted.kt b/openai-java-core/src/main/kotlin/com/openai/models/ModelDeleted.kt index 200cbaab0..7045e9b05 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/ModelDeleted.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/ModelDeleted.kt @@ -117,17 +117,14 @@ private constructor( return true } - return /* spotless:off */ other is ModelDeleted && this.id == other.id && this.deleted == other.deleted && this.object_ == other.object_ && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is ModelDeleted && id == other.id && deleted == other.deleted && object_ == other.object_ && additionalProperties == other.additionalProperties /* spotless:on */ } - private var hashCode: Int = 0 + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(id, deleted, object_, additionalProperties) } + /* spotless:on */ - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = /* spotless:off */ Objects.hash(id, deleted, object_, additionalProperties) /* spotless:on */ - } - return hashCode - } + override fun hashCode(): Int = hashCode override fun toString() = "ModelDeleted{id=$id, deleted=$deleted, object_=$object_, additionalProperties=$additionalProperties}" diff --git a/openai-java-core/src/main/kotlin/com/openai/models/ModelListPage.kt b/openai-java-core/src/main/kotlin/com/openai/models/ModelListPage.kt index f00a83bab..338fd202c 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/ModelListPage.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/ModelListPage.kt @@ -36,12 +36,10 @@ private constructor( return true } - return /* spotless:off */ other is ModelListPage && this.modelsService == other.modelsService && this.params == other.params && this.response == other.response /* spotless:on */ + return /* spotless:off */ other is ModelListPage && modelsService == other.modelsService && params == other.params && response == other.response /* spotless:on */ } - override fun hashCode(): Int { - return /* spotless:off */ Objects.hash(modelsService, params, response) /* spotless:on */ - } + override fun hashCode(): Int = /* spotless:off */ Objects.hash(modelsService, params, response) /* spotless:on */ override fun toString() = "ModelListPage{modelsService=$modelsService, params=$params, response=$response}" @@ -111,15 +109,13 @@ private constructor( return true } - return /* spotless:off */ other is Response && this.data == other.data && this.object_ == other.object_ && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Response && data == other.data && object_ == other.object_ && additionalProperties == other.additionalProperties /* spotless:on */ } - override fun hashCode(): Int { - return /* spotless:off */ Objects.hash(data, object_, additionalProperties) /* spotless:on */ - } + override fun hashCode(): Int = /* spotless:off */ Objects.hash(data, object_, additionalProperties) /* spotless:on */ override fun toString() = - "ModelListPage.Response{data=$data, object_=$object_, additionalProperties=$additionalProperties}" + "Response{data=$data, object_=$object_, additionalProperties=$additionalProperties}" companion object { diff --git a/openai-java-core/src/main/kotlin/com/openai/models/ModelListPageAsync.kt b/openai-java-core/src/main/kotlin/com/openai/models/ModelListPageAsync.kt index 63e216048..38fa9efd4 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/ModelListPageAsync.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/ModelListPageAsync.kt @@ -37,12 +37,10 @@ private constructor( return true } - return /* spotless:off */ other is ModelListPageAsync && this.modelsService == other.modelsService && this.params == other.params && this.response == other.response /* spotless:on */ + return /* spotless:off */ other is ModelListPageAsync && modelsService == other.modelsService && params == other.params && response == other.response /* spotless:on */ } - override fun hashCode(): Int { - return /* spotless:off */ Objects.hash(modelsService, params, response) /* spotless:on */ - } + override fun hashCode(): Int = /* spotless:off */ Objects.hash(modelsService, params, response) /* spotless:on */ override fun toString() = "ModelListPageAsync{modelsService=$modelsService, params=$params, response=$response}" @@ -114,15 +112,13 @@ private constructor( return true } - return /* spotless:off */ other is Response && this.data == other.data && this.object_ == other.object_ && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Response && data == other.data && object_ == other.object_ && additionalProperties == other.additionalProperties /* spotless:on */ } - override fun hashCode(): Int { - return /* spotless:off */ Objects.hash(data, object_, additionalProperties) /* spotless:on */ - } + override fun hashCode(): Int = /* spotless:off */ Objects.hash(data, object_, additionalProperties) /* spotless:on */ override fun toString() = - "ModelListPageAsync.Response{data=$data, object_=$object_, additionalProperties=$additionalProperties}" + "Response{data=$data, object_=$object_, additionalProperties=$additionalProperties}" companion object { diff --git a/openai-java-core/src/main/kotlin/com/openai/models/ModelListParams.kt b/openai-java-core/src/main/kotlin/com/openai/models/ModelListParams.kt index 203fea8e2..c8ce82f2e 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/ModelListParams.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/ModelListParams.kt @@ -27,12 +27,10 @@ constructor( return true } - return /* spotless:off */ other is ModelListParams && this.additionalHeaders == other.additionalHeaders && this.additionalQueryParams == other.additionalQueryParams /* spotless:on */ + return /* spotless:off */ other is ModelListParams && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams /* spotless:on */ } - override fun hashCode(): Int { - return /* spotless:off */ Objects.hash(additionalHeaders, additionalQueryParams) /* spotless:on */ - } + override fun hashCode(): Int = /* spotless:off */ Objects.hash(additionalHeaders, additionalQueryParams) /* spotless:on */ override fun toString() = "ModelListParams{additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" diff --git a/openai-java-core/src/main/kotlin/com/openai/models/ModelRetrieveParams.kt b/openai-java-core/src/main/kotlin/com/openai/models/ModelRetrieveParams.kt index 35b9cb981..ccf3d37cd 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/ModelRetrieveParams.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/ModelRetrieveParams.kt @@ -37,12 +37,10 @@ constructor( return true } - return /* spotless:off */ other is ModelRetrieveParams && this.model == other.model && this.additionalHeaders == other.additionalHeaders && this.additionalQueryParams == other.additionalQueryParams /* spotless:on */ + return /* spotless:off */ other is ModelRetrieveParams && model == other.model && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams /* spotless:on */ } - override fun hashCode(): Int { - return /* spotless:off */ Objects.hash(model, additionalHeaders, additionalQueryParams) /* spotless:on */ - } + override fun hashCode(): Int = /* spotless:off */ Objects.hash(model, additionalHeaders, additionalQueryParams) /* spotless:on */ override fun toString() = "ModelRetrieveParams{model=$model, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" diff --git a/openai-java-core/src/main/kotlin/com/openai/models/Moderation.kt b/openai-java-core/src/main/kotlin/com/openai/models/Moderation.kt index fdb62f114..a2725c30f 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/Moderation.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/Moderation.kt @@ -612,17 +612,14 @@ private constructor( return true } - return /* spotless:off */ other is Categories && this.hate == other.hate && this.hateThreatening == other.hateThreatening && this.harassment == other.harassment && this.harassmentThreatening == other.harassmentThreatening && this.illicit == other.illicit && this.illicitViolent == other.illicitViolent && this.selfHarm == other.selfHarm && this.selfHarmIntent == other.selfHarmIntent && this.selfHarmInstructions == other.selfHarmInstructions && this.sexual == other.sexual && this.sexualMinors == other.sexualMinors && this.violence == other.violence && this.violenceGraphic == other.violenceGraphic && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Categories && hate == other.hate && hateThreatening == other.hateThreatening && harassment == other.harassment && harassmentThreatening == other.harassmentThreatening && illicit == other.illicit && illicitViolent == other.illicitViolent && selfHarm == other.selfHarm && selfHarmIntent == other.selfHarmIntent && selfHarmInstructions == other.selfHarmInstructions && sexual == other.sexual && sexualMinors == other.sexualMinors && violence == other.violence && violenceGraphic == other.violenceGraphic && additionalProperties == other.additionalProperties /* spotless:on */ } - private var hashCode: Int = 0 + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(hate, hateThreatening, harassment, harassmentThreatening, illicit, illicitViolent, selfHarm, selfHarmIntent, selfHarmInstructions, sexual, sexualMinors, violence, violenceGraphic, additionalProperties) } + /* spotless:on */ - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = /* spotless:off */ Objects.hash(hate, hateThreatening, harassment, harassmentThreatening, illicit, illicitViolent, selfHarm, selfHarmIntent, selfHarmInstructions, sexual, sexualMinors, violence, violenceGraphic, additionalProperties) /* spotless:on */ - } - return hashCode - } + override fun hashCode(): Int = hashCode override fun toString() = "Categories{hate=$hate, hateThreatening=$hateThreatening, harassment=$harassment, harassmentThreatening=$harassmentThreatening, illicit=$illicit, illicitViolent=$illicitViolent, selfHarm=$selfHarm, selfHarmIntent=$selfHarmIntent, selfHarmInstructions=$selfHarmInstructions, sexual=$sexual, sexualMinors=$sexualMinors, violence=$violence, violenceGraphic=$violenceGraphic, additionalProperties=$additionalProperties}" @@ -978,7 +975,7 @@ private constructor( return true } - return /* spotless:off */ other is Harassment && this.value == other.value /* spotless:on */ + return /* spotless:off */ other is Harassment && value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -1029,7 +1026,7 @@ private constructor( return true } - return /* spotless:off */ other is HarassmentThreatening && this.value == other.value /* spotless:on */ + return /* spotless:off */ other is HarassmentThreatening && value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -1081,7 +1078,7 @@ private constructor( return true } - return /* spotless:off */ other is Hate && this.value == other.value /* spotless:on */ + return /* spotless:off */ other is Hate && value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -1132,7 +1129,7 @@ private constructor( return true } - return /* spotless:off */ other is HateThreatening && this.value == other.value /* spotless:on */ + return /* spotless:off */ other is HateThreatening && value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -1183,7 +1180,7 @@ private constructor( return true } - return /* spotless:off */ other is Illicit && this.value == other.value /* spotless:on */ + return /* spotless:off */ other is Illicit && value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -1234,7 +1231,7 @@ private constructor( return true } - return /* spotless:off */ other is IllicitViolent && this.value == other.value /* spotless:on */ + return /* spotless:off */ other is IllicitViolent && value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -1285,7 +1282,7 @@ private constructor( return true } - return /* spotless:off */ other is SelfHarm && this.value == other.value /* spotless:on */ + return /* spotless:off */ other is SelfHarm && value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -1342,7 +1339,7 @@ private constructor( return true } - return /* spotless:off */ other is SelfHarmInstruction && this.value == other.value /* spotless:on */ + return /* spotless:off */ other is SelfHarmInstruction && value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -1399,7 +1396,7 @@ private constructor( return true } - return /* spotless:off */ other is SelfHarmIntent && this.value == other.value /* spotless:on */ + return /* spotless:off */ other is SelfHarmIntent && value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -1456,7 +1453,7 @@ private constructor( return true } - return /* spotless:off */ other is Sexual && this.value == other.value /* spotless:on */ + return /* spotless:off */ other is Sexual && value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -1513,7 +1510,7 @@ private constructor( return true } - return /* spotless:off */ other is SexualMinor && this.value == other.value /* spotless:on */ + return /* spotless:off */ other is SexualMinor && value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -1564,7 +1561,7 @@ private constructor( return true } - return /* spotless:off */ other is Violence && this.value == other.value /* spotless:on */ + return /* spotless:off */ other is Violence && value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -1621,7 +1618,7 @@ private constructor( return true } - return /* spotless:off */ other is ViolenceGraphic && this.value == other.value /* spotless:on */ + return /* spotless:off */ other is ViolenceGraphic && value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -1670,17 +1667,14 @@ private constructor( return true } - return /* spotless:off */ other is CategoryAppliedInputTypes && this.hate == other.hate && this.hateThreatening == other.hateThreatening && this.harassment == other.harassment && this.harassmentThreatening == other.harassmentThreatening && this.illicit == other.illicit && this.illicitViolent == other.illicitViolent && this.selfHarm == other.selfHarm && this.selfHarmIntent == other.selfHarmIntent && this.selfHarmInstructions == other.selfHarmInstructions && this.sexual == other.sexual && this.sexualMinors == other.sexualMinors && this.violence == other.violence && this.violenceGraphic == other.violenceGraphic && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is CategoryAppliedInputTypes && hate == other.hate && hateThreatening == other.hateThreatening && harassment == other.harassment && harassmentThreatening == other.harassmentThreatening && illicit == other.illicit && illicitViolent == other.illicitViolent && selfHarm == other.selfHarm && selfHarmIntent == other.selfHarmIntent && selfHarmInstructions == other.selfHarmInstructions && sexual == other.sexual && sexualMinors == other.sexualMinors && violence == other.violence && violenceGraphic == other.violenceGraphic && additionalProperties == other.additionalProperties /* spotless:on */ } - private var hashCode: Int = 0 + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(hate, hateThreatening, harassment, harassmentThreatening, illicit, illicitViolent, selfHarm, selfHarmIntent, selfHarmInstructions, sexual, sexualMinors, violence, violenceGraphic, additionalProperties) } + /* spotless:on */ - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = /* spotless:off */ Objects.hash(hate, hateThreatening, harassment, harassmentThreatening, illicit, illicitViolent, selfHarm, selfHarmIntent, selfHarmInstructions, sexual, sexualMinors, violence, violenceGraphic, additionalProperties) /* spotless:on */ - } - return hashCode - } + override fun hashCode(): Int = hashCode override fun toString() = "CategoryAppliedInputTypes{hate=$hate, hateThreatening=$hateThreatening, harassment=$harassment, harassmentThreatening=$harassmentThreatening, illicit=$illicit, illicitViolent=$illicitViolent, selfHarm=$selfHarm, selfHarmIntent=$selfHarmIntent, selfHarmInstructions=$selfHarmInstructions, sexual=$sexual, sexualMinors=$sexualMinors, violence=$violence, violenceGraphic=$violenceGraphic, additionalProperties=$additionalProperties}" @@ -2020,17 +2014,14 @@ private constructor( return true } - return /* spotless:off */ other is CategoryScores && this.hate == other.hate && this.hateThreatening == other.hateThreatening && this.harassment == other.harassment && this.harassmentThreatening == other.harassmentThreatening && this.illicit == other.illicit && this.illicitViolent == other.illicitViolent && this.selfHarm == other.selfHarm && this.selfHarmIntent == other.selfHarmIntent && this.selfHarmInstructions == other.selfHarmInstructions && this.sexual == other.sexual && this.sexualMinors == other.sexualMinors && this.violence == other.violence && this.violenceGraphic == other.violenceGraphic && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is CategoryScores && hate == other.hate && hateThreatening == other.hateThreatening && harassment == other.harassment && harassmentThreatening == other.harassmentThreatening && illicit == other.illicit && illicitViolent == other.illicitViolent && selfHarm == other.selfHarm && selfHarmIntent == other.selfHarmIntent && selfHarmInstructions == other.selfHarmInstructions && sexual == other.sexual && sexualMinors == other.sexualMinors && violence == other.violence && violenceGraphic == other.violenceGraphic && additionalProperties == other.additionalProperties /* spotless:on */ } - private var hashCode: Int = 0 + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(hate, hateThreatening, harassment, harassmentThreatening, illicit, illicitViolent, selfHarm, selfHarmIntent, selfHarmInstructions, sexual, sexualMinors, violence, violenceGraphic, additionalProperties) } + /* spotless:on */ - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = /* spotless:off */ Objects.hash(hate, hateThreatening, harassment, harassmentThreatening, illicit, illicitViolent, selfHarm, selfHarmIntent, selfHarmInstructions, sexual, sexualMinors, violence, violenceGraphic, additionalProperties) /* spotless:on */ - } - return hashCode - } + override fun hashCode(): Int = hashCode override fun toString() = "CategoryScores{hate=$hate, hateThreatening=$hateThreatening, harassment=$harassment, harassmentThreatening=$harassmentThreatening, illicit=$illicit, illicitViolent=$illicitViolent, selfHarm=$selfHarm, selfHarmIntent=$selfHarmIntent, selfHarmInstructions=$selfHarmInstructions, sexual=$sexual, sexualMinors=$sexualMinors, violence=$violence, violenceGraphic=$violenceGraphic, additionalProperties=$additionalProperties}" @@ -2041,17 +2032,14 @@ private constructor( return true } - return /* spotless:off */ other is Moderation && this.flagged == other.flagged && this.categories == other.categories && this.categoryScores == other.categoryScores && this.categoryAppliedInputTypes == other.categoryAppliedInputTypes && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Moderation && flagged == other.flagged && categories == other.categories && categoryScores == other.categoryScores && categoryAppliedInputTypes == other.categoryAppliedInputTypes && additionalProperties == other.additionalProperties /* spotless:on */ } - private var hashCode: Int = 0 + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(flagged, categories, categoryScores, categoryAppliedInputTypes, additionalProperties) } + /* spotless:on */ - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = /* spotless:off */ Objects.hash(flagged, categories, categoryScores, categoryAppliedInputTypes, additionalProperties) /* spotless:on */ - } - return hashCode - } + override fun hashCode(): Int = hashCode override fun toString() = "Moderation{flagged=$flagged, categories=$categories, categoryScores=$categoryScores, categoryAppliedInputTypes=$categoryAppliedInputTypes, additionalProperties=$additionalProperties}" diff --git a/openai-java-core/src/main/kotlin/com/openai/models/ModerationCreateParams.kt b/openai-java-core/src/main/kotlin/com/openai/models/ModerationCreateParams.kt index 5675df952..f09c4d89e 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/ModerationCreateParams.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/ModerationCreateParams.kt @@ -141,17 +141,14 @@ constructor( return true } - return /* spotless:off */ other is ModerationCreateBody && this.input == other.input && this.model == other.model && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is ModerationCreateBody && input == other.input && model == other.model && additionalProperties == other.additionalProperties /* spotless:on */ } - private var hashCode: Int = 0 + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(input, model, additionalProperties) } + /* spotless:on */ - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = /* spotless:off */ Objects.hash(input, model, additionalProperties) /* spotless:on */ - } - return hashCode - } + override fun hashCode(): Int = hashCode override fun toString() = "ModerationCreateBody{input=$input, model=$model, additionalProperties=$additionalProperties}" @@ -168,12 +165,10 @@ constructor( return true } - return /* spotless:off */ other is ModerationCreateParams && this.input == other.input && this.model == other.model && this.additionalHeaders == other.additionalHeaders && this.additionalQueryParams == other.additionalQueryParams && this.additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ + return /* spotless:off */ other is ModerationCreateParams && input == other.input && model == other.model && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams && additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ } - override fun hashCode(): Int { - return /* spotless:off */ Objects.hash(input, model, additionalHeaders, additionalQueryParams, additionalBodyProperties) /* spotless:on */ - } + override fun hashCode(): Int = /* spotless:off */ Objects.hash(input, model, additionalHeaders, additionalQueryParams, additionalBodyProperties) /* spotless:on */ override fun toString() = "ModerationCreateParams{input=$input, model=$model, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams, additionalBodyProperties=$additionalBodyProperties}" @@ -432,15 +427,13 @@ constructor( return true } - return /* spotless:off */ other is Input && this.string == other.string && this.strings == other.strings && this.moderationMultiModalArray == other.moderationMultiModalArray /* spotless:on */ + return /* spotless:off */ other is Input && string == other.string && strings == other.strings && moderationMultiModalArray == other.moderationMultiModalArray /* spotless:on */ } - override fun hashCode(): Int { - return /* spotless:off */ Objects.hash(string, strings, moderationMultiModalArray) /* spotless:on */ - } + override fun hashCode(): Int = /* spotless:off */ Objects.hash(string, strings, moderationMultiModalArray) /* spotless:on */ - override fun toString(): String { - return when { + override fun toString(): String = + when { string != null -> "Input{string=$string}" strings != null -> "Input{strings=$strings}" moderationMultiModalArray != null -> @@ -448,7 +441,6 @@ constructor( _json != null -> "Input{_unknown=$_json}" else -> throw IllegalStateException("Invalid Input") } - } companion object { @@ -528,7 +520,7 @@ constructor( return true } - return /* spotless:off */ other is Model && this.value == other.value /* spotless:on */ + return /* spotless:off */ other is Model && value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() diff --git a/openai-java-core/src/main/kotlin/com/openai/models/ModerationCreateResponse.kt b/openai-java-core/src/main/kotlin/com/openai/models/ModerationCreateResponse.kt index 8ffb2feb6..e8f6a6945 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/ModerationCreateResponse.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/ModerationCreateResponse.kt @@ -130,17 +130,14 @@ private constructor( return true } - return /* spotless:off */ other is ModerationCreateResponse && this.id == other.id && this.model == other.model && this.results == other.results && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is ModerationCreateResponse && id == other.id && model == other.model && results == other.results && additionalProperties == other.additionalProperties /* spotless:on */ } - private var hashCode: Int = 0 + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(id, model, results, additionalProperties) } + /* spotless:on */ - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = /* spotless:off */ Objects.hash(id, model, results, additionalProperties) /* spotless:on */ - } - return hashCode - } + override fun hashCode(): Int = hashCode override fun toString() = "ModerationCreateResponse{id=$id, model=$model, results=$results, additionalProperties=$additionalProperties}" diff --git a/openai-java-core/src/main/kotlin/com/openai/models/ModerationImageUrlInput.kt b/openai-java-core/src/main/kotlin/com/openai/models/ModerationImageUrlInput.kt index 2e82b7cf2..b34b94119 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/ModerationImageUrlInput.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/ModerationImageUrlInput.kt @@ -187,17 +187,14 @@ private constructor( return true } - return /* spotless:off */ other is ImageUrl && this.url == other.url && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is ImageUrl && url == other.url && additionalProperties == other.additionalProperties /* spotless:on */ } - private var hashCode: Int = 0 + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(url, additionalProperties) } + /* spotless:on */ - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = /* spotless:off */ Objects.hash(url, additionalProperties) /* spotless:on */ - } - return hashCode - } + override fun hashCode(): Int = hashCode override fun toString() = "ImageUrl{url=$url, additionalProperties=$additionalProperties}" } @@ -215,7 +212,7 @@ private constructor( return true } - return /* spotless:off */ other is Type && this.value == other.value /* spotless:on */ + return /* spotless:off */ other is Type && value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -258,17 +255,14 @@ private constructor( return true } - return /* spotless:off */ other is ModerationImageUrlInput && this.type == other.type && this.imageUrl == other.imageUrl && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is ModerationImageUrlInput && type == other.type && imageUrl == other.imageUrl && additionalProperties == other.additionalProperties /* spotless:on */ } - private var hashCode: Int = 0 + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(type, imageUrl, additionalProperties) } + /* spotless:on */ - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = /* spotless:off */ Objects.hash(type, imageUrl, additionalProperties) /* spotless:on */ - } - return hashCode - } + override fun hashCode(): Int = hashCode override fun toString() = "ModerationImageUrlInput{type=$type, imageUrl=$imageUrl, additionalProperties=$additionalProperties}" diff --git a/openai-java-core/src/main/kotlin/com/openai/models/ModerationModel.kt b/openai-java-core/src/main/kotlin/com/openai/models/ModerationModel.kt index 6e26ec4a1..c51663d27 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/ModerationModel.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/ModerationModel.kt @@ -21,7 +21,7 @@ private constructor( return true } - return /* spotless:off */ other is ModerationModel && this.value == other.value /* spotless:on */ + return /* spotless:off */ other is ModerationModel && value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() diff --git a/openai-java-core/src/main/kotlin/com/openai/models/ModerationMultiModalInput.kt b/openai-java-core/src/main/kotlin/com/openai/models/ModerationMultiModalInput.kt index ee6f4de7e..925525609 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/ModerationMultiModalInput.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/ModerationMultiModalInput.kt @@ -73,15 +73,13 @@ private constructor( return true } - return /* spotless:off */ other is ModerationMultiModalInput && this.moderationImageUrlInput == other.moderationImageUrlInput && this.moderationTextInput == other.moderationTextInput /* spotless:on */ + return /* spotless:off */ other is ModerationMultiModalInput && moderationImageUrlInput == other.moderationImageUrlInput && moderationTextInput == other.moderationTextInput /* spotless:on */ } - override fun hashCode(): Int { - return /* spotless:off */ Objects.hash(moderationImageUrlInput, moderationTextInput) /* spotless:on */ - } + override fun hashCode(): Int = /* spotless:off */ Objects.hash(moderationImageUrlInput, moderationTextInput) /* spotless:on */ - override fun toString(): String { - return when { + override fun toString(): String = + when { moderationImageUrlInput != null -> "ModerationMultiModalInput{moderationImageUrlInput=$moderationImageUrlInput}" moderationTextInput != null -> @@ -89,7 +87,6 @@ private constructor( _json != null -> "ModerationMultiModalInput{_unknown=$_json}" else -> throw IllegalStateException("Invalid ModerationMultiModalInput") } - } companion object { diff --git a/openai-java-core/src/main/kotlin/com/openai/models/ModerationTextInput.kt b/openai-java-core/src/main/kotlin/com/openai/models/ModerationTextInput.kt index fb36d83d4..5b9a58e5f 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/ModerationTextInput.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/ModerationTextInput.kt @@ -124,7 +124,7 @@ private constructor( return true } - return /* spotless:off */ other is Type && this.value == other.value /* spotless:on */ + return /* spotless:off */ other is Type && value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -167,17 +167,14 @@ private constructor( return true } - return /* spotless:off */ other is ModerationTextInput && this.type == other.type && this.text == other.text && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is ModerationTextInput && type == other.type && text == other.text && additionalProperties == other.additionalProperties /* spotless:on */ } - private var hashCode: Int = 0 + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(type, text, additionalProperties) } + /* spotless:on */ - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = /* spotless:off */ Objects.hash(type, text, additionalProperties) /* spotless:on */ - } - return hashCode - } + override fun hashCode(): Int = hashCode override fun toString() = "ModerationTextInput{type=$type, text=$text, additionalProperties=$additionalProperties}" diff --git a/openai-java-core/src/main/kotlin/com/openai/models/ResponseFormatJsonObject.kt b/openai-java-core/src/main/kotlin/com/openai/models/ResponseFormatJsonObject.kt index 11d8b1271..9f1d46045 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/ResponseFormatJsonObject.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/ResponseFormatJsonObject.kt @@ -101,7 +101,7 @@ private constructor( return true } - return /* spotless:off */ other is Type && this.value == other.value /* spotless:on */ + return /* spotless:off */ other is Type && value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -144,17 +144,14 @@ private constructor( return true } - return /* spotless:off */ other is ResponseFormatJsonObject && this.type == other.type && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is ResponseFormatJsonObject && type == other.type && additionalProperties == other.additionalProperties /* spotless:on */ } - private var hashCode: Int = 0 + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(type, additionalProperties) } + /* spotless:on */ - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = /* spotless:off */ Objects.hash(type, additionalProperties) /* spotless:on */ - } - return hashCode - } + override fun hashCode(): Int = hashCode override fun toString() = "ResponseFormatJsonObject{type=$type, additionalProperties=$additionalProperties}" diff --git a/openai-java-core/src/main/kotlin/com/openai/models/ResponseFormatJsonSchema.kt b/openai-java-core/src/main/kotlin/com/openai/models/ResponseFormatJsonSchema.kt index fc0a592b8..6853160f3 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/ResponseFormatJsonSchema.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/ResponseFormatJsonSchema.kt @@ -344,17 +344,14 @@ private constructor( return true } - return /* spotless:off */ other is Schema && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Schema && additionalProperties == other.additionalProperties /* spotless:on */ } - private var hashCode: Int = 0 + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + /* spotless:on */ - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = /* spotless:off */ Objects.hash(additionalProperties) /* spotless:on */ - } - return hashCode - } + override fun hashCode(): Int = hashCode override fun toString() = "Schema{additionalProperties=$additionalProperties}" } @@ -364,17 +361,14 @@ private constructor( return true } - return /* spotless:off */ other is JsonSchema && this.description == other.description && this.name == other.name && this.schema == other.schema && this.strict == other.strict && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is JsonSchema && description == other.description && name == other.name && schema == other.schema && strict == other.strict && additionalProperties == other.additionalProperties /* spotless:on */ } - private var hashCode: Int = 0 + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(description, name, schema, strict, additionalProperties) } + /* spotless:on */ - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = /* spotless:off */ Objects.hash(description, name, schema, strict, additionalProperties) /* spotless:on */ - } - return hashCode - } + override fun hashCode(): Int = hashCode override fun toString() = "JsonSchema{description=$description, name=$name, schema=$schema, strict=$strict, additionalProperties=$additionalProperties}" @@ -393,7 +387,7 @@ private constructor( return true } - return /* spotless:off */ other is Type && this.value == other.value /* spotless:on */ + return /* spotless:off */ other is Type && value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -436,17 +430,14 @@ private constructor( return true } - return /* spotless:off */ other is ResponseFormatJsonSchema && this.type == other.type && this.jsonSchema == other.jsonSchema && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is ResponseFormatJsonSchema && type == other.type && jsonSchema == other.jsonSchema && additionalProperties == other.additionalProperties /* spotless:on */ } - private var hashCode: Int = 0 + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(type, jsonSchema, additionalProperties) } + /* spotless:on */ - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = /* spotless:off */ Objects.hash(type, jsonSchema, additionalProperties) /* spotless:on */ - } - return hashCode - } + override fun hashCode(): Int = hashCode override fun toString() = "ResponseFormatJsonSchema{type=$type, jsonSchema=$jsonSchema, additionalProperties=$additionalProperties}" diff --git a/openai-java-core/src/main/kotlin/com/openai/models/ResponseFormatText.kt b/openai-java-core/src/main/kotlin/com/openai/models/ResponseFormatText.kt index ef3408505..532a02561 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/ResponseFormatText.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/ResponseFormatText.kt @@ -101,7 +101,7 @@ private constructor( return true } - return /* spotless:off */ other is Type && this.value == other.value /* spotless:on */ + return /* spotless:off */ other is Type && value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -144,17 +144,14 @@ private constructor( return true } - return /* spotless:off */ other is ResponseFormatText && this.type == other.type && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is ResponseFormatText && type == other.type && additionalProperties == other.additionalProperties /* spotless:on */ } - private var hashCode: Int = 0 + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(type, additionalProperties) } + /* spotless:on */ - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = /* spotless:off */ Objects.hash(type, additionalProperties) /* spotless:on */ - } - return hashCode - } + override fun hashCode(): Int = hashCode override fun toString() = "ResponseFormatText{type=$type, additionalProperties=$additionalProperties}" diff --git a/openai-java-core/src/main/kotlin/com/openai/models/Upload.kt b/openai-java-core/src/main/kotlin/com/openai/models/Upload.kt index fbf444cb2..dc0d0b877 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/Upload.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/Upload.kt @@ -272,7 +272,7 @@ private constructor( return true } - return /* spotless:off */ other is Object && this.value == other.value /* spotless:on */ + return /* spotless:off */ other is Object && value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -323,7 +323,7 @@ private constructor( return true } - return /* spotless:off */ other is Status && this.value == other.value /* spotless:on */ + return /* spotless:off */ other is Status && value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -384,17 +384,14 @@ private constructor( return true } - return /* spotless:off */ other is Upload && this.id == other.id && this.createdAt == other.createdAt && this.filename == other.filename && this.bytes == other.bytes && this.purpose == other.purpose && this.status == other.status && this.expiresAt == other.expiresAt && this.object_ == other.object_ && this.file == other.file && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Upload && id == other.id && createdAt == other.createdAt && filename == other.filename && bytes == other.bytes && purpose == other.purpose && status == other.status && expiresAt == other.expiresAt && object_ == other.object_ && file == other.file && additionalProperties == other.additionalProperties /* spotless:on */ } - private var hashCode: Int = 0 + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(id, createdAt, filename, bytes, purpose, status, expiresAt, object_, file, additionalProperties) } + /* spotless:on */ - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = /* spotless:off */ Objects.hash(id, createdAt, filename, bytes, purpose, status, expiresAt, object_, file, additionalProperties) /* spotless:on */ - } - return hashCode - } + override fun hashCode(): Int = hashCode override fun toString() = "Upload{id=$id, createdAt=$createdAt, filename=$filename, bytes=$bytes, purpose=$purpose, status=$status, expiresAt=$expiresAt, object_=$object_, file=$file, additionalProperties=$additionalProperties}" diff --git a/openai-java-core/src/main/kotlin/com/openai/models/UploadCancelParams.kt b/openai-java-core/src/main/kotlin/com/openai/models/UploadCancelParams.kt index 6cddacd85..867220652 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/UploadCancelParams.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/UploadCancelParams.kt @@ -48,12 +48,10 @@ constructor( return true } - return /* spotless:off */ other is UploadCancelParams && this.uploadId == other.uploadId && this.additionalHeaders == other.additionalHeaders && this.additionalQueryParams == other.additionalQueryParams && this.additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ + return /* spotless:off */ other is UploadCancelParams && uploadId == other.uploadId && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams && additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ } - override fun hashCode(): Int { - return /* spotless:off */ Objects.hash(uploadId, additionalHeaders, additionalQueryParams, additionalBodyProperties) /* spotless:on */ - } + override fun hashCode(): Int = /* spotless:off */ Objects.hash(uploadId, additionalHeaders, additionalQueryParams, additionalBodyProperties) /* spotless:on */ override fun toString() = "UploadCancelParams{uploadId=$uploadId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams, additionalBodyProperties=$additionalBodyProperties}" diff --git a/openai-java-core/src/main/kotlin/com/openai/models/UploadCompleteParams.kt b/openai-java-core/src/main/kotlin/com/openai/models/UploadCompleteParams.kt index b3d5d2b69..a3c1abec8 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/UploadCompleteParams.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/UploadCompleteParams.kt @@ -131,17 +131,14 @@ constructor( return true } - return /* spotless:off */ other is UploadCompleteBody && this.partIds == other.partIds && this.md5 == other.md5 && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is UploadCompleteBody && partIds == other.partIds && md5 == other.md5 && additionalProperties == other.additionalProperties /* spotless:on */ } - private var hashCode: Int = 0 + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(partIds, md5, additionalProperties) } + /* spotless:on */ - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = /* spotless:off */ Objects.hash(partIds, md5, additionalProperties) /* spotless:on */ - } - return hashCode - } + override fun hashCode(): Int = hashCode override fun toString() = "UploadCompleteBody{partIds=$partIds, md5=$md5, additionalProperties=$additionalProperties}" @@ -158,12 +155,10 @@ constructor( return true } - return /* spotless:off */ other is UploadCompleteParams && this.uploadId == other.uploadId && this.partIds == other.partIds && this.md5 == other.md5 && this.additionalHeaders == other.additionalHeaders && this.additionalQueryParams == other.additionalQueryParams && this.additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ + return /* spotless:off */ other is UploadCompleteParams && uploadId == other.uploadId && partIds == other.partIds && md5 == other.md5 && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams && additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ } - override fun hashCode(): Int { - return /* spotless:off */ Objects.hash(uploadId, partIds, md5, additionalHeaders, additionalQueryParams, additionalBodyProperties) /* spotless:on */ - } + override fun hashCode(): Int = /* spotless:off */ Objects.hash(uploadId, partIds, md5, additionalHeaders, additionalQueryParams, additionalBodyProperties) /* spotless:on */ override fun toString() = "UploadCompleteParams{uploadId=$uploadId, partIds=$partIds, md5=$md5, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams, additionalBodyProperties=$additionalBodyProperties}" diff --git a/openai-java-core/src/main/kotlin/com/openai/models/UploadCreateParams.kt b/openai-java-core/src/main/kotlin/com/openai/models/UploadCreateParams.kt index 847a5d964..a6086a834 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/UploadCreateParams.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/UploadCreateParams.kt @@ -164,17 +164,14 @@ constructor( return true } - return /* spotless:off */ other is UploadCreateBody && this.bytes == other.bytes && this.filename == other.filename && this.mimeType == other.mimeType && this.purpose == other.purpose && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is UploadCreateBody && bytes == other.bytes && filename == other.filename && mimeType == other.mimeType && purpose == other.purpose && additionalProperties == other.additionalProperties /* spotless:on */ } - private var hashCode: Int = 0 + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(bytes, filename, mimeType, purpose, additionalProperties) } + /* spotless:on */ - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = /* spotless:off */ Objects.hash(bytes, filename, mimeType, purpose, additionalProperties) /* spotless:on */ - } - return hashCode - } + override fun hashCode(): Int = hashCode override fun toString() = "UploadCreateBody{bytes=$bytes, filename=$filename, mimeType=$mimeType, purpose=$purpose, additionalProperties=$additionalProperties}" @@ -191,12 +188,10 @@ constructor( return true } - return /* spotless:off */ other is UploadCreateParams && this.bytes == other.bytes && this.filename == other.filename && this.mimeType == other.mimeType && this.purpose == other.purpose && this.additionalHeaders == other.additionalHeaders && this.additionalQueryParams == other.additionalQueryParams && this.additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ + return /* spotless:off */ other is UploadCreateParams && bytes == other.bytes && filename == other.filename && mimeType == other.mimeType && purpose == other.purpose && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams && additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ } - override fun hashCode(): Int { - return /* spotless:off */ Objects.hash(bytes, filename, mimeType, purpose, additionalHeaders, additionalQueryParams, additionalBodyProperties) /* spotless:on */ - } + override fun hashCode(): Int = /* spotless:off */ Objects.hash(bytes, filename, mimeType, purpose, additionalHeaders, additionalQueryParams, additionalBodyProperties) /* spotless:on */ override fun toString() = "UploadCreateParams{bytes=$bytes, filename=$filename, mimeType=$mimeType, purpose=$purpose, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams, additionalBodyProperties=$additionalBodyProperties}" diff --git a/openai-java-core/src/main/kotlin/com/openai/models/UploadPart.kt b/openai-java-core/src/main/kotlin/com/openai/models/UploadPart.kt index e1fc393d3..fd50e0c94 100644 --- a/openai-java-core/src/main/kotlin/com/openai/models/UploadPart.kt +++ b/openai-java-core/src/main/kotlin/com/openai/models/UploadPart.kt @@ -160,7 +160,7 @@ private constructor( return true } - return /* spotless:off */ other is Object && this.value == other.value /* spotless:on */ + return /* spotless:off */ other is Object && value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -203,17 +203,14 @@ private constructor( return true } - return /* spotless:off */ other is UploadPart && this.id == other.id && this.createdAt == other.createdAt && this.uploadId == other.uploadId && this.object_ == other.object_ && this.additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is UploadPart && id == other.id && createdAt == other.createdAt && uploadId == other.uploadId && object_ == other.object_ && additionalProperties == other.additionalProperties /* spotless:on */ } - private var hashCode: Int = 0 + /* spotless:off */ + private val hashCode: Int by lazy { Objects.hash(id, createdAt, uploadId, object_, additionalProperties) } + /* spotless:on */ - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = /* spotless:off */ Objects.hash(id, createdAt, uploadId, object_, additionalProperties) /* spotless:on */ - } - return hashCode - } + override fun hashCode(): Int = hashCode override fun toString() = "UploadPart{id=$id, createdAt=$createdAt, uploadId=$uploadId, object_=$object_, additionalProperties=$additionalProperties}"