All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.aws.sdk.kotlin.services.redshiftdata.model.BatchExecuteStatementException.kt Maven / Gradle / Ivy

// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.redshiftdata.model

import aws.smithy.kotlin.runtime.ServiceErrorMetadata

/**
 * An SQL statement encountered an environmental error while running.
 */
public class BatchExecuteStatementException private constructor(builder: Builder) : RedshiftDataException() {

    override val message: kotlin.String = requireNotNull(builder.message) { "A non-null value must be provided for message" }
    /**
     * Statement identifier of the exception.
     */
    public val statementId: kotlin.String = requireNotNull(builder.statementId) { "A non-null value must be provided for statementId" }

    init {
        sdkErrorMetadata.attributes[ServiceErrorMetadata.ErrorType] = ErrorType.Server
    }

    public companion object {
        public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.redshiftdata.model.BatchExecuteStatementException = Builder().apply(block).build()
    }

    override fun toString(): kotlin.String = buildString {
        append("BatchExecuteStatementException(")
        append("message=$message,")
        append("statementId=$statementId")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = message.hashCode()
        result = 31 * result + (statementId.hashCode())
        return result
    }

    override fun equals(other: kotlin.Any?): kotlin.Boolean {
        if (this === other) return true
        if (other == null || this::class != other::class) return false

        other as BatchExecuteStatementException

        if (message != other.message) return false
        if (statementId != other.statementId) return false

        return true
    }

    public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.redshiftdata.model.BatchExecuteStatementException = Builder(this).apply(block).build()

    public class Builder {
        public var message: kotlin.String? = null
        /**
         * Statement identifier of the exception.
         */
        public var statementId: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.redshiftdata.model.BatchExecuteStatementException) : this() {
            this.message = x.message
            this.statementId = x.statementId
        }

        @PublishedApi
        internal fun build(): aws.sdk.kotlin.services.redshiftdata.model.BatchExecuteStatementException = BatchExecuteStatementException(this)

        internal fun correctErrors(): Builder {
            if (message == null) message = ""
            if (statementId == null) statementId = ""
            return this
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy