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

commonMain.aws.sdk.kotlin.services.qldbsession.model.SendCommandRequest.kt Maven / Gradle / Ivy

There is a newer version: 1.3.37
Show newest version
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.qldbsession.model

import aws.smithy.kotlin.runtime.SdkDsl

public class SendCommandRequest private constructor(builder: Builder) {
    /**
     * Command to abort the current transaction.
     */
    public val abortTransaction: aws.sdk.kotlin.services.qldbsession.model.AbortTransactionRequest? = builder.abortTransaction
    /**
     * Command to commit the specified transaction.
     */
    public val commitTransaction: aws.sdk.kotlin.services.qldbsession.model.CommitTransactionRequest? = builder.commitTransaction
    /**
     * Command to end the current session.
     */
    public val endSession: aws.sdk.kotlin.services.qldbsession.model.EndSessionRequest? = builder.endSession
    /**
     * Command to execute a statement in the specified transaction.
     */
    public val executeStatement: aws.sdk.kotlin.services.qldbsession.model.ExecuteStatementRequest? = builder.executeStatement
    /**
     * Command to fetch a page.
     */
    public val fetchPage: aws.sdk.kotlin.services.qldbsession.model.FetchPageRequest? = builder.fetchPage
    /**
     * Specifies the session token for the current command. A session token is constant throughout the life of the session.
     *
     * To obtain a session token, run the `StartSession` command. This `SessionToken` is required for every subsequent command that is issued during the current session.
     */
    public val sessionToken: kotlin.String? = builder.sessionToken
    /**
     * Command to start a new session. A session token is obtained as part of the response.
     */
    public val startSession: aws.sdk.kotlin.services.qldbsession.model.StartSessionRequest? = builder.startSession
    /**
     * Command to start a new transaction.
     */
    public val startTransaction: aws.sdk.kotlin.services.qldbsession.model.StartTransactionRequest? = builder.startTransaction

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

    override fun toString(): kotlin.String = buildString {
        append("SendCommandRequest(")
        append("abortTransaction=$abortTransaction,")
        append("commitTransaction=$commitTransaction,")
        append("endSession=$endSession,")
        append("executeStatement=$executeStatement,")
        append("fetchPage=$fetchPage,")
        append("sessionToken=$sessionToken,")
        append("startSession=$startSession,")
        append("startTransaction=$startTransaction")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = abortTransaction?.hashCode() ?: 0
        result = 31 * result + (commitTransaction?.hashCode() ?: 0)
        result = 31 * result + (endSession?.hashCode() ?: 0)
        result = 31 * result + (executeStatement?.hashCode() ?: 0)
        result = 31 * result + (fetchPage?.hashCode() ?: 0)
        result = 31 * result + (sessionToken?.hashCode() ?: 0)
        result = 31 * result + (startSession?.hashCode() ?: 0)
        result = 31 * result + (startTransaction?.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 SendCommandRequest

        if (abortTransaction != other.abortTransaction) return false
        if (commitTransaction != other.commitTransaction) return false
        if (endSession != other.endSession) return false
        if (executeStatement != other.executeStatement) return false
        if (fetchPage != other.fetchPage) return false
        if (sessionToken != other.sessionToken) return false
        if (startSession != other.startSession) return false
        if (startTransaction != other.startTransaction) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * Command to abort the current transaction.
         */
        public var abortTransaction: aws.sdk.kotlin.services.qldbsession.model.AbortTransactionRequest? = null
        /**
         * Command to commit the specified transaction.
         */
        public var commitTransaction: aws.sdk.kotlin.services.qldbsession.model.CommitTransactionRequest? = null
        /**
         * Command to end the current session.
         */
        public var endSession: aws.sdk.kotlin.services.qldbsession.model.EndSessionRequest? = null
        /**
         * Command to execute a statement in the specified transaction.
         */
        public var executeStatement: aws.sdk.kotlin.services.qldbsession.model.ExecuteStatementRequest? = null
        /**
         * Command to fetch a page.
         */
        public var fetchPage: aws.sdk.kotlin.services.qldbsession.model.FetchPageRequest? = null
        /**
         * Specifies the session token for the current command. A session token is constant throughout the life of the session.
         *
         * To obtain a session token, run the `StartSession` command. This `SessionToken` is required for every subsequent command that is issued during the current session.
         */
        public var sessionToken: kotlin.String? = null
        /**
         * Command to start a new session. A session token is obtained as part of the response.
         */
        public var startSession: aws.sdk.kotlin.services.qldbsession.model.StartSessionRequest? = null
        /**
         * Command to start a new transaction.
         */
        public var startTransaction: aws.sdk.kotlin.services.qldbsession.model.StartTransactionRequest? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.qldbsession.model.SendCommandRequest) : this() {
            this.abortTransaction = x.abortTransaction
            this.commitTransaction = x.commitTransaction
            this.endSession = x.endSession
            this.executeStatement = x.executeStatement
            this.fetchPage = x.fetchPage
            this.sessionToken = x.sessionToken
            this.startSession = x.startSession
            this.startTransaction = x.startTransaction
        }

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

        /**
         * construct an [aws.sdk.kotlin.services.qldbsession.model.AbortTransactionRequest] inside the given [block]
         */
        public fun abortTransaction(block: aws.sdk.kotlin.services.qldbsession.model.AbortTransactionRequest.Builder.() -> kotlin.Unit) {
            this.abortTransaction = aws.sdk.kotlin.services.qldbsession.model.AbortTransactionRequest.invoke(block)
        }

        /**
         * construct an [aws.sdk.kotlin.services.qldbsession.model.CommitTransactionRequest] inside the given [block]
         */
        public fun commitTransaction(block: aws.sdk.kotlin.services.qldbsession.model.CommitTransactionRequest.Builder.() -> kotlin.Unit) {
            this.commitTransaction = aws.sdk.kotlin.services.qldbsession.model.CommitTransactionRequest.invoke(block)
        }

        /**
         * construct an [aws.sdk.kotlin.services.qldbsession.model.EndSessionRequest] inside the given [block]
         */
        public fun endSession(block: aws.sdk.kotlin.services.qldbsession.model.EndSessionRequest.Builder.() -> kotlin.Unit) {
            this.endSession = aws.sdk.kotlin.services.qldbsession.model.EndSessionRequest.invoke(block)
        }

        /**
         * construct an [aws.sdk.kotlin.services.qldbsession.model.ExecuteStatementRequest] inside the given [block]
         */
        public fun executeStatement(block: aws.sdk.kotlin.services.qldbsession.model.ExecuteStatementRequest.Builder.() -> kotlin.Unit) {
            this.executeStatement = aws.sdk.kotlin.services.qldbsession.model.ExecuteStatementRequest.invoke(block)
        }

        /**
         * construct an [aws.sdk.kotlin.services.qldbsession.model.FetchPageRequest] inside the given [block]
         */
        public fun fetchPage(block: aws.sdk.kotlin.services.qldbsession.model.FetchPageRequest.Builder.() -> kotlin.Unit) {
            this.fetchPage = aws.sdk.kotlin.services.qldbsession.model.FetchPageRequest.invoke(block)
        }

        /**
         * construct an [aws.sdk.kotlin.services.qldbsession.model.StartSessionRequest] inside the given [block]
         */
        public fun startSession(block: aws.sdk.kotlin.services.qldbsession.model.StartSessionRequest.Builder.() -> kotlin.Unit) {
            this.startSession = aws.sdk.kotlin.services.qldbsession.model.StartSessionRequest.invoke(block)
        }

        /**
         * construct an [aws.sdk.kotlin.services.qldbsession.model.StartTransactionRequest] inside the given [block]
         */
        public fun startTransaction(block: aws.sdk.kotlin.services.qldbsession.model.StartTransactionRequest.Builder.() -> kotlin.Unit) {
            this.startTransaction = aws.sdk.kotlin.services.qldbsession.model.StartTransactionRequest.invoke(block)
        }

        internal fun correctErrors(): Builder {
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy