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

commonMain.aws.sdk.kotlin.services.glue.model.CreateTableRequest.kt Maven / Gradle / Ivy

The newest version!
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.glue.model

import aws.smithy.kotlin.runtime.SdkDsl

public class CreateTableRequest private constructor(builder: Builder) {
    /**
     * The ID of the Data Catalog in which to create the `Table`. If none is supplied, the Amazon Web Services account ID is used by default.
     */
    public val catalogId: kotlin.String? = builder.catalogId
    /**
     * The catalog database in which to create the new table. For Hive compatibility, this name is entirely lowercase.
     */
    public val databaseName: kotlin.String? = builder.databaseName
    /**
     * Specifies an `OpenTableFormatInput` structure when creating an open format table.
     */
    public val openTableFormatInput: aws.sdk.kotlin.services.glue.model.OpenTableFormatInput? = builder.openTableFormatInput
    /**
     * A list of partition indexes, `PartitionIndex` structures, to create in the table.
     */
    public val partitionIndexes: List? = builder.partitionIndexes
    /**
     * The `TableInput` object that defines the metadata table to create in the catalog.
     */
    public val tableInput: aws.sdk.kotlin.services.glue.model.TableInput? = builder.tableInput
    /**
     * The ID of the transaction.
     */
    public val transactionId: kotlin.String? = builder.transactionId

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

    override fun toString(): kotlin.String = buildString {
        append("CreateTableRequest(")
        append("catalogId=$catalogId,")
        append("databaseName=$databaseName,")
        append("openTableFormatInput=$openTableFormatInput,")
        append("partitionIndexes=$partitionIndexes,")
        append("tableInput=$tableInput,")
        append("transactionId=$transactionId")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = catalogId?.hashCode() ?: 0
        result = 31 * result + (databaseName?.hashCode() ?: 0)
        result = 31 * result + (openTableFormatInput?.hashCode() ?: 0)
        result = 31 * result + (partitionIndexes?.hashCode() ?: 0)
        result = 31 * result + (tableInput?.hashCode() ?: 0)
        result = 31 * result + (transactionId?.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 CreateTableRequest

        if (catalogId != other.catalogId) return false
        if (databaseName != other.databaseName) return false
        if (openTableFormatInput != other.openTableFormatInput) return false
        if (partitionIndexes != other.partitionIndexes) return false
        if (tableInput != other.tableInput) return false
        if (transactionId != other.transactionId) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The ID of the Data Catalog in which to create the `Table`. If none is supplied, the Amazon Web Services account ID is used by default.
         */
        public var catalogId: kotlin.String? = null
        /**
         * The catalog database in which to create the new table. For Hive compatibility, this name is entirely lowercase.
         */
        public var databaseName: kotlin.String? = null
        /**
         * Specifies an `OpenTableFormatInput` structure when creating an open format table.
         */
        public var openTableFormatInput: aws.sdk.kotlin.services.glue.model.OpenTableFormatInput? = null
        /**
         * A list of partition indexes, `PartitionIndex` structures, to create in the table.
         */
        public var partitionIndexes: List? = null
        /**
         * The `TableInput` object that defines the metadata table to create in the catalog.
         */
        public var tableInput: aws.sdk.kotlin.services.glue.model.TableInput? = null
        /**
         * The ID of the transaction.
         */
        public var transactionId: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.glue.model.CreateTableRequest) : this() {
            this.catalogId = x.catalogId
            this.databaseName = x.databaseName
            this.openTableFormatInput = x.openTableFormatInput
            this.partitionIndexes = x.partitionIndexes
            this.tableInput = x.tableInput
            this.transactionId = x.transactionId
        }

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

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

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

        internal fun correctErrors(): Builder {
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy