/*
 * JSONRPCError.kt
 *
 * This code was generated by json-kotlin-schema-codegen - JSON Schema Code Generator
 * See https://github.com/pwall567/json-kotlin-schema-codegen
 *
 * It is not advisable to modify generated code as any modifications will be lost
 * when the generation process is re-run.
 *
 * This was generated from A2A Schema: https://raw.githubusercontent.com/google/A2A/refs/heads/main/specification/json/a2a.json
 */
package dev.mokksy.aimocks.a2a.model

import kotlinx.serialization.Contextual
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable

@Serializable
public open class JSONRPCError(
    @SerialName("code")
    public val code: Long,
    @SerialName("message")
    public val message: String,
    @SerialName("data")
    @Contextual
    public val data: Data? = null,
) {
    override fun equals(other: Any?): Boolean {
        if (this === other) return true
        if (other !is JSONRPCError) return false
        if (other.javaClass != this.javaClass) return false

        if (code != other.code) return false
        if (message != other.message) return false
        if (data != other.data) return false

        return true
    }

    override fun hashCode(): Int {
        var result = code.hashCode()
        result = 31 * result + javaClass.hashCode()
        result = 31 * result + message.hashCode()
        result = 31 * result + (data?.hashCode() ?: 0)
        return result
    }

    override fun toString(): String = "JSONRPCError(message='$message', code=$code, data=$data)"
}
