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

commonMain.aws.sdk.kotlin.services.glue.model.RedshiftTarget.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 uses Amazon Redshift.
 */
public class RedshiftTarget private constructor(builder: Builder) {
    /**
     * The name of the database to write to.
     */
    public val database: kotlin.String = requireNotNull(builder.database) { "A non-null value must be provided for database" }
    /**
     * 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" }
    /**
     * The Amazon S3 path where temporary data can be staged when copying out of the database.
     */
    public val redshiftTmpDir: kotlin.String? = builder.redshiftTmpDir
    /**
     * The name of the table in the database to write to.
     */
    public val table: kotlin.String = requireNotNull(builder.table) { "A non-null value must be provided for table" }
    /**
     * The IAM role with permissions.
     */
    public val tmpDirIamRole: kotlin.String? = builder.tmpDirIamRole
    /**
     * The set of options to configure an upsert operation when writing to a Redshift target.
     */
    public val upsertRedshiftOptions: aws.sdk.kotlin.services.glue.model.UpsertRedshiftTargetOptions? = builder.upsertRedshiftOptions

    public companion object {
        public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.glue.model.RedshiftTarget = Builder().apply(block).build()
    }

    override fun toString(): kotlin.String = buildString {
        append("RedshiftTarget(")
        append("database=$database,")
        append("inputs=$inputs,")
        append("name=$name,")
        append("redshiftTmpDir=$redshiftTmpDir,")
        append("table=$table,")
        append("tmpDirIamRole=$tmpDirIamRole,")
        append("upsertRedshiftOptions=$upsertRedshiftOptions")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = database.hashCode()
        result = 31 * result + (inputs.hashCode())
        result = 31 * result + (name.hashCode())
        result = 31 * result + (redshiftTmpDir?.hashCode() ?: 0)
        result = 31 * result + (table.hashCode())
        result = 31 * result + (tmpDirIamRole?.hashCode() ?: 0)
        result = 31 * result + (upsertRedshiftOptions?.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 RedshiftTarget

        if (database != other.database) return false
        if (inputs != other.inputs) return false
        if (name != other.name) return false
        if (redshiftTmpDir != other.redshiftTmpDir) return false
        if (table != other.table) return false
        if (tmpDirIamRole != other.tmpDirIamRole) return false
        if (upsertRedshiftOptions != other.upsertRedshiftOptions) return false

        return true
    }

    public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.glue.model.RedshiftTarget = Builder(this).apply(block).build()

    @SdkDsl
    public class Builder {
        /**
         * The name of the database to write to.
         */
        public var database: kotlin.String? = 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
        /**
         * The Amazon S3 path where temporary data can be staged when copying out of the database.
         */
        public var redshiftTmpDir: kotlin.String? = null
        /**
         * The name of the table in the database to write to.
         */
        public var table: kotlin.String? = null
        /**
         * The IAM role with permissions.
         */
        public var tmpDirIamRole: kotlin.String? = null
        /**
         * The set of options to configure an upsert operation when writing to a Redshift target.
         */
        public var upsertRedshiftOptions: aws.sdk.kotlin.services.glue.model.UpsertRedshiftTargetOptions? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.glue.model.RedshiftTarget) : this() {
            this.database = x.database
            this.inputs = x.inputs
            this.name = x.name
            this.redshiftTmpDir = x.redshiftTmpDir
            this.table = x.table
            this.tmpDirIamRole = x.tmpDirIamRole
            this.upsertRedshiftOptions = x.upsertRedshiftOptions
        }

        @PublishedApi
        internal fun build(): aws.sdk.kotlin.services.glue.model.RedshiftTarget = RedshiftTarget(this)

        /**
         * construct an [aws.sdk.kotlin.services.glue.model.UpsertRedshiftTargetOptions] inside the given [block]
         */
        public fun upsertRedshiftOptions(block: aws.sdk.kotlin.services.glue.model.UpsertRedshiftTargetOptions.Builder.() -> kotlin.Unit) {
            this.upsertRedshiftOptions = aws.sdk.kotlin.services.glue.model.UpsertRedshiftTargetOptions.invoke(block)
        }

        internal fun correctErrors(): Builder {
            if (database == null) database = ""
            if (inputs == null) inputs = emptyList()
            if (name == null) name = ""
            if (table == null) table = ""
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy