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

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

There is a newer version: 1.3.31
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

/**
 * A type of analysis rule that enables the table owner to approve custom SQL queries on their configured tables. It supports differential privacy.
 */
public class AnalysisRuleCustom private constructor(builder: Builder) {
    /**
     * An indicator as to whether additional analyses (such as Clean Rooms ML) can be applied to the output of the direct query.
     */
    public val additionalAnalyses: aws.sdk.kotlin.services.cleanrooms.model.AdditionalAnalyses? = builder.additionalAnalyses
    /**
     * The ARN of the analysis templates that are allowed by the custom analysis rule.
     */
    public val allowedAnalyses: List = requireNotNull(builder.allowedAnalyses) { "A non-null value must be provided for allowedAnalyses" }
    /**
     * The IDs of the Amazon Web Services accounts that are allowed to query by the custom analysis rule. Required when `allowedAnalyses` is `ANY_QUERY`.
     */
    public val allowedAnalysisProviders: List? = builder.allowedAnalysisProviders
    /**
     * The differential privacy configuration.
     */
    public val differentialPrivacy: aws.sdk.kotlin.services.cleanrooms.model.DifferentialPrivacyConfiguration? = builder.differentialPrivacy
    /**
     * A list of columns that aren't allowed to be shown in the query output.
     */
    public val disallowedOutputColumns: List? = builder.disallowedOutputColumns

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

    override fun toString(): kotlin.String = buildString {
        append("AnalysisRuleCustom(")
        append("additionalAnalyses=$additionalAnalyses,")
        append("allowedAnalyses=$allowedAnalyses,")
        append("allowedAnalysisProviders=$allowedAnalysisProviders,")
        append("differentialPrivacy=$differentialPrivacy,")
        append("disallowedOutputColumns=$disallowedOutputColumns")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = additionalAnalyses?.hashCode() ?: 0
        result = 31 * result + (allowedAnalyses.hashCode())
        result = 31 * result + (allowedAnalysisProviders?.hashCode() ?: 0)
        result = 31 * result + (differentialPrivacy?.hashCode() ?: 0)
        result = 31 * result + (disallowedOutputColumns?.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 AnalysisRuleCustom

        if (additionalAnalyses != other.additionalAnalyses) return false
        if (allowedAnalyses != other.allowedAnalyses) return false
        if (allowedAnalysisProviders != other.allowedAnalysisProviders) return false
        if (differentialPrivacy != other.differentialPrivacy) return false
        if (disallowedOutputColumns != other.disallowedOutputColumns) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * An indicator as to whether additional analyses (such as Clean Rooms ML) can be applied to the output of the direct query.
         */
        public var additionalAnalyses: aws.sdk.kotlin.services.cleanrooms.model.AdditionalAnalyses? = null
        /**
         * The ARN of the analysis templates that are allowed by the custom analysis rule.
         */
        public var allowedAnalyses: List? = null
        /**
         * The IDs of the Amazon Web Services accounts that are allowed to query by the custom analysis rule. Required when `allowedAnalyses` is `ANY_QUERY`.
         */
        public var allowedAnalysisProviders: List? = null
        /**
         * The differential privacy configuration.
         */
        public var differentialPrivacy: aws.sdk.kotlin.services.cleanrooms.model.DifferentialPrivacyConfiguration? = null
        /**
         * A list of columns that aren't allowed to be shown in the query output.
         */
        public var disallowedOutputColumns: List? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.cleanrooms.model.AnalysisRuleCustom) : this() {
            this.additionalAnalyses = x.additionalAnalyses
            this.allowedAnalyses = x.allowedAnalyses
            this.allowedAnalysisProviders = x.allowedAnalysisProviders
            this.differentialPrivacy = x.differentialPrivacy
            this.disallowedOutputColumns = x.disallowedOutputColumns
        }

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

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

        internal fun correctErrors(): Builder {
            if (allowedAnalyses == null) allowedAnalyses = emptyList()
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy