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

commonMain.aws.sdk.kotlin.services.cleanrooms.model.AnalysisRule.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
import aws.smithy.kotlin.runtime.time.Instant

/**
 * A specification about how data from the configured table can be used in a query.
 */
public class AnalysisRule private constructor(builder: Builder) {
    /**
     * The unique ID for the associated collaboration.
     */
    public val collaborationId: kotlin.String = requireNotNull(builder.collaborationId) { "A non-null value must be provided for collaborationId" }
    /**
     * The time the analysis rule was created.
     */
    public val createTime: aws.smithy.kotlin.runtime.time.Instant = requireNotNull(builder.createTime) { "A non-null value must be provided for createTime" }
    /**
     * The name for the analysis rule.
     */
    public val name: kotlin.String = requireNotNull(builder.name) { "A non-null value must be provided for name" }
    /**
     * A policy that describes the associated data usage limitations.
     */
    public val policy: aws.sdk.kotlin.services.cleanrooms.model.AnalysisRulePolicy? = builder.policy
    /**
     * The type of analysis rule.
     */
    public val type: aws.sdk.kotlin.services.cleanrooms.model.AnalysisRuleType = requireNotNull(builder.type) { "A non-null value must be provided for type" }
    /**
     * The time the analysis rule was last updated.
     */
    public val updateTime: aws.smithy.kotlin.runtime.time.Instant = requireNotNull(builder.updateTime) { "A non-null value must be provided for updateTime" }

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

    override fun toString(): kotlin.String = buildString {
        append("AnalysisRule(")
        append("collaborationId=$collaborationId,")
        append("createTime=$createTime,")
        append("name=$name,")
        append("policy=$policy,")
        append("type=$type,")
        append("updateTime=$updateTime")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = collaborationId.hashCode()
        result = 31 * result + (createTime.hashCode())
        result = 31 * result + (name.hashCode())
        result = 31 * result + (policy?.hashCode() ?: 0)
        result = 31 * result + (type.hashCode())
        result = 31 * result + (updateTime.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 AnalysisRule

        if (collaborationId != other.collaborationId) return false
        if (createTime != other.createTime) return false
        if (name != other.name) return false
        if (policy != other.policy) return false
        if (type != other.type) return false
        if (updateTime != other.updateTime) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The unique ID for the associated collaboration.
         */
        public var collaborationId: kotlin.String? = null
        /**
         * The time the analysis rule was created.
         */
        public var createTime: aws.smithy.kotlin.runtime.time.Instant? = null
        /**
         * The name for the analysis rule.
         */
        public var name: kotlin.String? = null
        /**
         * A policy that describes the associated data usage limitations.
         */
        public var policy: aws.sdk.kotlin.services.cleanrooms.model.AnalysisRulePolicy? = null
        /**
         * The type of analysis rule.
         */
        public var type: aws.sdk.kotlin.services.cleanrooms.model.AnalysisRuleType? = null
        /**
         * The time the analysis rule was last updated.
         */
        public var updateTime: aws.smithy.kotlin.runtime.time.Instant? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.cleanrooms.model.AnalysisRule) : this() {
            this.collaborationId = x.collaborationId
            this.createTime = x.createTime
            this.name = x.name
            this.policy = x.policy
            this.type = x.type
            this.updateTime = x.updateTime
        }

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

        internal fun correctErrors(): Builder {
            if (collaborationId == null) collaborationId = ""
            if (createTime == null) createTime = Instant.fromEpochSeconds(0)
            if (name == null) name = ""
            if (type == null) type = AnalysisRuleType.SdkUnknown("no value provided")
            if (updateTime == null) updateTime = Instant.fromEpochSeconds(0)
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy