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

commonMain.aws.sdk.kotlin.services.glue.model.S3DirectTarget.kt Maven / Gradle / Ivy

There is a newer version: 1.3.76
Show newest version
// 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.
 */
public class S3DirectTarget 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: kotlin.String? = builder.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
    /**
     * 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.S3DirectTarget = Builder().apply(block).build()
    }

    override fun toString(): kotlin.String = buildString {
        append("S3DirectTarget(")
        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 = compression?.hashCode() ?: 0
        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 S3DirectTarget

        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.S3DirectTarget = 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: kotlin.String? = 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
        /**
         * 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.S3DirectTarget) : this() {
            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.S3DirectTarget = S3DirectTarget(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 (format == null) format = TargetFormat.SdkUnknown("no value provided")
            if (inputs == null) inputs = emptyList()
            if (name == null) name = ""
            if (path == null) path = ""
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy