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

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

/**
 * The `Database` object represents a logical grouping of tables that might reside in a Hive metastore or an RDBMS.
 */
public class Database private constructor(builder: Builder) {
    /**
     * The ID of the Data Catalog in which the database resides.
     */
    public val catalogId: kotlin.String? = builder.catalogId
    /**
     * Creates a set of default permissions on the table for principals. Used by Lake Formation. Not used in the normal course of Glue operations.
     */
    public val createTableDefaultPermissions: List? = builder.createTableDefaultPermissions
    /**
     * The time at which the metadata database was created in the catalog.
     */
    public val createTime: aws.smithy.kotlin.runtime.time.Instant? = builder.createTime
    /**
     * A description of the database.
     */
    public val description: kotlin.String? = builder.description
    /**
     * A `FederatedDatabase` structure that references an entity outside the Glue Data Catalog.
     */
    public val federatedDatabase: aws.sdk.kotlin.services.glue.model.FederatedDatabase? = builder.federatedDatabase
    /**
     * The location of the database (for example, an HDFS path).
     */
    public val locationUri: kotlin.String? = builder.locationUri
    /**
     * The name of the database. For Hive compatibility, this is folded to lowercase when it is stored.
     */
    public val name: kotlin.String = requireNotNull(builder.name) { "A non-null value must be provided for name" }
    /**
     * These key-value pairs define parameters and properties of the database.
     */
    public val parameters: Map? = builder.parameters
    /**
     * A `DatabaseIdentifier` structure that describes a target database for resource linking.
     */
    public val targetDatabase: aws.sdk.kotlin.services.glue.model.DatabaseIdentifier? = builder.targetDatabase

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

    override fun toString(): kotlin.String = buildString {
        append("Database(")
        append("catalogId=$catalogId,")
        append("createTableDefaultPermissions=$createTableDefaultPermissions,")
        append("createTime=$createTime,")
        append("description=$description,")
        append("federatedDatabase=$federatedDatabase,")
        append("locationUri=$locationUri,")
        append("name=$name,")
        append("parameters=$parameters,")
        append("targetDatabase=$targetDatabase")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = catalogId?.hashCode() ?: 0
        result = 31 * result + (createTableDefaultPermissions?.hashCode() ?: 0)
        result = 31 * result + (createTime?.hashCode() ?: 0)
        result = 31 * result + (description?.hashCode() ?: 0)
        result = 31 * result + (federatedDatabase?.hashCode() ?: 0)
        result = 31 * result + (locationUri?.hashCode() ?: 0)
        result = 31 * result + (name.hashCode())
        result = 31 * result + (parameters?.hashCode() ?: 0)
        result = 31 * result + (targetDatabase?.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 Database

        if (catalogId != other.catalogId) return false
        if (createTableDefaultPermissions != other.createTableDefaultPermissions) return false
        if (createTime != other.createTime) return false
        if (description != other.description) return false
        if (federatedDatabase != other.federatedDatabase) return false
        if (locationUri != other.locationUri) return false
        if (name != other.name) return false
        if (parameters != other.parameters) return false
        if (targetDatabase != other.targetDatabase) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The ID of the Data Catalog in which the database resides.
         */
        public var catalogId: kotlin.String? = null
        /**
         * Creates a set of default permissions on the table for principals. Used by Lake Formation. Not used in the normal course of Glue operations.
         */
        public var createTableDefaultPermissions: List? = null
        /**
         * The time at which the metadata database was created in the catalog.
         */
        public var createTime: aws.smithy.kotlin.runtime.time.Instant? = null
        /**
         * A description of the database.
         */
        public var description: kotlin.String? = null
        /**
         * A `FederatedDatabase` structure that references an entity outside the Glue Data Catalog.
         */
        public var federatedDatabase: aws.sdk.kotlin.services.glue.model.FederatedDatabase? = null
        /**
         * The location of the database (for example, an HDFS path).
         */
        public var locationUri: kotlin.String? = null
        /**
         * The name of the database. For Hive compatibility, this is folded to lowercase when it is stored.
         */
        public var name: kotlin.String? = null
        /**
         * These key-value pairs define parameters and properties of the database.
         */
        public var parameters: Map? = null
        /**
         * A `DatabaseIdentifier` structure that describes a target database for resource linking.
         */
        public var targetDatabase: aws.sdk.kotlin.services.glue.model.DatabaseIdentifier? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.glue.model.Database) : this() {
            this.catalogId = x.catalogId
            this.createTableDefaultPermissions = x.createTableDefaultPermissions
            this.createTime = x.createTime
            this.description = x.description
            this.federatedDatabase = x.federatedDatabase
            this.locationUri = x.locationUri
            this.name = x.name
            this.parameters = x.parameters
            this.targetDatabase = x.targetDatabase
        }

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

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

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

        internal fun correctErrors(): Builder {
            if (name == null) name = ""
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy