commonMain.aws.sdk.kotlin.services.glue.model.IcebergInput.kt Maven / Gradle / Ivy
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.glue.model
import aws.smithy.kotlin.runtime.SdkDsl
/**
* A structure that defines an Apache Iceberg metadata table to create in the catalog.
*/
public class IcebergInput private constructor(builder: Builder) {
/**
* A required metadata operation. Can only be set to `CREATE`.
*/
public val metadataOperation: aws.sdk.kotlin.services.glue.model.MetadataOperation = requireNotNull(builder.metadataOperation) { "A non-null value must be provided for metadataOperation" }
/**
* The table version for the Iceberg table. Defaults to 2.
*/
public val version: kotlin.String? = builder.version
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.glue.model.IcebergInput = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("IcebergInput(")
append("metadataOperation=$metadataOperation,")
append("version=$version")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = metadataOperation.hashCode()
result = 31 * result + (version?.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 IcebergInput
if (metadataOperation != other.metadataOperation) return false
if (version != other.version) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.glue.model.IcebergInput = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* A required metadata operation. Can only be set to `CREATE`.
*/
public var metadataOperation: aws.sdk.kotlin.services.glue.model.MetadataOperation? = null
/**
* The table version for the Iceberg table. Defaults to 2.
*/
public var version: kotlin.String? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.glue.model.IcebergInput) : this() {
this.metadataOperation = x.metadataOperation
this.version = x.version
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.glue.model.IcebergInput = IcebergInput(this)
internal fun correctErrors(): Builder {
if (metadataOperation == null) metadataOperation = MetadataOperation.SdkUnknown("no value provided")
return this
}
}
}