commonMain.aws.sdk.kotlin.services.glue.model.S3HudiDirectTarget.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
/**
* Specifies a target that writes to a Hudi data source in Amazon S3.
*/
public class S3HudiDirectTarget private constructor(builder: Builder) {
/**
* Specifies additional connection options for the connector.
*/
public val additionalOptions: Map = requireNotNull(builder.additionalOptions) { "A non-null value must be provided for additionalOptions" }
/**
* Specifies how the data is compressed. This is generally not necessary if the data has a standard file extension. Possible values are `"gzip"` and `"bzip"`).
*/
public val compression: aws.sdk.kotlin.services.glue.model.HudiTargetCompressionType = requireNotNull(builder.compression) { "A non-null value must be provided for compression" }
/**
* Specifies the data output format for the target.
*/
public val format: aws.sdk.kotlin.services.glue.model.TargetFormat = requireNotNull(builder.format) { "A non-null value must be provided for format" }
/**
* The nodes that are inputs to the data target.
*/
public val inputs: List = requireNotNull(builder.inputs) { "A non-null value must be provided for inputs" }
/**
* The name of the data target.
*/
public val name: kotlin.String = requireNotNull(builder.name) { "A non-null value must be provided for name" }
/**
* Specifies native partitioning using a sequence of keys.
*/
public val partitionKeys: List>? = builder.partitionKeys
/**
* The Amazon S3 path of your Hudi data source to write to.
*/
public val path: kotlin.String = requireNotNull(builder.path) { "A non-null value must be provided for path" }
/**
* A policy that specifies update behavior for the crawler.
*/
public val schemaChangePolicy: aws.sdk.kotlin.services.glue.model.DirectSchemaChangePolicy? = builder.schemaChangePolicy
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.glue.model.S3HudiDirectTarget = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("S3HudiDirectTarget(")
append("additionalOptions=$additionalOptions,")
append("compression=$compression,")
append("format=$format,")
append("inputs=$inputs,")
append("name=$name,")
append("partitionKeys=$partitionKeys,")
append("path=$path,")
append("schemaChangePolicy=$schemaChangePolicy")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = additionalOptions.hashCode()
result = 31 * result + (compression.hashCode())
result = 31 * result + (format.hashCode())
result = 31 * result + (inputs.hashCode())
result = 31 * result + (name.hashCode())
result = 31 * result + (partitionKeys?.hashCode() ?: 0)
result = 31 * result + (path.hashCode())
result = 31 * result + (schemaChangePolicy?.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 S3HudiDirectTarget
if (additionalOptions != other.additionalOptions) return false
if (compression != other.compression) return false
if (format != other.format) return false
if (inputs != other.inputs) return false
if (name != other.name) return false
if (partitionKeys != other.partitionKeys) return false
if (path != other.path) return false
if (schemaChangePolicy != other.schemaChangePolicy) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.glue.model.S3HudiDirectTarget = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* Specifies additional connection options for the connector.
*/
public var additionalOptions: Map? = null
/**
* Specifies how the data is compressed. This is generally not necessary if the data has a standard file extension. Possible values are `"gzip"` and `"bzip"`).
*/
public var compression: aws.sdk.kotlin.services.glue.model.HudiTargetCompressionType? = null
/**
* Specifies the data output format for the target.
*/
public var format: aws.sdk.kotlin.services.glue.model.TargetFormat? = null
/**
* The nodes that are inputs to the data target.
*/
public var inputs: List? = null
/**
* The name of the data target.
*/
public var name: kotlin.String? = null
/**
* Specifies native partitioning using a sequence of keys.
*/
public var partitionKeys: List>? = null
/**
* The Amazon S3 path of your Hudi data source to write to.
*/
public var path: kotlin.String? = null
/**
* A policy that specifies update behavior for the crawler.
*/
public var schemaChangePolicy: aws.sdk.kotlin.services.glue.model.DirectSchemaChangePolicy? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.glue.model.S3HudiDirectTarget) : this() {
this.additionalOptions = x.additionalOptions
this.compression = x.compression
this.format = x.format
this.inputs = x.inputs
this.name = x.name
this.partitionKeys = x.partitionKeys
this.path = x.path
this.schemaChangePolicy = x.schemaChangePolicy
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.glue.model.S3HudiDirectTarget = S3HudiDirectTarget(this)
/**
* construct an [aws.sdk.kotlin.services.glue.model.DirectSchemaChangePolicy] inside the given [block]
*/
public fun schemaChangePolicy(block: aws.sdk.kotlin.services.glue.model.DirectSchemaChangePolicy.Builder.() -> kotlin.Unit) {
this.schemaChangePolicy = aws.sdk.kotlin.services.glue.model.DirectSchemaChangePolicy.invoke(block)
}
internal fun correctErrors(): Builder {
if (additionalOptions == null) additionalOptions = emptyMap()
if (compression == null) compression = HudiTargetCompressionType.SdkUnknown("no value provided")
if (format == null) format = TargetFormat.SdkUnknown("no value provided")
if (inputs == null) inputs = emptyList()
if (name == null) name = ""
if (path == null) path = ""
return this
}
}
}