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

commonMain.aws.sdk.kotlin.services.glue.model.PartitionIndexDescriptor.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.glue.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * A descriptor for a partition index in a table.
 */
public class PartitionIndexDescriptor private constructor(builder: Builder) {
    /**
     * A list of errors that can occur when registering partition indexes for an existing table.
     */
    public val backfillErrors: List? = builder.backfillErrors
    /**
     * The name of the partition index.
     */
    public val indexName: kotlin.String = requireNotNull(builder.indexName) { "A non-null value must be provided for indexName" }
    /**
     * The status of the partition index.
     *
     * The possible statuses are:
     * + CREATING: The index is being created. When an index is in a CREATING state, the index or its table cannot be deleted.
     * + ACTIVE: The index creation succeeds.
     * + FAILED: The index creation fails.
     * + DELETING: The index is deleted from the list of indexes.
     */
    public val indexStatus: aws.sdk.kotlin.services.glue.model.PartitionIndexStatus = requireNotNull(builder.indexStatus) { "A non-null value must be provided for indexStatus" }
    /**
     * A list of one or more keys, as `KeySchemaElement` structures, for the partition index.
     */
    public val keys: List = requireNotNull(builder.keys) { "A non-null value must be provided for keys" }

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

    override fun toString(): kotlin.String = buildString {
        append("PartitionIndexDescriptor(")
        append("backfillErrors=$backfillErrors,")
        append("indexName=$indexName,")
        append("indexStatus=$indexStatus,")
        append("keys=$keys")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = backfillErrors?.hashCode() ?: 0
        result = 31 * result + (indexName.hashCode())
        result = 31 * result + (indexStatus.hashCode())
        result = 31 * result + (keys.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 PartitionIndexDescriptor

        if (backfillErrors != other.backfillErrors) return false
        if (indexName != other.indexName) return false
        if (indexStatus != other.indexStatus) return false
        if (keys != other.keys) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * A list of errors that can occur when registering partition indexes for an existing table.
         */
        public var backfillErrors: List? = null
        /**
         * The name of the partition index.
         */
        public var indexName: kotlin.String? = null
        /**
         * The status of the partition index.
         *
         * The possible statuses are:
         * + CREATING: The index is being created. When an index is in a CREATING state, the index or its table cannot be deleted.
         * + ACTIVE: The index creation succeeds.
         * + FAILED: The index creation fails.
         * + DELETING: The index is deleted from the list of indexes.
         */
        public var indexStatus: aws.sdk.kotlin.services.glue.model.PartitionIndexStatus? = null
        /**
         * A list of one or more keys, as `KeySchemaElement` structures, for the partition index.
         */
        public var keys: List? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.glue.model.PartitionIndexDescriptor) : this() {
            this.backfillErrors = x.backfillErrors
            this.indexName = x.indexName
            this.indexStatus = x.indexStatus
            this.keys = x.keys
        }

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

        internal fun correctErrors(): Builder {
            if (indexName == null) indexName = ""
            if (indexStatus == null) indexStatus = PartitionIndexStatus.SdkUnknown("no value provided")
            if (keys == null) keys = emptyList()
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy