Skip to content

Commit

Permalink
style(client): move equals, hashCode, and toString to the bottom of e…
Browse files Browse the repository at this point in the history
…ntity files

chore: unknown commit message
  • Loading branch information
stainless-bot authored and Stainless Bot committed Oct 2, 2024
1 parent 670e73f commit 9ec34a8
Show file tree
Hide file tree
Showing 39 changed files with 2,224 additions and 2,224 deletions.
184 changes: 92 additions & 92 deletions openai-java-core/src/main/kotlin/com/openai/models/Batch.kt
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ private constructor(

private var validated: Boolean = false

private var hashCode: Int = 0

fun id(): String = id.getRequired("id")

/** The object type, which is always `batch`. */
Expand Down Expand Up @@ -203,68 +201,6 @@ private constructor(

fun toBuilder() = Builder().from(this)

override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}

return other is Batch &&
this.id == other.id &&
this.object_ == other.object_ &&
this.endpoint == other.endpoint &&
this.errors == other.errors &&
this.inputFileId == other.inputFileId &&
this.completionWindow == other.completionWindow &&
this.status == other.status &&
this.outputFileId == other.outputFileId &&
this.errorFileId == other.errorFileId &&
this.createdAt == other.createdAt &&
this.inProgressAt == other.inProgressAt &&
this.expiresAt == other.expiresAt &&
this.finalizingAt == other.finalizingAt &&
this.completedAt == other.completedAt &&
this.failedAt == other.failedAt &&
this.expiredAt == other.expiredAt &&
this.cancellingAt == other.cancellingAt &&
this.cancelledAt == other.cancelledAt &&
this.requestCounts == other.requestCounts &&
this.metadata == other.metadata &&
this.additionalProperties == other.additionalProperties
}

override fun hashCode(): Int {
if (hashCode == 0) {
hashCode =
Objects.hash(
id,
object_,
endpoint,
errors,
inputFileId,
completionWindow,
status,
outputFileId,
errorFileId,
createdAt,
inProgressAt,
expiresAt,
finalizingAt,
completedAt,
failedAt,
expiredAt,
cancellingAt,
cancelledAt,
requestCounts,
metadata,
additionalProperties,
)
}
return hashCode
}

override fun toString() =
"Batch{id=$id, object_=$object_, endpoint=$endpoint, errors=$errors, inputFileId=$inputFileId, completionWindow=$completionWindow, status=$status, outputFileId=$outputFileId, errorFileId=$errorFileId, createdAt=$createdAt, inProgressAt=$inProgressAt, expiresAt=$expiresAt, finalizingAt=$finalizingAt, completedAt=$completedAt, failedAt=$failedAt, expiredAt=$expiredAt, cancellingAt=$cancellingAt, cancelledAt=$cancelledAt, requestCounts=$requestCounts, metadata=$metadata, additionalProperties=$additionalProperties}"

companion object {

@JvmStatic fun builder() = Builder()
Expand Down Expand Up @@ -677,8 +613,6 @@ private constructor(

private var validated: Boolean = false

private var hashCode: Int = 0

/** The object type, which is always `list`. */
fun object_(): Optional<String> = Optional.ofNullable(object_.getNullable("object"))

Expand All @@ -703,32 +637,6 @@ private constructor(

fun toBuilder() = Builder().from(this)

override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}

return other is Errors &&
this.object_ == other.object_ &&
this.data == other.data &&
this.additionalProperties == other.additionalProperties
}

override fun hashCode(): Int {
if (hashCode == 0) {
hashCode =
Objects.hash(
object_,
data,
additionalProperties,
)
}
return hashCode
}

override fun toString() =
"Errors{object_=$object_, data=$data, additionalProperties=$additionalProperties}"

companion object {

@JvmStatic fun builder() = Builder()
Expand Down Expand Up @@ -782,5 +690,97 @@ private constructor(
additionalProperties.toUnmodifiable(),
)
}

override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}

return other is Errors &&
this.object_ == other.object_ &&
this.data == other.data &&
this.additionalProperties == other.additionalProperties
}

private var hashCode: Int = 0

override fun hashCode(): Int {
if (hashCode == 0) {
hashCode =
Objects.hash(
object_,
data,
additionalProperties,
)
}
return hashCode
}

override fun toString() =
"Errors{object_=$object_, data=$data, additionalProperties=$additionalProperties}"
}

override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}

return other is Batch &&
this.id == other.id &&
this.object_ == other.object_ &&
this.endpoint == other.endpoint &&
this.errors == other.errors &&
this.inputFileId == other.inputFileId &&
this.completionWindow == other.completionWindow &&
this.status == other.status &&
this.outputFileId == other.outputFileId &&
this.errorFileId == other.errorFileId &&
this.createdAt == other.createdAt &&
this.inProgressAt == other.inProgressAt &&
this.expiresAt == other.expiresAt &&
this.finalizingAt == other.finalizingAt &&
this.completedAt == other.completedAt &&
this.failedAt == other.failedAt &&
this.expiredAt == other.expiredAt &&
this.cancellingAt == other.cancellingAt &&
this.cancelledAt == other.cancelledAt &&
this.requestCounts == other.requestCounts &&
this.metadata == other.metadata &&
this.additionalProperties == other.additionalProperties
}

private var hashCode: Int = 0

override fun hashCode(): Int {
if (hashCode == 0) {
hashCode =
Objects.hash(
id,
object_,
endpoint,
errors,
inputFileId,
completionWindow,
status,
outputFileId,
errorFileId,
createdAt,
inProgressAt,
expiresAt,
finalizingAt,
completedAt,
failedAt,
expiredAt,
cancellingAt,
cancelledAt,
requestCounts,
metadata,
additionalProperties,
)
}
return hashCode
}

override fun toString() =
"Batch{id=$id, object_=$object_, endpoint=$endpoint, errors=$errors, inputFileId=$inputFileId, completionWindow=$completionWindow, status=$status, outputFileId=$outputFileId, errorFileId=$errorFileId, createdAt=$createdAt, inProgressAt=$inProgressAt, expiresAt=$expiresAt, finalizingAt=$finalizingAt, completedAt=$completedAt, failedAt=$failedAt, expiredAt=$expiredAt, cancellingAt=$cancellingAt, cancelledAt=$cancelledAt, requestCounts=$requestCounts, metadata=$metadata, additionalProperties=$additionalProperties}"
}
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,6 @@ constructor(
private val additionalProperties: Map<String, JsonValue>,
) {

private var hashCode: Int = 0

/**
* The time frame within which the batch should be processed. Currently only `24h` is
* supported.
Expand Down Expand Up @@ -102,36 +100,6 @@ constructor(

fun toBuilder() = Builder().from(this)

override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}

return other is BatchCreateBody &&
this.completionWindow == other.completionWindow &&
this.endpoint == other.endpoint &&
this.inputFileId == other.inputFileId &&
this.metadata == other.metadata &&
this.additionalProperties == other.additionalProperties
}

override fun hashCode(): Int {
if (hashCode == 0) {
hashCode =
Objects.hash(
completionWindow,
endpoint,
inputFileId,
metadata,
additionalProperties,
)
}
return hashCode
}

override fun toString() =
"BatchCreateBody{completionWindow=$completionWindow, endpoint=$endpoint, inputFileId=$inputFileId, metadata=$metadata, additionalProperties=$additionalProperties}"

companion object {

@JvmStatic fun builder() = Builder()
Expand Down Expand Up @@ -215,6 +183,38 @@ constructor(
additionalProperties.toUnmodifiable(),
)
}

override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}

return other is BatchCreateBody &&
this.completionWindow == other.completionWindow &&
this.endpoint == other.endpoint &&
this.inputFileId == other.inputFileId &&
this.metadata == other.metadata &&
this.additionalProperties == other.additionalProperties
}

private var hashCode: Int = 0

override fun hashCode(): Int {
if (hashCode == 0) {
hashCode =
Objects.hash(
completionWindow,
endpoint,
inputFileId,
metadata,
additionalProperties,
)
}
return hashCode
}

override fun toString() =
"BatchCreateBody{completionWindow=$completionWindow, endpoint=$endpoint, inputFileId=$inputFileId, metadata=$metadata, additionalProperties=$additionalProperties}"
}

fun _additionalQueryParams(): Map<String, List<String>> = additionalQueryParams
Expand Down Expand Up @@ -502,31 +502,12 @@ constructor(
private val additionalProperties: Map<String, JsonValue>,
) {

private var hashCode: Int = 0

@JsonAnyGetter
@ExcludeMissing
fun _additionalProperties(): Map<String, JsonValue> = 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()
Expand Down Expand Up @@ -557,5 +538,24 @@ constructor(

fun build(): Metadata = Metadata(additionalProperties.toUnmodifiable())
}

override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}

return other is Metadata && this.additionalProperties == other.additionalProperties
}

private var hashCode: Int = 0

override fun hashCode(): Int {
if (hashCode == 0) {
hashCode = Objects.hash(additionalProperties)
}
return hashCode
}

override fun toString() = "Metadata{additionalProperties=$additionalProperties}"
}
}
Loading

0 comments on commit 9ec34a8

Please sign in to comment.