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

commonMain.aws.sdk.kotlin.services.timestreamquery.model.QueryResponse.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.timestreamquery.model

import aws.smithy.kotlin.runtime.SdkDsl

public class QueryResponse private constructor(builder: Builder) {
    /**
     * The column data types of the returned result set.
     */
    public val columnInfo: List = requireNotNull(builder.columnInfo) { "A non-null value must be provided for columnInfo" }
    /**
     * A pagination token that can be used again on a `Query` call to get the next set of results.
     */
    public val nextToken: kotlin.String? = builder.nextToken
    /**
     * A unique ID for the given query.
     */
    public val queryId: kotlin.String = requireNotNull(builder.queryId) { "A non-null value must be provided for queryId" }
    /**
     * Information about the status of the query, including progress and bytes scanned.
     */
    public val queryStatus: aws.sdk.kotlin.services.timestreamquery.model.QueryStatus? = builder.queryStatus
    /**
     * The result set rows returned by the query.
     */
    public val rows: List = requireNotNull(builder.rows) { "A non-null value must be provided for rows" }

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

    override fun toString(): kotlin.String = buildString {
        append("QueryResponse(")
        append("columnInfo=$columnInfo,")
        append("nextToken=$nextToken,")
        append("queryId=$queryId,")
        append("queryStatus=$queryStatus,")
        append("rows=$rows")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = columnInfo.hashCode()
        result = 31 * result + (nextToken?.hashCode() ?: 0)
        result = 31 * result + (queryId.hashCode())
        result = 31 * result + (queryStatus?.hashCode() ?: 0)
        result = 31 * result + (rows.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 QueryResponse

        if (columnInfo != other.columnInfo) return false
        if (nextToken != other.nextToken) return false
        if (queryId != other.queryId) return false
        if (queryStatus != other.queryStatus) return false
        if (rows != other.rows) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The column data types of the returned result set.
         */
        public var columnInfo: List? = null
        /**
         * A pagination token that can be used again on a `Query` call to get the next set of results.
         */
        public var nextToken: kotlin.String? = null
        /**
         * A unique ID for the given query.
         */
        public var queryId: kotlin.String? = null
        /**
         * Information about the status of the query, including progress and bytes scanned.
         */
        public var queryStatus: aws.sdk.kotlin.services.timestreamquery.model.QueryStatus? = null
        /**
         * The result set rows returned by the query.
         */
        public var rows: List? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.timestreamquery.model.QueryResponse) : this() {
            this.columnInfo = x.columnInfo
            this.nextToken = x.nextToken
            this.queryId = x.queryId
            this.queryStatus = x.queryStatus
            this.rows = x.rows
        }

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

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

        internal fun correctErrors(): Builder {
            if (columnInfo == null) columnInfo = emptyList()
            if (queryId == null) queryId = ""
            if (rows == null) rows = emptyList()
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy