commonMain.aws.sdk.kotlin.services.glue.model.DatabaseInput.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of glue-jvm Show documentation
Show all versions of glue-jvm Show documentation
The AWS SDK for Kotlin client for Glue
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
/**
* The structure used to create or update a database.
*/
public class DatabaseInput private constructor(builder: Builder) {
/**
* 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
/**
* 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.
*
* 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.DatabaseInput = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("DatabaseInput(")
append("createTableDefaultPermissions=$createTableDefaultPermissions,")
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 = createTableDefaultPermissions?.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 DatabaseInput
if (createTableDefaultPermissions != other.createTableDefaultPermissions) 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.DatabaseInput = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* 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
/**
* 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.
*
* 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.DatabaseInput) : this() {
this.createTableDefaultPermissions = x.createTableDefaultPermissions
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.DatabaseInput = DatabaseInput(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
}
}
}