commonMain.aws.sdk.kotlin.services.glue.model.S3GlueParquetTarget.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 data target that writes to Amazon S3 in Apache Parquet columnar storage.
*/
public class S3GlueParquetTarget private constructor(builder: Builder) {
/**
* 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.ParquetCompressionType? = builder.compression
/**
* 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
/**
* A single Amazon S3 path 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.S3GlueParquetTarget = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("S3GlueParquetTarget(")
append("compression=$compression,")
append("inputs=$inputs,")
append("name=$name,")
append("partitionKeys=$partitionKeys,")
append("path=$path,")
append("schemaChangePolicy=$schemaChangePolicy")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = compression?.hashCode() ?: 0
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 S3GlueParquetTarget
if (compression != other.compression) 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.S3GlueParquetTarget = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* 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.ParquetCompressionType? = 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
/**
* A single Amazon S3 path 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.S3GlueParquetTarget) : this() {
this.compression = x.compression
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.S3GlueParquetTarget = S3GlueParquetTarget(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 (inputs == null) inputs = emptyList()
if (name == null) name = ""
if (path == null) path = ""
return this
}
}
}