From 03839fce72596f512cd9da840648ab4280e50f96 Mon Sep 17 00:00:00 2001 From: stainless-bot Date: Tue, 22 Oct 2024 08:04:26 +0000 Subject: [PATCH] feat(api): api update --- .../api/client/BraintrustClientAsyncImpl.kt | 5 - .../api/client/BraintrustClientImpl.kt | 5 - .../api/core/HttpRequestBodies.kt | 111 ++ .../com/braintrustdata/api/core/Properties.kt | 13 +- .../com/braintrustdata/api/core/Values.kt | 5 +- .../api/core/handlers/ErrorHandler.kt | 125 ++ .../api/core/handlers/JsonHandler.kt | 21 + .../api/core/handlers/StringHandler.kt | 13 + .../api/core/http/HttpRequest.kt | 2 +- .../api/errors/BraintrustError.kt | 4 +- .../com/braintrustdata/api/models/Acl.kt | 70 +- .../api/models/AclBatchUpdateParams.kt | 191 +-- .../api/models/AclBatchUpdateResponse.kt | 48 +- .../api/models/AclCreateParams.kt | 89 +- .../api/models/AclDeleteParams.kt | 13 +- .../api/models/AclFindAndDeleteParams.kt | 89 +- .../braintrustdata/api/models/AclListPage.kt | 17 +- .../api/models/AclListPageAsync.kt | 17 +- .../api/models/AclListParams.kt | 30 +- .../api/models/AclRetrieveParams.kt | 11 +- .../com/braintrustdata/api/models/AiSecret.kt | 96 +- .../api/models/AiSecretCreateParams.kt | 113 +- .../api/models/AiSecretDeleteParams.kt | 13 +- .../api/models/AiSecretFindAndDeleteParams.kt | 63 +- .../api/models/AiSecretListPage.kt | 17 +- .../api/models/AiSecretListPageAsync.kt | 17 +- .../api/models/AiSecretListParams.kt | 39 +- .../api/models/AiSecretReplaceParams.kt | 113 +- .../api/models/AiSecretRetrieveParams.kt | 11 +- .../api/models/AiSecretUpdateParams.kt | 111 +- .../com/braintrustdata/api/models/ApiKey.kt | 56 +- .../api/models/ApiKeyCreateParams.kt | 63 +- .../api/models/ApiKeyDeleteParams.kt | 13 +- .../api/models/ApiKeyListPage.kt | 17 +- .../api/models/ApiKeyListPageAsync.kt | 17 +- .../api/models/ApiKeyListParams.kt | 28 +- .../api/models/ApiKeyRetrieveParams.kt | 11 +- .../models/ChatCompletionContentPartImage.kt | 100 +- .../models/ChatCompletionContentPartText.kt | 50 +- .../models/ChatCompletionMessageToolCall.kt | 100 +- .../braintrustdata/api/models/CodeBundle.kt | 218 ++- .../api/models/CreateApiKeyOutput.kt | 58 +- .../api/models/CrossObjectInsertResponse.kt | 164 +- .../braintrustdata/api/models/DataSummary.kt | 42 +- .../com/braintrustdata/api/models/Dataset.kt | 98 +- .../api/models/DatasetCreateParams.kt | 67 +- .../api/models/DatasetDeleteParams.kt | 13 +- .../braintrustdata/api/models/DatasetEvent.kt | 104 +- .../api/models/DatasetFeedbackParams.kt | 57 +- .../api/models/DatasetFetchParams.kt | 19 +- .../api/models/DatasetFetchPostParams.kt | 81 +- .../api/models/DatasetInsertParams.kt | 64 +- .../api/models/DatasetListPage.kt | 17 +- .../api/models/DatasetListPageAsync.kt | 17 +- .../api/models/DatasetListParams.kt | 32 +- .../api/models/DatasetRetrieveParams.kt | 11 +- .../api/models/DatasetSummarizeParams.kt | 13 +- .../api/models/DatasetUpdateParams.kt | 107 +- .../com/braintrustdata/api/models/EnvVar.kt | 58 +- .../api/models/EnvVarCreateParams.kt | 73 +- .../api/models/EnvVarDeleteParams.kt | 13 +- .../api/models/EnvVarListParams.kt | 28 +- .../api/models/EnvVarListResponse.kt | 42 +- .../api/models/EnvVarReplaceParams.kt | 73 +- .../api/models/EnvVarRetrieveParams.kt | 11 +- .../api/models/EnvVarUpdateParams.kt | 65 +- .../api/models/EvalCreateParams.kt | 934 +++++------ .../braintrustdata/api/models/Experiment.kt | 110 +- .../api/models/ExperimentCreateParams.kt | 133 +- .../api/models/ExperimentDeleteParams.kt | 13 +- .../api/models/ExperimentEvent.kt | 312 ++-- .../api/models/ExperimentFeedbackParams.kt | 57 +- .../api/models/ExperimentFetchParams.kt | 19 +- .../api/models/ExperimentFetchPostParams.kt | 81 +- .../api/models/ExperimentInsertParams.kt | 64 +- .../api/models/ExperimentListPage.kt | 17 +- .../api/models/ExperimentListPageAsync.kt | 17 +- .../api/models/ExperimentListParams.kt | 32 +- .../api/models/ExperimentRetrieveParams.kt | 11 +- .../api/models/ExperimentSummarizeParams.kt | 15 +- .../api/models/ExperimentUpdateParams.kt | 127 +- .../api/models/FeedbackDatasetItem.kt | 92 +- .../api/models/FeedbackExperimentItem.kt | 134 +- .../api/models/FeedbackProjectLogsItem.kt | 134 +- .../api/models/FeedbackResponseSchema.kt | 44 +- .../api/models/FetchDatasetEventsResponse.kt | 48 +- .../models/FetchExperimentEventsResponse.kt | 48 +- .../models/FetchProjectLogsEventsResponse.kt | 48 +- .../com/braintrustdata/api/models/Function.kt | 539 +++---- .../api/models/FunctionCreateParams.kt | 518 +++---- .../api/models/FunctionDeleteParams.kt | 13 +- .../api/models/FunctionInvokeParams.kt | 685 ++++---- .../api/models/FunctionInvokeResponse.kt | 39 +- .../api/models/FunctionListPage.kt | 17 +- .../api/models/FunctionListPageAsync.kt | 17 +- .../api/models/FunctionListParams.kt | 36 +- .../api/models/FunctionReplaceParams.kt | 518 +++---- .../api/models/FunctionRetrieveParams.kt | 11 +- .../api/models/FunctionToolChoice.kt | 42 +- .../api/models/FunctionUpdateParams.kt | 439 +++--- .../com/braintrustdata/api/models/Group.kt | 62 +- .../api/models/GroupCreateParams.kt | 75 +- .../api/models/GroupDeleteParams.kt | 13 +- .../api/models/GroupListPage.kt | 17 +- .../api/models/GroupListPageAsync.kt | 17 +- .../api/models/GroupListParams.kt | 28 +- .../api/models/GroupReplaceParams.kt | 75 +- .../api/models/GroupRetrieveParams.kt | 11 +- .../api/models/GroupUpdateParams.kt | 81 +- .../api/models/InsertDatasetEventMerge.kt | 100 +- .../api/models/InsertDatasetEventReplace.kt | 100 +- .../api/models/InsertEventsResponse.kt | 42 +- .../api/models/InsertExperimentEventMerge.kt | 306 ++-- .../models/InsertExperimentEventReplace.kt | 306 ++-- .../api/models/InsertProjectLogsEventMerge.kt | 304 ++-- .../models/InsertProjectLogsEventReplace.kt | 304 ++-- .../api/models/MetricSummary.kt | 56 +- .../api/models/OnlineScoreConfig.kt | 157 +- .../braintrustdata/api/models/Organization.kt | 58 +- .../api/models/OrganizationDeleteParams.kt | 13 +- .../api/models/OrganizationListPage.kt | 17 +- .../api/models/OrganizationListPageAsync.kt | 17 +- .../api/models/OrganizationListParams.kt | 26 +- .../models/OrganizationMemberUpdateParams.kt | 177 +-- .../api/models/OrganizationRetrieveParams.kt | 11 +- .../api/models/OrganizationUpdateParams.kt | 77 +- .../models/PatchOrganizationMembersOutput.kt | 50 +- .../api/models/PathLookupFilter.kt | 52 +- .../com/braintrustdata/api/models/Project.kt | 58 +- .../api/models/ProjectCreateParams.kt | 63 +- .../api/models/ProjectDeleteParams.kt | 13 +- .../api/models/ProjectListPage.kt | 17 +- .../api/models/ProjectListPageAsync.kt | 17 +- .../api/models/ProjectListParams.kt | 28 +- .../api/models/ProjectLogFeedbackParams.kt | 57 +- .../api/models/ProjectLogFetchParams.kt | 19 +- .../api/models/ProjectLogFetchPostParams.kt | 81 +- .../api/models/ProjectLogInsertParams.kt | 64 +- .../api/models/ProjectLogsEvent.kt | 314 ++-- .../api/models/ProjectRetrieveParams.kt | 11 +- .../braintrustdata/api/models/ProjectScore.kt | 208 +-- .../api/models/ProjectScoreCategory.kt | 48 +- .../api/models/ProjectScoreConfig.kt | 52 +- .../api/models/ProjectScoreCreateParams.kt | 231 ++- .../api/models/ProjectScoreDeleteParams.kt | 13 +- .../api/models/ProjectScoreListPage.kt | 17 +- .../api/models/ProjectScoreListPageAsync.kt | 17 +- .../api/models/ProjectScoreListParams.kt | 43 +- .../api/models/ProjectScoreReplaceParams.kt | 231 ++- .../api/models/ProjectScoreRetrieveParams.kt | 11 +- .../api/models/ProjectScoreType.kt | 2 +- .../api/models/ProjectScoreUpdateParams.kt | 229 ++- .../api/models/ProjectSettings.kt | 42 +- .../braintrustdata/api/models/ProjectTag.kt | 58 +- .../api/models/ProjectTagCreateParams.kt | 71 +- .../api/models/ProjectTagDeleteParams.kt | 13 +- .../api/models/ProjectTagListPage.kt | 17 +- .../api/models/ProjectTagListPageAsync.kt | 17 +- .../api/models/ProjectTagListParams.kt | 32 +- .../api/models/ProjectTagReplaceParams.kt | 71 +- .../api/models/ProjectTagRetrieveParams.kt | 11 +- .../api/models/ProjectTagUpdateParams.kt | 69 +- .../api/models/ProjectUpdateParams.kt | 65 +- .../com/braintrustdata/api/models/Prompt.kt | 112 +- .../api/models/PromptCreateParams.kt | 85 +- .../braintrustdata/api/models/PromptData.kt | 1375 +++++++---------- .../api/models/PromptDeleteParams.kt | 13 +- .../api/models/PromptListPage.kt | 17 +- .../api/models/PromptListPageAsync.kt | 17 +- .../api/models/PromptListParams.kt | 36 +- .../api/models/PromptReplaceParams.kt | 85 +- .../api/models/PromptRetrieveParams.kt | 11 +- .../api/models/PromptUpdateParams.kt | 77 +- .../com/braintrustdata/api/models/RepoInfo.kt | 62 +- .../com/braintrustdata/api/models/Role.kt | 114 +- .../api/models/RoleCreateParams.kt | 127 +- .../api/models/RoleDeleteParams.kt | 13 +- .../braintrustdata/api/models/RoleListPage.kt | 17 +- .../api/models/RoleListPageAsync.kt | 17 +- .../api/models/RoleListParams.kt | 28 +- .../api/models/RoleReplaceParams.kt | 127 +- .../api/models/RoleRetrieveParams.kt | 11 +- .../api/models/RoleUpdateParams.kt | 185 +-- .../braintrustdata/api/models/ScoreSummary.kt | 54 +- .../com/braintrustdata/api/models/Scorer.kt | 50 +- .../api/models/SummarizeDatasetResponse.kt | 54 +- .../api/models/SummarizeExperimentResponse.kt | 134 +- .../com/braintrustdata/api/models/Task.kt | 42 +- .../braintrustdata/api/models/ToolChoice.kt | 66 +- .../api/models/TopLevelHelloWorldParams.kt | 6 +- .../com/braintrustdata/api/models/User.kt | 56 +- .../braintrustdata/api/models/UserListPage.kt | 17 +- .../api/models/UserListPageAsync.kt | 17 +- .../api/models/UserListParams.kt | 57 +- .../api/models/UserRetrieveParams.kt | 11 +- .../com/braintrustdata/api/models/View.kt | 68 +- .../api/models/ViewCreateParams.kt | 91 +- .../com/braintrustdata/api/models/ViewData.kt | 40 +- .../api/models/ViewDataSearch.kt | 52 +- .../api/models/ViewDeleteParams.kt | 67 +- .../braintrustdata/api/models/ViewListPage.kt | 17 +- .../api/models/ViewListPageAsync.kt | 17 +- .../api/models/ViewListParams.kt | 36 +- .../braintrustdata/api/models/ViewOptions.kt | 127 +- .../api/models/ViewReplaceParams.kt | 91 +- .../api/models/ViewRetrieveParams.kt | 17 +- .../api/models/ViewUpdateParams.kt | 89 +- .../api/services/async/AclServiceAsyncImpl.kt | 8 +- .../async/AiSecretServiceAsyncImpl.kt | 8 +- .../services/async/ApiKeyServiceAsyncImpl.kt | 8 +- .../services/async/DatasetServiceAsyncImpl.kt | 8 +- .../services/async/EnvVarServiceAsyncImpl.kt | 8 +- .../services/async/EvalServiceAsyncImpl.kt | 8 +- .../async/ExperimentServiceAsyncImpl.kt | 8 +- .../async/FunctionServiceAsyncImpl.kt | 8 +- .../services/async/GroupServiceAsyncImpl.kt | 8 +- .../async/OrganizationServiceAsyncImpl.kt | 8 +- .../async/ProjectScoreServiceAsyncImpl.kt | 8 +- .../services/async/ProjectServiceAsyncImpl.kt | 8 +- .../async/ProjectTagServiceAsyncImpl.kt | 8 +- .../services/async/PromptServiceAsyncImpl.kt | 8 +- .../services/async/RoleServiceAsyncImpl.kt | 8 +- .../async/TopLevelServiceAsyncImpl.kt | 6 +- .../services/async/UserServiceAsyncImpl.kt | 6 +- .../services/async/ViewServiceAsyncImpl.kt | 8 +- .../organizations/MemberServiceAsyncImpl.kt | 8 +- .../async/projects/LogServiceAsyncImpl.kt | 8 +- .../api/services/blocking/AclServiceImpl.kt | 8 +- .../services/blocking/AiSecretServiceImpl.kt | 8 +- .../services/blocking/ApiKeyServiceImpl.kt | 8 +- .../services/blocking/DatasetServiceImpl.kt | 8 +- .../services/blocking/EnvVarServiceImpl.kt | 8 +- .../api/services/blocking/EvalServiceImpl.kt | 8 +- .../blocking/ExperimentServiceImpl.kt | 8 +- .../services/blocking/FunctionServiceImpl.kt | 8 +- .../api/services/blocking/GroupServiceImpl.kt | 8 +- .../blocking/OrganizationServiceImpl.kt | 8 +- .../blocking/ProjectScoreServiceImpl.kt | 8 +- .../services/blocking/ProjectServiceImpl.kt | 8 +- .../blocking/ProjectTagServiceImpl.kt | 8 +- .../services/blocking/PromptServiceImpl.kt | 8 +- .../api/services/blocking/RoleServiceImpl.kt | 8 +- .../services/blocking/TopLevelServiceImpl.kt | 6 +- .../api/services/blocking/UserServiceImpl.kt | 6 +- .../api/services/blocking/ViewServiceImpl.kt | 8 +- .../organizations/MemberServiceImpl.kt | 8 +- .../blocking/projects/LogServiceImpl.kt | 8 +- .../models/ProjectScoreCreateParamsTest.kt | 6 +- .../models/ProjectScoreReplaceParamsTest.kt | 6 +- .../api/models/ProjectScoreTest.kt | 4 +- .../models/ProjectScoreUpdateParamsTest.kt | 6 +- .../blocking/ProjectScoreServiceTest.kt | 6 +- .../main/kotlin/braintrust.java.gradle.kts | 1 + .../main/kotlin/braintrust.kotlin.gradle.kts | 1 + 254 files changed, 6704 insertions(+), 11141 deletions(-) create mode 100644 braintrust-java-core/src/main/kotlin/com/braintrustdata/api/core/HttpRequestBodies.kt create mode 100644 braintrust-java-core/src/main/kotlin/com/braintrustdata/api/core/handlers/ErrorHandler.kt create mode 100644 braintrust-java-core/src/main/kotlin/com/braintrustdata/api/core/handlers/JsonHandler.kt create mode 100644 braintrust-java-core/src/main/kotlin/com/braintrustdata/api/core/handlers/StringHandler.kt diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/client/BraintrustClientAsyncImpl.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/client/BraintrustClientAsyncImpl.kt index ee5f3110..d5a7c733 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/client/BraintrustClientAsyncImpl.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/client/BraintrustClientAsyncImpl.kt @@ -3,19 +3,14 @@ package com.braintrustdata.api.client import com.braintrustdata.api.core.ClientOptions -import com.braintrustdata.api.core.http.HttpResponse.Handler -import com.braintrustdata.api.errors.BraintrustError import com.braintrustdata.api.models.* import com.braintrustdata.api.services.async.* -import com.braintrustdata.api.services.errorHandler class BraintrustClientAsyncImpl constructor( private val clientOptions: ClientOptions, ) : BraintrustClientAsync { - private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) - private val sync: BraintrustClient by lazy { BraintrustClientImpl(clientOptions) } private val topLevel: TopLevelServiceAsync by lazy { TopLevelServiceAsyncImpl(clientOptions) } diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/client/BraintrustClientImpl.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/client/BraintrustClientImpl.kt index e23daeb0..e770915e 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/client/BraintrustClientImpl.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/client/BraintrustClientImpl.kt @@ -3,19 +3,14 @@ package com.braintrustdata.api.client import com.braintrustdata.api.core.ClientOptions -import com.braintrustdata.api.core.http.HttpResponse.Handler -import com.braintrustdata.api.errors.BraintrustError import com.braintrustdata.api.models.* import com.braintrustdata.api.services.blocking.* -import com.braintrustdata.api.services.errorHandler class BraintrustClientImpl constructor( private val clientOptions: ClientOptions, ) : BraintrustClient { - private val errorHandler: Handler = errorHandler(clientOptions.jsonMapper) - private val async: BraintrustClientAsync by lazy { BraintrustClientAsyncImpl(clientOptions) } private val topLevel: TopLevelService by lazy { TopLevelServiceImpl(clientOptions) } diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/core/HttpRequestBodies.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/core/HttpRequestBodies.kt new file mode 100644 index 00000000..65052ee1 --- /dev/null +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/core/HttpRequestBodies.kt @@ -0,0 +1,111 @@ +@file:JvmName("HttpRequestBodies") + +package com.braintrustdata.api.core + +import com.braintrustdata.api.core.http.HttpRequestBody +import com.braintrustdata.api.errors.BraintrustException +import com.fasterxml.jackson.databind.json.JsonMapper +import java.io.ByteArrayOutputStream +import java.io.OutputStream +import org.apache.hc.client5.http.entity.mime.MultipartEntityBuilder + +@JvmSynthetic +internal inline fun json( + jsonMapper: JsonMapper, + value: T, +): HttpRequestBody { + return object : HttpRequestBody { + private var cachedBytes: ByteArray? = null + + private fun serialize(): ByteArray { + if (cachedBytes != null) return cachedBytes!! + + val buffer = ByteArrayOutputStream() + try { + jsonMapper.writeValue(buffer, value) + cachedBytes = buffer.toByteArray() + return cachedBytes!! + } catch (e: Exception) { + throw BraintrustException("Error writing request", e) + } + } + + override fun writeTo(outputStream: OutputStream) { + outputStream.write(serialize()) + } + + override fun contentType(): String = "application/json" + + override fun contentLength(): Long { + return serialize().size.toLong() + } + + override fun repeatable(): Boolean = true + + override fun close() {} + } +} + +@JvmSynthetic +internal fun multipartFormData( + jsonMapper: JsonMapper, + parts: Array?> +): HttpRequestBody { + val builder = MultipartEntityBuilder.create() + parts.forEach { part -> + if (part?.value != null) { + when (part.value) { + is JsonValue -> { + val buffer = ByteArrayOutputStream() + try { + jsonMapper.writeValue(buffer, part.value) + } catch (e: Exception) { + throw BraintrustException("Error serializing value to json", e) + } + builder.addBinaryBody( + part.name, + buffer.toByteArray(), + part.contentType, + part.filename + ) + } + is Boolean -> + builder.addTextBody( + part.name, + if (part.value) "true" else "false", + part.contentType + ) + is Int -> builder.addTextBody(part.name, part.value.toString(), part.contentType) + is Long -> builder.addTextBody(part.name, part.value.toString(), part.contentType) + is Double -> builder.addTextBody(part.name, part.value.toString(), part.contentType) + is ByteArray -> + builder.addBinaryBody(part.name, part.value, part.contentType, part.filename) + is String -> builder.addTextBody(part.name, part.value, part.contentType) + is Enum -> builder.addTextBody(part.name, part.value.toString(), part.contentType) + else -> + throw IllegalArgumentException( + "Unsupported content type: ${part.value::class.java.simpleName}" + ) + } + } + } + val entity = builder.build() + + return object : HttpRequestBody { + override fun writeTo(outputStream: OutputStream) { + try { + return entity.writeTo(outputStream) + } catch (e: Exception) { + throw BraintrustException("Error writing request", e) + } + } + + override fun contentType(): String = entity.contentType + + override fun contentLength(): Long = -1 + + override fun repeatable(): Boolean = entity.isRepeatable + + override fun close() = entity.close() + } +} diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/core/Properties.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/core/Properties.kt index 1c59eee1..a0924603 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/core/Properties.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/core/Properties.kt @@ -34,14 +34,9 @@ fun getOsName(): String { } } -fun getOsVersion(): String { - return System.getProperty("os.version", "unknown") -} +fun getOsVersion(): String = System.getProperty("os.version", "unknown") -fun getPackageVersion(): String { - return Properties::class.java.`package`.implementationVersion ?: "unknown" -} +fun getPackageVersion(): String = + Properties::class.java.`package`.implementationVersion ?: "unknown" -fun getJavaVersion(): String { - return System.getProperty("java.version", "unknown") -} +fun getJavaVersion(): String = System.getProperty("java.version", "unknown") diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/core/Values.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/core/Values.kt index 9ede4db6..45e19b1c 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/core/Values.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/core/Values.kt @@ -479,9 +479,8 @@ internal constructor( } } - override fun toString(): String { - return "MultipartFormValue(name='$name', contentType=$contentType, filename=$filename, value=${valueToString()})" - } + override fun toString(): String = + "MultipartFormValue{name=$name, contentType=$contentType, filename=$filename, value=${valueToString()}}" private fun valueToString(): String = when (value) { diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/core/handlers/ErrorHandler.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/core/handlers/ErrorHandler.kt new file mode 100644 index 00000000..62010fbb --- /dev/null +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/core/handlers/ErrorHandler.kt @@ -0,0 +1,125 @@ +@file:JvmName("ErrorHandler") + +package com.braintrustdata.api.core.handlers + +import com.braintrustdata.api.core.http.HttpResponse +import com.braintrustdata.api.core.http.HttpResponse.Handler +import com.braintrustdata.api.errors.BadRequestException +import com.braintrustdata.api.errors.BraintrustError +import com.braintrustdata.api.errors.InternalServerException +import com.braintrustdata.api.errors.NotFoundException +import com.braintrustdata.api.errors.PermissionDeniedException +import com.braintrustdata.api.errors.RateLimitException +import com.braintrustdata.api.errors.UnauthorizedException +import com.braintrustdata.api.errors.UnexpectedStatusCodeException +import com.braintrustdata.api.errors.UnprocessableEntityException +import com.fasterxml.jackson.databind.json.JsonMapper +import com.google.common.collect.ListMultimap +import java.io.ByteArrayInputStream +import java.io.InputStream + +@JvmSynthetic +internal fun errorHandler(jsonMapper: JsonMapper): Handler { + val handler = jsonHandler(jsonMapper) + + return object : Handler { + override fun handle(response: HttpResponse): BraintrustError = + try { + handler.handle(response) + } catch (e: Exception) { + BraintrustError.builder().build() + } + } +} + +@JvmSynthetic +internal fun Handler.withErrorHandler(errorHandler: Handler): Handler = + object : Handler { + override fun handle(response: HttpResponse): T { + when (val statusCode = response.statusCode()) { + in 200..299 -> { + return this@withErrorHandler.handle(response) + } + 400 -> { + val buffered = response.buffered() + throw BadRequestException( + buffered.headers(), + stringHandler().handle(buffered), + errorHandler.handle(buffered), + ) + } + 401 -> { + val buffered = response.buffered() + throw UnauthorizedException( + buffered.headers(), + stringHandler().handle(buffered), + errorHandler.handle(buffered), + ) + } + 403 -> { + val buffered = response.buffered() + throw PermissionDeniedException( + buffered.headers(), + stringHandler().handle(buffered), + errorHandler.handle(buffered), + ) + } + 404 -> { + val buffered = response.buffered() + throw NotFoundException( + buffered.headers(), + stringHandler().handle(buffered), + errorHandler.handle(buffered), + ) + } + 422 -> { + val buffered = response.buffered() + throw UnprocessableEntityException( + buffered.headers(), + stringHandler().handle(buffered), + errorHandler.handle(buffered), + ) + } + 429 -> { + val buffered = response.buffered() + throw RateLimitException( + buffered.headers(), + stringHandler().handle(buffered), + errorHandler.handle(buffered), + ) + } + in 500..599 -> { + val buffered = response.buffered() + throw InternalServerException( + statusCode, + buffered.headers(), + stringHandler().handle(buffered), + errorHandler.handle(buffered), + ) + } + else -> { + val buffered = response.buffered() + throw UnexpectedStatusCodeException( + statusCode, + buffered.headers(), + stringHandler().handle(buffered), + errorHandler.handle(buffered), + ) + } + } + } + } + +private fun HttpResponse.buffered(): HttpResponse { + val body = body().readBytes() + + return object : HttpResponse { + override fun statusCode(): Int = this@buffered.statusCode() + + override fun headers(): ListMultimap = this@buffered.headers() + + override fun body(): InputStream = ByteArrayInputStream(body) + + override fun close() = this@buffered.close() + } +} diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/core/handlers/JsonHandler.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/core/handlers/JsonHandler.kt new file mode 100644 index 00000000..6db3e392 --- /dev/null +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/core/handlers/JsonHandler.kt @@ -0,0 +1,21 @@ +@file:JvmName("JsonHandler") + +package com.braintrustdata.api.core.handlers + +import com.braintrustdata.api.core.http.HttpResponse +import com.braintrustdata.api.core.http.HttpResponse.Handler +import com.braintrustdata.api.errors.BraintrustException +import com.fasterxml.jackson.databind.json.JsonMapper +import com.fasterxml.jackson.module.kotlin.jacksonTypeRef + +@JvmSynthetic +internal inline fun jsonHandler(jsonMapper: JsonMapper): Handler = + object : Handler { + override fun handle(response: HttpResponse): T { + try { + return jsonMapper.readValue(response.body(), jacksonTypeRef()) + } catch (e: Exception) { + throw BraintrustException("Error reading response", e) + } + } + } diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/core/handlers/StringHandler.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/core/handlers/StringHandler.kt new file mode 100644 index 00000000..bb04609d --- /dev/null +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/core/handlers/StringHandler.kt @@ -0,0 +1,13 @@ +@file:JvmName("StringHandler") + +package com.braintrustdata.api.core.handlers + +import com.braintrustdata.api.core.http.HttpResponse +import com.braintrustdata.api.core.http.HttpResponse.Handler + +@JvmSynthetic internal fun stringHandler(): Handler = StringHandlerInternal + +private object StringHandlerInternal : Handler { + override fun handle(response: HttpResponse): String = + response.body().readBytes().toString(Charsets.UTF_8) +} diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/core/http/HttpRequest.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/core/http/HttpRequest.kt index f4ba383e..4662ece7 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/core/http/HttpRequest.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/core/http/HttpRequest.kt @@ -17,7 +17,7 @@ private constructor( ) { override fun toString(): String = - "HttpRequest {method=$method, pathSegments=$pathSegments, queryParams=$queryParams, headers=$headers, body=$body}" + "HttpRequest{method=$method, pathSegments=$pathSegments, queryParams=$queryParams, headers=$headers, body=$body}" companion object { @JvmStatic fun builder() = Builder() diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/errors/BraintrustError.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/errors/BraintrustError.kt index e845c581..aa821e80 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/errors/BraintrustError.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/errors/BraintrustError.kt @@ -26,11 +26,11 @@ constructor( return true } - return other is BraintrustError && this.additionalProperties == other.additionalProperties + return /* spotless:off */ other is BraintrustError && this.additionalProperties == other.additionalProperties /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash(additionalProperties) + return /* spotless:off */ Objects.hash(additionalProperties) /* spotless:on */ } override fun toString() = "BraintrustError{additionalProperties=$additionalProperties}" diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/Acl.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/Acl.kt index 4af6e306..25b577be 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/Acl.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/Acl.kt @@ -48,8 +48,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - /** Unique identifier for the acl */ fun id(): String = id.getRequired("id") @@ -152,48 +150,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Acl && - this.id == other.id && - this.objectType == other.objectType && - this.objectId == other.objectId && - this.userId == other.userId && - this.groupId == other.groupId && - this.permission == other.permission && - this.restrictObjectType == other.restrictObjectType && - this.roleId == other.roleId && - this._objectOrgId == other._objectOrgId && - this.created == other.created && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - id, - objectType, - objectId, - userId, - groupId, - permission, - restrictObjectType, - roleId, - _objectOrgId, - created, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "Acl{id=$id, objectType=$objectType, objectId=$objectId, userId=$userId, groupId=$groupId, permission=$permission, restrictObjectType=$restrictObjectType, roleId=$roleId, _objectOrgId=$_objectOrgId, created=$created, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -378,7 +334,7 @@ private constructor( return true } - return other is ObjectType && this.value == other.value + return /* spotless:off */ other is ObjectType && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -489,7 +445,7 @@ private constructor( return true } - return other is Permission && this.value == other.value + return /* spotless:off */ other is Permission && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -582,7 +538,7 @@ private constructor( return true } - return other is RestrictObjectType && this.value == other.value + return /* spotless:off */ other is RestrictObjectType && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -679,4 +635,24 @@ private constructor( fun asString(): String = _value().asStringOrThrow() } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Acl && this.id == other.id && this.objectType == other.objectType && this.objectId == other.objectId && this.userId == other.userId && this.groupId == other.groupId && this.permission == other.permission && this.restrictObjectType == other.restrictObjectType && this.roleId == other.roleId && this._objectOrgId == other._objectOrgId && this.created == other.created && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(id, objectType, objectId, userId, groupId, permission, restrictObjectType, roleId, _objectOrgId, created, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "Acl{id=$id, objectType=$objectType, objectId=$objectId, userId=$userId, groupId=$groupId, permission=$permission, restrictObjectType=$restrictObjectType, roleId=$roleId, _objectOrgId=$_objectOrgId, created=$created, additionalProperties=$additionalProperties}" } diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/AclBatchUpdateParams.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/AclBatchUpdateParams.kt index 0ce57d6e..f41f20ec 100644 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/AclBatchUpdateParams.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/AclBatchUpdateParams.kt @@ -53,8 +53,6 @@ constructor( private val additionalProperties: Map, ) { - private var hashCode: Int = 0 - /** * An ACL grants a certain permission or role to a certain user or group on an object. * @@ -85,32 +83,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is AclBatchUpdateBody && - this.addAcls == other.addAcls && - this.removeAcls == other.removeAcls && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - addAcls, - removeAcls, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "AclBatchUpdateBody{addAcls=$addAcls, removeAcls=$removeAcls, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -178,6 +150,26 @@ constructor( additionalProperties.toUnmodifiable(), ) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is AclBatchUpdateBody && this.addAcls == other.addAcls && this.removeAcls == other.removeAcls && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(addAcls, removeAcls, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "AclBatchUpdateBody{addAcls=$addAcls, removeAcls=$removeAcls, additionalProperties=$additionalProperties}" } fun _additionalQueryParams(): Map> = additionalQueryParams @@ -191,22 +183,11 @@ constructor( return true } - return other is AclBatchUpdateParams && - this.addAcls == other.addAcls && - this.removeAcls == other.removeAcls && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders && - this.additionalBodyProperties == other.additionalBodyProperties + return /* spotless:off */ other is AclBatchUpdateParams && this.addAcls == other.addAcls && this.removeAcls == other.removeAcls && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders && this.additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - addAcls, - removeAcls, - additionalQueryParams, - additionalHeaders, - additionalBodyProperties, - ) + return /* spotless:off */ Objects.hash(addAcls, removeAcls, additionalQueryParams, additionalHeaders, additionalBodyProperties) /* spotless:on */ } override fun toString() = @@ -379,8 +360,6 @@ constructor( private val additionalProperties: Map, ) { - private var hashCode: Int = 0 - /** The object type that the ACL applies to */ @JsonProperty("object_type") fun objectType(): ObjectType? = objectType @@ -421,42 +400,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is AddAcl && - this.objectType == other.objectType && - this.objectId == other.objectId && - this.userId == other.userId && - this.groupId == other.groupId && - this.permission == other.permission && - this.restrictObjectType == other.restrictObjectType && - this.roleId == other.roleId && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - objectType, - objectId, - userId, - groupId, - permission, - restrictObjectType, - roleId, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "AddAcl{objectType=$objectType, objectId=$objectId, userId=$userId, groupId=$groupId, permission=$permission, restrictObjectType=$restrictObjectType, roleId=$roleId, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -567,7 +510,7 @@ constructor( return true } - return other is ObjectType && this.value == other.value + return /* spotless:off */ other is ObjectType && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -678,7 +621,7 @@ constructor( return true } - return other is Permission && this.value == other.value + return /* spotless:off */ other is Permission && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -771,7 +714,7 @@ constructor( return true } - return other is RestrictObjectType && this.value == other.value + return /* spotless:off */ other is RestrictObjectType && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -869,6 +812,26 @@ constructor( fun asString(): String = _value().asStringOrThrow() } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is AddAcl && this.objectType == other.objectType && this.objectId == other.objectId && this.userId == other.userId && this.groupId == other.groupId && this.permission == other.permission && this.restrictObjectType == other.restrictObjectType && this.roleId == other.roleId && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(objectType, objectId, userId, groupId, permission, restrictObjectType, roleId, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "AddAcl{objectType=$objectType, objectId=$objectId, userId=$userId, groupId=$groupId, permission=$permission, restrictObjectType=$restrictObjectType, roleId=$roleId, additionalProperties=$additionalProperties}" } /** @@ -895,8 +858,6 @@ constructor( private val additionalProperties: Map, ) { - private var hashCode: Int = 0 - /** The object type that the ACL applies to */ @JsonProperty("object_type") fun objectType(): ObjectType? = objectType @@ -937,42 +898,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is RemoveAcl && - this.objectType == other.objectType && - this.objectId == other.objectId && - this.userId == other.userId && - this.groupId == other.groupId && - this.permission == other.permission && - this.restrictObjectType == other.restrictObjectType && - this.roleId == other.roleId && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - objectType, - objectId, - userId, - groupId, - permission, - restrictObjectType, - roleId, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "RemoveAcl{objectType=$objectType, objectId=$objectId, userId=$userId, groupId=$groupId, permission=$permission, restrictObjectType=$restrictObjectType, roleId=$roleId, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -1083,7 +1008,7 @@ constructor( return true } - return other is ObjectType && this.value == other.value + return /* spotless:off */ other is ObjectType && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -1194,7 +1119,7 @@ constructor( return true } - return other is Permission && this.value == other.value + return /* spotless:off */ other is Permission && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -1287,7 +1212,7 @@ constructor( return true } - return other is RestrictObjectType && this.value == other.value + return /* spotless:off */ other is RestrictObjectType && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -1385,5 +1310,25 @@ constructor( fun asString(): String = _value().asStringOrThrow() } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is RemoveAcl && this.objectType == other.objectType && this.objectId == other.objectId && this.userId == other.userId && this.groupId == other.groupId && this.permission == other.permission && this.restrictObjectType == other.restrictObjectType && this.roleId == other.roleId && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(objectType, objectId, userId, groupId, permission, restrictObjectType, roleId, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "RemoveAcl{objectType=$objectType, objectId=$objectId, userId=$userId, groupId=$groupId, permission=$permission, restrictObjectType=$restrictObjectType, roleId=$roleId, additionalProperties=$additionalProperties}" } } diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/AclBatchUpdateResponse.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/AclBatchUpdateResponse.kt index 4d9d89b7..48ad5d75 100644 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/AclBatchUpdateResponse.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/AclBatchUpdateResponse.kt @@ -25,8 +25,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - /** * An ACL grants a certain permission or role to a certain user or group on an object. * @@ -89,32 +87,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is AclBatchUpdateResponse && - this.addedAcls == other.addedAcls && - this.removedAcls == other.removedAcls && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - addedAcls, - removedAcls, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "AclBatchUpdateResponse{addedAcls=$addedAcls, removedAcls=$removedAcls, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -208,4 +180,24 @@ private constructor( additionalProperties.toUnmodifiable(), ) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is AclBatchUpdateResponse && this.addedAcls == other.addedAcls && this.removedAcls == other.removedAcls && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(addedAcls, removedAcls, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "AclBatchUpdateResponse{addedAcls=$addedAcls, removedAcls=$removedAcls, additionalProperties=$additionalProperties}" } diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/AclCreateParams.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/AclCreateParams.kt index df9d7d5e..82944d42 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/AclCreateParams.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/AclCreateParams.kt @@ -88,8 +88,6 @@ constructor( private val additionalProperties: Map, ) { - private var hashCode: Int = 0 - /** The id of the object the ACL applies to */ @JsonProperty("object_id") fun objectId(): String? = objectId @@ -130,42 +128,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is AclCreateBody && - this.objectId == other.objectId && - this.objectType == other.objectType && - this.groupId == other.groupId && - this.permission == other.permission && - this.restrictObjectType == other.restrictObjectType && - this.roleId == other.roleId && - this.userId == other.userId && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - objectId, - objectType, - groupId, - permission, - restrictObjectType, - roleId, - userId, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "AclCreateBody{objectId=$objectId, objectType=$objectType, groupId=$groupId, permission=$permission, restrictObjectType=$restrictObjectType, roleId=$roleId, userId=$userId, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -262,6 +224,26 @@ constructor( additionalProperties.toUnmodifiable(), ) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is AclCreateBody && this.objectId == other.objectId && this.objectType == other.objectType && this.groupId == other.groupId && this.permission == other.permission && this.restrictObjectType == other.restrictObjectType && this.roleId == other.roleId && this.userId == other.userId && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(objectId, objectType, groupId, permission, restrictObjectType, roleId, userId, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "AclCreateBody{objectId=$objectId, objectType=$objectType, groupId=$groupId, permission=$permission, restrictObjectType=$restrictObjectType, roleId=$roleId, userId=$userId, additionalProperties=$additionalProperties}" } fun _additionalQueryParams(): Map> = additionalQueryParams @@ -275,32 +257,11 @@ constructor( return true } - return other is AclCreateParams && - this.objectId == other.objectId && - this.objectType == other.objectType && - this.groupId == other.groupId && - this.permission == other.permission && - this.restrictObjectType == other.restrictObjectType && - this.roleId == other.roleId && - this.userId == other.userId && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders && - this.additionalBodyProperties == other.additionalBodyProperties + return /* spotless:off */ other is AclCreateParams && this.objectId == other.objectId && this.objectType == other.objectType && this.groupId == other.groupId && this.permission == other.permission && this.restrictObjectType == other.restrictObjectType && this.roleId == other.roleId && this.userId == other.userId && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders && this.additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - objectId, - objectType, - groupId, - permission, - restrictObjectType, - roleId, - userId, - additionalQueryParams, - additionalHeaders, - additionalBodyProperties, - ) + return /* spotless:off */ Objects.hash(objectId, objectType, groupId, permission, restrictObjectType, roleId, userId, additionalQueryParams, additionalHeaders, additionalBodyProperties) /* spotless:on */ } override fun toString() = @@ -458,7 +419,7 @@ constructor( return true } - return other is ObjectType && this.value == other.value + return /* spotless:off */ other is ObjectType && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -569,7 +530,7 @@ constructor( return true } - return other is Permission && this.value == other.value + return /* spotless:off */ other is Permission && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -662,7 +623,7 @@ constructor( return true } - return other is RestrictObjectType && this.value == other.value + return /* spotless:off */ other is RestrictObjectType && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/AclDeleteParams.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/AclDeleteParams.kt index 6ffaefdf..93e7f1e1 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/AclDeleteParams.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/AclDeleteParams.kt @@ -46,20 +46,11 @@ constructor( return true } - return other is AclDeleteParams && - this.aclId == other.aclId && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders && - this.additionalBodyProperties == other.additionalBodyProperties + return /* spotless:off */ other is AclDeleteParams && this.aclId == other.aclId && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders && this.additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - aclId, - additionalQueryParams, - additionalHeaders, - additionalBodyProperties, - ) + return /* spotless:off */ Objects.hash(aclId, additionalQueryParams, additionalHeaders, additionalBodyProperties) /* spotless:on */ } override fun toString() = diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/AclFindAndDeleteParams.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/AclFindAndDeleteParams.kt index c9af483d..7d334fa5 100644 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/AclFindAndDeleteParams.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/AclFindAndDeleteParams.kt @@ -88,8 +88,6 @@ constructor( private val additionalProperties: Map, ) { - private var hashCode: Int = 0 - /** The id of the object the ACL applies to */ @JsonProperty("object_id") fun objectId(): String? = objectId @@ -130,42 +128,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is AclFindAndDeleteBody && - this.objectId == other.objectId && - this.objectType == other.objectType && - this.groupId == other.groupId && - this.permission == other.permission && - this.restrictObjectType == other.restrictObjectType && - this.roleId == other.roleId && - this.userId == other.userId && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - objectId, - objectType, - groupId, - permission, - restrictObjectType, - roleId, - userId, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "AclFindAndDeleteBody{objectId=$objectId, objectType=$objectType, groupId=$groupId, permission=$permission, restrictObjectType=$restrictObjectType, roleId=$roleId, userId=$userId, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -262,6 +224,26 @@ constructor( additionalProperties.toUnmodifiable(), ) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is AclFindAndDeleteBody && this.objectId == other.objectId && this.objectType == other.objectType && this.groupId == other.groupId && this.permission == other.permission && this.restrictObjectType == other.restrictObjectType && this.roleId == other.roleId && this.userId == other.userId && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(objectId, objectType, groupId, permission, restrictObjectType, roleId, userId, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "AclFindAndDeleteBody{objectId=$objectId, objectType=$objectType, groupId=$groupId, permission=$permission, restrictObjectType=$restrictObjectType, roleId=$roleId, userId=$userId, additionalProperties=$additionalProperties}" } fun _additionalQueryParams(): Map> = additionalQueryParams @@ -275,32 +257,11 @@ constructor( return true } - return other is AclFindAndDeleteParams && - this.objectId == other.objectId && - this.objectType == other.objectType && - this.groupId == other.groupId && - this.permission == other.permission && - this.restrictObjectType == other.restrictObjectType && - this.roleId == other.roleId && - this.userId == other.userId && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders && - this.additionalBodyProperties == other.additionalBodyProperties + return /* spotless:off */ other is AclFindAndDeleteParams && this.objectId == other.objectId && this.objectType == other.objectType && this.groupId == other.groupId && this.permission == other.permission && this.restrictObjectType == other.restrictObjectType && this.roleId == other.roleId && this.userId == other.userId && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders && this.additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - objectId, - objectType, - groupId, - permission, - restrictObjectType, - roleId, - userId, - additionalQueryParams, - additionalHeaders, - additionalBodyProperties, - ) + return /* spotless:off */ Objects.hash(objectId, objectType, groupId, permission, restrictObjectType, roleId, userId, additionalQueryParams, additionalHeaders, additionalBodyProperties) /* spotless:on */ } override fun toString() = @@ -458,7 +419,7 @@ constructor( return true } - return other is ObjectType && this.value == other.value + return /* spotless:off */ other is ObjectType && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -569,7 +530,7 @@ constructor( return true } - return other is Permission && this.value == other.value + return /* spotless:off */ other is Permission && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -662,7 +623,7 @@ constructor( return true } - return other is RestrictObjectType && this.value == other.value + return /* spotless:off */ other is RestrictObjectType && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/AclListPage.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/AclListPage.kt index b3c80969..86271fa0 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/AclListPage.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/AclListPage.kt @@ -34,18 +34,11 @@ private constructor( return true } - return other is AclListPage && - this.aclsService == other.aclsService && - this.params == other.params && - this.response == other.response + return /* spotless:off */ other is AclListPage && this.aclsService == other.aclsService && this.params == other.params && this.response == other.response /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - aclsService, - params, - response, - ) + return /* spotless:off */ Objects.hash(aclsService, params, response) /* spotless:on */ } override fun toString() = @@ -121,13 +114,11 @@ private constructor( return true } - return other is Response && - this.objects == other.objects && - this.additionalProperties == other.additionalProperties + return /* spotless:off */ other is Response && this.objects == other.objects && this.additionalProperties == other.additionalProperties /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash(objects, additionalProperties) + return /* spotless:off */ Objects.hash(objects, additionalProperties) /* spotless:on */ } override fun toString() = diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/AclListPageAsync.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/AclListPageAsync.kt index ec02e5b8..05369260 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/AclListPageAsync.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/AclListPageAsync.kt @@ -35,18 +35,11 @@ private constructor( return true } - return other is AclListPageAsync && - this.aclsService == other.aclsService && - this.params == other.params && - this.response == other.response + return /* spotless:off */ other is AclListPageAsync && this.aclsService == other.aclsService && this.params == other.params && this.response == other.response /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - aclsService, - params, - response, - ) + return /* spotless:off */ Objects.hash(aclsService, params, response) /* spotless:on */ } override fun toString() = @@ -124,13 +117,11 @@ private constructor( return true } - return other is Response && - this.objects == other.objects && - this.additionalProperties == other.additionalProperties + return /* spotless:off */ other is Response && this.objects == other.objects && this.additionalProperties == other.additionalProperties /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash(objects, additionalProperties) + return /* spotless:off */ Objects.hash(objects, additionalProperties) /* spotless:on */ } override fun toString() = diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/AclListParams.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/AclListParams.kt index 20be8167..70a432dd 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/AclListParams.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/AclListParams.kt @@ -71,28 +71,11 @@ constructor( return true } - return other is AclListParams && - this.objectId == other.objectId && - this.objectType == other.objectType && - this.endingBefore == other.endingBefore && - this.ids == other.ids && - this.limit == other.limit && - this.startingAfter == other.startingAfter && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders + return /* spotless:off */ other is AclListParams && this.objectId == other.objectId && this.objectType == other.objectType && this.endingBefore == other.endingBefore && this.ids == other.ids && this.limit == other.limit && this.startingAfter == other.startingAfter && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - objectId, - objectType, - endingBefore, - ids, - limit, - startingAfter, - additionalQueryParams, - additionalHeaders, - ) + return /* spotless:off */ Objects.hash(objectId, objectType, endingBefore, ids, limit, startingAfter, additionalQueryParams, additionalHeaders) /* spotless:on */ } override fun toString() = @@ -160,7 +143,7 @@ constructor( * Filter search results to a particular set of object IDs. To specify a list of IDs, * include the query param multiple times */ - fun ids(strings: List) = apply { this.ids = Ids.ofStrings(strings) } + fun idsOfStrings(strings: List) = apply { this.ids = Ids.ofStrings(strings) } /** Limit the number of objects to return */ fun limit(limit: Long) = apply { this.limit = limit } @@ -240,7 +223,7 @@ constructor( return true } - return other is ObjectType && this.value == other.value + return /* spotless:off */ other is ObjectType && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -385,11 +368,11 @@ constructor( return true } - return other is Ids && this.string == other.string && this.strings == other.strings + return /* spotless:off */ other is Ids && this.string == other.string && this.strings == other.strings /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash(string, strings) + return /* spotless:off */ Objects.hash(string, strings) /* spotless:on */ } override fun toString(): String { @@ -423,6 +406,7 @@ constructor( override fun ObjectCodec.deserialize(node: JsonNode): Ids { val json = JsonValue.fromJsonNode(node) + tryDeserialize(node, jacksonTypeRef())?.let { return Ids(string = it, _json = json) } diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/AclRetrieveParams.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/AclRetrieveParams.kt index 52819618..11b1ce01 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/AclRetrieveParams.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/AclRetrieveParams.kt @@ -36,18 +36,11 @@ constructor( return true } - return other is AclRetrieveParams && - this.aclId == other.aclId && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders + return /* spotless:off */ other is AclRetrieveParams && this.aclId == other.aclId && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - aclId, - additionalQueryParams, - additionalHeaders, - ) + return /* spotless:off */ Objects.hash(aclId, additionalQueryParams, additionalHeaders) /* spotless:on */ } override fun toString() = diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/AiSecret.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/AiSecret.kt index e7d4df58..8543661d 100644 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/AiSecret.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/AiSecret.kt @@ -32,8 +32,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - /** Unique identifier for the AI secret */ fun id(): String = id.getRequired("id") @@ -90,42 +88,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is AISecret && - this.id == other.id && - this.created == other.created && - this.orgId == other.orgId && - this.name == other.name && - this.type == other.type && - this.metadata == other.metadata && - this.previewSecret == other.previewSecret && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - id, - created, - orgId, - name, - type, - metadata, - previewSecret, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "AISecret{id=$id, created=$created, orgId=$orgId, name=$name, type=$type, metadata=$metadata, previewSecret=$previewSecret, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -240,8 +202,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -254,23 +214,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Metadata && this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = Objects.hash(additionalProperties) - } - return hashCode - } - - override fun toString() = "Metadata{additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -301,5 +244,44 @@ private constructor( fun build(): Metadata = Metadata(additionalProperties.toUnmodifiable()) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Metadata && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = "Metadata{additionalProperties=$additionalProperties}" } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is AISecret && this.id == other.id && this.created == other.created && this.orgId == other.orgId && this.name == other.name && this.type == other.type && this.metadata == other.metadata && this.previewSecret == other.previewSecret && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(id, created, orgId, name, type, metadata, previewSecret, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "AISecret{id=$id, created=$created, orgId=$orgId, name=$name, type=$type, metadata=$metadata, previewSecret=$previewSecret, additionalProperties=$additionalProperties}" } diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/AiSecretCreateParams.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/AiSecretCreateParams.kt index 779156e8..c8ac3207 100644 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/AiSecretCreateParams.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/AiSecretCreateParams.kt @@ -64,8 +64,6 @@ constructor( private val additionalProperties: Map, ) { - private var hashCode: Int = 0 - /** Name of the AI secret */ @JsonProperty("name") fun name(): String? = name @@ -92,38 +90,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is AiSecretCreateBody && - this.name == other.name && - this.metadata == other.metadata && - this.orgName == other.orgName && - this.secret == other.secret && - this.type == other.type && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - name, - metadata, - orgName, - secret, - type, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "AiSecretCreateBody{name=$name, metadata=$metadata, orgName=$orgName, secret=$secret, type=$type, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -194,6 +160,26 @@ constructor( additionalProperties.toUnmodifiable(), ) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is AiSecretCreateBody && this.name == other.name && this.metadata == other.metadata && this.orgName == other.orgName && this.secret == other.secret && this.type == other.type && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(name, metadata, orgName, secret, type, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "AiSecretCreateBody{name=$name, metadata=$metadata, orgName=$orgName, secret=$secret, type=$type, additionalProperties=$additionalProperties}" } fun _additionalQueryParams(): Map> = additionalQueryParams @@ -207,28 +193,11 @@ constructor( return true } - return other is AiSecretCreateParams && - this.name == other.name && - this.metadata == other.metadata && - this.orgName == other.orgName && - this.secret == other.secret && - this.type == other.type && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders && - this.additionalBodyProperties == other.additionalBodyProperties + return /* spotless:off */ other is AiSecretCreateParams && this.name == other.name && this.metadata == other.metadata && this.orgName == other.orgName && this.secret == other.secret && this.type == other.type && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders && this.additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - name, - metadata, - orgName, - secret, - type, - additionalQueryParams, - additionalHeaders, - additionalBodyProperties, - ) + return /* spotless:off */ Objects.hash(name, metadata, orgName, secret, type, additionalQueryParams, additionalHeaders, additionalBodyProperties) /* spotless:on */ } override fun toString() = @@ -359,31 +328,12 @@ constructor( private val additionalProperties: Map, ) { - private var hashCode: Int = 0 - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Metadata && this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = Objects.hash(additionalProperties) - } - return hashCode - } - - override fun toString() = "Metadata{additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -414,5 +364,24 @@ constructor( fun build(): Metadata = Metadata(additionalProperties.toUnmodifiable()) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Metadata && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = "Metadata{additionalProperties=$additionalProperties}" } } diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/AiSecretDeleteParams.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/AiSecretDeleteParams.kt index 6ddecb7f..5403ba52 100644 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/AiSecretDeleteParams.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/AiSecretDeleteParams.kt @@ -46,20 +46,11 @@ constructor( return true } - return other is AiSecretDeleteParams && - this.aiSecretId == other.aiSecretId && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders && - this.additionalBodyProperties == other.additionalBodyProperties + return /* spotless:off */ other is AiSecretDeleteParams && this.aiSecretId == other.aiSecretId && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders && this.additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - aiSecretId, - additionalQueryParams, - additionalHeaders, - additionalBodyProperties, - ) + return /* spotless:off */ Objects.hash(aiSecretId, additionalQueryParams, additionalHeaders, additionalBodyProperties) /* spotless:on */ } override fun toString() = diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/AiSecretFindAndDeleteParams.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/AiSecretFindAndDeleteParams.kt index 837d68ed..064eb2fa 100644 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/AiSecretFindAndDeleteParams.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/AiSecretFindAndDeleteParams.kt @@ -49,8 +49,6 @@ constructor( private val additionalProperties: Map, ) { - private var hashCode: Int = 0 - /** Name of the AI secret */ @JsonProperty("name") fun name(): String? = name @@ -67,32 +65,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is AiSecretFindAndDeleteBody && - this.name == other.name && - this.orgName == other.orgName && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - name, - orgName, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "AiSecretFindAndDeleteBody{name=$name, orgName=$orgName, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -143,6 +115,26 @@ constructor( additionalProperties.toUnmodifiable(), ) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is AiSecretFindAndDeleteBody && this.name == other.name && this.orgName == other.orgName && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(name, orgName, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "AiSecretFindAndDeleteBody{name=$name, orgName=$orgName, additionalProperties=$additionalProperties}" } fun _additionalQueryParams(): Map> = additionalQueryParams @@ -156,22 +148,11 @@ constructor( return true } - return other is AiSecretFindAndDeleteParams && - this.name == other.name && - this.orgName == other.orgName && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders && - this.additionalBodyProperties == other.additionalBodyProperties + return /* spotless:off */ other is AiSecretFindAndDeleteParams && this.name == other.name && this.orgName == other.orgName && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders && this.additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - name, - orgName, - additionalQueryParams, - additionalHeaders, - additionalBodyProperties, - ) + return /* spotless:off */ Objects.hash(name, orgName, additionalQueryParams, additionalHeaders, additionalBodyProperties) /* spotless:on */ } override fun toString() = diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/AiSecretListPage.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/AiSecretListPage.kt index 2adbb611..a0e9abfc 100644 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/AiSecretListPage.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/AiSecretListPage.kt @@ -34,18 +34,11 @@ private constructor( return true } - return other is AiSecretListPage && - this.aiSecretsService == other.aiSecretsService && - this.params == other.params && - this.response == other.response + return /* spotless:off */ other is AiSecretListPage && this.aiSecretsService == other.aiSecretsService && this.params == other.params && this.response == other.response /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - aiSecretsService, - params, - response, - ) + return /* spotless:off */ Objects.hash(aiSecretsService, params, response) /* spotless:on */ } override fun toString() = @@ -127,13 +120,11 @@ private constructor( return true } - return other is Response && - this.objects == other.objects && - this.additionalProperties == other.additionalProperties + return /* spotless:off */ other is Response && this.objects == other.objects && this.additionalProperties == other.additionalProperties /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash(objects, additionalProperties) + return /* spotless:off */ Objects.hash(objects, additionalProperties) /* spotless:on */ } override fun toString() = diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/AiSecretListPageAsync.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/AiSecretListPageAsync.kt index af3a1365..7b2b31aa 100644 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/AiSecretListPageAsync.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/AiSecretListPageAsync.kt @@ -35,18 +35,11 @@ private constructor( return true } - return other is AiSecretListPageAsync && - this.aiSecretsService == other.aiSecretsService && - this.params == other.params && - this.response == other.response + return /* spotless:off */ other is AiSecretListPageAsync && this.aiSecretsService == other.aiSecretsService && this.params == other.params && this.response == other.response /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - aiSecretsService, - params, - response, - ) + return /* spotless:off */ Objects.hash(aiSecretsService, params, response) /* spotless:on */ } override fun toString() = @@ -134,13 +127,11 @@ private constructor( return true } - return other is Response && - this.objects == other.objects && - this.additionalProperties == other.additionalProperties + return /* spotless:off */ other is Response && this.objects == other.objects && this.additionalProperties == other.additionalProperties /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash(objects, additionalProperties) + return /* spotless:off */ Objects.hash(objects, additionalProperties) /* spotless:on */ } override fun toString() = diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/AiSecretListParams.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/AiSecretListParams.kt index d9170848..4be9c8dc 100644 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/AiSecretListParams.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/AiSecretListParams.kt @@ -72,30 +72,11 @@ constructor( return true } - return other is AiSecretListParams && - this.aiSecretName == other.aiSecretName && - this.aiSecretType == other.aiSecretType && - this.endingBefore == other.endingBefore && - this.ids == other.ids && - this.limit == other.limit && - this.orgName == other.orgName && - this.startingAfter == other.startingAfter && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders + return /* spotless:off */ other is AiSecretListParams && this.aiSecretName == other.aiSecretName && this.aiSecretType == other.aiSecretType && this.endingBefore == other.endingBefore && this.ids == other.ids && this.limit == other.limit && this.orgName == other.orgName && this.startingAfter == other.startingAfter && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - aiSecretName, - aiSecretType, - endingBefore, - ids, - limit, - orgName, - startingAfter, - additionalQueryParams, - additionalHeaders, - ) + return /* spotless:off */ Objects.hash(aiSecretName, aiSecretType, endingBefore, ids, limit, orgName, startingAfter, additionalQueryParams, additionalHeaders) /* spotless:on */ } override fun toString() = @@ -143,7 +124,7 @@ constructor( this.aiSecretType = AiSecretType.ofString(string) } - fun aiSecretType(strings: List) = apply { + fun aiSecretTypeOfStrings(strings: List) = apply { this.aiSecretType = AiSecretType.ofStrings(strings) } @@ -172,7 +153,7 @@ constructor( * Filter search results to a particular set of object IDs. To specify a list of IDs, * include the query param multiple times */ - fun ids(strings: List) = apply { this.ids = Ids.ofStrings(strings) } + fun idsOfStrings(strings: List) = apply { this.ids = Ids.ofStrings(strings) } /** Limit the number of objects to return */ fun limit(limit: Long) = apply { this.limit = limit } @@ -290,13 +271,11 @@ constructor( return true } - return other is AiSecretType && - this.string == other.string && - this.strings == other.strings + return /* spotless:off */ other is AiSecretType && this.string == other.string && this.strings == other.strings /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash(string, strings) + return /* spotless:off */ Objects.hash(string, strings) /* spotless:on */ } override fun toString(): String { @@ -330,6 +309,7 @@ constructor( override fun ObjectCodec.deserialize(node: JsonNode): AiSecretType { val json = JsonValue.fromJsonNode(node) + tryDeserialize(node, jacksonTypeRef())?.let { return AiSecretType(string = it, _json = json) } @@ -405,11 +385,11 @@ constructor( return true } - return other is Ids && this.string == other.string && this.strings == other.strings + return /* spotless:off */ other is Ids && this.string == other.string && this.strings == other.strings /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash(string, strings) + return /* spotless:off */ Objects.hash(string, strings) /* spotless:on */ } override fun toString(): String { @@ -443,6 +423,7 @@ constructor( override fun ObjectCodec.deserialize(node: JsonNode): Ids { val json = JsonValue.fromJsonNode(node) + tryDeserialize(node, jacksonTypeRef())?.let { return Ids(string = it, _json = json) } diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/AiSecretReplaceParams.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/AiSecretReplaceParams.kt index ab2ecf44..130b0aef 100644 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/AiSecretReplaceParams.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/AiSecretReplaceParams.kt @@ -64,8 +64,6 @@ constructor( private val additionalProperties: Map, ) { - private var hashCode: Int = 0 - /** Name of the AI secret */ @JsonProperty("name") fun name(): String? = name @@ -92,38 +90,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is AiSecretReplaceBody && - this.name == other.name && - this.metadata == other.metadata && - this.orgName == other.orgName && - this.secret == other.secret && - this.type == other.type && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - name, - metadata, - orgName, - secret, - type, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "AiSecretReplaceBody{name=$name, metadata=$metadata, orgName=$orgName, secret=$secret, type=$type, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -194,6 +160,26 @@ constructor( additionalProperties.toUnmodifiable(), ) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is AiSecretReplaceBody && this.name == other.name && this.metadata == other.metadata && this.orgName == other.orgName && this.secret == other.secret && this.type == other.type && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(name, metadata, orgName, secret, type, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "AiSecretReplaceBody{name=$name, metadata=$metadata, orgName=$orgName, secret=$secret, type=$type, additionalProperties=$additionalProperties}" } fun _additionalQueryParams(): Map> = additionalQueryParams @@ -207,28 +193,11 @@ constructor( return true } - return other is AiSecretReplaceParams && - this.name == other.name && - this.metadata == other.metadata && - this.orgName == other.orgName && - this.secret == other.secret && - this.type == other.type && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders && - this.additionalBodyProperties == other.additionalBodyProperties + return /* spotless:off */ other is AiSecretReplaceParams && this.name == other.name && this.metadata == other.metadata && this.orgName == other.orgName && this.secret == other.secret && this.type == other.type && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders && this.additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - name, - metadata, - orgName, - secret, - type, - additionalQueryParams, - additionalHeaders, - additionalBodyProperties, - ) + return /* spotless:off */ Objects.hash(name, metadata, orgName, secret, type, additionalQueryParams, additionalHeaders, additionalBodyProperties) /* spotless:on */ } override fun toString() = @@ -359,31 +328,12 @@ constructor( private val additionalProperties: Map, ) { - private var hashCode: Int = 0 - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Metadata && this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = Objects.hash(additionalProperties) - } - return hashCode - } - - override fun toString() = "Metadata{additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -414,5 +364,24 @@ constructor( fun build(): Metadata = Metadata(additionalProperties.toUnmodifiable()) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Metadata && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = "Metadata{additionalProperties=$additionalProperties}" } } diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/AiSecretRetrieveParams.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/AiSecretRetrieveParams.kt index b0e59f6d..c4d8d0e2 100644 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/AiSecretRetrieveParams.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/AiSecretRetrieveParams.kt @@ -36,18 +36,11 @@ constructor( return true } - return other is AiSecretRetrieveParams && - this.aiSecretId == other.aiSecretId && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders + return /* spotless:off */ other is AiSecretRetrieveParams && this.aiSecretId == other.aiSecretId && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - aiSecretId, - additionalQueryParams, - additionalHeaders, - ) + return /* spotless:off */ Objects.hash(aiSecretId, additionalQueryParams, additionalHeaders) /* spotless:on */ } override fun toString() = diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/AiSecretUpdateParams.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/AiSecretUpdateParams.kt index 4973300d..449d0223 100644 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/AiSecretUpdateParams.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/AiSecretUpdateParams.kt @@ -69,8 +69,6 @@ constructor( private val additionalProperties: Map, ) { - private var hashCode: Int = 0 - @JsonProperty("metadata") fun metadata(): Metadata? = metadata /** Name of the AI secret */ @@ -86,36 +84,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is AiSecretUpdateBody && - this.metadata == other.metadata && - this.name == other.name && - this.secret == other.secret && - this.type == other.type && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - metadata, - name, - secret, - type, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "AiSecretUpdateBody{metadata=$metadata, name=$name, secret=$secret, type=$type, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -171,6 +139,26 @@ constructor( additionalProperties.toUnmodifiable(), ) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is AiSecretUpdateBody && this.metadata == other.metadata && this.name == other.name && this.secret == other.secret && this.type == other.type && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(metadata, name, secret, type, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "AiSecretUpdateBody{metadata=$metadata, name=$name, secret=$secret, type=$type, additionalProperties=$additionalProperties}" } fun _additionalQueryParams(): Map> = additionalQueryParams @@ -184,28 +172,11 @@ constructor( return true } - return other is AiSecretUpdateParams && - this.aiSecretId == other.aiSecretId && - this.metadata == other.metadata && - this.name == other.name && - this.secret == other.secret && - this.type == other.type && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders && - this.additionalBodyProperties == other.additionalBodyProperties + return /* spotless:off */ other is AiSecretUpdateParams && this.aiSecretId == other.aiSecretId && this.metadata == other.metadata && this.name == other.name && this.secret == other.secret && this.type == other.type && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders && this.additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - aiSecretId, - metadata, - name, - secret, - type, - additionalQueryParams, - additionalHeaders, - additionalBodyProperties, - ) + return /* spotless:off */ Objects.hash(aiSecretId, metadata, name, secret, type, additionalQueryParams, additionalHeaders, additionalBodyProperties) /* spotless:on */ } override fun toString() = @@ -328,31 +299,12 @@ constructor( private val additionalProperties: Map, ) { - private var hashCode: Int = 0 - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Metadata && this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = Objects.hash(additionalProperties) - } - return hashCode - } - - override fun toString() = "Metadata{additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -383,5 +335,24 @@ constructor( fun build(): Metadata = Metadata(additionalProperties.toUnmodifiable()) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Metadata && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = "Metadata{additionalProperties=$additionalProperties}" } } diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ApiKey.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ApiKey.kt index 14eed088..78072843 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ApiKey.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ApiKey.kt @@ -31,8 +31,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - /** Unique identifier for the api key */ fun id(): String = id.getRequired("id") @@ -85,40 +83,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is ApiKey && - this.id == other.id && - this.created == other.created && - this.name == other.name && - this.previewName == other.previewName && - this.userId == other.userId && - this.orgId == other.orgId && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - id, - created, - name, - previewName, - userId, - orgId, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "ApiKey{id=$id, created=$created, name=$name, previewName=$previewName, userId=$userId, orgId=$orgId, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -214,4 +178,24 @@ private constructor( additionalProperties.toUnmodifiable(), ) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is ApiKey && this.id == other.id && this.created == other.created && this.name == other.name && this.previewName == other.previewName && this.userId == other.userId && this.orgId == other.orgId && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(id, created, name, previewName, userId, orgId, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "ApiKey{id=$id, created=$created, name=$name, previewName=$previewName, userId=$userId, orgId=$orgId, additionalProperties=$additionalProperties}" } diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ApiKeyCreateParams.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ApiKeyCreateParams.kt index e5d0f3b9..79d4d800 100644 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ApiKeyCreateParams.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ApiKeyCreateParams.kt @@ -49,8 +49,6 @@ constructor( private val additionalProperties: Map, ) { - private var hashCode: Int = 0 - /** Name of the api key. Does not have to be unique */ @JsonProperty("name") fun name(): String? = name @@ -67,32 +65,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is ApiKeyCreateBody && - this.name == other.name && - this.orgName == other.orgName && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - name, - orgName, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "ApiKeyCreateBody{name=$name, orgName=$orgName, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -143,6 +115,26 @@ constructor( additionalProperties.toUnmodifiable(), ) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is ApiKeyCreateBody && this.name == other.name && this.orgName == other.orgName && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(name, orgName, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "ApiKeyCreateBody{name=$name, orgName=$orgName, additionalProperties=$additionalProperties}" } fun _additionalQueryParams(): Map> = additionalQueryParams @@ -156,22 +148,11 @@ constructor( return true } - return other is ApiKeyCreateParams && - this.name == other.name && - this.orgName == other.orgName && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders && - this.additionalBodyProperties == other.additionalBodyProperties + return /* spotless:off */ other is ApiKeyCreateParams && this.name == other.name && this.orgName == other.orgName && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders && this.additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - name, - orgName, - additionalQueryParams, - additionalHeaders, - additionalBodyProperties, - ) + return /* spotless:off */ Objects.hash(name, orgName, additionalQueryParams, additionalHeaders, additionalBodyProperties) /* spotless:on */ } override fun toString() = diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ApiKeyDeleteParams.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ApiKeyDeleteParams.kt index 8b48e6d1..337d12c8 100644 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ApiKeyDeleteParams.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ApiKeyDeleteParams.kt @@ -46,20 +46,11 @@ constructor( return true } - return other is ApiKeyDeleteParams && - this.apiKeyId == other.apiKeyId && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders && - this.additionalBodyProperties == other.additionalBodyProperties + return /* spotless:off */ other is ApiKeyDeleteParams && this.apiKeyId == other.apiKeyId && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders && this.additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - apiKeyId, - additionalQueryParams, - additionalHeaders, - additionalBodyProperties, - ) + return /* spotless:off */ Objects.hash(apiKeyId, additionalQueryParams, additionalHeaders, additionalBodyProperties) /* spotless:on */ } override fun toString() = diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ApiKeyListPage.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ApiKeyListPage.kt index 6369da73..5a79da82 100644 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ApiKeyListPage.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ApiKeyListPage.kt @@ -34,18 +34,11 @@ private constructor( return true } - return other is ApiKeyListPage && - this.apiKeysService == other.apiKeysService && - this.params == other.params && - this.response == other.response + return /* spotless:off */ other is ApiKeyListPage && this.apiKeysService == other.apiKeysService && this.params == other.params && this.response == other.response /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - apiKeysService, - params, - response, - ) + return /* spotless:off */ Objects.hash(apiKeysService, params, response) /* spotless:on */ } override fun toString() = @@ -121,13 +114,11 @@ private constructor( return true } - return other is Response && - this.objects == other.objects && - this.additionalProperties == other.additionalProperties + return /* spotless:off */ other is Response && this.objects == other.objects && this.additionalProperties == other.additionalProperties /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash(objects, additionalProperties) + return /* spotless:off */ Objects.hash(objects, additionalProperties) /* spotless:on */ } override fun toString() = diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ApiKeyListPageAsync.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ApiKeyListPageAsync.kt index d8742552..b3d2f9a4 100644 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ApiKeyListPageAsync.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ApiKeyListPageAsync.kt @@ -35,18 +35,11 @@ private constructor( return true } - return other is ApiKeyListPageAsync && - this.apiKeysService == other.apiKeysService && - this.params == other.params && - this.response == other.response + return /* spotless:off */ other is ApiKeyListPageAsync && this.apiKeysService == other.apiKeysService && this.params == other.params && this.response == other.response /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - apiKeysService, - params, - response, - ) + return /* spotless:off */ Objects.hash(apiKeysService, params, response) /* spotless:on */ } override fun toString() = @@ -124,13 +117,11 @@ private constructor( return true } - return other is Response && - this.objects == other.objects && - this.additionalProperties == other.additionalProperties + return /* spotless:off */ other is Response && this.objects == other.objects && this.additionalProperties == other.additionalProperties /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash(objects, additionalProperties) + return /* spotless:off */ Objects.hash(objects, additionalProperties) /* spotless:on */ } override fun toString() = diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ApiKeyListParams.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ApiKeyListParams.kt index dbaf4340..bf72099b 100644 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ApiKeyListParams.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ApiKeyListParams.kt @@ -68,28 +68,11 @@ constructor( return true } - return other is ApiKeyListParams && - this.apiKeyName == other.apiKeyName && - this.endingBefore == other.endingBefore && - this.ids == other.ids && - this.limit == other.limit && - this.orgName == other.orgName && - this.startingAfter == other.startingAfter && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders + return /* spotless:off */ other is ApiKeyListParams && this.apiKeyName == other.apiKeyName && this.endingBefore == other.endingBefore && this.ids == other.ids && this.limit == other.limit && this.orgName == other.orgName && this.startingAfter == other.startingAfter && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - apiKeyName, - endingBefore, - ids, - limit, - orgName, - startingAfter, - additionalQueryParams, - additionalHeaders, - ) + return /* spotless:off */ Objects.hash(apiKeyName, endingBefore, ids, limit, orgName, startingAfter, additionalQueryParams, additionalHeaders) /* spotless:on */ } override fun toString() = @@ -154,7 +137,7 @@ constructor( * Filter search results to a particular set of object IDs. To specify a list of IDs, * include the query param multiple times */ - fun ids(strings: List) = apply { this.ids = Ids.ofStrings(strings) } + fun idsOfStrings(strings: List) = apply { this.ids = Ids.ofStrings(strings) } /** Limit the number of objects to return */ fun limit(limit: Long) = apply { this.limit = limit } @@ -271,11 +254,11 @@ constructor( return true } - return other is Ids && this.string == other.string && this.strings == other.strings + return /* spotless:off */ other is Ids && this.string == other.string && this.strings == other.strings /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash(string, strings) + return /* spotless:off */ Objects.hash(string, strings) /* spotless:on */ } override fun toString(): String { @@ -309,6 +292,7 @@ constructor( override fun ObjectCodec.deserialize(node: JsonNode): Ids { val json = JsonValue.fromJsonNode(node) + tryDeserialize(node, jacksonTypeRef())?.let { return Ids(string = it, _json = json) } diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ApiKeyRetrieveParams.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ApiKeyRetrieveParams.kt index 836fb6f3..1a577eb5 100644 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ApiKeyRetrieveParams.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ApiKeyRetrieveParams.kt @@ -36,18 +36,11 @@ constructor( return true } - return other is ApiKeyRetrieveParams && - this.apiKeyId == other.apiKeyId && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders + return /* spotless:off */ other is ApiKeyRetrieveParams && this.apiKeyId == other.apiKeyId && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - apiKeyId, - additionalQueryParams, - additionalHeaders, - ) + return /* spotless:off */ Objects.hash(apiKeyId, additionalQueryParams, additionalHeaders) /* spotless:on */ } override fun toString() = diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ChatCompletionContentPartImage.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ChatCompletionContentPartImage.kt index 7bca54f3..cd41c589 100644 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ChatCompletionContentPartImage.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ChatCompletionContentPartImage.kt @@ -29,8 +29,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - fun imageUrl(): ImageUrl = imageUrl.getRequired("image_url") fun type(): Type = type.getRequired("type") @@ -53,32 +51,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is ChatCompletionContentPartImage && - this.imageUrl == other.imageUrl && - this.type == other.type && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - imageUrl, - type, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "ChatCompletionContentPartImage{imageUrl=$imageUrl, type=$type, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -142,8 +114,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - fun url(): String = url.getRequired("url") fun detail(): Optional = Optional.ofNullable(detail.getNullable("detail")) @@ -166,32 +136,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is ImageUrl && - this.url == other.url && - this.detail == other.detail && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - url, - detail, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "ImageUrl{url=$url, detail=$detail, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -257,7 +201,7 @@ private constructor( return true } - return other is Detail && this.value == other.value + return /* spotless:off */ other is Detail && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -306,6 +250,26 @@ private constructor( fun asString(): String = _value().asStringOrThrow() } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is ImageUrl && this.url == other.url && this.detail == other.detail && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(url, detail, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "ImageUrl{url=$url, detail=$detail, additionalProperties=$additionalProperties}" } class Type @@ -321,7 +285,7 @@ private constructor( return true } - return other is Type && this.value == other.value + return /* spotless:off */ other is Type && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -358,4 +322,24 @@ private constructor( fun asString(): String = _value().asStringOrThrow() } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is ChatCompletionContentPartImage && this.imageUrl == other.imageUrl && this.type == other.type && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(imageUrl, type, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "ChatCompletionContentPartImage{imageUrl=$imageUrl, type=$type, additionalProperties=$additionalProperties}" } diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ChatCompletionContentPartText.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ChatCompletionContentPartText.kt index 3df6a2a5..0a46ca17 100644 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ChatCompletionContentPartText.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ChatCompletionContentPartText.kt @@ -29,8 +29,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - fun text(): Optional = Optional.ofNullable(text.getNullable("text")) fun type(): Type = type.getRequired("type") @@ -53,32 +51,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is ChatCompletionContentPartText && - this.text == other.text && - this.type == other.type && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - text, - type, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "ChatCompletionContentPartText{text=$text, type=$type, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -144,7 +116,7 @@ private constructor( return true } - return other is Type && this.value == other.value + return /* spotless:off */ other is Type && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -181,4 +153,24 @@ private constructor( fun asString(): String = _value().asStringOrThrow() } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is ChatCompletionContentPartText && this.text == other.text && this.type == other.type && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(text, type, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "ChatCompletionContentPartText{text=$text, type=$type, additionalProperties=$additionalProperties}" } diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ChatCompletionMessageToolCall.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ChatCompletionMessageToolCall.kt index 5fa0d38a..dbe33932 100644 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ChatCompletionMessageToolCall.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ChatCompletionMessageToolCall.kt @@ -29,8 +29,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - fun id(): String = id.getRequired("id") fun function(): Function = function.getRequired("function") @@ -58,34 +56,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is ChatCompletionMessageToolCall && - this.id == other.id && - this.function == other.function && - this.type == other.type && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - id, - function, - type, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "ChatCompletionMessageToolCall{id=$id, function=$function, type=$type, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -156,8 +126,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - fun arguments(): String = arguments.getRequired("arguments") fun name(): String = name.getRequired("name") @@ -180,32 +148,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Function && - this.arguments == other.arguments && - this.name == other.name && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - arguments, - name, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "Function{arguments=$arguments, name=$name, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -257,6 +199,26 @@ private constructor( additionalProperties.toUnmodifiable(), ) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Function && this.arguments == other.arguments && this.name == other.name && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(arguments, name, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "Function{arguments=$arguments, name=$name, additionalProperties=$additionalProperties}" } class Type @@ -272,7 +234,7 @@ private constructor( return true } - return other is Type && this.value == other.value + return /* spotless:off */ other is Type && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -309,4 +271,24 @@ private constructor( fun asString(): String = _value().asStringOrThrow() } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is ChatCompletionMessageToolCall && this.id == other.id && this.function == other.function && this.type == other.type && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(id, function, type, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "ChatCompletionMessageToolCall{id=$id, function=$function, type=$type, additionalProperties=$additionalProperties}" } diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/CodeBundle.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/CodeBundle.kt index d99a8cc3..844b82b2 100644 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/CodeBundle.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/CodeBundle.kt @@ -40,8 +40,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - fun runtimeContext(): RuntimeContext = runtimeContext.getRequired("runtime_context") fun location(): Location = location.getRequired("location") @@ -76,36 +74,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is CodeBundle && - this.runtimeContext == other.runtimeContext && - this.location == other.location && - this.bundleId == other.bundleId && - this.preview == other.preview && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - runtimeContext, - location, - bundleId, - preview, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "CodeBundle{runtimeContext=$runtimeContext, location=$location, bundleId=$bundleId, preview=$preview, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -230,13 +198,11 @@ private constructor( return true } - return other is Location && - this.experiment == other.experiment && - this.function == other.function + return /* spotless:off */ other is Location && this.experiment == other.experiment && this.function == other.function /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash(experiment, function) + return /* spotless:off */ Objects.hash(experiment, function) /* spotless:on */ } override fun toString(): String { @@ -270,6 +236,7 @@ private constructor( override fun ObjectCodec.deserialize(node: JsonNode): Location { val json = JsonValue.fromJsonNode(node) + tryDeserialize(node, jacksonTypeRef()) { it.validate() } ?.let { return Location(experiment = it, _json = json) @@ -311,8 +278,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - fun type(): Type = type.getRequired("type") fun evalName(): String = evalName.getRequired("eval_name") @@ -340,34 +305,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Experiment && - this.type == other.type && - this.evalName == other.evalName && - this.position == other.position && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - type, - evalName, - position, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "Experiment{type=$type, evalName=$evalName, position=$position, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -479,13 +416,11 @@ private constructor( return true } - return other is Position && - this.task == other.task && - this.scorer == other.scorer + return /* spotless:off */ other is Position && this.task == other.task && this.scorer == other.scorer /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash(task, scorer) + return /* spotless:off */ Objects.hash(task, scorer) /* spotless:on */ } override fun toString(): String { @@ -519,6 +454,7 @@ private constructor( override fun ObjectCodec.deserialize(node: JsonNode): Position { val json = JsonValue.fromJsonNode(node) + tryDeserialize(node, jacksonTypeRef()) { it.validate() } ?.let { return Position(task = it, _json = json) @@ -562,7 +498,7 @@ private constructor( return true } - return other is Type && this.value == other.value + return /* spotless:off */ other is Type && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -599,6 +535,26 @@ private constructor( fun asString(): String = _value().asStringOrThrow() } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Experiment && this.type == other.type && this.evalName == other.evalName && this.position == other.position && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(type, evalName, position, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "Experiment{type=$type, evalName=$evalName, position=$position, additionalProperties=$additionalProperties}" } @JsonDeserialize(builder = Function.Builder::class) @@ -612,8 +568,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - fun type(): Type = type.getRequired("type") fun index(): Long = index.getRequired("index") @@ -636,32 +590,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Function && - this.type == other.type && - this.index == other.index && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - type, - index, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "Function{type=$type, index=$index, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -728,7 +656,7 @@ private constructor( return true } - return other is Type && this.value == other.value + return /* spotless:off */ other is Type && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -765,6 +693,26 @@ private constructor( fun asString(): String = _value().asStringOrThrow() } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Function && this.type == other.type && this.index == other.index && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(type, index, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "Function{type=$type, index=$index, additionalProperties=$additionalProperties}" } } @@ -779,8 +727,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - fun runtime(): Runtime = runtime.getRequired("runtime") fun version(): String = version.getRequired("version") @@ -803,32 +749,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is RuntimeContext && - this.runtime == other.runtime && - this.version == other.version && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - runtime, - version, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "RuntimeContext{runtime=$runtime, version=$version, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -894,7 +814,7 @@ private constructor( return true } - return other is Runtime && this.value == other.value + return /* spotless:off */ other is Runtime && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -937,5 +857,45 @@ private constructor( fun asString(): String = _value().asStringOrThrow() } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is RuntimeContext && this.runtime == other.runtime && this.version == other.version && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(runtime, version, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "RuntimeContext{runtime=$runtime, version=$version, additionalProperties=$additionalProperties}" } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is CodeBundle && this.runtimeContext == other.runtimeContext && this.location == other.location && this.bundleId == other.bundleId && this.preview == other.preview && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(runtimeContext, location, bundleId, preview, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "CodeBundle{runtimeContext=$runtimeContext, location=$location, bundleId=$bundleId, preview=$preview, additionalProperties=$additionalProperties}" } diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/CreateApiKeyOutput.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/CreateApiKeyOutput.kt index f8043a78..aa08e7f4 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/CreateApiKeyOutput.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/CreateApiKeyOutput.kt @@ -32,8 +32,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - /** Unique identifier for the api key */ fun id(): String = id.getRequired("id") @@ -93,42 +91,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is CreateApiKeyOutput && - this.id == other.id && - this.created == other.created && - this.name == other.name && - this.previewName == other.previewName && - this.userId == other.userId && - this.orgId == other.orgId && - this.key == other.key && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - id, - created, - name, - previewName, - userId, - orgId, - key, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "CreateApiKeyOutput{id=$id, created=$created, name=$name, previewName=$previewName, userId=$userId, orgId=$orgId, key=$key, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -235,4 +197,24 @@ private constructor( additionalProperties.toUnmodifiable(), ) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is CreateApiKeyOutput && this.id == other.id && this.created == other.created && this.name == other.name && this.previewName == other.previewName && this.userId == other.userId && this.orgId == other.orgId && this.key == other.key && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(id, created, name, previewName, userId, orgId, key, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "CreateApiKeyOutput{id=$id, created=$created, name=$name, previewName=$previewName, userId=$userId, orgId=$orgId, key=$key, additionalProperties=$additionalProperties}" } diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/CrossObjectInsertResponse.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/CrossObjectInsertResponse.kt index 9c3ace5c..b4f6ca10 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/CrossObjectInsertResponse.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/CrossObjectInsertResponse.kt @@ -27,8 +27,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - /** A mapping from experiment id to row ids for inserted `events` */ fun experiment(): Optional = Optional.ofNullable(experiment.getNullable("experiment")) @@ -64,34 +62,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is CrossObjectInsertResponse && - this.experiment == other.experiment && - this.dataset == other.dataset && - this.projectLogs == other.projectLogs && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - experiment, - dataset, - projectLogs, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "CrossObjectInsertResponse{experiment=$experiment, dataset=$dataset, projectLogs=$projectLogs, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -171,8 +141,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -185,23 +153,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Dataset && this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = Objects.hash(additionalProperties) - } - return hashCode - } - - override fun toString() = "Dataset{additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -232,6 +183,25 @@ private constructor( fun build(): Dataset = Dataset(additionalProperties.toUnmodifiable()) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Dataset && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = "Dataset{additionalProperties=$additionalProperties}" } /** A mapping from experiment id to row ids for inserted `events` */ @@ -244,8 +214,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -258,23 +226,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Experiment && this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = Objects.hash(additionalProperties) - } - return hashCode - } - - override fun toString() = "Experiment{additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -305,6 +256,25 @@ private constructor( fun build(): Experiment = Experiment(additionalProperties.toUnmodifiable()) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Experiment && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = "Experiment{additionalProperties=$additionalProperties}" } /** A mapping from project id to row ids for inserted `events` */ @@ -317,8 +287,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -331,23 +299,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is ProjectLogs && this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = Objects.hash(additionalProperties) - } - return hashCode - } - - override fun toString() = "ProjectLogs{additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -378,5 +329,44 @@ private constructor( fun build(): ProjectLogs = ProjectLogs(additionalProperties.toUnmodifiable()) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is ProjectLogs && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = "ProjectLogs{additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is CrossObjectInsertResponse && this.experiment == other.experiment && this.dataset == other.dataset && this.projectLogs == other.projectLogs && this.additionalProperties == other.additionalProperties /* spotless:on */ } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(experiment, dataset, projectLogs, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "CrossObjectInsertResponse{experiment=$experiment, dataset=$dataset, projectLogs=$projectLogs, additionalProperties=$additionalProperties}" } diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/DataSummary.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/DataSummary.kt index 09ea8607..b09f0838 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/DataSummary.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/DataSummary.kt @@ -25,8 +25,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - /** Total number of records in the dataset */ fun totalRecords(): Long = totalRecords.getRequired("total_records") @@ -46,26 +44,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is DataSummary && - this.totalRecords == other.totalRecords && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = Objects.hash(totalRecords, additionalProperties) - } - return hashCode - } - - override fun toString() = - "DataSummary{totalRecords=$totalRecords, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -106,4 +84,24 @@ private constructor( fun build(): DataSummary = DataSummary(totalRecords, additionalProperties.toUnmodifiable()) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is DataSummary && this.totalRecords == other.totalRecords && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(totalRecords, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "DataSummary{totalRecords=$totalRecords, additionalProperties=$additionalProperties}" } diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/Dataset.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/Dataset.kt index 6ff84bcd..325b230e 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/Dataset.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/Dataset.kt @@ -33,8 +33,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - /** Unique identifier for the dataset */ fun id(): String = id.getRequired("id") @@ -105,44 +103,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Dataset && - this.id == other.id && - this.projectId == other.projectId && - this.name == other.name && - this.description == other.description && - this.created == other.created && - this.deletedAt == other.deletedAt && - this.userId == other.userId && - this.metadata == other.metadata && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - id, - projectId, - name, - description, - created, - deletedAt, - userId, - metadata, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "Dataset{id=$id, projectId=$projectId, name=$name, description=$description, created=$created, deletedAt=$deletedAt, userId=$userId, metadata=$metadata, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -273,8 +233,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -287,23 +245,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Metadata && this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = Objects.hash(additionalProperties) - } - return hashCode - } - - override fun toString() = "Metadata{additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -334,5 +275,44 @@ private constructor( fun build(): Metadata = Metadata(additionalProperties.toUnmodifiable()) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Metadata && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = "Metadata{additionalProperties=$additionalProperties}" } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Dataset && this.id == other.id && this.projectId == other.projectId && this.name == other.name && this.description == other.description && this.created == other.created && this.deletedAt == other.deletedAt && this.userId == other.userId && this.metadata == other.metadata && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(id, projectId, name, description, created, deletedAt, userId, metadata, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "Dataset{id=$id, projectId=$projectId, name=$name, description=$description, created=$created, deletedAt=$deletedAt, userId=$userId, metadata=$metadata, additionalProperties=$additionalProperties}" } diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/DatasetCreateParams.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/DatasetCreateParams.kt index 4146c66e..5390c300 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/DatasetCreateParams.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/DatasetCreateParams.kt @@ -54,8 +54,6 @@ constructor( private val additionalProperties: Map, ) { - private var hashCode: Int = 0 - /** Name of the dataset. Within a project, dataset names are unique */ @JsonProperty("name") fun name(): String? = name @@ -71,34 +69,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is DatasetCreateBody && - this.name == other.name && - this.projectId == other.projectId && - this.description == other.description && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - name, - projectId, - description, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "DatasetCreateBody{name=$name, projectId=$projectId, description=$description, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -152,6 +122,26 @@ constructor( additionalProperties.toUnmodifiable(), ) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is DatasetCreateBody && this.name == other.name && this.projectId == other.projectId && this.description == other.description && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(name, projectId, description, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "DatasetCreateBody{name=$name, projectId=$projectId, description=$description, additionalProperties=$additionalProperties}" } fun _additionalQueryParams(): Map> = additionalQueryParams @@ -165,24 +155,11 @@ constructor( return true } - return other is DatasetCreateParams && - this.name == other.name && - this.projectId == other.projectId && - this.description == other.description && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders && - this.additionalBodyProperties == other.additionalBodyProperties + return /* spotless:off */ other is DatasetCreateParams && this.name == other.name && this.projectId == other.projectId && this.description == other.description && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders && this.additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - name, - projectId, - description, - additionalQueryParams, - additionalHeaders, - additionalBodyProperties, - ) + return /* spotless:off */ Objects.hash(name, projectId, description, additionalQueryParams, additionalHeaders, additionalBodyProperties) /* spotless:on */ } override fun toString() = diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/DatasetDeleteParams.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/DatasetDeleteParams.kt index 29ce38b2..aa332eff 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/DatasetDeleteParams.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/DatasetDeleteParams.kt @@ -46,20 +46,11 @@ constructor( return true } - return other is DatasetDeleteParams && - this.datasetId == other.datasetId && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders && - this.additionalBodyProperties == other.additionalBodyProperties + return /* spotless:off */ other is DatasetDeleteParams && this.datasetId == other.datasetId && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders && this.additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - datasetId, - additionalQueryParams, - additionalHeaders, - additionalBodyProperties, - ) + return /* spotless:off */ Objects.hash(datasetId, additionalQueryParams, additionalHeaders, additionalBodyProperties) /* spotless:on */ } override fun toString() = diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/DatasetEvent.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/DatasetEvent.kt index 1ea168ef..08d204b8 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/DatasetEvent.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/DatasetEvent.kt @@ -36,8 +36,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - /** * A unique identifier for the dataset event. If you don't provide one, BrainTrust will generate * one for you @@ -167,50 +165,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is DatasetEvent && - this.id == other.id && - this._xactId == other._xactId && - this.created == other.created && - this.projectId == other.projectId && - this.datasetId == other.datasetId && - this.input == other.input && - this.expected == other.expected && - this.metadata == other.metadata && - this.tags == other.tags && - this.spanId == other.spanId && - this.rootSpanId == other.rootSpanId && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - id, - _xactId, - created, - projectId, - datasetId, - input, - expected, - metadata, - tags, - spanId, - rootSpanId, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "DatasetEvent{id=$id, _xactId=$_xactId, created=$created, projectId=$projectId, datasetId=$datasetId, input=$input, expected=$expected, metadata=$metadata, tags=$tags, spanId=$spanId, rootSpanId=$rootSpanId, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -413,8 +367,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -427,23 +379,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Metadata && this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = Objects.hash(additionalProperties) - } - return hashCode - } - - override fun toString() = "Metadata{additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -474,5 +409,44 @@ private constructor( fun build(): Metadata = Metadata(additionalProperties.toUnmodifiable()) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Metadata && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = "Metadata{additionalProperties=$additionalProperties}" } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is DatasetEvent && this.id == other.id && this._xactId == other._xactId && this.created == other.created && this.projectId == other.projectId && this.datasetId == other.datasetId && this.input == other.input && this.expected == other.expected && this.metadata == other.metadata && this.tags == other.tags && this.spanId == other.spanId && this.rootSpanId == other.rootSpanId && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(id, _xactId, created, projectId, datasetId, input, expected, metadata, tags, spanId, rootSpanId, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "DatasetEvent{id=$id, _xactId=$_xactId, created=$created, projectId=$projectId, datasetId=$datasetId, input=$input, expected=$expected, metadata=$metadata, tags=$tags, spanId=$spanId, rootSpanId=$rootSpanId, additionalProperties=$additionalProperties}" } diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/DatasetFeedbackParams.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/DatasetFeedbackParams.kt index c32d823b..b3fbe140 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/DatasetFeedbackParams.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/DatasetFeedbackParams.kt @@ -50,8 +50,6 @@ constructor( private val additionalProperties: Map, ) { - private var hashCode: Int = 0 - /** A list of dataset feedback items */ @JsonProperty("feedback") fun feedback(): List? = feedback @@ -61,26 +59,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is DatasetFeedbackBody && - this.feedback == other.feedback && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = Objects.hash(feedback, additionalProperties) - } - return hashCode - } - - override fun toString() = - "DatasetFeedbackBody{feedback=$feedback, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -122,6 +100,26 @@ constructor( additionalProperties.toUnmodifiable() ) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is DatasetFeedbackBody && this.feedback == other.feedback && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(feedback, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "DatasetFeedbackBody{feedback=$feedback, additionalProperties=$additionalProperties}" } fun _additionalQueryParams(): Map> = additionalQueryParams @@ -135,22 +133,11 @@ constructor( return true } - return other is DatasetFeedbackParams && - this.datasetId == other.datasetId && - this.feedback == other.feedback && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders && - this.additionalBodyProperties == other.additionalBodyProperties + return /* spotless:off */ other is DatasetFeedbackParams && this.datasetId == other.datasetId && this.feedback == other.feedback && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders && this.additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - datasetId, - feedback, - additionalQueryParams, - additionalHeaders, - additionalBodyProperties, - ) + return /* spotless:off */ Objects.hash(datasetId, feedback, additionalQueryParams, additionalHeaders, additionalBodyProperties) /* spotless:on */ } override fun toString() = diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/DatasetFetchParams.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/DatasetFetchParams.kt index 1698818b..6202841f 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/DatasetFetchParams.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/DatasetFetchParams.kt @@ -58,26 +58,11 @@ constructor( return true } - return other is DatasetFetchParams && - this.datasetId == other.datasetId && - this.limit == other.limit && - this.maxRootSpanId == other.maxRootSpanId && - this.maxXactId == other.maxXactId && - this.version == other.version && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders + return /* spotless:off */ other is DatasetFetchParams && this.datasetId == other.datasetId && this.limit == other.limit && this.maxRootSpanId == other.maxRootSpanId && this.maxXactId == other.maxXactId && this.version == other.version && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - datasetId, - limit, - maxRootSpanId, - maxXactId, - version, - additionalQueryParams, - additionalHeaders, - ) + return /* spotless:off */ Objects.hash(datasetId, limit, maxRootSpanId, maxXactId, version, additionalQueryParams, additionalHeaders) /* spotless:on */ } override fun toString() = diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/DatasetFetchPostParams.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/DatasetFetchPostParams.kt index 7d3a72e7..945c769d 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/DatasetFetchPostParams.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/DatasetFetchPostParams.kt @@ -79,8 +79,6 @@ constructor( private val additionalProperties: Map, ) { - private var hashCode: Int = 0 - /** * An opaque string to be used as a cursor for the next page of results, in order from * latest to earliest. @@ -159,40 +157,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is DatasetFetchPostBody && - this.cursor == other.cursor && - this.filters == other.filters && - this.limit == other.limit && - this.maxRootSpanId == other.maxRootSpanId && - this.maxXactId == other.maxXactId && - this.version == other.version && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - cursor, - filters, - limit, - maxRootSpanId, - maxXactId, - version, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "DatasetFetchPostBody{cursor=$cursor, filters=$filters, limit=$limit, maxRootSpanId=$maxRootSpanId, maxXactId=$maxXactId, version=$version, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -320,6 +284,26 @@ constructor( additionalProperties.toUnmodifiable(), ) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is DatasetFetchPostBody && this.cursor == other.cursor && this.filters == other.filters && this.limit == other.limit && this.maxRootSpanId == other.maxRootSpanId && this.maxXactId == other.maxXactId && this.version == other.version && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(cursor, filters, limit, maxRootSpanId, maxXactId, version, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "DatasetFetchPostBody{cursor=$cursor, filters=$filters, limit=$limit, maxRootSpanId=$maxRootSpanId, maxXactId=$maxXactId, version=$version, additionalProperties=$additionalProperties}" } fun _additionalQueryParams(): Map> = additionalQueryParams @@ -333,32 +317,11 @@ constructor( return true } - return other is DatasetFetchPostParams && - this.datasetId == other.datasetId && - this.cursor == other.cursor && - this.filters == other.filters && - this.limit == other.limit && - this.maxRootSpanId == other.maxRootSpanId && - this.maxXactId == other.maxXactId && - this.version == other.version && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders && - this.additionalBodyProperties == other.additionalBodyProperties + return /* spotless:off */ other is DatasetFetchPostParams && this.datasetId == other.datasetId && this.cursor == other.cursor && this.filters == other.filters && this.limit == other.limit && this.maxRootSpanId == other.maxRootSpanId && this.maxXactId == other.maxXactId && this.version == other.version && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders && this.additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - datasetId, - cursor, - filters, - limit, - maxRootSpanId, - maxXactId, - version, - additionalQueryParams, - additionalHeaders, - additionalBodyProperties, - ) + return /* spotless:off */ Objects.hash(datasetId, cursor, filters, limit, maxRootSpanId, maxXactId, version, additionalQueryParams, additionalHeaders, additionalBodyProperties) /* spotless:on */ } override fun toString() = diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/DatasetInsertParams.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/DatasetInsertParams.kt index 8089fb3e..ef809f0f 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/DatasetInsertParams.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/DatasetInsertParams.kt @@ -61,8 +61,6 @@ constructor( private val additionalProperties: Map, ) { - private var hashCode: Int = 0 - /** A list of dataset events to insert */ @JsonProperty("events") fun events(): List? = events @@ -72,26 +70,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is DatasetInsertBody && - this.events == other.events && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = Objects.hash(events, additionalProperties) - } - return hashCode - } - - override fun toString() = - "DatasetInsertBody{events=$events, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -132,6 +110,26 @@ constructor( additionalProperties.toUnmodifiable() ) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is DatasetInsertBody && this.events == other.events && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(events, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "DatasetInsertBody{events=$events, additionalProperties=$additionalProperties}" } fun _additionalQueryParams(): Map> = additionalQueryParams @@ -145,22 +143,11 @@ constructor( return true } - return other is DatasetInsertParams && - this.datasetId == other.datasetId && - this.events == other.events && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders && - this.additionalBodyProperties == other.additionalBodyProperties + return /* spotless:off */ other is DatasetInsertParams && this.datasetId == other.datasetId && this.events == other.events && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders && this.additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - datasetId, - events, - additionalQueryParams, - additionalHeaders, - additionalBodyProperties, - ) + return /* spotless:off */ Objects.hash(datasetId, events, additionalQueryParams, additionalHeaders, additionalBodyProperties) /* spotless:on */ } override fun toString() = @@ -322,13 +309,11 @@ constructor( return true } - return other is Event && - this.insertDatasetEventReplace == other.insertDatasetEventReplace && - this.insertDatasetEventMerge == other.insertDatasetEventMerge + return /* spotless:off */ other is Event && this.insertDatasetEventReplace == other.insertDatasetEventReplace && this.insertDatasetEventMerge == other.insertDatasetEventMerge /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash(insertDatasetEventReplace, insertDatasetEventMerge) + return /* spotless:off */ Objects.hash(insertDatasetEventReplace, insertDatasetEventMerge) /* spotless:on */ } override fun toString(): String { @@ -370,6 +355,7 @@ constructor( override fun ObjectCodec.deserialize(node: JsonNode): Event { val json = JsonValue.fromJsonNode(node) + tryDeserialize(node, jacksonTypeRef()) { it.validate() } ?.let { return Event(insertDatasetEventReplace = it, _json = json) diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/DatasetListPage.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/DatasetListPage.kt index 5ad34048..636f0fbf 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/DatasetListPage.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/DatasetListPage.kt @@ -34,18 +34,11 @@ private constructor( return true } - return other is DatasetListPage && - this.datasetsService == other.datasetsService && - this.params == other.params && - this.response == other.response + return /* spotless:off */ other is DatasetListPage && this.datasetsService == other.datasetsService && this.params == other.params && this.response == other.response /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - datasetsService, - params, - response, - ) + return /* spotless:off */ Objects.hash(datasetsService, params, response) /* spotless:on */ } override fun toString() = @@ -127,13 +120,11 @@ private constructor( return true } - return other is Response && - this.objects == other.objects && - this.additionalProperties == other.additionalProperties + return /* spotless:off */ other is Response && this.objects == other.objects && this.additionalProperties == other.additionalProperties /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash(objects, additionalProperties) + return /* spotless:off */ Objects.hash(objects, additionalProperties) /* spotless:on */ } override fun toString() = diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/DatasetListPageAsync.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/DatasetListPageAsync.kt index ab1096f7..b0a51d0c 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/DatasetListPageAsync.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/DatasetListPageAsync.kt @@ -35,18 +35,11 @@ private constructor( return true } - return other is DatasetListPageAsync && - this.datasetsService == other.datasetsService && - this.params == other.params && - this.response == other.response + return /* spotless:off */ other is DatasetListPageAsync && this.datasetsService == other.datasetsService && this.params == other.params && this.response == other.response /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - datasetsService, - params, - response, - ) + return /* spotless:off */ Objects.hash(datasetsService, params, response) /* spotless:on */ } override fun toString() = @@ -134,13 +127,11 @@ private constructor( return true } - return other is Response && - this.objects == other.objects && - this.additionalProperties == other.additionalProperties + return /* spotless:off */ other is Response && this.objects == other.objects && this.additionalProperties == other.additionalProperties /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash(objects, additionalProperties) + return /* spotless:off */ Objects.hash(objects, additionalProperties) /* spotless:on */ } override fun toString() = diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/DatasetListParams.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/DatasetListParams.kt index d42871f3..2f4645b3 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/DatasetListParams.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/DatasetListParams.kt @@ -76,32 +76,11 @@ constructor( return true } - return other is DatasetListParams && - this.datasetName == other.datasetName && - this.endingBefore == other.endingBefore && - this.ids == other.ids && - this.limit == other.limit && - this.orgName == other.orgName && - this.projectId == other.projectId && - this.projectName == other.projectName && - this.startingAfter == other.startingAfter && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders + return /* spotless:off */ other is DatasetListParams && this.datasetName == other.datasetName && this.endingBefore == other.endingBefore && this.ids == other.ids && this.limit == other.limit && this.orgName == other.orgName && this.projectId == other.projectId && this.projectName == other.projectName && this.startingAfter == other.startingAfter && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - datasetName, - endingBefore, - ids, - limit, - orgName, - projectId, - projectName, - startingAfter, - additionalQueryParams, - additionalHeaders, - ) + return /* spotless:off */ Objects.hash(datasetName, endingBefore, ids, limit, orgName, projectId, projectName, startingAfter, additionalQueryParams, additionalHeaders) /* spotless:on */ } override fun toString() = @@ -170,7 +149,7 @@ constructor( * Filter search results to a particular set of object IDs. To specify a list of IDs, * include the query param multiple times */ - fun ids(strings: List) = apply { this.ids = Ids.ofStrings(strings) } + fun idsOfStrings(strings: List) = apply { this.ids = Ids.ofStrings(strings) } /** Limit the number of objects to return */ fun limit(limit: Long) = apply { this.limit = limit } @@ -295,11 +274,11 @@ constructor( return true } - return other is Ids && this.string == other.string && this.strings == other.strings + return /* spotless:off */ other is Ids && this.string == other.string && this.strings == other.strings /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash(string, strings) + return /* spotless:off */ Objects.hash(string, strings) /* spotless:on */ } override fun toString(): String { @@ -333,6 +312,7 @@ constructor( override fun ObjectCodec.deserialize(node: JsonNode): Ids { val json = JsonValue.fromJsonNode(node) + tryDeserialize(node, jacksonTypeRef())?.let { return Ids(string = it, _json = json) } diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/DatasetRetrieveParams.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/DatasetRetrieveParams.kt index 963469a6..833cc3fc 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/DatasetRetrieveParams.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/DatasetRetrieveParams.kt @@ -36,18 +36,11 @@ constructor( return true } - return other is DatasetRetrieveParams && - this.datasetId == other.datasetId && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders + return /* spotless:off */ other is DatasetRetrieveParams && this.datasetId == other.datasetId && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - datasetId, - additionalQueryParams, - additionalHeaders, - ) + return /* spotless:off */ Objects.hash(datasetId, additionalQueryParams, additionalHeaders) /* spotless:on */ } override fun toString() = diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/DatasetSummarizeParams.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/DatasetSummarizeParams.kt index 434a6d19..bc730d6d 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/DatasetSummarizeParams.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/DatasetSummarizeParams.kt @@ -46,20 +46,11 @@ constructor( return true } - return other is DatasetSummarizeParams && - this.datasetId == other.datasetId && - this.summarizeData == other.summarizeData && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders + return /* spotless:off */ other is DatasetSummarizeParams && this.datasetId == other.datasetId && this.summarizeData == other.summarizeData && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - datasetId, - summarizeData, - additionalQueryParams, - additionalHeaders, - ) + return /* spotless:off */ Objects.hash(datasetId, summarizeData, additionalQueryParams, additionalHeaders) /* spotless:on */ } override fun toString() = diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/DatasetUpdateParams.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/DatasetUpdateParams.kt index 1ab15c86..148e70e1 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/DatasetUpdateParams.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/DatasetUpdateParams.kt @@ -64,8 +64,6 @@ constructor( private val additionalProperties: Map, ) { - private var hashCode: Int = 0 - /** Textual description of the dataset */ @JsonProperty("description") fun description(): String? = description @@ -81,34 +79,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is DatasetUpdateBody && - this.description == other.description && - this.metadata == other.metadata && - this.name == other.name && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - description, - metadata, - name, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "DatasetUpdateBody{description=$description, metadata=$metadata, name=$name, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -162,6 +132,26 @@ constructor( additionalProperties.toUnmodifiable(), ) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is DatasetUpdateBody && this.description == other.description && this.metadata == other.metadata && this.name == other.name && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(description, metadata, name, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "DatasetUpdateBody{description=$description, metadata=$metadata, name=$name, additionalProperties=$additionalProperties}" } fun _additionalQueryParams(): Map> = additionalQueryParams @@ -175,26 +165,11 @@ constructor( return true } - return other is DatasetUpdateParams && - this.datasetId == other.datasetId && - this.description == other.description && - this.metadata == other.metadata && - this.name == other.name && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders && - this.additionalBodyProperties == other.additionalBodyProperties + return /* spotless:off */ other is DatasetUpdateParams && this.datasetId == other.datasetId && this.description == other.description && this.metadata == other.metadata && this.name == other.name && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders && this.additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - datasetId, - description, - metadata, - name, - additionalQueryParams, - additionalHeaders, - additionalBodyProperties, - ) + return /* spotless:off */ Objects.hash(datasetId, description, metadata, name, additionalQueryParams, additionalHeaders, additionalBodyProperties) /* spotless:on */ } override fun toString() = @@ -315,31 +290,12 @@ constructor( private val additionalProperties: Map, ) { - private var hashCode: Int = 0 - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Metadata && this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = Objects.hash(additionalProperties) - } - return hashCode - } - - override fun toString() = "Metadata{additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -370,5 +326,24 @@ constructor( fun build(): Metadata = Metadata(additionalProperties.toUnmodifiable()) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Metadata && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = "Metadata{additionalProperties=$additionalProperties}" } } diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/EnvVar.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/EnvVar.kt index 73e03e71..f6242dc9 100644 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/EnvVar.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/EnvVar.kt @@ -34,8 +34,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - /** Unique identifier for the environment variable */ fun id(): String = id.getRequired("id") @@ -90,40 +88,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is EnvVar && - this.id == other.id && - this.objectType == other.objectType && - this.objectId == other.objectId && - this.name == other.name && - this.created == other.created && - this.used == other.used && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - id, - objectType, - objectId, - name, - created, - used, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "EnvVar{id=$id, objectType=$objectType, objectId=$objectId, name=$name, created=$created, used=$used, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -235,7 +199,7 @@ private constructor( return true } - return other is ObjectType && this.value == other.value + return /* spotless:off */ other is ObjectType && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -284,4 +248,24 @@ private constructor( fun asString(): String = _value().asStringOrThrow() } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is EnvVar && this.id == other.id && this.objectType == other.objectType && this.objectId == other.objectId && this.name == other.name && this.created == other.created && this.used == other.used && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(id, objectType, objectId, name, created, used, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "EnvVar{id=$id, objectType=$objectType, objectId=$objectId, name=$name, created=$created, used=$used, additionalProperties=$additionalProperties}" } diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/EnvVarCreateParams.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/EnvVarCreateParams.kt index 4b7c486e..56aeae21 100644 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/EnvVarCreateParams.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/EnvVarCreateParams.kt @@ -63,8 +63,6 @@ constructor( private val additionalProperties: Map, ) { - private var hashCode: Int = 0 - /** The name of the environment variable */ @JsonProperty("name") fun name(): String? = name @@ -83,36 +81,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is EnvVarCreateBody && - this.name == other.name && - this.objectId == other.objectId && - this.objectType == other.objectType && - this.value == other.value && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - name, - objectId, - objectType, - value, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "EnvVarCreateBody{name=$name, objectId=$objectId, objectType=$objectType, value=$value, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -172,6 +140,26 @@ constructor( additionalProperties.toUnmodifiable(), ) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is EnvVarCreateBody && this.name == other.name && this.objectId == other.objectId && this.objectType == other.objectType && this.value == other.value && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(name, objectId, objectType, value, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "EnvVarCreateBody{name=$name, objectId=$objectId, objectType=$objectType, value=$value, additionalProperties=$additionalProperties}" } fun _additionalQueryParams(): Map> = additionalQueryParams @@ -185,26 +173,11 @@ constructor( return true } - return other is EnvVarCreateParams && - this.name == other.name && - this.objectId == other.objectId && - this.objectType == other.objectType && - this.value == other.value && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders && - this.additionalBodyProperties == other.additionalBodyProperties + return /* spotless:off */ other is EnvVarCreateParams && this.name == other.name && this.objectId == other.objectId && this.objectType == other.objectType && this.value == other.value && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders && this.additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - name, - objectId, - objectType, - value, - additionalQueryParams, - additionalHeaders, - additionalBodyProperties, - ) + return /* spotless:off */ Objects.hash(name, objectId, objectType, value, additionalQueryParams, additionalHeaders, additionalBodyProperties) /* spotless:on */ } override fun toString() = @@ -330,7 +303,7 @@ constructor( return true } - return other is ObjectType && this.value == other.value + return /* spotless:off */ other is ObjectType && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/EnvVarDeleteParams.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/EnvVarDeleteParams.kt index 358a7d95..e3e82fb3 100644 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/EnvVarDeleteParams.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/EnvVarDeleteParams.kt @@ -46,20 +46,11 @@ constructor( return true } - return other is EnvVarDeleteParams && - this.envVarId == other.envVarId && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders && - this.additionalBodyProperties == other.additionalBodyProperties + return /* spotless:off */ other is EnvVarDeleteParams && this.envVarId == other.envVarId && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders && this.additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - envVarId, - additionalQueryParams, - additionalHeaders, - additionalBodyProperties, - ) + return /* spotless:off */ Objects.hash(envVarId, additionalQueryParams, additionalHeaders, additionalBodyProperties) /* spotless:on */ } override fun toString() = diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/EnvVarListParams.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/EnvVarListParams.kt index 4f26f91e..9dcaf1d1 100644 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/EnvVarListParams.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/EnvVarListParams.kt @@ -67,26 +67,11 @@ constructor( return true } - return other is EnvVarListParams && - this.envVarName == other.envVarName && - this.ids == other.ids && - this.limit == other.limit && - this.objectId == other.objectId && - this.objectType == other.objectType && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders + return /* spotless:off */ other is EnvVarListParams && this.envVarName == other.envVarName && this.ids == other.ids && this.limit == other.limit && this.objectId == other.objectId && this.objectType == other.objectType && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - envVarName, - ids, - limit, - objectId, - objectType, - additionalQueryParams, - additionalHeaders, - ) + return /* spotless:off */ Objects.hash(envVarName, ids, limit, objectId, objectType, additionalQueryParams, additionalHeaders) /* spotless:on */ } override fun toString() = @@ -140,7 +125,7 @@ constructor( * Filter search results to a particular set of object IDs. To specify a list of IDs, * include the query param multiple times */ - fun ids(strings: List) = apply { this.ids = Ids.ofStrings(strings) } + fun idsOfStrings(strings: List) = apply { this.ids = Ids.ofStrings(strings) } /** Limit the number of objects to return */ fun limit(limit: Long) = apply { this.limit = limit } @@ -250,11 +235,11 @@ constructor( return true } - return other is Ids && this.string == other.string && this.strings == other.strings + return /* spotless:off */ other is Ids && this.string == other.string && this.strings == other.strings /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash(string, strings) + return /* spotless:off */ Objects.hash(string, strings) /* spotless:on */ } override fun toString(): String { @@ -288,6 +273,7 @@ constructor( override fun ObjectCodec.deserialize(node: JsonNode): Ids { val json = JsonValue.fromJsonNode(node) + tryDeserialize(node, jacksonTypeRef())?.let { return Ids(string = it, _json = json) } @@ -329,7 +315,7 @@ constructor( return true } - return other is ObjectType && this.value == other.value + return /* spotless:off */ other is ObjectType && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/EnvVarListResponse.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/EnvVarListResponse.kt index 2232c807..22112cd4 100644 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/EnvVarListResponse.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/EnvVarListResponse.kt @@ -24,8 +24,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - /** A list of env_var objects */ fun objects(): List = objects.getRequired("objects") @@ -45,26 +43,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is EnvVarListResponse && - this.objects == other.objects && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = Objects.hash(objects, additionalProperties) - } - return hashCode - } - - override fun toString() = - "EnvVarListResponse{objects=$objects, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -109,4 +87,24 @@ private constructor( additionalProperties.toUnmodifiable() ) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is EnvVarListResponse && this.objects == other.objects && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(objects, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "EnvVarListResponse{objects=$objects, additionalProperties=$additionalProperties}" } diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/EnvVarReplaceParams.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/EnvVarReplaceParams.kt index b14cc253..cb7eb09d 100644 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/EnvVarReplaceParams.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/EnvVarReplaceParams.kt @@ -63,8 +63,6 @@ constructor( private val additionalProperties: Map, ) { - private var hashCode: Int = 0 - /** The name of the environment variable */ @JsonProperty("name") fun name(): String? = name @@ -83,36 +81,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is EnvVarReplaceBody && - this.name == other.name && - this.objectId == other.objectId && - this.objectType == other.objectType && - this.value == other.value && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - name, - objectId, - objectType, - value, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "EnvVarReplaceBody{name=$name, objectId=$objectId, objectType=$objectType, value=$value, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -172,6 +140,26 @@ constructor( additionalProperties.toUnmodifiable(), ) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is EnvVarReplaceBody && this.name == other.name && this.objectId == other.objectId && this.objectType == other.objectType && this.value == other.value && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(name, objectId, objectType, value, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "EnvVarReplaceBody{name=$name, objectId=$objectId, objectType=$objectType, value=$value, additionalProperties=$additionalProperties}" } fun _additionalQueryParams(): Map> = additionalQueryParams @@ -185,26 +173,11 @@ constructor( return true } - return other is EnvVarReplaceParams && - this.name == other.name && - this.objectId == other.objectId && - this.objectType == other.objectType && - this.value == other.value && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders && - this.additionalBodyProperties == other.additionalBodyProperties + return /* spotless:off */ other is EnvVarReplaceParams && this.name == other.name && this.objectId == other.objectId && this.objectType == other.objectType && this.value == other.value && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders && this.additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - name, - objectId, - objectType, - value, - additionalQueryParams, - additionalHeaders, - additionalBodyProperties, - ) + return /* spotless:off */ Objects.hash(name, objectId, objectType, value, additionalQueryParams, additionalHeaders, additionalBodyProperties) /* spotless:on */ } override fun toString() = @@ -330,7 +303,7 @@ constructor( return true } - return other is ObjectType && this.value == other.value + return /* spotless:off */ other is ObjectType && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/EnvVarRetrieveParams.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/EnvVarRetrieveParams.kt index 4c26e77c..764d154d 100644 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/EnvVarRetrieveParams.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/EnvVarRetrieveParams.kt @@ -36,18 +36,11 @@ constructor( return true } - return other is EnvVarRetrieveParams && - this.envVarId == other.envVarId && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders + return /* spotless:off */ other is EnvVarRetrieveParams && this.envVarId == other.envVarId && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - envVarId, - additionalQueryParams, - additionalHeaders, - ) + return /* spotless:off */ Objects.hash(envVarId, additionalQueryParams, additionalHeaders) /* spotless:on */ } override fun toString() = diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/EnvVarUpdateParams.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/EnvVarUpdateParams.kt index 8da2fd52..e502769a 100644 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/EnvVarUpdateParams.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/EnvVarUpdateParams.kt @@ -59,8 +59,6 @@ constructor( private val additionalProperties: Map, ) { - private var hashCode: Int = 0 - /** The name of the environment variable */ @JsonProperty("name") fun name(): String? = name @@ -73,32 +71,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is EnvVarUpdateBody && - this.name == other.name && - this.value == other.value && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - name, - value, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "EnvVarUpdateBody{name=$name, value=$value, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -144,6 +116,26 @@ constructor( additionalProperties.toUnmodifiable(), ) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is EnvVarUpdateBody && this.name == other.name && this.value == other.value && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(name, value, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "EnvVarUpdateBody{name=$name, value=$value, additionalProperties=$additionalProperties}" } fun _additionalQueryParams(): Map> = additionalQueryParams @@ -157,24 +149,11 @@ constructor( return true } - return other is EnvVarUpdateParams && - this.envVarId == other.envVarId && - this.name == other.name && - this.value == other.value && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders && - this.additionalBodyProperties == other.additionalBodyProperties + return /* spotless:off */ other is EnvVarUpdateParams && this.envVarId == other.envVarId && this.name == other.name && this.value == other.value && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders && this.additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - envVarId, - name, - value, - additionalQueryParams, - additionalHeaders, - additionalBodyProperties, - ) + return /* spotless:off */ Objects.hash(envVarId, name, value, additionalQueryParams, additionalHeaders, additionalBodyProperties) /* spotless:on */ } override fun toString() = diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/EvalCreateParams.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/EvalCreateParams.kt index 31605b1c..0ef11ee3 100644 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/EvalCreateParams.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/EvalCreateParams.kt @@ -88,8 +88,6 @@ constructor( private val additionalProperties: Map, ) { - private var hashCode: Int = 0 - /** The dataset to use */ @JsonProperty("data") fun data(): Data? = data @@ -127,42 +125,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is EvalCreateBody && - this.data == other.data && - this.projectId == other.projectId && - this.scores == other.scores && - this.task == other.task && - this.experimentName == other.experimentName && - this.metadata == other.metadata && - this.stream == other.stream && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - data, - projectId, - scores, - task, - experimentName, - metadata, - stream, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "EvalCreateBody{data=$data, projectId=$projectId, scores=$scores, task=$task, experimentName=$experimentName, metadata=$metadata, stream=$stream, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -254,6 +216,26 @@ constructor( additionalProperties.toUnmodifiable(), ) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is EvalCreateBody && this.data == other.data && this.projectId == other.projectId && this.scores == other.scores && this.task == other.task && this.experimentName == other.experimentName && this.metadata == other.metadata && this.stream == other.stream && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(data, projectId, scores, task, experimentName, metadata, stream, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "EvalCreateBody{data=$data, projectId=$projectId, scores=$scores, task=$task, experimentName=$experimentName, metadata=$metadata, stream=$stream, additionalProperties=$additionalProperties}" } fun _additionalQueryParams(): Map> = additionalQueryParams @@ -267,32 +249,11 @@ constructor( return true } - return other is EvalCreateParams && - this.data == other.data && - this.projectId == other.projectId && - this.scores == other.scores && - this.task == other.task && - this.experimentName == other.experimentName && - this.metadata == other.metadata && - this.stream == other.stream && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders && - this.additionalBodyProperties == other.additionalBodyProperties + return /* spotless:off */ other is EvalCreateParams && this.data == other.data && this.projectId == other.projectId && this.scores == other.scores && this.task == other.task && this.experimentName == other.experimentName && this.metadata == other.metadata && this.stream == other.stream && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders && this.additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - data, - projectId, - scores, - task, - experimentName, - metadata, - stream, - additionalQueryParams, - additionalHeaders, - additionalBodyProperties, - ) + return /* spotless:off */ Objects.hash(data, projectId, scores, task, experimentName, metadata, stream, additionalQueryParams, additionalHeaders, additionalBodyProperties) /* spotless:on */ } override fun toString() = @@ -525,13 +486,11 @@ constructor( return true } - return other is Data && - this.datasetId == other.datasetId && - this.projectDatasetName == other.projectDatasetName + return /* spotless:off */ other is Data && this.datasetId == other.datasetId && this.projectDatasetName == other.projectDatasetName /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash(datasetId, projectDatasetName) + return /* spotless:off */ Objects.hash(datasetId, projectDatasetName) /* spotless:on */ } override fun toString(): String { @@ -567,6 +526,7 @@ constructor( override fun ObjectCodec.deserialize(node: JsonNode): Data { val json = JsonValue.fromJsonNode(node) + tryDeserialize(node, jacksonTypeRef()) { it.validate() } ?.let { return Data(datasetId = it, _json = json) @@ -608,8 +568,6 @@ constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - fun datasetId(): String = datasetId.getRequired("dataset_id") @JsonProperty("dataset_id") @ExcludeMissing fun _datasetId() = datasetId @@ -627,26 +585,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is DatasetId && - this.datasetId == other.datasetId && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = Objects.hash(datasetId, additionalProperties) - } - return hashCode - } - - override fun toString() = - "DatasetId{datasetId=$datasetId, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -686,6 +624,26 @@ constructor( fun build(): DatasetId = DatasetId(datasetId, additionalProperties.toUnmodifiable()) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is DatasetId && this.datasetId == other.datasetId && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(datasetId, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "DatasetId{datasetId=$datasetId, additionalProperties=$additionalProperties}" } /** Project and dataset name */ @@ -700,8 +658,6 @@ constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - fun projectName(): String = projectName.getRequired("project_name") fun datasetName(): String = datasetName.getRequired("dataset_name") @@ -724,32 +680,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is ProjectDatasetName && - this.projectName == other.projectName && - this.datasetName == other.datasetName && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - projectName, - datasetName, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "ProjectDatasetName{projectName=$projectName, datasetName=$datasetName, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -806,6 +736,26 @@ constructor( additionalProperties.toUnmodifiable(), ) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is ProjectDatasetName && this.projectName == other.projectName && this.datasetName == other.datasetName && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(projectName, datasetName, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "ProjectDatasetName{projectName=$projectName, datasetName=$datasetName, additionalProperties=$additionalProperties}" } } @@ -902,24 +852,11 @@ constructor( return true } - return other is Score && - this.functionId == other.functionId && - this.projectSlug == other.projectSlug && - this.globalFunction == other.globalFunction && - this.promptSessionId == other.promptSessionId && - this.inlineCode == other.inlineCode && - this.inlinePrompt == other.inlinePrompt + return /* spotless:off */ other is Score && this.functionId == other.functionId && this.projectSlug == other.projectSlug && this.globalFunction == other.globalFunction && this.promptSessionId == other.promptSessionId && this.inlineCode == other.inlineCode && this.inlinePrompt == other.inlinePrompt /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - functionId, - projectSlug, - globalFunction, - promptSessionId, - inlineCode, - inlinePrompt, - ) + return /* spotless:off */ Objects.hash(functionId, projectSlug, globalFunction, promptSessionId, inlineCode, inlinePrompt) /* spotless:on */ } override fun toString(): String { @@ -979,6 +916,7 @@ constructor( override fun ObjectCodec.deserialize(node: JsonNode): Score { val json = JsonValue.fromJsonNode(node) + tryDeserialize(node, jacksonTypeRef()) { it.validate() } ?.let { return Score(functionId = it, _json = json) @@ -1040,8 +978,6 @@ constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - /** The ID of the function */ fun functionId(): String = functionId.getRequired("function_id") @@ -1068,32 +1004,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is FunctionId && - this.functionId == other.functionId && - this.version == other.version && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - functionId, - version, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "FunctionId{functionId=$functionId, version=$version, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -1152,6 +1062,26 @@ constructor( additionalProperties.toUnmodifiable(), ) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is FunctionId && this.functionId == other.functionId && this.version == other.version && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(functionId, version, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "FunctionId{functionId=$functionId, version=$version, additionalProperties=$additionalProperties}" } /** Project name and slug */ @@ -1167,8 +1097,6 @@ constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - /** The name of the project containing the function */ fun projectName(): String = projectName.getRequired("project_name") @@ -1202,34 +1130,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is ProjectSlug && - this.projectName == other.projectName && - this.slug == other.slug && - this.version == other.version && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - projectName, - slug, - version, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "ProjectSlug{projectName=$projectName, slug=$slug, version=$version, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -1299,6 +1199,26 @@ constructor( additionalProperties.toUnmodifiable(), ) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is ProjectSlug && this.projectName == other.projectName && this.slug == other.slug && this.version == other.version && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(projectName, slug, version, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "ProjectSlug{projectName=$projectName, slug=$slug, version=$version, additionalProperties=$additionalProperties}" } /** Global function name */ @@ -1312,8 +1232,6 @@ constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - /** * The name of the global function. Currently, the global namespace includes the * functions in autoevals @@ -1339,26 +1257,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is GlobalFunction && - this.globalFunction == other.globalFunction && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = Objects.hash(globalFunction, additionalProperties) - } - return hashCode - } - - override fun toString() = - "GlobalFunction{globalFunction=$globalFunction, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -1410,6 +1308,26 @@ constructor( fun build(): GlobalFunction = GlobalFunction(globalFunction, additionalProperties.toUnmodifiable()) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is GlobalFunction && this.globalFunction == other.globalFunction && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(globalFunction, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "GlobalFunction{globalFunction=$globalFunction, additionalProperties=$additionalProperties}" } /** Prompt session id */ @@ -1425,8 +1343,6 @@ constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - /** The ID of the prompt session */ fun promptSessionId(): String = promptSessionId.getRequired("prompt_session_id") @@ -1465,34 +1381,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is PromptSessionId && - this.promptSessionId == other.promptSessionId && - this.promptSessionFunctionId == other.promptSessionFunctionId && - this.version == other.version && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - promptSessionId, - promptSessionFunctionId, - version, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "PromptSessionId{promptSessionId=$promptSessionId, promptSessionFunctionId=$promptSessionFunctionId, version=$version, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -1566,9 +1454,29 @@ constructor( additionalProperties.toUnmodifiable(), ) } - } - /** Inline code function */ + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is PromptSessionId && this.promptSessionId == other.promptSessionId && this.promptSessionFunctionId == other.promptSessionFunctionId && this.version == other.version && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(promptSessionId, promptSessionFunctionId, version, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "PromptSessionId{promptSessionId=$promptSessionId, promptSessionFunctionId=$promptSessionFunctionId, version=$version, additionalProperties=$additionalProperties}" + } + + /** Inline code function */ @JsonDeserialize(builder = InlineCode.Builder::class) @NoAutoDetect class InlineCode @@ -1581,8 +1489,6 @@ constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - fun inlineContext(): InlineContext = inlineContext.getRequired("inline_context") /** The inline code to execute */ @@ -1614,34 +1520,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is InlineCode && - this.inlineContext == other.inlineContext && - this.code == other.code && - this.name == other.name && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - inlineContext, - code, - name, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "InlineCode{inlineContext=$inlineContext, code=$code, name=$name, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -1722,8 +1600,6 @@ constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - fun runtime(): Runtime = runtime.getRequired("runtime") fun version(): String = version.getRequired("version") @@ -1746,32 +1622,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is InlineContext && - this.runtime == other.runtime && - this.version == other.version && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - runtime, - version, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "InlineContext{runtime=$runtime, version=$version, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -1839,7 +1689,7 @@ constructor( return true } - return other is Runtime && this.value == other.value + return /* spotless:off */ other is Runtime && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -1882,7 +1732,47 @@ constructor( fun asString(): String = _value().asStringOrThrow() } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is InlineContext && this.runtime == other.runtime && this.version == other.version && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(runtime, version, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "InlineContext{runtime=$runtime, version=$version, additionalProperties=$additionalProperties}" } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is InlineCode && this.inlineContext == other.inlineContext && this.code == other.code && this.name == other.name && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(inlineContext, code, name, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "InlineCode{inlineContext=$inlineContext, code=$code, name=$name, additionalProperties=$additionalProperties}" } /** Inline prompt definition */ @@ -1897,8 +1787,6 @@ constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - /** The prompt, model, and its parameters */ fun inlinePrompt(): Optional = Optional.ofNullable(inlinePrompt.getNullable("inline_prompt")) @@ -1926,32 +1814,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is InlinePrompt && - this.inlinePrompt == other.inlinePrompt && - this.name == other.name && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - inlinePrompt, - name, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "InlinePrompt{inlinePrompt=$inlinePrompt, name=$name, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -2011,6 +1873,26 @@ constructor( additionalProperties.toUnmodifiable(), ) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is InlinePrompt && this.inlinePrompt == other.inlinePrompt && this.name == other.name && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(inlinePrompt, name, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "InlinePrompt{inlinePrompt=$inlinePrompt, name=$name, additionalProperties=$additionalProperties}" } } @@ -2107,24 +1989,11 @@ constructor( return true } - return other is Task && - this.functionId == other.functionId && - this.projectSlug == other.projectSlug && - this.globalFunction == other.globalFunction && - this.promptSessionId == other.promptSessionId && - this.inlineCode == other.inlineCode && - this.inlinePrompt == other.inlinePrompt + return /* spotless:off */ other is Task && this.functionId == other.functionId && this.projectSlug == other.projectSlug && this.globalFunction == other.globalFunction && this.promptSessionId == other.promptSessionId && this.inlineCode == other.inlineCode && this.inlinePrompt == other.inlinePrompt /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - functionId, - projectSlug, - globalFunction, - promptSessionId, - inlineCode, - inlinePrompt, - ) + return /* spotless:off */ Objects.hash(functionId, projectSlug, globalFunction, promptSessionId, inlineCode, inlinePrompt) /* spotless:on */ } override fun toString(): String { @@ -2183,6 +2052,7 @@ constructor( override fun ObjectCodec.deserialize(node: JsonNode): Task { val json = JsonValue.fromJsonNode(node) + tryDeserialize(node, jacksonTypeRef()) { it.validate() } ?.let { return Task(functionId = it, _json = json) @@ -2244,8 +2114,6 @@ constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - /** The ID of the function */ fun functionId(): String = functionId.getRequired("function_id") @@ -2272,32 +2140,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is FunctionId && - this.functionId == other.functionId && - this.version == other.version && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - functionId, - version, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "FunctionId{functionId=$functionId, version=$version, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -2356,6 +2198,26 @@ constructor( additionalProperties.toUnmodifiable(), ) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is FunctionId && this.functionId == other.functionId && this.version == other.version && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(functionId, version, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "FunctionId{functionId=$functionId, version=$version, additionalProperties=$additionalProperties}" } /** Project name and slug */ @@ -2371,8 +2233,6 @@ constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - /** The name of the project containing the function */ fun projectName(): String = projectName.getRequired("project_name") @@ -2406,34 +2266,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is ProjectSlug && - this.projectName == other.projectName && - this.slug == other.slug && - this.version == other.version && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - projectName, - slug, - version, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "ProjectSlug{projectName=$projectName, slug=$slug, version=$version, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -2503,6 +2335,26 @@ constructor( additionalProperties.toUnmodifiable(), ) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is ProjectSlug && this.projectName == other.projectName && this.slug == other.slug && this.version == other.version && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(projectName, slug, version, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "ProjectSlug{projectName=$projectName, slug=$slug, version=$version, additionalProperties=$additionalProperties}" } /** Global function name */ @@ -2516,8 +2368,6 @@ constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - /** * The name of the global function. Currently, the global namespace includes the * functions in autoevals @@ -2543,26 +2393,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is GlobalFunction && - this.globalFunction == other.globalFunction && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = Objects.hash(globalFunction, additionalProperties) - } - return hashCode - } - - override fun toString() = - "GlobalFunction{globalFunction=$globalFunction, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -2614,6 +2444,26 @@ constructor( fun build(): GlobalFunction = GlobalFunction(globalFunction, additionalProperties.toUnmodifiable()) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is GlobalFunction && this.globalFunction == other.globalFunction && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(globalFunction, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "GlobalFunction{globalFunction=$globalFunction, additionalProperties=$additionalProperties}" } /** Prompt session id */ @@ -2629,8 +2479,6 @@ constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - /** The ID of the prompt session */ fun promptSessionId(): String = promptSessionId.getRequired("prompt_session_id") @@ -2669,34 +2517,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is PromptSessionId && - this.promptSessionId == other.promptSessionId && - this.promptSessionFunctionId == other.promptSessionFunctionId && - this.version == other.version && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - promptSessionId, - promptSessionFunctionId, - version, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "PromptSessionId{promptSessionId=$promptSessionId, promptSessionFunctionId=$promptSessionFunctionId, version=$version, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -2770,6 +2590,26 @@ constructor( additionalProperties.toUnmodifiable(), ) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is PromptSessionId && this.promptSessionId == other.promptSessionId && this.promptSessionFunctionId == other.promptSessionFunctionId && this.version == other.version && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(promptSessionId, promptSessionFunctionId, version, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "PromptSessionId{promptSessionId=$promptSessionId, promptSessionFunctionId=$promptSessionFunctionId, version=$version, additionalProperties=$additionalProperties}" } /** Inline code function */ @@ -2785,8 +2625,6 @@ constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - fun inlineContext(): InlineContext = inlineContext.getRequired("inline_context") /** The inline code to execute */ @@ -2818,34 +2656,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is InlineCode && - this.inlineContext == other.inlineContext && - this.code == other.code && - this.name == other.name && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - inlineContext, - code, - name, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "InlineCode{inlineContext=$inlineContext, code=$code, name=$name, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -2926,8 +2736,6 @@ constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - fun runtime(): Runtime = runtime.getRequired("runtime") fun version(): String = version.getRequired("version") @@ -2950,32 +2758,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is InlineContext && - this.runtime == other.runtime && - this.version == other.version && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - runtime, - version, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "InlineContext{runtime=$runtime, version=$version, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -3043,7 +2825,7 @@ constructor( return true } - return other is Runtime && this.value == other.value + return /* spotless:off */ other is Runtime && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -3086,7 +2868,47 @@ constructor( fun asString(): String = _value().asStringOrThrow() } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is InlineContext && this.runtime == other.runtime && this.version == other.version && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(runtime, version, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "InlineContext{runtime=$runtime, version=$version, additionalProperties=$additionalProperties}" } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is InlineCode && this.inlineContext == other.inlineContext && this.code == other.code && this.name == other.name && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(inlineContext, code, name, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "InlineCode{inlineContext=$inlineContext, code=$code, name=$name, additionalProperties=$additionalProperties}" } /** Inline prompt definition */ @@ -3101,8 +2923,6 @@ constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - /** The prompt, model, and its parameters */ fun inlinePrompt(): Optional = Optional.ofNullable(inlinePrompt.getNullable("inline_prompt")) @@ -3130,32 +2950,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is InlinePrompt && - this.inlinePrompt == other.inlinePrompt && - this.name == other.name && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - inlinePrompt, - name, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "InlinePrompt{inlinePrompt=$inlinePrompt, name=$name, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -3215,6 +3009,26 @@ constructor( additionalProperties.toUnmodifiable(), ) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is InlinePrompt && this.inlinePrompt == other.inlinePrompt && this.name == other.name && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(inlinePrompt, name, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "InlinePrompt{inlinePrompt=$inlinePrompt, name=$name, additionalProperties=$additionalProperties}" } } @@ -3229,31 +3043,12 @@ constructor( private val additionalProperties: Map, ) { - private var hashCode: Int = 0 - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Metadata && this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = Objects.hash(additionalProperties) - } - return hashCode - } - - override fun toString() = "Metadata{additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -3284,5 +3079,24 @@ constructor( fun build(): Metadata = Metadata(additionalProperties.toUnmodifiable()) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Metadata && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = "Metadata{additionalProperties=$additionalProperties}" } } diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/Experiment.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/Experiment.kt index 7e07bb42..7d6d775b 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/Experiment.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/Experiment.kt @@ -39,8 +39,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - /** Unique identifier for the experiment */ fun id(): String = id.getRequired("id") @@ -166,56 +164,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Experiment && - this.id == other.id && - this.projectId == other.projectId && - this.name == other.name && - this.description == other.description && - this.created == other.created && - this.repoInfo == other.repoInfo && - this.commit == other.commit && - this.baseExpId == other.baseExpId && - this.deletedAt == other.deletedAt && - this.datasetId == other.datasetId && - this.datasetVersion == other.datasetVersion && - this.public_ == other.public_ && - this.userId == other.userId && - this.metadata == other.metadata && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - id, - projectId, - name, - description, - created, - repoInfo, - commit, - baseExpId, - deletedAt, - datasetId, - datasetVersion, - public_, - userId, - metadata, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "Experiment{id=$id, projectId=$projectId, name=$name, description=$description, created=$created, repoInfo=$repoInfo, commit=$commit, baseExpId=$baseExpId, deletedAt=$deletedAt, datasetId=$datasetId, datasetVersion=$datasetVersion, public_=$public_, userId=$userId, metadata=$metadata, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -430,8 +378,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -444,23 +390,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Metadata && this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = Objects.hash(additionalProperties) - } - return hashCode - } - - override fun toString() = "Metadata{additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -491,5 +420,44 @@ private constructor( fun build(): Metadata = Metadata(additionalProperties.toUnmodifiable()) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Metadata && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = "Metadata{additionalProperties=$additionalProperties}" } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Experiment && this.id == other.id && this.projectId == other.projectId && this.name == other.name && this.description == other.description && this.created == other.created && this.repoInfo == other.repoInfo && this.commit == other.commit && this.baseExpId == other.baseExpId && this.deletedAt == other.deletedAt && this.datasetId == other.datasetId && this.datasetVersion == other.datasetVersion && this.public_ == other.public_ && this.userId == other.userId && this.metadata == other.metadata && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(id, projectId, name, description, created, repoInfo, commit, baseExpId, deletedAt, datasetId, datasetVersion, public_, userId, metadata, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "Experiment{id=$id, projectId=$projectId, name=$name, description=$description, created=$created, repoInfo=$repoInfo, commit=$commit, baseExpId=$baseExpId, deletedAt=$deletedAt, datasetId=$datasetId, datasetVersion=$datasetVersion, public_=$public_, userId=$userId, metadata=$metadata, additionalProperties=$additionalProperties}" } diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ExperimentCreateParams.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ExperimentCreateParams.kt index c4aa0d18..df88f2a2 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ExperimentCreateParams.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ExperimentCreateParams.kt @@ -89,8 +89,6 @@ constructor( private val additionalProperties: Map, ) { - private var hashCode: Int = 0 - /** Unique identifier for the project that the experiment belongs under */ @JsonProperty("project_id") fun projectId(): String? = projectId @@ -139,48 +137,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is ExperimentCreateBody && - this.projectId == other.projectId && - this.baseExpId == other.baseExpId && - this.datasetId == other.datasetId && - this.datasetVersion == other.datasetVersion && - this.description == other.description && - this.ensureNew == other.ensureNew && - this.metadata == other.metadata && - this.name == other.name && - this.public_ == other.public_ && - this.repoInfo == other.repoInfo && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - projectId, - baseExpId, - datasetId, - datasetVersion, - description, - ensureNew, - metadata, - name, - public_, - repoInfo, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "ExperimentCreateBody{projectId=$projectId, baseExpId=$baseExpId, datasetId=$datasetId, datasetVersion=$datasetVersion, description=$description, ensureNew=$ensureNew, metadata=$metadata, name=$name, public_=$public_, repoInfo=$repoInfo, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -297,6 +253,26 @@ constructor( additionalProperties.toUnmodifiable(), ) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is ExperimentCreateBody && this.projectId == other.projectId && this.baseExpId == other.baseExpId && this.datasetId == other.datasetId && this.datasetVersion == other.datasetVersion && this.description == other.description && this.ensureNew == other.ensureNew && this.metadata == other.metadata && this.name == other.name && this.public_ == other.public_ && this.repoInfo == other.repoInfo && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(projectId, baseExpId, datasetId, datasetVersion, description, ensureNew, metadata, name, public_, repoInfo, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "ExperimentCreateBody{projectId=$projectId, baseExpId=$baseExpId, datasetId=$datasetId, datasetVersion=$datasetVersion, description=$description, ensureNew=$ensureNew, metadata=$metadata, name=$name, public_=$public_, repoInfo=$repoInfo, additionalProperties=$additionalProperties}" } fun _additionalQueryParams(): Map> = additionalQueryParams @@ -310,38 +286,11 @@ constructor( return true } - return other is ExperimentCreateParams && - this.projectId == other.projectId && - this.baseExpId == other.baseExpId && - this.datasetId == other.datasetId && - this.datasetVersion == other.datasetVersion && - this.description == other.description && - this.ensureNew == other.ensureNew && - this.metadata == other.metadata && - this.name == other.name && - this.public_ == other.public_ && - this.repoInfo == other.repoInfo && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders && - this.additionalBodyProperties == other.additionalBodyProperties + return /* spotless:off */ other is ExperimentCreateParams && this.projectId == other.projectId && this.baseExpId == other.baseExpId && this.datasetId == other.datasetId && this.datasetVersion == other.datasetVersion && this.description == other.description && this.ensureNew == other.ensureNew && this.metadata == other.metadata && this.name == other.name && this.public_ == other.public_ && this.repoInfo == other.repoInfo && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders && this.additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - projectId, - baseExpId, - datasetId, - datasetVersion, - description, - ensureNew, - metadata, - name, - public_, - repoInfo, - additionalQueryParams, - additionalHeaders, - additionalBodyProperties, - ) + return /* spotless:off */ Objects.hash(projectId, baseExpId, datasetId, datasetVersion, description, ensureNew, metadata, name, public_, repoInfo, additionalQueryParams, additionalHeaders, additionalBodyProperties) /* spotless:on */ } override fun toString() = @@ -510,31 +459,12 @@ constructor( private val additionalProperties: Map, ) { - private var hashCode: Int = 0 - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Metadata && this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = Objects.hash(additionalProperties) - } - return hashCode - } - - override fun toString() = "Metadata{additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -565,5 +495,24 @@ constructor( fun build(): Metadata = Metadata(additionalProperties.toUnmodifiable()) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Metadata && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = "Metadata{additionalProperties=$additionalProperties}" } } diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ExperimentDeleteParams.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ExperimentDeleteParams.kt index e3e57b22..d1522848 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ExperimentDeleteParams.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ExperimentDeleteParams.kt @@ -46,20 +46,11 @@ constructor( return true } - return other is ExperimentDeleteParams && - this.experimentId == other.experimentId && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders && - this.additionalBodyProperties == other.additionalBodyProperties + return /* spotless:off */ other is ExperimentDeleteParams && this.experimentId == other.experimentId && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders && this.additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - experimentId, - additionalQueryParams, - additionalHeaders, - additionalBodyProperties, - ) + return /* spotless:off */ Objects.hash(experimentId, additionalQueryParams, additionalHeaders, additionalBodyProperties) /* spotless:on */ } override fun toString() = diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ExperimentEvent.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ExperimentEvent.kt index ec5c09a6..debb6043 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ExperimentEvent.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ExperimentEvent.kt @@ -47,8 +47,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - /** * A unique identifier for the experiment event. If you don't provide one, BrainTrust will * generate one for you @@ -311,66 +309,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is ExperimentEvent && - this.id == other.id && - this.datasetRecordId == other.datasetRecordId && - this._xactId == other._xactId && - this.created == other.created && - this.projectId == other.projectId && - this.experimentId == other.experimentId && - this.input == other.input && - this.output == other.output && - this.expected == other.expected && - this.error == other.error && - this.scores == other.scores && - this.metadata == other.metadata && - this.tags == other.tags && - this.metrics == other.metrics && - this.context == other.context && - this.spanId == other.spanId && - this.spanParents == other.spanParents && - this.rootSpanId == other.rootSpanId && - this.spanAttributes == other.spanAttributes && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - id, - datasetRecordId, - _xactId, - created, - projectId, - experimentId, - input, - output, - expected, - error, - scores, - metadata, - tags, - metrics, - context, - spanId, - spanParents, - rootSpanId, - spanAttributes, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "ExperimentEvent{id=$id, datasetRecordId=$datasetRecordId, _xactId=$_xactId, created=$created, projectId=$projectId, experimentId=$experimentId, input=$input, output=$output, expected=$expected, error=$error, scores=$scores, metadata=$metadata, tags=$tags, metrics=$metrics, context=$context, spanId=$spanId, spanParents=$spanParents, rootSpanId=$rootSpanId, spanAttributes=$spanAttributes, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -723,8 +661,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - /** The function in code which created the experiment event */ fun callerFunctionname(): Optional = Optional.ofNullable(callerFunctionname.getNullable("caller_functionname")) @@ -763,34 +699,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Context && - this.callerFunctionname == other.callerFunctionname && - this.callerFilename == other.callerFilename && - this.callerLineno == other.callerLineno && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - callerFunctionname, - callerFilename, - callerLineno, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "Context{callerFunctionname=$callerFunctionname, callerFilename=$callerFilename, callerLineno=$callerLineno, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -865,6 +773,26 @@ private constructor( additionalProperties.toUnmodifiable(), ) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Context && this.callerFunctionname == other.callerFunctionname && this.callerFilename == other.callerFilename && this.callerLineno == other.callerLineno && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(callerFunctionname, callerFilename, callerLineno, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "Context{callerFunctionname=$callerFunctionname, callerFilename=$callerFilename, callerLineno=$callerLineno, additionalProperties=$additionalProperties}" } /** @@ -883,8 +811,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -897,23 +823,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Metadata && this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = Objects.hash(additionalProperties) - } - return hashCode - } - - override fun toString() = "Metadata{additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -944,6 +853,25 @@ private constructor( fun build(): Metadata = Metadata(additionalProperties.toUnmodifiable()) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Metadata && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = "Metadata{additionalProperties=$additionalProperties}" } /** @@ -965,8 +893,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - /** * A unix timestamp recording when the section of code which produced the experiment event * started @@ -1042,38 +968,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Metrics && - this.start == other.start && - this.end == other.end && - this.promptTokens == other.promptTokens && - this.completionTokens == other.completionTokens && - this.tokens == other.tokens && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - start, - end, - promptTokens, - completionTokens, - tokens, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "Metrics{start=$start, end=$end, promptTokens=$promptTokens, completionTokens=$completionTokens, tokens=$tokens, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -1191,6 +1085,26 @@ private constructor( additionalProperties.toUnmodifiable(), ) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Metrics && this.start == other.start && this.end == other.end && this.promptTokens == other.promptTokens && this.completionTokens == other.completionTokens && this.tokens == other.tokens && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(start, end, promptTokens, completionTokens, tokens, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "Metrics{start=$start, end=$end, promptTokens=$promptTokens, completionTokens=$completionTokens, tokens=$tokens, additionalProperties=$additionalProperties}" } /** @@ -1211,8 +1125,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -1225,23 +1137,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Scores && this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = Objects.hash(additionalProperties) - } - return hashCode - } - - override fun toString() = "Scores{additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -1272,6 +1167,25 @@ private constructor( fun build(): Scores = Scores(additionalProperties.toUnmodifiable()) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Scores && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = "Scores{additionalProperties=$additionalProperties}" } /** Human-identifying attributes of the span, such as name, type, etc. */ @@ -1286,8 +1200,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - /** Name of the span, for display purposes only */ fun name(): Optional = Optional.ofNullable(name.getNullable("name")) @@ -1314,32 +1226,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is SpanAttributes && - this.name == other.name && - this.type == other.type && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - name, - type, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "SpanAttributes{name=$name, type=$type, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -1409,7 +1295,7 @@ private constructor( return true } - return other is Type && this.value == other.value + return /* spotless:off */ other is Type && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -1476,5 +1362,45 @@ private constructor( fun asString(): String = _value().asStringOrThrow() } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is SpanAttributes && this.name == other.name && this.type == other.type && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(name, type, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "SpanAttributes{name=$name, type=$type, additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is ExperimentEvent && this.id == other.id && this.datasetRecordId == other.datasetRecordId && this._xactId == other._xactId && this.created == other.created && this.projectId == other.projectId && this.experimentId == other.experimentId && this.input == other.input && this.output == other.output && this.expected == other.expected && this.error == other.error && this.scores == other.scores && this.metadata == other.metadata && this.tags == other.tags && this.metrics == other.metrics && this.context == other.context && this.spanId == other.spanId && this.spanParents == other.spanParents && this.rootSpanId == other.rootSpanId && this.spanAttributes == other.spanAttributes && this.additionalProperties == other.additionalProperties /* spotless:on */ } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(id, datasetRecordId, _xactId, created, projectId, experimentId, input, output, expected, error, scores, metadata, tags, metrics, context, spanId, spanParents, rootSpanId, spanAttributes, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "ExperimentEvent{id=$id, datasetRecordId=$datasetRecordId, _xactId=$_xactId, created=$created, projectId=$projectId, experimentId=$experimentId, input=$input, output=$output, expected=$expected, error=$error, scores=$scores, metadata=$metadata, tags=$tags, metrics=$metrics, context=$context, spanId=$spanId, spanParents=$spanParents, rootSpanId=$rootSpanId, spanAttributes=$spanAttributes, additionalProperties=$additionalProperties}" } diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ExperimentFeedbackParams.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ExperimentFeedbackParams.kt index 02de4d52..8b2a759e 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ExperimentFeedbackParams.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ExperimentFeedbackParams.kt @@ -50,8 +50,6 @@ constructor( private val additionalProperties: Map, ) { - private var hashCode: Int = 0 - /** A list of experiment feedback items */ @JsonProperty("feedback") fun feedback(): List? = feedback @@ -61,26 +59,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is ExperimentFeedbackBody && - this.feedback == other.feedback && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = Objects.hash(feedback, additionalProperties) - } - return hashCode - } - - override fun toString() = - "ExperimentFeedbackBody{feedback=$feedback, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -124,6 +102,26 @@ constructor( additionalProperties.toUnmodifiable() ) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is ExperimentFeedbackBody && this.feedback == other.feedback && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(feedback, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "ExperimentFeedbackBody{feedback=$feedback, additionalProperties=$additionalProperties}" } fun _additionalQueryParams(): Map> = additionalQueryParams @@ -137,22 +135,11 @@ constructor( return true } - return other is ExperimentFeedbackParams && - this.experimentId == other.experimentId && - this.feedback == other.feedback && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders && - this.additionalBodyProperties == other.additionalBodyProperties + return /* spotless:off */ other is ExperimentFeedbackParams && this.experimentId == other.experimentId && this.feedback == other.feedback && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders && this.additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - experimentId, - feedback, - additionalQueryParams, - additionalHeaders, - additionalBodyProperties, - ) + return /* spotless:off */ Objects.hash(experimentId, feedback, additionalQueryParams, additionalHeaders, additionalBodyProperties) /* spotless:on */ } override fun toString() = diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ExperimentFetchParams.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ExperimentFetchParams.kt index 9f90dc28..cb530419 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ExperimentFetchParams.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ExperimentFetchParams.kt @@ -58,26 +58,11 @@ constructor( return true } - return other is ExperimentFetchParams && - this.experimentId == other.experimentId && - this.limit == other.limit && - this.maxRootSpanId == other.maxRootSpanId && - this.maxXactId == other.maxXactId && - this.version == other.version && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders + return /* spotless:off */ other is ExperimentFetchParams && this.experimentId == other.experimentId && this.limit == other.limit && this.maxRootSpanId == other.maxRootSpanId && this.maxXactId == other.maxXactId && this.version == other.version && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - experimentId, - limit, - maxRootSpanId, - maxXactId, - version, - additionalQueryParams, - additionalHeaders, - ) + return /* spotless:off */ Objects.hash(experimentId, limit, maxRootSpanId, maxXactId, version, additionalQueryParams, additionalHeaders) /* spotless:on */ } override fun toString() = diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ExperimentFetchPostParams.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ExperimentFetchPostParams.kt index b208f3c8..36eafdcb 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ExperimentFetchPostParams.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ExperimentFetchPostParams.kt @@ -79,8 +79,6 @@ constructor( private val additionalProperties: Map, ) { - private var hashCode: Int = 0 - /** * An opaque string to be used as a cursor for the next page of results, in order from * latest to earliest. @@ -159,40 +157,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is ExperimentFetchPostBody && - this.cursor == other.cursor && - this.filters == other.filters && - this.limit == other.limit && - this.maxRootSpanId == other.maxRootSpanId && - this.maxXactId == other.maxXactId && - this.version == other.version && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - cursor, - filters, - limit, - maxRootSpanId, - maxXactId, - version, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "ExperimentFetchPostBody{cursor=$cursor, filters=$filters, limit=$limit, maxRootSpanId=$maxRootSpanId, maxXactId=$maxXactId, version=$version, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -320,6 +284,26 @@ constructor( additionalProperties.toUnmodifiable(), ) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is ExperimentFetchPostBody && this.cursor == other.cursor && this.filters == other.filters && this.limit == other.limit && this.maxRootSpanId == other.maxRootSpanId && this.maxXactId == other.maxXactId && this.version == other.version && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(cursor, filters, limit, maxRootSpanId, maxXactId, version, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "ExperimentFetchPostBody{cursor=$cursor, filters=$filters, limit=$limit, maxRootSpanId=$maxRootSpanId, maxXactId=$maxXactId, version=$version, additionalProperties=$additionalProperties}" } fun _additionalQueryParams(): Map> = additionalQueryParams @@ -333,32 +317,11 @@ constructor( return true } - return other is ExperimentFetchPostParams && - this.experimentId == other.experimentId && - this.cursor == other.cursor && - this.filters == other.filters && - this.limit == other.limit && - this.maxRootSpanId == other.maxRootSpanId && - this.maxXactId == other.maxXactId && - this.version == other.version && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders && - this.additionalBodyProperties == other.additionalBodyProperties + return /* spotless:off */ other is ExperimentFetchPostParams && this.experimentId == other.experimentId && this.cursor == other.cursor && this.filters == other.filters && this.limit == other.limit && this.maxRootSpanId == other.maxRootSpanId && this.maxXactId == other.maxXactId && this.version == other.version && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders && this.additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - experimentId, - cursor, - filters, - limit, - maxRootSpanId, - maxXactId, - version, - additionalQueryParams, - additionalHeaders, - additionalBodyProperties, - ) + return /* spotless:off */ Objects.hash(experimentId, cursor, filters, limit, maxRootSpanId, maxXactId, version, additionalQueryParams, additionalHeaders, additionalBodyProperties) /* spotless:on */ } override fun toString() = diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ExperimentInsertParams.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ExperimentInsertParams.kt index b03547c6..728d5bdb 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ExperimentInsertParams.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ExperimentInsertParams.kt @@ -61,8 +61,6 @@ constructor( private val additionalProperties: Map, ) { - private var hashCode: Int = 0 - /** A list of experiment events to insert */ @JsonProperty("events") fun events(): List? = events @@ -72,26 +70,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is ExperimentInsertBody && - this.events == other.events && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = Objects.hash(events, additionalProperties) - } - return hashCode - } - - override fun toString() = - "ExperimentInsertBody{events=$events, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -132,6 +110,26 @@ constructor( additionalProperties.toUnmodifiable() ) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is ExperimentInsertBody && this.events == other.events && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(events, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "ExperimentInsertBody{events=$events, additionalProperties=$additionalProperties}" } fun _additionalQueryParams(): Map> = additionalQueryParams @@ -145,22 +143,11 @@ constructor( return true } - return other is ExperimentInsertParams && - this.experimentId == other.experimentId && - this.events == other.events && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders && - this.additionalBodyProperties == other.additionalBodyProperties + return /* spotless:off */ other is ExperimentInsertParams && this.experimentId == other.experimentId && this.events == other.events && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders && this.additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - experimentId, - events, - additionalQueryParams, - additionalHeaders, - additionalBodyProperties, - ) + return /* spotless:off */ Objects.hash(experimentId, events, additionalQueryParams, additionalHeaders, additionalBodyProperties) /* spotless:on */ } override fun toString() = @@ -322,13 +309,11 @@ constructor( return true } - return other is Event && - this.insertExperimentEventReplace == other.insertExperimentEventReplace && - this.insertExperimentEventMerge == other.insertExperimentEventMerge + return /* spotless:off */ other is Event && this.insertExperimentEventReplace == other.insertExperimentEventReplace && this.insertExperimentEventMerge == other.insertExperimentEventMerge /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash(insertExperimentEventReplace, insertExperimentEventMerge) + return /* spotless:off */ Objects.hash(insertExperimentEventReplace, insertExperimentEventMerge) /* spotless:on */ } override fun toString(): String { @@ -374,6 +359,7 @@ constructor( override fun ObjectCodec.deserialize(node: JsonNode): Event { val json = JsonValue.fromJsonNode(node) + tryDeserialize(node, jacksonTypeRef()) { it.validate() } diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ExperimentListPage.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ExperimentListPage.kt index 18eb99a7..4e6b5d8f 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ExperimentListPage.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ExperimentListPage.kt @@ -34,18 +34,11 @@ private constructor( return true } - return other is ExperimentListPage && - this.experimentsService == other.experimentsService && - this.params == other.params && - this.response == other.response + return /* spotless:off */ other is ExperimentListPage && this.experimentsService == other.experimentsService && this.params == other.params && this.response == other.response /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - experimentsService, - params, - response, - ) + return /* spotless:off */ Objects.hash(experimentsService, params, response) /* spotless:on */ } override fun toString() = @@ -131,13 +124,11 @@ private constructor( return true } - return other is Response && - this.objects == other.objects && - this.additionalProperties == other.additionalProperties + return /* spotless:off */ other is Response && this.objects == other.objects && this.additionalProperties == other.additionalProperties /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash(objects, additionalProperties) + return /* spotless:off */ Objects.hash(objects, additionalProperties) /* spotless:on */ } override fun toString() = diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ExperimentListPageAsync.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ExperimentListPageAsync.kt index 2b5d3b79..ff0a1487 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ExperimentListPageAsync.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ExperimentListPageAsync.kt @@ -35,18 +35,11 @@ private constructor( return true } - return other is ExperimentListPageAsync && - this.experimentsService == other.experimentsService && - this.params == other.params && - this.response == other.response + return /* spotless:off */ other is ExperimentListPageAsync && this.experimentsService == other.experimentsService && this.params == other.params && this.response == other.response /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - experimentsService, - params, - response, - ) + return /* spotless:off */ Objects.hash(experimentsService, params, response) /* spotless:on */ } override fun toString() = @@ -134,13 +127,11 @@ private constructor( return true } - return other is Response && - this.objects == other.objects && - this.additionalProperties == other.additionalProperties + return /* spotless:off */ other is Response && this.objects == other.objects && this.additionalProperties == other.additionalProperties /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash(objects, additionalProperties) + return /* spotless:off */ Objects.hash(objects, additionalProperties) /* spotless:on */ } override fun toString() = diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ExperimentListParams.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ExperimentListParams.kt index 6c36c064..a2b8bb99 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ExperimentListParams.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ExperimentListParams.kt @@ -76,32 +76,11 @@ constructor( return true } - return other is ExperimentListParams && - this.endingBefore == other.endingBefore && - this.experimentName == other.experimentName && - this.ids == other.ids && - this.limit == other.limit && - this.orgName == other.orgName && - this.projectId == other.projectId && - this.projectName == other.projectName && - this.startingAfter == other.startingAfter && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders + return /* spotless:off */ other is ExperimentListParams && this.endingBefore == other.endingBefore && this.experimentName == other.experimentName && this.ids == other.ids && this.limit == other.limit && this.orgName == other.orgName && this.projectId == other.projectId && this.projectName == other.projectName && this.startingAfter == other.startingAfter && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - endingBefore, - experimentName, - ids, - limit, - orgName, - projectId, - projectName, - startingAfter, - additionalQueryParams, - additionalHeaders, - ) + return /* spotless:off */ Objects.hash(endingBefore, experimentName, ids, limit, orgName, projectId, projectName, startingAfter, additionalQueryParams, additionalHeaders) /* spotless:on */ } override fun toString() = @@ -170,7 +149,7 @@ constructor( * Filter search results to a particular set of object IDs. To specify a list of IDs, * include the query param multiple times */ - fun ids(strings: List) = apply { this.ids = Ids.ofStrings(strings) } + fun idsOfStrings(strings: List) = apply { this.ids = Ids.ofStrings(strings) } /** Limit the number of objects to return */ fun limit(limit: Long) = apply { this.limit = limit } @@ -295,11 +274,11 @@ constructor( return true } - return other is Ids && this.string == other.string && this.strings == other.strings + return /* spotless:off */ other is Ids && this.string == other.string && this.strings == other.strings /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash(string, strings) + return /* spotless:off */ Objects.hash(string, strings) /* spotless:on */ } override fun toString(): String { @@ -333,6 +312,7 @@ constructor( override fun ObjectCodec.deserialize(node: JsonNode): Ids { val json = JsonValue.fromJsonNode(node) + tryDeserialize(node, jacksonTypeRef())?.let { return Ids(string = it, _json = json) } diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ExperimentRetrieveParams.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ExperimentRetrieveParams.kt index 3062382b..ebb46148 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ExperimentRetrieveParams.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ExperimentRetrieveParams.kt @@ -36,18 +36,11 @@ constructor( return true } - return other is ExperimentRetrieveParams && - this.experimentId == other.experimentId && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders + return /* spotless:off */ other is ExperimentRetrieveParams && this.experimentId == other.experimentId && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - experimentId, - additionalQueryParams, - additionalHeaders, - ) + return /* spotless:off */ Objects.hash(experimentId, additionalQueryParams, additionalHeaders) /* spotless:on */ } override fun toString() = diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ExperimentSummarizeParams.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ExperimentSummarizeParams.kt index c72fa655..8923ed07 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ExperimentSummarizeParams.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ExperimentSummarizeParams.kt @@ -52,22 +52,11 @@ constructor( return true } - return other is ExperimentSummarizeParams && - this.experimentId == other.experimentId && - this.comparisonExperimentId == other.comparisonExperimentId && - this.summarizeScores == other.summarizeScores && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders + return /* spotless:off */ other is ExperimentSummarizeParams && this.experimentId == other.experimentId && this.comparisonExperimentId == other.comparisonExperimentId && this.summarizeScores == other.summarizeScores && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - experimentId, - comparisonExperimentId, - summarizeScores, - additionalQueryParams, - additionalHeaders, - ) + return /* spotless:off */ Objects.hash(experimentId, comparisonExperimentId, summarizeScores, additionalQueryParams, additionalHeaders) /* spotless:on */ } override fun toString() = diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ExperimentUpdateParams.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ExperimentUpdateParams.kt index bac822b2..37a22a12 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ExperimentUpdateParams.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ExperimentUpdateParams.kt @@ -89,8 +89,6 @@ constructor( private val additionalProperties: Map, ) { - private var hashCode: Int = 0 - /** Id of default base experiment to compare against when viewing this experiment */ @JsonProperty("base_exp_id") fun baseExpId(): String? = baseExpId @@ -129,44 +127,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is ExperimentUpdateBody && - this.baseExpId == other.baseExpId && - this.datasetId == other.datasetId && - this.datasetVersion == other.datasetVersion && - this.description == other.description && - this.metadata == other.metadata && - this.name == other.name && - this.public_ == other.public_ && - this.repoInfo == other.repoInfo && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - baseExpId, - datasetId, - datasetVersion, - description, - metadata, - name, - public_, - repoInfo, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "ExperimentUpdateBody{baseExpId=$baseExpId, datasetId=$datasetId, datasetVersion=$datasetVersion, description=$description, metadata=$metadata, name=$name, public_=$public_, repoInfo=$repoInfo, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -265,6 +225,26 @@ constructor( additionalProperties.toUnmodifiable(), ) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is ExperimentUpdateBody && this.baseExpId == other.baseExpId && this.datasetId == other.datasetId && this.datasetVersion == other.datasetVersion && this.description == other.description && this.metadata == other.metadata && this.name == other.name && this.public_ == other.public_ && this.repoInfo == other.repoInfo && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(baseExpId, datasetId, datasetVersion, description, metadata, name, public_, repoInfo, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "ExperimentUpdateBody{baseExpId=$baseExpId, datasetId=$datasetId, datasetVersion=$datasetVersion, description=$description, metadata=$metadata, name=$name, public_=$public_, repoInfo=$repoInfo, additionalProperties=$additionalProperties}" } fun _additionalQueryParams(): Map> = additionalQueryParams @@ -278,36 +258,11 @@ constructor( return true } - return other is ExperimentUpdateParams && - this.experimentId == other.experimentId && - this.baseExpId == other.baseExpId && - this.datasetId == other.datasetId && - this.datasetVersion == other.datasetVersion && - this.description == other.description && - this.metadata == other.metadata && - this.name == other.name && - this.public_ == other.public_ && - this.repoInfo == other.repoInfo && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders && - this.additionalBodyProperties == other.additionalBodyProperties + return /* spotless:off */ other is ExperimentUpdateParams && this.experimentId == other.experimentId && this.baseExpId == other.baseExpId && this.datasetId == other.datasetId && this.datasetVersion == other.datasetVersion && this.description == other.description && this.metadata == other.metadata && this.name == other.name && this.public_ == other.public_ && this.repoInfo == other.repoInfo && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders && this.additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - experimentId, - baseExpId, - datasetId, - datasetVersion, - description, - metadata, - name, - public_, - repoInfo, - additionalQueryParams, - additionalHeaders, - additionalBodyProperties, - ) + return /* spotless:off */ Objects.hash(experimentId, baseExpId, datasetId, datasetVersion, description, metadata, name, public_, repoInfo, additionalQueryParams, additionalHeaders, additionalBodyProperties) /* spotless:on */ } override fun toString() = @@ -466,31 +421,12 @@ constructor( private val additionalProperties: Map, ) { - private var hashCode: Int = 0 - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Metadata && this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = Objects.hash(additionalProperties) - } - return hashCode - } - - override fun toString() = "Metadata{additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -521,5 +457,24 @@ constructor( fun build(): Metadata = Metadata(additionalProperties.toUnmodifiable()) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Metadata && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = "Metadata{additionalProperties=$additionalProperties}" } } diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/FeedbackDatasetItem.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/FeedbackDatasetItem.kt index 7e931a63..3422a014 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/FeedbackDatasetItem.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/FeedbackDatasetItem.kt @@ -31,8 +31,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - /** * The id of the dataset event to log feedback for. This is the row `id` returned by `POST * /v1/dataset/{dataset_id}/insert` @@ -85,36 +83,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is FeedbackDatasetItem && - this.id == other.id && - this.comment == other.comment && - this.metadata == other.metadata && - this.source == other.source && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - id, - comment, - metadata, - source, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "FeedbackDatasetItem{id=$id, comment=$comment, metadata=$metadata, source=$source, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -216,8 +184,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -230,23 +196,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Metadata && this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = Objects.hash(additionalProperties) - } - return hashCode - } - - override fun toString() = "Metadata{additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -277,6 +226,25 @@ private constructor( fun build(): Metadata = Metadata(additionalProperties.toUnmodifiable()) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Metadata && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = "Metadata{additionalProperties=$additionalProperties}" } class Source @@ -292,7 +260,7 @@ private constructor( return true } - return other is Source && this.value == other.value + return /* spotless:off */ other is Source && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -341,4 +309,24 @@ private constructor( fun asString(): String = _value().asStringOrThrow() } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is FeedbackDatasetItem && this.id == other.id && this.comment == other.comment && this.metadata == other.metadata && this.source == other.source && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(id, comment, metadata, source, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "FeedbackDatasetItem{id=$id, comment=$comment, metadata=$metadata, source=$source, additionalProperties=$additionalProperties}" } diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/FeedbackExperimentItem.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/FeedbackExperimentItem.kt index 2abcfe43..f05a762a 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/FeedbackExperimentItem.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/FeedbackExperimentItem.kt @@ -33,8 +33,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - /** * The id of the experiment event to log feedback for. This is the row `id` returned by `POST * /v1/experiment/{experiment_id}/insert` @@ -113,40 +111,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is FeedbackExperimentItem && - this.id == other.id && - this.scores == other.scores && - this.expected == other.expected && - this.comment == other.comment && - this.metadata == other.metadata && - this.source == other.source && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - id, - scores, - expected, - comment, - metadata, - source, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "FeedbackExperimentItem{id=$id, scores=$scores, expected=$expected, comment=$comment, metadata=$metadata, source=$source, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -276,8 +240,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -290,23 +252,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Metadata && this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = Objects.hash(additionalProperties) - } - return hashCode - } - - override fun toString() = "Metadata{additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -337,6 +282,25 @@ private constructor( fun build(): Metadata = Metadata(additionalProperties.toUnmodifiable()) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Metadata && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = "Metadata{additionalProperties=$additionalProperties}" } /** @@ -352,8 +316,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -366,23 +328,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Scores && this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = Objects.hash(additionalProperties) - } - return hashCode - } - - override fun toString() = "Scores{additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -413,6 +358,25 @@ private constructor( fun build(): Scores = Scores(additionalProperties.toUnmodifiable()) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Scores && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = "Scores{additionalProperties=$additionalProperties}" } class Source @@ -428,7 +392,7 @@ private constructor( return true } - return other is Source && this.value == other.value + return /* spotless:off */ other is Source && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -477,4 +441,24 @@ private constructor( fun asString(): String = _value().asStringOrThrow() } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is FeedbackExperimentItem && this.id == other.id && this.scores == other.scores && this.expected == other.expected && this.comment == other.comment && this.metadata == other.metadata && this.source == other.source && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(id, scores, expected, comment, metadata, source, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "FeedbackExperimentItem{id=$id, scores=$scores, expected=$expected, comment=$comment, metadata=$metadata, source=$source, additionalProperties=$additionalProperties}" } diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/FeedbackProjectLogsItem.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/FeedbackProjectLogsItem.kt index becc2347..776bee1a 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/FeedbackProjectLogsItem.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/FeedbackProjectLogsItem.kt @@ -33,8 +33,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - /** * The id of the project logs event to log feedback for. This is the row `id` returned by `POST * /v1/project_logs/{project_id}/insert` @@ -113,40 +111,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is FeedbackProjectLogsItem && - this.id == other.id && - this.scores == other.scores && - this.expected == other.expected && - this.comment == other.comment && - this.metadata == other.metadata && - this.source == other.source && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - id, - scores, - expected, - comment, - metadata, - source, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "FeedbackProjectLogsItem{id=$id, scores=$scores, expected=$expected, comment=$comment, metadata=$metadata, source=$source, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -276,8 +240,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -290,23 +252,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Metadata && this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = Objects.hash(additionalProperties) - } - return hashCode - } - - override fun toString() = "Metadata{additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -337,6 +282,25 @@ private constructor( fun build(): Metadata = Metadata(additionalProperties.toUnmodifiable()) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Metadata && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = "Metadata{additionalProperties=$additionalProperties}" } /** @@ -352,8 +316,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -366,23 +328,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Scores && this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = Objects.hash(additionalProperties) - } - return hashCode - } - - override fun toString() = "Scores{additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -413,6 +358,25 @@ private constructor( fun build(): Scores = Scores(additionalProperties.toUnmodifiable()) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Scores && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = "Scores{additionalProperties=$additionalProperties}" } class Source @@ -428,7 +392,7 @@ private constructor( return true } - return other is Source && this.value == other.value + return /* spotless:off */ other is Source && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -477,4 +441,24 @@ private constructor( fun asString(): String = _value().asStringOrThrow() } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is FeedbackProjectLogsItem && this.id == other.id && this.scores == other.scores && this.expected == other.expected && this.comment == other.comment && this.metadata == other.metadata && this.source == other.source && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(id, scores, expected, comment, metadata, source, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "FeedbackProjectLogsItem{id=$id, scores=$scores, expected=$expected, comment=$comment, metadata=$metadata, source=$source, additionalProperties=$additionalProperties}" } diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/FeedbackResponseSchema.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/FeedbackResponseSchema.kt index a3654dac..a14a83a4 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/FeedbackResponseSchema.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/FeedbackResponseSchema.kt @@ -27,8 +27,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - fun status(): Status = status.getRequired("status") @JsonProperty("status") @ExcludeMissing fun _status() = status @@ -46,26 +44,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is FeedbackResponseSchema && - this.status == other.status && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = Objects.hash(status, additionalProperties) - } - return hashCode - } - - override fun toString() = - "FeedbackResponseSchema{status=$status, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -119,7 +97,7 @@ private constructor( return true } - return other is Status && this.value == other.value + return /* spotless:off */ other is Status && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -156,4 +134,24 @@ private constructor( fun asString(): String = _value().asStringOrThrow() } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is FeedbackResponseSchema && this.status == other.status && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(status, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "FeedbackResponseSchema{status=$status, additionalProperties=$additionalProperties}" } diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/FetchDatasetEventsResponse.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/FetchDatasetEventsResponse.kt index 00a47268..6d3bd511 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/FetchDatasetEventsResponse.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/FetchDatasetEventsResponse.kt @@ -26,8 +26,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - /** A list of fetched events */ fun events(): List = events.getRequired("events") @@ -64,32 +62,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is FetchDatasetEventsResponse && - this.events == other.events && - this.cursor == other.cursor && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - events, - cursor, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "FetchDatasetEventsResponse{events=$events, cursor=$cursor, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -155,4 +127,24 @@ private constructor( additionalProperties.toUnmodifiable(), ) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is FetchDatasetEventsResponse && this.events == other.events && this.cursor == other.cursor && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(events, cursor, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "FetchDatasetEventsResponse{events=$events, cursor=$cursor, additionalProperties=$additionalProperties}" } diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/FetchExperimentEventsResponse.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/FetchExperimentEventsResponse.kt index 318e1c7a..6be52808 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/FetchExperimentEventsResponse.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/FetchExperimentEventsResponse.kt @@ -26,8 +26,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - /** A list of fetched events */ fun events(): List = events.getRequired("events") @@ -64,32 +62,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is FetchExperimentEventsResponse && - this.events == other.events && - this.cursor == other.cursor && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - events, - cursor, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "FetchExperimentEventsResponse{events=$events, cursor=$cursor, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -155,4 +127,24 @@ private constructor( additionalProperties.toUnmodifiable(), ) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is FetchExperimentEventsResponse && this.events == other.events && this.cursor == other.cursor && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(events, cursor, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "FetchExperimentEventsResponse{events=$events, cursor=$cursor, additionalProperties=$additionalProperties}" } diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/FetchProjectLogsEventsResponse.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/FetchProjectLogsEventsResponse.kt index 7c808c80..49bebdf3 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/FetchProjectLogsEventsResponse.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/FetchProjectLogsEventsResponse.kt @@ -26,8 +26,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - /** A list of fetched events */ fun events(): List = events.getRequired("events") @@ -64,32 +62,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is FetchProjectLogsEventsResponse && - this.events == other.events && - this.cursor == other.cursor && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - events, - cursor, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "FetchProjectLogsEventsResponse{events=$events, cursor=$cursor, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -155,4 +127,24 @@ private constructor( additionalProperties.toUnmodifiable(), ) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is FetchProjectLogsEventsResponse && this.events == other.events && this.cursor == other.cursor && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(events, cursor, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "FetchProjectLogsEventsResponse{events=$events, cursor=$cursor, additionalProperties=$additionalProperties}" } diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/Function.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/Function.kt index 54481c03..b81f35c2 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/Function.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/Function.kt @@ -53,8 +53,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - /** Unique identifier for the prompt */ fun id(): String = id.getRequired("id") @@ -185,60 +183,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Function && - this.id == other.id && - this._xactId == other._xactId && - this.projectId == other.projectId && - this.logId == other.logId && - this.orgId == other.orgId && - this.name == other.name && - this.slug == other.slug && - this.description == other.description && - this.created == other.created && - this.promptData == other.promptData && - this.tags == other.tags && - this.metadata == other.metadata && - this.functionType == other.functionType && - this.functionData == other.functionData && - this.origin == other.origin && - this.functionSchema == other.functionSchema && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - id, - _xactId, - projectId, - logId, - orgId, - name, - slug, - description, - created, - promptData, - tags, - metadata, - functionType, - functionData, - origin, - functionSchema, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "Function{id=$id, _xactId=$_xactId, projectId=$projectId, logId=$logId, orgId=$orgId, name=$name, slug=$slug, description=$description, created=$created, promptData=$promptData, tags=$tags, metadata=$metadata, functionType=$functionType, functionData=$functionData, origin=$origin, functionSchema=$functionSchema, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -514,18 +458,11 @@ private constructor( return true } - return other is FunctionData && - this.prompt == other.prompt && - this.code == other.code && - this.global == other.global + return /* spotless:off */ other is FunctionData && this.prompt == other.prompt && this.code == other.code && this.global == other.global /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - prompt, - code, - global, - ) + return /* spotless:off */ Objects.hash(prompt, code, global) /* spotless:on */ } override fun toString(): String { @@ -564,6 +501,7 @@ private constructor( override fun ObjectCodec.deserialize(node: JsonNode): FunctionData { val json = JsonValue.fromJsonNode(node) + tryDeserialize(node, jacksonTypeRef()) { it.validate() } ?.let { return FunctionData(prompt = it, _json = json) @@ -608,8 +546,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - fun type(): Type = type.getRequired("type") @JsonProperty("type") @ExcludeMissing fun _type() = type @@ -627,26 +563,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Prompt && - this.type == other.type && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = Objects.hash(type, additionalProperties) - } - return hashCode - } - - override fun toString() = - "Prompt{type=$type, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -700,7 +616,7 @@ private constructor( return true } - return other is Type && this.value == other.value + return /* spotless:off */ other is Type && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -737,6 +653,26 @@ private constructor( fun asString(): String = _value().asStringOrThrow() } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Prompt && this.type == other.type && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(type, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "Prompt{type=$type, additionalProperties=$additionalProperties}" } @JsonDeserialize(builder = Code.Builder::class) @@ -750,8 +686,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - fun type(): Type = type.getRequired("type") fun data(): Data = data.getRequired("data") @@ -774,32 +708,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Code && - this.type == other.type && - this.data == other.data && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - type, - data, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "Code{type=$type, data=$data, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -901,13 +809,11 @@ private constructor( return true } - return other is Data && - this.bundle == other.bundle && - this.inline == other.inline + return /* spotless:off */ other is Data && this.bundle == other.bundle && this.inline == other.inline /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash(bundle, inline) + return /* spotless:off */ Objects.hash(bundle, inline) /* spotless:on */ } override fun toString(): String { @@ -941,6 +847,7 @@ private constructor( override fun ObjectCodec.deserialize(node: JsonNode): Data { val json = JsonValue.fromJsonNode(node) + tryDeserialize(node, jacksonTypeRef())?.let { return Data(bundle = it, _json = json) } @@ -983,8 +890,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - fun runtimeContext(): CodeBundle.RuntimeContext = runtimeContext.getRequired("runtime_context") @@ -1036,38 +941,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Bundle && - this.runtimeContext == other.runtimeContext && - this.location == other.location && - this.bundleId == other.bundleId && - this.preview == other.preview && - this.type == other.type && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - runtimeContext, - location, - bundleId, - preview, - type, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "Bundle{runtimeContext=$runtimeContext, location=$location, bundleId=$bundleId, preview=$preview, type=$type, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -1175,7 +1048,7 @@ private constructor( return true } - return other is Type && this.value == other.value + return /* spotless:off */ other is Type && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -1212,6 +1085,26 @@ private constructor( fun asString(): String = _value().asStringOrThrow() } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Bundle && this.runtimeContext == other.runtimeContext && this.location == other.location && this.bundleId == other.bundleId && this.preview == other.preview && this.type == other.type && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(runtimeContext, location, bundleId, preview, type, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "Bundle{runtimeContext=$runtimeContext, location=$location, bundleId=$bundleId, preview=$preview, type=$type, additionalProperties=$additionalProperties}" } @JsonDeserialize(builder = Inline.Builder::class) @@ -1226,8 +1119,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - fun type(): Type = type.getRequired("type") fun runtimeContext(): RuntimeContext = @@ -1258,34 +1149,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Inline && - this.type == other.type && - this.runtimeContext == other.runtimeContext && - this.code == other.code && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - type, - runtimeContext, - code, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "Inline{type=$type, runtimeContext=$runtimeContext, code=$code, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -1363,8 +1226,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - fun runtime(): Runtime = runtime.getRequired("runtime") fun version(): String = version.getRequired("version") @@ -1387,32 +1248,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is RuntimeContext && - this.runtime == other.runtime && - this.version == other.version && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - runtime, - version, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "RuntimeContext{runtime=$runtime, version=$version, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -1485,7 +1320,7 @@ private constructor( return true } - return other is Runtime && this.value == other.value + return /* spotless:off */ other is Runtime && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -1531,6 +1366,26 @@ private constructor( fun asString(): String = _value().asStringOrThrow() } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is RuntimeContext && this.runtime == other.runtime && this.version == other.version && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(runtime, version, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "RuntimeContext{runtime=$runtime, version=$version, additionalProperties=$additionalProperties}" } class Type @@ -1547,7 +1402,7 @@ private constructor( return true } - return other is Type && this.value == other.value + return /* spotless:off */ other is Type && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -1584,6 +1439,26 @@ private constructor( fun asString(): String = _value().asStringOrThrow() } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Inline && this.type == other.type && this.runtimeContext == other.runtimeContext && this.code == other.code && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(type, runtimeContext, code, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "Inline{type=$type, runtimeContext=$runtimeContext, code=$code, additionalProperties=$additionalProperties}" } } @@ -1600,7 +1475,7 @@ private constructor( return true } - return other is Type && this.value == other.value + return /* spotless:off */ other is Type && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -1637,6 +1512,26 @@ private constructor( fun asString(): String = _value().asStringOrThrow() } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Code && this.type == other.type && this.data == other.data && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(type, data, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "Code{type=$type, data=$data, additionalProperties=$additionalProperties}" } @JsonDeserialize(builder = Global.Builder::class) @@ -1650,8 +1545,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - fun type(): Type = type.getRequired("type") fun name(): String = name.getRequired("name") @@ -1674,32 +1567,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Global && - this.type == other.type && - this.name == other.name && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - type, - name, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "Global{type=$type, name=$name, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -1766,7 +1633,7 @@ private constructor( return true } - return other is Type && this.value == other.value + return /* spotless:off */ other is Type && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -1803,6 +1670,26 @@ private constructor( fun asString(): String = _value().asStringOrThrow() } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Global && this.type == other.type && this.name == other.name && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(type, name, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "Global{type=$type, name=$name, additionalProperties=$additionalProperties}" } } @@ -1819,7 +1706,7 @@ private constructor( return true } - return other is LogId && this.value == other.value + return /* spotless:off */ other is LogId && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -1869,8 +1756,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - fun parameters(): JsonValue = parameters fun returns(): JsonValue = returns @@ -1893,32 +1778,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is FunctionSchema && - this.parameters == other.parameters && - this.returns == other.returns && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - parameters, - returns, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "FunctionSchema{parameters=$parameters, returns=$returns, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -1966,6 +1825,26 @@ private constructor( additionalProperties.toUnmodifiable(), ) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is FunctionSchema && this.parameters == other.parameters && this.returns == other.returns && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(parameters, returns, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "FunctionSchema{parameters=$parameters, returns=$returns, additionalProperties=$additionalProperties}" } class FunctionType @@ -1981,7 +1860,7 @@ private constructor( return true } - return other is FunctionType && this.value == other.value + return /* spotless:off */ other is FunctionType && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -2047,8 +1926,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -2061,23 +1938,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Metadata && this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = Objects.hash(additionalProperties) - } - return hashCode - } - - override fun toString() = "Metadata{additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -2108,6 +1968,25 @@ private constructor( fun build(): Metadata = Metadata(additionalProperties.toUnmodifiable()) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Metadata && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = "Metadata{additionalProperties=$additionalProperties}" } @JsonDeserialize(builder = Origin.Builder::class) @@ -2122,8 +2001,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - /** The object type that the ACL applies to */ fun objectType(): ObjectType = objectType.getRequired("object_type") @@ -2163,34 +2040,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Origin && - this.objectType == other.objectType && - this.objectId == other.objectId && - this.internal_ == other.internal_ && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - objectType, - objectId, - internal_, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "Origin{objectType=$objectType, objectId=$objectId, internal_=$internal_, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -2279,7 +2128,7 @@ private constructor( return true } - return other is ObjectType && this.value == other.value + return /* spotless:off */ other is ObjectType && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -2376,5 +2225,45 @@ private constructor( fun asString(): String = _value().asStringOrThrow() } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Origin && this.objectType == other.objectType && this.objectId == other.objectId && this.internal_ == other.internal_ && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(objectType, objectId, internal_, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "Origin{objectType=$objectType, objectId=$objectId, internal_=$internal_, additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Function && this.id == other.id && this._xactId == other._xactId && this.projectId == other.projectId && this.logId == other.logId && this.orgId == other.orgId && this.name == other.name && this.slug == other.slug && this.description == other.description && this.created == other.created && this.promptData == other.promptData && this.tags == other.tags && this.metadata == other.metadata && this.functionType == other.functionType && this.functionData == other.functionData && this.origin == other.origin && this.functionSchema == other.functionSchema && this.additionalProperties == other.additionalProperties /* spotless:on */ } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(id, _xactId, projectId, logId, orgId, name, slug, description, created, promptData, tags, metadata, functionType, functionData, origin, functionSchema, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "Function{id=$id, _xactId=$_xactId, projectId=$projectId, logId=$logId, orgId=$orgId, name=$name, slug=$slug, description=$description, created=$created, promptData=$promptData, tags=$tags, metadata=$metadata, functionType=$functionType, functionData=$functionData, origin=$origin, functionSchema=$functionSchema, additionalProperties=$additionalProperties}" } diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/FunctionCreateParams.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/FunctionCreateParams.kt index 54997996..178000dd 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/FunctionCreateParams.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/FunctionCreateParams.kt @@ -103,8 +103,6 @@ constructor( private val additionalProperties: Map, ) { - private var hashCode: Int = 0 - @JsonProperty("function_data") fun functionData(): FunctionData? = functionData /** Name of the prompt */ @@ -138,48 +136,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is FunctionCreateBody && - this.functionData == other.functionData && - this.name == other.name && - this.projectId == other.projectId && - this.slug == other.slug && - this.description == other.description && - this.functionSchema == other.functionSchema && - this.functionType == other.functionType && - this.origin == other.origin && - this.promptData == other.promptData && - this.tags == other.tags && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - functionData, - name, - projectId, - slug, - description, - functionSchema, - functionType, - origin, - promptData, - tags, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "FunctionCreateBody{functionData=$functionData, name=$name, projectId=$projectId, slug=$slug, description=$description, functionSchema=$functionSchema, functionType=$functionType, origin=$origin, promptData=$promptData, tags=$tags, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -282,6 +238,26 @@ constructor( additionalProperties.toUnmodifiable(), ) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is FunctionCreateBody && this.functionData == other.functionData && this.name == other.name && this.projectId == other.projectId && this.slug == other.slug && this.description == other.description && this.functionSchema == other.functionSchema && this.functionType == other.functionType && this.origin == other.origin && this.promptData == other.promptData && this.tags == other.tags && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(functionData, name, projectId, slug, description, functionSchema, functionType, origin, promptData, tags, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "FunctionCreateBody{functionData=$functionData, name=$name, projectId=$projectId, slug=$slug, description=$description, functionSchema=$functionSchema, functionType=$functionType, origin=$origin, promptData=$promptData, tags=$tags, additionalProperties=$additionalProperties}" } fun _additionalQueryParams(): Map> = additionalQueryParams @@ -295,38 +271,11 @@ constructor( return true } - return other is FunctionCreateParams && - this.functionData == other.functionData && - this.name == other.name && - this.projectId == other.projectId && - this.slug == other.slug && - this.description == other.description && - this.functionSchema == other.functionSchema && - this.functionType == other.functionType && - this.origin == other.origin && - this.promptData == other.promptData && - this.tags == other.tags && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders && - this.additionalBodyProperties == other.additionalBodyProperties + return /* spotless:off */ other is FunctionCreateParams && this.functionData == other.functionData && this.name == other.name && this.projectId == other.projectId && this.slug == other.slug && this.description == other.description && this.functionSchema == other.functionSchema && this.functionType == other.functionType && this.origin == other.origin && this.promptData == other.promptData && this.tags == other.tags && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders && this.additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - functionData, - name, - projectId, - slug, - description, - functionSchema, - functionType, - origin, - promptData, - tags, - additionalQueryParams, - additionalHeaders, - additionalBodyProperties, - ) + return /* spotless:off */ Objects.hash(functionData, name, projectId, slug, description, functionSchema, functionType, origin, promptData, tags, additionalQueryParams, additionalHeaders, additionalBodyProperties) /* spotless:on */ } override fun toString() = @@ -550,18 +499,11 @@ constructor( return true } - return other is FunctionData && - this.prompt == other.prompt && - this.code == other.code && - this.global == other.global + return /* spotless:off */ other is FunctionData && this.prompt == other.prompt && this.code == other.code && this.global == other.global /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - prompt, - code, - global, - ) + return /* spotless:off */ Objects.hash(prompt, code, global) /* spotless:on */ } override fun toString(): String { @@ -600,6 +542,7 @@ constructor( override fun ObjectCodec.deserialize(node: JsonNode): FunctionData { val json = JsonValue.fromJsonNode(node) + tryDeserialize(node, jacksonTypeRef()) { it.validate() } ?.let { return FunctionData(prompt = it, _json = json) @@ -644,8 +587,6 @@ constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - fun type(): Type = type.getRequired("type") @JsonProperty("type") @ExcludeMissing fun _type() = type @@ -663,26 +604,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Prompt && - this.type == other.type && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = Objects.hash(type, additionalProperties) - } - return hashCode - } - - override fun toString() = - "Prompt{type=$type, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -736,7 +657,7 @@ constructor( return true } - return other is Type && this.value == other.value + return /* spotless:off */ other is Type && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -773,6 +694,26 @@ constructor( fun asString(): String = _value().asStringOrThrow() } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Prompt && this.type == other.type && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(type, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "Prompt{type=$type, additionalProperties=$additionalProperties}" } @JsonDeserialize(builder = Code.Builder::class) @@ -786,8 +727,6 @@ constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - fun type(): Type = type.getRequired("type") fun data(): Data = data.getRequired("data") @@ -810,32 +749,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Code && - this.type == other.type && - this.data == other.data && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - type, - data, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "Code{type=$type, data=$data, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -937,13 +850,11 @@ constructor( return true } - return other is Data && - this.bundle == other.bundle && - this.inline == other.inline + return /* spotless:off */ other is Data && this.bundle == other.bundle && this.inline == other.inline /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash(bundle, inline) + return /* spotless:off */ Objects.hash(bundle, inline) /* spotless:on */ } override fun toString(): String { @@ -977,6 +888,7 @@ constructor( override fun ObjectCodec.deserialize(node: JsonNode): Data { val json = JsonValue.fromJsonNode(node) + tryDeserialize(node, jacksonTypeRef())?.let { return Data(bundle = it, _json = json) } @@ -1019,8 +931,6 @@ constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - fun runtimeContext(): RuntimeContext = runtimeContext.getRequired("runtime_context") @@ -1072,38 +982,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Bundle && - this.runtimeContext == other.runtimeContext && - this.location == other.location && - this.bundleId == other.bundleId && - this.preview == other.preview && - this.type == other.type && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - runtimeContext, - location, - bundleId, - preview, - type, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "Bundle{runtimeContext=$runtimeContext, location=$location, bundleId=$bundleId, preview=$preview, type=$type, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -1208,7 +1086,7 @@ constructor( return true } - return other is Type && this.value == other.value + return /* spotless:off */ other is Type && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -1245,6 +1123,26 @@ constructor( fun asString(): String = _value().asStringOrThrow() } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Bundle && this.runtimeContext == other.runtimeContext && this.location == other.location && this.bundleId == other.bundleId && this.preview == other.preview && this.type == other.type && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(runtimeContext, location, bundleId, preview, type, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "Bundle{runtimeContext=$runtimeContext, location=$location, bundleId=$bundleId, preview=$preview, type=$type, additionalProperties=$additionalProperties}" } @JsonDeserialize(builder = Inline.Builder::class) @@ -1259,8 +1157,6 @@ constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - fun type(): Type = type.getRequired("type") fun runtimeContext(): RuntimeContext = @@ -1291,34 +1187,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Inline && - this.type == other.type && - this.runtimeContext == other.runtimeContext && - this.code == other.code && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - type, - runtimeContext, - code, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "Inline{type=$type, runtimeContext=$runtimeContext, code=$code, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -1396,8 +1264,6 @@ constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - fun runtime(): Runtime = runtime.getRequired("runtime") fun version(): String = version.getRequired("version") @@ -1420,32 +1286,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is RuntimeContext && - this.runtime == other.runtime && - this.version == other.version && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - runtime, - version, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "RuntimeContext{runtime=$runtime, version=$version, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -1518,7 +1358,7 @@ constructor( return true } - return other is Runtime && this.value == other.value + return /* spotless:off */ other is Runtime && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -1564,6 +1404,26 @@ constructor( fun asString(): String = _value().asStringOrThrow() } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is RuntimeContext && this.runtime == other.runtime && this.version == other.version && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(runtime, version, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "RuntimeContext{runtime=$runtime, version=$version, additionalProperties=$additionalProperties}" } class Type @@ -1580,7 +1440,7 @@ constructor( return true } - return other is Type && this.value == other.value + return /* spotless:off */ other is Type && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -1617,6 +1477,26 @@ constructor( fun asString(): String = _value().asStringOrThrow() } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Inline && this.type == other.type && this.runtimeContext == other.runtimeContext && this.code == other.code && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(type, runtimeContext, code, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "Inline{type=$type, runtimeContext=$runtimeContext, code=$code, additionalProperties=$additionalProperties}" } } @@ -1633,7 +1513,7 @@ constructor( return true } - return other is Type && this.value == other.value + return /* spotless:off */ other is Type && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -1670,6 +1550,26 @@ constructor( fun asString(): String = _value().asStringOrThrow() } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Code && this.type == other.type && this.data == other.data && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(type, data, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "Code{type=$type, data=$data, additionalProperties=$additionalProperties}" } @JsonDeserialize(builder = Global.Builder::class) @@ -1683,8 +1583,6 @@ constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - fun type(): Type = type.getRequired("type") fun name(): String = name.getRequired("name") @@ -1707,32 +1605,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Global && - this.type == other.type && - this.name == other.name && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - type, - name, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "Global{type=$type, name=$name, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -1799,7 +1671,7 @@ constructor( return true } - return other is Type && this.value == other.value + return /* spotless:off */ other is Type && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -1836,6 +1708,26 @@ constructor( fun asString(): String = _value().asStringOrThrow() } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Global && this.type == other.type && this.name == other.name && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(type, name, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "Global{type=$type, name=$name, additionalProperties=$additionalProperties}" } } @@ -1849,8 +1741,6 @@ constructor( private val additionalProperties: Map, ) { - private var hashCode: Int = 0 - @JsonProperty("parameters") fun parameters(): JsonValue? = parameters @JsonProperty("returns") fun returns(): JsonValue? = returns @@ -1861,32 +1751,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is FunctionSchema && - this.parameters == other.parameters && - this.returns == other.returns && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - parameters, - returns, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "FunctionSchema{parameters=$parameters, returns=$returns, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -1932,6 +1796,26 @@ constructor( additionalProperties.toUnmodifiable(), ) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is FunctionSchema && this.parameters == other.parameters && this.returns == other.returns && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(parameters, returns, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "FunctionSchema{parameters=$parameters, returns=$returns, additionalProperties=$additionalProperties}" } class FunctionType @@ -1947,7 +1831,7 @@ constructor( return true } - return other is FunctionType && this.value == other.value + return /* spotless:off */ other is FunctionType && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -2013,8 +1897,6 @@ constructor( private val additionalProperties: Map, ) { - private var hashCode: Int = 0 - /** The object type that the ACL applies to */ @JsonProperty("object_type") fun objectType(): ObjectType? = objectType @@ -2033,34 +1915,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Origin && - this.objectType == other.objectType && - this.objectId == other.objectId && - this.internal_ == other.internal_ && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - objectType, - objectId, - internal_, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "Origin{objectType=$objectType, objectId=$objectId, internal_=$internal_, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -2132,7 +1986,7 @@ constructor( return true } - return other is ObjectType && this.value == other.value + return /* spotless:off */ other is ObjectType && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -2229,5 +2083,25 @@ constructor( fun asString(): String = _value().asStringOrThrow() } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Origin && this.objectType == other.objectType && this.objectId == other.objectId && this.internal_ == other.internal_ && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(objectType, objectId, internal_, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "Origin{objectType=$objectType, objectId=$objectId, internal_=$internal_, additionalProperties=$additionalProperties}" } } diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/FunctionDeleteParams.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/FunctionDeleteParams.kt index 3c433643..bbadeeff 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/FunctionDeleteParams.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/FunctionDeleteParams.kt @@ -46,20 +46,11 @@ constructor( return true } - return other is FunctionDeleteParams && - this.functionId == other.functionId && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders && - this.additionalBodyProperties == other.additionalBodyProperties + return /* spotless:off */ other is FunctionDeleteParams && this.functionId == other.functionId && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders && this.additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - functionId, - additionalQueryParams, - additionalHeaders, - additionalBodyProperties, - ) + return /* spotless:off */ Objects.hash(functionId, additionalQueryParams, additionalHeaders, additionalBodyProperties) /* spotless:on */ } override fun toString() = diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/FunctionInvokeParams.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/FunctionInvokeParams.kt index cc968e6e..1e78cd12 100644 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/FunctionInvokeParams.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/FunctionInvokeParams.kt @@ -94,8 +94,6 @@ constructor( private val additionalProperties: Map, ) { - private var hashCode: Int = 0 - /** Argument to the function, which can be any JSON serializable value */ @JsonProperty("input") fun input(): JsonValue? = input @@ -123,40 +121,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is FunctionInvokeBody && - this.input == other.input && - this.messages == other.messages && - this.mode == other.mode && - this.parent == other.parent && - this.stream == other.stream && - this.version == other.version && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - input, - messages, - mode, - parent, - stream, - version, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "FunctionInvokeBody{input=$input, messages=$messages, mode=$mode, parent=$parent, stream=$stream, version=$version, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -230,6 +194,26 @@ constructor( additionalProperties.toUnmodifiable(), ) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is FunctionInvokeBody && this.input == other.input && this.messages == other.messages && this.mode == other.mode && this.parent == other.parent && this.stream == other.stream && this.version == other.version && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(input, messages, mode, parent, stream, version, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "FunctionInvokeBody{input=$input, messages=$messages, mode=$mode, parent=$parent, stream=$stream, version=$version, additionalProperties=$additionalProperties}" } fun _additionalQueryParams(): Map> = additionalQueryParams @@ -243,32 +227,11 @@ constructor( return true } - return other is FunctionInvokeParams && - this.functionId == other.functionId && - this.input == other.input && - this.messages == other.messages && - this.mode == other.mode && - this.parent == other.parent && - this.stream == other.stream && - this.version == other.version && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders && - this.additionalBodyProperties == other.additionalBodyProperties + return /* spotless:off */ other is FunctionInvokeParams && this.functionId == other.functionId && this.input == other.input && this.messages == other.messages && this.mode == other.mode && this.parent == other.parent && this.stream == other.stream && this.version == other.version && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders && this.additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - functionId, - input, - messages, - mode, - parent, - stream, - version, - additionalQueryParams, - additionalHeaders, - additionalBodyProperties, - ) + return /* spotless:off */ Objects.hash(functionId, input, messages, mode, parent, stream, version, additionalQueryParams, additionalHeaders, additionalBodyProperties) /* spotless:on */ } override fun toString() = @@ -508,24 +471,11 @@ constructor( return true } - return other is Message && - this.system == other.system && - this.user == other.user && - this.assistant == other.assistant && - this.tool == other.tool && - this.function == other.function && - this.fallback == other.fallback + return /* spotless:off */ other is Message && this.system == other.system && this.user == other.user && this.assistant == other.assistant && this.tool == other.tool && this.function == other.function && this.fallback == other.fallback /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - system, - user, - assistant, - tool, - function, - fallback, - ) + return /* spotless:off */ Objects.hash(system, user, assistant, tool, function, fallback) /* spotless:on */ } override fun toString(): String { @@ -579,6 +529,7 @@ constructor( override fun ObjectCodec.deserialize(node: JsonNode): Message { val json = JsonValue.fromJsonNode(node) + tryDeserialize(node, jacksonTypeRef()) { it.validate() } ?.let { return Message(system = it, _json = json) @@ -640,8 +591,6 @@ constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - fun content(): Optional = Optional.ofNullable(content.getNullable("content")) fun role(): Role = role.getRequired("role") @@ -669,34 +618,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is System && - this.content == other.content && - this.role == other.role && - this.name == other.name && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - content, - role, - name, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "System{content=$content, role=$role, name=$name, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -772,7 +693,7 @@ constructor( return true } - return other is Role && this.value == other.value + return /* spotless:off */ other is Role && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -809,6 +730,26 @@ constructor( fun asString(): String = _value().asStringOrThrow() } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is System && this.content == other.content && this.role == other.role && this.name == other.name && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(content, role, name, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "System{content=$content, role=$role, name=$name, additionalProperties=$additionalProperties}" } @JsonDeserialize(builder = User.Builder::class) @@ -823,8 +764,6 @@ constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - fun content(): Optional = Optional.ofNullable(content.getNullable("content")) fun role(): Role = role.getRequired("role") @@ -852,34 +791,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is User && - this.content == other.content && - this.role == other.role && - this.name == other.name && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - content, - role, - name, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "User{content=$content, role=$role, name=$name, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -955,7 +866,7 @@ constructor( return true } - return other is Role && this.value == other.value + return /* spotless:off */ other is Role && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -997,41 +908,38 @@ constructor( @JsonSerialize(using = Content.Serializer::class) class Content private constructor( - private val string: String? = null, - private val chatCompletionContentParts: List? = null, + private val text: String? = null, + private val array: List? = null, private val _json: JsonValue? = null, ) { private var validated: Boolean = false - fun string(): Optional = Optional.ofNullable(string) + fun text(): Optional = Optional.ofNullable(text) - fun chatCompletionContentParts(): Optional> = - Optional.ofNullable(chatCompletionContentParts) + fun array(): Optional> = Optional.ofNullable(array) - fun isString(): Boolean = string != null + fun isText(): Boolean = text != null - fun isChatCompletionContentParts(): Boolean = chatCompletionContentParts != null + fun isArray(): Boolean = array != null - fun asString(): String = string.getOrThrow("string") + fun asText(): String = text.getOrThrow("text") - fun asChatCompletionContentParts(): List = - chatCompletionContentParts.getOrThrow("chatCompletionContentParts") + fun asArray(): List = array.getOrThrow("array") fun _json(): Optional = Optional.ofNullable(_json) fun accept(visitor: Visitor): T { return when { - string != null -> visitor.visitString(string) - chatCompletionContentParts != null -> - visitor.visitChatCompletionContentParts(chatCompletionContentParts) + text != null -> visitor.visitText(text) + array != null -> visitor.visitArray(array) else -> visitor.unknown(_json) } } fun validate(): Content = apply { if (!validated) { - if (string == null && chatCompletionContentParts == null) { + if (text == null && array == null) { throw BraintrustInvalidDataException("Unknown Content: $_json") } validated = true @@ -1043,20 +951,17 @@ constructor( return true } - return other is Content && - this.string == other.string && - this.chatCompletionContentParts == other.chatCompletionContentParts + return /* spotless:off */ other is Content && this.text == other.text && this.array == other.array /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash(string, chatCompletionContentParts) + return /* spotless:off */ Objects.hash(text, array) /* spotless:on */ } override fun toString(): String { return when { - string != null -> "Content{string=$string}" - chatCompletionContentParts != null -> - "Content{chatCompletionContentParts=$chatCompletionContentParts}" + text != null -> "Content{text=$text}" + array != null -> "Content{array=$array}" _json != null -> "Content{_unknown=$_json}" else -> throw IllegalStateException("Invalid Content") } @@ -1064,21 +969,17 @@ constructor( companion object { - @JvmStatic fun ofString(string: String) = Content(string = string) + @JvmStatic fun ofText(text: String) = Content(text = text) @JvmStatic - fun ofChatCompletionContentParts( - chatCompletionContentParts: List - ) = Content(chatCompletionContentParts = chatCompletionContentParts) + fun ofArray(array: List) = Content(array = array) } interface Visitor { - fun visitString(string: String): T + fun visitText(text: String): T - fun visitChatCompletionContentParts( - chatCompletionContentParts: List - ): T + fun visitArray(array: List): T fun unknown(json: JsonValue?): T { throw BraintrustInvalidDataException("Unknown Content: $json") @@ -1089,12 +990,13 @@ constructor( override fun ObjectCodec.deserialize(node: JsonNode): Content { val json = JsonValue.fromJsonNode(node) + tryDeserialize(node, jacksonTypeRef())?.let { - return Content(string = it, _json = json) + return Content(text = it, _json = json) } tryDeserialize(node, jacksonTypeRef>()) ?.let { - return Content(chatCompletionContentParts = it, _json = json) + return Content(array = it, _json = json) } return Content(_json = json) @@ -1109,9 +1011,8 @@ constructor( provider: SerializerProvider ) { when { - value.string != null -> generator.writeObject(value.string) - value.chatCompletionContentParts != null -> - generator.writeObject(value.chatCompletionContentParts) + value.text != null -> generator.writeObject(value.text) + value.array != null -> generator.writeObject(value.array) value._json != null -> generator.writeObject(value._json) else -> throw IllegalStateException("Invalid Content") } @@ -1186,18 +1087,11 @@ constructor( return true } - return other is ChatCompletionContentPart && - this.chatCompletionContentPartText == - other.chatCompletionContentPartText && - this.chatCompletionContentPartImage == - other.chatCompletionContentPartImage + return /* spotless:off */ other is ChatCompletionContentPart && this.chatCompletionContentPartText == other.chatCompletionContentPartText && this.chatCompletionContentPartImage == other.chatCompletionContentPartImage /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - chatCompletionContentPartText, - chatCompletionContentPartImage - ) + return /* spotless:off */ Objects.hash(chatCompletionContentPartText, chatCompletionContentPartImage) /* spotless:on */ } override fun toString(): String { @@ -1256,6 +1150,7 @@ constructor( node: JsonNode ): ChatCompletionContentPart { val json = JsonValue.fromJsonNode(node) + tryDeserialize(node, jacksonTypeRef()) { it.validate() } @@ -1302,6 +1197,26 @@ constructor( } } } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is User && this.content == other.content && this.role == other.role && this.name == other.name && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(content, role, name, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "User{content=$content, role=$role, name=$name, additionalProperties=$additionalProperties}" } @JsonDeserialize(builder = Assistant.Builder::class) @@ -1318,8 +1233,6 @@ constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - fun role(): Role = role.getRequired("role") fun content(): Optional = Optional.ofNullable(content.getNullable("content")) @@ -1359,38 +1272,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Assistant && - this.role == other.role && - this.content == other.content && - this.functionCall == other.functionCall && - this.name == other.name && - this.toolCalls == other.toolCalls && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - role, - content, - functionCall, - name, - toolCalls, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "Assistant{role=$role, content=$content, functionCall=$functionCall, name=$name, toolCalls=$toolCalls, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -1491,7 +1372,7 @@ constructor( return true } - return other is Role && this.value == other.value + return /* spotless:off */ other is Role && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -1540,8 +1421,6 @@ constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - fun arguments(): String = arguments.getRequired("arguments") fun name(): String = name.getRequired("name") @@ -1564,32 +1443,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is FunctionCall && - this.arguments == other.arguments && - this.name == other.name && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - arguments, - name, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "FunctionCall{arguments=$arguments, name=$name, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -1644,7 +1497,47 @@ constructor( additionalProperties.toUnmodifiable(), ) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is FunctionCall && this.arguments == other.arguments && this.name == other.name && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(arguments, name, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "FunctionCall{arguments=$arguments, name=$name, additionalProperties=$additionalProperties}" } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Assistant && this.role == other.role && this.content == other.content && this.functionCall == other.functionCall && this.name == other.name && this.toolCalls == other.toolCalls && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(role, content, functionCall, name, toolCalls, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "Assistant{role=$role, content=$content, functionCall=$functionCall, name=$name, toolCalls=$toolCalls, additionalProperties=$additionalProperties}" } @JsonDeserialize(builder = Tool.Builder::class) @@ -1659,8 +1552,6 @@ constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - fun content(): Optional = Optional.ofNullable(content.getNullable("content")) fun role(): Role = role.getRequired("role") @@ -1689,34 +1580,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Tool && - this.content == other.content && - this.role == other.role && - this.toolCallId == other.toolCallId && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - content, - role, - toolCallId, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "Tool{content=$content, role=$role, toolCallId=$toolCallId, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -1794,7 +1657,7 @@ constructor( return true } - return other is Role && this.value == other.value + return /* spotless:off */ other is Role && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -1831,6 +1694,26 @@ constructor( fun asString(): String = _value().asStringOrThrow() } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Tool && this.content == other.content && this.role == other.role && this.toolCallId == other.toolCallId && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(content, role, toolCallId, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "Tool{content=$content, role=$role, toolCallId=$toolCallId, additionalProperties=$additionalProperties}" } @JsonDeserialize(builder = Function.Builder::class) @@ -1845,8 +1728,6 @@ constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - fun content(): Optional = Optional.ofNullable(content.getNullable("content")) fun name(): String = name.getRequired("name") @@ -1874,34 +1755,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Function && - this.content == other.content && - this.name == other.name && - this.role == other.role && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - content, - name, - role, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "Function{content=$content, name=$name, role=$role, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -1977,7 +1830,7 @@ constructor( return true } - return other is Role && this.value == other.value + return /* spotless:off */ other is Role && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -2014,6 +1867,26 @@ constructor( fun asString(): String = _value().asStringOrThrow() } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Function && this.content == other.content && this.name == other.name && this.role == other.role && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(content, name, role, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "Function{content=$content, name=$name, role=$role, additionalProperties=$additionalProperties}" } @JsonDeserialize(builder = Fallback.Builder::class) @@ -2027,8 +1900,6 @@ constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - fun role(): Role = role.getRequired("role") fun content(): Optional = Optional.ofNullable(content.getNullable("content")) @@ -2051,32 +1922,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Fallback && - this.role == other.role && - this.content == other.content && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - role, - content, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "Fallback{role=$role, content=$content, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -2143,7 +1988,7 @@ constructor( return true } - return other is Role && this.value == other.value + return /* spotless:off */ other is Role && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -2180,6 +2025,26 @@ constructor( fun asString(): String = _value().asStringOrThrow() } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Fallback && this.role == other.role && this.content == other.content && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(role, content, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "Fallback{role=$role, content=$content, additionalProperties=$additionalProperties}" } } @@ -2196,7 +2061,7 @@ constructor( return true } - return other is Mode && this.value == other.value + return /* spotless:off */ other is Mode && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -2289,13 +2154,11 @@ constructor( return true } - return other is Parent && - this.spanParentStruct == other.spanParentStruct && - this.string == other.string + return /* spotless:off */ other is Parent && this.spanParentStruct == other.spanParentStruct && this.string == other.string /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash(spanParentStruct, string) + return /* spotless:off */ Objects.hash(spanParentStruct, string) /* spotless:on */ } override fun toString(): String { @@ -2331,6 +2194,7 @@ constructor( override fun ObjectCodec.deserialize(node: JsonNode): Parent { val json = JsonValue.fromJsonNode(node) + tryDeserialize(node, jacksonTypeRef()) { it.validate() } ?.let { return Parent(spanParentStruct = it, _json = json) @@ -2373,8 +2237,6 @@ constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - fun objectType(): ObjectType = objectType.getRequired("object_type") /** The id of the container object you are logging to */ @@ -2416,36 +2278,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is SpanParentStruct && - this.objectType == other.objectType && - this.objectId == other.objectId && - this.rowIds == other.rowIds && - this.propagatedEvent == other.propagatedEvent && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - objectType, - objectId, - rowIds, - propagatedEvent, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "SpanParentStruct{objectType=$objectType, objectId=$objectId, rowIds=$rowIds, propagatedEvent=$propagatedEvent, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -2541,7 +2373,7 @@ constructor( return true } - return other is ObjectType && this.value == other.value + return /* spotless:off */ other is ObjectType && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -2595,8 +2427,6 @@ constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -2609,25 +2439,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is PropagatedEvent && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = Objects.hash(additionalProperties) - } - return hashCode - } - - override fun toString() = - "PropagatedEvent{additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -2660,6 +2471,26 @@ constructor( fun build(): PropagatedEvent = PropagatedEvent(additionalProperties.toUnmodifiable()) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is PropagatedEvent && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "PropagatedEvent{additionalProperties=$additionalProperties}" } /** Identifiers for the row to to log a subspan under */ @@ -2675,8 +2506,6 @@ constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - /** The id of the row */ fun id(): String = id.getRequired("id") @@ -2710,34 +2539,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is RowIds && - this.id == other.id && - this.spanId == other.spanId && - this.rootSpanId == other.rootSpanId && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - id, - spanId, - rootSpanId, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "RowIds{id=$id, spanId=$spanId, rootSpanId=$rootSpanId, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -2807,7 +2608,47 @@ constructor( additionalProperties.toUnmodifiable(), ) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is RowIds && this.id == other.id && this.spanId == other.spanId && this.rootSpanId == other.rootSpanId && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(id, spanId, rootSpanId, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "RowIds{id=$id, spanId=$spanId, rootSpanId=$rootSpanId, additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is SpanParentStruct && this.objectType == other.objectType && this.objectId == other.objectId && this.rowIds == other.rowIds && this.propagatedEvent == other.propagatedEvent && this.additionalProperties == other.additionalProperties /* spotless:on */ } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(objectType, objectId, rowIds, propagatedEvent, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "SpanParentStruct{objectType=$objectType, objectId=$objectId, rowIds=$rowIds, propagatedEvent=$propagatedEvent, additionalProperties=$additionalProperties}" } } } diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/FunctionInvokeResponse.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/FunctionInvokeResponse.kt index 4d510eb4..da7f8dd4 100644 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/FunctionInvokeResponse.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/FunctionInvokeResponse.kt @@ -20,8 +20,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -34,24 +32,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is FunctionInvokeResponse && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = Objects.hash(additionalProperties) - } - return hashCode - } - - override fun toString() = "FunctionInvokeResponse{additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -83,4 +63,23 @@ private constructor( fun build(): FunctionInvokeResponse = FunctionInvokeResponse(additionalProperties.toUnmodifiable()) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is FunctionInvokeResponse && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = "FunctionInvokeResponse{additionalProperties=$additionalProperties}" } diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/FunctionListPage.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/FunctionListPage.kt index 9b9e1cac..cd1d3a44 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/FunctionListPage.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/FunctionListPage.kt @@ -34,18 +34,11 @@ private constructor( return true } - return other is FunctionListPage && - this.functionsService == other.functionsService && - this.params == other.params && - this.response == other.response + return /* spotless:off */ other is FunctionListPage && this.functionsService == other.functionsService && this.params == other.params && this.response == other.response /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - functionsService, - params, - response, - ) + return /* spotless:off */ Objects.hash(functionsService, params, response) /* spotless:on */ } override fun toString() = @@ -127,13 +120,11 @@ private constructor( return true } - return other is Response && - this.objects == other.objects && - this.additionalProperties == other.additionalProperties + return /* spotless:off */ other is Response && this.objects == other.objects && this.additionalProperties == other.additionalProperties /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash(objects, additionalProperties) + return /* spotless:off */ Objects.hash(objects, additionalProperties) /* spotless:on */ } override fun toString() = diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/FunctionListPageAsync.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/FunctionListPageAsync.kt index 9daf7ae8..ba488e94 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/FunctionListPageAsync.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/FunctionListPageAsync.kt @@ -35,18 +35,11 @@ private constructor( return true } - return other is FunctionListPageAsync && - this.functionsService == other.functionsService && - this.params == other.params && - this.response == other.response + return /* spotless:off */ other is FunctionListPageAsync && this.functionsService == other.functionsService && this.params == other.params && this.response == other.response /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - functionsService, - params, - response, - ) + return /* spotless:off */ Objects.hash(functionsService, params, response) /* spotless:on */ } override fun toString() = @@ -134,13 +127,11 @@ private constructor( return true } - return other is Response && - this.objects == other.objects && - this.additionalProperties == other.additionalProperties + return /* spotless:off */ other is Response && this.objects == other.objects && this.additionalProperties == other.additionalProperties /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash(objects, additionalProperties) + return /* spotless:off */ Objects.hash(objects, additionalProperties) /* spotless:on */ } override fun toString() = diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/FunctionListParams.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/FunctionListParams.kt index 624cd773..20350b57 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/FunctionListParams.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/FunctionListParams.kt @@ -84,36 +84,11 @@ constructor( return true } - return other is FunctionListParams && - this.endingBefore == other.endingBefore && - this.functionName == other.functionName && - this.ids == other.ids && - this.limit == other.limit && - this.orgName == other.orgName && - this.projectId == other.projectId && - this.projectName == other.projectName && - this.slug == other.slug && - this.startingAfter == other.startingAfter && - this.version == other.version && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders + return /* spotless:off */ other is FunctionListParams && this.endingBefore == other.endingBefore && this.functionName == other.functionName && this.ids == other.ids && this.limit == other.limit && this.orgName == other.orgName && this.projectId == other.projectId && this.projectName == other.projectName && this.slug == other.slug && this.startingAfter == other.startingAfter && this.version == other.version && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - endingBefore, - functionName, - ids, - limit, - orgName, - projectId, - projectName, - slug, - startingAfter, - version, - additionalQueryParams, - additionalHeaders, - ) + return /* spotless:off */ Objects.hash(endingBefore, functionName, ids, limit, orgName, projectId, projectName, slug, startingAfter, version, additionalQueryParams, additionalHeaders) /* spotless:on */ } override fun toString() = @@ -186,7 +161,7 @@ constructor( * Filter search results to a particular set of object IDs. To specify a list of IDs, * include the query param multiple times */ - fun ids(strings: List) = apply { this.ids = Ids.ofStrings(strings) } + fun idsOfStrings(strings: List) = apply { this.ids = Ids.ofStrings(strings) } /** Limit the number of objects to return */ fun limit(limit: Long) = apply { this.limit = limit } @@ -324,11 +299,11 @@ constructor( return true } - return other is Ids && this.string == other.string && this.strings == other.strings + return /* spotless:off */ other is Ids && this.string == other.string && this.strings == other.strings /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash(string, strings) + return /* spotless:off */ Objects.hash(string, strings) /* spotless:on */ } override fun toString(): String { @@ -362,6 +337,7 @@ constructor( override fun ObjectCodec.deserialize(node: JsonNode): Ids { val json = JsonValue.fromJsonNode(node) + tryDeserialize(node, jacksonTypeRef())?.let { return Ids(string = it, _json = json) } diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/FunctionReplaceParams.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/FunctionReplaceParams.kt index f7ef61af..37051a80 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/FunctionReplaceParams.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/FunctionReplaceParams.kt @@ -103,8 +103,6 @@ constructor( private val additionalProperties: Map, ) { - private var hashCode: Int = 0 - @JsonProperty("function_data") fun functionData(): FunctionData? = functionData /** Name of the prompt */ @@ -138,48 +136,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is FunctionReplaceBody && - this.functionData == other.functionData && - this.name == other.name && - this.projectId == other.projectId && - this.slug == other.slug && - this.description == other.description && - this.functionSchema == other.functionSchema && - this.functionType == other.functionType && - this.origin == other.origin && - this.promptData == other.promptData && - this.tags == other.tags && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - functionData, - name, - projectId, - slug, - description, - functionSchema, - functionType, - origin, - promptData, - tags, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "FunctionReplaceBody{functionData=$functionData, name=$name, projectId=$projectId, slug=$slug, description=$description, functionSchema=$functionSchema, functionType=$functionType, origin=$origin, promptData=$promptData, tags=$tags, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -282,6 +238,26 @@ constructor( additionalProperties.toUnmodifiable(), ) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is FunctionReplaceBody && this.functionData == other.functionData && this.name == other.name && this.projectId == other.projectId && this.slug == other.slug && this.description == other.description && this.functionSchema == other.functionSchema && this.functionType == other.functionType && this.origin == other.origin && this.promptData == other.promptData && this.tags == other.tags && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(functionData, name, projectId, slug, description, functionSchema, functionType, origin, promptData, tags, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "FunctionReplaceBody{functionData=$functionData, name=$name, projectId=$projectId, slug=$slug, description=$description, functionSchema=$functionSchema, functionType=$functionType, origin=$origin, promptData=$promptData, tags=$tags, additionalProperties=$additionalProperties}" } fun _additionalQueryParams(): Map> = additionalQueryParams @@ -295,38 +271,11 @@ constructor( return true } - return other is FunctionReplaceParams && - this.functionData == other.functionData && - this.name == other.name && - this.projectId == other.projectId && - this.slug == other.slug && - this.description == other.description && - this.functionSchema == other.functionSchema && - this.functionType == other.functionType && - this.origin == other.origin && - this.promptData == other.promptData && - this.tags == other.tags && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders && - this.additionalBodyProperties == other.additionalBodyProperties + return /* spotless:off */ other is FunctionReplaceParams && this.functionData == other.functionData && this.name == other.name && this.projectId == other.projectId && this.slug == other.slug && this.description == other.description && this.functionSchema == other.functionSchema && this.functionType == other.functionType && this.origin == other.origin && this.promptData == other.promptData && this.tags == other.tags && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders && this.additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - functionData, - name, - projectId, - slug, - description, - functionSchema, - functionType, - origin, - promptData, - tags, - additionalQueryParams, - additionalHeaders, - additionalBodyProperties, - ) + return /* spotless:off */ Objects.hash(functionData, name, projectId, slug, description, functionSchema, functionType, origin, promptData, tags, additionalQueryParams, additionalHeaders, additionalBodyProperties) /* spotless:on */ } override fun toString() = @@ -550,18 +499,11 @@ constructor( return true } - return other is FunctionData && - this.prompt == other.prompt && - this.code == other.code && - this.global == other.global + return /* spotless:off */ other is FunctionData && this.prompt == other.prompt && this.code == other.code && this.global == other.global /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - prompt, - code, - global, - ) + return /* spotless:off */ Objects.hash(prompt, code, global) /* spotless:on */ } override fun toString(): String { @@ -600,6 +542,7 @@ constructor( override fun ObjectCodec.deserialize(node: JsonNode): FunctionData { val json = JsonValue.fromJsonNode(node) + tryDeserialize(node, jacksonTypeRef()) { it.validate() } ?.let { return FunctionData(prompt = it, _json = json) @@ -644,8 +587,6 @@ constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - fun type(): Type = type.getRequired("type") @JsonProperty("type") @ExcludeMissing fun _type() = type @@ -663,26 +604,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Prompt && - this.type == other.type && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = Objects.hash(type, additionalProperties) - } - return hashCode - } - - override fun toString() = - "Prompt{type=$type, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -736,7 +657,7 @@ constructor( return true } - return other is Type && this.value == other.value + return /* spotless:off */ other is Type && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -773,6 +694,26 @@ constructor( fun asString(): String = _value().asStringOrThrow() } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Prompt && this.type == other.type && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(type, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "Prompt{type=$type, additionalProperties=$additionalProperties}" } @JsonDeserialize(builder = Code.Builder::class) @@ -786,8 +727,6 @@ constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - fun type(): Type = type.getRequired("type") fun data(): Data = data.getRequired("data") @@ -810,32 +749,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Code && - this.type == other.type && - this.data == other.data && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - type, - data, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "Code{type=$type, data=$data, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -937,13 +850,11 @@ constructor( return true } - return other is Data && - this.bundle == other.bundle && - this.inline == other.inline + return /* spotless:off */ other is Data && this.bundle == other.bundle && this.inline == other.inline /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash(bundle, inline) + return /* spotless:off */ Objects.hash(bundle, inline) /* spotless:on */ } override fun toString(): String { @@ -977,6 +888,7 @@ constructor( override fun ObjectCodec.deserialize(node: JsonNode): Data { val json = JsonValue.fromJsonNode(node) + tryDeserialize(node, jacksonTypeRef())?.let { return Data(bundle = it, _json = json) } @@ -1019,8 +931,6 @@ constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - fun runtimeContext(): RuntimeContext = runtimeContext.getRequired("runtime_context") @@ -1072,38 +982,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Bundle && - this.runtimeContext == other.runtimeContext && - this.location == other.location && - this.bundleId == other.bundleId && - this.preview == other.preview && - this.type == other.type && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - runtimeContext, - location, - bundleId, - preview, - type, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "Bundle{runtimeContext=$runtimeContext, location=$location, bundleId=$bundleId, preview=$preview, type=$type, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -1208,7 +1086,7 @@ constructor( return true } - return other is Type && this.value == other.value + return /* spotless:off */ other is Type && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -1245,6 +1123,26 @@ constructor( fun asString(): String = _value().asStringOrThrow() } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Bundle && this.runtimeContext == other.runtimeContext && this.location == other.location && this.bundleId == other.bundleId && this.preview == other.preview && this.type == other.type && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(runtimeContext, location, bundleId, preview, type, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "Bundle{runtimeContext=$runtimeContext, location=$location, bundleId=$bundleId, preview=$preview, type=$type, additionalProperties=$additionalProperties}" } @JsonDeserialize(builder = Inline.Builder::class) @@ -1259,8 +1157,6 @@ constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - fun type(): Type = type.getRequired("type") fun runtimeContext(): RuntimeContext = @@ -1291,34 +1187,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Inline && - this.type == other.type && - this.runtimeContext == other.runtimeContext && - this.code == other.code && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - type, - runtimeContext, - code, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "Inline{type=$type, runtimeContext=$runtimeContext, code=$code, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -1396,8 +1264,6 @@ constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - fun runtime(): Runtime = runtime.getRequired("runtime") fun version(): String = version.getRequired("version") @@ -1420,32 +1286,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is RuntimeContext && - this.runtime == other.runtime && - this.version == other.version && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - runtime, - version, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "RuntimeContext{runtime=$runtime, version=$version, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -1518,7 +1358,7 @@ constructor( return true } - return other is Runtime && this.value == other.value + return /* spotless:off */ other is Runtime && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -1564,6 +1404,26 @@ constructor( fun asString(): String = _value().asStringOrThrow() } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is RuntimeContext && this.runtime == other.runtime && this.version == other.version && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(runtime, version, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "RuntimeContext{runtime=$runtime, version=$version, additionalProperties=$additionalProperties}" } class Type @@ -1580,7 +1440,7 @@ constructor( return true } - return other is Type && this.value == other.value + return /* spotless:off */ other is Type && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -1617,6 +1477,26 @@ constructor( fun asString(): String = _value().asStringOrThrow() } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Inline && this.type == other.type && this.runtimeContext == other.runtimeContext && this.code == other.code && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(type, runtimeContext, code, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "Inline{type=$type, runtimeContext=$runtimeContext, code=$code, additionalProperties=$additionalProperties}" } } @@ -1633,7 +1513,7 @@ constructor( return true } - return other is Type && this.value == other.value + return /* spotless:off */ other is Type && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -1670,6 +1550,26 @@ constructor( fun asString(): String = _value().asStringOrThrow() } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Code && this.type == other.type && this.data == other.data && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(type, data, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "Code{type=$type, data=$data, additionalProperties=$additionalProperties}" } @JsonDeserialize(builder = Global.Builder::class) @@ -1683,8 +1583,6 @@ constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - fun type(): Type = type.getRequired("type") fun name(): String = name.getRequired("name") @@ -1707,32 +1605,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Global && - this.type == other.type && - this.name == other.name && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - type, - name, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "Global{type=$type, name=$name, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -1799,7 +1671,7 @@ constructor( return true } - return other is Type && this.value == other.value + return /* spotless:off */ other is Type && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -1836,6 +1708,26 @@ constructor( fun asString(): String = _value().asStringOrThrow() } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Global && this.type == other.type && this.name == other.name && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(type, name, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "Global{type=$type, name=$name, additionalProperties=$additionalProperties}" } } @@ -1849,8 +1741,6 @@ constructor( private val additionalProperties: Map, ) { - private var hashCode: Int = 0 - @JsonProperty("parameters") fun parameters(): JsonValue? = parameters @JsonProperty("returns") fun returns(): JsonValue? = returns @@ -1861,32 +1751,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is FunctionSchema && - this.parameters == other.parameters && - this.returns == other.returns && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - parameters, - returns, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "FunctionSchema{parameters=$parameters, returns=$returns, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -1932,6 +1796,26 @@ constructor( additionalProperties.toUnmodifiable(), ) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is FunctionSchema && this.parameters == other.parameters && this.returns == other.returns && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(parameters, returns, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "FunctionSchema{parameters=$parameters, returns=$returns, additionalProperties=$additionalProperties}" } class FunctionType @@ -1947,7 +1831,7 @@ constructor( return true } - return other is FunctionType && this.value == other.value + return /* spotless:off */ other is FunctionType && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -2013,8 +1897,6 @@ constructor( private val additionalProperties: Map, ) { - private var hashCode: Int = 0 - /** The object type that the ACL applies to */ @JsonProperty("object_type") fun objectType(): ObjectType? = objectType @@ -2033,34 +1915,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Origin && - this.objectType == other.objectType && - this.objectId == other.objectId && - this.internal_ == other.internal_ && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - objectType, - objectId, - internal_, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "Origin{objectType=$objectType, objectId=$objectId, internal_=$internal_, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -2132,7 +1986,7 @@ constructor( return true } - return other is ObjectType && this.value == other.value + return /* spotless:off */ other is ObjectType && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -2229,5 +2083,25 @@ constructor( fun asString(): String = _value().asStringOrThrow() } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Origin && this.objectType == other.objectType && this.objectId == other.objectId && this.internal_ == other.internal_ && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(objectType, objectId, internal_, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "Origin{objectType=$objectType, objectId=$objectId, internal_=$internal_, additionalProperties=$additionalProperties}" } } diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/FunctionRetrieveParams.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/FunctionRetrieveParams.kt index 815fc34d..ada64538 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/FunctionRetrieveParams.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/FunctionRetrieveParams.kt @@ -36,18 +36,11 @@ constructor( return true } - return other is FunctionRetrieveParams && - this.functionId == other.functionId && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders + return /* spotless:off */ other is FunctionRetrieveParams && this.functionId == other.functionId && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - functionId, - additionalQueryParams, - additionalHeaders, - ) + return /* spotless:off */ Objects.hash(functionId, additionalQueryParams, additionalHeaders) /* spotless:on */ } override fun toString() = diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/FunctionToolChoice.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/FunctionToolChoice.kt index 78763bef..4c21b784 100644 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/FunctionToolChoice.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/FunctionToolChoice.kt @@ -24,8 +24,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - fun name(): String = name.getRequired("name") @JsonProperty("name") @ExcludeMissing fun _name() = name @@ -43,26 +41,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is FunctionToolChoice && - this.name == other.name && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = Objects.hash(name, additionalProperties) - } - return hashCode - } - - override fun toString() = - "FunctionToolChoice{name=$name, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -102,4 +80,24 @@ private constructor( fun build(): FunctionToolChoice = FunctionToolChoice(name, additionalProperties.toUnmodifiable()) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is FunctionToolChoice && this.name == other.name && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(name, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "FunctionToolChoice{name=$name, additionalProperties=$additionalProperties}" } diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/FunctionUpdateParams.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/FunctionUpdateParams.kt index b91f5d72..a179f3b8 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/FunctionUpdateParams.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/FunctionUpdateParams.kt @@ -88,8 +88,6 @@ constructor( private val additionalProperties: Map, ) { - private var hashCode: Int = 0 - /** Textual description of the prompt */ @JsonProperty("description") fun description(): String? = description @@ -110,38 +108,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is FunctionUpdateBody && - this.description == other.description && - this.functionData == other.functionData && - this.name == other.name && - this.promptData == other.promptData && - this.tags == other.tags && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - description, - functionData, - name, - promptData, - tags, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "FunctionUpdateBody{description=$description, functionData=$functionData, name=$name, promptData=$promptData, tags=$tags, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -209,6 +175,26 @@ constructor( additionalProperties.toUnmodifiable(), ) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is FunctionUpdateBody && this.description == other.description && this.functionData == other.functionData && this.name == other.name && this.promptData == other.promptData && this.tags == other.tags && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(description, functionData, name, promptData, tags, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "FunctionUpdateBody{description=$description, functionData=$functionData, name=$name, promptData=$promptData, tags=$tags, additionalProperties=$additionalProperties}" } fun _additionalQueryParams(): Map> = additionalQueryParams @@ -222,30 +208,11 @@ constructor( return true } - return other is FunctionUpdateParams && - this.functionId == other.functionId && - this.description == other.description && - this.functionData == other.functionData && - this.name == other.name && - this.promptData == other.promptData && - this.tags == other.tags && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders && - this.additionalBodyProperties == other.additionalBodyProperties + return /* spotless:off */ other is FunctionUpdateParams && this.functionId == other.functionId && this.description == other.description && this.functionData == other.functionData && this.name == other.name && this.promptData == other.promptData && this.tags == other.tags && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders && this.additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - functionId, - description, - functionData, - name, - promptData, - tags, - additionalQueryParams, - additionalHeaders, - additionalBodyProperties, - ) + return /* spotless:off */ Objects.hash(functionId, description, functionData, name, promptData, tags, additionalQueryParams, additionalHeaders, additionalBodyProperties) /* spotless:on */ } override fun toString() = @@ -458,20 +425,11 @@ constructor( return true } - return other is FunctionData && - this.prompt == other.prompt && - this.code == other.code && - this.global == other.global && - this.nullableVariant == other.nullableVariant + return /* spotless:off */ other is FunctionData && this.prompt == other.prompt && this.code == other.code && this.global == other.global && this.nullableVariant == other.nullableVariant /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - prompt, - code, - global, - nullableVariant, - ) + return /* spotless:off */ Objects.hash(prompt, code, global, nullableVariant) /* spotless:on */ } override fun toString(): String { @@ -517,6 +475,7 @@ constructor( override fun ObjectCodec.deserialize(node: JsonNode): FunctionData { val json = JsonValue.fromJsonNode(node) + tryDeserialize(node, jacksonTypeRef()) { it.validate() } ?.let { return FunctionData(prompt = it, _json = json) @@ -566,8 +525,6 @@ constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - fun type(): Type = type.getRequired("type") @JsonProperty("type") @ExcludeMissing fun _type() = type @@ -585,26 +542,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Prompt && - this.type == other.type && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = Objects.hash(type, additionalProperties) - } - return hashCode - } - - override fun toString() = - "Prompt{type=$type, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -658,7 +595,7 @@ constructor( return true } - return other is Type && this.value == other.value + return /* spotless:off */ other is Type && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -695,6 +632,26 @@ constructor( fun asString(): String = _value().asStringOrThrow() } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Prompt && this.type == other.type && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(type, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "Prompt{type=$type, additionalProperties=$additionalProperties}" } @JsonDeserialize(builder = Code.Builder::class) @@ -708,8 +665,6 @@ constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - fun type(): Type = type.getRequired("type") fun data(): Data = data.getRequired("data") @@ -732,32 +687,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Code && - this.type == other.type && - this.data == other.data && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - type, - data, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "Code{type=$type, data=$data, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -859,13 +788,11 @@ constructor( return true } - return other is Data && - this.bundle == other.bundle && - this.inline == other.inline + return /* spotless:off */ other is Data && this.bundle == other.bundle && this.inline == other.inline /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash(bundle, inline) + return /* spotless:off */ Objects.hash(bundle, inline) /* spotless:on */ } override fun toString(): String { @@ -899,6 +826,7 @@ constructor( override fun ObjectCodec.deserialize(node: JsonNode): Data { val json = JsonValue.fromJsonNode(node) + tryDeserialize(node, jacksonTypeRef())?.let { return Data(bundle = it, _json = json) } @@ -941,8 +869,6 @@ constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - fun runtimeContext(): RuntimeContext = runtimeContext.getRequired("runtime_context") @@ -994,38 +920,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Bundle && - this.runtimeContext == other.runtimeContext && - this.location == other.location && - this.bundleId == other.bundleId && - this.preview == other.preview && - this.type == other.type && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - runtimeContext, - location, - bundleId, - preview, - type, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "Bundle{runtimeContext=$runtimeContext, location=$location, bundleId=$bundleId, preview=$preview, type=$type, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -1130,7 +1024,7 @@ constructor( return true } - return other is Type && this.value == other.value + return /* spotless:off */ other is Type && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -1167,6 +1061,26 @@ constructor( fun asString(): String = _value().asStringOrThrow() } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Bundle && this.runtimeContext == other.runtimeContext && this.location == other.location && this.bundleId == other.bundleId && this.preview == other.preview && this.type == other.type && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(runtimeContext, location, bundleId, preview, type, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "Bundle{runtimeContext=$runtimeContext, location=$location, bundleId=$bundleId, preview=$preview, type=$type, additionalProperties=$additionalProperties}" } @JsonDeserialize(builder = Inline.Builder::class) @@ -1181,8 +1095,6 @@ constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - fun type(): Type = type.getRequired("type") fun runtimeContext(): RuntimeContext = @@ -1213,34 +1125,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Inline && - this.type == other.type && - this.runtimeContext == other.runtimeContext && - this.code == other.code && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - type, - runtimeContext, - code, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "Inline{type=$type, runtimeContext=$runtimeContext, code=$code, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -1318,8 +1202,6 @@ constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - fun runtime(): Runtime = runtime.getRequired("runtime") fun version(): String = version.getRequired("version") @@ -1342,32 +1224,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is RuntimeContext && - this.runtime == other.runtime && - this.version == other.version && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - runtime, - version, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "RuntimeContext{runtime=$runtime, version=$version, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -1440,7 +1296,7 @@ constructor( return true } - return other is Runtime && this.value == other.value + return /* spotless:off */ other is Runtime && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -1486,6 +1342,26 @@ constructor( fun asString(): String = _value().asStringOrThrow() } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is RuntimeContext && this.runtime == other.runtime && this.version == other.version && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(runtime, version, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "RuntimeContext{runtime=$runtime, version=$version, additionalProperties=$additionalProperties}" } class Type @@ -1502,7 +1378,7 @@ constructor( return true } - return other is Type && this.value == other.value + return /* spotless:off */ other is Type && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -1539,6 +1415,26 @@ constructor( fun asString(): String = _value().asStringOrThrow() } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Inline && this.type == other.type && this.runtimeContext == other.runtimeContext && this.code == other.code && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(type, runtimeContext, code, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "Inline{type=$type, runtimeContext=$runtimeContext, code=$code, additionalProperties=$additionalProperties}" } } @@ -1555,7 +1451,7 @@ constructor( return true } - return other is Type && this.value == other.value + return /* spotless:off */ other is Type && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -1592,6 +1488,26 @@ constructor( fun asString(): String = _value().asStringOrThrow() } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Code && this.type == other.type && this.data == other.data && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(type, data, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "Code{type=$type, data=$data, additionalProperties=$additionalProperties}" } @JsonDeserialize(builder = Global.Builder::class) @@ -1605,8 +1521,6 @@ constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - fun type(): Type = type.getRequired("type") fun name(): String = name.getRequired("name") @@ -1629,32 +1543,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Global && - this.type == other.type && - this.name == other.name && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - type, - name, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "Global{type=$type, name=$name, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -1721,7 +1609,7 @@ constructor( return true } - return other is Type && this.value == other.value + return /* spotless:off */ other is Type && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -1758,6 +1646,26 @@ constructor( fun asString(): String = _value().asStringOrThrow() } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Global && this.type == other.type && this.name == other.name && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(type, name, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "Global{type=$type, name=$name, additionalProperties=$additionalProperties}" } @JsonDeserialize(builder = NullableVariant.Builder::class) @@ -1769,8 +1677,6 @@ constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -1783,24 +1689,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is NullableVariant && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = Objects.hash(additionalProperties) - } - return hashCode - } - - override fun toString() = "NullableVariant{additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -1833,6 +1721,25 @@ constructor( fun build(): NullableVariant = NullableVariant(additionalProperties.toUnmodifiable()) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is NullableVariant && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = "NullableVariant{additionalProperties=$additionalProperties}" } } } diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/Group.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/Group.kt index e6427910..f82897d5 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/Group.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/Group.kt @@ -39,8 +39,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - /** Unique identifier for the group */ fun id(): String = id.getRequired("id") @@ -138,46 +136,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Group && - this.id == other.id && - this.orgId == other.orgId && - this.userId == other.userId && - this.created == other.created && - this.name == other.name && - this.description == other.description && - this.deletedAt == other.deletedAt && - this.memberUsers == other.memberUsers && - this.memberGroups == other.memberGroups && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - id, - orgId, - userId, - created, - name, - description, - deletedAt, - memberUsers, - memberGroups, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "Group{id=$id, orgId=$orgId, userId=$userId, created=$created, name=$name, description=$description, deletedAt=$deletedAt, memberUsers=$memberUsers, memberGroups=$memberGroups, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -330,4 +288,24 @@ private constructor( additionalProperties.toUnmodifiable(), ) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Group && this.id == other.id && this.orgId == other.orgId && this.userId == other.userId && this.created == other.created && this.name == other.name && this.description == other.description && this.deletedAt == other.deletedAt && this.memberUsers == other.memberUsers && this.memberGroups == other.memberGroups && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(id, orgId, userId, created, name, description, deletedAt, memberUsers, memberGroups, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "Group{id=$id, orgId=$orgId, userId=$userId, created=$created, name=$name, description=$description, deletedAt=$deletedAt, memberUsers=$memberUsers, memberGroups=$memberGroups, additionalProperties=$additionalProperties}" } diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/GroupCreateParams.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/GroupCreateParams.kt index 50bdabcf..91245477 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/GroupCreateParams.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/GroupCreateParams.kt @@ -64,8 +64,6 @@ constructor( private val additionalProperties: Map, ) { - private var hashCode: Int = 0 - /** Name of the group */ @JsonProperty("name") fun name(): String? = name @@ -96,38 +94,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is GroupCreateBody && - this.name == other.name && - this.description == other.description && - this.memberGroups == other.memberGroups && - this.memberUsers == other.memberUsers && - this.orgName == other.orgName && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - name, - description, - memberGroups, - memberUsers, - orgName, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "GroupCreateBody{name=$name, description=$description, memberGroups=$memberGroups, memberUsers=$memberUsers, orgName=$orgName, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -206,6 +172,26 @@ constructor( additionalProperties.toUnmodifiable(), ) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is GroupCreateBody && this.name == other.name && this.description == other.description && this.memberGroups == other.memberGroups && this.memberUsers == other.memberUsers && this.orgName == other.orgName && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(name, description, memberGroups, memberUsers, orgName, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "GroupCreateBody{name=$name, description=$description, memberGroups=$memberGroups, memberUsers=$memberUsers, orgName=$orgName, additionalProperties=$additionalProperties}" } fun _additionalQueryParams(): Map> = additionalQueryParams @@ -219,28 +205,11 @@ constructor( return true } - return other is GroupCreateParams && - this.name == other.name && - this.description == other.description && - this.memberGroups == other.memberGroups && - this.memberUsers == other.memberUsers && - this.orgName == other.orgName && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders && - this.additionalBodyProperties == other.additionalBodyProperties + return /* spotless:off */ other is GroupCreateParams && this.name == other.name && this.description == other.description && this.memberGroups == other.memberGroups && this.memberUsers == other.memberUsers && this.orgName == other.orgName && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders && this.additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - name, - description, - memberGroups, - memberUsers, - orgName, - additionalQueryParams, - additionalHeaders, - additionalBodyProperties, - ) + return /* spotless:off */ Objects.hash(name, description, memberGroups, memberUsers, orgName, additionalQueryParams, additionalHeaders, additionalBodyProperties) /* spotless:on */ } override fun toString() = diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/GroupDeleteParams.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/GroupDeleteParams.kt index 275bba9f..dd1df7ef 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/GroupDeleteParams.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/GroupDeleteParams.kt @@ -46,20 +46,11 @@ constructor( return true } - return other is GroupDeleteParams && - this.groupId == other.groupId && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders && - this.additionalBodyProperties == other.additionalBodyProperties + return /* spotless:off */ other is GroupDeleteParams && this.groupId == other.groupId && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders && this.additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - groupId, - additionalQueryParams, - additionalHeaders, - additionalBodyProperties, - ) + return /* spotless:off */ Objects.hash(groupId, additionalQueryParams, additionalHeaders, additionalBodyProperties) /* spotless:on */ } override fun toString() = diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/GroupListPage.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/GroupListPage.kt index 9d3d9ceb..1c96005e 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/GroupListPage.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/GroupListPage.kt @@ -34,18 +34,11 @@ private constructor( return true } - return other is GroupListPage && - this.groupsService == other.groupsService && - this.params == other.params && - this.response == other.response + return /* spotless:off */ other is GroupListPage && this.groupsService == other.groupsService && this.params == other.params && this.response == other.response /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - groupsService, - params, - response, - ) + return /* spotless:off */ Objects.hash(groupsService, params, response) /* spotless:on */ } override fun toString() = @@ -121,13 +114,11 @@ private constructor( return true } - return other is Response && - this.objects == other.objects && - this.additionalProperties == other.additionalProperties + return /* spotless:off */ other is Response && this.objects == other.objects && this.additionalProperties == other.additionalProperties /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash(objects, additionalProperties) + return /* spotless:off */ Objects.hash(objects, additionalProperties) /* spotless:on */ } override fun toString() = diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/GroupListPageAsync.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/GroupListPageAsync.kt index cc058b58..3f977879 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/GroupListPageAsync.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/GroupListPageAsync.kt @@ -35,18 +35,11 @@ private constructor( return true } - return other is GroupListPageAsync && - this.groupsService == other.groupsService && - this.params == other.params && - this.response == other.response + return /* spotless:off */ other is GroupListPageAsync && this.groupsService == other.groupsService && this.params == other.params && this.response == other.response /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - groupsService, - params, - response, - ) + return /* spotless:off */ Objects.hash(groupsService, params, response) /* spotless:on */ } override fun toString() = @@ -124,13 +117,11 @@ private constructor( return true } - return other is Response && - this.objects == other.objects && - this.additionalProperties == other.additionalProperties + return /* spotless:off */ other is Response && this.objects == other.objects && this.additionalProperties == other.additionalProperties /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash(objects, additionalProperties) + return /* spotless:off */ Objects.hash(objects, additionalProperties) /* spotless:on */ } override fun toString() = diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/GroupListParams.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/GroupListParams.kt index 99922e46..79f31933 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/GroupListParams.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/GroupListParams.kt @@ -68,28 +68,11 @@ constructor( return true } - return other is GroupListParams && - this.endingBefore == other.endingBefore && - this.groupName == other.groupName && - this.ids == other.ids && - this.limit == other.limit && - this.orgName == other.orgName && - this.startingAfter == other.startingAfter && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders + return /* spotless:off */ other is GroupListParams && this.endingBefore == other.endingBefore && this.groupName == other.groupName && this.ids == other.ids && this.limit == other.limit && this.orgName == other.orgName && this.startingAfter == other.startingAfter && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - endingBefore, - groupName, - ids, - limit, - orgName, - startingAfter, - additionalQueryParams, - additionalHeaders, - ) + return /* spotless:off */ Objects.hash(endingBefore, groupName, ids, limit, orgName, startingAfter, additionalQueryParams, additionalHeaders) /* spotless:on */ } override fun toString() = @@ -154,7 +137,7 @@ constructor( * Filter search results to a particular set of object IDs. To specify a list of IDs, * include the query param multiple times */ - fun ids(strings: List) = apply { this.ids = Ids.ofStrings(strings) } + fun idsOfStrings(strings: List) = apply { this.ids = Ids.ofStrings(strings) } /** Limit the number of objects to return */ fun limit(limit: Long) = apply { this.limit = limit } @@ -271,11 +254,11 @@ constructor( return true } - return other is Ids && this.string == other.string && this.strings == other.strings + return /* spotless:off */ other is Ids && this.string == other.string && this.strings == other.strings /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash(string, strings) + return /* spotless:off */ Objects.hash(string, strings) /* spotless:on */ } override fun toString(): String { @@ -309,6 +292,7 @@ constructor( override fun ObjectCodec.deserialize(node: JsonNode): Ids { val json = JsonValue.fromJsonNode(node) + tryDeserialize(node, jacksonTypeRef())?.let { return Ids(string = it, _json = json) } diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/GroupReplaceParams.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/GroupReplaceParams.kt index c7f5ad54..347027b9 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/GroupReplaceParams.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/GroupReplaceParams.kt @@ -64,8 +64,6 @@ constructor( private val additionalProperties: Map, ) { - private var hashCode: Int = 0 - /** Name of the group */ @JsonProperty("name") fun name(): String? = name @@ -96,38 +94,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is GroupReplaceBody && - this.name == other.name && - this.description == other.description && - this.memberGroups == other.memberGroups && - this.memberUsers == other.memberUsers && - this.orgName == other.orgName && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - name, - description, - memberGroups, - memberUsers, - orgName, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "GroupReplaceBody{name=$name, description=$description, memberGroups=$memberGroups, memberUsers=$memberUsers, orgName=$orgName, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -206,6 +172,26 @@ constructor( additionalProperties.toUnmodifiable(), ) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is GroupReplaceBody && this.name == other.name && this.description == other.description && this.memberGroups == other.memberGroups && this.memberUsers == other.memberUsers && this.orgName == other.orgName && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(name, description, memberGroups, memberUsers, orgName, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "GroupReplaceBody{name=$name, description=$description, memberGroups=$memberGroups, memberUsers=$memberUsers, orgName=$orgName, additionalProperties=$additionalProperties}" } fun _additionalQueryParams(): Map> = additionalQueryParams @@ -219,28 +205,11 @@ constructor( return true } - return other is GroupReplaceParams && - this.name == other.name && - this.description == other.description && - this.memberGroups == other.memberGroups && - this.memberUsers == other.memberUsers && - this.orgName == other.orgName && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders && - this.additionalBodyProperties == other.additionalBodyProperties + return /* spotless:off */ other is GroupReplaceParams && this.name == other.name && this.description == other.description && this.memberGroups == other.memberGroups && this.memberUsers == other.memberUsers && this.orgName == other.orgName && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders && this.additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - name, - description, - memberGroups, - memberUsers, - orgName, - additionalQueryParams, - additionalHeaders, - additionalBodyProperties, - ) + return /* spotless:off */ Objects.hash(name, description, memberGroups, memberUsers, orgName, additionalQueryParams, additionalHeaders, additionalBodyProperties) /* spotless:on */ } override fun toString() = diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/GroupRetrieveParams.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/GroupRetrieveParams.kt index 7a68c3d6..a4b5bae1 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/GroupRetrieveParams.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/GroupRetrieveParams.kt @@ -36,18 +36,11 @@ constructor( return true } - return other is GroupRetrieveParams && - this.groupId == other.groupId && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders + return /* spotless:off */ other is GroupRetrieveParams && this.groupId == other.groupId && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - groupId, - additionalQueryParams, - additionalHeaders, - ) + return /* spotless:off */ Objects.hash(groupId, additionalQueryParams, additionalHeaders) /* spotless:on */ } override fun toString() = diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/GroupUpdateParams.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/GroupUpdateParams.kt index ad6adecc..94ff5248 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/GroupUpdateParams.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/GroupUpdateParams.kt @@ -79,8 +79,6 @@ constructor( private val additionalProperties: Map, ) { - private var hashCode: Int = 0 - /** A list of group IDs to add to the group's inheriting-from set */ @JsonProperty("add_member_groups") fun addMemberGroups(): List? = addMemberGroups @@ -107,40 +105,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is GroupUpdateBody && - this.addMemberGroups == other.addMemberGroups && - this.addMemberUsers == other.addMemberUsers && - this.description == other.description && - this.name == other.name && - this.removeMemberGroups == other.removeMemberGroups && - this.removeMemberUsers == other.removeMemberUsers && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - addMemberGroups, - addMemberUsers, - description, - name, - removeMemberGroups, - removeMemberUsers, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "GroupUpdateBody{addMemberGroups=$addMemberGroups, addMemberUsers=$addMemberUsers, description=$description, name=$name, removeMemberGroups=$removeMemberGroups, removeMemberUsers=$removeMemberUsers, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -223,6 +187,26 @@ constructor( additionalProperties.toUnmodifiable(), ) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is GroupUpdateBody && this.addMemberGroups == other.addMemberGroups && this.addMemberUsers == other.addMemberUsers && this.description == other.description && this.name == other.name && this.removeMemberGroups == other.removeMemberGroups && this.removeMemberUsers == other.removeMemberUsers && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(addMemberGroups, addMemberUsers, description, name, removeMemberGroups, removeMemberUsers, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "GroupUpdateBody{addMemberGroups=$addMemberGroups, addMemberUsers=$addMemberUsers, description=$description, name=$name, removeMemberGroups=$removeMemberGroups, removeMemberUsers=$removeMemberUsers, additionalProperties=$additionalProperties}" } fun _additionalQueryParams(): Map> = additionalQueryParams @@ -236,32 +220,11 @@ constructor( return true } - return other is GroupUpdateParams && - this.groupId == other.groupId && - this.addMemberGroups == other.addMemberGroups && - this.addMemberUsers == other.addMemberUsers && - this.description == other.description && - this.name == other.name && - this.removeMemberGroups == other.removeMemberGroups && - this.removeMemberUsers == other.removeMemberUsers && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders && - this.additionalBodyProperties == other.additionalBodyProperties + return /* spotless:off */ other is GroupUpdateParams && this.groupId == other.groupId && this.addMemberGroups == other.addMemberGroups && this.addMemberUsers == other.addMemberUsers && this.description == other.description && this.name == other.name && this.removeMemberGroups == other.removeMemberGroups && this.removeMemberUsers == other.removeMemberUsers && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders && this.additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - groupId, - addMemberGroups, - addMemberUsers, - description, - name, - removeMemberGroups, - removeMemberUsers, - additionalQueryParams, - additionalHeaders, - additionalBodyProperties, - ) + return /* spotless:off */ Objects.hash(groupId, addMemberGroups, addMemberUsers, description, name, removeMemberGroups, removeMemberUsers, additionalQueryParams, additionalHeaders, additionalBodyProperties) /* spotless:on */ } override fun toString() = diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/InsertDatasetEventMerge.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/InsertDatasetEventMerge.kt index 5e2fade0..4445f55c 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/InsertDatasetEventMerge.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/InsertDatasetEventMerge.kt @@ -34,8 +34,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - /** The argument that uniquely define an input case (an arbitrary, JSON serializable object) */ fun input(): JsonValue = input @@ -187,46 +185,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is InsertDatasetEventMerge && - this.input == other.input && - this.expected == other.expected && - this.metadata == other.metadata && - this.tags == other.tags && - this.id == other.id && - this.created == other.created && - this._objectDelete == other._objectDelete && - this._isMerge == other._isMerge && - this._mergePaths == other._mergePaths && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - input, - expected, - metadata, - tags, - id, - created, - _objectDelete, - _isMerge, - _mergePaths, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "InsertDatasetEventMerge{input=$input, expected=$expected, metadata=$metadata, tags=$tags, id=$id, created=$created, _objectDelete=$_objectDelete, _isMerge=$_isMerge, _mergePaths=$_mergePaths, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -449,8 +407,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -463,23 +419,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Metadata && this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = Objects.hash(additionalProperties) - } - return hashCode - } - - override fun toString() = "Metadata{additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -510,5 +449,44 @@ private constructor( fun build(): Metadata = Metadata(additionalProperties.toUnmodifiable()) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Metadata && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = "Metadata{additionalProperties=$additionalProperties}" } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is InsertDatasetEventMerge && this.input == other.input && this.expected == other.expected && this.metadata == other.metadata && this.tags == other.tags && this.id == other.id && this.created == other.created && this._objectDelete == other._objectDelete && this._isMerge == other._isMerge && this._mergePaths == other._mergePaths && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(input, expected, metadata, tags, id, created, _objectDelete, _isMerge, _mergePaths, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "InsertDatasetEventMerge{input=$input, expected=$expected, metadata=$metadata, tags=$tags, id=$id, created=$created, _objectDelete=$_objectDelete, _isMerge=$_isMerge, _mergePaths=$_mergePaths, additionalProperties=$additionalProperties}" } diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/InsertDatasetEventReplace.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/InsertDatasetEventReplace.kt index 2d77d5bd..62b686cb 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/InsertDatasetEventReplace.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/InsertDatasetEventReplace.kt @@ -34,8 +34,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - /** The argument that uniquely define an input case (an arbitrary, JSON serializable object) */ fun input(): JsonValue = input @@ -184,46 +182,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is InsertDatasetEventReplace && - this.input == other.input && - this.expected == other.expected && - this.metadata == other.metadata && - this.tags == other.tags && - this.id == other.id && - this.created == other.created && - this._objectDelete == other._objectDelete && - this._isMerge == other._isMerge && - this._parentId == other._parentId && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - input, - expected, - metadata, - tags, - id, - created, - _objectDelete, - _isMerge, - _parentId, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "InsertDatasetEventReplace{input=$input, expected=$expected, metadata=$metadata, tags=$tags, id=$id, created=$created, _objectDelete=$_objectDelete, _isMerge=$_isMerge, _parentId=$_parentId, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -442,8 +400,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -456,23 +412,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Metadata && this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = Objects.hash(additionalProperties) - } - return hashCode - } - - override fun toString() = "Metadata{additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -503,5 +442,44 @@ private constructor( fun build(): Metadata = Metadata(additionalProperties.toUnmodifiable()) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Metadata && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = "Metadata{additionalProperties=$additionalProperties}" } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is InsertDatasetEventReplace && this.input == other.input && this.expected == other.expected && this.metadata == other.metadata && this.tags == other.tags && this.id == other.id && this.created == other.created && this._objectDelete == other._objectDelete && this._isMerge == other._isMerge && this._parentId == other._parentId && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(input, expected, metadata, tags, id, created, _objectDelete, _isMerge, _parentId, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "InsertDatasetEventReplace{input=$input, expected=$expected, metadata=$metadata, tags=$tags, id=$id, created=$created, _objectDelete=$_objectDelete, _isMerge=$_isMerge, _parentId=$_parentId, additionalProperties=$additionalProperties}" } diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/InsertEventsResponse.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/InsertEventsResponse.kt index 6646cb3e..4daad75e 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/InsertEventsResponse.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/InsertEventsResponse.kt @@ -24,8 +24,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - /** * The ids of all rows that were inserted, aligning one-to-one with the rows provided as input */ @@ -49,26 +47,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is InsertEventsResponse && - this.rowIds == other.rowIds && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = Objects.hash(rowIds, additionalProperties) - } - return hashCode - } - - override fun toString() = - "InsertEventsResponse{rowIds=$rowIds, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -119,4 +97,24 @@ private constructor( additionalProperties.toUnmodifiable() ) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is InsertEventsResponse && this.rowIds == other.rowIds && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(rowIds, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "InsertEventsResponse{rowIds=$rowIds, additionalProperties=$additionalProperties}" } diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/InsertExperimentEventMerge.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/InsertExperimentEventMerge.kt index bfc1a9ff..a757f159 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/InsertExperimentEventMerge.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/InsertExperimentEventMerge.kt @@ -44,8 +44,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - /** * The arguments that uniquely define a test case (an arbitrary, JSON serializable object). * Later on, Braintrust will use the `input` to know whether two test cases are the same between @@ -316,60 +314,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is InsertExperimentEventMerge && - this.input == other.input && - this.output == other.output && - this.expected == other.expected && - this.error == other.error && - this.scores == other.scores && - this.metadata == other.metadata && - this.tags == other.tags && - this.metrics == other.metrics && - this.context == other.context && - this.spanAttributes == other.spanAttributes && - this.id == other.id && - this.datasetRecordId == other.datasetRecordId && - this.created == other.created && - this._objectDelete == other._objectDelete && - this._isMerge == other._isMerge && - this._mergePaths == other._mergePaths && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - input, - output, - expected, - error, - scores, - metadata, - tags, - metrics, - context, - spanAttributes, - id, - datasetRecordId, - created, - _objectDelete, - _isMerge, - _mergePaths, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "InsertExperimentEventMerge{input=$input, output=$output, expected=$expected, error=$error, scores=$scores, metadata=$metadata, tags=$tags, metrics=$metrics, context=$context, spanAttributes=$spanAttributes, id=$id, datasetRecordId=$datasetRecordId, created=$created, _objectDelete=$_objectDelete, _isMerge=$_isMerge, _mergePaths=$_mergePaths, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -721,8 +665,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - /** The function in code which created the experiment event */ fun callerFunctionname(): Optional = Optional.ofNullable(callerFunctionname.getNullable("caller_functionname")) @@ -761,34 +703,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Context && - this.callerFunctionname == other.callerFunctionname && - this.callerFilename == other.callerFilename && - this.callerLineno == other.callerLineno && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - callerFunctionname, - callerFilename, - callerLineno, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "Context{callerFunctionname=$callerFunctionname, callerFilename=$callerFilename, callerLineno=$callerLineno, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -863,6 +777,26 @@ private constructor( additionalProperties.toUnmodifiable(), ) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Context && this.callerFunctionname == other.callerFunctionname && this.callerFilename == other.callerFilename && this.callerLineno == other.callerLineno && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(callerFunctionname, callerFilename, callerLineno, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "Context{callerFunctionname=$callerFunctionname, callerFilename=$callerFilename, callerLineno=$callerLineno, additionalProperties=$additionalProperties}" } /** @@ -881,8 +815,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -895,23 +827,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Metadata && this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = Objects.hash(additionalProperties) - } - return hashCode - } - - override fun toString() = "Metadata{additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -942,6 +857,25 @@ private constructor( fun build(): Metadata = Metadata(additionalProperties.toUnmodifiable()) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Metadata && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = "Metadata{additionalProperties=$additionalProperties}" } /** @@ -963,8 +897,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - /** * A unix timestamp recording when the section of code which produced the experiment event * started @@ -1040,38 +972,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Metrics && - this.start == other.start && - this.end == other.end && - this.promptTokens == other.promptTokens && - this.completionTokens == other.completionTokens && - this.tokens == other.tokens && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - start, - end, - promptTokens, - completionTokens, - tokens, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "Metrics{start=$start, end=$end, promptTokens=$promptTokens, completionTokens=$completionTokens, tokens=$tokens, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -1189,6 +1089,26 @@ private constructor( additionalProperties.toUnmodifiable(), ) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Metrics && this.start == other.start && this.end == other.end && this.promptTokens == other.promptTokens && this.completionTokens == other.completionTokens && this.tokens == other.tokens && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(start, end, promptTokens, completionTokens, tokens, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "Metrics{start=$start, end=$end, promptTokens=$promptTokens, completionTokens=$completionTokens, tokens=$tokens, additionalProperties=$additionalProperties}" } /** @@ -1209,8 +1129,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -1223,23 +1141,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Scores && this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = Objects.hash(additionalProperties) - } - return hashCode - } - - override fun toString() = "Scores{additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -1270,6 +1171,25 @@ private constructor( fun build(): Scores = Scores(additionalProperties.toUnmodifiable()) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Scores && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = "Scores{additionalProperties=$additionalProperties}" } /** Human-identifying attributes of the span, such as name, type, etc. */ @@ -1284,8 +1204,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - /** Name of the span, for display purposes only */ fun name(): Optional = Optional.ofNullable(name.getNullable("name")) @@ -1312,32 +1230,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is SpanAttributes && - this.name == other.name && - this.type == other.type && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - name, - type, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "SpanAttributes{name=$name, type=$type, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -1407,7 +1299,7 @@ private constructor( return true } - return other is Type && this.value == other.value + return /* spotless:off */ other is Type && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -1474,5 +1366,45 @@ private constructor( fun asString(): String = _value().asStringOrThrow() } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is SpanAttributes && this.name == other.name && this.type == other.type && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(name, type, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "SpanAttributes{name=$name, type=$type, additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is InsertExperimentEventMerge && this.input == other.input && this.output == other.output && this.expected == other.expected && this.error == other.error && this.scores == other.scores && this.metadata == other.metadata && this.tags == other.tags && this.metrics == other.metrics && this.context == other.context && this.spanAttributes == other.spanAttributes && this.id == other.id && this.datasetRecordId == other.datasetRecordId && this.created == other.created && this._objectDelete == other._objectDelete && this._isMerge == other._isMerge && this._mergePaths == other._mergePaths && this.additionalProperties == other.additionalProperties /* spotless:on */ } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(input, output, expected, error, scores, metadata, tags, metrics, context, spanAttributes, id, datasetRecordId, created, _objectDelete, _isMerge, _mergePaths, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "InsertExperimentEventMerge{input=$input, output=$output, expected=$expected, error=$error, scores=$scores, metadata=$metadata, tags=$tags, metrics=$metrics, context=$context, spanAttributes=$spanAttributes, id=$id, datasetRecordId=$datasetRecordId, created=$created, _objectDelete=$_objectDelete, _isMerge=$_isMerge, _mergePaths=$_mergePaths, additionalProperties=$additionalProperties}" } diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/InsertExperimentEventReplace.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/InsertExperimentEventReplace.kt index 41a1ffb7..f939b6da 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/InsertExperimentEventReplace.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/InsertExperimentEventReplace.kt @@ -44,8 +44,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - /** * The arguments that uniquely define a test case (an arbitrary, JSON serializable object). * Later on, Braintrust will use the `input` to know whether two test cases are the same between @@ -313,60 +311,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is InsertExperimentEventReplace && - this.input == other.input && - this.output == other.output && - this.expected == other.expected && - this.error == other.error && - this.scores == other.scores && - this.metadata == other.metadata && - this.tags == other.tags && - this.metrics == other.metrics && - this.context == other.context && - this.spanAttributes == other.spanAttributes && - this.id == other.id && - this.datasetRecordId == other.datasetRecordId && - this.created == other.created && - this._objectDelete == other._objectDelete && - this._isMerge == other._isMerge && - this._parentId == other._parentId && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - input, - output, - expected, - error, - scores, - metadata, - tags, - metrics, - context, - spanAttributes, - id, - datasetRecordId, - created, - _objectDelete, - _isMerge, - _parentId, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "InsertExperimentEventReplace{input=$input, output=$output, expected=$expected, error=$error, scores=$scores, metadata=$metadata, tags=$tags, metrics=$metrics, context=$context, spanAttributes=$spanAttributes, id=$id, datasetRecordId=$datasetRecordId, created=$created, _objectDelete=$_objectDelete, _isMerge=$_isMerge, _parentId=$_parentId, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -714,8 +658,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - /** The function in code which created the experiment event */ fun callerFunctionname(): Optional = Optional.ofNullable(callerFunctionname.getNullable("caller_functionname")) @@ -754,34 +696,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Context && - this.callerFunctionname == other.callerFunctionname && - this.callerFilename == other.callerFilename && - this.callerLineno == other.callerLineno && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - callerFunctionname, - callerFilename, - callerLineno, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "Context{callerFunctionname=$callerFunctionname, callerFilename=$callerFilename, callerLineno=$callerLineno, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -856,6 +770,26 @@ private constructor( additionalProperties.toUnmodifiable(), ) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Context && this.callerFunctionname == other.callerFunctionname && this.callerFilename == other.callerFilename && this.callerLineno == other.callerLineno && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(callerFunctionname, callerFilename, callerLineno, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "Context{callerFunctionname=$callerFunctionname, callerFilename=$callerFilename, callerLineno=$callerLineno, additionalProperties=$additionalProperties}" } /** @@ -874,8 +808,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -888,23 +820,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Metadata && this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = Objects.hash(additionalProperties) - } - return hashCode - } - - override fun toString() = "Metadata{additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -935,6 +850,25 @@ private constructor( fun build(): Metadata = Metadata(additionalProperties.toUnmodifiable()) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Metadata && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = "Metadata{additionalProperties=$additionalProperties}" } /** @@ -956,8 +890,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - /** * A unix timestamp recording when the section of code which produced the experiment event * started @@ -1033,38 +965,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Metrics && - this.start == other.start && - this.end == other.end && - this.promptTokens == other.promptTokens && - this.completionTokens == other.completionTokens && - this.tokens == other.tokens && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - start, - end, - promptTokens, - completionTokens, - tokens, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "Metrics{start=$start, end=$end, promptTokens=$promptTokens, completionTokens=$completionTokens, tokens=$tokens, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -1182,6 +1082,26 @@ private constructor( additionalProperties.toUnmodifiable(), ) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Metrics && this.start == other.start && this.end == other.end && this.promptTokens == other.promptTokens && this.completionTokens == other.completionTokens && this.tokens == other.tokens && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(start, end, promptTokens, completionTokens, tokens, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "Metrics{start=$start, end=$end, promptTokens=$promptTokens, completionTokens=$completionTokens, tokens=$tokens, additionalProperties=$additionalProperties}" } /** @@ -1202,8 +1122,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -1216,23 +1134,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Scores && this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = Objects.hash(additionalProperties) - } - return hashCode - } - - override fun toString() = "Scores{additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -1263,6 +1164,25 @@ private constructor( fun build(): Scores = Scores(additionalProperties.toUnmodifiable()) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Scores && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = "Scores{additionalProperties=$additionalProperties}" } /** Human-identifying attributes of the span, such as name, type, etc. */ @@ -1277,8 +1197,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - /** Name of the span, for display purposes only */ fun name(): Optional = Optional.ofNullable(name.getNullable("name")) @@ -1305,32 +1223,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is SpanAttributes && - this.name == other.name && - this.type == other.type && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - name, - type, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "SpanAttributes{name=$name, type=$type, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -1400,7 +1292,7 @@ private constructor( return true } - return other is Type && this.value == other.value + return /* spotless:off */ other is Type && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -1467,5 +1359,45 @@ private constructor( fun asString(): String = _value().asStringOrThrow() } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is SpanAttributes && this.name == other.name && this.type == other.type && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(name, type, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "SpanAttributes{name=$name, type=$type, additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is InsertExperimentEventReplace && this.input == other.input && this.output == other.output && this.expected == other.expected && this.error == other.error && this.scores == other.scores && this.metadata == other.metadata && this.tags == other.tags && this.metrics == other.metrics && this.context == other.context && this.spanAttributes == other.spanAttributes && this.id == other.id && this.datasetRecordId == other.datasetRecordId && this.created == other.created && this._objectDelete == other._objectDelete && this._isMerge == other._isMerge && this._parentId == other._parentId && this.additionalProperties == other.additionalProperties /* spotless:on */ } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(input, output, expected, error, scores, metadata, tags, metrics, context, spanAttributes, id, datasetRecordId, created, _objectDelete, _isMerge, _parentId, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "InsertExperimentEventReplace{input=$input, output=$output, expected=$expected, error=$error, scores=$scores, metadata=$metadata, tags=$tags, metrics=$metrics, context=$context, spanAttributes=$spanAttributes, id=$id, datasetRecordId=$datasetRecordId, created=$created, _objectDelete=$_objectDelete, _isMerge=$_isMerge, _parentId=$_parentId, additionalProperties=$additionalProperties}" } diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/InsertProjectLogsEventMerge.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/InsertProjectLogsEventMerge.kt index ed3b51be..5ec14eb3 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/InsertProjectLogsEventMerge.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/InsertProjectLogsEventMerge.kt @@ -43,8 +43,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - /** The arguments that uniquely define a user input (an arbitrary, JSON serializable object). */ fun input(): JsonValue = input @@ -291,58 +289,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is InsertProjectLogsEventMerge && - this.input == other.input && - this.output == other.output && - this.expected == other.expected && - this.error == other.error && - this.scores == other.scores && - this.metadata == other.metadata && - this.tags == other.tags && - this.metrics == other.metrics && - this.context == other.context && - this.spanAttributes == other.spanAttributes && - this.id == other.id && - this.created == other.created && - this._objectDelete == other._objectDelete && - this._isMerge == other._isMerge && - this._mergePaths == other._mergePaths && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - input, - output, - expected, - error, - scores, - metadata, - tags, - metrics, - context, - spanAttributes, - id, - created, - _objectDelete, - _isMerge, - _mergePaths, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "InsertProjectLogsEventMerge{input=$input, output=$output, expected=$expected, error=$error, scores=$scores, metadata=$metadata, tags=$tags, metrics=$metrics, context=$context, spanAttributes=$spanAttributes, id=$id, created=$created, _objectDelete=$_objectDelete, _isMerge=$_isMerge, _mergePaths=$_mergePaths, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -671,8 +617,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - /** The function in code which created the project logs event */ fun callerFunctionname(): Optional = Optional.ofNullable(callerFunctionname.getNullable("caller_functionname")) @@ -711,34 +655,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Context && - this.callerFunctionname == other.callerFunctionname && - this.callerFilename == other.callerFilename && - this.callerLineno == other.callerLineno && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - callerFunctionname, - callerFilename, - callerLineno, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "Context{callerFunctionname=$callerFunctionname, callerFilename=$callerFilename, callerLineno=$callerLineno, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -813,6 +729,26 @@ private constructor( additionalProperties.toUnmodifiable(), ) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Context && this.callerFunctionname == other.callerFunctionname && this.callerFilename == other.callerFilename && this.callerLineno == other.callerLineno && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(callerFunctionname, callerFilename, callerLineno, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "Context{callerFunctionname=$callerFunctionname, callerFilename=$callerFilename, callerLineno=$callerLineno, additionalProperties=$additionalProperties}" } /** @@ -831,8 +767,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -845,23 +779,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Metadata && this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = Objects.hash(additionalProperties) - } - return hashCode - } - - override fun toString() = "Metadata{additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -892,6 +809,25 @@ private constructor( fun build(): Metadata = Metadata(additionalProperties.toUnmodifiable()) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Metadata && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = "Metadata{additionalProperties=$additionalProperties}" } /** @@ -913,8 +849,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - /** * A unix timestamp recording when the section of code which produced the project logs event * started @@ -990,38 +924,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Metrics && - this.start == other.start && - this.end == other.end && - this.promptTokens == other.promptTokens && - this.completionTokens == other.completionTokens && - this.tokens == other.tokens && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - start, - end, - promptTokens, - completionTokens, - tokens, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "Metrics{start=$start, end=$end, promptTokens=$promptTokens, completionTokens=$completionTokens, tokens=$tokens, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -1139,6 +1041,26 @@ private constructor( additionalProperties.toUnmodifiable(), ) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Metrics && this.start == other.start && this.end == other.end && this.promptTokens == other.promptTokens && this.completionTokens == other.completionTokens && this.tokens == other.tokens && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(start, end, promptTokens, completionTokens, tokens, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "Metrics{start=$start, end=$end, promptTokens=$promptTokens, completionTokens=$completionTokens, tokens=$tokens, additionalProperties=$additionalProperties}" } /** @@ -1159,8 +1081,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -1173,23 +1093,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Scores && this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = Objects.hash(additionalProperties) - } - return hashCode - } - - override fun toString() = "Scores{additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -1220,6 +1123,25 @@ private constructor( fun build(): Scores = Scores(additionalProperties.toUnmodifiable()) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Scores && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = "Scores{additionalProperties=$additionalProperties}" } /** Human-identifying attributes of the span, such as name, type, etc. */ @@ -1234,8 +1156,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - /** Name of the span, for display purposes only */ fun name(): Optional = Optional.ofNullable(name.getNullable("name")) @@ -1262,32 +1182,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is SpanAttributes && - this.name == other.name && - this.type == other.type && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - name, - type, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "SpanAttributes{name=$name, type=$type, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -1357,7 +1251,7 @@ private constructor( return true } - return other is Type && this.value == other.value + return /* spotless:off */ other is Type && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -1424,5 +1318,45 @@ private constructor( fun asString(): String = _value().asStringOrThrow() } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is SpanAttributes && this.name == other.name && this.type == other.type && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(name, type, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "SpanAttributes{name=$name, type=$type, additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is InsertProjectLogsEventMerge && this.input == other.input && this.output == other.output && this.expected == other.expected && this.error == other.error && this.scores == other.scores && this.metadata == other.metadata && this.tags == other.tags && this.metrics == other.metrics && this.context == other.context && this.spanAttributes == other.spanAttributes && this.id == other.id && this.created == other.created && this._objectDelete == other._objectDelete && this._isMerge == other._isMerge && this._mergePaths == other._mergePaths && this.additionalProperties == other.additionalProperties /* spotless:on */ } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(input, output, expected, error, scores, metadata, tags, metrics, context, spanAttributes, id, created, _objectDelete, _isMerge, _mergePaths, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "InsertProjectLogsEventMerge{input=$input, output=$output, expected=$expected, error=$error, scores=$scores, metadata=$metadata, tags=$tags, metrics=$metrics, context=$context, spanAttributes=$spanAttributes, id=$id, created=$created, _objectDelete=$_objectDelete, _isMerge=$_isMerge, _mergePaths=$_mergePaths, additionalProperties=$additionalProperties}" } diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/InsertProjectLogsEventReplace.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/InsertProjectLogsEventReplace.kt index 26089aee..8b1ee414 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/InsertProjectLogsEventReplace.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/InsertProjectLogsEventReplace.kt @@ -43,8 +43,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - /** The arguments that uniquely define a user input (an arbitrary, JSON serializable object). */ fun input(): JsonValue = input @@ -288,58 +286,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is InsertProjectLogsEventReplace && - this.input == other.input && - this.output == other.output && - this.expected == other.expected && - this.error == other.error && - this.scores == other.scores && - this.metadata == other.metadata && - this.tags == other.tags && - this.metrics == other.metrics && - this.context == other.context && - this.spanAttributes == other.spanAttributes && - this.id == other.id && - this.created == other.created && - this._objectDelete == other._objectDelete && - this._isMerge == other._isMerge && - this._parentId == other._parentId && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - input, - output, - expected, - error, - scores, - metadata, - tags, - metrics, - context, - spanAttributes, - id, - created, - _objectDelete, - _isMerge, - _parentId, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "InsertProjectLogsEventReplace{input=$input, output=$output, expected=$expected, error=$error, scores=$scores, metadata=$metadata, tags=$tags, metrics=$metrics, context=$context, spanAttributes=$spanAttributes, id=$id, created=$created, _objectDelete=$_objectDelete, _isMerge=$_isMerge, _parentId=$_parentId, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -664,8 +610,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - /** The function in code which created the project logs event */ fun callerFunctionname(): Optional = Optional.ofNullable(callerFunctionname.getNullable("caller_functionname")) @@ -704,34 +648,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Context && - this.callerFunctionname == other.callerFunctionname && - this.callerFilename == other.callerFilename && - this.callerLineno == other.callerLineno && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - callerFunctionname, - callerFilename, - callerLineno, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "Context{callerFunctionname=$callerFunctionname, callerFilename=$callerFilename, callerLineno=$callerLineno, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -806,6 +722,26 @@ private constructor( additionalProperties.toUnmodifiable(), ) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Context && this.callerFunctionname == other.callerFunctionname && this.callerFilename == other.callerFilename && this.callerLineno == other.callerLineno && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(callerFunctionname, callerFilename, callerLineno, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "Context{callerFunctionname=$callerFunctionname, callerFilename=$callerFilename, callerLineno=$callerLineno, additionalProperties=$additionalProperties}" } /** @@ -824,8 +760,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -838,23 +772,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Metadata && this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = Objects.hash(additionalProperties) - } - return hashCode - } - - override fun toString() = "Metadata{additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -885,6 +802,25 @@ private constructor( fun build(): Metadata = Metadata(additionalProperties.toUnmodifiable()) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Metadata && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = "Metadata{additionalProperties=$additionalProperties}" } /** @@ -906,8 +842,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - /** * A unix timestamp recording when the section of code which produced the project logs event * started @@ -983,38 +917,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Metrics && - this.start == other.start && - this.end == other.end && - this.promptTokens == other.promptTokens && - this.completionTokens == other.completionTokens && - this.tokens == other.tokens && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - start, - end, - promptTokens, - completionTokens, - tokens, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "Metrics{start=$start, end=$end, promptTokens=$promptTokens, completionTokens=$completionTokens, tokens=$tokens, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -1132,6 +1034,26 @@ private constructor( additionalProperties.toUnmodifiable(), ) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Metrics && this.start == other.start && this.end == other.end && this.promptTokens == other.promptTokens && this.completionTokens == other.completionTokens && this.tokens == other.tokens && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(start, end, promptTokens, completionTokens, tokens, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "Metrics{start=$start, end=$end, promptTokens=$promptTokens, completionTokens=$completionTokens, tokens=$tokens, additionalProperties=$additionalProperties}" } /** @@ -1152,8 +1074,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -1166,23 +1086,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Scores && this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = Objects.hash(additionalProperties) - } - return hashCode - } - - override fun toString() = "Scores{additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -1213,6 +1116,25 @@ private constructor( fun build(): Scores = Scores(additionalProperties.toUnmodifiable()) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Scores && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = "Scores{additionalProperties=$additionalProperties}" } /** Human-identifying attributes of the span, such as name, type, etc. */ @@ -1227,8 +1149,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - /** Name of the span, for display purposes only */ fun name(): Optional = Optional.ofNullable(name.getNullable("name")) @@ -1255,32 +1175,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is SpanAttributes && - this.name == other.name && - this.type == other.type && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - name, - type, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "SpanAttributes{name=$name, type=$type, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -1350,7 +1244,7 @@ private constructor( return true } - return other is Type && this.value == other.value + return /* spotless:off */ other is Type && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -1417,5 +1311,45 @@ private constructor( fun asString(): String = _value().asStringOrThrow() } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is SpanAttributes && this.name == other.name && this.type == other.type && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(name, type, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "SpanAttributes{name=$name, type=$type, additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is InsertProjectLogsEventReplace && this.input == other.input && this.output == other.output && this.expected == other.expected && this.error == other.error && this.scores == other.scores && this.metadata == other.metadata && this.tags == other.tags && this.metrics == other.metrics && this.context == other.context && this.spanAttributes == other.spanAttributes && this.id == other.id && this.created == other.created && this._objectDelete == other._objectDelete && this._isMerge == other._isMerge && this._parentId == other._parentId && this.additionalProperties == other.additionalProperties /* spotless:on */ } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(input, output, expected, error, scores, metadata, tags, metrics, context, spanAttributes, id, created, _objectDelete, _isMerge, _parentId, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "InsertProjectLogsEventReplace{input=$input, output=$output, expected=$expected, error=$error, scores=$scores, metadata=$metadata, tags=$tags, metrics=$metrics, context=$context, spanAttributes=$spanAttributes, id=$id, created=$created, _objectDelete=$_objectDelete, _isMerge=$_isMerge, _parentId=$_parentId, additionalProperties=$additionalProperties}" } diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/MetricSummary.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/MetricSummary.kt index 5927af4c..4336a5f1 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/MetricSummary.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/MetricSummary.kt @@ -31,8 +31,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - /** Name of the metric */ fun name(): String = name.getRequired("name") @@ -87,40 +85,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is MetricSummary && - this.name == other.name && - this.metric == other.metric && - this.unit == other.unit && - this.diff == other.diff && - this.improvements == other.improvements && - this.regressions == other.regressions && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - name, - metric, - unit, - diff, - improvements, - regressions, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "MetricSummary{name=$name, metric=$metric, unit=$unit, diff=$diff, improvements=$improvements, regressions=$regressions, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -220,4 +184,24 @@ private constructor( additionalProperties.toUnmodifiable(), ) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is MetricSummary && this.name == other.name && this.metric == other.metric && this.unit == other.unit && this.diff == other.diff && this.improvements == other.improvements && this.regressions == other.regressions && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(name, metric, unit, diff, improvements, regressions, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "MetricSummary{name=$name, metric=$metric, unit=$unit, diff=$diff, improvements=$improvements, regressions=$regressions, additionalProperties=$additionalProperties}" } diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/OnlineScoreConfig.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/OnlineScoreConfig.kt index fcebfdc0..9c8a1620 100644 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/OnlineScoreConfig.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/OnlineScoreConfig.kt @@ -40,8 +40,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - /** The sampling rate for online scoring */ fun samplingRate(): Double = samplingRate.getRequired("sampling_rate") @@ -84,36 +82,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is OnlineScoreConfig && - this.samplingRate == other.samplingRate && - this.scorers == other.scorers && - this.applyToRootSpan == other.applyToRootSpan && - this.applyToSpanNames == other.applyToSpanNames && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - samplingRate, - scorers, - applyToRootSpan, - applyToSpanNames, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "OnlineScoreConfig{samplingRate=$samplingRate, scorers=$scorers, applyToRootSpan=$applyToRootSpan, applyToSpanNames=$applyToSpanNames, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -249,11 +217,11 @@ private constructor( return true } - return other is Scorer && this.function == other.function && this.global == other.global + return /* spotless:off */ other is Scorer && this.function == other.function && this.global == other.global /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash(function, global) + return /* spotless:off */ Objects.hash(function, global) /* spotless:on */ } override fun toString(): String { @@ -287,6 +255,7 @@ private constructor( override fun ObjectCodec.deserialize(node: JsonNode): Scorer { val json = JsonValue.fromJsonNode(node) + tryDeserialize(node, jacksonTypeRef()) { it.validate() } ?.let { return Scorer(function = it, _json = json) @@ -327,8 +296,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - fun type(): Type = type.getRequired("type") fun id(): String = id.getRequired("id") @@ -351,32 +318,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Function && - this.type == other.type && - this.id == other.id && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - type, - id, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "Function{type=$type, id=$id, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -443,7 +384,7 @@ private constructor( return true } - return other is Type && this.value == other.value + return /* spotless:off */ other is Type && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -480,6 +421,26 @@ private constructor( fun asString(): String = _value().asStringOrThrow() } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Function && this.type == other.type && this.id == other.id && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(type, id, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "Function{type=$type, id=$id, additionalProperties=$additionalProperties}" } @JsonDeserialize(builder = Global.Builder::class) @@ -493,8 +454,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - fun type(): Type = type.getRequired("type") fun name(): String = name.getRequired("name") @@ -517,32 +476,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Global && - this.type == other.type && - this.name == other.name && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - type, - name, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "Global{type=$type, name=$name, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -609,7 +542,7 @@ private constructor( return true } - return other is Type && this.value == other.value + return /* spotless:off */ other is Type && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -646,6 +579,46 @@ private constructor( fun asString(): String = _value().asStringOrThrow() } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Global && this.type == other.type && this.name == other.name && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(type, name, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "Global{type=$type, name=$name, additionalProperties=$additionalProperties}" } } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is OnlineScoreConfig && this.samplingRate == other.samplingRate && this.scorers == other.scorers && this.applyToRootSpan == other.applyToRootSpan && this.applyToSpanNames == other.applyToSpanNames && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(samplingRate, scorers, applyToRootSpan, applyToSpanNames, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "OnlineScoreConfig{samplingRate=$samplingRate, scorers=$scorers, applyToRootSpan=$applyToRootSpan, applyToSpanNames=$applyToSpanNames, additionalProperties=$additionalProperties}" } diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/Organization.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/Organization.kt index 44c9b609..a586fcb4 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/Organization.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/Organization.kt @@ -32,8 +32,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - /** Unique identifier for the organization */ fun id(): String = id.getRequired("id") @@ -89,42 +87,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Organization && - this.id == other.id && - this.name == other.name && - this.apiUrl == other.apiUrl && - this.isUniversalApi == other.isUniversalApi && - this.proxyUrl == other.proxyUrl && - this.realtimeUrl == other.realtimeUrl && - this.created == other.created && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - id, - name, - apiUrl, - isUniversalApi, - proxyUrl, - realtimeUrl, - created, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "Organization{id=$id, name=$name, apiUrl=$apiUrl, isUniversalApi=$isUniversalApi, proxyUrl=$proxyUrl, realtimeUrl=$realtimeUrl, created=$created, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -227,4 +189,24 @@ private constructor( additionalProperties.toUnmodifiable(), ) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Organization && this.id == other.id && this.name == other.name && this.apiUrl == other.apiUrl && this.isUniversalApi == other.isUniversalApi && this.proxyUrl == other.proxyUrl && this.realtimeUrl == other.realtimeUrl && this.created == other.created && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(id, name, apiUrl, isUniversalApi, proxyUrl, realtimeUrl, created, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "Organization{id=$id, name=$name, apiUrl=$apiUrl, isUniversalApi=$isUniversalApi, proxyUrl=$proxyUrl, realtimeUrl=$realtimeUrl, created=$created, additionalProperties=$additionalProperties}" } diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/OrganizationDeleteParams.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/OrganizationDeleteParams.kt index 2a32949b..3e5294c1 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/OrganizationDeleteParams.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/OrganizationDeleteParams.kt @@ -46,20 +46,11 @@ constructor( return true } - return other is OrganizationDeleteParams && - this.organizationId == other.organizationId && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders && - this.additionalBodyProperties == other.additionalBodyProperties + return /* spotless:off */ other is OrganizationDeleteParams && this.organizationId == other.organizationId && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders && this.additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - organizationId, - additionalQueryParams, - additionalHeaders, - additionalBodyProperties, - ) + return /* spotless:off */ Objects.hash(organizationId, additionalQueryParams, additionalHeaders, additionalBodyProperties) /* spotless:on */ } override fun toString() = diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/OrganizationListPage.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/OrganizationListPage.kt index ed6d9bd9..6555fc93 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/OrganizationListPage.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/OrganizationListPage.kt @@ -34,18 +34,11 @@ private constructor( return true } - return other is OrganizationListPage && - this.organizationsService == other.organizationsService && - this.params == other.params && - this.response == other.response + return /* spotless:off */ other is OrganizationListPage && this.organizationsService == other.organizationsService && this.params == other.params && this.response == other.response /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - organizationsService, - params, - response, - ) + return /* spotless:off */ Objects.hash(organizationsService, params, response) /* spotless:on */ } override fun toString() = @@ -131,13 +124,11 @@ private constructor( return true } - return other is Response && - this.objects == other.objects && - this.additionalProperties == other.additionalProperties + return /* spotless:off */ other is Response && this.objects == other.objects && this.additionalProperties == other.additionalProperties /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash(objects, additionalProperties) + return /* spotless:off */ Objects.hash(objects, additionalProperties) /* spotless:on */ } override fun toString() = diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/OrganizationListPageAsync.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/OrganizationListPageAsync.kt index 5dc12993..1f73b9f9 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/OrganizationListPageAsync.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/OrganizationListPageAsync.kt @@ -35,18 +35,11 @@ private constructor( return true } - return other is OrganizationListPageAsync && - this.organizationsService == other.organizationsService && - this.params == other.params && - this.response == other.response + return /* spotless:off */ other is OrganizationListPageAsync && this.organizationsService == other.organizationsService && this.params == other.params && this.response == other.response /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - organizationsService, - params, - response, - ) + return /* spotless:off */ Objects.hash(organizationsService, params, response) /* spotless:on */ } override fun toString() = @@ -134,13 +127,11 @@ private constructor( return true } - return other is Response && - this.objects == other.objects && - this.additionalProperties == other.additionalProperties + return /* spotless:off */ other is Response && this.objects == other.objects && this.additionalProperties == other.additionalProperties /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash(objects, additionalProperties) + return /* spotless:off */ Objects.hash(objects, additionalProperties) /* spotless:on */ } override fun toString() = diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/OrganizationListParams.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/OrganizationListParams.kt index 76ac2962..fca42385 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/OrganizationListParams.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/OrganizationListParams.kt @@ -64,26 +64,11 @@ constructor( return true } - return other is OrganizationListParams && - this.endingBefore == other.endingBefore && - this.ids == other.ids && - this.limit == other.limit && - this.orgName == other.orgName && - this.startingAfter == other.startingAfter && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders + return /* spotless:off */ other is OrganizationListParams && this.endingBefore == other.endingBefore && this.ids == other.ids && this.limit == other.limit && this.orgName == other.orgName && this.startingAfter == other.startingAfter && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - endingBefore, - ids, - limit, - orgName, - startingAfter, - additionalQueryParams, - additionalHeaders, - ) + return /* spotless:off */ Objects.hash(endingBefore, ids, limit, orgName, startingAfter, additionalQueryParams, additionalHeaders) /* spotless:on */ } override fun toString() = @@ -143,7 +128,7 @@ constructor( * Filter search results to a particular set of object IDs. To specify a list of IDs, * include the query param multiple times */ - fun ids(strings: List) = apply { this.ids = Ids.ofStrings(strings) } + fun idsOfStrings(strings: List) = apply { this.ids = Ids.ofStrings(strings) } /** Limit the number of objects to return */ fun limit(limit: Long) = apply { this.limit = limit } @@ -259,11 +244,11 @@ constructor( return true } - return other is Ids && this.string == other.string && this.strings == other.strings + return /* spotless:off */ other is Ids && this.string == other.string && this.strings == other.strings /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash(string, strings) + return /* spotless:off */ Objects.hash(string, strings) /* spotless:on */ } override fun toString(): String { @@ -297,6 +282,7 @@ constructor( override fun ObjectCodec.deserialize(node: JsonNode): Ids { val json = JsonValue.fromJsonNode(node) + tryDeserialize(node, jacksonTypeRef())?.let { return Ids(string = it, _json = json) } diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/OrganizationMemberUpdateParams.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/OrganizationMemberUpdateParams.kt index b97ce9e2..6cacca69 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/OrganizationMemberUpdateParams.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/OrganizationMemberUpdateParams.kt @@ -59,8 +59,6 @@ constructor( private val additionalProperties: Map, ) { - private var hashCode: Int = 0 - /** Users to invite to the organization */ @JsonProperty("invite_users") fun inviteUsers(): InviteUsers? = inviteUsers @@ -87,36 +85,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is OrganizationMemberUpdateBody && - this.inviteUsers == other.inviteUsers && - this.orgId == other.orgId && - this.orgName == other.orgName && - this.removeUsers == other.removeUsers && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - inviteUsers, - orgId, - orgName, - removeUsers, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "OrganizationMemberUpdateBody{inviteUsers=$inviteUsers, orgId=$orgId, orgName=$orgName, removeUsers=$removeUsers, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -187,6 +155,26 @@ constructor( additionalProperties.toUnmodifiable(), ) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is OrganizationMemberUpdateBody && this.inviteUsers == other.inviteUsers && this.orgId == other.orgId && this.orgName == other.orgName && this.removeUsers == other.removeUsers && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(inviteUsers, orgId, orgName, removeUsers, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "OrganizationMemberUpdateBody{inviteUsers=$inviteUsers, orgId=$orgId, orgName=$orgName, removeUsers=$removeUsers, additionalProperties=$additionalProperties}" } fun _additionalQueryParams(): Map> = additionalQueryParams @@ -200,26 +188,11 @@ constructor( return true } - return other is OrganizationMemberUpdateParams && - this.inviteUsers == other.inviteUsers && - this.orgId == other.orgId && - this.orgName == other.orgName && - this.removeUsers == other.removeUsers && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders && - this.additionalBodyProperties == other.additionalBodyProperties + return /* spotless:off */ other is OrganizationMemberUpdateParams && this.inviteUsers == other.inviteUsers && this.orgId == other.orgId && this.orgName == other.orgName && this.removeUsers == other.removeUsers && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders && this.additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - inviteUsers, - orgId, - orgName, - removeUsers, - additionalQueryParams, - additionalHeaders, - additionalBodyProperties, - ) + return /* spotless:off */ Objects.hash(inviteUsers, orgId, orgName, removeUsers, additionalQueryParams, additionalHeaders, additionalBodyProperties) /* spotless:on */ } override fun toString() = @@ -355,8 +328,6 @@ constructor( private val additionalProperties: Map, ) { - private var hashCode: Int = 0 - /** Ids of existing users to invite */ @JsonProperty("ids") fun ids(): List? = ids @@ -384,42 +355,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is InviteUsers && - this.ids == other.ids && - this.emails == other.emails && - this.sendInviteEmails == other.sendInviteEmails && - this.groupIds == other.groupIds && - this.groupNames == other.groupNames && - this.groupId == other.groupId && - this.groupName == other.groupName && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - ids, - emails, - sendInviteEmails, - groupIds, - groupNames, - groupId, - groupName, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "InviteUsers{ids=$ids, emails=$emails, sendInviteEmails=$sendInviteEmails, groupIds=$groupIds, groupNames=$groupNames, groupId=$groupId, groupName=$groupName, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -503,6 +438,26 @@ constructor( additionalProperties.toUnmodifiable(), ) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is InviteUsers && this.ids == other.ids && this.emails == other.emails && this.sendInviteEmails == other.sendInviteEmails && this.groupIds == other.groupIds && this.groupNames == other.groupNames && this.groupId == other.groupId && this.groupName == other.groupName && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(ids, emails, sendInviteEmails, groupIds, groupNames, groupId, groupName, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "InviteUsers{ids=$ids, emails=$emails, sendInviteEmails=$sendInviteEmails, groupIds=$groupIds, groupNames=$groupNames, groupId=$groupId, groupName=$groupName, additionalProperties=$additionalProperties}" } /** Users to remove from the organization */ @@ -515,8 +470,6 @@ constructor( private val additionalProperties: Map, ) { - private var hashCode: Int = 0 - /** Ids of users to remove */ @JsonProperty("ids") fun ids(): List? = ids @@ -529,32 +482,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is RemoveUsers && - this.ids == other.ids && - this.emails == other.emails && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - ids, - emails, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "RemoveUsers{ids=$ids, emails=$emails, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -601,5 +528,25 @@ constructor( additionalProperties.toUnmodifiable(), ) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is RemoveUsers && this.ids == other.ids && this.emails == other.emails && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(ids, emails, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "RemoveUsers{ids=$ids, emails=$emails, additionalProperties=$additionalProperties}" } } diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/OrganizationRetrieveParams.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/OrganizationRetrieveParams.kt index 6999669c..63569b8a 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/OrganizationRetrieveParams.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/OrganizationRetrieveParams.kt @@ -36,18 +36,11 @@ constructor( return true } - return other is OrganizationRetrieveParams && - this.organizationId == other.organizationId && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders + return /* spotless:off */ other is OrganizationRetrieveParams && this.organizationId == other.organizationId && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - organizationId, - additionalQueryParams, - additionalHeaders, - ) + return /* spotless:off */ Objects.hash(organizationId, additionalQueryParams, additionalHeaders) /* spotless:on */ } override fun toString() = diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/OrganizationUpdateParams.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/OrganizationUpdateParams.kt index a513fc50..468cef37 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/OrganizationUpdateParams.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/OrganizationUpdateParams.kt @@ -74,8 +74,6 @@ constructor( private val additionalProperties: Map, ) { - private var hashCode: Int = 0 - @JsonProperty("api_url") fun apiUrl(): String? = apiUrl @JsonProperty("is_universal_api") fun isUniversalApi(): Boolean? = isUniversalApi @@ -93,38 +91,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is OrganizationUpdateBody && - this.apiUrl == other.apiUrl && - this.isUniversalApi == other.isUniversalApi && - this.name == other.name && - this.proxyUrl == other.proxyUrl && - this.realtimeUrl == other.realtimeUrl && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - apiUrl, - isUniversalApi, - name, - proxyUrl, - realtimeUrl, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "OrganizationUpdateBody{apiUrl=$apiUrl, isUniversalApi=$isUniversalApi, name=$name, proxyUrl=$proxyUrl, realtimeUrl=$realtimeUrl, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -189,6 +155,26 @@ constructor( additionalProperties.toUnmodifiable(), ) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is OrganizationUpdateBody && this.apiUrl == other.apiUrl && this.isUniversalApi == other.isUniversalApi && this.name == other.name && this.proxyUrl == other.proxyUrl && this.realtimeUrl == other.realtimeUrl && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(apiUrl, isUniversalApi, name, proxyUrl, realtimeUrl, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "OrganizationUpdateBody{apiUrl=$apiUrl, isUniversalApi=$isUniversalApi, name=$name, proxyUrl=$proxyUrl, realtimeUrl=$realtimeUrl, additionalProperties=$additionalProperties}" } fun _additionalQueryParams(): Map> = additionalQueryParams @@ -202,30 +188,11 @@ constructor( return true } - return other is OrganizationUpdateParams && - this.organizationId == other.organizationId && - this.apiUrl == other.apiUrl && - this.isUniversalApi == other.isUniversalApi && - this.name == other.name && - this.proxyUrl == other.proxyUrl && - this.realtimeUrl == other.realtimeUrl && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders && - this.additionalBodyProperties == other.additionalBodyProperties + return /* spotless:off */ other is OrganizationUpdateParams && this.organizationId == other.organizationId && this.apiUrl == other.apiUrl && this.isUniversalApi == other.isUniversalApi && this.name == other.name && this.proxyUrl == other.proxyUrl && this.realtimeUrl == other.realtimeUrl && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders && this.additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - organizationId, - apiUrl, - isUniversalApi, - name, - proxyUrl, - realtimeUrl, - additionalQueryParams, - additionalHeaders, - additionalBodyProperties, - ) + return /* spotless:off */ Objects.hash(organizationId, apiUrl, isUniversalApi, name, proxyUrl, realtimeUrl, additionalQueryParams, additionalHeaders, additionalBodyProperties) /* spotless:on */ } override fun toString() = diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/PatchOrganizationMembersOutput.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/PatchOrganizationMembersOutput.kt index 3c0f52bc..f7948d50 100644 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/PatchOrganizationMembersOutput.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/PatchOrganizationMembersOutput.kt @@ -29,8 +29,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - fun status(): Status = status.getRequired("status") /** @@ -62,32 +60,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is PatchOrganizationMembersOutput && - this.status == other.status && - this.sendEmailError == other.sendEmailError && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - status, - sendEmailError, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "PatchOrganizationMembersOutput{status=$status, sendEmailError=$sendEmailError, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -163,7 +135,7 @@ private constructor( return true } - return other is Status && this.value == other.value + return /* spotless:off */ other is Status && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -200,4 +172,24 @@ private constructor( fun asString(): String = _value().asStringOrThrow() } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is PatchOrganizationMembersOutput && this.status == other.status && this.sendEmailError == other.sendEmailError && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(status, sendEmailError, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "PatchOrganizationMembersOutput{status=$status, sendEmailError=$sendEmailError, additionalProperties=$additionalProperties}" } diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/PathLookupFilter.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/PathLookupFilter.kt index d1127b0d..5dc888a5 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/PathLookupFilter.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/PathLookupFilter.kt @@ -34,8 +34,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - /** Denotes the type of filter as a path-lookup filter */ fun type(): Type = type.getRequired("type") @@ -87,34 +85,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is PathLookupFilter && - this.type == other.type && - this.path == other.path && - this.value == other.value && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - type, - path, - value, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "PathLookupFilter{type=$type, path=$path, value=$value, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -205,7 +175,7 @@ private constructor( return true } - return other is Type && this.value == other.value + return /* spotless:off */ other is Type && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -242,4 +212,24 @@ private constructor( fun asString(): String = _value().asStringOrThrow() } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is PathLookupFilter && this.type == other.type && this.path == other.path && this.value == other.value && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(type, path, value, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "PathLookupFilter{type=$type, path=$path, value=$value, additionalProperties=$additionalProperties}" } diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/Project.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/Project.kt index abc37a0a..8b2ed686 100644 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/Project.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/Project.kt @@ -32,8 +32,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - /** Unique identifier for the project */ fun id(): String = id.getRequired("id") @@ -95,42 +93,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Project && - this.id == other.id && - this.orgId == other.orgId && - this.name == other.name && - this.created == other.created && - this.deletedAt == other.deletedAt && - this.userId == other.userId && - this.settings == other.settings && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - id, - orgId, - name, - created, - deletedAt, - userId, - settings, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "Project{id=$id, orgId=$orgId, name=$name, created=$created, deletedAt=$deletedAt, userId=$userId, settings=$settings, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -237,4 +199,24 @@ private constructor( additionalProperties.toUnmodifiable(), ) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Project && this.id == other.id && this.orgId == other.orgId && this.name == other.name && this.created == other.created && this.deletedAt == other.deletedAt && this.userId == other.userId && this.settings == other.settings && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(id, orgId, name, created, deletedAt, userId, settings, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "Project{id=$id, orgId=$orgId, name=$name, created=$created, deletedAt=$deletedAt, userId=$userId, settings=$settings, additionalProperties=$additionalProperties}" } diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectCreateParams.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectCreateParams.kt index 6a037704..bcb55527 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectCreateParams.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectCreateParams.kt @@ -49,8 +49,6 @@ constructor( private val additionalProperties: Map, ) { - private var hashCode: Int = 0 - /** Name of the project */ @JsonProperty("name") fun name(): String? = name @@ -67,32 +65,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is ProjectCreateBody && - this.name == other.name && - this.orgName == other.orgName && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - name, - orgName, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "ProjectCreateBody{name=$name, orgName=$orgName, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -143,6 +115,26 @@ constructor( additionalProperties.toUnmodifiable(), ) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is ProjectCreateBody && this.name == other.name && this.orgName == other.orgName && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(name, orgName, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "ProjectCreateBody{name=$name, orgName=$orgName, additionalProperties=$additionalProperties}" } fun _additionalQueryParams(): Map> = additionalQueryParams @@ -156,22 +148,11 @@ constructor( return true } - return other is ProjectCreateParams && - this.name == other.name && - this.orgName == other.orgName && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders && - this.additionalBodyProperties == other.additionalBodyProperties + return /* spotless:off */ other is ProjectCreateParams && this.name == other.name && this.orgName == other.orgName && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders && this.additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - name, - orgName, - additionalQueryParams, - additionalHeaders, - additionalBodyProperties, - ) + return /* spotless:off */ Objects.hash(name, orgName, additionalQueryParams, additionalHeaders, additionalBodyProperties) /* spotless:on */ } override fun toString() = diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectDeleteParams.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectDeleteParams.kt index 830d84e9..132d0c2a 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectDeleteParams.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectDeleteParams.kt @@ -46,20 +46,11 @@ constructor( return true } - return other is ProjectDeleteParams && - this.projectId == other.projectId && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders && - this.additionalBodyProperties == other.additionalBodyProperties + return /* spotless:off */ other is ProjectDeleteParams && this.projectId == other.projectId && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders && this.additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - projectId, - additionalQueryParams, - additionalHeaders, - additionalBodyProperties, - ) + return /* spotless:off */ Objects.hash(projectId, additionalQueryParams, additionalHeaders, additionalBodyProperties) /* spotless:on */ } override fun toString() = diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectListPage.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectListPage.kt index 11d4f3b9..fece2a7d 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectListPage.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectListPage.kt @@ -34,18 +34,11 @@ private constructor( return true } - return other is ProjectListPage && - this.projectsService == other.projectsService && - this.params == other.params && - this.response == other.response + return /* spotless:off */ other is ProjectListPage && this.projectsService == other.projectsService && this.params == other.params && this.response == other.response /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - projectsService, - params, - response, - ) + return /* spotless:off */ Objects.hash(projectsService, params, response) /* spotless:on */ } override fun toString() = @@ -127,13 +120,11 @@ private constructor( return true } - return other is Response && - this.objects == other.objects && - this.additionalProperties == other.additionalProperties + return /* spotless:off */ other is Response && this.objects == other.objects && this.additionalProperties == other.additionalProperties /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash(objects, additionalProperties) + return /* spotless:off */ Objects.hash(objects, additionalProperties) /* spotless:on */ } override fun toString() = diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectListPageAsync.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectListPageAsync.kt index 15bb897c..401fb412 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectListPageAsync.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectListPageAsync.kt @@ -35,18 +35,11 @@ private constructor( return true } - return other is ProjectListPageAsync && - this.projectsService == other.projectsService && - this.params == other.params && - this.response == other.response + return /* spotless:off */ other is ProjectListPageAsync && this.projectsService == other.projectsService && this.params == other.params && this.response == other.response /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - projectsService, - params, - response, - ) + return /* spotless:off */ Objects.hash(projectsService, params, response) /* spotless:on */ } override fun toString() = @@ -134,13 +127,11 @@ private constructor( return true } - return other is Response && - this.objects == other.objects && - this.additionalProperties == other.additionalProperties + return /* spotless:off */ other is Response && this.objects == other.objects && this.additionalProperties == other.additionalProperties /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash(objects, additionalProperties) + return /* spotless:off */ Objects.hash(objects, additionalProperties) /* spotless:on */ } override fun toString() = diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectListParams.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectListParams.kt index 9cd5e09b..19ebdba0 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectListParams.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectListParams.kt @@ -68,28 +68,11 @@ constructor( return true } - return other is ProjectListParams && - this.endingBefore == other.endingBefore && - this.ids == other.ids && - this.limit == other.limit && - this.orgName == other.orgName && - this.projectName == other.projectName && - this.startingAfter == other.startingAfter && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders + return /* spotless:off */ other is ProjectListParams && this.endingBefore == other.endingBefore && this.ids == other.ids && this.limit == other.limit && this.orgName == other.orgName && this.projectName == other.projectName && this.startingAfter == other.startingAfter && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - endingBefore, - ids, - limit, - orgName, - projectName, - startingAfter, - additionalQueryParams, - additionalHeaders, - ) + return /* spotless:off */ Objects.hash(endingBefore, ids, limit, orgName, projectName, startingAfter, additionalQueryParams, additionalHeaders) /* spotless:on */ } override fun toString() = @@ -151,7 +134,7 @@ constructor( * Filter search results to a particular set of object IDs. To specify a list of IDs, * include the query param multiple times */ - fun ids(strings: List) = apply { this.ids = Ids.ofStrings(strings) } + fun idsOfStrings(strings: List) = apply { this.ids = Ids.ofStrings(strings) } /** Limit the number of objects to return */ fun limit(limit: Long) = apply { this.limit = limit } @@ -271,11 +254,11 @@ constructor( return true } - return other is Ids && this.string == other.string && this.strings == other.strings + return /* spotless:off */ other is Ids && this.string == other.string && this.strings == other.strings /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash(string, strings) + return /* spotless:off */ Objects.hash(string, strings) /* spotless:on */ } override fun toString(): String { @@ -309,6 +292,7 @@ constructor( override fun ObjectCodec.deserialize(node: JsonNode): Ids { val json = JsonValue.fromJsonNode(node) + tryDeserialize(node, jacksonTypeRef())?.let { return Ids(string = it, _json = json) } diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectLogFeedbackParams.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectLogFeedbackParams.kt index 5d6b1011..b94e9eb8 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectLogFeedbackParams.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectLogFeedbackParams.kt @@ -50,8 +50,6 @@ constructor( private val additionalProperties: Map, ) { - private var hashCode: Int = 0 - /** A list of project logs feedback items */ @JsonProperty("feedback") fun feedback(): List? = feedback @@ -61,26 +59,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is ProjectLogFeedbackBody && - this.feedback == other.feedback && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = Objects.hash(feedback, additionalProperties) - } - return hashCode - } - - override fun toString() = - "ProjectLogFeedbackBody{feedback=$feedback, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -124,6 +102,26 @@ constructor( additionalProperties.toUnmodifiable() ) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is ProjectLogFeedbackBody && this.feedback == other.feedback && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(feedback, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "ProjectLogFeedbackBody{feedback=$feedback, additionalProperties=$additionalProperties}" } fun _additionalQueryParams(): Map> = additionalQueryParams @@ -137,22 +135,11 @@ constructor( return true } - return other is ProjectLogFeedbackParams && - this.projectId == other.projectId && - this.feedback == other.feedback && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders && - this.additionalBodyProperties == other.additionalBodyProperties + return /* spotless:off */ other is ProjectLogFeedbackParams && this.projectId == other.projectId && this.feedback == other.feedback && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders && this.additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - projectId, - feedback, - additionalQueryParams, - additionalHeaders, - additionalBodyProperties, - ) + return /* spotless:off */ Objects.hash(projectId, feedback, additionalQueryParams, additionalHeaders, additionalBodyProperties) /* spotless:on */ } override fun toString() = diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectLogFetchParams.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectLogFetchParams.kt index 75f643a0..c24ff3ad 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectLogFetchParams.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectLogFetchParams.kt @@ -58,26 +58,11 @@ constructor( return true } - return other is ProjectLogFetchParams && - this.projectId == other.projectId && - this.limit == other.limit && - this.maxRootSpanId == other.maxRootSpanId && - this.maxXactId == other.maxXactId && - this.version == other.version && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders + return /* spotless:off */ other is ProjectLogFetchParams && this.projectId == other.projectId && this.limit == other.limit && this.maxRootSpanId == other.maxRootSpanId && this.maxXactId == other.maxXactId && this.version == other.version && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - projectId, - limit, - maxRootSpanId, - maxXactId, - version, - additionalQueryParams, - additionalHeaders, - ) + return /* spotless:off */ Objects.hash(projectId, limit, maxRootSpanId, maxXactId, version, additionalQueryParams, additionalHeaders) /* spotless:on */ } override fun toString() = diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectLogFetchPostParams.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectLogFetchPostParams.kt index fe4aed35..8b156a99 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectLogFetchPostParams.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectLogFetchPostParams.kt @@ -79,8 +79,6 @@ constructor( private val additionalProperties: Map, ) { - private var hashCode: Int = 0 - /** * An opaque string to be used as a cursor for the next page of results, in order from * latest to earliest. @@ -159,40 +157,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is ProjectLogFetchPostBody && - this.cursor == other.cursor && - this.filters == other.filters && - this.limit == other.limit && - this.maxRootSpanId == other.maxRootSpanId && - this.maxXactId == other.maxXactId && - this.version == other.version && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - cursor, - filters, - limit, - maxRootSpanId, - maxXactId, - version, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "ProjectLogFetchPostBody{cursor=$cursor, filters=$filters, limit=$limit, maxRootSpanId=$maxRootSpanId, maxXactId=$maxXactId, version=$version, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -320,6 +284,26 @@ constructor( additionalProperties.toUnmodifiable(), ) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is ProjectLogFetchPostBody && this.cursor == other.cursor && this.filters == other.filters && this.limit == other.limit && this.maxRootSpanId == other.maxRootSpanId && this.maxXactId == other.maxXactId && this.version == other.version && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(cursor, filters, limit, maxRootSpanId, maxXactId, version, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "ProjectLogFetchPostBody{cursor=$cursor, filters=$filters, limit=$limit, maxRootSpanId=$maxRootSpanId, maxXactId=$maxXactId, version=$version, additionalProperties=$additionalProperties}" } fun _additionalQueryParams(): Map> = additionalQueryParams @@ -333,32 +317,11 @@ constructor( return true } - return other is ProjectLogFetchPostParams && - this.projectId == other.projectId && - this.cursor == other.cursor && - this.filters == other.filters && - this.limit == other.limit && - this.maxRootSpanId == other.maxRootSpanId && - this.maxXactId == other.maxXactId && - this.version == other.version && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders && - this.additionalBodyProperties == other.additionalBodyProperties + return /* spotless:off */ other is ProjectLogFetchPostParams && this.projectId == other.projectId && this.cursor == other.cursor && this.filters == other.filters && this.limit == other.limit && this.maxRootSpanId == other.maxRootSpanId && this.maxXactId == other.maxXactId && this.version == other.version && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders && this.additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - projectId, - cursor, - filters, - limit, - maxRootSpanId, - maxXactId, - version, - additionalQueryParams, - additionalHeaders, - additionalBodyProperties, - ) + return /* spotless:off */ Objects.hash(projectId, cursor, filters, limit, maxRootSpanId, maxXactId, version, additionalQueryParams, additionalHeaders, additionalBodyProperties) /* spotless:on */ } override fun toString() = diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectLogInsertParams.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectLogInsertParams.kt index abe096e9..02042d61 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectLogInsertParams.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectLogInsertParams.kt @@ -61,8 +61,6 @@ constructor( private val additionalProperties: Map, ) { - private var hashCode: Int = 0 - /** A list of project logs events to insert */ @JsonProperty("events") fun events(): List? = events @@ -72,26 +70,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is ProjectLogInsertBody && - this.events == other.events && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = Objects.hash(events, additionalProperties) - } - return hashCode - } - - override fun toString() = - "ProjectLogInsertBody{events=$events, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -132,6 +110,26 @@ constructor( additionalProperties.toUnmodifiable() ) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is ProjectLogInsertBody && this.events == other.events && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(events, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "ProjectLogInsertBody{events=$events, additionalProperties=$additionalProperties}" } fun _additionalQueryParams(): Map> = additionalQueryParams @@ -145,22 +143,11 @@ constructor( return true } - return other is ProjectLogInsertParams && - this.projectId == other.projectId && - this.events == other.events && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders && - this.additionalBodyProperties == other.additionalBodyProperties + return /* spotless:off */ other is ProjectLogInsertParams && this.projectId == other.projectId && this.events == other.events && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders && this.additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - projectId, - events, - additionalQueryParams, - additionalHeaders, - additionalBodyProperties, - ) + return /* spotless:off */ Objects.hash(projectId, events, additionalQueryParams, additionalHeaders, additionalBodyProperties) /* spotless:on */ } override fun toString() = @@ -322,13 +309,11 @@ constructor( return true } - return other is Event && - this.insertProjectLogsEventReplace == other.insertProjectLogsEventReplace && - this.insertProjectLogsEventMerge == other.insertProjectLogsEventMerge + return /* spotless:off */ other is Event && this.insertProjectLogsEventReplace == other.insertProjectLogsEventReplace && this.insertProjectLogsEventMerge == other.insertProjectLogsEventMerge /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash(insertProjectLogsEventReplace, insertProjectLogsEventMerge) + return /* spotless:off */ Objects.hash(insertProjectLogsEventReplace, insertProjectLogsEventMerge) /* spotless:on */ } override fun toString(): String { @@ -374,6 +359,7 @@ constructor( override fun ObjectCodec.deserialize(node: JsonNode): Event { val json = JsonValue.fromJsonNode(node) + tryDeserialize(node, jacksonTypeRef()) { it.validate() } diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectLogsEvent.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectLogsEvent.kt index 7fec3828..baabf2e2 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectLogsEvent.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectLogsEvent.kt @@ -47,8 +47,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - /** * A unique identifier for the project logs event. If you don't provide one, BrainTrust will * generate one for you @@ -294,66 +292,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is ProjectLogsEvent && - this.id == other.id && - this._xactId == other._xactId && - this.created == other.created && - this.orgId == other.orgId && - this.projectId == other.projectId && - this.logId == other.logId && - this.input == other.input && - this.output == other.output && - this.expected == other.expected && - this.error == other.error && - this.scores == other.scores && - this.metadata == other.metadata && - this.tags == other.tags && - this.metrics == other.metrics && - this.context == other.context && - this.spanId == other.spanId && - this.spanParents == other.spanParents && - this.rootSpanId == other.rootSpanId && - this.spanAttributes == other.spanAttributes && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - id, - _xactId, - created, - orgId, - projectId, - logId, - input, - output, - expected, - error, - scores, - metadata, - tags, - metrics, - context, - spanId, - spanParents, - rootSpanId, - spanAttributes, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "ProjectLogsEvent{id=$id, _xactId=$_xactId, created=$created, orgId=$orgId, projectId=$projectId, logId=$logId, input=$input, output=$output, expected=$expected, error=$error, scores=$scores, metadata=$metadata, tags=$tags, metrics=$metrics, context=$context, spanId=$spanId, spanParents=$spanParents, rootSpanId=$rootSpanId, spanAttributes=$spanAttributes, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -690,7 +628,7 @@ private constructor( return true } - return other is LogId && this.value == other.value + return /* spotless:off */ other is LogId && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -745,8 +683,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - /** The function in code which created the project logs event */ fun callerFunctionname(): Optional = Optional.ofNullable(callerFunctionname.getNullable("caller_functionname")) @@ -785,34 +721,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Context && - this.callerFunctionname == other.callerFunctionname && - this.callerFilename == other.callerFilename && - this.callerLineno == other.callerLineno && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - callerFunctionname, - callerFilename, - callerLineno, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "Context{callerFunctionname=$callerFunctionname, callerFilename=$callerFilename, callerLineno=$callerLineno, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -887,6 +795,26 @@ private constructor( additionalProperties.toUnmodifiable(), ) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Context && this.callerFunctionname == other.callerFunctionname && this.callerFilename == other.callerFilename && this.callerLineno == other.callerLineno && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(callerFunctionname, callerFilename, callerLineno, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "Context{callerFunctionname=$callerFunctionname, callerFilename=$callerFilename, callerLineno=$callerLineno, additionalProperties=$additionalProperties}" } /** @@ -905,8 +833,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -919,23 +845,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Metadata && this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = Objects.hash(additionalProperties) - } - return hashCode - } - - override fun toString() = "Metadata{additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -966,6 +875,25 @@ private constructor( fun build(): Metadata = Metadata(additionalProperties.toUnmodifiable()) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Metadata && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = "Metadata{additionalProperties=$additionalProperties}" } /** @@ -987,8 +915,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - /** * A unix timestamp recording when the section of code which produced the project logs event * started @@ -1064,38 +990,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Metrics && - this.start == other.start && - this.end == other.end && - this.promptTokens == other.promptTokens && - this.completionTokens == other.completionTokens && - this.tokens == other.tokens && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - start, - end, - promptTokens, - completionTokens, - tokens, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "Metrics{start=$start, end=$end, promptTokens=$promptTokens, completionTokens=$completionTokens, tokens=$tokens, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -1213,6 +1107,26 @@ private constructor( additionalProperties.toUnmodifiable(), ) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Metrics && this.start == other.start && this.end == other.end && this.promptTokens == other.promptTokens && this.completionTokens == other.completionTokens && this.tokens == other.tokens && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(start, end, promptTokens, completionTokens, tokens, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "Metrics{start=$start, end=$end, promptTokens=$promptTokens, completionTokens=$completionTokens, tokens=$tokens, additionalProperties=$additionalProperties}" } /** @@ -1233,8 +1147,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -1247,23 +1159,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Scores && this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = Objects.hash(additionalProperties) - } - return hashCode - } - - override fun toString() = "Scores{additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -1294,6 +1189,25 @@ private constructor( fun build(): Scores = Scores(additionalProperties.toUnmodifiable()) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Scores && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = "Scores{additionalProperties=$additionalProperties}" } /** Human-identifying attributes of the span, such as name, type, etc. */ @@ -1308,8 +1222,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - /** Name of the span, for display purposes only */ fun name(): Optional = Optional.ofNullable(name.getNullable("name")) @@ -1336,32 +1248,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is SpanAttributes && - this.name == other.name && - this.type == other.type && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - name, - type, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "SpanAttributes{name=$name, type=$type, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -1431,7 +1317,7 @@ private constructor( return true } - return other is Type && this.value == other.value + return /* spotless:off */ other is Type && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -1498,5 +1384,45 @@ private constructor( fun asString(): String = _value().asStringOrThrow() } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is SpanAttributes && this.name == other.name && this.type == other.type && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(name, type, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "SpanAttributes{name=$name, type=$type, additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is ProjectLogsEvent && this.id == other.id && this._xactId == other._xactId && this.created == other.created && this.orgId == other.orgId && this.projectId == other.projectId && this.logId == other.logId && this.input == other.input && this.output == other.output && this.expected == other.expected && this.error == other.error && this.scores == other.scores && this.metadata == other.metadata && this.tags == other.tags && this.metrics == other.metrics && this.context == other.context && this.spanId == other.spanId && this.spanParents == other.spanParents && this.rootSpanId == other.rootSpanId && this.spanAttributes == other.spanAttributes && this.additionalProperties == other.additionalProperties /* spotless:on */ } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(id, _xactId, created, orgId, projectId, logId, input, output, expected, error, scores, metadata, tags, metrics, context, spanId, spanParents, rootSpanId, spanAttributes, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "ProjectLogsEvent{id=$id, _xactId=$_xactId, created=$created, orgId=$orgId, projectId=$projectId, logId=$logId, input=$input, output=$output, expected=$expected, error=$error, scores=$scores, metadata=$metadata, tags=$tags, metrics=$metrics, context=$context, spanId=$spanId, spanParents=$spanParents, rootSpanId=$rootSpanId, spanAttributes=$spanAttributes, additionalProperties=$additionalProperties}" } diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectRetrieveParams.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectRetrieveParams.kt index 37a0e287..8c8116df 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectRetrieveParams.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectRetrieveParams.kt @@ -36,18 +36,11 @@ constructor( return true } - return other is ProjectRetrieveParams && - this.projectId == other.projectId && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders + return /* spotless:off */ other is ProjectRetrieveParams && this.projectId == other.projectId && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - projectId, - additionalQueryParams, - additionalHeaders, - ) + return /* spotless:off */ Objects.hash(projectId, additionalQueryParams, additionalHeaders) /* spotless:on */ } override fun toString() = diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectScore.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectScore.kt index 41a70ed4..6f268c6e 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectScore.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectScore.kt @@ -46,8 +46,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - /** Unique identifier for the project score */ fun id(): String = id.getRequired("id") @@ -126,48 +124,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is ProjectScore && - this.id == other.id && - this.projectId == other.projectId && - this.userId == other.userId && - this.created == other.created && - this.name == other.name && - this.description == other.description && - this.scoreType == other.scoreType && - this.categories == other.categories && - this.config == other.config && - this.position == other.position && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - id, - projectId, - userId, - created, - name, - description, - scoreType, - categories, - config, - position, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "ProjectScore{id=$id, projectId=$projectId, userId=$userId, created=$created, name=$name, description=$description, scoreType=$scoreType, categories=$categories, config=$config, position=$position, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -308,9 +264,9 @@ private constructor( @JsonSerialize(using = Categories.Serializer::class) class Categories private constructor( - private val projectScoreCategories: List? = null, + private val categorical: List? = null, private val weighted: Weighted? = null, - private val strings: List? = null, + private val minimum: List? = null, private val nullableVariant: NullableVariant? = null, private val _json: JsonValue? = null, ) { @@ -318,29 +274,27 @@ private constructor( private var validated: Boolean = false /** For categorical-type project scores, the list of all categories */ - fun projectScoreCategories(): Optional> = - Optional.ofNullable(projectScoreCategories) + fun categorical(): Optional> = Optional.ofNullable(categorical) /** For weighted-type project scores, the weights of each score */ fun weighted(): Optional = Optional.ofNullable(weighted) /** For minimum-type project scores, the list of included scores */ - fun strings(): Optional> = Optional.ofNullable(strings) + fun minimum(): Optional> = Optional.ofNullable(minimum) fun nullableVariant(): Optional = Optional.ofNullable(nullableVariant) - fun isProjectScoreCategories(): Boolean = projectScoreCategories != null + fun isCategorical(): Boolean = categorical != null fun isWeighted(): Boolean = weighted != null - fun isStrings(): Boolean = strings != null + fun isMinimum(): Boolean = minimum != null fun isNullableVariant(): Boolean = nullableVariant != null - fun asProjectScoreCategories(): List = - projectScoreCategories.getOrThrow("projectScoreCategories") + fun asCategorical(): List = categorical.getOrThrow("categorical") fun asWeighted(): Weighted = weighted.getOrThrow("weighted") - fun asStrings(): List = strings.getOrThrow("strings") + fun asMinimum(): List = minimum.getOrThrow("minimum") fun asNullableVariant(): NullableVariant = nullableVariant.getOrThrow("nullableVariant") @@ -348,10 +302,9 @@ private constructor( fun accept(visitor: Visitor): T { return when { - projectScoreCategories != null -> - visitor.visitProjectScoreCategories(projectScoreCategories) + categorical != null -> visitor.visitCategorical(categorical) weighted != null -> visitor.visitWeighted(weighted) - strings != null -> visitor.visitStrings(strings) + minimum != null -> visitor.visitMinimum(minimum) nullableVariant != null -> visitor.visitNullableVariant(nullableVariant) else -> visitor.unknown(_json) } @@ -360,14 +313,14 @@ private constructor( fun validate(): Categories = apply { if (!validated) { if ( - projectScoreCategories == null && + categorical == null && weighted == null && - strings == null && + minimum == null && nullableVariant == null ) { throw BraintrustInvalidDataException("Unknown Categories: $_json") } - projectScoreCategories?.forEach { it.validate() } + categorical?.forEach { it.validate() } weighted?.validate() nullableVariant?.validate() validated = true @@ -379,28 +332,18 @@ private constructor( return true } - return other is Categories && - this.projectScoreCategories == other.projectScoreCategories && - this.weighted == other.weighted && - this.strings == other.strings && - this.nullableVariant == other.nullableVariant + return /* spotless:off */ other is Categories && this.categorical == other.categorical && this.weighted == other.weighted && this.minimum == other.minimum && this.nullableVariant == other.nullableVariant /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - projectScoreCategories, - weighted, - strings, - nullableVariant, - ) + return /* spotless:off */ Objects.hash(categorical, weighted, minimum, nullableVariant) /* spotless:on */ } override fun toString(): String { return when { - projectScoreCategories != null -> - "Categories{projectScoreCategories=$projectScoreCategories}" + categorical != null -> "Categories{categorical=$categorical}" weighted != null -> "Categories{weighted=$weighted}" - strings != null -> "Categories{strings=$strings}" + minimum != null -> "Categories{minimum=$minimum}" nullableVariant != null -> "Categories{nullableVariant=$nullableVariant}" _json != null -> "Categories{_unknown=$_json}" else -> throw IllegalStateException("Invalid Categories") @@ -410,12 +353,12 @@ private constructor( companion object { @JvmStatic - fun ofProjectScoreCategories(projectScoreCategories: List) = - Categories(projectScoreCategories = projectScoreCategories) + fun ofCategorical(categorical: List) = + Categories(categorical = categorical) @JvmStatic fun ofWeighted(weighted: Weighted) = Categories(weighted = weighted) - @JvmStatic fun ofStrings(strings: List) = Categories(strings = strings) + @JvmStatic fun ofMinimum(minimum: List) = Categories(minimum = minimum) @JvmStatic fun ofNullableVariant(nullableVariant: NullableVariant) = @@ -424,11 +367,11 @@ private constructor( interface Visitor { - fun visitProjectScoreCategories(projectScoreCategories: List): T + fun visitCategorical(categorical: List): T fun visitWeighted(weighted: Weighted): T - fun visitStrings(strings: List): T + fun visitMinimum(minimum: List): T fun visitNullableVariant(nullableVariant: NullableVariant): T @@ -441,18 +384,19 @@ private constructor( override fun ObjectCodec.deserialize(node: JsonNode): Categories { val json = JsonValue.fromJsonNode(node) + tryDeserialize(node, jacksonTypeRef>()) { it.forEach { it.validate() } } ?.let { - return Categories(projectScoreCategories = it, _json = json) + return Categories(categorical = it, _json = json) } tryDeserialize(node, jacksonTypeRef()) { it.validate() } ?.let { return Categories(weighted = it, _json = json) } tryDeserialize(node, jacksonTypeRef>())?.let { - return Categories(strings = it, _json = json) + return Categories(minimum = it, _json = json) } tryDeserialize(node, jacksonTypeRef()) { it.validate() } ?.let { @@ -471,10 +415,9 @@ private constructor( provider: SerializerProvider ) { when { - value.projectScoreCategories != null -> - generator.writeObject(value.projectScoreCategories) + value.categorical != null -> generator.writeObject(value.categorical) value.weighted != null -> generator.writeObject(value.weighted) - value.strings != null -> generator.writeObject(value.strings) + value.minimum != null -> generator.writeObject(value.minimum) value.nullableVariant != null -> generator.writeObject(value.nullableVariant) value._json != null -> generator.writeObject(value._json) else -> throw IllegalStateException("Invalid Categories") @@ -492,8 +435,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -506,23 +447,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Weighted && this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = Objects.hash(additionalProperties) - } - return hashCode - } - - override fun toString() = "Weighted{additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -554,6 +478,25 @@ private constructor( fun build(): Weighted = Weighted(additionalProperties.toUnmodifiable()) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Weighted && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = "Weighted{additionalProperties=$additionalProperties}" } @JsonDeserialize(builder = NullableVariant.Builder::class) @@ -565,8 +508,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -579,24 +520,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is NullableVariant && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = Objects.hash(additionalProperties) - } - return hashCode - } - - override fun toString() = "NullableVariant{additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -629,6 +552,45 @@ private constructor( fun build(): NullableVariant = NullableVariant(additionalProperties.toUnmodifiable()) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is NullableVariant && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = "NullableVariant{additionalProperties=$additionalProperties}" + } + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true } + + return /* spotless:off */ other is ProjectScore && this.id == other.id && this.projectId == other.projectId && this.userId == other.userId && this.created == other.created && this.name == other.name && this.description == other.description && this.scoreType == other.scoreType && this.categories == other.categories && this.config == other.config && this.position == other.position && this.additionalProperties == other.additionalProperties /* spotless:on */ } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(id, projectId, userId, created, name, description, scoreType, categories, config, position, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "ProjectScore{id=$id, projectId=$projectId, userId=$userId, created=$created, name=$name, description=$description, scoreType=$scoreType, categories=$categories, config=$config, position=$position, additionalProperties=$additionalProperties}" } diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectScoreCategory.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectScoreCategory.kt index e7c56679..b131ecb5 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectScoreCategory.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectScoreCategory.kt @@ -26,8 +26,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - /** Name of the category */ fun name(): String = name.getRequired("name") @@ -54,32 +52,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is ProjectScoreCategory && - this.name == other.name && - this.value == other.value && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - name, - value, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "ProjectScoreCategory{name=$name, value=$value, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -135,4 +107,24 @@ private constructor( additionalProperties.toUnmodifiable(), ) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is ProjectScoreCategory && this.name == other.name && this.value == other.value && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(name, value, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "ProjectScoreCategory{name=$name, value=$value, additionalProperties=$additionalProperties}" } diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectScoreConfig.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectScoreConfig.kt index af9b299e..b60f236b 100644 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectScoreConfig.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectScoreConfig.kt @@ -30,8 +30,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - fun multiSelect(): Optional = Optional.ofNullable(multiSelect.getNullable("multi_select")) @@ -61,34 +59,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is ProjectScoreConfig && - this.multiSelect == other.multiSelect && - this.destination == other.destination && - this.online == other.online && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - multiSelect, - destination, - online, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "ProjectScoreConfig{multiSelect=$multiSelect, destination=$destination, online=$online, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -165,7 +135,7 @@ private constructor( return true } - return other is Destination && this.value == other.value + return /* spotless:off */ other is Destination && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -202,4 +172,24 @@ private constructor( fun asString(): String = _value().asStringOrThrow() } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is ProjectScoreConfig && this.multiSelect == other.multiSelect && this.destination == other.destination && this.online == other.online && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(multiSelect, destination, online, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "ProjectScoreConfig{multiSelect=$multiSelect, destination=$destination, online=$online, additionalProperties=$additionalProperties}" } diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectScoreCreateParams.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectScoreCreateParams.kt index fa6fc588..cf6447ea 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectScoreCreateParams.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectScoreCreateParams.kt @@ -80,8 +80,6 @@ constructor( private val additionalProperties: Map, ) { - private var hashCode: Int = 0 - /** Name of the project score */ @JsonProperty("name") fun name(): String? = name @@ -104,40 +102,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is ProjectScoreCreateBody && - this.name == other.name && - this.projectId == other.projectId && - this.scoreType == other.scoreType && - this.categories == other.categories && - this.config == other.config && - this.description == other.description && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - name, - projectId, - scoreType, - categories, - config, - description, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "ProjectScoreCreateBody{name=$name, projectId=$projectId, scoreType=$scoreType, categories=$categories, config=$config, description=$description, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -210,6 +174,26 @@ constructor( additionalProperties.toUnmodifiable(), ) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is ProjectScoreCreateBody && this.name == other.name && this.projectId == other.projectId && this.scoreType == other.scoreType && this.categories == other.categories && this.config == other.config && this.description == other.description && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(name, projectId, scoreType, categories, config, description, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "ProjectScoreCreateBody{name=$name, projectId=$projectId, scoreType=$scoreType, categories=$categories, config=$config, description=$description, additionalProperties=$additionalProperties}" } fun _additionalQueryParams(): Map> = additionalQueryParams @@ -223,30 +207,11 @@ constructor( return true } - return other is ProjectScoreCreateParams && - this.name == other.name && - this.projectId == other.projectId && - this.scoreType == other.scoreType && - this.categories == other.categories && - this.config == other.config && - this.description == other.description && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders && - this.additionalBodyProperties == other.additionalBodyProperties + return /* spotless:off */ other is ProjectScoreCreateParams && this.name == other.name && this.projectId == other.projectId && this.scoreType == other.scoreType && this.categories == other.categories && this.config == other.config && this.description == other.description && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders && this.additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - name, - projectId, - scoreType, - categories, - config, - description, - additionalQueryParams, - additionalHeaders, - additionalBodyProperties, - ) + return /* spotless:off */ Objects.hash(name, projectId, scoreType, categories, config, description, additionalQueryParams, additionalHeaders, additionalBodyProperties) /* spotless:on */ } override fun toString() = @@ -298,8 +263,8 @@ constructor( fun categories(categories: Categories) = apply { this.categories = categories } /** For categorical-type project scores, the list of all categories */ - fun categories(projectScoreCategories: List) = apply { - this.categories = Categories.ofProjectScoreCategories(projectScoreCategories) + fun categoriesOfCategorical(categorical: List) = apply { + this.categories = Categories.ofCategorical(categorical) } /** For categorical-type project scores, the list of all categories */ @@ -308,8 +273,8 @@ constructor( } /** For categorical-type project scores, the list of all categories */ - fun categories(strings: List) = apply { - this.categories = Categories.ofStrings(strings) + fun categoriesOfMinimum(minimum: List) = apply { + this.categories = Categories.ofMinimum(minimum) } /** For categorical-type project scores, the list of all categories */ @@ -394,9 +359,9 @@ constructor( @JsonSerialize(using = Categories.Serializer::class) class Categories private constructor( - private val projectScoreCategories: List? = null, + private val categorical: List? = null, private val weighted: Weighted? = null, - private val strings: List? = null, + private val minimum: List? = null, private val nullableVariant: NullableVariant? = null, private val _json: JsonValue? = null, ) { @@ -404,29 +369,27 @@ constructor( private var validated: Boolean = false /** For categorical-type project scores, the list of all categories */ - fun projectScoreCategories(): Optional> = - Optional.ofNullable(projectScoreCategories) + fun categorical(): Optional> = Optional.ofNullable(categorical) /** For weighted-type project scores, the weights of each score */ fun weighted(): Optional = Optional.ofNullable(weighted) /** For minimum-type project scores, the list of included scores */ - fun strings(): Optional> = Optional.ofNullable(strings) + fun minimum(): Optional> = Optional.ofNullable(minimum) fun nullableVariant(): Optional = Optional.ofNullable(nullableVariant) - fun isProjectScoreCategories(): Boolean = projectScoreCategories != null + fun isCategorical(): Boolean = categorical != null fun isWeighted(): Boolean = weighted != null - fun isStrings(): Boolean = strings != null + fun isMinimum(): Boolean = minimum != null fun isNullableVariant(): Boolean = nullableVariant != null - fun asProjectScoreCategories(): List = - projectScoreCategories.getOrThrow("projectScoreCategories") + fun asCategorical(): List = categorical.getOrThrow("categorical") fun asWeighted(): Weighted = weighted.getOrThrow("weighted") - fun asStrings(): List = strings.getOrThrow("strings") + fun asMinimum(): List = minimum.getOrThrow("minimum") fun asNullableVariant(): NullableVariant = nullableVariant.getOrThrow("nullableVariant") @@ -434,10 +397,9 @@ constructor( fun accept(visitor: Visitor): T { return when { - projectScoreCategories != null -> - visitor.visitProjectScoreCategories(projectScoreCategories) + categorical != null -> visitor.visitCategorical(categorical) weighted != null -> visitor.visitWeighted(weighted) - strings != null -> visitor.visitStrings(strings) + minimum != null -> visitor.visitMinimum(minimum) nullableVariant != null -> visitor.visitNullableVariant(nullableVariant) else -> visitor.unknown(_json) } @@ -446,14 +408,14 @@ constructor( fun validate(): Categories = apply { if (!validated) { if ( - projectScoreCategories == null && + categorical == null && weighted == null && - strings == null && + minimum == null && nullableVariant == null ) { throw BraintrustInvalidDataException("Unknown Categories: $_json") } - projectScoreCategories?.forEach { it.validate() } + categorical?.forEach { it.validate() } weighted?.validate() nullableVariant?.validate() validated = true @@ -465,28 +427,18 @@ constructor( return true } - return other is Categories && - this.projectScoreCategories == other.projectScoreCategories && - this.weighted == other.weighted && - this.strings == other.strings && - this.nullableVariant == other.nullableVariant + return /* spotless:off */ other is Categories && this.categorical == other.categorical && this.weighted == other.weighted && this.minimum == other.minimum && this.nullableVariant == other.nullableVariant /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - projectScoreCategories, - weighted, - strings, - nullableVariant, - ) + return /* spotless:off */ Objects.hash(categorical, weighted, minimum, nullableVariant) /* spotless:on */ } override fun toString(): String { return when { - projectScoreCategories != null -> - "Categories{projectScoreCategories=$projectScoreCategories}" + categorical != null -> "Categories{categorical=$categorical}" weighted != null -> "Categories{weighted=$weighted}" - strings != null -> "Categories{strings=$strings}" + minimum != null -> "Categories{minimum=$minimum}" nullableVariant != null -> "Categories{nullableVariant=$nullableVariant}" _json != null -> "Categories{_unknown=$_json}" else -> throw IllegalStateException("Invalid Categories") @@ -496,12 +448,12 @@ constructor( companion object { @JvmStatic - fun ofProjectScoreCategories(projectScoreCategories: List) = - Categories(projectScoreCategories = projectScoreCategories) + fun ofCategorical(categorical: List) = + Categories(categorical = categorical) @JvmStatic fun ofWeighted(weighted: Weighted) = Categories(weighted = weighted) - @JvmStatic fun ofStrings(strings: List) = Categories(strings = strings) + @JvmStatic fun ofMinimum(minimum: List) = Categories(minimum = minimum) @JvmStatic fun ofNullableVariant(nullableVariant: NullableVariant) = @@ -510,11 +462,11 @@ constructor( interface Visitor { - fun visitProjectScoreCategories(projectScoreCategories: List): T + fun visitCategorical(categorical: List): T fun visitWeighted(weighted: Weighted): T - fun visitStrings(strings: List): T + fun visitMinimum(minimum: List): T fun visitNullableVariant(nullableVariant: NullableVariant): T @@ -527,18 +479,19 @@ constructor( override fun ObjectCodec.deserialize(node: JsonNode): Categories { val json = JsonValue.fromJsonNode(node) + tryDeserialize(node, jacksonTypeRef>()) { it.forEach { it.validate() } } ?.let { - return Categories(projectScoreCategories = it, _json = json) + return Categories(categorical = it, _json = json) } tryDeserialize(node, jacksonTypeRef()) { it.validate() } ?.let { return Categories(weighted = it, _json = json) } tryDeserialize(node, jacksonTypeRef>())?.let { - return Categories(strings = it, _json = json) + return Categories(minimum = it, _json = json) } tryDeserialize(node, jacksonTypeRef()) { it.validate() } ?.let { @@ -557,10 +510,9 @@ constructor( provider: SerializerProvider ) { when { - value.projectScoreCategories != null -> - generator.writeObject(value.projectScoreCategories) + value.categorical != null -> generator.writeObject(value.categorical) value.weighted != null -> generator.writeObject(value.weighted) - value.strings != null -> generator.writeObject(value.strings) + value.minimum != null -> generator.writeObject(value.minimum) value.nullableVariant != null -> generator.writeObject(value.nullableVariant) value._json != null -> generator.writeObject(value._json) else -> throw IllegalStateException("Invalid Categories") @@ -578,8 +530,6 @@ constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -592,23 +542,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Weighted && this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = Objects.hash(additionalProperties) - } - return hashCode - } - - override fun toString() = "Weighted{additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -640,6 +573,25 @@ constructor( fun build(): Weighted = Weighted(additionalProperties.toUnmodifiable()) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Weighted && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = "Weighted{additionalProperties=$additionalProperties}" } @JsonDeserialize(builder = NullableVariant.Builder::class) @@ -651,8 +603,6 @@ constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -665,24 +615,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is NullableVariant && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = Objects.hash(additionalProperties) - } - return hashCode - } - - override fun toString() = "NullableVariant{additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -715,6 +647,25 @@ constructor( fun build(): NullableVariant = NullableVariant(additionalProperties.toUnmodifiable()) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is NullableVariant && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = "NullableVariant{additionalProperties=$additionalProperties}" } } } diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectScoreDeleteParams.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectScoreDeleteParams.kt index 23ff689d..a528d830 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectScoreDeleteParams.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectScoreDeleteParams.kt @@ -46,20 +46,11 @@ constructor( return true } - return other is ProjectScoreDeleteParams && - this.projectScoreId == other.projectScoreId && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders && - this.additionalBodyProperties == other.additionalBodyProperties + return /* spotless:off */ other is ProjectScoreDeleteParams && this.projectScoreId == other.projectScoreId && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders && this.additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - projectScoreId, - additionalQueryParams, - additionalHeaders, - additionalBodyProperties, - ) + return /* spotless:off */ Objects.hash(projectScoreId, additionalQueryParams, additionalHeaders, additionalBodyProperties) /* spotless:on */ } override fun toString() = diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectScoreListPage.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectScoreListPage.kt index f638afa9..b7a3af06 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectScoreListPage.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectScoreListPage.kt @@ -34,18 +34,11 @@ private constructor( return true } - return other is ProjectScoreListPage && - this.projectScoresService == other.projectScoresService && - this.params == other.params && - this.response == other.response + return /* spotless:off */ other is ProjectScoreListPage && this.projectScoresService == other.projectScoresService && this.params == other.params && this.response == other.response /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - projectScoresService, - params, - response, - ) + return /* spotless:off */ Objects.hash(projectScoresService, params, response) /* spotless:on */ } override fun toString() = @@ -131,13 +124,11 @@ private constructor( return true } - return other is Response && - this.objects == other.objects && - this.additionalProperties == other.additionalProperties + return /* spotless:off */ other is Response && this.objects == other.objects && this.additionalProperties == other.additionalProperties /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash(objects, additionalProperties) + return /* spotless:off */ Objects.hash(objects, additionalProperties) /* spotless:on */ } override fun toString() = diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectScoreListPageAsync.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectScoreListPageAsync.kt index 961d9012..6efe963c 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectScoreListPageAsync.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectScoreListPageAsync.kt @@ -35,18 +35,11 @@ private constructor( return true } - return other is ProjectScoreListPageAsync && - this.projectScoresService == other.projectScoresService && - this.params == other.params && - this.response == other.response + return /* spotless:off */ other is ProjectScoreListPageAsync && this.projectScoresService == other.projectScoresService && this.params == other.params && this.response == other.response /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - projectScoresService, - params, - response, - ) + return /* spotless:off */ Objects.hash(projectScoresService, params, response) /* spotless:on */ } override fun toString() = @@ -134,13 +127,11 @@ private constructor( return true } - return other is Response && - this.objects == other.objects && - this.additionalProperties == other.additionalProperties + return /* spotless:off */ other is Response && this.objects == other.objects && this.additionalProperties == other.additionalProperties /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash(objects, additionalProperties) + return /* spotless:off */ Objects.hash(objects, additionalProperties) /* spotless:on */ } override fun toString() = diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectScoreListParams.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectScoreListParams.kt index a2d3f5fd..ab95668d 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectScoreListParams.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectScoreListParams.kt @@ -80,34 +80,11 @@ constructor( return true } - return other is ProjectScoreListParams && - this.endingBefore == other.endingBefore && - this.ids == other.ids && - this.limit == other.limit && - this.orgName == other.orgName && - this.projectId == other.projectId && - this.projectName == other.projectName && - this.projectScoreName == other.projectScoreName && - this.scoreType == other.scoreType && - this.startingAfter == other.startingAfter && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders + return /* spotless:off */ other is ProjectScoreListParams && this.endingBefore == other.endingBefore && this.ids == other.ids && this.limit == other.limit && this.orgName == other.orgName && this.projectId == other.projectId && this.projectName == other.projectName && this.projectScoreName == other.projectScoreName && this.scoreType == other.scoreType && this.startingAfter == other.startingAfter && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - endingBefore, - ids, - limit, - orgName, - projectId, - projectName, - projectScoreName, - scoreType, - startingAfter, - additionalQueryParams, - additionalHeaders, - ) + return /* spotless:off */ Objects.hash(endingBefore, ids, limit, orgName, projectId, projectName, projectScoreName, scoreType, startingAfter, additionalQueryParams, additionalHeaders) /* spotless:on */ } override fun toString() = @@ -175,7 +152,7 @@ constructor( * Filter search results to a particular set of object IDs. To specify a list of IDs, * include the query param multiple times */ - fun ids(strings: List) = apply { this.ids = Ids.ofStrings(strings) } + fun idsOfStrings(strings: List) = apply { this.ids = Ids.ofStrings(strings) } /** Limit the number of objects to return */ fun limit(limit: Long) = apply { this.limit = limit } @@ -203,7 +180,7 @@ constructor( } /** The type of the configured score */ - fun scoreType(projectScoreTypes: List) = apply { + fun scoreTypeOfProjectScoreTypes(projectScoreTypes: List) = apply { this.scoreType = ScoreType.ofProjectScoreTypes(projectScoreTypes) } @@ -319,11 +296,11 @@ constructor( return true } - return other is Ids && this.string == other.string && this.strings == other.strings + return /* spotless:off */ other is Ids && this.string == other.string && this.strings == other.strings /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash(string, strings) + return /* spotless:off */ Objects.hash(string, strings) /* spotless:on */ } override fun toString(): String { @@ -357,6 +334,7 @@ constructor( override fun ObjectCodec.deserialize(node: JsonNode): Ids { val json = JsonValue.fromJsonNode(node) + tryDeserialize(node, jacksonTypeRef())?.let { return Ids(string = it, _json = json) } @@ -435,13 +413,11 @@ constructor( return true } - return other is ScoreType && - this.projectScoreType == other.projectScoreType && - this.projectScoreTypes == other.projectScoreTypes + return /* spotless:off */ other is ScoreType && this.projectScoreType == other.projectScoreType && this.projectScoreTypes == other.projectScoreTypes /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash(projectScoreType, projectScoreTypes) + return /* spotless:off */ Objects.hash(projectScoreType, projectScoreTypes) /* spotless:on */ } override fun toString(): String { @@ -479,6 +455,7 @@ constructor( override fun ObjectCodec.deserialize(node: JsonNode): ScoreType { val json = JsonValue.fromJsonNode(node) + tryDeserialize(node, jacksonTypeRef())?.let { return ScoreType(projectScoreType = it, _json = json) } diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectScoreReplaceParams.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectScoreReplaceParams.kt index ad05f843..325ff57f 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectScoreReplaceParams.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectScoreReplaceParams.kt @@ -80,8 +80,6 @@ constructor( private val additionalProperties: Map, ) { - private var hashCode: Int = 0 - /** Name of the project score */ @JsonProperty("name") fun name(): String? = name @@ -104,40 +102,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is ProjectScoreReplaceBody && - this.name == other.name && - this.projectId == other.projectId && - this.scoreType == other.scoreType && - this.categories == other.categories && - this.config == other.config && - this.description == other.description && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - name, - projectId, - scoreType, - categories, - config, - description, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "ProjectScoreReplaceBody{name=$name, projectId=$projectId, scoreType=$scoreType, categories=$categories, config=$config, description=$description, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -210,6 +174,26 @@ constructor( additionalProperties.toUnmodifiable(), ) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is ProjectScoreReplaceBody && this.name == other.name && this.projectId == other.projectId && this.scoreType == other.scoreType && this.categories == other.categories && this.config == other.config && this.description == other.description && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(name, projectId, scoreType, categories, config, description, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "ProjectScoreReplaceBody{name=$name, projectId=$projectId, scoreType=$scoreType, categories=$categories, config=$config, description=$description, additionalProperties=$additionalProperties}" } fun _additionalQueryParams(): Map> = additionalQueryParams @@ -223,30 +207,11 @@ constructor( return true } - return other is ProjectScoreReplaceParams && - this.name == other.name && - this.projectId == other.projectId && - this.scoreType == other.scoreType && - this.categories == other.categories && - this.config == other.config && - this.description == other.description && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders && - this.additionalBodyProperties == other.additionalBodyProperties + return /* spotless:off */ other is ProjectScoreReplaceParams && this.name == other.name && this.projectId == other.projectId && this.scoreType == other.scoreType && this.categories == other.categories && this.config == other.config && this.description == other.description && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders && this.additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - name, - projectId, - scoreType, - categories, - config, - description, - additionalQueryParams, - additionalHeaders, - additionalBodyProperties, - ) + return /* spotless:off */ Objects.hash(name, projectId, scoreType, categories, config, description, additionalQueryParams, additionalHeaders, additionalBodyProperties) /* spotless:on */ } override fun toString() = @@ -298,8 +263,8 @@ constructor( fun categories(categories: Categories) = apply { this.categories = categories } /** For categorical-type project scores, the list of all categories */ - fun categories(projectScoreCategories: List) = apply { - this.categories = Categories.ofProjectScoreCategories(projectScoreCategories) + fun categoriesOfCategorical(categorical: List) = apply { + this.categories = Categories.ofCategorical(categorical) } /** For categorical-type project scores, the list of all categories */ @@ -308,8 +273,8 @@ constructor( } /** For categorical-type project scores, the list of all categories */ - fun categories(strings: List) = apply { - this.categories = Categories.ofStrings(strings) + fun categoriesOfMinimum(minimum: List) = apply { + this.categories = Categories.ofMinimum(minimum) } /** For categorical-type project scores, the list of all categories */ @@ -394,9 +359,9 @@ constructor( @JsonSerialize(using = Categories.Serializer::class) class Categories private constructor( - private val projectScoreCategories: List? = null, + private val categorical: List? = null, private val weighted: Weighted? = null, - private val strings: List? = null, + private val minimum: List? = null, private val nullableVariant: NullableVariant? = null, private val _json: JsonValue? = null, ) { @@ -404,29 +369,27 @@ constructor( private var validated: Boolean = false /** For categorical-type project scores, the list of all categories */ - fun projectScoreCategories(): Optional> = - Optional.ofNullable(projectScoreCategories) + fun categorical(): Optional> = Optional.ofNullable(categorical) /** For weighted-type project scores, the weights of each score */ fun weighted(): Optional = Optional.ofNullable(weighted) /** For minimum-type project scores, the list of included scores */ - fun strings(): Optional> = Optional.ofNullable(strings) + fun minimum(): Optional> = Optional.ofNullable(minimum) fun nullableVariant(): Optional = Optional.ofNullable(nullableVariant) - fun isProjectScoreCategories(): Boolean = projectScoreCategories != null + fun isCategorical(): Boolean = categorical != null fun isWeighted(): Boolean = weighted != null - fun isStrings(): Boolean = strings != null + fun isMinimum(): Boolean = minimum != null fun isNullableVariant(): Boolean = nullableVariant != null - fun asProjectScoreCategories(): List = - projectScoreCategories.getOrThrow("projectScoreCategories") + fun asCategorical(): List = categorical.getOrThrow("categorical") fun asWeighted(): Weighted = weighted.getOrThrow("weighted") - fun asStrings(): List = strings.getOrThrow("strings") + fun asMinimum(): List = minimum.getOrThrow("minimum") fun asNullableVariant(): NullableVariant = nullableVariant.getOrThrow("nullableVariant") @@ -434,10 +397,9 @@ constructor( fun accept(visitor: Visitor): T { return when { - projectScoreCategories != null -> - visitor.visitProjectScoreCategories(projectScoreCategories) + categorical != null -> visitor.visitCategorical(categorical) weighted != null -> visitor.visitWeighted(weighted) - strings != null -> visitor.visitStrings(strings) + minimum != null -> visitor.visitMinimum(minimum) nullableVariant != null -> visitor.visitNullableVariant(nullableVariant) else -> visitor.unknown(_json) } @@ -446,14 +408,14 @@ constructor( fun validate(): Categories = apply { if (!validated) { if ( - projectScoreCategories == null && + categorical == null && weighted == null && - strings == null && + minimum == null && nullableVariant == null ) { throw BraintrustInvalidDataException("Unknown Categories: $_json") } - projectScoreCategories?.forEach { it.validate() } + categorical?.forEach { it.validate() } weighted?.validate() nullableVariant?.validate() validated = true @@ -465,28 +427,18 @@ constructor( return true } - return other is Categories && - this.projectScoreCategories == other.projectScoreCategories && - this.weighted == other.weighted && - this.strings == other.strings && - this.nullableVariant == other.nullableVariant + return /* spotless:off */ other is Categories && this.categorical == other.categorical && this.weighted == other.weighted && this.minimum == other.minimum && this.nullableVariant == other.nullableVariant /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - projectScoreCategories, - weighted, - strings, - nullableVariant, - ) + return /* spotless:off */ Objects.hash(categorical, weighted, minimum, nullableVariant) /* spotless:on */ } override fun toString(): String { return when { - projectScoreCategories != null -> - "Categories{projectScoreCategories=$projectScoreCategories}" + categorical != null -> "Categories{categorical=$categorical}" weighted != null -> "Categories{weighted=$weighted}" - strings != null -> "Categories{strings=$strings}" + minimum != null -> "Categories{minimum=$minimum}" nullableVariant != null -> "Categories{nullableVariant=$nullableVariant}" _json != null -> "Categories{_unknown=$_json}" else -> throw IllegalStateException("Invalid Categories") @@ -496,12 +448,12 @@ constructor( companion object { @JvmStatic - fun ofProjectScoreCategories(projectScoreCategories: List) = - Categories(projectScoreCategories = projectScoreCategories) + fun ofCategorical(categorical: List) = + Categories(categorical = categorical) @JvmStatic fun ofWeighted(weighted: Weighted) = Categories(weighted = weighted) - @JvmStatic fun ofStrings(strings: List) = Categories(strings = strings) + @JvmStatic fun ofMinimum(minimum: List) = Categories(minimum = minimum) @JvmStatic fun ofNullableVariant(nullableVariant: NullableVariant) = @@ -510,11 +462,11 @@ constructor( interface Visitor { - fun visitProjectScoreCategories(projectScoreCategories: List): T + fun visitCategorical(categorical: List): T fun visitWeighted(weighted: Weighted): T - fun visitStrings(strings: List): T + fun visitMinimum(minimum: List): T fun visitNullableVariant(nullableVariant: NullableVariant): T @@ -527,18 +479,19 @@ constructor( override fun ObjectCodec.deserialize(node: JsonNode): Categories { val json = JsonValue.fromJsonNode(node) + tryDeserialize(node, jacksonTypeRef>()) { it.forEach { it.validate() } } ?.let { - return Categories(projectScoreCategories = it, _json = json) + return Categories(categorical = it, _json = json) } tryDeserialize(node, jacksonTypeRef()) { it.validate() } ?.let { return Categories(weighted = it, _json = json) } tryDeserialize(node, jacksonTypeRef>())?.let { - return Categories(strings = it, _json = json) + return Categories(minimum = it, _json = json) } tryDeserialize(node, jacksonTypeRef()) { it.validate() } ?.let { @@ -557,10 +510,9 @@ constructor( provider: SerializerProvider ) { when { - value.projectScoreCategories != null -> - generator.writeObject(value.projectScoreCategories) + value.categorical != null -> generator.writeObject(value.categorical) value.weighted != null -> generator.writeObject(value.weighted) - value.strings != null -> generator.writeObject(value.strings) + value.minimum != null -> generator.writeObject(value.minimum) value.nullableVariant != null -> generator.writeObject(value.nullableVariant) value._json != null -> generator.writeObject(value._json) else -> throw IllegalStateException("Invalid Categories") @@ -578,8 +530,6 @@ constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -592,23 +542,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Weighted && this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = Objects.hash(additionalProperties) - } - return hashCode - } - - override fun toString() = "Weighted{additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -640,6 +573,25 @@ constructor( fun build(): Weighted = Weighted(additionalProperties.toUnmodifiable()) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Weighted && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = "Weighted{additionalProperties=$additionalProperties}" } @JsonDeserialize(builder = NullableVariant.Builder::class) @@ -651,8 +603,6 @@ constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -665,24 +615,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is NullableVariant && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = Objects.hash(additionalProperties) - } - return hashCode - } - - override fun toString() = "NullableVariant{additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -715,6 +647,25 @@ constructor( fun build(): NullableVariant = NullableVariant(additionalProperties.toUnmodifiable()) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is NullableVariant && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = "NullableVariant{additionalProperties=$additionalProperties}" } } } diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectScoreRetrieveParams.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectScoreRetrieveParams.kt index cf6919d4..7ff755d1 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectScoreRetrieveParams.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectScoreRetrieveParams.kt @@ -36,18 +36,11 @@ constructor( return true } - return other is ProjectScoreRetrieveParams && - this.projectScoreId == other.projectScoreId && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders + return /* spotless:off */ other is ProjectScoreRetrieveParams && this.projectScoreId == other.projectScoreId && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - projectScoreId, - additionalQueryParams, - additionalHeaders, - ) + return /* spotless:off */ Objects.hash(projectScoreId, additionalQueryParams, additionalHeaders) /* spotless:on */ } override fun toString() = diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectScoreType.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectScoreType.kt index fb9ec5be..2d9449e0 100644 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectScoreType.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectScoreType.kt @@ -21,7 +21,7 @@ private constructor( return true } - return other is ProjectScoreType && this.value == other.value + return /* spotless:off */ other is ProjectScoreType && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectScoreUpdateParams.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectScoreUpdateParams.kt index 4548ffb9..ca58dad5 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectScoreUpdateParams.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectScoreUpdateParams.kt @@ -85,8 +85,6 @@ constructor( private val additionalProperties: Map, ) { - private var hashCode: Int = 0 - @JsonProperty("categories") fun categories(): Categories? = categories @JsonProperty("config") fun config(): ProjectScoreConfig? = config @@ -106,38 +104,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is ProjectScoreUpdateBody && - this.categories == other.categories && - this.config == other.config && - this.description == other.description && - this.name == other.name && - this.scoreType == other.scoreType && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - categories, - config, - description, - name, - scoreType, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "ProjectScoreUpdateBody{categories=$categories, config=$config, description=$description, name=$name, scoreType=$scoreType, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -203,6 +169,26 @@ constructor( additionalProperties.toUnmodifiable(), ) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is ProjectScoreUpdateBody && this.categories == other.categories && this.config == other.config && this.description == other.description && this.name == other.name && this.scoreType == other.scoreType && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(categories, config, description, name, scoreType, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "ProjectScoreUpdateBody{categories=$categories, config=$config, description=$description, name=$name, scoreType=$scoreType, additionalProperties=$additionalProperties}" } fun _additionalQueryParams(): Map> = additionalQueryParams @@ -216,30 +202,11 @@ constructor( return true } - return other is ProjectScoreUpdateParams && - this.projectScoreId == other.projectScoreId && - this.categories == other.categories && - this.config == other.config && - this.description == other.description && - this.name == other.name && - this.scoreType == other.scoreType && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders && - this.additionalBodyProperties == other.additionalBodyProperties + return /* spotless:off */ other is ProjectScoreUpdateParams && this.projectScoreId == other.projectScoreId && this.categories == other.categories && this.config == other.config && this.description == other.description && this.name == other.name && this.scoreType == other.scoreType && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders && this.additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - projectScoreId, - categories, - config, - description, - name, - scoreType, - additionalQueryParams, - additionalHeaders, - additionalBodyProperties, - ) + return /* spotless:off */ Objects.hash(projectScoreId, categories, config, description, name, scoreType, additionalQueryParams, additionalHeaders, additionalBodyProperties) /* spotless:on */ } override fun toString() = @@ -285,8 +252,8 @@ constructor( fun categories(categories: Categories) = apply { this.categories = categories } /** For categorical-type project scores, the list of all categories */ - fun categories(projectScoreCategories: List) = apply { - this.categories = Categories.ofProjectScoreCategories(projectScoreCategories) + fun categoriesOfCategorical(categorical: List) = apply { + this.categories = Categories.ofCategorical(categorical) } /** For categorical-type project scores, the list of all categories */ @@ -295,8 +262,8 @@ constructor( } /** For categorical-type project scores, the list of all categories */ - fun categories(strings: List) = apply { - this.categories = Categories.ofStrings(strings) + fun categoriesOfMinimum(minimum: List) = apply { + this.categories = Categories.ofMinimum(minimum) } /** For categorical-type project scores, the list of all categories */ @@ -387,9 +354,9 @@ constructor( @JsonSerialize(using = Categories.Serializer::class) class Categories private constructor( - private val projectScoreCategories: List? = null, + private val categorical: List? = null, private val weighted: Weighted? = null, - private val strings: List? = null, + private val minimum: List? = null, private val nullableVariant: NullableVariant? = null, private val _json: JsonValue? = null, ) { @@ -397,29 +364,27 @@ constructor( private var validated: Boolean = false /** For categorical-type project scores, the list of all categories */ - fun projectScoreCategories(): Optional> = - Optional.ofNullable(projectScoreCategories) + fun categorical(): Optional> = Optional.ofNullable(categorical) /** For weighted-type project scores, the weights of each score */ fun weighted(): Optional = Optional.ofNullable(weighted) /** For minimum-type project scores, the list of included scores */ - fun strings(): Optional> = Optional.ofNullable(strings) + fun minimum(): Optional> = Optional.ofNullable(minimum) fun nullableVariant(): Optional = Optional.ofNullable(nullableVariant) - fun isProjectScoreCategories(): Boolean = projectScoreCategories != null + fun isCategorical(): Boolean = categorical != null fun isWeighted(): Boolean = weighted != null - fun isStrings(): Boolean = strings != null + fun isMinimum(): Boolean = minimum != null fun isNullableVariant(): Boolean = nullableVariant != null - fun asProjectScoreCategories(): List = - projectScoreCategories.getOrThrow("projectScoreCategories") + fun asCategorical(): List = categorical.getOrThrow("categorical") fun asWeighted(): Weighted = weighted.getOrThrow("weighted") - fun asStrings(): List = strings.getOrThrow("strings") + fun asMinimum(): List = minimum.getOrThrow("minimum") fun asNullableVariant(): NullableVariant = nullableVariant.getOrThrow("nullableVariant") @@ -427,10 +392,9 @@ constructor( fun accept(visitor: Visitor): T { return when { - projectScoreCategories != null -> - visitor.visitProjectScoreCategories(projectScoreCategories) + categorical != null -> visitor.visitCategorical(categorical) weighted != null -> visitor.visitWeighted(weighted) - strings != null -> visitor.visitStrings(strings) + minimum != null -> visitor.visitMinimum(minimum) nullableVariant != null -> visitor.visitNullableVariant(nullableVariant) else -> visitor.unknown(_json) } @@ -439,14 +403,14 @@ constructor( fun validate(): Categories = apply { if (!validated) { if ( - projectScoreCategories == null && + categorical == null && weighted == null && - strings == null && + minimum == null && nullableVariant == null ) { throw BraintrustInvalidDataException("Unknown Categories: $_json") } - projectScoreCategories?.forEach { it.validate() } + categorical?.forEach { it.validate() } weighted?.validate() nullableVariant?.validate() validated = true @@ -458,28 +422,18 @@ constructor( return true } - return other is Categories && - this.projectScoreCategories == other.projectScoreCategories && - this.weighted == other.weighted && - this.strings == other.strings && - this.nullableVariant == other.nullableVariant + return /* spotless:off */ other is Categories && this.categorical == other.categorical && this.weighted == other.weighted && this.minimum == other.minimum && this.nullableVariant == other.nullableVariant /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - projectScoreCategories, - weighted, - strings, - nullableVariant, - ) + return /* spotless:off */ Objects.hash(categorical, weighted, minimum, nullableVariant) /* spotless:on */ } override fun toString(): String { return when { - projectScoreCategories != null -> - "Categories{projectScoreCategories=$projectScoreCategories}" + categorical != null -> "Categories{categorical=$categorical}" weighted != null -> "Categories{weighted=$weighted}" - strings != null -> "Categories{strings=$strings}" + minimum != null -> "Categories{minimum=$minimum}" nullableVariant != null -> "Categories{nullableVariant=$nullableVariant}" _json != null -> "Categories{_unknown=$_json}" else -> throw IllegalStateException("Invalid Categories") @@ -489,12 +443,12 @@ constructor( companion object { @JvmStatic - fun ofProjectScoreCategories(projectScoreCategories: List) = - Categories(projectScoreCategories = projectScoreCategories) + fun ofCategorical(categorical: List) = + Categories(categorical = categorical) @JvmStatic fun ofWeighted(weighted: Weighted) = Categories(weighted = weighted) - @JvmStatic fun ofStrings(strings: List) = Categories(strings = strings) + @JvmStatic fun ofMinimum(minimum: List) = Categories(minimum = minimum) @JvmStatic fun ofNullableVariant(nullableVariant: NullableVariant) = @@ -503,11 +457,11 @@ constructor( interface Visitor { - fun visitProjectScoreCategories(projectScoreCategories: List): T + fun visitCategorical(categorical: List): T fun visitWeighted(weighted: Weighted): T - fun visitStrings(strings: List): T + fun visitMinimum(minimum: List): T fun visitNullableVariant(nullableVariant: NullableVariant): T @@ -520,18 +474,19 @@ constructor( override fun ObjectCodec.deserialize(node: JsonNode): Categories { val json = JsonValue.fromJsonNode(node) + tryDeserialize(node, jacksonTypeRef>()) { it.forEach { it.validate() } } ?.let { - return Categories(projectScoreCategories = it, _json = json) + return Categories(categorical = it, _json = json) } tryDeserialize(node, jacksonTypeRef()) { it.validate() } ?.let { return Categories(weighted = it, _json = json) } tryDeserialize(node, jacksonTypeRef>())?.let { - return Categories(strings = it, _json = json) + return Categories(minimum = it, _json = json) } tryDeserialize(node, jacksonTypeRef()) { it.validate() } ?.let { @@ -550,10 +505,9 @@ constructor( provider: SerializerProvider ) { when { - value.projectScoreCategories != null -> - generator.writeObject(value.projectScoreCategories) + value.categorical != null -> generator.writeObject(value.categorical) value.weighted != null -> generator.writeObject(value.weighted) - value.strings != null -> generator.writeObject(value.strings) + value.minimum != null -> generator.writeObject(value.minimum) value.nullableVariant != null -> generator.writeObject(value.nullableVariant) value._json != null -> generator.writeObject(value._json) else -> throw IllegalStateException("Invalid Categories") @@ -571,8 +525,6 @@ constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -585,23 +537,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Weighted && this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = Objects.hash(additionalProperties) - } - return hashCode - } - - override fun toString() = "Weighted{additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -633,6 +568,25 @@ constructor( fun build(): Weighted = Weighted(additionalProperties.toUnmodifiable()) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Weighted && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = "Weighted{additionalProperties=$additionalProperties}" } @JsonDeserialize(builder = NullableVariant.Builder::class) @@ -644,8 +598,6 @@ constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -658,24 +610,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is NullableVariant && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = Objects.hash(additionalProperties) - } - return hashCode - } - - override fun toString() = "NullableVariant{additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -708,6 +642,25 @@ constructor( fun build(): NullableVariant = NullableVariant(additionalProperties.toUnmodifiable()) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is NullableVariant && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = "NullableVariant{additionalProperties=$additionalProperties}" } } } diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectSettings.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectSettings.kt index d4a8c8cb..d14a8707 100644 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectSettings.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectSettings.kt @@ -25,8 +25,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - /** The key used to join two experiments (defaults to `input`). */ fun comparisonKey(): Optional = Optional.ofNullable(comparisonKey.getNullable("comparison_key")) @@ -47,26 +45,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is ProjectSettings && - this.comparisonKey == other.comparisonKey && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = Objects.hash(comparisonKey, additionalProperties) - } - return hashCode - } - - override fun toString() = - "ProjectSettings{comparisonKey=$comparisonKey, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -110,4 +88,24 @@ private constructor( fun build(): ProjectSettings = ProjectSettings(comparisonKey, additionalProperties.toUnmodifiable()) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is ProjectSettings && this.comparisonKey == other.comparisonKey && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(comparisonKey, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "ProjectSettings{comparisonKey=$comparisonKey, additionalProperties=$additionalProperties}" } diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectTag.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectTag.kt index 61b80ba9..aa10d385 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectTag.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectTag.kt @@ -36,8 +36,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - /** Unique identifier for the project tag */ fun id(): String = id.getRequired("id") @@ -98,42 +96,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is ProjectTag && - this.id == other.id && - this.projectId == other.projectId && - this.userId == other.userId && - this.created == other.created && - this.name == other.name && - this.description == other.description && - this.color == other.color && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - id, - projectId, - userId, - created, - name, - description, - color, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "ProjectTag{id=$id, projectId=$projectId, userId=$userId, created=$created, name=$name, description=$description, color=$color, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -240,4 +202,24 @@ private constructor( additionalProperties.toUnmodifiable(), ) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is ProjectTag && this.id == other.id && this.projectId == other.projectId && this.userId == other.userId && this.created == other.created && this.name == other.name && this.description == other.description && this.color == other.color && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(id, projectId, userId, created, name, description, color, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "ProjectTag{id=$id, projectId=$projectId, userId=$userId, created=$created, name=$name, description=$description, color=$color, additionalProperties=$additionalProperties}" } diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectTagCreateParams.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectTagCreateParams.kt index 9275324e..f31204d8 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectTagCreateParams.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectTagCreateParams.kt @@ -59,8 +59,6 @@ constructor( private val additionalProperties: Map, ) { - private var hashCode: Int = 0 - /** Name of the project tag */ @JsonProperty("name") fun name(): String? = name @@ -79,36 +77,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is ProjectTagCreateBody && - this.name == other.name && - this.projectId == other.projectId && - this.color == other.color && - this.description == other.description && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - name, - projectId, - color, - description, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "ProjectTagCreateBody{name=$name, projectId=$projectId, color=$color, description=$description, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -168,6 +136,26 @@ constructor( additionalProperties.toUnmodifiable(), ) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is ProjectTagCreateBody && this.name == other.name && this.projectId == other.projectId && this.color == other.color && this.description == other.description && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(name, projectId, color, description, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "ProjectTagCreateBody{name=$name, projectId=$projectId, color=$color, description=$description, additionalProperties=$additionalProperties}" } fun _additionalQueryParams(): Map> = additionalQueryParams @@ -181,26 +169,11 @@ constructor( return true } - return other is ProjectTagCreateParams && - this.name == other.name && - this.projectId == other.projectId && - this.color == other.color && - this.description == other.description && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders && - this.additionalBodyProperties == other.additionalBodyProperties + return /* spotless:off */ other is ProjectTagCreateParams && this.name == other.name && this.projectId == other.projectId && this.color == other.color && this.description == other.description && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders && this.additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - name, - projectId, - color, - description, - additionalQueryParams, - additionalHeaders, - additionalBodyProperties, - ) + return /* spotless:off */ Objects.hash(name, projectId, color, description, additionalQueryParams, additionalHeaders, additionalBodyProperties) /* spotless:on */ } override fun toString() = diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectTagDeleteParams.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectTagDeleteParams.kt index 26f9294d..71458816 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectTagDeleteParams.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectTagDeleteParams.kt @@ -46,20 +46,11 @@ constructor( return true } - return other is ProjectTagDeleteParams && - this.projectTagId == other.projectTagId && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders && - this.additionalBodyProperties == other.additionalBodyProperties + return /* spotless:off */ other is ProjectTagDeleteParams && this.projectTagId == other.projectTagId && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders && this.additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - projectTagId, - additionalQueryParams, - additionalHeaders, - additionalBodyProperties, - ) + return /* spotless:off */ Objects.hash(projectTagId, additionalQueryParams, additionalHeaders, additionalBodyProperties) /* spotless:on */ } override fun toString() = diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectTagListPage.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectTagListPage.kt index 065e040c..f93071d5 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectTagListPage.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectTagListPage.kt @@ -34,18 +34,11 @@ private constructor( return true } - return other is ProjectTagListPage && - this.projectTagsService == other.projectTagsService && - this.params == other.params && - this.response == other.response + return /* spotless:off */ other is ProjectTagListPage && this.projectTagsService == other.projectTagsService && this.params == other.params && this.response == other.response /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - projectTagsService, - params, - response, - ) + return /* spotless:off */ Objects.hash(projectTagsService, params, response) /* spotless:on */ } override fun toString() = @@ -131,13 +124,11 @@ private constructor( return true } - return other is Response && - this.objects == other.objects && - this.additionalProperties == other.additionalProperties + return /* spotless:off */ other is Response && this.objects == other.objects && this.additionalProperties == other.additionalProperties /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash(objects, additionalProperties) + return /* spotless:off */ Objects.hash(objects, additionalProperties) /* spotless:on */ } override fun toString() = diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectTagListPageAsync.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectTagListPageAsync.kt index 403a1798..aee77897 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectTagListPageAsync.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectTagListPageAsync.kt @@ -35,18 +35,11 @@ private constructor( return true } - return other is ProjectTagListPageAsync && - this.projectTagsService == other.projectTagsService && - this.params == other.params && - this.response == other.response + return /* spotless:off */ other is ProjectTagListPageAsync && this.projectTagsService == other.projectTagsService && this.params == other.params && this.response == other.response /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - projectTagsService, - params, - response, - ) + return /* spotless:off */ Objects.hash(projectTagsService, params, response) /* spotless:on */ } override fun toString() = @@ -134,13 +127,11 @@ private constructor( return true } - return other is Response && - this.objects == other.objects && - this.additionalProperties == other.additionalProperties + return /* spotless:off */ other is Response && this.objects == other.objects && this.additionalProperties == other.additionalProperties /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash(objects, additionalProperties) + return /* spotless:off */ Objects.hash(objects, additionalProperties) /* spotless:on */ } override fun toString() = diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectTagListParams.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectTagListParams.kt index 893d676e..9b43b54d 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectTagListParams.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectTagListParams.kt @@ -76,32 +76,11 @@ constructor( return true } - return other is ProjectTagListParams && - this.endingBefore == other.endingBefore && - this.ids == other.ids && - this.limit == other.limit && - this.orgName == other.orgName && - this.projectId == other.projectId && - this.projectName == other.projectName && - this.projectTagName == other.projectTagName && - this.startingAfter == other.startingAfter && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders + return /* spotless:off */ other is ProjectTagListParams && this.endingBefore == other.endingBefore && this.ids == other.ids && this.limit == other.limit && this.orgName == other.orgName && this.projectId == other.projectId && this.projectName == other.projectName && this.projectTagName == other.projectTagName && this.startingAfter == other.startingAfter && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - endingBefore, - ids, - limit, - orgName, - projectId, - projectName, - projectTagName, - startingAfter, - additionalQueryParams, - additionalHeaders, - ) + return /* spotless:off */ Objects.hash(endingBefore, ids, limit, orgName, projectId, projectName, projectTagName, startingAfter, additionalQueryParams, additionalHeaders) /* spotless:on */ } override fun toString() = @@ -167,7 +146,7 @@ constructor( * Filter search results to a particular set of object IDs. To specify a list of IDs, * include the query param multiple times */ - fun ids(strings: List) = apply { this.ids = Ids.ofStrings(strings) } + fun idsOfStrings(strings: List) = apply { this.ids = Ids.ofStrings(strings) } /** Limit the number of objects to return */ fun limit(limit: Long) = apply { this.limit = limit } @@ -295,11 +274,11 @@ constructor( return true } - return other is Ids && this.string == other.string && this.strings == other.strings + return /* spotless:off */ other is Ids && this.string == other.string && this.strings == other.strings /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash(string, strings) + return /* spotless:off */ Objects.hash(string, strings) /* spotless:on */ } override fun toString(): String { @@ -333,6 +312,7 @@ constructor( override fun ObjectCodec.deserialize(node: JsonNode): Ids { val json = JsonValue.fromJsonNode(node) + tryDeserialize(node, jacksonTypeRef())?.let { return Ids(string = it, _json = json) } diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectTagReplaceParams.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectTagReplaceParams.kt index 28a4613d..51a0bdba 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectTagReplaceParams.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectTagReplaceParams.kt @@ -59,8 +59,6 @@ constructor( private val additionalProperties: Map, ) { - private var hashCode: Int = 0 - /** Name of the project tag */ @JsonProperty("name") fun name(): String? = name @@ -79,36 +77,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is ProjectTagReplaceBody && - this.name == other.name && - this.projectId == other.projectId && - this.color == other.color && - this.description == other.description && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - name, - projectId, - color, - description, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "ProjectTagReplaceBody{name=$name, projectId=$projectId, color=$color, description=$description, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -168,6 +136,26 @@ constructor( additionalProperties.toUnmodifiable(), ) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is ProjectTagReplaceBody && this.name == other.name && this.projectId == other.projectId && this.color == other.color && this.description == other.description && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(name, projectId, color, description, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "ProjectTagReplaceBody{name=$name, projectId=$projectId, color=$color, description=$description, additionalProperties=$additionalProperties}" } fun _additionalQueryParams(): Map> = additionalQueryParams @@ -181,26 +169,11 @@ constructor( return true } - return other is ProjectTagReplaceParams && - this.name == other.name && - this.projectId == other.projectId && - this.color == other.color && - this.description == other.description && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders && - this.additionalBodyProperties == other.additionalBodyProperties + return /* spotless:off */ other is ProjectTagReplaceParams && this.name == other.name && this.projectId == other.projectId && this.color == other.color && this.description == other.description && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders && this.additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - name, - projectId, - color, - description, - additionalQueryParams, - additionalHeaders, - additionalBodyProperties, - ) + return /* spotless:off */ Objects.hash(name, projectId, color, description, additionalQueryParams, additionalHeaders, additionalBodyProperties) /* spotless:on */ } override fun toString() = diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectTagRetrieveParams.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectTagRetrieveParams.kt index 1fa19f4b..90f5a22a 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectTagRetrieveParams.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectTagRetrieveParams.kt @@ -36,18 +36,11 @@ constructor( return true } - return other is ProjectTagRetrieveParams && - this.projectTagId == other.projectTagId && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders + return /* spotless:off */ other is ProjectTagRetrieveParams && this.projectTagId == other.projectTagId && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - projectTagId, - additionalQueryParams, - additionalHeaders, - ) + return /* spotless:off */ Objects.hash(projectTagId, additionalQueryParams, additionalHeaders) /* spotless:on */ } override fun toString() = diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectTagUpdateParams.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectTagUpdateParams.kt index e8f94d38..3641ff1a 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectTagUpdateParams.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectTagUpdateParams.kt @@ -64,8 +64,6 @@ constructor( private val additionalProperties: Map, ) { - private var hashCode: Int = 0 - /** Color of the tag for the UI */ @JsonProperty("color") fun color(): String? = color @@ -81,34 +79,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is ProjectTagUpdateBody && - this.color == other.color && - this.description == other.description && - this.name == other.name && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - color, - description, - name, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "ProjectTagUpdateBody{color=$color, description=$description, name=$name, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -161,6 +131,26 @@ constructor( additionalProperties.toUnmodifiable(), ) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is ProjectTagUpdateBody && this.color == other.color && this.description == other.description && this.name == other.name && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(color, description, name, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "ProjectTagUpdateBody{color=$color, description=$description, name=$name, additionalProperties=$additionalProperties}" } fun _additionalQueryParams(): Map> = additionalQueryParams @@ -174,26 +164,11 @@ constructor( return true } - return other is ProjectTagUpdateParams && - this.projectTagId == other.projectTagId && - this.color == other.color && - this.description == other.description && - this.name == other.name && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders && - this.additionalBodyProperties == other.additionalBodyProperties + return /* spotless:off */ other is ProjectTagUpdateParams && this.projectTagId == other.projectTagId && this.color == other.color && this.description == other.description && this.name == other.name && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders && this.additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - projectTagId, - color, - description, - name, - additionalQueryParams, - additionalHeaders, - additionalBodyProperties, - ) + return /* spotless:off */ Objects.hash(projectTagId, color, description, name, additionalQueryParams, additionalHeaders, additionalBodyProperties) /* spotless:on */ } override fun toString() = diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectUpdateParams.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectUpdateParams.kt index b9770377..505467b5 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectUpdateParams.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ProjectUpdateParams.kt @@ -59,8 +59,6 @@ constructor( private val additionalProperties: Map, ) { - private var hashCode: Int = 0 - /** Name of the project */ @JsonProperty("name") fun name(): String? = name @@ -76,32 +74,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is ProjectUpdateBody && - this.name == other.name && - this.settings == other.settings && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - name, - settings, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "ProjectUpdateBody{name=$name, settings=$settings, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -151,6 +123,26 @@ constructor( additionalProperties.toUnmodifiable(), ) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is ProjectUpdateBody && this.name == other.name && this.settings == other.settings && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(name, settings, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "ProjectUpdateBody{name=$name, settings=$settings, additionalProperties=$additionalProperties}" } fun _additionalQueryParams(): Map> = additionalQueryParams @@ -164,24 +156,11 @@ constructor( return true } - return other is ProjectUpdateParams && - this.projectId == other.projectId && - this.name == other.name && - this.settings == other.settings && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders && - this.additionalBodyProperties == other.additionalBodyProperties + return /* spotless:off */ other is ProjectUpdateParams && this.projectId == other.projectId && this.name == other.name && this.settings == other.settings && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders && this.additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - projectId, - name, - settings, - additionalQueryParams, - additionalHeaders, - additionalBodyProperties, - ) + return /* spotless:off */ Objects.hash(projectId, name, settings, additionalQueryParams, additionalHeaders, additionalBodyProperties) /* spotless:on */ } override fun toString() = diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/Prompt.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/Prompt.kt index 3805046d..e4c891cf 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/Prompt.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/Prompt.kt @@ -41,8 +41,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - /** Unique identifier for the prompt */ fun id(): String = id.getRequired("id") @@ -155,54 +153,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Prompt && - this.id == other.id && - this._xactId == other._xactId && - this.projectId == other.projectId && - this.logId == other.logId && - this.orgId == other.orgId && - this.name == other.name && - this.slug == other.slug && - this.description == other.description && - this.created == other.created && - this.promptData == other.promptData && - this.tags == other.tags && - this.metadata == other.metadata && - this.functionType == other.functionType && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - id, - _xactId, - projectId, - logId, - orgId, - name, - slug, - description, - created, - promptData, - tags, - metadata, - functionType, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "Prompt{id=$id, _xactId=$_xactId, projectId=$projectId, logId=$logId, orgId=$orgId, name=$name, slug=$slug, description=$description, created=$created, promptData=$promptData, tags=$tags, metadata=$metadata, functionType=$functionType, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -399,7 +349,7 @@ private constructor( return true } - return other is LogId && this.value == other.value + return /* spotless:off */ other is LogId && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -450,7 +400,7 @@ private constructor( return true } - return other is FunctionType && this.value == other.value + return /* spotless:off */ other is FunctionType && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -516,8 +466,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -530,23 +478,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Metadata && this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = Objects.hash(additionalProperties) - } - return hashCode - } - - override fun toString() = "Metadata{additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -577,5 +508,44 @@ private constructor( fun build(): Metadata = Metadata(additionalProperties.toUnmodifiable()) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Metadata && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = "Metadata{additionalProperties=$additionalProperties}" } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Prompt && this.id == other.id && this._xactId == other._xactId && this.projectId == other.projectId && this.logId == other.logId && this.orgId == other.orgId && this.name == other.name && this.slug == other.slug && this.description == other.description && this.created == other.created && this.promptData == other.promptData && this.tags == other.tags && this.metadata == other.metadata && this.functionType == other.functionType && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(id, _xactId, projectId, logId, orgId, name, slug, description, created, promptData, tags, metadata, functionType, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "Prompt{id=$id, _xactId=$_xactId, projectId=$projectId, logId=$logId, orgId=$orgId, name=$name, slug=$slug, description=$description, created=$created, promptData=$promptData, tags=$tags, metadata=$metadata, functionType=$functionType, additionalProperties=$additionalProperties}" } diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/PromptCreateParams.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/PromptCreateParams.kt index 5ed64365..d31c2b09 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/PromptCreateParams.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/PromptCreateParams.kt @@ -78,8 +78,6 @@ constructor( private val additionalProperties: Map, ) { - private var hashCode: Int = 0 - /** Name of the prompt */ @JsonProperty("name") fun name(): String? = name @@ -106,42 +104,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is PromptCreateBody && - this.name == other.name && - this.projectId == other.projectId && - this.slug == other.slug && - this.description == other.description && - this.functionType == other.functionType && - this.promptData == other.promptData && - this.tags == other.tags && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - name, - projectId, - slug, - description, - functionType, - promptData, - tags, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "PromptCreateBody{name=$name, projectId=$projectId, slug=$slug, description=$description, functionType=$functionType, promptData=$promptData, tags=$tags, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -222,6 +184,26 @@ constructor( additionalProperties.toUnmodifiable(), ) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is PromptCreateBody && this.name == other.name && this.projectId == other.projectId && this.slug == other.slug && this.description == other.description && this.functionType == other.functionType && this.promptData == other.promptData && this.tags == other.tags && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(name, projectId, slug, description, functionType, promptData, tags, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "PromptCreateBody{name=$name, projectId=$projectId, slug=$slug, description=$description, functionType=$functionType, promptData=$promptData, tags=$tags, additionalProperties=$additionalProperties}" } fun _additionalQueryParams(): Map> = additionalQueryParams @@ -235,32 +217,11 @@ constructor( return true } - return other is PromptCreateParams && - this.name == other.name && - this.projectId == other.projectId && - this.slug == other.slug && - this.description == other.description && - this.functionType == other.functionType && - this.promptData == other.promptData && - this.tags == other.tags && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders && - this.additionalBodyProperties == other.additionalBodyProperties + return /* spotless:off */ other is PromptCreateParams && this.name == other.name && this.projectId == other.projectId && this.slug == other.slug && this.description == other.description && this.functionType == other.functionType && this.promptData == other.promptData && this.tags == other.tags && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders && this.additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - name, - projectId, - slug, - description, - functionType, - promptData, - tags, - additionalQueryParams, - additionalHeaders, - additionalBodyProperties, - ) + return /* spotless:off */ Objects.hash(name, projectId, slug, description, functionType, promptData, tags, additionalQueryParams, additionalHeaders, additionalBodyProperties) /* spotless:on */ } override fun toString() = @@ -409,7 +370,7 @@ constructor( return true } - return other is FunctionType && this.value == other.value + return /* spotless:off */ other is FunctionType && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/PromptData.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/PromptData.kt index a1fa2644..a503fa7b 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/PromptData.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/PromptData.kt @@ -42,8 +42,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - fun prompt(): Optional = Optional.ofNullable(prompt.getNullable("prompt")) fun options(): Optional = Optional.ofNullable(options.getNullable("options")) @@ -82,38 +80,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is PromptData && - this.prompt == other.prompt && - this.options == other.options && - this.parser == other.parser && - this.toolFunctions == other.toolFunctions && - this.origin == other.origin && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - prompt, - options, - parser, - toolFunctions, - origin, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "PromptData{prompt=$prompt, options=$options, parser=$parser, toolFunctions=$toolFunctions, origin=$origin, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -208,8 +174,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - fun model(): Optional = Optional.ofNullable(model.getNullable("model")) fun params(): Optional = Optional.ofNullable(params.getNullable("params")) @@ -237,34 +201,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Options && - this.model == other.model && - this.params == other.params && - this.position == other.position && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - model, - params, - position, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "Options{model=$model, params=$params, position=$position, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -421,22 +357,11 @@ private constructor( return true } - return other is Params && - this.openaiModelParams == other.openaiModelParams && - this.anthropicModelParams == other.anthropicModelParams && - this.googleModelParams == other.googleModelParams && - this.windowAiModelParams == other.windowAiModelParams && - this.jsCompletionParams == other.jsCompletionParams + return /* spotless:off */ other is Params && this.openaiModelParams == other.openaiModelParams && this.anthropicModelParams == other.anthropicModelParams && this.googleModelParams == other.googleModelParams && this.windowAiModelParams == other.windowAiModelParams && this.jsCompletionParams == other.jsCompletionParams /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - openaiModelParams, - anthropicModelParams, - googleModelParams, - windowAiModelParams, - jsCompletionParams, - ) + return /* spotless:off */ Objects.hash(openaiModelParams, anthropicModelParams, googleModelParams, windowAiModelParams, jsCompletionParams) /* spotless:on */ } override fun toString(): String { @@ -497,6 +422,7 @@ private constructor( override fun ObjectCodec.deserialize(node: JsonNode): Params { val json = JsonValue.fromJsonNode(node) + tryDeserialize(node, jacksonTypeRef()) { it.validate() } ?.let { return Params(openaiModelParams = it, _json = json) @@ -566,8 +492,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - fun useCache(): Optional = Optional.ofNullable(useCache.getNullable("use_cache")) @@ -649,50 +573,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is OpenAIModelParams && - this.useCache == other.useCache && - this.temperature == other.temperature && - this.topP == other.topP && - this.maxTokens == other.maxTokens && - this.frequencyPenalty == other.frequencyPenalty && - this.presencePenalty == other.presencePenalty && - this.responseFormat == other.responseFormat && - this.toolChoice == other.toolChoice && - this.functionCall == other.functionCall && - this.n == other.n && - this.stop == other.stop && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - useCache, - temperature, - topP, - maxTokens, - frequencyPenalty, - presencePenalty, - responseFormat, - toolChoice, - functionCall, - n, - stop, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "OpenAIModelParams{useCache=$useCache, temperature=$temperature, topP=$topP, maxTokens=$maxTokens, frequencyPenalty=$frequencyPenalty, presencePenalty=$presencePenalty, responseFormat=$responseFormat, toolChoice=$toolChoice, functionCall=$functionCall, n=$n, stop=$stop, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -901,18 +781,11 @@ private constructor( return true } - return other is FunctionCall && - this.auto == other.auto && - this.none == other.none && - this.function == other.function + return /* spotless:off */ other is FunctionCall && this.auto == other.auto && this.none == other.none && this.function == other.function /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - auto, - none, - function, - ) + return /* spotless:off */ Objects.hash(auto, none, function) /* spotless:on */ } override fun toString(): String { @@ -952,6 +825,7 @@ private constructor( override fun ObjectCodec.deserialize(node: JsonNode): FunctionCall { val json = JsonValue.fromJsonNode(node) + tryDeserialize(node, jacksonTypeRef())?.let { return FunctionCall(auto = it, _json = json) } @@ -998,7 +872,7 @@ private constructor( return true } - return other is Auto && this.value == other.value + return /* spotless:off */ other is Auto && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -1050,7 +924,7 @@ private constructor( return true } - return other is None && this.value == other.value + return /* spotless:off */ other is None && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -1098,8 +972,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - fun name(): String = name.getRequired("name") @JsonProperty("name") @ExcludeMissing fun _name() = name @@ -1117,26 +989,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Function && - this.name == other.name && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = Objects.hash(name, additionalProperties) - } - return hashCode - } - - override fun toString() = - "Function{name=$name, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -1178,6 +1030,26 @@ private constructor( fun build(): Function = Function(name, additionalProperties.toUnmodifiable()) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Function && this.name == other.name && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(name, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "Function{name=$name, additionalProperties=$additionalProperties}" } } @@ -1191,8 +1063,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - fun type(): Type = type.getRequired("type") @JsonProperty("type") @ExcludeMissing fun _type() = type @@ -1210,26 +1080,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is ResponseFormat && - this.type == other.type && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = Objects.hash(type, additionalProperties) - } - return hashCode - } - - override fun toString() = - "ResponseFormat{type=$type, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -1286,7 +1136,7 @@ private constructor( return true } - return other is Type && this.value == other.value + return /* spotless:off */ other is Type && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -1323,7 +1173,47 @@ private constructor( fun asString(): String = _value().asStringOrThrow() } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is ResponseFormat && this.type == other.type && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(type, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "ResponseFormat{type=$type, additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is OpenAIModelParams && this.useCache == other.useCache && this.temperature == other.temperature && this.topP == other.topP && this.maxTokens == other.maxTokens && this.frequencyPenalty == other.frequencyPenalty && this.presencePenalty == other.presencePenalty && this.responseFormat == other.responseFormat && this.toolChoice == other.toolChoice && this.functionCall == other.functionCall && this.n == other.n && this.stop == other.stop && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(useCache, temperature, topP, maxTokens, frequencyPenalty, presencePenalty, responseFormat, toolChoice, functionCall, n, stop, additionalProperties) /* spotless:on */ + } + return hashCode } + + override fun toString() = + "OpenAIModelParams{useCache=$useCache, temperature=$temperature, topP=$topP, maxTokens=$maxTokens, frequencyPenalty=$frequencyPenalty, presencePenalty=$presencePenalty, responseFormat=$responseFormat, toolChoice=$toolChoice, functionCall=$functionCall, n=$n, stop=$stop, additionalProperties=$additionalProperties}" } @JsonDeserialize(builder = AnthropicModelParams.Builder::class) @@ -1342,8 +1232,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - fun useCache(): Optional = Optional.ofNullable(useCache.getNullable("use_cache")) @@ -1398,42 +1286,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is AnthropicModelParams && - this.useCache == other.useCache && - this.maxTokens == other.maxTokens && - this.temperature == other.temperature && - this.topP == other.topP && - this.topK == other.topK && - this.stopSequences == other.stopSequences && - this.maxTokensToSample == other.maxTokensToSample && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - useCache, - maxTokens, - temperature, - topP, - topK, - stopSequences, - maxTokensToSample, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "AnthropicModelParams{useCache=$useCache, maxTokens=$maxTokens, temperature=$temperature, topP=$topP, topK=$topK, stopSequences=$stopSequences, maxTokensToSample=$maxTokensToSample, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -1543,6 +1395,26 @@ private constructor( additionalProperties.toUnmodifiable(), ) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is AnthropicModelParams && this.useCache == other.useCache && this.maxTokens == other.maxTokens && this.temperature == other.temperature && this.topP == other.topP && this.topK == other.topK && this.stopSequences == other.stopSequences && this.maxTokensToSample == other.maxTokensToSample && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(useCache, maxTokens, temperature, topP, topK, stopSequences, maxTokensToSample, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "AnthropicModelParams{useCache=$useCache, maxTokens=$maxTokens, temperature=$temperature, topP=$topP, topK=$topK, stopSequences=$stopSequences, maxTokensToSample=$maxTokensToSample, additionalProperties=$additionalProperties}" } @JsonDeserialize(builder = GoogleModelParams.Builder::class) @@ -1559,8 +1431,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - fun useCache(): Optional = Optional.ofNullable(useCache.getNullable("use_cache")) @@ -1603,38 +1473,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is GoogleModelParams && - this.useCache == other.useCache && - this.temperature == other.temperature && - this.maxOutputTokens == other.maxOutputTokens && - this.topP == other.topP && - this.topK == other.topK && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - useCache, - temperature, - maxOutputTokens, - topP, - topK, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "GoogleModelParams{useCache=$useCache, temperature=$temperature, maxOutputTokens=$maxOutputTokens, topP=$topP, topK=$topK, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -1719,6 +1557,26 @@ private constructor( additionalProperties.toUnmodifiable(), ) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is GoogleModelParams && this.useCache == other.useCache && this.temperature == other.temperature && this.maxOutputTokens == other.maxOutputTokens && this.topP == other.topP && this.topK == other.topK && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(useCache, temperature, maxOutputTokens, topP, topK, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "GoogleModelParams{useCache=$useCache, temperature=$temperature, maxOutputTokens=$maxOutputTokens, topP=$topP, topK=$topK, additionalProperties=$additionalProperties}" } @JsonDeserialize(builder = WindowAiModelParams.Builder::class) @@ -1733,8 +1591,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - fun useCache(): Optional = Optional.ofNullable(useCache.getNullable("use_cache")) @@ -1764,34 +1620,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is WindowAiModelParams && - this.useCache == other.useCache && - this.temperature == other.temperature && - this.topK == other.topK && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - useCache, - temperature, - topK, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "WindowAiModelParams{useCache=$useCache, temperature=$temperature, topK=$topK, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -1855,20 +1683,38 @@ private constructor( additionalProperties.toUnmodifiable(), ) } - } - - @JsonDeserialize(builder = JsCompletionParams.Builder::class) - @NoAutoDetect - class JsCompletionParams - private constructor( - private val useCache: JsonField, - private val additionalProperties: Map, - ) { - - private var validated: Boolean = false + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is WindowAiModelParams && this.useCache == other.useCache && this.temperature == other.temperature && this.topK == other.topK && this.additionalProperties == other.additionalProperties /* spotless:on */ + } private var hashCode: Int = 0 + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(useCache, temperature, topK, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "WindowAiModelParams{useCache=$useCache, temperature=$temperature, topK=$topK, additionalProperties=$additionalProperties}" + } + + @JsonDeserialize(builder = JsCompletionParams.Builder::class) + @NoAutoDetect + class JsCompletionParams + private constructor( + private val useCache: JsonField, + private val additionalProperties: Map, + ) { + + private var validated: Boolean = false + fun useCache(): Optional = Optional.ofNullable(useCache.getNullable("use_cache")) @@ -1887,26 +1733,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is JsCompletionParams && - this.useCache == other.useCache && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = Objects.hash(useCache, additionalProperties) - } - return hashCode - } - - override fun toString() = - "JsCompletionParams{useCache=$useCache, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -1947,8 +1773,48 @@ private constructor( fun build(): JsCompletionParams = JsCompletionParams(useCache, additionalProperties.toUnmodifiable()) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is JsCompletionParams && this.useCache == other.useCache && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(useCache, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "JsCompletionParams{useCache=$useCache, additionalProperties=$additionalProperties}" + } + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Options && this.model == other.model && this.params == other.params && this.position == other.position && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(model, params, position, additionalProperties) /* spotless:on */ } + return hashCode } + + override fun toString() = + "Options{model=$model, params=$params, position=$position, additionalProperties=$additionalProperties}" } @JsonDeserialize(builder = Origin.Builder::class) @@ -1963,8 +1829,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - fun promptId(): Optional = Optional.ofNullable(promptId.getNullable("prompt_id")) fun projectId(): Optional = Optional.ofNullable(projectId.getNullable("project_id")) @@ -1993,34 +1857,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Origin && - this.promptId == other.promptId && - this.projectId == other.projectId && - this.promptVersion == other.promptVersion && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - promptId, - projectId, - promptVersion, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "Origin{promptId=$promptId, projectId=$projectId, promptVersion=$promptVersion, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -2083,6 +1919,26 @@ private constructor( additionalProperties.toUnmodifiable(), ) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Origin && this.promptId == other.promptId && this.projectId == other.projectId && this.promptVersion == other.promptVersion && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(promptId, projectId, promptVersion, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "Origin{promptId=$promptId, projectId=$projectId, promptVersion=$promptVersion, additionalProperties=$additionalProperties}" } @JsonDeserialize(builder = Parser.Builder::class) @@ -2097,8 +1953,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - fun type(): Type = type.getRequired("type") fun useCot(): Boolean = useCot.getRequired("use_cot") @@ -2126,34 +1980,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Parser && - this.type == other.type && - this.useCot == other.useCot && - this.choiceScores == other.choiceScores && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - type, - useCot, - choiceScores, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "Parser{type=$type, useCot=$useCot, choiceScores=$choiceScores, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -2226,8 +2052,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -2240,24 +2064,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is ChoiceScores && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = Objects.hash(additionalProperties) - } - return hashCode - } - - override fun toString() = "ChoiceScores{additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -2289,6 +2095,25 @@ private constructor( fun build(): ChoiceScores = ChoiceScores(additionalProperties.toUnmodifiable()) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is ChoiceScores && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = "ChoiceScores{additionalProperties=$additionalProperties}" } class Type @@ -2304,7 +2129,7 @@ private constructor( return true } - return other is Type && this.value == other.value + return /* spotless:off */ other is Type && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -2341,6 +2166,26 @@ private constructor( fun asString(): String = _value().asStringOrThrow() } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Parser && this.type == other.type && this.useCot == other.useCot && this.choiceScores == other.choiceScores && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(type, useCot, choiceScores, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "Parser{type=$type, useCot=$useCot, choiceScores=$choiceScores, additionalProperties=$additionalProperties}" } @JsonDeserialize(using = Prompt.Deserializer::class) @@ -2401,18 +2246,11 @@ private constructor( return true } - return other is Prompt && - this.completion == other.completion && - this.chat == other.chat && - this.nullableVariant == other.nullableVariant + return /* spotless:off */ other is Prompt && this.completion == other.completion && this.chat == other.chat && this.nullableVariant == other.nullableVariant /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - completion, - chat, - nullableVariant, - ) + return /* spotless:off */ Objects.hash(completion, chat, nullableVariant) /* spotless:on */ } override fun toString(): String { @@ -2453,6 +2291,7 @@ private constructor( override fun ObjectCodec.deserialize(node: JsonNode): Prompt { val json = JsonValue.fromJsonNode(node) + tryDeserialize(node, jacksonTypeRef()) { it.validate() } ?.let { return Prompt(completion = it, _json = json) @@ -2498,8 +2337,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - fun type(): Type = type.getRequired("type") fun content(): String = content.getRequired("content") @@ -2522,32 +2359,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Completion && - this.type == other.type && - this.content == other.content && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - type, - content, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "Completion{type=$type, content=$content, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -2614,7 +2425,7 @@ private constructor( return true } - return other is Type && this.value == other.value + return /* spotless:off */ other is Type && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -2651,6 +2462,26 @@ private constructor( fun asString(): String = _value().asStringOrThrow() } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Completion && this.type == other.type && this.content == other.content && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(type, content, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "Completion{type=$type, content=$content, additionalProperties=$additionalProperties}" } @JsonDeserialize(builder = Chat.Builder::class) @@ -2665,8 +2496,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - fun type(): Type = type.getRequired("type") fun messages(): List = messages.getRequired("messages") @@ -2694,34 +2523,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Chat && - this.type == other.type && - this.messages == other.messages && - this.tools == other.tools && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - type, - messages, - tools, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "Chat{type=$type, messages=$messages, tools=$tools, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -2878,24 +2679,11 @@ private constructor( return true } - return other is Message && - this.system == other.system && - this.user == other.user && - this.assistant == other.assistant && - this.tool == other.tool && - this.function == other.function && - this.fallback == other.fallback + return /* spotless:off */ other is Message && this.system == other.system && this.user == other.user && this.assistant == other.assistant && this.tool == other.tool && this.function == other.function && this.fallback == other.fallback /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - system, - user, - assistant, - tool, - function, - fallback, - ) + return /* spotless:off */ Objects.hash(system, user, assistant, tool, function, fallback) /* spotless:on */ } override fun toString(): String { @@ -2950,6 +2738,7 @@ private constructor( override fun ObjectCodec.deserialize(node: JsonNode): Message { val json = JsonValue.fromJsonNode(node) + tryDeserialize(node, jacksonTypeRef()) { it.validate() } ?.let { return Message(system = it, _json = json) @@ -3011,8 +2800,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - fun content(): Optional = Optional.ofNullable(content.getNullable("content")) @@ -3041,37 +2828,9 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } + companion object { - return other is System && - this.content == other.content && - this.role == other.role && - this.name == other.name && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - content, - role, - name, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "System{content=$content, role=$role, name=$name, additionalProperties=$additionalProperties}" - - companion object { - - @JvmStatic fun builder() = Builder() + @JvmStatic fun builder() = Builder() } class Builder { @@ -3146,7 +2905,7 @@ private constructor( return true } - return other is Role && this.value == other.value + return /* spotless:off */ other is Role && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -3183,6 +2942,26 @@ private constructor( fun asString(): String = _value().asStringOrThrow() } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is System && this.content == other.content && this.role == other.role && this.name == other.name && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(content, role, name, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "System{content=$content, role=$role, name=$name, additionalProperties=$additionalProperties}" } @JsonDeserialize(builder = User.Builder::class) @@ -3197,8 +2976,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - fun content(): Optional = Optional.ofNullable(content.getNullable("content")) @@ -3227,34 +3004,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is User && - this.content == other.content && - this.role == other.role && - this.name == other.name && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - content, - role, - name, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "User{content=$content, role=$role, name=$name, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -3332,7 +3081,7 @@ private constructor( return true } - return other is Role && this.value == other.value + return /* spotless:off */ other is Role && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -3374,46 +3123,39 @@ private constructor( @JsonSerialize(using = Content.Serializer::class) class Content private constructor( - private val string: String? = null, - private val chatCompletionContentParts: List? = - null, + private val text: String? = null, + private val array: List? = null, private val _json: JsonValue? = null, ) { private var validated: Boolean = false - fun string(): Optional = Optional.ofNullable(string) + fun text(): Optional = Optional.ofNullable(text) - fun chatCompletionContentParts(): - Optional> = - Optional.ofNullable(chatCompletionContentParts) + fun array(): Optional> = + Optional.ofNullable(array) - fun isString(): Boolean = string != null + fun isText(): Boolean = text != null - fun isChatCompletionContentParts(): Boolean = - chatCompletionContentParts != null + fun isArray(): Boolean = array != null - fun asString(): String = string.getOrThrow("string") + fun asText(): String = text.getOrThrow("text") - fun asChatCompletionContentParts(): List = - chatCompletionContentParts.getOrThrow("chatCompletionContentParts") + fun asArray(): List = array.getOrThrow("array") fun _json(): Optional = Optional.ofNullable(_json) fun accept(visitor: Visitor): T { return when { - string != null -> visitor.visitString(string) - chatCompletionContentParts != null -> - visitor.visitChatCompletionContentParts( - chatCompletionContentParts - ) + text != null -> visitor.visitText(text) + array != null -> visitor.visitArray(array) else -> visitor.unknown(_json) } } fun validate(): Content = apply { if (!validated) { - if (string == null && chatCompletionContentParts == null) { + if (text == null && array == null) { throw BraintrustInvalidDataException("Unknown Content: $_json") } validated = true @@ -3425,20 +3167,17 @@ private constructor( return true } - return other is Content && - this.string == other.string && - this.chatCompletionContentParts == other.chatCompletionContentParts + return /* spotless:off */ other is Content && this.text == other.text && this.array == other.array /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash(string, chatCompletionContentParts) + return /* spotless:off */ Objects.hash(text, array) /* spotless:on */ } override fun toString(): String { return when { - string != null -> "Content{string=$string}" - chatCompletionContentParts != null -> - "Content{chatCompletionContentParts=$chatCompletionContentParts}" + text != null -> "Content{text=$text}" + array != null -> "Content{array=$array}" _json != null -> "Content{_unknown=$_json}" else -> throw IllegalStateException("Invalid Content") } @@ -3446,21 +3185,18 @@ private constructor( companion object { - @JvmStatic fun ofString(string: String) = Content(string = string) + @JvmStatic fun ofText(text: String) = Content(text = text) @JvmStatic - fun ofChatCompletionContentParts( - chatCompletionContentParts: List - ) = Content(chatCompletionContentParts = chatCompletionContentParts) + fun ofArray(array: List) = + Content(array = array) } interface Visitor { - fun visitString(string: String): T + fun visitText(text: String): T - fun visitChatCompletionContentParts( - chatCompletionContentParts: List - ): T + fun visitArray(array: List): T fun unknown(json: JsonValue?): T { throw BraintrustInvalidDataException("Unknown Content: $json") @@ -3471,18 +3207,16 @@ private constructor( override fun ObjectCodec.deserialize(node: JsonNode): Content { val json = JsonValue.fromJsonNode(node) + tryDeserialize(node, jacksonTypeRef())?.let { - return Content(string = it, _json = json) + return Content(text = it, _json = json) } tryDeserialize( node, jacksonTypeRef>() ) ?.let { - return Content( - chatCompletionContentParts = it, - _json = json - ) + return Content(array = it, _json = json) } return Content(_json = json) @@ -3497,9 +3231,8 @@ private constructor( provider: SerializerProvider ) { when { - value.string != null -> generator.writeObject(value.string) - value.chatCompletionContentParts != null -> - generator.writeObject(value.chatCompletionContentParts) + value.text != null -> generator.writeObject(value.text) + value.array != null -> generator.writeObject(value.array) value._json != null -> generator.writeObject(value._json) else -> throw IllegalStateException("Invalid Content") } @@ -3582,18 +3315,11 @@ private constructor( return true } - return other is ChatCompletionContentPart && - this.chatCompletionContentPartText == - other.chatCompletionContentPartText && - this.chatCompletionContentPartImage == - other.chatCompletionContentPartImage + return /* spotless:off */ other is ChatCompletionContentPart && this.chatCompletionContentPartText == other.chatCompletionContentPartText && this.chatCompletionContentPartImage == other.chatCompletionContentPartImage /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - chatCompletionContentPartText, - chatCompletionContentPartImage - ) + return /* spotless:off */ Objects.hash(chatCompletionContentPartText, chatCompletionContentPartImage) /* spotless:on */ } override fun toString(): String { @@ -3657,6 +3383,7 @@ private constructor( node: JsonNode ): ChatCompletionContentPart { val json = JsonValue.fromJsonNode(node) + tryDeserialize( node, jacksonTypeRef() @@ -3715,6 +3442,26 @@ private constructor( } } } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is User && this.content == other.content && this.role == other.role && this.name == other.name && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(content, role, name, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "User{content=$content, role=$role, name=$name, additionalProperties=$additionalProperties}" } @JsonDeserialize(builder = Assistant.Builder::class) @@ -3731,8 +3478,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - fun role(): Role = role.getRequired("role") fun content(): Optional = @@ -3775,38 +3520,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Assistant && - this.role == other.role && - this.content == other.content && - this.functionCall == other.functionCall && - this.name == other.name && - this.toolCalls == other.toolCalls && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - role, - content, - functionCall, - name, - toolCalls, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "Assistant{role=$role, content=$content, functionCall=$functionCall, name=$name, toolCalls=$toolCalls, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -3910,7 +3623,7 @@ private constructor( return true } - return other is Role && this.value == other.value + return /* spotless:off */ other is Role && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -3959,8 +3672,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - fun arguments(): String = arguments.getRequired("arguments") fun name(): String = name.getRequired("name") @@ -3983,32 +3694,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is FunctionCall && - this.arguments == other.arguments && - this.name == other.name && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - arguments, - name, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "FunctionCall{arguments=$arguments, name=$name, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -4064,7 +3749,47 @@ private constructor( additionalProperties.toUnmodifiable(), ) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is FunctionCall && this.arguments == other.arguments && this.name == other.name && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(arguments, name, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "FunctionCall{arguments=$arguments, name=$name, additionalProperties=$additionalProperties}" } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Assistant && this.role == other.role && this.content == other.content && this.functionCall == other.functionCall && this.name == other.name && this.toolCalls == other.toolCalls && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(role, content, functionCall, name, toolCalls, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "Assistant{role=$role, content=$content, functionCall=$functionCall, name=$name, toolCalls=$toolCalls, additionalProperties=$additionalProperties}" } @JsonDeserialize(builder = Tool.Builder::class) @@ -4079,8 +3804,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - fun content(): Optional = Optional.ofNullable(content.getNullable("content")) @@ -4110,34 +3833,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Tool && - this.content == other.content && - this.role == other.role && - this.toolCallId == other.toolCallId && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - content, - role, - toolCallId, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "Tool{content=$content, role=$role, toolCallId=$toolCallId, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -4217,7 +3912,7 @@ private constructor( return true } - return other is Role && this.value == other.value + return /* spotless:off */ other is Role && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -4254,6 +3949,26 @@ private constructor( fun asString(): String = _value().asStringOrThrow() } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Tool && this.content == other.content && this.role == other.role && this.toolCallId == other.toolCallId && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(content, role, toolCallId, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "Tool{content=$content, role=$role, toolCallId=$toolCallId, additionalProperties=$additionalProperties}" } @JsonDeserialize(builder = Function.Builder::class) @@ -4268,8 +3983,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - fun content(): Optional = Optional.ofNullable(content.getNullable("content")) @@ -4298,34 +4011,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Function && - this.content == other.content && - this.name == other.name && - this.role == other.role && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - content, - name, - role, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "Function{content=$content, name=$name, role=$role, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -4403,7 +4088,7 @@ private constructor( return true } - return other is Role && this.value == other.value + return /* spotless:off */ other is Role && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -4440,6 +4125,26 @@ private constructor( fun asString(): String = _value().asStringOrThrow() } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Function && this.content == other.content && this.name == other.name && this.role == other.role && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(content, name, role, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "Function{content=$content, name=$name, role=$role, additionalProperties=$additionalProperties}" } @JsonDeserialize(builder = Fallback.Builder::class) @@ -4453,8 +4158,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - fun role(): Role = role.getRequired("role") fun content(): Optional = @@ -4478,32 +4181,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Fallback && - this.role == other.role && - this.content == other.content && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - role, - content, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "Fallback{role=$role, content=$content, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -4572,7 +4249,7 @@ private constructor( return true } - return other is Role && this.value == other.value + return /* spotless:off */ other is Role && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -4609,6 +4286,26 @@ private constructor( fun asString(): String = _value().asStringOrThrow() } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Fallback && this.role == other.role && this.content == other.content && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(role, content, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "Fallback{role=$role, content=$content, additionalProperties=$additionalProperties}" } } @@ -4625,7 +4322,7 @@ private constructor( return true } - return other is Type && this.value == other.value + return /* spotless:off */ other is Type && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -4662,6 +4359,26 @@ private constructor( fun asString(): String = _value().asStringOrThrow() } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Chat && this.type == other.type && this.messages == other.messages && this.tools == other.tools && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(type, messages, tools, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "Chat{type=$type, messages=$messages, tools=$tools, additionalProperties=$additionalProperties}" } @JsonDeserialize(builder = NullableVariant.Builder::class) @@ -4673,8 +4390,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -4687,24 +4402,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is NullableVariant && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = Objects.hash(additionalProperties) - } - return hashCode - } - - override fun toString() = "NullableVariant{additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -4737,6 +4434,25 @@ private constructor( fun build(): NullableVariant = NullableVariant(additionalProperties.toUnmodifiable()) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is NullableVariant && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = "NullableVariant{additionalProperties=$additionalProperties}" } } @@ -4789,13 +4505,11 @@ private constructor( return true } - return other is ToolFunction && - this.function == other.function && - this.global == other.global + return /* spotless:off */ other is ToolFunction && this.function == other.function && this.global == other.global /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash(function, global) + return /* spotless:off */ Objects.hash(function, global) /* spotless:on */ } override fun toString(): String { @@ -4829,6 +4543,7 @@ private constructor( override fun ObjectCodec.deserialize(node: JsonNode): ToolFunction { val json = JsonValue.fromJsonNode(node) + tryDeserialize(node, jacksonTypeRef()) { it.validate() } ?.let { return ToolFunction(function = it, _json = json) @@ -4869,8 +4584,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - fun type(): Type = type.getRequired("type") fun id(): String = id.getRequired("id") @@ -4893,32 +4606,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Function && - this.type == other.type && - this.id == other.id && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - type, - id, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "Function{type=$type, id=$id, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -4985,7 +4672,7 @@ private constructor( return true } - return other is Type && this.value == other.value + return /* spotless:off */ other is Type && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -5022,6 +4709,26 @@ private constructor( fun asString(): String = _value().asStringOrThrow() } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Function && this.type == other.type && this.id == other.id && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(type, id, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "Function{type=$type, id=$id, additionalProperties=$additionalProperties}" } @JsonDeserialize(builder = Global.Builder::class) @@ -5035,8 +4742,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - fun type(): Type = type.getRequired("type") fun name(): String = name.getRequired("name") @@ -5059,32 +4764,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Global && - this.type == other.type && - this.name == other.name && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - type, - name, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "Global{type=$type, name=$name, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -5151,7 +4830,7 @@ private constructor( return true } - return other is Type && this.value == other.value + return /* spotless:off */ other is Type && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -5188,6 +4867,46 @@ private constructor( fun asString(): String = _value().asStringOrThrow() } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Global && this.type == other.type && this.name == other.name && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(type, name, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "Global{type=$type, name=$name, additionalProperties=$additionalProperties}" } } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is PromptData && this.prompt == other.prompt && this.options == other.options && this.parser == other.parser && this.toolFunctions == other.toolFunctions && this.origin == other.origin && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(prompt, options, parser, toolFunctions, origin, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "PromptData{prompt=$prompt, options=$options, parser=$parser, toolFunctions=$toolFunctions, origin=$origin, additionalProperties=$additionalProperties}" } diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/PromptDeleteParams.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/PromptDeleteParams.kt index 586d384a..197004ad 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/PromptDeleteParams.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/PromptDeleteParams.kt @@ -46,20 +46,11 @@ constructor( return true } - return other is PromptDeleteParams && - this.promptId == other.promptId && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders && - this.additionalBodyProperties == other.additionalBodyProperties + return /* spotless:off */ other is PromptDeleteParams && this.promptId == other.promptId && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders && this.additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - promptId, - additionalQueryParams, - additionalHeaders, - additionalBodyProperties, - ) + return /* spotless:off */ Objects.hash(promptId, additionalQueryParams, additionalHeaders, additionalBodyProperties) /* spotless:on */ } override fun toString() = diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/PromptListPage.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/PromptListPage.kt index 43cda3c0..c7ca805e 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/PromptListPage.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/PromptListPage.kt @@ -34,18 +34,11 @@ private constructor( return true } - return other is PromptListPage && - this.promptsService == other.promptsService && - this.params == other.params && - this.response == other.response + return /* spotless:off */ other is PromptListPage && this.promptsService == other.promptsService && this.params == other.params && this.response == other.response /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - promptsService, - params, - response, - ) + return /* spotless:off */ Objects.hash(promptsService, params, response) /* spotless:on */ } override fun toString() = @@ -121,13 +114,11 @@ private constructor( return true } - return other is Response && - this.objects == other.objects && - this.additionalProperties == other.additionalProperties + return /* spotless:off */ other is Response && this.objects == other.objects && this.additionalProperties == other.additionalProperties /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash(objects, additionalProperties) + return /* spotless:off */ Objects.hash(objects, additionalProperties) /* spotless:on */ } override fun toString() = diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/PromptListPageAsync.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/PromptListPageAsync.kt index 31a7d456..c55289e4 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/PromptListPageAsync.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/PromptListPageAsync.kt @@ -35,18 +35,11 @@ private constructor( return true } - return other is PromptListPageAsync && - this.promptsService == other.promptsService && - this.params == other.params && - this.response == other.response + return /* spotless:off */ other is PromptListPageAsync && this.promptsService == other.promptsService && this.params == other.params && this.response == other.response /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - promptsService, - params, - response, - ) + return /* spotless:off */ Objects.hash(promptsService, params, response) /* spotless:on */ } override fun toString() = @@ -124,13 +117,11 @@ private constructor( return true } - return other is Response && - this.objects == other.objects && - this.additionalProperties == other.additionalProperties + return /* spotless:off */ other is Response && this.objects == other.objects && this.additionalProperties == other.additionalProperties /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash(objects, additionalProperties) + return /* spotless:off */ Objects.hash(objects, additionalProperties) /* spotless:on */ } override fun toString() = diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/PromptListParams.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/PromptListParams.kt index 9dfce694..28984928 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/PromptListParams.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/PromptListParams.kt @@ -84,36 +84,11 @@ constructor( return true } - return other is PromptListParams && - this.endingBefore == other.endingBefore && - this.ids == other.ids && - this.limit == other.limit && - this.orgName == other.orgName && - this.projectId == other.projectId && - this.projectName == other.projectName && - this.promptName == other.promptName && - this.slug == other.slug && - this.startingAfter == other.startingAfter && - this.version == other.version && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders + return /* spotless:off */ other is PromptListParams && this.endingBefore == other.endingBefore && this.ids == other.ids && this.limit == other.limit && this.orgName == other.orgName && this.projectId == other.projectId && this.projectName == other.projectName && this.promptName == other.promptName && this.slug == other.slug && this.startingAfter == other.startingAfter && this.version == other.version && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - endingBefore, - ids, - limit, - orgName, - projectId, - projectName, - promptName, - slug, - startingAfter, - version, - additionalQueryParams, - additionalHeaders, - ) + return /* spotless:off */ Objects.hash(endingBefore, ids, limit, orgName, projectId, projectName, promptName, slug, startingAfter, version, additionalQueryParams, additionalHeaders) /* spotless:on */ } override fun toString() = @@ -183,7 +158,7 @@ constructor( * Filter search results to a particular set of object IDs. To specify a list of IDs, * include the query param multiple times */ - fun ids(strings: List) = apply { this.ids = Ids.ofStrings(strings) } + fun idsOfStrings(strings: List) = apply { this.ids = Ids.ofStrings(strings) } /** Limit the number of objects to return */ fun limit(limit: Long) = apply { this.limit = limit } @@ -324,11 +299,11 @@ constructor( return true } - return other is Ids && this.string == other.string && this.strings == other.strings + return /* spotless:off */ other is Ids && this.string == other.string && this.strings == other.strings /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash(string, strings) + return /* spotless:off */ Objects.hash(string, strings) /* spotless:on */ } override fun toString(): String { @@ -362,6 +337,7 @@ constructor( override fun ObjectCodec.deserialize(node: JsonNode): Ids { val json = JsonValue.fromJsonNode(node) + tryDeserialize(node, jacksonTypeRef())?.let { return Ids(string = it, _json = json) } diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/PromptReplaceParams.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/PromptReplaceParams.kt index ae734d51..9b731273 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/PromptReplaceParams.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/PromptReplaceParams.kt @@ -78,8 +78,6 @@ constructor( private val additionalProperties: Map, ) { - private var hashCode: Int = 0 - /** Name of the prompt */ @JsonProperty("name") fun name(): String? = name @@ -106,42 +104,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is PromptReplaceBody && - this.name == other.name && - this.projectId == other.projectId && - this.slug == other.slug && - this.description == other.description && - this.functionType == other.functionType && - this.promptData == other.promptData && - this.tags == other.tags && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - name, - projectId, - slug, - description, - functionType, - promptData, - tags, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "PromptReplaceBody{name=$name, projectId=$projectId, slug=$slug, description=$description, functionType=$functionType, promptData=$promptData, tags=$tags, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -222,6 +184,26 @@ constructor( additionalProperties.toUnmodifiable(), ) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is PromptReplaceBody && this.name == other.name && this.projectId == other.projectId && this.slug == other.slug && this.description == other.description && this.functionType == other.functionType && this.promptData == other.promptData && this.tags == other.tags && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(name, projectId, slug, description, functionType, promptData, tags, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "PromptReplaceBody{name=$name, projectId=$projectId, slug=$slug, description=$description, functionType=$functionType, promptData=$promptData, tags=$tags, additionalProperties=$additionalProperties}" } fun _additionalQueryParams(): Map> = additionalQueryParams @@ -235,32 +217,11 @@ constructor( return true } - return other is PromptReplaceParams && - this.name == other.name && - this.projectId == other.projectId && - this.slug == other.slug && - this.description == other.description && - this.functionType == other.functionType && - this.promptData == other.promptData && - this.tags == other.tags && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders && - this.additionalBodyProperties == other.additionalBodyProperties + return /* spotless:off */ other is PromptReplaceParams && this.name == other.name && this.projectId == other.projectId && this.slug == other.slug && this.description == other.description && this.functionType == other.functionType && this.promptData == other.promptData && this.tags == other.tags && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders && this.additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - name, - projectId, - slug, - description, - functionType, - promptData, - tags, - additionalQueryParams, - additionalHeaders, - additionalBodyProperties, - ) + return /* spotless:off */ Objects.hash(name, projectId, slug, description, functionType, promptData, tags, additionalQueryParams, additionalHeaders, additionalBodyProperties) /* spotless:on */ } override fun toString() = @@ -409,7 +370,7 @@ constructor( return true } - return other is FunctionType && this.value == other.value + return /* spotless:off */ other is FunctionType && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/PromptRetrieveParams.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/PromptRetrieveParams.kt index 5fb7fad1..ace5c98d 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/PromptRetrieveParams.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/PromptRetrieveParams.kt @@ -36,18 +36,11 @@ constructor( return true } - return other is PromptRetrieveParams && - this.promptId == other.promptId && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders + return /* spotless:off */ other is PromptRetrieveParams && this.promptId == other.promptId && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - promptId, - additionalQueryParams, - additionalHeaders, - ) + return /* spotless:off */ Objects.hash(promptId, additionalQueryParams, additionalHeaders) /* spotless:on */ } override fun toString() = diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/PromptUpdateParams.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/PromptUpdateParams.kt index 334bbcba..f03ef924 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/PromptUpdateParams.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/PromptUpdateParams.kt @@ -74,8 +74,6 @@ constructor( private val additionalProperties: Map, ) { - private var hashCode: Int = 0 - /** Textual description of the prompt */ @JsonProperty("description") fun description(): String? = description @@ -97,38 +95,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is PromptUpdateBody && - this.description == other.description && - this.name == other.name && - this.promptData == other.promptData && - this.slug == other.slug && - this.tags == other.tags && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - description, - name, - promptData, - slug, - tags, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "PromptUpdateBody{description=$description, name=$name, promptData=$promptData, slug=$slug, tags=$tags, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -194,6 +160,26 @@ constructor( additionalProperties.toUnmodifiable(), ) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is PromptUpdateBody && this.description == other.description && this.name == other.name && this.promptData == other.promptData && this.slug == other.slug && this.tags == other.tags && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(description, name, promptData, slug, tags, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "PromptUpdateBody{description=$description, name=$name, promptData=$promptData, slug=$slug, tags=$tags, additionalProperties=$additionalProperties}" } fun _additionalQueryParams(): Map> = additionalQueryParams @@ -207,30 +193,11 @@ constructor( return true } - return other is PromptUpdateParams && - this.promptId == other.promptId && - this.description == other.description && - this.name == other.name && - this.promptData == other.promptData && - this.slug == other.slug && - this.tags == other.tags && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders && - this.additionalBodyProperties == other.additionalBodyProperties + return /* spotless:off */ other is PromptUpdateParams && this.promptId == other.promptId && this.description == other.description && this.name == other.name && this.promptData == other.promptData && this.slug == other.slug && this.tags == other.tags && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders && this.additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - promptId, - description, - name, - promptData, - slug, - tags, - additionalQueryParams, - additionalHeaders, - additionalBodyProperties, - ) + return /* spotless:off */ Objects.hash(promptId, description, name, promptData, slug, tags, additionalQueryParams, additionalHeaders, additionalBodyProperties) /* spotless:on */ } override fun toString() = diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/RepoInfo.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/RepoInfo.kt index 6447c8f7..d57bd593 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/RepoInfo.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/RepoInfo.kt @@ -34,8 +34,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - /** SHA of most recent commit */ fun commit(): Optional = Optional.ofNullable(commit.getNullable("commit")) @@ -119,46 +117,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is RepoInfo && - this.commit == other.commit && - this.branch == other.branch && - this.tag == other.tag && - this.dirty == other.dirty && - this.authorName == other.authorName && - this.authorEmail == other.authorEmail && - this.commitMessage == other.commitMessage && - this.commitTime == other.commitTime && - this.gitDiff == other.gitDiff && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - commit, - branch, - tag, - dirty, - authorName, - authorEmail, - commitMessage, - commitTime, - gitDiff, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "RepoInfo{commit=$commit, branch=$branch, tag=$tag, dirty=$dirty, authorName=$authorName, authorEmail=$authorEmail, commitMessage=$commitMessage, commitTime=$commitTime, gitDiff=$gitDiff, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -299,4 +257,24 @@ private constructor( additionalProperties.toUnmodifiable(), ) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is RepoInfo && this.commit == other.commit && this.branch == other.branch && this.tag == other.tag && this.dirty == other.dirty && this.authorName == other.authorName && this.authorEmail == other.authorEmail && this.commitMessage == other.commitMessage && this.commitTime == other.commitTime && this.gitDiff == other.gitDiff && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(commit, branch, tag, dirty, authorName, authorEmail, commitMessage, commitTime, gitDiff, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "RepoInfo{commit=$commit, branch=$branch, tag=$tag, dirty=$dirty, authorName=$authorName, authorEmail=$authorEmail, commitMessage=$commitMessage, commitTime=$commitTime, gitDiff=$gitDiff, additionalProperties=$additionalProperties}" } diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/Role.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/Role.kt index a5d749f1..610b1156 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/Role.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/Role.kt @@ -42,8 +42,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - /** Unique identifier for the role */ fun id(): String = id.getRequired("id") @@ -147,46 +145,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Role && - this.id == other.id && - this.orgId == other.orgId && - this.userId == other.userId && - this.created == other.created && - this.name == other.name && - this.description == other.description && - this.deletedAt == other.deletedAt && - this.memberPermissions == other.memberPermissions && - this.memberRoles == other.memberRoles && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - id, - orgId, - userId, - created, - name, - description, - deletedAt, - memberPermissions, - memberRoles, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "Role{id=$id, orgId=$orgId, userId=$userId, created=$created, name=$name, description=$description, deletedAt=$deletedAt, memberPermissions=$memberPermissions, memberRoles=$memberRoles, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -358,8 +316,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - /** * Each permission permits a certain type of operation on an object in the system * @@ -397,32 +353,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is MemberPermission && - this.permission == other.permission && - this.restrictObjectType == other.restrictObjectType && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - permission, - restrictObjectType, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "MemberPermission{permission=$permission, restrictObjectType=$restrictObjectType, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -507,7 +437,7 @@ private constructor( return true } - return other is Permission && this.value == other.value + return /* spotless:off */ other is Permission && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -600,7 +530,7 @@ private constructor( return true } - return other is RestrictObjectType && this.value == other.value + return /* spotless:off */ other is RestrictObjectType && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -698,5 +628,45 @@ private constructor( fun asString(): String = _value().asStringOrThrow() } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is MemberPermission && this.permission == other.permission && this.restrictObjectType == other.restrictObjectType && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(permission, restrictObjectType, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "MemberPermission{permission=$permission, restrictObjectType=$restrictObjectType, additionalProperties=$additionalProperties}" } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Role && this.id == other.id && this.orgId == other.orgId && this.userId == other.userId && this.created == other.created && this.name == other.name && this.description == other.description && this.deletedAt == other.deletedAt && this.memberPermissions == other.memberPermissions && this.memberRoles == other.memberRoles && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(id, orgId, userId, created, name, description, deletedAt, memberPermissions, memberRoles, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "Role{id=$id, orgId=$orgId, userId=$userId, created=$created, name=$name, description=$description, deletedAt=$deletedAt, memberPermissions=$memberPermissions, memberRoles=$memberRoles, additionalProperties=$additionalProperties}" } diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/RoleCreateParams.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/RoleCreateParams.kt index 492f4055..4d55e6e5 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/RoleCreateParams.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/RoleCreateParams.kt @@ -69,8 +69,6 @@ constructor( private val additionalProperties: Map, ) { - private var hashCode: Int = 0 - /** Name of the role */ @JsonProperty("name") fun name(): String? = name @@ -102,38 +100,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is RoleCreateBody && - this.name == other.name && - this.description == other.description && - this.memberPermissions == other.memberPermissions && - this.memberRoles == other.memberRoles && - this.orgName == other.orgName && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - name, - description, - memberPermissions, - memberRoles, - orgName, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "RoleCreateBody{name=$name, description=$description, memberPermissions=$memberPermissions, memberRoles=$memberRoles, orgName=$orgName, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -212,6 +178,26 @@ constructor( additionalProperties.toUnmodifiable(), ) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is RoleCreateBody && this.name == other.name && this.description == other.description && this.memberPermissions == other.memberPermissions && this.memberRoles == other.memberRoles && this.orgName == other.orgName && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(name, description, memberPermissions, memberRoles, orgName, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "RoleCreateBody{name=$name, description=$description, memberPermissions=$memberPermissions, memberRoles=$memberRoles, orgName=$orgName, additionalProperties=$additionalProperties}" } fun _additionalQueryParams(): Map> = additionalQueryParams @@ -225,28 +211,11 @@ constructor( return true } - return other is RoleCreateParams && - this.name == other.name && - this.description == other.description && - this.memberPermissions == other.memberPermissions && - this.memberRoles == other.memberRoles && - this.orgName == other.orgName && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders && - this.additionalBodyProperties == other.additionalBodyProperties + return /* spotless:off */ other is RoleCreateParams && this.name == other.name && this.description == other.description && this.memberPermissions == other.memberPermissions && this.memberRoles == other.memberRoles && this.orgName == other.orgName && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders && this.additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - name, - description, - memberPermissions, - memberRoles, - orgName, - additionalQueryParams, - additionalHeaders, - additionalBodyProperties, - ) + return /* spotless:off */ Objects.hash(name, description, memberPermissions, memberRoles, orgName, additionalQueryParams, additionalHeaders, additionalBodyProperties) /* spotless:on */ } override fun toString() = @@ -402,8 +371,6 @@ constructor( private val additionalProperties: Map, ) { - private var hashCode: Int = 0 - /** * Each permission permits a certain type of operation on an object in the system * @@ -421,32 +388,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is MemberPermission && - this.permission == other.permission && - this.restrictObjectType == other.restrictObjectType && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - permission, - restrictObjectType, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "MemberPermission{permission=$permission, restrictObjectType=$restrictObjectType, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -515,7 +456,7 @@ constructor( return true } - return other is Permission && this.value == other.value + return /* spotless:off */ other is Permission && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -608,7 +549,7 @@ constructor( return true } - return other is RestrictObjectType && this.value == other.value + return /* spotless:off */ other is RestrictObjectType && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -706,5 +647,25 @@ constructor( fun asString(): String = _value().asStringOrThrow() } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is MemberPermission && this.permission == other.permission && this.restrictObjectType == other.restrictObjectType && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(permission, restrictObjectType, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "MemberPermission{permission=$permission, restrictObjectType=$restrictObjectType, additionalProperties=$additionalProperties}" } } diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/RoleDeleteParams.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/RoleDeleteParams.kt index 8e8f313f..0423855c 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/RoleDeleteParams.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/RoleDeleteParams.kt @@ -46,20 +46,11 @@ constructor( return true } - return other is RoleDeleteParams && - this.roleId == other.roleId && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders && - this.additionalBodyProperties == other.additionalBodyProperties + return /* spotless:off */ other is RoleDeleteParams && this.roleId == other.roleId && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders && this.additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - roleId, - additionalQueryParams, - additionalHeaders, - additionalBodyProperties, - ) + return /* spotless:off */ Objects.hash(roleId, additionalQueryParams, additionalHeaders, additionalBodyProperties) /* spotless:on */ } override fun toString() = diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/RoleListPage.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/RoleListPage.kt index d49ae5dc..99125be5 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/RoleListPage.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/RoleListPage.kt @@ -34,18 +34,11 @@ private constructor( return true } - return other is RoleListPage && - this.rolesService == other.rolesService && - this.params == other.params && - this.response == other.response + return /* spotless:off */ other is RoleListPage && this.rolesService == other.rolesService && this.params == other.params && this.response == other.response /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - rolesService, - params, - response, - ) + return /* spotless:off */ Objects.hash(rolesService, params, response) /* spotless:on */ } override fun toString() = @@ -121,13 +114,11 @@ private constructor( return true } - return other is Response && - this.objects == other.objects && - this.additionalProperties == other.additionalProperties + return /* spotless:off */ other is Response && this.objects == other.objects && this.additionalProperties == other.additionalProperties /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash(objects, additionalProperties) + return /* spotless:off */ Objects.hash(objects, additionalProperties) /* spotless:on */ } override fun toString() = diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/RoleListPageAsync.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/RoleListPageAsync.kt index a53c7f0f..14597025 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/RoleListPageAsync.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/RoleListPageAsync.kt @@ -35,18 +35,11 @@ private constructor( return true } - return other is RoleListPageAsync && - this.rolesService == other.rolesService && - this.params == other.params && - this.response == other.response + return /* spotless:off */ other is RoleListPageAsync && this.rolesService == other.rolesService && this.params == other.params && this.response == other.response /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - rolesService, - params, - response, - ) + return /* spotless:off */ Objects.hash(rolesService, params, response) /* spotless:on */ } override fun toString() = @@ -124,13 +117,11 @@ private constructor( return true } - return other is Response && - this.objects == other.objects && - this.additionalProperties == other.additionalProperties + return /* spotless:off */ other is Response && this.objects == other.objects && this.additionalProperties == other.additionalProperties /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash(objects, additionalProperties) + return /* spotless:off */ Objects.hash(objects, additionalProperties) /* spotless:on */ } override fun toString() = diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/RoleListParams.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/RoleListParams.kt index 33910b59..44250688 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/RoleListParams.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/RoleListParams.kt @@ -68,28 +68,11 @@ constructor( return true } - return other is RoleListParams && - this.endingBefore == other.endingBefore && - this.ids == other.ids && - this.limit == other.limit && - this.orgName == other.orgName && - this.roleName == other.roleName && - this.startingAfter == other.startingAfter && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders + return /* spotless:off */ other is RoleListParams && this.endingBefore == other.endingBefore && this.ids == other.ids && this.limit == other.limit && this.orgName == other.orgName && this.roleName == other.roleName && this.startingAfter == other.startingAfter && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - endingBefore, - ids, - limit, - orgName, - roleName, - startingAfter, - additionalQueryParams, - additionalHeaders, - ) + return /* spotless:off */ Objects.hash(endingBefore, ids, limit, orgName, roleName, startingAfter, additionalQueryParams, additionalHeaders) /* spotless:on */ } override fun toString() = @@ -151,7 +134,7 @@ constructor( * Filter search results to a particular set of object IDs. To specify a list of IDs, * include the query param multiple times */ - fun ids(strings: List) = apply { this.ids = Ids.ofStrings(strings) } + fun idsOfStrings(strings: List) = apply { this.ids = Ids.ofStrings(strings) } /** Limit the number of objects to return */ fun limit(limit: Long) = apply { this.limit = limit } @@ -271,11 +254,11 @@ constructor( return true } - return other is Ids && this.string == other.string && this.strings == other.strings + return /* spotless:off */ other is Ids && this.string == other.string && this.strings == other.strings /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash(string, strings) + return /* spotless:off */ Objects.hash(string, strings) /* spotless:on */ } override fun toString(): String { @@ -309,6 +292,7 @@ constructor( override fun ObjectCodec.deserialize(node: JsonNode): Ids { val json = JsonValue.fromJsonNode(node) + tryDeserialize(node, jacksonTypeRef())?.let { return Ids(string = it, _json = json) } diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/RoleReplaceParams.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/RoleReplaceParams.kt index 68772fb6..a9d35087 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/RoleReplaceParams.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/RoleReplaceParams.kt @@ -69,8 +69,6 @@ constructor( private val additionalProperties: Map, ) { - private var hashCode: Int = 0 - /** Name of the role */ @JsonProperty("name") fun name(): String? = name @@ -102,38 +100,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is RoleReplaceBody && - this.name == other.name && - this.description == other.description && - this.memberPermissions == other.memberPermissions && - this.memberRoles == other.memberRoles && - this.orgName == other.orgName && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - name, - description, - memberPermissions, - memberRoles, - orgName, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "RoleReplaceBody{name=$name, description=$description, memberPermissions=$memberPermissions, memberRoles=$memberRoles, orgName=$orgName, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -212,6 +178,26 @@ constructor( additionalProperties.toUnmodifiable(), ) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is RoleReplaceBody && this.name == other.name && this.description == other.description && this.memberPermissions == other.memberPermissions && this.memberRoles == other.memberRoles && this.orgName == other.orgName && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(name, description, memberPermissions, memberRoles, orgName, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "RoleReplaceBody{name=$name, description=$description, memberPermissions=$memberPermissions, memberRoles=$memberRoles, orgName=$orgName, additionalProperties=$additionalProperties}" } fun _additionalQueryParams(): Map> = additionalQueryParams @@ -225,28 +211,11 @@ constructor( return true } - return other is RoleReplaceParams && - this.name == other.name && - this.description == other.description && - this.memberPermissions == other.memberPermissions && - this.memberRoles == other.memberRoles && - this.orgName == other.orgName && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders && - this.additionalBodyProperties == other.additionalBodyProperties + return /* spotless:off */ other is RoleReplaceParams && this.name == other.name && this.description == other.description && this.memberPermissions == other.memberPermissions && this.memberRoles == other.memberRoles && this.orgName == other.orgName && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders && this.additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - name, - description, - memberPermissions, - memberRoles, - orgName, - additionalQueryParams, - additionalHeaders, - additionalBodyProperties, - ) + return /* spotless:off */ Objects.hash(name, description, memberPermissions, memberRoles, orgName, additionalQueryParams, additionalHeaders, additionalBodyProperties) /* spotless:on */ } override fun toString() = @@ -402,8 +371,6 @@ constructor( private val additionalProperties: Map, ) { - private var hashCode: Int = 0 - /** * Each permission permits a certain type of operation on an object in the system * @@ -421,32 +388,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is MemberPermission && - this.permission == other.permission && - this.restrictObjectType == other.restrictObjectType && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - permission, - restrictObjectType, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "MemberPermission{permission=$permission, restrictObjectType=$restrictObjectType, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -515,7 +456,7 @@ constructor( return true } - return other is Permission && this.value == other.value + return /* spotless:off */ other is Permission && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -608,7 +549,7 @@ constructor( return true } - return other is RestrictObjectType && this.value == other.value + return /* spotless:off */ other is RestrictObjectType && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -706,5 +647,25 @@ constructor( fun asString(): String = _value().asStringOrThrow() } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is MemberPermission && this.permission == other.permission && this.restrictObjectType == other.restrictObjectType && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(permission, restrictObjectType, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "MemberPermission{permission=$permission, restrictObjectType=$restrictObjectType, additionalProperties=$additionalProperties}" } } diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/RoleRetrieveParams.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/RoleRetrieveParams.kt index 9f1fbfef..7bcb1535 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/RoleRetrieveParams.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/RoleRetrieveParams.kt @@ -36,18 +36,11 @@ constructor( return true } - return other is RoleRetrieveParams && - this.roleId == other.roleId && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders + return /* spotless:off */ other is RoleRetrieveParams && this.roleId == other.roleId && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - roleId, - additionalQueryParams, - additionalHeaders, - ) + return /* spotless:off */ Objects.hash(roleId, additionalQueryParams, additionalHeaders) /* spotless:on */ } override fun toString() = diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/RoleUpdateParams.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/RoleUpdateParams.kt index 80f56383..edf284f2 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/RoleUpdateParams.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/RoleUpdateParams.kt @@ -85,8 +85,6 @@ constructor( private val additionalProperties: Map, ) { - private var hashCode: Int = 0 - /** A list of permissions to add to the role */ @JsonProperty("add_member_permissions") fun addMemberPermissions(): List? = addMemberPermissions @@ -114,40 +112,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is RoleUpdateBody && - this.addMemberPermissions == other.addMemberPermissions && - this.addMemberRoles == other.addMemberRoles && - this.description == other.description && - this.name == other.name && - this.removeMemberPermissions == other.removeMemberPermissions && - this.removeMemberRoles == other.removeMemberRoles && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - addMemberPermissions, - addMemberRoles, - description, - name, - removeMemberPermissions, - removeMemberRoles, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "RoleUpdateBody{addMemberPermissions=$addMemberPermissions, addMemberRoles=$addMemberRoles, description=$description, name=$name, removeMemberPermissions=$removeMemberPermissions, removeMemberRoles=$removeMemberRoles, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -231,6 +195,26 @@ constructor( additionalProperties.toUnmodifiable(), ) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is RoleUpdateBody && this.addMemberPermissions == other.addMemberPermissions && this.addMemberRoles == other.addMemberRoles && this.description == other.description && this.name == other.name && this.removeMemberPermissions == other.removeMemberPermissions && this.removeMemberRoles == other.removeMemberRoles && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(addMemberPermissions, addMemberRoles, description, name, removeMemberPermissions, removeMemberRoles, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "RoleUpdateBody{addMemberPermissions=$addMemberPermissions, addMemberRoles=$addMemberRoles, description=$description, name=$name, removeMemberPermissions=$removeMemberPermissions, removeMemberRoles=$removeMemberRoles, additionalProperties=$additionalProperties}" } fun _additionalQueryParams(): Map> = additionalQueryParams @@ -244,32 +228,11 @@ constructor( return true } - return other is RoleUpdateParams && - this.roleId == other.roleId && - this.addMemberPermissions == other.addMemberPermissions && - this.addMemberRoles == other.addMemberRoles && - this.description == other.description && - this.name == other.name && - this.removeMemberPermissions == other.removeMemberPermissions && - this.removeMemberRoles == other.removeMemberRoles && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders && - this.additionalBodyProperties == other.additionalBodyProperties + return /* spotless:off */ other is RoleUpdateParams && this.roleId == other.roleId && this.addMemberPermissions == other.addMemberPermissions && this.addMemberRoles == other.addMemberRoles && this.description == other.description && this.name == other.name && this.removeMemberPermissions == other.removeMemberPermissions && this.removeMemberRoles == other.removeMemberRoles && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders && this.additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - roleId, - addMemberPermissions, - addMemberRoles, - description, - name, - removeMemberPermissions, - removeMemberRoles, - additionalQueryParams, - additionalHeaders, - additionalBodyProperties, - ) + return /* spotless:off */ Objects.hash(roleId, addMemberPermissions, addMemberRoles, description, name, removeMemberPermissions, removeMemberRoles, additionalQueryParams, additionalHeaders, additionalBodyProperties) /* spotless:on */ } override fun toString() = @@ -442,8 +405,6 @@ constructor( private val additionalProperties: Map, ) { - private var hashCode: Int = 0 - /** * Each permission permits a certain type of operation on an object in the system * @@ -461,32 +422,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is AddMemberPermission && - this.permission == other.permission && - this.restrictObjectType == other.restrictObjectType && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - permission, - restrictObjectType, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "AddMemberPermission{permission=$permission, restrictObjectType=$restrictObjectType, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -555,7 +490,7 @@ constructor( return true } - return other is Permission && this.value == other.value + return /* spotless:off */ other is Permission && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -648,7 +583,7 @@ constructor( return true } - return other is RestrictObjectType && this.value == other.value + return /* spotless:off */ other is RestrictObjectType && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -746,6 +681,26 @@ constructor( fun asString(): String = _value().asStringOrThrow() } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is AddMemberPermission && this.permission == other.permission && this.restrictObjectType == other.restrictObjectType && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(permission, restrictObjectType, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "AddMemberPermission{permission=$permission, restrictObjectType=$restrictObjectType, additionalProperties=$additionalProperties}" } @JsonDeserialize(builder = RemoveMemberPermission.Builder::class) @@ -757,8 +712,6 @@ constructor( private val additionalProperties: Map, ) { - private var hashCode: Int = 0 - /** * Each permission permits a certain type of operation on an object in the system * @@ -776,32 +729,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is RemoveMemberPermission && - this.permission == other.permission && - this.restrictObjectType == other.restrictObjectType && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - permission, - restrictObjectType, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "RemoveMemberPermission{permission=$permission, restrictObjectType=$restrictObjectType, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -870,7 +797,7 @@ constructor( return true } - return other is Permission && this.value == other.value + return /* spotless:off */ other is Permission && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -963,7 +890,7 @@ constructor( return true } - return other is RestrictObjectType && this.value == other.value + return /* spotless:off */ other is RestrictObjectType && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -1061,5 +988,25 @@ constructor( fun asString(): String = _value().asStringOrThrow() } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is RemoveMemberPermission && this.permission == other.permission && this.restrictObjectType == other.restrictObjectType && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(permission, restrictObjectType, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "RemoveMemberPermission{permission=$permission, restrictObjectType=$restrictObjectType, additionalProperties=$additionalProperties}" } } diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ScoreSummary.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ScoreSummary.kt index 3eed5fbd..b274297a 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ScoreSummary.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ScoreSummary.kt @@ -30,8 +30,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - /** Name of the score */ fun name(): String = name.getRequired("name") @@ -79,38 +77,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is ScoreSummary && - this.name == other.name && - this.score == other.score && - this.diff == other.diff && - this.improvements == other.improvements && - this.regressions == other.regressions && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - name, - score, - diff, - improvements, - regressions, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "ScoreSummary{name=$name, score=$score, diff=$diff, improvements=$improvements, regressions=$regressions, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -199,4 +165,24 @@ private constructor( additionalProperties.toUnmodifiable(), ) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is ScoreSummary && this.name == other.name && this.score == other.score && this.diff == other.diff && this.improvements == other.improvements && this.regressions == other.regressions && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(name, score, diff, improvements, regressions, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "ScoreSummary{name=$name, score=$score, diff=$diff, improvements=$improvements, regressions=$regressions, additionalProperties=$additionalProperties}" } diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/Scorer.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/Scorer.kt index 11d30316..8276a02d 100644 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/Scorer.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/Scorer.kt @@ -28,8 +28,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - fun type(): Type = type.getRequired("type") fun index(): Long = index.getRequired("index") @@ -52,32 +50,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Scorer && - this.type == other.type && - this.index == other.index && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - type, - index, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "Scorer{type=$type, index=$index, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -143,7 +115,7 @@ private constructor( return true } - return other is Type && this.value == other.value + return /* spotless:off */ other is Type && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -180,4 +152,24 @@ private constructor( fun asString(): String = _value().asStringOrThrow() } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Scorer && this.type == other.type && this.index == other.index && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(type, index, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "Scorer{type=$type, index=$index, additionalProperties=$additionalProperties}" } diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/SummarizeDatasetResponse.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/SummarizeDatasetResponse.kt index 4b2fdaf6..de9121fa 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/SummarizeDatasetResponse.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/SummarizeDatasetResponse.kt @@ -30,8 +30,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - /** Name of the project that the dataset belongs to */ fun projectName(): String = projectName.getRequired("project_name") @@ -80,38 +78,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is SummarizeDatasetResponse && - this.projectName == other.projectName && - this.datasetName == other.datasetName && - this.projectUrl == other.projectUrl && - this.datasetUrl == other.datasetUrl && - this.dataSummary == other.dataSummary && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - projectName, - datasetName, - projectUrl, - datasetUrl, - dataSummary, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "SummarizeDatasetResponse{projectName=$projectName, datasetName=$datasetName, projectUrl=$projectUrl, datasetUrl=$datasetUrl, dataSummary=$dataSummary, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -202,4 +168,24 @@ private constructor( additionalProperties.toUnmodifiable(), ) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is SummarizeDatasetResponse && this.projectName == other.projectName && this.datasetName == other.datasetName && this.projectUrl == other.projectUrl && this.datasetUrl == other.datasetUrl && this.dataSummary == other.dataSummary && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(projectName, datasetName, projectUrl, datasetUrl, dataSummary, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "SummarizeDatasetResponse{projectName=$projectName, datasetName=$datasetName, projectUrl=$projectUrl, datasetUrl=$datasetUrl, dataSummary=$dataSummary, additionalProperties=$additionalProperties}" } diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/SummarizeExperimentResponse.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/SummarizeExperimentResponse.kt index 8a391f6a..4048ae6c 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/SummarizeExperimentResponse.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/SummarizeExperimentResponse.kt @@ -32,8 +32,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - /** Name of the project that the experiment belongs to */ fun projectName(): String = projectName.getRequired("project_name") @@ -98,42 +96,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is SummarizeExperimentResponse && - this.projectName == other.projectName && - this.experimentName == other.experimentName && - this.projectUrl == other.projectUrl && - this.experimentUrl == other.experimentUrl && - this.comparisonExperimentName == other.comparisonExperimentName && - this.scores == other.scores && - this.metrics == other.metrics && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - projectName, - experimentName, - projectUrl, - experimentUrl, - comparisonExperimentName, - scores, - metrics, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "SummarizeExperimentResponse{projectName=$projectName, experimentName=$experimentName, projectUrl=$projectUrl, experimentUrl=$experimentUrl, comparisonExperimentName=$comparisonExperimentName, scores=$scores, metrics=$metrics, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -262,8 +224,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -276,23 +236,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Metrics && this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = Objects.hash(additionalProperties) - } - return hashCode - } - - override fun toString() = "Metrics{additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -323,6 +266,25 @@ private constructor( fun build(): Metrics = Metrics(additionalProperties.toUnmodifiable()) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Metrics && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = "Metrics{additionalProperties=$additionalProperties}" } /** Summary of the experiment's scores */ @@ -335,8 +297,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -349,23 +309,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Scores && this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = Objects.hash(additionalProperties) - } - return hashCode - } - - override fun toString() = "Scores{additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -396,5 +339,44 @@ private constructor( fun build(): Scores = Scores(additionalProperties.toUnmodifiable()) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Scores && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = "Scores{additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is SummarizeExperimentResponse && this.projectName == other.projectName && this.experimentName == other.experimentName && this.projectUrl == other.projectUrl && this.experimentUrl == other.experimentUrl && this.comparisonExperimentName == other.comparisonExperimentName && this.scores == other.scores && this.metrics == other.metrics && this.additionalProperties == other.additionalProperties /* spotless:on */ } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(projectName, experimentName, projectUrl, experimentUrl, comparisonExperimentName, scores, metrics, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "SummarizeExperimentResponse{projectName=$projectName, experimentName=$experimentName, projectUrl=$projectUrl, experimentUrl=$experimentUrl, comparisonExperimentName=$comparisonExperimentName, scores=$scores, metrics=$metrics, additionalProperties=$additionalProperties}" } diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/Task.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/Task.kt index 77b56f67..9a57685d 100644 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/Task.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/Task.kt @@ -27,8 +27,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - fun type(): Type = type.getRequired("type") @JsonProperty("type") @ExcludeMissing fun _type() = type @@ -46,25 +44,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Task && - this.type == other.type && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = Objects.hash(type, additionalProperties) - } - return hashCode - } - - override fun toString() = "Task{type=$type, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -117,7 +96,7 @@ private constructor( return true } - return other is Type && this.value == other.value + return /* spotless:off */ other is Type && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -154,4 +133,23 @@ private constructor( fun asString(): String = _value().asStringOrThrow() } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Task && this.type == other.type && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(type, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = "Task{type=$type, additionalProperties=$additionalProperties}" } diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ToolChoice.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ToolChoice.kt index 2c6e59f5..33a4c796 100644 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ToolChoice.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ToolChoice.kt @@ -83,18 +83,11 @@ private constructor( return true } - return other is ToolChoice && - this.auto == other.auto && - this.none == other.none && - this.function == other.function + return /* spotless:off */ other is ToolChoice && this.auto == other.auto && this.none == other.none && this.function == other.function /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - auto, - none, - function, - ) + return /* spotless:off */ Objects.hash(auto, none, function) /* spotless:on */ } override fun toString(): String { @@ -133,6 +126,7 @@ private constructor( override fun ObjectCodec.deserialize(node: JsonNode): ToolChoice { val json = JsonValue.fromJsonNode(node) + tryDeserialize(node, jacksonTypeRef())?.let { return ToolChoice(auto = it, _json = json) } @@ -178,7 +172,7 @@ private constructor( return true } - return other is Auto && this.value == other.value + return /* spotless:off */ other is Auto && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -229,7 +223,7 @@ private constructor( return true } - return other is None && this.value == other.value + return /* spotless:off */ other is None && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -278,8 +272,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - fun type(): Type = type.getRequired("type") fun function(): FunctionToolChoice = function.getRequired("function") @@ -302,32 +294,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Function && - this.type == other.type && - this.function == other.function && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - type, - function, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "Function{type=$type, function=$function, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -395,7 +361,7 @@ private constructor( return true } - return other is Type && this.value == other.value + return /* spotless:off */ other is Type && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -432,5 +398,25 @@ private constructor( fun asString(): String = _value().asStringOrThrow() } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is Function && this.type == other.type && this.function == other.function && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(type, function, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "Function{type=$type, function=$function, additionalProperties=$additionalProperties}" } } diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/TopLevelHelloWorldParams.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/TopLevelHelloWorldParams.kt index 9575b9fa..957a80ca 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/TopLevelHelloWorldParams.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/TopLevelHelloWorldParams.kt @@ -26,13 +26,11 @@ constructor( return true } - return other is TopLevelHelloWorldParams && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders + return /* spotless:off */ other is TopLevelHelloWorldParams && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash(additionalQueryParams, additionalHeaders) + return /* spotless:off */ Objects.hash(additionalQueryParams, additionalHeaders) /* spotless:on */ } override fun toString() = diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/User.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/User.kt index c254ff9d..039c11c8 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/User.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/User.kt @@ -31,8 +31,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - /** Unique identifier for the user */ fun id(): String = id.getRequired("id") @@ -87,40 +85,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is User && - this.id == other.id && - this.givenName == other.givenName && - this.familyName == other.familyName && - this.email == other.email && - this.avatarUrl == other.avatarUrl && - this.created == other.created && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - id, - givenName, - familyName, - email, - avatarUrl, - created, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "User{id=$id, givenName=$givenName, familyName=$familyName, email=$email, avatarUrl=$avatarUrl, created=$created, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -218,4 +182,24 @@ private constructor( additionalProperties.toUnmodifiable(), ) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is User && this.id == other.id && this.givenName == other.givenName && this.familyName == other.familyName && this.email == other.email && this.avatarUrl == other.avatarUrl && this.created == other.created && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(id, givenName, familyName, email, avatarUrl, created, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "User{id=$id, givenName=$givenName, familyName=$familyName, email=$email, avatarUrl=$avatarUrl, created=$created, additionalProperties=$additionalProperties}" } diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/UserListPage.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/UserListPage.kt index 75c893f9..388aad00 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/UserListPage.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/UserListPage.kt @@ -34,18 +34,11 @@ private constructor( return true } - return other is UserListPage && - this.usersService == other.usersService && - this.params == other.params && - this.response == other.response + return /* spotless:off */ other is UserListPage && this.usersService == other.usersService && this.params == other.params && this.response == other.response /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - usersService, - params, - response, - ) + return /* spotless:off */ Objects.hash(usersService, params, response) /* spotless:on */ } override fun toString() = @@ -121,13 +114,11 @@ private constructor( return true } - return other is Response && - this.objects == other.objects && - this.additionalProperties == other.additionalProperties + return /* spotless:off */ other is Response && this.objects == other.objects && this.additionalProperties == other.additionalProperties /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash(objects, additionalProperties) + return /* spotless:off */ Objects.hash(objects, additionalProperties) /* spotless:on */ } override fun toString() = diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/UserListPageAsync.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/UserListPageAsync.kt index 330014eb..e4f5560e 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/UserListPageAsync.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/UserListPageAsync.kt @@ -35,18 +35,11 @@ private constructor( return true } - return other is UserListPageAsync && - this.usersService == other.usersService && - this.params == other.params && - this.response == other.response + return /* spotless:off */ other is UserListPageAsync && this.usersService == other.usersService && this.params == other.params && this.response == other.response /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - usersService, - params, - response, - ) + return /* spotless:off */ Objects.hash(usersService, params, response) /* spotless:on */ } override fun toString() = @@ -124,13 +117,11 @@ private constructor( return true } - return other is Response && - this.objects == other.objects && - this.additionalProperties == other.additionalProperties + return /* spotless:off */ other is Response && this.objects == other.objects && this.additionalProperties == other.additionalProperties /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash(objects, additionalProperties) + return /* spotless:off */ Objects.hash(objects, additionalProperties) /* spotless:on */ } override fun toString() = diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/UserListParams.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/UserListParams.kt index 48836250..ee2d46b6 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/UserListParams.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/UserListParams.kt @@ -76,32 +76,11 @@ constructor( return true } - return other is UserListParams && - this.email == other.email && - this.endingBefore == other.endingBefore && - this.familyName == other.familyName && - this.givenName == other.givenName && - this.ids == other.ids && - this.limit == other.limit && - this.orgName == other.orgName && - this.startingAfter == other.startingAfter && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders + return /* spotless:off */ other is UserListParams && this.email == other.email && this.endingBefore == other.endingBefore && this.familyName == other.familyName && this.givenName == other.givenName && this.ids == other.ids && this.limit == other.limit && this.orgName == other.orgName && this.startingAfter == other.startingAfter && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - email, - endingBefore, - familyName, - givenName, - ids, - limit, - orgName, - startingAfter, - additionalQueryParams, - additionalHeaders, - ) + return /* spotless:off */ Objects.hash(email, endingBefore, familyName, givenName, ids, limit, orgName, startingAfter, additionalQueryParams, additionalHeaders) /* spotless:on */ } override fun toString() = @@ -158,7 +137,7 @@ constructor( * Email of the user to search for. You may pass the param multiple times to filter for more * than one email */ - fun email(strings: List) = apply { this.email = Email.ofStrings(strings) } + fun emailOfStrings(strings: List) = apply { this.email = Email.ofStrings(strings) } /** * Pagination cursor id. @@ -185,7 +164,7 @@ constructor( * Family name of the user to search for. You may pass the param multiple times to filter * for more than one family name */ - fun familyName(strings: List) = apply { + fun familyNameOfStrings(strings: List) = apply { this.familyName = FamilyName.ofStrings(strings) } @@ -205,7 +184,7 @@ constructor( * Given name of the user to search for. You may pass the param multiple times to filter for * more than one given name */ - fun givenName(strings: List) = apply { + fun givenNameOfStrings(strings: List) = apply { this.givenName = GivenName.ofStrings(strings) } @@ -225,7 +204,7 @@ constructor( * Filter search results to a particular set of object IDs. To specify a list of IDs, * include the query param multiple times */ - fun ids(strings: List) = apply { this.ids = Ids.ofStrings(strings) } + fun idsOfStrings(strings: List) = apply { this.ids = Ids.ofStrings(strings) } /** Limit the number of objects to return */ fun limit(limit: Long) = apply { this.limit = limit } @@ -344,11 +323,11 @@ constructor( return true } - return other is Email && this.string == other.string && this.strings == other.strings + return /* spotless:off */ other is Email && this.string == other.string && this.strings == other.strings /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash(string, strings) + return /* spotless:off */ Objects.hash(string, strings) /* spotless:on */ } override fun toString(): String { @@ -382,6 +361,7 @@ constructor( override fun ObjectCodec.deserialize(node: JsonNode): Email { val json = JsonValue.fromJsonNode(node) + tryDeserialize(node, jacksonTypeRef())?.let { return Email(string = it, _json = json) } @@ -457,13 +437,11 @@ constructor( return true } - return other is FamilyName && - this.string == other.string && - this.strings == other.strings + return /* spotless:off */ other is FamilyName && this.string == other.string && this.strings == other.strings /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash(string, strings) + return /* spotless:off */ Objects.hash(string, strings) /* spotless:on */ } override fun toString(): String { @@ -497,6 +475,7 @@ constructor( override fun ObjectCodec.deserialize(node: JsonNode): FamilyName { val json = JsonValue.fromJsonNode(node) + tryDeserialize(node, jacksonTypeRef())?.let { return FamilyName(string = it, _json = json) } @@ -572,13 +551,11 @@ constructor( return true } - return other is GivenName && - this.string == other.string && - this.strings == other.strings + return /* spotless:off */ other is GivenName && this.string == other.string && this.strings == other.strings /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash(string, strings) + return /* spotless:off */ Objects.hash(string, strings) /* spotless:on */ } override fun toString(): String { @@ -612,6 +589,7 @@ constructor( override fun ObjectCodec.deserialize(node: JsonNode): GivenName { val json = JsonValue.fromJsonNode(node) + tryDeserialize(node, jacksonTypeRef())?.let { return GivenName(string = it, _json = json) } @@ -687,11 +665,11 @@ constructor( return true } - return other is Ids && this.string == other.string && this.strings == other.strings + return /* spotless:off */ other is Ids && this.string == other.string && this.strings == other.strings /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash(string, strings) + return /* spotless:off */ Objects.hash(string, strings) /* spotless:on */ } override fun toString(): String { @@ -725,6 +703,7 @@ constructor( override fun ObjectCodec.deserialize(node: JsonNode): Ids { val json = JsonValue.fromJsonNode(node) + tryDeserialize(node, jacksonTypeRef())?.let { return Ids(string = it, _json = json) } diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/UserRetrieveParams.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/UserRetrieveParams.kt index 5dfac4ef..32c8279c 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/UserRetrieveParams.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/UserRetrieveParams.kt @@ -36,18 +36,11 @@ constructor( return true } - return other is UserRetrieveParams && - this.userId == other.userId && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders + return /* spotless:off */ other is UserRetrieveParams && this.userId == other.userId && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - userId, - additionalQueryParams, - additionalHeaders, - ) + return /* spotless:off */ Objects.hash(userId, additionalQueryParams, additionalHeaders) /* spotless:on */ } override fun toString() = diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/View.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/View.kt index 84463eb2..79698b99 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/View.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/View.kt @@ -38,8 +38,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - /** Unique identifier for the view */ fun id(): String = id.getRequired("id") @@ -123,48 +121,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is View && - this.id == other.id && - this.objectType == other.objectType && - this.objectId == other.objectId && - this.viewType == other.viewType && - this.name == other.name && - this.created == other.created && - this.viewData == other.viewData && - this.options == other.options && - this.userId == other.userId && - this.deletedAt == other.deletedAt && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - id, - objectType, - objectId, - viewType, - name, - created, - viewData, - options, - userId, - deletedAt, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "View{id=$id, objectType=$objectType, objectId=$objectId, viewType=$viewType, name=$name, created=$created, viewData=$viewData, options=$options, userId=$userId, deletedAt=$deletedAt, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -320,7 +276,7 @@ private constructor( return true } - return other is ObjectType && this.value == other.value + return /* spotless:off */ other is ObjectType && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -431,7 +387,7 @@ private constructor( return true } - return other is ViewType && this.value == other.value + return /* spotless:off */ other is ViewType && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -510,4 +466,24 @@ private constructor( fun asString(): String = _value().asStringOrThrow() } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is View && this.id == other.id && this.objectType == other.objectType && this.objectId == other.objectId && this.viewType == other.viewType && this.name == other.name && this.created == other.created && this.viewData == other.viewData && this.options == other.options && this.userId == other.userId && this.deletedAt == other.deletedAt && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(id, objectType, objectId, viewType, name, created, viewData, options, userId, deletedAt, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "View{id=$id, objectType=$objectType, objectId=$objectId, viewType=$viewType, name=$name, created=$created, viewData=$viewData, options=$options, userId=$userId, deletedAt=$deletedAt, additionalProperties=$additionalProperties}" } diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ViewCreateParams.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ViewCreateParams.kt index 25b8ec2f..1671609d 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ViewCreateParams.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ViewCreateParams.kt @@ -84,8 +84,6 @@ constructor( private val additionalProperties: Map, ) { - private var hashCode: Int = 0 - /** Name of the view */ @JsonProperty("name") fun name(): String? = name @@ -116,44 +114,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is ViewCreateBody && - this.name == other.name && - this.objectId == other.objectId && - this.objectType == other.objectType && - this.viewType == other.viewType && - this.deletedAt == other.deletedAt && - this.options == other.options && - this.userId == other.userId && - this.viewData == other.viewData && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - name, - objectId, - objectType, - viewType, - deletedAt, - options, - userId, - viewData, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "ViewCreateBody{name=$name, objectId=$objectId, objectType=$objectType, viewType=$viewType, deletedAt=$deletedAt, options=$options, userId=$userId, viewData=$viewData, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -241,6 +201,26 @@ constructor( additionalProperties.toUnmodifiable(), ) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is ViewCreateBody && this.name == other.name && this.objectId == other.objectId && this.objectType == other.objectType && this.viewType == other.viewType && this.deletedAt == other.deletedAt && this.options == other.options && this.userId == other.userId && this.viewData == other.viewData && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(name, objectId, objectType, viewType, deletedAt, options, userId, viewData, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "ViewCreateBody{name=$name, objectId=$objectId, objectType=$objectType, viewType=$viewType, deletedAt=$deletedAt, options=$options, userId=$userId, viewData=$viewData, additionalProperties=$additionalProperties}" } fun _additionalQueryParams(): Map> = additionalQueryParams @@ -254,34 +234,11 @@ constructor( return true } - return other is ViewCreateParams && - this.name == other.name && - this.objectId == other.objectId && - this.objectType == other.objectType && - this.viewType == other.viewType && - this.deletedAt == other.deletedAt && - this.options == other.options && - this.userId == other.userId && - this.viewData == other.viewData && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders && - this.additionalBodyProperties == other.additionalBodyProperties + return /* spotless:off */ other is ViewCreateParams && this.name == other.name && this.objectId == other.objectId && this.objectType == other.objectType && this.viewType == other.viewType && this.deletedAt == other.deletedAt && this.options == other.options && this.userId == other.userId && this.viewData == other.viewData && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders && this.additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - name, - objectId, - objectType, - viewType, - deletedAt, - options, - userId, - viewData, - additionalQueryParams, - additionalHeaders, - additionalBodyProperties, - ) + return /* spotless:off */ Objects.hash(name, objectId, objectType, viewType, deletedAt, options, userId, viewData, additionalQueryParams, additionalHeaders, additionalBodyProperties) /* spotless:on */ } override fun toString() = @@ -431,7 +388,7 @@ constructor( return true } - return other is ObjectType && this.value == other.value + return /* spotless:off */ other is ObjectType && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -542,7 +499,7 @@ constructor( return true } - return other is ViewType && this.value == other.value + return /* spotless:off */ other is ViewType && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ViewData.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ViewData.kt index 1a019644..06bb2708 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ViewData.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ViewData.kt @@ -26,8 +26,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - fun search(): Optional = Optional.ofNullable(search.getNullable("search")) @JsonProperty("search") @ExcludeMissing fun _search() = search @@ -45,25 +43,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is ViewData && - this.search == other.search && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = Objects.hash(search, additionalProperties) - } - return hashCode - } - - override fun toString() = "ViewData{search=$search, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -102,4 +81,23 @@ private constructor( fun build(): ViewData = ViewData(search, additionalProperties.toUnmodifiable()) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is ViewData && this.search == other.search && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(search, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = "ViewData{search=$search, additionalProperties=$additionalProperties}" } diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ViewDataSearch.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ViewDataSearch.kt index b64ebbc7..9381f892 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ViewDataSearch.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ViewDataSearch.kt @@ -28,8 +28,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - fun filter(): Optional> = Optional.ofNullable(filter.getNullable("filter")) fun tag(): Optional> = Optional.ofNullable(tag.getNullable("tag")) @@ -62,36 +60,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is ViewDataSearch && - this.filter == other.filter && - this.tag == other.tag && - this.match == other.match && - this.sort == other.sort && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - filter, - tag, - match, - sort, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "ViewDataSearch{filter=$filter, tag=$tag, match=$match, sort=$sort, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -161,4 +129,24 @@ private constructor( additionalProperties.toUnmodifiable(), ) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is ViewDataSearch && this.filter == other.filter && this.tag == other.tag && this.match == other.match && this.sort == other.sort && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(filter, tag, match, sort, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "ViewDataSearch{filter=$filter, tag=$tag, match=$match, sort=$sort, additionalProperties=$additionalProperties}" } diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ViewDeleteParams.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ViewDeleteParams.kt index 60e9fa73..ec6007a6 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ViewDeleteParams.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ViewDeleteParams.kt @@ -62,8 +62,6 @@ constructor( private val additionalProperties: Map, ) { - private var hashCode: Int = 0 - /** The id of the object the view applies to */ @JsonProperty("object_id") fun objectId(): String? = objectId @@ -76,32 +74,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is ViewDeleteBody && - this.objectId == other.objectId && - this.objectType == other.objectType && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - objectId, - objectType, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "ViewDeleteBody{objectId=$objectId, objectType=$objectType, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -149,6 +121,26 @@ constructor( additionalProperties.toUnmodifiable(), ) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is ViewDeleteBody && this.objectId == other.objectId && this.objectType == other.objectType && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(objectId, objectType, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "ViewDeleteBody{objectId=$objectId, objectType=$objectType, additionalProperties=$additionalProperties}" } fun _additionalQueryParams(): Map> = additionalQueryParams @@ -162,24 +154,11 @@ constructor( return true } - return other is ViewDeleteParams && - this.viewId == other.viewId && - this.objectId == other.objectId && - this.objectType == other.objectType && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders && - this.additionalBodyProperties == other.additionalBodyProperties + return /* spotless:off */ other is ViewDeleteParams && this.viewId == other.viewId && this.objectId == other.objectId && this.objectType == other.objectType && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders && this.additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - viewId, - objectId, - objectType, - additionalQueryParams, - additionalHeaders, - additionalBodyProperties, - ) + return /* spotless:off */ Objects.hash(viewId, objectId, objectType, additionalQueryParams, additionalHeaders, additionalBodyProperties) /* spotless:on */ } override fun toString() = @@ -299,7 +278,7 @@ constructor( return true } - return other is ObjectType && this.value == other.value + return /* spotless:off */ other is ObjectType && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ViewListPage.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ViewListPage.kt index 4fc74c4a..c6968b6b 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ViewListPage.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ViewListPage.kt @@ -34,18 +34,11 @@ private constructor( return true } - return other is ViewListPage && - this.viewsService == other.viewsService && - this.params == other.params && - this.response == other.response + return /* spotless:off */ other is ViewListPage && this.viewsService == other.viewsService && this.params == other.params && this.response == other.response /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - viewsService, - params, - response, - ) + return /* spotless:off */ Objects.hash(viewsService, params, response) /* spotless:on */ } override fun toString() = @@ -121,13 +114,11 @@ private constructor( return true } - return other is Response && - this.objects == other.objects && - this.additionalProperties == other.additionalProperties + return /* spotless:off */ other is Response && this.objects == other.objects && this.additionalProperties == other.additionalProperties /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash(objects, additionalProperties) + return /* spotless:off */ Objects.hash(objects, additionalProperties) /* spotless:on */ } override fun toString() = diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ViewListPageAsync.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ViewListPageAsync.kt index f781d4f4..305931bf 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ViewListPageAsync.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ViewListPageAsync.kt @@ -35,18 +35,11 @@ private constructor( return true } - return other is ViewListPageAsync && - this.viewsService == other.viewsService && - this.params == other.params && - this.response == other.response + return /* spotless:off */ other is ViewListPageAsync && this.viewsService == other.viewsService && this.params == other.params && this.response == other.response /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - viewsService, - params, - response, - ) + return /* spotless:off */ Objects.hash(viewsService, params, response) /* spotless:on */ } override fun toString() = @@ -124,13 +117,11 @@ private constructor( return true } - return other is Response && - this.objects == other.objects && - this.additionalProperties == other.additionalProperties + return /* spotless:off */ other is Response && this.objects == other.objects && this.additionalProperties == other.additionalProperties /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash(objects, additionalProperties) + return /* spotless:off */ Objects.hash(objects, additionalProperties) /* spotless:on */ } override fun toString() = diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ViewListParams.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ViewListParams.kt index 4096d8c8..012100a8 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ViewListParams.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ViewListParams.kt @@ -79,32 +79,11 @@ constructor( return true } - return other is ViewListParams && - this.objectId == other.objectId && - this.objectType == other.objectType && - this.endingBefore == other.endingBefore && - this.ids == other.ids && - this.limit == other.limit && - this.startingAfter == other.startingAfter && - this.viewName == other.viewName && - this.viewType == other.viewType && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders + return /* spotless:off */ other is ViewListParams && this.objectId == other.objectId && this.objectType == other.objectType && this.endingBefore == other.endingBefore && this.ids == other.ids && this.limit == other.limit && this.startingAfter == other.startingAfter && this.viewName == other.viewName && this.viewType == other.viewType && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - objectId, - objectType, - endingBefore, - ids, - limit, - startingAfter, - viewName, - viewType, - additionalQueryParams, - additionalHeaders, - ) + return /* spotless:off */ Objects.hash(objectId, objectType, endingBefore, ids, limit, startingAfter, viewName, viewType, additionalQueryParams, additionalHeaders) /* spotless:on */ } override fun toString() = @@ -176,7 +155,7 @@ constructor( * Filter search results to a particular set of object IDs. To specify a list of IDs, * include the query param multiple times */ - fun ids(strings: List) = apply { this.ids = Ids.ofStrings(strings) } + fun idsOfStrings(strings: List) = apply { this.ids = Ids.ofStrings(strings) } /** Limit the number of objects to return */ fun limit(limit: Long) = apply { this.limit = limit } @@ -264,7 +243,7 @@ constructor( return true } - return other is ObjectType && this.value == other.value + return /* spotless:off */ other is ObjectType && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -409,11 +388,11 @@ constructor( return true } - return other is Ids && this.string == other.string && this.strings == other.strings + return /* spotless:off */ other is Ids && this.string == other.string && this.strings == other.strings /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash(string, strings) + return /* spotless:off */ Objects.hash(string, strings) /* spotless:on */ } override fun toString(): String { @@ -447,6 +426,7 @@ constructor( override fun ObjectCodec.deserialize(node: JsonNode): Ids { val json = JsonValue.fromJsonNode(node) + tryDeserialize(node, jacksonTypeRef())?.let { return Ids(string = it, _json = json) } @@ -488,7 +468,7 @@ constructor( return true } - return other is ViewType && this.value == other.value + return /* spotless:off */ other is ViewType && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ViewOptions.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ViewOptions.kt index f47bc870..816d8937 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ViewOptions.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ViewOptions.kt @@ -28,8 +28,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - fun columnVisibility(): Optional = Optional.ofNullable(columnVisibility.getNullable("columnVisibility")) @@ -60,34 +58,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is ViewOptions && - this.columnVisibility == other.columnVisibility && - this.columnOrder == other.columnOrder && - this.columnSizing == other.columnSizing && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - columnVisibility, - columnOrder, - columnSizing, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "ViewOptions{columnVisibility=$columnVisibility, columnOrder=$columnOrder, columnSizing=$columnSizing, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -165,8 +135,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -179,23 +147,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is ColumnSizing && this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = Objects.hash(additionalProperties) - } - return hashCode - } - - override fun toString() = "ColumnSizing{additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -226,6 +177,25 @@ private constructor( fun build(): ColumnSizing = ColumnSizing(additionalProperties.toUnmodifiable()) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is ColumnSizing && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = "ColumnSizing{additionalProperties=$additionalProperties}" } @JsonDeserialize(builder = ColumnVisibility.Builder::class) @@ -237,8 +207,6 @@ private constructor( private var validated: Boolean = false - private var hashCode: Int = 0 - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -251,24 +219,6 @@ private constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is ColumnVisibility && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = Objects.hash(additionalProperties) - } - return hashCode - } - - override fun toString() = "ColumnVisibility{additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -299,5 +249,44 @@ private constructor( fun build(): ColumnVisibility = ColumnVisibility(additionalProperties.toUnmodifiable()) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is ColumnVisibility && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = "ColumnVisibility{additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is ViewOptions && this.columnVisibility == other.columnVisibility && this.columnOrder == other.columnOrder && this.columnSizing == other.columnSizing && this.additionalProperties == other.additionalProperties /* spotless:on */ } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(columnVisibility, columnOrder, columnSizing, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "ViewOptions{columnVisibility=$columnVisibility, columnOrder=$columnOrder, columnSizing=$columnSizing, additionalProperties=$additionalProperties}" } diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ViewReplaceParams.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ViewReplaceParams.kt index e49681ca..c16c3983 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ViewReplaceParams.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ViewReplaceParams.kt @@ -84,8 +84,6 @@ constructor( private val additionalProperties: Map, ) { - private var hashCode: Int = 0 - /** Name of the view */ @JsonProperty("name") fun name(): String? = name @@ -116,44 +114,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is ViewReplaceBody && - this.name == other.name && - this.objectId == other.objectId && - this.objectType == other.objectType && - this.viewType == other.viewType && - this.deletedAt == other.deletedAt && - this.options == other.options && - this.userId == other.userId && - this.viewData == other.viewData && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - name, - objectId, - objectType, - viewType, - deletedAt, - options, - userId, - viewData, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "ViewReplaceBody{name=$name, objectId=$objectId, objectType=$objectType, viewType=$viewType, deletedAt=$deletedAt, options=$options, userId=$userId, viewData=$viewData, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -241,6 +201,26 @@ constructor( additionalProperties.toUnmodifiable(), ) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is ViewReplaceBody && this.name == other.name && this.objectId == other.objectId && this.objectType == other.objectType && this.viewType == other.viewType && this.deletedAt == other.deletedAt && this.options == other.options && this.userId == other.userId && this.viewData == other.viewData && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(name, objectId, objectType, viewType, deletedAt, options, userId, viewData, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "ViewReplaceBody{name=$name, objectId=$objectId, objectType=$objectType, viewType=$viewType, deletedAt=$deletedAt, options=$options, userId=$userId, viewData=$viewData, additionalProperties=$additionalProperties}" } fun _additionalQueryParams(): Map> = additionalQueryParams @@ -254,34 +234,11 @@ constructor( return true } - return other is ViewReplaceParams && - this.name == other.name && - this.objectId == other.objectId && - this.objectType == other.objectType && - this.viewType == other.viewType && - this.deletedAt == other.deletedAt && - this.options == other.options && - this.userId == other.userId && - this.viewData == other.viewData && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders && - this.additionalBodyProperties == other.additionalBodyProperties + return /* spotless:off */ other is ViewReplaceParams && this.name == other.name && this.objectId == other.objectId && this.objectType == other.objectType && this.viewType == other.viewType && this.deletedAt == other.deletedAt && this.options == other.options && this.userId == other.userId && this.viewData == other.viewData && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders && this.additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - name, - objectId, - objectType, - viewType, - deletedAt, - options, - userId, - viewData, - additionalQueryParams, - additionalHeaders, - additionalBodyProperties, - ) + return /* spotless:off */ Objects.hash(name, objectId, objectType, viewType, deletedAt, options, userId, viewData, additionalQueryParams, additionalHeaders, additionalBodyProperties) /* spotless:on */ } override fun toString() = @@ -431,7 +388,7 @@ constructor( return true } - return other is ObjectType && this.value == other.value + return /* spotless:off */ other is ObjectType && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -542,7 +499,7 @@ constructor( return true } - return other is ViewType && this.value == other.value + return /* spotless:off */ other is ViewType && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ViewRetrieveParams.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ViewRetrieveParams.kt index b56ed968..d5c72ce1 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ViewRetrieveParams.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ViewRetrieveParams.kt @@ -54,22 +54,11 @@ constructor( return true } - return other is ViewRetrieveParams && - this.viewId == other.viewId && - this.objectId == other.objectId && - this.objectType == other.objectType && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders + return /* spotless:off */ other is ViewRetrieveParams && this.viewId == other.viewId && this.objectId == other.objectId && this.objectType == other.objectType && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - viewId, - objectId, - objectType, - additionalQueryParams, - additionalHeaders, - ) + return /* spotless:off */ Objects.hash(viewId, objectId, objectType, additionalQueryParams, additionalHeaders) /* spotless:on */ } override fun toString() = @@ -172,7 +161,7 @@ constructor( return true } - return other is ObjectType && this.value == other.value + return /* spotless:off */ other is ObjectType && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ViewUpdateParams.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ViewUpdateParams.kt index 3bb1d99d..519c1fa3 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ViewUpdateParams.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/models/ViewUpdateParams.kt @@ -88,8 +88,6 @@ constructor( private val additionalProperties: Map, ) { - private var hashCode: Int = 0 - /** The id of the object the view applies to */ @JsonProperty("object_id") fun objectId(): String? = objectId @@ -117,42 +115,6 @@ constructor( fun toBuilder() = Builder().from(this) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is ViewUpdateBody && - this.objectId == other.objectId && - this.objectType == other.objectType && - this.name == other.name && - this.options == other.options && - this.userId == other.userId && - this.viewData == other.viewData && - this.viewType == other.viewType && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = - Objects.hash( - objectId, - objectType, - name, - options, - userId, - viewData, - viewType, - additionalProperties, - ) - } - return hashCode - } - - override fun toString() = - "ViewUpdateBody{objectId=$objectId, objectType=$objectType, name=$name, options=$options, userId=$userId, viewData=$viewData, viewType=$viewType, additionalProperties=$additionalProperties}" - companion object { @JvmStatic fun builder() = Builder() @@ -233,6 +195,26 @@ constructor( additionalProperties.toUnmodifiable(), ) } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return /* spotless:off */ other is ViewUpdateBody && this.objectId == other.objectId && this.objectType == other.objectType && this.name == other.name && this.options == other.options && this.userId == other.userId && this.viewData == other.viewData && this.viewType == other.viewType && this.additionalProperties == other.additionalProperties /* spotless:on */ + } + + private var hashCode: Int = 0 + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = /* spotless:off */ Objects.hash(objectId, objectType, name, options, userId, viewData, viewType, additionalProperties) /* spotless:on */ + } + return hashCode + } + + override fun toString() = + "ViewUpdateBody{objectId=$objectId, objectType=$objectType, name=$name, options=$options, userId=$userId, viewData=$viewData, viewType=$viewType, additionalProperties=$additionalProperties}" } fun _additionalQueryParams(): Map> = additionalQueryParams @@ -246,34 +228,11 @@ constructor( return true } - return other is ViewUpdateParams && - this.viewId == other.viewId && - this.objectId == other.objectId && - this.objectType == other.objectType && - this.name == other.name && - this.options == other.options && - this.userId == other.userId && - this.viewData == other.viewData && - this.viewType == other.viewType && - this.additionalQueryParams == other.additionalQueryParams && - this.additionalHeaders == other.additionalHeaders && - this.additionalBodyProperties == other.additionalBodyProperties + return /* spotless:off */ other is ViewUpdateParams && this.viewId == other.viewId && this.objectId == other.objectId && this.objectType == other.objectType && this.name == other.name && this.options == other.options && this.userId == other.userId && this.viewData == other.viewData && this.viewType == other.viewType && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders && this.additionalBodyProperties == other.additionalBodyProperties /* spotless:on */ } override fun hashCode(): Int { - return Objects.hash( - viewId, - objectId, - objectType, - name, - options, - userId, - viewData, - viewType, - additionalQueryParams, - additionalHeaders, - additionalBodyProperties, - ) + return /* spotless:off */ Objects.hash(viewId, objectId, objectType, name, options, userId, viewData, viewType, additionalQueryParams, additionalHeaders, additionalBodyProperties) /* spotless:on */ } override fun toString() = @@ -423,7 +382,7 @@ constructor( return true } - return other is ObjectType && this.value == other.value + return /* spotless:off */ other is ObjectType && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() @@ -534,7 +493,7 @@ constructor( return true } - return other is ViewType && this.value == other.value + return /* spotless:off */ other is ViewType && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/async/AclServiceAsyncImpl.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/async/AclServiceAsyncImpl.kt index 41c071d5..6edea0c2 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/async/AclServiceAsyncImpl.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/async/AclServiceAsyncImpl.kt @@ -4,9 +4,13 @@ package com.braintrustdata.api.services.async import com.braintrustdata.api.core.ClientOptions import com.braintrustdata.api.core.RequestOptions +import com.braintrustdata.api.core.handlers.errorHandler +import com.braintrustdata.api.core.handlers.jsonHandler +import com.braintrustdata.api.core.handlers.withErrorHandler import com.braintrustdata.api.core.http.HttpMethod import com.braintrustdata.api.core.http.HttpRequest import com.braintrustdata.api.core.http.HttpResponse.Handler +import com.braintrustdata.api.core.json import com.braintrustdata.api.errors.BraintrustError import com.braintrustdata.api.models.Acl import com.braintrustdata.api.models.AclBatchUpdateParams @@ -17,10 +21,6 @@ import com.braintrustdata.api.models.AclFindAndDeleteParams import com.braintrustdata.api.models.AclListPageAsync import com.braintrustdata.api.models.AclListParams import com.braintrustdata.api.models.AclRetrieveParams -import com.braintrustdata.api.services.errorHandler -import com.braintrustdata.api.services.json -import com.braintrustdata.api.services.jsonHandler -import com.braintrustdata.api.services.withErrorHandler import java.util.concurrent.CompletableFuture class AclServiceAsyncImpl diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/async/AiSecretServiceAsyncImpl.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/async/AiSecretServiceAsyncImpl.kt index 330c772b..e4cfe750 100644 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/async/AiSecretServiceAsyncImpl.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/async/AiSecretServiceAsyncImpl.kt @@ -4,9 +4,13 @@ package com.braintrustdata.api.services.async import com.braintrustdata.api.core.ClientOptions import com.braintrustdata.api.core.RequestOptions +import com.braintrustdata.api.core.handlers.errorHandler +import com.braintrustdata.api.core.handlers.jsonHandler +import com.braintrustdata.api.core.handlers.withErrorHandler import com.braintrustdata.api.core.http.HttpMethod import com.braintrustdata.api.core.http.HttpRequest import com.braintrustdata.api.core.http.HttpResponse.Handler +import com.braintrustdata.api.core.json import com.braintrustdata.api.errors.BraintrustError import com.braintrustdata.api.models.AISecret import com.braintrustdata.api.models.AiSecretCreateParams @@ -17,10 +21,6 @@ import com.braintrustdata.api.models.AiSecretListParams import com.braintrustdata.api.models.AiSecretReplaceParams import com.braintrustdata.api.models.AiSecretRetrieveParams import com.braintrustdata.api.models.AiSecretUpdateParams -import com.braintrustdata.api.services.errorHandler -import com.braintrustdata.api.services.json -import com.braintrustdata.api.services.jsonHandler -import com.braintrustdata.api.services.withErrorHandler import java.util.concurrent.CompletableFuture class AiSecretServiceAsyncImpl diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/async/ApiKeyServiceAsyncImpl.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/async/ApiKeyServiceAsyncImpl.kt index 5228efa4..75a6af2d 100644 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/async/ApiKeyServiceAsyncImpl.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/async/ApiKeyServiceAsyncImpl.kt @@ -4,9 +4,13 @@ package com.braintrustdata.api.services.async import com.braintrustdata.api.core.ClientOptions import com.braintrustdata.api.core.RequestOptions +import com.braintrustdata.api.core.handlers.errorHandler +import com.braintrustdata.api.core.handlers.jsonHandler +import com.braintrustdata.api.core.handlers.withErrorHandler import com.braintrustdata.api.core.http.HttpMethod import com.braintrustdata.api.core.http.HttpRequest import com.braintrustdata.api.core.http.HttpResponse.Handler +import com.braintrustdata.api.core.json import com.braintrustdata.api.errors.BraintrustError import com.braintrustdata.api.models.ApiKey import com.braintrustdata.api.models.ApiKeyCreateParams @@ -15,10 +19,6 @@ import com.braintrustdata.api.models.ApiKeyListPageAsync import com.braintrustdata.api.models.ApiKeyListParams import com.braintrustdata.api.models.ApiKeyRetrieveParams import com.braintrustdata.api.models.CreateApiKeyOutput -import com.braintrustdata.api.services.errorHandler -import com.braintrustdata.api.services.json -import com.braintrustdata.api.services.jsonHandler -import com.braintrustdata.api.services.withErrorHandler import java.util.concurrent.CompletableFuture class ApiKeyServiceAsyncImpl diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/async/DatasetServiceAsyncImpl.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/async/DatasetServiceAsyncImpl.kt index 7430668e..0dd2647b 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/async/DatasetServiceAsyncImpl.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/async/DatasetServiceAsyncImpl.kt @@ -4,9 +4,13 @@ package com.braintrustdata.api.services.async import com.braintrustdata.api.core.ClientOptions import com.braintrustdata.api.core.RequestOptions +import com.braintrustdata.api.core.handlers.errorHandler +import com.braintrustdata.api.core.handlers.jsonHandler +import com.braintrustdata.api.core.handlers.withErrorHandler import com.braintrustdata.api.core.http.HttpMethod import com.braintrustdata.api.core.http.HttpRequest import com.braintrustdata.api.core.http.HttpResponse.Handler +import com.braintrustdata.api.core.json import com.braintrustdata.api.errors.BraintrustError import com.braintrustdata.api.models.Dataset import com.braintrustdata.api.models.DatasetCreateParams @@ -24,10 +28,6 @@ import com.braintrustdata.api.models.FeedbackResponseSchema import com.braintrustdata.api.models.FetchDatasetEventsResponse import com.braintrustdata.api.models.InsertEventsResponse import com.braintrustdata.api.models.SummarizeDatasetResponse -import com.braintrustdata.api.services.errorHandler -import com.braintrustdata.api.services.json -import com.braintrustdata.api.services.jsonHandler -import com.braintrustdata.api.services.withErrorHandler import java.util.concurrent.CompletableFuture class DatasetServiceAsyncImpl diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/async/EnvVarServiceAsyncImpl.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/async/EnvVarServiceAsyncImpl.kt index a2f9d114..40334775 100644 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/async/EnvVarServiceAsyncImpl.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/async/EnvVarServiceAsyncImpl.kt @@ -4,9 +4,13 @@ package com.braintrustdata.api.services.async import com.braintrustdata.api.core.ClientOptions import com.braintrustdata.api.core.RequestOptions +import com.braintrustdata.api.core.handlers.errorHandler +import com.braintrustdata.api.core.handlers.jsonHandler +import com.braintrustdata.api.core.handlers.withErrorHandler import com.braintrustdata.api.core.http.HttpMethod import com.braintrustdata.api.core.http.HttpRequest import com.braintrustdata.api.core.http.HttpResponse.Handler +import com.braintrustdata.api.core.json import com.braintrustdata.api.errors.BraintrustError import com.braintrustdata.api.models.EnvVar import com.braintrustdata.api.models.EnvVarCreateParams @@ -16,10 +20,6 @@ import com.braintrustdata.api.models.EnvVarListResponse import com.braintrustdata.api.models.EnvVarReplaceParams import com.braintrustdata.api.models.EnvVarRetrieveParams import com.braintrustdata.api.models.EnvVarUpdateParams -import com.braintrustdata.api.services.errorHandler -import com.braintrustdata.api.services.json -import com.braintrustdata.api.services.jsonHandler -import com.braintrustdata.api.services.withErrorHandler import java.util.concurrent.CompletableFuture class EnvVarServiceAsyncImpl diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/async/EvalServiceAsyncImpl.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/async/EvalServiceAsyncImpl.kt index 275cafcb..aa2dddda 100644 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/async/EvalServiceAsyncImpl.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/async/EvalServiceAsyncImpl.kt @@ -4,16 +4,16 @@ package com.braintrustdata.api.services.async import com.braintrustdata.api.core.ClientOptions import com.braintrustdata.api.core.RequestOptions +import com.braintrustdata.api.core.handlers.errorHandler +import com.braintrustdata.api.core.handlers.jsonHandler +import com.braintrustdata.api.core.handlers.withErrorHandler import com.braintrustdata.api.core.http.HttpMethod import com.braintrustdata.api.core.http.HttpRequest import com.braintrustdata.api.core.http.HttpResponse.Handler +import com.braintrustdata.api.core.json import com.braintrustdata.api.errors.BraintrustError import com.braintrustdata.api.models.EvalCreateParams import com.braintrustdata.api.models.SummarizeExperimentResponse -import com.braintrustdata.api.services.errorHandler -import com.braintrustdata.api.services.json -import com.braintrustdata.api.services.jsonHandler -import com.braintrustdata.api.services.withErrorHandler import java.util.concurrent.CompletableFuture class EvalServiceAsyncImpl diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/async/ExperimentServiceAsyncImpl.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/async/ExperimentServiceAsyncImpl.kt index 0517c864..3ae26dda 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/async/ExperimentServiceAsyncImpl.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/async/ExperimentServiceAsyncImpl.kt @@ -4,9 +4,13 @@ package com.braintrustdata.api.services.async import com.braintrustdata.api.core.ClientOptions import com.braintrustdata.api.core.RequestOptions +import com.braintrustdata.api.core.handlers.errorHandler +import com.braintrustdata.api.core.handlers.jsonHandler +import com.braintrustdata.api.core.handlers.withErrorHandler import com.braintrustdata.api.core.http.HttpMethod import com.braintrustdata.api.core.http.HttpRequest import com.braintrustdata.api.core.http.HttpResponse.Handler +import com.braintrustdata.api.core.json import com.braintrustdata.api.errors.BraintrustError import com.braintrustdata.api.models.Experiment import com.braintrustdata.api.models.ExperimentCreateParams @@ -24,10 +28,6 @@ import com.braintrustdata.api.models.FeedbackResponseSchema import com.braintrustdata.api.models.FetchExperimentEventsResponse import com.braintrustdata.api.models.InsertEventsResponse import com.braintrustdata.api.models.SummarizeExperimentResponse -import com.braintrustdata.api.services.errorHandler -import com.braintrustdata.api.services.json -import com.braintrustdata.api.services.jsonHandler -import com.braintrustdata.api.services.withErrorHandler import java.util.concurrent.CompletableFuture class ExperimentServiceAsyncImpl diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/async/FunctionServiceAsyncImpl.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/async/FunctionServiceAsyncImpl.kt index 006ad090..491cca41 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/async/FunctionServiceAsyncImpl.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/async/FunctionServiceAsyncImpl.kt @@ -4,9 +4,13 @@ package com.braintrustdata.api.services.async import com.braintrustdata.api.core.ClientOptions import com.braintrustdata.api.core.RequestOptions +import com.braintrustdata.api.core.handlers.errorHandler +import com.braintrustdata.api.core.handlers.jsonHandler +import com.braintrustdata.api.core.handlers.withErrorHandler import com.braintrustdata.api.core.http.HttpMethod import com.braintrustdata.api.core.http.HttpRequest import com.braintrustdata.api.core.http.HttpResponse.Handler +import com.braintrustdata.api.core.json import com.braintrustdata.api.errors.BraintrustError import com.braintrustdata.api.models.Function import com.braintrustdata.api.models.FunctionCreateParams @@ -18,10 +22,6 @@ import com.braintrustdata.api.models.FunctionListParams import com.braintrustdata.api.models.FunctionReplaceParams import com.braintrustdata.api.models.FunctionRetrieveParams import com.braintrustdata.api.models.FunctionUpdateParams -import com.braintrustdata.api.services.errorHandler -import com.braintrustdata.api.services.json -import com.braintrustdata.api.services.jsonHandler -import com.braintrustdata.api.services.withErrorHandler import java.util.concurrent.CompletableFuture class FunctionServiceAsyncImpl diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/async/GroupServiceAsyncImpl.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/async/GroupServiceAsyncImpl.kt index aebfd0ae..0cb84f89 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/async/GroupServiceAsyncImpl.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/async/GroupServiceAsyncImpl.kt @@ -4,9 +4,13 @@ package com.braintrustdata.api.services.async import com.braintrustdata.api.core.ClientOptions import com.braintrustdata.api.core.RequestOptions +import com.braintrustdata.api.core.handlers.errorHandler +import com.braintrustdata.api.core.handlers.jsonHandler +import com.braintrustdata.api.core.handlers.withErrorHandler import com.braintrustdata.api.core.http.HttpMethod import com.braintrustdata.api.core.http.HttpRequest import com.braintrustdata.api.core.http.HttpResponse.Handler +import com.braintrustdata.api.core.json import com.braintrustdata.api.errors.BraintrustError import com.braintrustdata.api.models.Group import com.braintrustdata.api.models.GroupCreateParams @@ -16,10 +20,6 @@ import com.braintrustdata.api.models.GroupListParams import com.braintrustdata.api.models.GroupReplaceParams import com.braintrustdata.api.models.GroupRetrieveParams import com.braintrustdata.api.models.GroupUpdateParams -import com.braintrustdata.api.services.errorHandler -import com.braintrustdata.api.services.json -import com.braintrustdata.api.services.jsonHandler -import com.braintrustdata.api.services.withErrorHandler import java.util.concurrent.CompletableFuture class GroupServiceAsyncImpl diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/async/OrganizationServiceAsyncImpl.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/async/OrganizationServiceAsyncImpl.kt index 2ff92c1d..1f66e1c3 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/async/OrganizationServiceAsyncImpl.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/async/OrganizationServiceAsyncImpl.kt @@ -4,9 +4,13 @@ package com.braintrustdata.api.services.async import com.braintrustdata.api.core.ClientOptions import com.braintrustdata.api.core.RequestOptions +import com.braintrustdata.api.core.handlers.errorHandler +import com.braintrustdata.api.core.handlers.jsonHandler +import com.braintrustdata.api.core.handlers.withErrorHandler import com.braintrustdata.api.core.http.HttpMethod import com.braintrustdata.api.core.http.HttpRequest import com.braintrustdata.api.core.http.HttpResponse.Handler +import com.braintrustdata.api.core.json import com.braintrustdata.api.errors.BraintrustError import com.braintrustdata.api.models.Organization import com.braintrustdata.api.models.OrganizationDeleteParams @@ -16,10 +20,6 @@ import com.braintrustdata.api.models.OrganizationRetrieveParams import com.braintrustdata.api.models.OrganizationUpdateParams import com.braintrustdata.api.services.async.organizations.MemberServiceAsync import com.braintrustdata.api.services.async.organizations.MemberServiceAsyncImpl -import com.braintrustdata.api.services.errorHandler -import com.braintrustdata.api.services.json -import com.braintrustdata.api.services.jsonHandler -import com.braintrustdata.api.services.withErrorHandler import java.util.concurrent.CompletableFuture class OrganizationServiceAsyncImpl diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/async/ProjectScoreServiceAsyncImpl.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/async/ProjectScoreServiceAsyncImpl.kt index 8953beb8..8f592589 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/async/ProjectScoreServiceAsyncImpl.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/async/ProjectScoreServiceAsyncImpl.kt @@ -4,9 +4,13 @@ package com.braintrustdata.api.services.async import com.braintrustdata.api.core.ClientOptions import com.braintrustdata.api.core.RequestOptions +import com.braintrustdata.api.core.handlers.errorHandler +import com.braintrustdata.api.core.handlers.jsonHandler +import com.braintrustdata.api.core.handlers.withErrorHandler import com.braintrustdata.api.core.http.HttpMethod import com.braintrustdata.api.core.http.HttpRequest import com.braintrustdata.api.core.http.HttpResponse.Handler +import com.braintrustdata.api.core.json import com.braintrustdata.api.errors.BraintrustError import com.braintrustdata.api.models.ProjectScore import com.braintrustdata.api.models.ProjectScoreCreateParams @@ -16,10 +20,6 @@ import com.braintrustdata.api.models.ProjectScoreListParams import com.braintrustdata.api.models.ProjectScoreReplaceParams import com.braintrustdata.api.models.ProjectScoreRetrieveParams import com.braintrustdata.api.models.ProjectScoreUpdateParams -import com.braintrustdata.api.services.errorHandler -import com.braintrustdata.api.services.json -import com.braintrustdata.api.services.jsonHandler -import com.braintrustdata.api.services.withErrorHandler import java.util.concurrent.CompletableFuture class ProjectScoreServiceAsyncImpl diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/async/ProjectServiceAsyncImpl.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/async/ProjectServiceAsyncImpl.kt index 02e1fd79..d064b194 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/async/ProjectServiceAsyncImpl.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/async/ProjectServiceAsyncImpl.kt @@ -4,9 +4,13 @@ package com.braintrustdata.api.services.async import com.braintrustdata.api.core.ClientOptions import com.braintrustdata.api.core.RequestOptions +import com.braintrustdata.api.core.handlers.errorHandler +import com.braintrustdata.api.core.handlers.jsonHandler +import com.braintrustdata.api.core.handlers.withErrorHandler import com.braintrustdata.api.core.http.HttpMethod import com.braintrustdata.api.core.http.HttpRequest import com.braintrustdata.api.core.http.HttpResponse.Handler +import com.braintrustdata.api.core.json import com.braintrustdata.api.errors.BraintrustError import com.braintrustdata.api.models.Project import com.braintrustdata.api.models.ProjectCreateParams @@ -17,10 +21,6 @@ import com.braintrustdata.api.models.ProjectRetrieveParams import com.braintrustdata.api.models.ProjectUpdateParams import com.braintrustdata.api.services.async.projects.LogServiceAsync import com.braintrustdata.api.services.async.projects.LogServiceAsyncImpl -import com.braintrustdata.api.services.errorHandler -import com.braintrustdata.api.services.json -import com.braintrustdata.api.services.jsonHandler -import com.braintrustdata.api.services.withErrorHandler import java.util.concurrent.CompletableFuture class ProjectServiceAsyncImpl diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/async/ProjectTagServiceAsyncImpl.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/async/ProjectTagServiceAsyncImpl.kt index 66372dea..7cc499c6 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/async/ProjectTagServiceAsyncImpl.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/async/ProjectTagServiceAsyncImpl.kt @@ -4,9 +4,13 @@ package com.braintrustdata.api.services.async import com.braintrustdata.api.core.ClientOptions import com.braintrustdata.api.core.RequestOptions +import com.braintrustdata.api.core.handlers.errorHandler +import com.braintrustdata.api.core.handlers.jsonHandler +import com.braintrustdata.api.core.handlers.withErrorHandler import com.braintrustdata.api.core.http.HttpMethod import com.braintrustdata.api.core.http.HttpRequest import com.braintrustdata.api.core.http.HttpResponse.Handler +import com.braintrustdata.api.core.json import com.braintrustdata.api.errors.BraintrustError import com.braintrustdata.api.models.ProjectTag import com.braintrustdata.api.models.ProjectTagCreateParams @@ -16,10 +20,6 @@ import com.braintrustdata.api.models.ProjectTagListParams import com.braintrustdata.api.models.ProjectTagReplaceParams import com.braintrustdata.api.models.ProjectTagRetrieveParams import com.braintrustdata.api.models.ProjectTagUpdateParams -import com.braintrustdata.api.services.errorHandler -import com.braintrustdata.api.services.json -import com.braintrustdata.api.services.jsonHandler -import com.braintrustdata.api.services.withErrorHandler import java.util.concurrent.CompletableFuture class ProjectTagServiceAsyncImpl diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/async/PromptServiceAsyncImpl.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/async/PromptServiceAsyncImpl.kt index f892b1fd..6e56557a 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/async/PromptServiceAsyncImpl.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/async/PromptServiceAsyncImpl.kt @@ -4,9 +4,13 @@ package com.braintrustdata.api.services.async import com.braintrustdata.api.core.ClientOptions import com.braintrustdata.api.core.RequestOptions +import com.braintrustdata.api.core.handlers.errorHandler +import com.braintrustdata.api.core.handlers.jsonHandler +import com.braintrustdata.api.core.handlers.withErrorHandler import com.braintrustdata.api.core.http.HttpMethod import com.braintrustdata.api.core.http.HttpRequest import com.braintrustdata.api.core.http.HttpResponse.Handler +import com.braintrustdata.api.core.json import com.braintrustdata.api.errors.BraintrustError import com.braintrustdata.api.models.Prompt import com.braintrustdata.api.models.PromptCreateParams @@ -16,10 +20,6 @@ import com.braintrustdata.api.models.PromptListParams import com.braintrustdata.api.models.PromptReplaceParams import com.braintrustdata.api.models.PromptRetrieveParams import com.braintrustdata.api.models.PromptUpdateParams -import com.braintrustdata.api.services.errorHandler -import com.braintrustdata.api.services.json -import com.braintrustdata.api.services.jsonHandler -import com.braintrustdata.api.services.withErrorHandler import java.util.concurrent.CompletableFuture class PromptServiceAsyncImpl diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/async/RoleServiceAsyncImpl.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/async/RoleServiceAsyncImpl.kt index 87b3e814..837c6e66 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/async/RoleServiceAsyncImpl.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/async/RoleServiceAsyncImpl.kt @@ -4,9 +4,13 @@ package com.braintrustdata.api.services.async import com.braintrustdata.api.core.ClientOptions import com.braintrustdata.api.core.RequestOptions +import com.braintrustdata.api.core.handlers.errorHandler +import com.braintrustdata.api.core.handlers.jsonHandler +import com.braintrustdata.api.core.handlers.withErrorHandler import com.braintrustdata.api.core.http.HttpMethod import com.braintrustdata.api.core.http.HttpRequest import com.braintrustdata.api.core.http.HttpResponse.Handler +import com.braintrustdata.api.core.json import com.braintrustdata.api.errors.BraintrustError import com.braintrustdata.api.models.Role import com.braintrustdata.api.models.RoleCreateParams @@ -16,10 +20,6 @@ import com.braintrustdata.api.models.RoleListParams import com.braintrustdata.api.models.RoleReplaceParams import com.braintrustdata.api.models.RoleRetrieveParams import com.braintrustdata.api.models.RoleUpdateParams -import com.braintrustdata.api.services.errorHandler -import com.braintrustdata.api.services.json -import com.braintrustdata.api.services.jsonHandler -import com.braintrustdata.api.services.withErrorHandler import java.util.concurrent.CompletableFuture class RoleServiceAsyncImpl diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/async/TopLevelServiceAsyncImpl.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/async/TopLevelServiceAsyncImpl.kt index 62a80406..759787bd 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/async/TopLevelServiceAsyncImpl.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/async/TopLevelServiceAsyncImpl.kt @@ -4,14 +4,14 @@ package com.braintrustdata.api.services.async import com.braintrustdata.api.core.ClientOptions import com.braintrustdata.api.core.RequestOptions +import com.braintrustdata.api.core.handlers.errorHandler +import com.braintrustdata.api.core.handlers.stringHandler +import com.braintrustdata.api.core.handlers.withErrorHandler import com.braintrustdata.api.core.http.HttpMethod import com.braintrustdata.api.core.http.HttpRequest import com.braintrustdata.api.core.http.HttpResponse.Handler import com.braintrustdata.api.errors.BraintrustError import com.braintrustdata.api.models.TopLevelHelloWorldParams -import com.braintrustdata.api.services.errorHandler -import com.braintrustdata.api.services.stringHandler -import com.braintrustdata.api.services.withErrorHandler import java.util.concurrent.CompletableFuture class TopLevelServiceAsyncImpl diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/async/UserServiceAsyncImpl.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/async/UserServiceAsyncImpl.kt index 3cbcf8e1..246d614f 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/async/UserServiceAsyncImpl.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/async/UserServiceAsyncImpl.kt @@ -4,6 +4,9 @@ package com.braintrustdata.api.services.async import com.braintrustdata.api.core.ClientOptions import com.braintrustdata.api.core.RequestOptions +import com.braintrustdata.api.core.handlers.errorHandler +import com.braintrustdata.api.core.handlers.jsonHandler +import com.braintrustdata.api.core.handlers.withErrorHandler import com.braintrustdata.api.core.http.HttpMethod import com.braintrustdata.api.core.http.HttpRequest import com.braintrustdata.api.core.http.HttpResponse.Handler @@ -12,9 +15,6 @@ import com.braintrustdata.api.models.User import com.braintrustdata.api.models.UserListPageAsync import com.braintrustdata.api.models.UserListParams import com.braintrustdata.api.models.UserRetrieveParams -import com.braintrustdata.api.services.errorHandler -import com.braintrustdata.api.services.jsonHandler -import com.braintrustdata.api.services.withErrorHandler import java.util.concurrent.CompletableFuture class UserServiceAsyncImpl diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/async/ViewServiceAsyncImpl.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/async/ViewServiceAsyncImpl.kt index 9a9874ec..ddc3dad5 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/async/ViewServiceAsyncImpl.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/async/ViewServiceAsyncImpl.kt @@ -4,9 +4,13 @@ package com.braintrustdata.api.services.async import com.braintrustdata.api.core.ClientOptions import com.braintrustdata.api.core.RequestOptions +import com.braintrustdata.api.core.handlers.errorHandler +import com.braintrustdata.api.core.handlers.jsonHandler +import com.braintrustdata.api.core.handlers.withErrorHandler import com.braintrustdata.api.core.http.HttpMethod import com.braintrustdata.api.core.http.HttpRequest import com.braintrustdata.api.core.http.HttpResponse.Handler +import com.braintrustdata.api.core.json import com.braintrustdata.api.errors.BraintrustError import com.braintrustdata.api.models.View import com.braintrustdata.api.models.ViewCreateParams @@ -16,10 +20,6 @@ import com.braintrustdata.api.models.ViewListParams import com.braintrustdata.api.models.ViewReplaceParams import com.braintrustdata.api.models.ViewRetrieveParams import com.braintrustdata.api.models.ViewUpdateParams -import com.braintrustdata.api.services.errorHandler -import com.braintrustdata.api.services.json -import com.braintrustdata.api.services.jsonHandler -import com.braintrustdata.api.services.withErrorHandler import java.util.concurrent.CompletableFuture class ViewServiceAsyncImpl diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/async/organizations/MemberServiceAsyncImpl.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/async/organizations/MemberServiceAsyncImpl.kt index 73d5eaec..65480fe5 100644 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/async/organizations/MemberServiceAsyncImpl.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/async/organizations/MemberServiceAsyncImpl.kt @@ -4,16 +4,16 @@ package com.braintrustdata.api.services.async.organizations import com.braintrustdata.api.core.ClientOptions import com.braintrustdata.api.core.RequestOptions +import com.braintrustdata.api.core.handlers.errorHandler +import com.braintrustdata.api.core.handlers.jsonHandler +import com.braintrustdata.api.core.handlers.withErrorHandler import com.braintrustdata.api.core.http.HttpMethod import com.braintrustdata.api.core.http.HttpRequest import com.braintrustdata.api.core.http.HttpResponse.Handler +import com.braintrustdata.api.core.json import com.braintrustdata.api.errors.BraintrustError import com.braintrustdata.api.models.OrganizationMemberUpdateParams import com.braintrustdata.api.models.PatchOrganizationMembersOutput -import com.braintrustdata.api.services.errorHandler -import com.braintrustdata.api.services.json -import com.braintrustdata.api.services.jsonHandler -import com.braintrustdata.api.services.withErrorHandler import java.util.concurrent.CompletableFuture class MemberServiceAsyncImpl diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/async/projects/LogServiceAsyncImpl.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/async/projects/LogServiceAsyncImpl.kt index 23037f34..69a9dc3f 100644 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/async/projects/LogServiceAsyncImpl.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/async/projects/LogServiceAsyncImpl.kt @@ -4,9 +4,13 @@ package com.braintrustdata.api.services.async.projects import com.braintrustdata.api.core.ClientOptions import com.braintrustdata.api.core.RequestOptions +import com.braintrustdata.api.core.handlers.errorHandler +import com.braintrustdata.api.core.handlers.jsonHandler +import com.braintrustdata.api.core.handlers.withErrorHandler import com.braintrustdata.api.core.http.HttpMethod import com.braintrustdata.api.core.http.HttpRequest import com.braintrustdata.api.core.http.HttpResponse.Handler +import com.braintrustdata.api.core.json import com.braintrustdata.api.errors.BraintrustError import com.braintrustdata.api.models.FeedbackResponseSchema import com.braintrustdata.api.models.FetchProjectLogsEventsResponse @@ -15,10 +19,6 @@ import com.braintrustdata.api.models.ProjectLogFeedbackParams import com.braintrustdata.api.models.ProjectLogFetchParams import com.braintrustdata.api.models.ProjectLogFetchPostParams import com.braintrustdata.api.models.ProjectLogInsertParams -import com.braintrustdata.api.services.errorHandler -import com.braintrustdata.api.services.json -import com.braintrustdata.api.services.jsonHandler -import com.braintrustdata.api.services.withErrorHandler import java.util.concurrent.CompletableFuture class LogServiceAsyncImpl diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/blocking/AclServiceImpl.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/blocking/AclServiceImpl.kt index a7b51e01..9d266d42 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/blocking/AclServiceImpl.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/blocking/AclServiceImpl.kt @@ -4,9 +4,13 @@ package com.braintrustdata.api.services.blocking import com.braintrustdata.api.core.ClientOptions import com.braintrustdata.api.core.RequestOptions +import com.braintrustdata.api.core.handlers.errorHandler +import com.braintrustdata.api.core.handlers.jsonHandler +import com.braintrustdata.api.core.handlers.withErrorHandler import com.braintrustdata.api.core.http.HttpMethod import com.braintrustdata.api.core.http.HttpRequest import com.braintrustdata.api.core.http.HttpResponse.Handler +import com.braintrustdata.api.core.json import com.braintrustdata.api.errors.BraintrustError import com.braintrustdata.api.models.Acl import com.braintrustdata.api.models.AclBatchUpdateParams @@ -17,10 +21,6 @@ import com.braintrustdata.api.models.AclFindAndDeleteParams import com.braintrustdata.api.models.AclListPage import com.braintrustdata.api.models.AclListParams import com.braintrustdata.api.models.AclRetrieveParams -import com.braintrustdata.api.services.errorHandler -import com.braintrustdata.api.services.json -import com.braintrustdata.api.services.jsonHandler -import com.braintrustdata.api.services.withErrorHandler class AclServiceImpl constructor( diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/blocking/AiSecretServiceImpl.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/blocking/AiSecretServiceImpl.kt index 2b0fadbc..f61b7be6 100644 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/blocking/AiSecretServiceImpl.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/blocking/AiSecretServiceImpl.kt @@ -4,9 +4,13 @@ package com.braintrustdata.api.services.blocking import com.braintrustdata.api.core.ClientOptions import com.braintrustdata.api.core.RequestOptions +import com.braintrustdata.api.core.handlers.errorHandler +import com.braintrustdata.api.core.handlers.jsonHandler +import com.braintrustdata.api.core.handlers.withErrorHandler import com.braintrustdata.api.core.http.HttpMethod import com.braintrustdata.api.core.http.HttpRequest import com.braintrustdata.api.core.http.HttpResponse.Handler +import com.braintrustdata.api.core.json import com.braintrustdata.api.errors.BraintrustError import com.braintrustdata.api.models.AISecret import com.braintrustdata.api.models.AiSecretCreateParams @@ -17,10 +21,6 @@ import com.braintrustdata.api.models.AiSecretListParams import com.braintrustdata.api.models.AiSecretReplaceParams import com.braintrustdata.api.models.AiSecretRetrieveParams import com.braintrustdata.api.models.AiSecretUpdateParams -import com.braintrustdata.api.services.errorHandler -import com.braintrustdata.api.services.json -import com.braintrustdata.api.services.jsonHandler -import com.braintrustdata.api.services.withErrorHandler class AiSecretServiceImpl constructor( diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/blocking/ApiKeyServiceImpl.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/blocking/ApiKeyServiceImpl.kt index 5b705c68..0f6d80aa 100644 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/blocking/ApiKeyServiceImpl.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/blocking/ApiKeyServiceImpl.kt @@ -4,9 +4,13 @@ package com.braintrustdata.api.services.blocking import com.braintrustdata.api.core.ClientOptions import com.braintrustdata.api.core.RequestOptions +import com.braintrustdata.api.core.handlers.errorHandler +import com.braintrustdata.api.core.handlers.jsonHandler +import com.braintrustdata.api.core.handlers.withErrorHandler import com.braintrustdata.api.core.http.HttpMethod import com.braintrustdata.api.core.http.HttpRequest import com.braintrustdata.api.core.http.HttpResponse.Handler +import com.braintrustdata.api.core.json import com.braintrustdata.api.errors.BraintrustError import com.braintrustdata.api.models.ApiKey import com.braintrustdata.api.models.ApiKeyCreateParams @@ -15,10 +19,6 @@ import com.braintrustdata.api.models.ApiKeyListPage import com.braintrustdata.api.models.ApiKeyListParams import com.braintrustdata.api.models.ApiKeyRetrieveParams import com.braintrustdata.api.models.CreateApiKeyOutput -import com.braintrustdata.api.services.errorHandler -import com.braintrustdata.api.services.json -import com.braintrustdata.api.services.jsonHandler -import com.braintrustdata.api.services.withErrorHandler class ApiKeyServiceImpl constructor( diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/blocking/DatasetServiceImpl.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/blocking/DatasetServiceImpl.kt index a7d2f6e1..4dc34521 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/blocking/DatasetServiceImpl.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/blocking/DatasetServiceImpl.kt @@ -4,9 +4,13 @@ package com.braintrustdata.api.services.blocking import com.braintrustdata.api.core.ClientOptions import com.braintrustdata.api.core.RequestOptions +import com.braintrustdata.api.core.handlers.errorHandler +import com.braintrustdata.api.core.handlers.jsonHandler +import com.braintrustdata.api.core.handlers.withErrorHandler import com.braintrustdata.api.core.http.HttpMethod import com.braintrustdata.api.core.http.HttpRequest import com.braintrustdata.api.core.http.HttpResponse.Handler +import com.braintrustdata.api.core.json import com.braintrustdata.api.errors.BraintrustError import com.braintrustdata.api.models.Dataset import com.braintrustdata.api.models.DatasetCreateParams @@ -24,10 +28,6 @@ import com.braintrustdata.api.models.FeedbackResponseSchema import com.braintrustdata.api.models.FetchDatasetEventsResponse import com.braintrustdata.api.models.InsertEventsResponse import com.braintrustdata.api.models.SummarizeDatasetResponse -import com.braintrustdata.api.services.errorHandler -import com.braintrustdata.api.services.json -import com.braintrustdata.api.services.jsonHandler -import com.braintrustdata.api.services.withErrorHandler class DatasetServiceImpl constructor( diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/blocking/EnvVarServiceImpl.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/blocking/EnvVarServiceImpl.kt index 947656fd..34db366c 100644 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/blocking/EnvVarServiceImpl.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/blocking/EnvVarServiceImpl.kt @@ -4,9 +4,13 @@ package com.braintrustdata.api.services.blocking import com.braintrustdata.api.core.ClientOptions import com.braintrustdata.api.core.RequestOptions +import com.braintrustdata.api.core.handlers.errorHandler +import com.braintrustdata.api.core.handlers.jsonHandler +import com.braintrustdata.api.core.handlers.withErrorHandler import com.braintrustdata.api.core.http.HttpMethod import com.braintrustdata.api.core.http.HttpRequest import com.braintrustdata.api.core.http.HttpResponse.Handler +import com.braintrustdata.api.core.json import com.braintrustdata.api.errors.BraintrustError import com.braintrustdata.api.models.EnvVar import com.braintrustdata.api.models.EnvVarCreateParams @@ -16,10 +20,6 @@ import com.braintrustdata.api.models.EnvVarListResponse import com.braintrustdata.api.models.EnvVarReplaceParams import com.braintrustdata.api.models.EnvVarRetrieveParams import com.braintrustdata.api.models.EnvVarUpdateParams -import com.braintrustdata.api.services.errorHandler -import com.braintrustdata.api.services.json -import com.braintrustdata.api.services.jsonHandler -import com.braintrustdata.api.services.withErrorHandler class EnvVarServiceImpl constructor( diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/blocking/EvalServiceImpl.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/blocking/EvalServiceImpl.kt index 2811b4d7..f8a2f694 100644 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/blocking/EvalServiceImpl.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/blocking/EvalServiceImpl.kt @@ -4,16 +4,16 @@ package com.braintrustdata.api.services.blocking import com.braintrustdata.api.core.ClientOptions import com.braintrustdata.api.core.RequestOptions +import com.braintrustdata.api.core.handlers.errorHandler +import com.braintrustdata.api.core.handlers.jsonHandler +import com.braintrustdata.api.core.handlers.withErrorHandler import com.braintrustdata.api.core.http.HttpMethod import com.braintrustdata.api.core.http.HttpRequest import com.braintrustdata.api.core.http.HttpResponse.Handler +import com.braintrustdata.api.core.json import com.braintrustdata.api.errors.BraintrustError import com.braintrustdata.api.models.EvalCreateParams import com.braintrustdata.api.models.SummarizeExperimentResponse -import com.braintrustdata.api.services.errorHandler -import com.braintrustdata.api.services.json -import com.braintrustdata.api.services.jsonHandler -import com.braintrustdata.api.services.withErrorHandler class EvalServiceImpl constructor( diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/blocking/ExperimentServiceImpl.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/blocking/ExperimentServiceImpl.kt index 1d80270a..df57dad1 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/blocking/ExperimentServiceImpl.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/blocking/ExperimentServiceImpl.kt @@ -4,9 +4,13 @@ package com.braintrustdata.api.services.blocking import com.braintrustdata.api.core.ClientOptions import com.braintrustdata.api.core.RequestOptions +import com.braintrustdata.api.core.handlers.errorHandler +import com.braintrustdata.api.core.handlers.jsonHandler +import com.braintrustdata.api.core.handlers.withErrorHandler import com.braintrustdata.api.core.http.HttpMethod import com.braintrustdata.api.core.http.HttpRequest import com.braintrustdata.api.core.http.HttpResponse.Handler +import com.braintrustdata.api.core.json import com.braintrustdata.api.errors.BraintrustError import com.braintrustdata.api.models.Experiment import com.braintrustdata.api.models.ExperimentCreateParams @@ -24,10 +28,6 @@ import com.braintrustdata.api.models.FeedbackResponseSchema import com.braintrustdata.api.models.FetchExperimentEventsResponse import com.braintrustdata.api.models.InsertEventsResponse import com.braintrustdata.api.models.SummarizeExperimentResponse -import com.braintrustdata.api.services.errorHandler -import com.braintrustdata.api.services.json -import com.braintrustdata.api.services.jsonHandler -import com.braintrustdata.api.services.withErrorHandler class ExperimentServiceImpl constructor( diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/blocking/FunctionServiceImpl.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/blocking/FunctionServiceImpl.kt index d626758d..00bcbe94 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/blocking/FunctionServiceImpl.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/blocking/FunctionServiceImpl.kt @@ -4,9 +4,13 @@ package com.braintrustdata.api.services.blocking import com.braintrustdata.api.core.ClientOptions import com.braintrustdata.api.core.RequestOptions +import com.braintrustdata.api.core.handlers.errorHandler +import com.braintrustdata.api.core.handlers.jsonHandler +import com.braintrustdata.api.core.handlers.withErrorHandler import com.braintrustdata.api.core.http.HttpMethod import com.braintrustdata.api.core.http.HttpRequest import com.braintrustdata.api.core.http.HttpResponse.Handler +import com.braintrustdata.api.core.json import com.braintrustdata.api.errors.BraintrustError import com.braintrustdata.api.models.Function import com.braintrustdata.api.models.FunctionCreateParams @@ -18,10 +22,6 @@ import com.braintrustdata.api.models.FunctionListParams import com.braintrustdata.api.models.FunctionReplaceParams import com.braintrustdata.api.models.FunctionRetrieveParams import com.braintrustdata.api.models.FunctionUpdateParams -import com.braintrustdata.api.services.errorHandler -import com.braintrustdata.api.services.json -import com.braintrustdata.api.services.jsonHandler -import com.braintrustdata.api.services.withErrorHandler class FunctionServiceImpl constructor( diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/blocking/GroupServiceImpl.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/blocking/GroupServiceImpl.kt index 352a97e9..080f21e2 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/blocking/GroupServiceImpl.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/blocking/GroupServiceImpl.kt @@ -4,9 +4,13 @@ package com.braintrustdata.api.services.blocking import com.braintrustdata.api.core.ClientOptions import com.braintrustdata.api.core.RequestOptions +import com.braintrustdata.api.core.handlers.errorHandler +import com.braintrustdata.api.core.handlers.jsonHandler +import com.braintrustdata.api.core.handlers.withErrorHandler import com.braintrustdata.api.core.http.HttpMethod import com.braintrustdata.api.core.http.HttpRequest import com.braintrustdata.api.core.http.HttpResponse.Handler +import com.braintrustdata.api.core.json import com.braintrustdata.api.errors.BraintrustError import com.braintrustdata.api.models.Group import com.braintrustdata.api.models.GroupCreateParams @@ -16,10 +20,6 @@ import com.braintrustdata.api.models.GroupListParams import com.braintrustdata.api.models.GroupReplaceParams import com.braintrustdata.api.models.GroupRetrieveParams import com.braintrustdata.api.models.GroupUpdateParams -import com.braintrustdata.api.services.errorHandler -import com.braintrustdata.api.services.json -import com.braintrustdata.api.services.jsonHandler -import com.braintrustdata.api.services.withErrorHandler class GroupServiceImpl constructor( diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/blocking/OrganizationServiceImpl.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/blocking/OrganizationServiceImpl.kt index 786fc869..fd55f46a 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/blocking/OrganizationServiceImpl.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/blocking/OrganizationServiceImpl.kt @@ -4,9 +4,13 @@ package com.braintrustdata.api.services.blocking import com.braintrustdata.api.core.ClientOptions import com.braintrustdata.api.core.RequestOptions +import com.braintrustdata.api.core.handlers.errorHandler +import com.braintrustdata.api.core.handlers.jsonHandler +import com.braintrustdata.api.core.handlers.withErrorHandler import com.braintrustdata.api.core.http.HttpMethod import com.braintrustdata.api.core.http.HttpRequest import com.braintrustdata.api.core.http.HttpResponse.Handler +import com.braintrustdata.api.core.json import com.braintrustdata.api.errors.BraintrustError import com.braintrustdata.api.models.Organization import com.braintrustdata.api.models.OrganizationDeleteParams @@ -16,10 +20,6 @@ import com.braintrustdata.api.models.OrganizationRetrieveParams import com.braintrustdata.api.models.OrganizationUpdateParams import com.braintrustdata.api.services.blocking.organizations.MemberService import com.braintrustdata.api.services.blocking.organizations.MemberServiceImpl -import com.braintrustdata.api.services.errorHandler -import com.braintrustdata.api.services.json -import com.braintrustdata.api.services.jsonHandler -import com.braintrustdata.api.services.withErrorHandler class OrganizationServiceImpl constructor( diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/blocking/ProjectScoreServiceImpl.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/blocking/ProjectScoreServiceImpl.kt index 8adb60b6..9576e14a 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/blocking/ProjectScoreServiceImpl.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/blocking/ProjectScoreServiceImpl.kt @@ -4,9 +4,13 @@ package com.braintrustdata.api.services.blocking import com.braintrustdata.api.core.ClientOptions import com.braintrustdata.api.core.RequestOptions +import com.braintrustdata.api.core.handlers.errorHandler +import com.braintrustdata.api.core.handlers.jsonHandler +import com.braintrustdata.api.core.handlers.withErrorHandler import com.braintrustdata.api.core.http.HttpMethod import com.braintrustdata.api.core.http.HttpRequest import com.braintrustdata.api.core.http.HttpResponse.Handler +import com.braintrustdata.api.core.json import com.braintrustdata.api.errors.BraintrustError import com.braintrustdata.api.models.ProjectScore import com.braintrustdata.api.models.ProjectScoreCreateParams @@ -16,10 +20,6 @@ import com.braintrustdata.api.models.ProjectScoreListParams import com.braintrustdata.api.models.ProjectScoreReplaceParams import com.braintrustdata.api.models.ProjectScoreRetrieveParams import com.braintrustdata.api.models.ProjectScoreUpdateParams -import com.braintrustdata.api.services.errorHandler -import com.braintrustdata.api.services.json -import com.braintrustdata.api.services.jsonHandler -import com.braintrustdata.api.services.withErrorHandler class ProjectScoreServiceImpl constructor( diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/blocking/ProjectServiceImpl.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/blocking/ProjectServiceImpl.kt index 9a166368..1349bed5 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/blocking/ProjectServiceImpl.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/blocking/ProjectServiceImpl.kt @@ -4,9 +4,13 @@ package com.braintrustdata.api.services.blocking import com.braintrustdata.api.core.ClientOptions import com.braintrustdata.api.core.RequestOptions +import com.braintrustdata.api.core.handlers.errorHandler +import com.braintrustdata.api.core.handlers.jsonHandler +import com.braintrustdata.api.core.handlers.withErrorHandler import com.braintrustdata.api.core.http.HttpMethod import com.braintrustdata.api.core.http.HttpRequest import com.braintrustdata.api.core.http.HttpResponse.Handler +import com.braintrustdata.api.core.json import com.braintrustdata.api.errors.BraintrustError import com.braintrustdata.api.models.Project import com.braintrustdata.api.models.ProjectCreateParams @@ -17,10 +21,6 @@ import com.braintrustdata.api.models.ProjectRetrieveParams import com.braintrustdata.api.models.ProjectUpdateParams import com.braintrustdata.api.services.blocking.projects.LogService import com.braintrustdata.api.services.blocking.projects.LogServiceImpl -import com.braintrustdata.api.services.errorHandler -import com.braintrustdata.api.services.json -import com.braintrustdata.api.services.jsonHandler -import com.braintrustdata.api.services.withErrorHandler class ProjectServiceImpl constructor( diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/blocking/ProjectTagServiceImpl.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/blocking/ProjectTagServiceImpl.kt index 79ec9e72..daf6171e 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/blocking/ProjectTagServiceImpl.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/blocking/ProjectTagServiceImpl.kt @@ -4,9 +4,13 @@ package com.braintrustdata.api.services.blocking import com.braintrustdata.api.core.ClientOptions import com.braintrustdata.api.core.RequestOptions +import com.braintrustdata.api.core.handlers.errorHandler +import com.braintrustdata.api.core.handlers.jsonHandler +import com.braintrustdata.api.core.handlers.withErrorHandler import com.braintrustdata.api.core.http.HttpMethod import com.braintrustdata.api.core.http.HttpRequest import com.braintrustdata.api.core.http.HttpResponse.Handler +import com.braintrustdata.api.core.json import com.braintrustdata.api.errors.BraintrustError import com.braintrustdata.api.models.ProjectTag import com.braintrustdata.api.models.ProjectTagCreateParams @@ -16,10 +20,6 @@ import com.braintrustdata.api.models.ProjectTagListParams import com.braintrustdata.api.models.ProjectTagReplaceParams import com.braintrustdata.api.models.ProjectTagRetrieveParams import com.braintrustdata.api.models.ProjectTagUpdateParams -import com.braintrustdata.api.services.errorHandler -import com.braintrustdata.api.services.json -import com.braintrustdata.api.services.jsonHandler -import com.braintrustdata.api.services.withErrorHandler class ProjectTagServiceImpl constructor( diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/blocking/PromptServiceImpl.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/blocking/PromptServiceImpl.kt index 25e6d6b7..dc23ed4d 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/blocking/PromptServiceImpl.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/blocking/PromptServiceImpl.kt @@ -4,9 +4,13 @@ package com.braintrustdata.api.services.blocking import com.braintrustdata.api.core.ClientOptions import com.braintrustdata.api.core.RequestOptions +import com.braintrustdata.api.core.handlers.errorHandler +import com.braintrustdata.api.core.handlers.jsonHandler +import com.braintrustdata.api.core.handlers.withErrorHandler import com.braintrustdata.api.core.http.HttpMethod import com.braintrustdata.api.core.http.HttpRequest import com.braintrustdata.api.core.http.HttpResponse.Handler +import com.braintrustdata.api.core.json import com.braintrustdata.api.errors.BraintrustError import com.braintrustdata.api.models.Prompt import com.braintrustdata.api.models.PromptCreateParams @@ -16,10 +20,6 @@ import com.braintrustdata.api.models.PromptListParams import com.braintrustdata.api.models.PromptReplaceParams import com.braintrustdata.api.models.PromptRetrieveParams import com.braintrustdata.api.models.PromptUpdateParams -import com.braintrustdata.api.services.errorHandler -import com.braintrustdata.api.services.json -import com.braintrustdata.api.services.jsonHandler -import com.braintrustdata.api.services.withErrorHandler class PromptServiceImpl constructor( diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/blocking/RoleServiceImpl.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/blocking/RoleServiceImpl.kt index 5f49a6b3..ef6cba86 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/blocking/RoleServiceImpl.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/blocking/RoleServiceImpl.kt @@ -4,9 +4,13 @@ package com.braintrustdata.api.services.blocking import com.braintrustdata.api.core.ClientOptions import com.braintrustdata.api.core.RequestOptions +import com.braintrustdata.api.core.handlers.errorHandler +import com.braintrustdata.api.core.handlers.jsonHandler +import com.braintrustdata.api.core.handlers.withErrorHandler import com.braintrustdata.api.core.http.HttpMethod import com.braintrustdata.api.core.http.HttpRequest import com.braintrustdata.api.core.http.HttpResponse.Handler +import com.braintrustdata.api.core.json import com.braintrustdata.api.errors.BraintrustError import com.braintrustdata.api.models.Role import com.braintrustdata.api.models.RoleCreateParams @@ -16,10 +20,6 @@ import com.braintrustdata.api.models.RoleListParams import com.braintrustdata.api.models.RoleReplaceParams import com.braintrustdata.api.models.RoleRetrieveParams import com.braintrustdata.api.models.RoleUpdateParams -import com.braintrustdata.api.services.errorHandler -import com.braintrustdata.api.services.json -import com.braintrustdata.api.services.jsonHandler -import com.braintrustdata.api.services.withErrorHandler class RoleServiceImpl constructor( diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/blocking/TopLevelServiceImpl.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/blocking/TopLevelServiceImpl.kt index 631eac96..59d5c939 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/blocking/TopLevelServiceImpl.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/blocking/TopLevelServiceImpl.kt @@ -4,14 +4,14 @@ package com.braintrustdata.api.services.blocking import com.braintrustdata.api.core.ClientOptions import com.braintrustdata.api.core.RequestOptions +import com.braintrustdata.api.core.handlers.errorHandler +import com.braintrustdata.api.core.handlers.stringHandler +import com.braintrustdata.api.core.handlers.withErrorHandler import com.braintrustdata.api.core.http.HttpMethod import com.braintrustdata.api.core.http.HttpRequest import com.braintrustdata.api.core.http.HttpResponse.Handler import com.braintrustdata.api.errors.BraintrustError import com.braintrustdata.api.models.TopLevelHelloWorldParams -import com.braintrustdata.api.services.errorHandler -import com.braintrustdata.api.services.stringHandler -import com.braintrustdata.api.services.withErrorHandler class TopLevelServiceImpl constructor( diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/blocking/UserServiceImpl.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/blocking/UserServiceImpl.kt index 28ff5d7a..b07330fe 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/blocking/UserServiceImpl.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/blocking/UserServiceImpl.kt @@ -4,6 +4,9 @@ package com.braintrustdata.api.services.blocking import com.braintrustdata.api.core.ClientOptions import com.braintrustdata.api.core.RequestOptions +import com.braintrustdata.api.core.handlers.errorHandler +import com.braintrustdata.api.core.handlers.jsonHandler +import com.braintrustdata.api.core.handlers.withErrorHandler import com.braintrustdata.api.core.http.HttpMethod import com.braintrustdata.api.core.http.HttpRequest import com.braintrustdata.api.core.http.HttpResponse.Handler @@ -12,9 +15,6 @@ import com.braintrustdata.api.models.User import com.braintrustdata.api.models.UserListPage import com.braintrustdata.api.models.UserListParams import com.braintrustdata.api.models.UserRetrieveParams -import com.braintrustdata.api.services.errorHandler -import com.braintrustdata.api.services.jsonHandler -import com.braintrustdata.api.services.withErrorHandler class UserServiceImpl constructor( diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/blocking/ViewServiceImpl.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/blocking/ViewServiceImpl.kt index f682e6d6..4f17ebf9 100755 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/blocking/ViewServiceImpl.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/blocking/ViewServiceImpl.kt @@ -4,9 +4,13 @@ package com.braintrustdata.api.services.blocking import com.braintrustdata.api.core.ClientOptions import com.braintrustdata.api.core.RequestOptions +import com.braintrustdata.api.core.handlers.errorHandler +import com.braintrustdata.api.core.handlers.jsonHandler +import com.braintrustdata.api.core.handlers.withErrorHandler import com.braintrustdata.api.core.http.HttpMethod import com.braintrustdata.api.core.http.HttpRequest import com.braintrustdata.api.core.http.HttpResponse.Handler +import com.braintrustdata.api.core.json import com.braintrustdata.api.errors.BraintrustError import com.braintrustdata.api.models.View import com.braintrustdata.api.models.ViewCreateParams @@ -16,10 +20,6 @@ import com.braintrustdata.api.models.ViewListParams import com.braintrustdata.api.models.ViewReplaceParams import com.braintrustdata.api.models.ViewRetrieveParams import com.braintrustdata.api.models.ViewUpdateParams -import com.braintrustdata.api.services.errorHandler -import com.braintrustdata.api.services.json -import com.braintrustdata.api.services.jsonHandler -import com.braintrustdata.api.services.withErrorHandler class ViewServiceImpl constructor( diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/blocking/organizations/MemberServiceImpl.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/blocking/organizations/MemberServiceImpl.kt index 749d7bf8..31901bd3 100644 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/blocking/organizations/MemberServiceImpl.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/blocking/organizations/MemberServiceImpl.kt @@ -4,16 +4,16 @@ package com.braintrustdata.api.services.blocking.organizations import com.braintrustdata.api.core.ClientOptions import com.braintrustdata.api.core.RequestOptions +import com.braintrustdata.api.core.handlers.errorHandler +import com.braintrustdata.api.core.handlers.jsonHandler +import com.braintrustdata.api.core.handlers.withErrorHandler import com.braintrustdata.api.core.http.HttpMethod import com.braintrustdata.api.core.http.HttpRequest import com.braintrustdata.api.core.http.HttpResponse.Handler +import com.braintrustdata.api.core.json import com.braintrustdata.api.errors.BraintrustError import com.braintrustdata.api.models.OrganizationMemberUpdateParams import com.braintrustdata.api.models.PatchOrganizationMembersOutput -import com.braintrustdata.api.services.errorHandler -import com.braintrustdata.api.services.json -import com.braintrustdata.api.services.jsonHandler -import com.braintrustdata.api.services.withErrorHandler class MemberServiceImpl constructor( diff --git a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/blocking/projects/LogServiceImpl.kt b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/blocking/projects/LogServiceImpl.kt index 9f21671a..5fc922bd 100644 --- a/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/blocking/projects/LogServiceImpl.kt +++ b/braintrust-java-core/src/main/kotlin/com/braintrustdata/api/services/blocking/projects/LogServiceImpl.kt @@ -4,9 +4,13 @@ package com.braintrustdata.api.services.blocking.projects import com.braintrustdata.api.core.ClientOptions import com.braintrustdata.api.core.RequestOptions +import com.braintrustdata.api.core.handlers.errorHandler +import com.braintrustdata.api.core.handlers.jsonHandler +import com.braintrustdata.api.core.handlers.withErrorHandler import com.braintrustdata.api.core.http.HttpMethod import com.braintrustdata.api.core.http.HttpRequest import com.braintrustdata.api.core.http.HttpResponse.Handler +import com.braintrustdata.api.core.json import com.braintrustdata.api.errors.BraintrustError import com.braintrustdata.api.models.FeedbackResponseSchema import com.braintrustdata.api.models.FetchProjectLogsEventsResponse @@ -15,10 +19,6 @@ import com.braintrustdata.api.models.ProjectLogFeedbackParams import com.braintrustdata.api.models.ProjectLogFetchParams import com.braintrustdata.api.models.ProjectLogFetchPostParams import com.braintrustdata.api.models.ProjectLogInsertParams -import com.braintrustdata.api.services.errorHandler -import com.braintrustdata.api.services.json -import com.braintrustdata.api.services.jsonHandler -import com.braintrustdata.api.services.withErrorHandler class LogServiceImpl constructor( diff --git a/braintrust-java-core/src/test/kotlin/com/braintrustdata/api/models/ProjectScoreCreateParamsTest.kt b/braintrust-java-core/src/test/kotlin/com/braintrustdata/api/models/ProjectScoreCreateParamsTest.kt index f507235b..5f1a5949 100755 --- a/braintrust-java-core/src/test/kotlin/com/braintrustdata/api/models/ProjectScoreCreateParamsTest.kt +++ b/braintrust-java-core/src/test/kotlin/com/braintrustdata/api/models/ProjectScoreCreateParamsTest.kt @@ -15,7 +15,7 @@ class ProjectScoreCreateParamsTest { .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .scoreType(ProjectScoreType.SLIDER) .categories( - ProjectScoreCreateParams.Categories.ofList( + ProjectScoreCreateParams.Categories.ofCategorical( listOf(ProjectScoreCategory.builder().name("name").value(42.23).build()) ) ) @@ -54,7 +54,7 @@ class ProjectScoreCreateParamsTest { .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .scoreType(ProjectScoreType.SLIDER) .categories( - ProjectScoreCreateParams.Categories.ofList( + ProjectScoreCreateParams.Categories.ofCategorical( listOf(ProjectScoreCategory.builder().name("name").value(42.23).build()) ) ) @@ -92,7 +92,7 @@ class ProjectScoreCreateParamsTest { assertThat(body.scoreType()).isEqualTo(ProjectScoreType.SLIDER) assertThat(body.categories()) .isEqualTo( - ProjectScoreCreateParams.Categories.ofList( + ProjectScoreCreateParams.Categories.ofCategorical( listOf(ProjectScoreCategory.builder().name("name").value(42.23).build()) ) ) diff --git a/braintrust-java-core/src/test/kotlin/com/braintrustdata/api/models/ProjectScoreReplaceParamsTest.kt b/braintrust-java-core/src/test/kotlin/com/braintrustdata/api/models/ProjectScoreReplaceParamsTest.kt index f73213e9..d3b3409c 100755 --- a/braintrust-java-core/src/test/kotlin/com/braintrustdata/api/models/ProjectScoreReplaceParamsTest.kt +++ b/braintrust-java-core/src/test/kotlin/com/braintrustdata/api/models/ProjectScoreReplaceParamsTest.kt @@ -15,7 +15,7 @@ class ProjectScoreReplaceParamsTest { .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .scoreType(ProjectScoreType.SLIDER) .categories( - ProjectScoreReplaceParams.Categories.ofList( + ProjectScoreReplaceParams.Categories.ofCategorical( listOf(ProjectScoreCategory.builder().name("name").value(42.23).build()) ) ) @@ -54,7 +54,7 @@ class ProjectScoreReplaceParamsTest { .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .scoreType(ProjectScoreType.SLIDER) .categories( - ProjectScoreReplaceParams.Categories.ofList( + ProjectScoreReplaceParams.Categories.ofCategorical( listOf(ProjectScoreCategory.builder().name("name").value(42.23).build()) ) ) @@ -92,7 +92,7 @@ class ProjectScoreReplaceParamsTest { assertThat(body.scoreType()).isEqualTo(ProjectScoreType.SLIDER) assertThat(body.categories()) .isEqualTo( - ProjectScoreReplaceParams.Categories.ofList( + ProjectScoreReplaceParams.Categories.ofCategorical( listOf(ProjectScoreCategory.builder().name("name").value(42.23).build()) ) ) diff --git a/braintrust-java-core/src/test/kotlin/com/braintrustdata/api/models/ProjectScoreTest.kt b/braintrust-java-core/src/test/kotlin/com/braintrustdata/api/models/ProjectScoreTest.kt index 49e7db82..8cabac19 100755 --- a/braintrust-java-core/src/test/kotlin/com/braintrustdata/api/models/ProjectScoreTest.kt +++ b/braintrust-java-core/src/test/kotlin/com/braintrustdata/api/models/ProjectScoreTest.kt @@ -18,7 +18,7 @@ class ProjectScoreTest { .scoreType(ProjectScoreType.SLIDER) .userId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .categories( - ProjectScore.Categories.ofList( + ProjectScore.Categories.ofCategorical( listOf(ProjectScoreCategory.builder().name("name").value(42.23).build()) ) ) @@ -59,7 +59,7 @@ class ProjectScoreTest { assertThat(projectScore.userId()).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") assertThat(projectScore.categories()) .contains( - ProjectScore.Categories.ofList( + ProjectScore.Categories.ofCategorical( listOf(ProjectScoreCategory.builder().name("name").value(42.23).build()) ) ) diff --git a/braintrust-java-core/src/test/kotlin/com/braintrustdata/api/models/ProjectScoreUpdateParamsTest.kt b/braintrust-java-core/src/test/kotlin/com/braintrustdata/api/models/ProjectScoreUpdateParamsTest.kt index 9a40ded3..66c17521 100755 --- a/braintrust-java-core/src/test/kotlin/com/braintrustdata/api/models/ProjectScoreUpdateParamsTest.kt +++ b/braintrust-java-core/src/test/kotlin/com/braintrustdata/api/models/ProjectScoreUpdateParamsTest.kt @@ -13,7 +13,7 @@ class ProjectScoreUpdateParamsTest { ProjectScoreUpdateParams.builder() .projectScoreId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .categories( - ProjectScoreUpdateParams.Categories.ofList( + ProjectScoreUpdateParams.Categories.ofCategorical( listOf(ProjectScoreCategory.builder().name("name").value(42.23).build()) ) ) @@ -52,7 +52,7 @@ class ProjectScoreUpdateParamsTest { ProjectScoreUpdateParams.builder() .projectScoreId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .categories( - ProjectScoreUpdateParams.Categories.ofList( + ProjectScoreUpdateParams.Categories.ofCategorical( listOf(ProjectScoreCategory.builder().name("name").value(42.23).build()) ) ) @@ -89,7 +89,7 @@ class ProjectScoreUpdateParamsTest { assertThat(body).isNotNull assertThat(body.categories()) .isEqualTo( - ProjectScoreUpdateParams.Categories.ofList( + ProjectScoreUpdateParams.Categories.ofCategorical( listOf(ProjectScoreCategory.builder().name("name").value(42.23).build()) ) ) diff --git a/braintrust-java-core/src/test/kotlin/com/braintrustdata/api/services/blocking/ProjectScoreServiceTest.kt b/braintrust-java-core/src/test/kotlin/com/braintrustdata/api/services/blocking/ProjectScoreServiceTest.kt index b6a470b5..7726d0da 100755 --- a/braintrust-java-core/src/test/kotlin/com/braintrustdata/api/services/blocking/ProjectScoreServiceTest.kt +++ b/braintrust-java-core/src/test/kotlin/com/braintrustdata/api/services/blocking/ProjectScoreServiceTest.kt @@ -27,7 +27,7 @@ class ProjectScoreServiceTest { .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .scoreType(ProjectScoreType.SLIDER) .categories( - ProjectScoreCreateParams.Categories.ofList( + ProjectScoreCreateParams.Categories.ofCategorical( listOf(ProjectScoreCategory.builder().name("name").value(42.23).build()) ) ) @@ -95,7 +95,7 @@ class ProjectScoreServiceTest { ProjectScoreUpdateParams.builder() .projectScoreId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .categories( - ProjectScoreUpdateParams.Categories.ofList( + ProjectScoreUpdateParams.Categories.ofCategorical( listOf(ProjectScoreCategory.builder().name("name").value(42.23).build()) ) ) @@ -180,7 +180,7 @@ class ProjectScoreServiceTest { .projectId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .scoreType(ProjectScoreType.SLIDER) .categories( - ProjectScoreReplaceParams.Categories.ofList( + ProjectScoreReplaceParams.Categories.ofCategorical( listOf(ProjectScoreCategory.builder().name("name").value(42.23).build()) ) ) diff --git a/buildSrc/src/main/kotlin/braintrust.java.gradle.kts b/buildSrc/src/main/kotlin/braintrust.java.gradle.kts index 53e63304..32a150ed 100755 --- a/buildSrc/src/main/kotlin/braintrust.java.gradle.kts +++ b/buildSrc/src/main/kotlin/braintrust.java.gradle.kts @@ -19,6 +19,7 @@ configure { importOrder() removeUnusedImports() palantirJavaFormat() + toggleOffOn() } } diff --git a/buildSrc/src/main/kotlin/braintrust.kotlin.gradle.kts b/buildSrc/src/main/kotlin/braintrust.kotlin.gradle.kts index 267e3576..21c44eda 100755 --- a/buildSrc/src/main/kotlin/braintrust.kotlin.gradle.kts +++ b/buildSrc/src/main/kotlin/braintrust.kotlin.gradle.kts @@ -16,6 +16,7 @@ kotlin { configure { kotlin { ktfmt().kotlinlangStyle() + toggleOffOn() } }