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

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

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

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



public class ExecuteStatementRequest private constructor(builder: Builder) {
    /**
     * A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.
     */
    public val clientToken: kotlin.String? = builder.clientToken
    /**
     * The cluster identifier. This parameter is required when connecting to a cluster and authenticating using either Secrets Manager or temporary credentials.
     */
    public val clusterIdentifier: kotlin.String? = builder.clusterIdentifier
    /**
     * The name of the database. This parameter is required when authenticating using either Secrets Manager or temporary credentials.
     */
    public val database: kotlin.String = requireNotNull(builder.database) { "A non-null value must be provided for database" }
    /**
     * The database user name. This parameter is required when connecting to a cluster as a database user and authenticating using temporary credentials.
     */
    public val dbUser: kotlin.String? = builder.dbUser
    /**
     * The parameters for the SQL statement.
     */
    public val parameters: List? = builder.parameters
    /**
     * The name or ARN of the secret that enables access to the database. This parameter is required when authenticating using Secrets Manager.
     */
    public val secretArn: kotlin.String? = builder.secretArn
    /**
     * The SQL statement text to run.
     */
    public val sql: kotlin.String = requireNotNull(builder.sql) { "A non-null value must be provided for sql" }
    /**
     * The name of the SQL statement. You can name the SQL statement when you create it to identify the query.
     */
    public val statementName: kotlin.String? = builder.statementName
    /**
     * A value that indicates whether to send an event to the Amazon EventBridge event bus after the SQL statement runs.
     */
    public val withEvent: kotlin.Boolean? = builder.withEvent
    /**
     * The serverless workgroup name or Amazon Resource Name (ARN). This parameter is required when connecting to a serverless workgroup and authenticating using either Secrets Manager or temporary credentials.
     */
    public val workgroupName: kotlin.String? = builder.workgroupName

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

    override fun toString(): kotlin.String = buildString {
        append("ExecuteStatementRequest(")
        append("clientToken=$clientToken,")
        append("clusterIdentifier=$clusterIdentifier,")
        append("database=$database,")
        append("dbUser=$dbUser,")
        append("parameters=$parameters,")
        append("secretArn=$secretArn,")
        append("sql=$sql,")
        append("statementName=$statementName,")
        append("withEvent=$withEvent,")
        append("workgroupName=$workgroupName")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = clientToken?.hashCode() ?: 0
        result = 31 * result + (clusterIdentifier?.hashCode() ?: 0)
        result = 31 * result + (database.hashCode())
        result = 31 * result + (dbUser?.hashCode() ?: 0)
        result = 31 * result + (parameters?.hashCode() ?: 0)
        result = 31 * result + (secretArn?.hashCode() ?: 0)
        result = 31 * result + (sql.hashCode())
        result = 31 * result + (statementName?.hashCode() ?: 0)
        result = 31 * result + (withEvent?.hashCode() ?: 0)
        result = 31 * result + (workgroupName?.hashCode() ?: 0)
        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 ExecuteStatementRequest

        if (clientToken != other.clientToken) return false
        if (clusterIdentifier != other.clusterIdentifier) return false
        if (database != other.database) return false
        if (dbUser != other.dbUser) return false
        if (parameters != other.parameters) return false
        if (secretArn != other.secretArn) return false
        if (sql != other.sql) return false
        if (statementName != other.statementName) return false
        if (withEvent != other.withEvent) return false
        if (workgroupName != other.workgroupName) return false

        return true
    }

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

    public class Builder {
        /**
         * A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.
         */
        public var clientToken: kotlin.String? = null
        /**
         * The cluster identifier. This parameter is required when connecting to a cluster and authenticating using either Secrets Manager or temporary credentials.
         */
        public var clusterIdentifier: kotlin.String? = null
        /**
         * The name of the database. This parameter is required when authenticating using either Secrets Manager or temporary credentials.
         */
        public var database: kotlin.String? = null
        /**
         * The database user name. This parameter is required when connecting to a cluster as a database user and authenticating using temporary credentials.
         */
        public var dbUser: kotlin.String? = null
        /**
         * The parameters for the SQL statement.
         */
        public var parameters: List? = null
        /**
         * The name or ARN of the secret that enables access to the database. This parameter is required when authenticating using Secrets Manager.
         */
        public var secretArn: kotlin.String? = null
        /**
         * The SQL statement text to run.
         */
        public var sql: kotlin.String? = null
        /**
         * The name of the SQL statement. You can name the SQL statement when you create it to identify the query.
         */
        public var statementName: kotlin.String? = null
        /**
         * A value that indicates whether to send an event to the Amazon EventBridge event bus after the SQL statement runs.
         */
        public var withEvent: kotlin.Boolean? = null
        /**
         * The serverless workgroup name or Amazon Resource Name (ARN). This parameter is required when connecting to a serverless workgroup and authenticating using either Secrets Manager or temporary credentials.
         */
        public var workgroupName: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.redshiftdata.model.ExecuteStatementRequest) : this() {
            this.clientToken = x.clientToken
            this.clusterIdentifier = x.clusterIdentifier
            this.database = x.database
            this.dbUser = x.dbUser
            this.parameters = x.parameters
            this.secretArn = x.secretArn
            this.sql = x.sql
            this.statementName = x.statementName
            this.withEvent = x.withEvent
            this.workgroupName = x.workgroupName
        }

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

        internal fun correctErrors(): Builder {
            if (database == null) database = ""
            if (sql == null) sql = ""
            return this
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy