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

commonMain.aws.sdk.kotlin.services.cleanrooms.model.StartProtectedQueryRequest.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.cleanrooms.model

import aws.smithy.kotlin.runtime.SdkDsl

public class StartProtectedQueryRequest private constructor(builder: Builder) {
    /**
     * A unique identifier for the membership to run this query against. Currently accepts a membership ID.
     */
    public val membershipIdentifier: kotlin.String = requireNotNull(builder.membershipIdentifier) { "A non-null value must be provided for membershipIdentifier" }
    /**
     * The details needed to write the query results.
     */
    public val resultConfiguration: aws.sdk.kotlin.services.cleanrooms.model.ProtectedQueryResultConfiguration? = builder.resultConfiguration
    /**
     * The protected SQL query parameters.
     */
    public val sqlParameters: aws.sdk.kotlin.services.cleanrooms.model.ProtectedQuerySqlParameters? = builder.sqlParameters
    /**
     * The type of the protected query to be started.
     */
    public val type: aws.sdk.kotlin.services.cleanrooms.model.ProtectedQueryType = requireNotNull(builder.type) { "A non-null value must be provided for type" }

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

    override fun toString(): kotlin.String = buildString {
        append("StartProtectedQueryRequest(")
        append("membershipIdentifier=$membershipIdentifier,")
        append("resultConfiguration=$resultConfiguration,")
        append("sqlParameters=*** Sensitive Data Redacted ***,")
        append("type=$type")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = membershipIdentifier.hashCode()
        result = 31 * result + (resultConfiguration?.hashCode() ?: 0)
        result = 31 * result + (sqlParameters?.hashCode() ?: 0)
        result = 31 * result + (type.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 StartProtectedQueryRequest

        if (membershipIdentifier != other.membershipIdentifier) return false
        if (resultConfiguration != other.resultConfiguration) return false
        if (sqlParameters != other.sqlParameters) return false
        if (type != other.type) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * A unique identifier for the membership to run this query against. Currently accepts a membership ID.
         */
        public var membershipIdentifier: kotlin.String? = null
        /**
         * The details needed to write the query results.
         */
        public var resultConfiguration: aws.sdk.kotlin.services.cleanrooms.model.ProtectedQueryResultConfiguration? = null
        /**
         * The protected SQL query parameters.
         */
        public var sqlParameters: aws.sdk.kotlin.services.cleanrooms.model.ProtectedQuerySqlParameters? = null
        /**
         * The type of the protected query to be started.
         */
        public var type: aws.sdk.kotlin.services.cleanrooms.model.ProtectedQueryType? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.cleanrooms.model.StartProtectedQueryRequest) : this() {
            this.membershipIdentifier = x.membershipIdentifier
            this.resultConfiguration = x.resultConfiguration
            this.sqlParameters = x.sqlParameters
            this.type = x.type
        }

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

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

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

        internal fun correctErrors(): Builder {
            if (membershipIdentifier == null) membershipIdentifier = ""
            if (type == null) type = ProtectedQueryType.SdkUnknown("no value provided")
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy