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

commonMain.aws.sdk.kotlin.services.cleanrooms.model.Schema.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 schema is a relation within a collaboration.
 */
public class Schema private constructor(builder: Builder) {
    /**
     * The analysis method for the schema. The only valid value is currently DIRECT_QUERY.
     */
    public val analysisMethod: aws.sdk.kotlin.services.cleanrooms.model.AnalysisMethod? = builder.analysisMethod
    /**
     * The analysis rule types associated with the schema. Currently, only one entry is present.
     */
    public val analysisRuleTypes: List = requireNotNull(builder.analysisRuleTypes) { "A non-null value must be provided for analysisRuleTypes" }
    /**
     * The unique ARN for the collaboration that the schema belongs to.
     */
    public val collaborationArn: kotlin.String = requireNotNull(builder.collaborationArn) { "A non-null value must be provided for collaborationArn" }
    /**
     * The unique ID for the collaboration that the schema belongs to.
     */
    public val collaborationId: kotlin.String = requireNotNull(builder.collaborationId) { "A non-null value must be provided for collaborationId" }
    /**
     * The columns for the relation this schema represents.
     */
    public val columns: List = requireNotNull(builder.columns) { "A non-null value must be provided for columns" }
    /**
     * The time the schema was created.
     */
    public val createTime: aws.smithy.kotlin.runtime.time.Instant = requireNotNull(builder.createTime) { "A non-null value must be provided for createTime" }
    /**
     * The unique account ID for the Amazon Web Services account that owns the schema.
     */
    public val creatorAccountId: kotlin.String = requireNotNull(builder.creatorAccountId) { "A non-null value must be provided for creatorAccountId" }
    /**
     * A description for the schema.
     */
    public val description: kotlin.String = requireNotNull(builder.description) { "A non-null value must be provided for description" }
    /**
     * A name for the schema. The schema relation is referred to by this name when queried by a protected query.
     */
    public val name: kotlin.String = requireNotNull(builder.name) { "A non-null value must be provided for name" }
    /**
     * The partition keys for the dataset underlying this schema.
     */
    public val partitionKeys: List = requireNotNull(builder.partitionKeys) { "A non-null value must be provided for partitionKeys" }
    /**
     * Details about the status of the schema. Currently, only one entry is present.
     */
    public val schemaStatusDetails: List = builder.schemaStatusDetails
    /**
     * The schema type properties.
     */
    public val schemaTypeProperties: aws.sdk.kotlin.services.cleanrooms.model.SchemaTypeProperties? = builder.schemaTypeProperties
    /**
     * The type of schema. The only valid value is currently `TABLE`.
     */
    public val type: aws.sdk.kotlin.services.cleanrooms.model.SchemaType = requireNotNull(builder.type) { "A non-null value must be provided for type" }
    /**
     * The time the schema 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.Schema = Builder().apply(block).build()
    }

    override fun toString(): kotlin.String = buildString {
        append("Schema(")
        append("analysisMethod=$analysisMethod,")
        append("analysisRuleTypes=$analysisRuleTypes,")
        append("collaborationArn=$collaborationArn,")
        append("collaborationId=$collaborationId,")
        append("columns=$columns,")
        append("createTime=$createTime,")
        append("creatorAccountId=$creatorAccountId,")
        append("description=$description,")
        append("name=$name,")
        append("partitionKeys=$partitionKeys,")
        append("schemaStatusDetails=$schemaStatusDetails,")
        append("schemaTypeProperties=$schemaTypeProperties,")
        append("type=$type,")
        append("updateTime=$updateTime")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = analysisMethod?.hashCode() ?: 0
        result = 31 * result + (analysisRuleTypes.hashCode())
        result = 31 * result + (collaborationArn.hashCode())
        result = 31 * result + (collaborationId.hashCode())
        result = 31 * result + (columns.hashCode())
        result = 31 * result + (createTime.hashCode())
        result = 31 * result + (creatorAccountId.hashCode())
        result = 31 * result + (description.hashCode())
        result = 31 * result + (name.hashCode())
        result = 31 * result + (partitionKeys.hashCode())
        result = 31 * result + (schemaStatusDetails.hashCode())
        result = 31 * result + (schemaTypeProperties?.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 Schema

        if (analysisMethod != other.analysisMethod) return false
        if (analysisRuleTypes != other.analysisRuleTypes) return false
        if (collaborationArn != other.collaborationArn) return false
        if (collaborationId != other.collaborationId) return false
        if (columns != other.columns) return false
        if (createTime != other.createTime) return false
        if (creatorAccountId != other.creatorAccountId) return false
        if (description != other.description) return false
        if (name != other.name) return false
        if (partitionKeys != other.partitionKeys) return false
        if (schemaStatusDetails != other.schemaStatusDetails) return false
        if (schemaTypeProperties != other.schemaTypeProperties) 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.Schema = Builder(this).apply(block).build()

    @SdkDsl
    public class Builder {
        /**
         * The analysis method for the schema. The only valid value is currently DIRECT_QUERY.
         */
        public var analysisMethod: aws.sdk.kotlin.services.cleanrooms.model.AnalysisMethod? = null
        /**
         * The analysis rule types associated with the schema. Currently, only one entry is present.
         */
        public var analysisRuleTypes: List? = null
        /**
         * The unique ARN for the collaboration that the schema belongs to.
         */
        public var collaborationArn: kotlin.String? = null
        /**
         * The unique ID for the collaboration that the schema belongs to.
         */
        public var collaborationId: kotlin.String? = null
        /**
         * The columns for the relation this schema represents.
         */
        public var columns: List? = null
        /**
         * The time the schema was created.
         */
        public var createTime: aws.smithy.kotlin.runtime.time.Instant? = null
        /**
         * The unique account ID for the Amazon Web Services account that owns the schema.
         */
        public var creatorAccountId: kotlin.String? = null
        /**
         * A description for the schema.
         */
        public var description: kotlin.String? = null
        /**
         * A name for the schema. The schema relation is referred to by this name when queried by a protected query.
         */
        public var name: kotlin.String? = null
        /**
         * The partition keys for the dataset underlying this schema.
         */
        public var partitionKeys: List? = null
        /**
         * Details about the status of the schema. Currently, only one entry is present.
         */
        public var schemaStatusDetails: List = listOf()
        /**
         * The schema type properties.
         */
        public var schemaTypeProperties: aws.sdk.kotlin.services.cleanrooms.model.SchemaTypeProperties? = null
        /**
         * The type of schema. The only valid value is currently `TABLE`.
         */
        public var type: aws.sdk.kotlin.services.cleanrooms.model.SchemaType? = null
        /**
         * The time the schema 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.Schema) : this() {
            this.analysisMethod = x.analysisMethod
            this.analysisRuleTypes = x.analysisRuleTypes
            this.collaborationArn = x.collaborationArn
            this.collaborationId = x.collaborationId
            this.columns = x.columns
            this.createTime = x.createTime
            this.creatorAccountId = x.creatorAccountId
            this.description = x.description
            this.name = x.name
            this.partitionKeys = x.partitionKeys
            this.schemaStatusDetails = x.schemaStatusDetails
            this.schemaTypeProperties = x.schemaTypeProperties
            this.type = x.type
            this.updateTime = x.updateTime
        }

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

        internal fun correctErrors(): Builder {
            if (analysisRuleTypes == null) analysisRuleTypes = emptyList()
            if (collaborationArn == null) collaborationArn = ""
            if (collaborationId == null) collaborationId = ""
            if (columns == null) columns = emptyList()
            if (createTime == null) createTime = Instant.fromEpochSeconds(0)
            if (creatorAccountId == null) creatorAccountId = ""
            if (description == null) description = ""
            if (name == null) name = ""
            if (partitionKeys == null) partitionKeys = emptyList()
            if (type == null) type = SchemaType.SdkUnknown("no value provided")
            if (updateTime == null) updateTime = Instant.fromEpochSeconds(0)
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy