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

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

The 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 transform that merges a `DynamicFrame` with a staging `DynamicFrame` based on the specified primary keys to identify records. Duplicate records (records with the same primary keys) are not de-duplicated.
 */
public class Merge private constructor(builder: Builder) {
    /**
     * The data inputs identified by their node names.
     */
    public val inputs: List = requireNotNull(builder.inputs) { "A non-null value must be provided for inputs" }
    /**
     * The name of the transform node.
     */
    public val name: kotlin.String = requireNotNull(builder.name) { "A non-null value must be provided for name" }
    /**
     * The list of primary key fields to match records from the source and staging dynamic frames.
     */
    public val primaryKeys: List> = requireNotNull(builder.primaryKeys) { "A non-null value must be provided for primaryKeys" }
    /**
     * The source `DynamicFrame` that will be merged with a staging `DynamicFrame`.
     */
    public val source: kotlin.String = requireNotNull(builder.source) { "A non-null value must be provided for source" }

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

    override fun toString(): kotlin.String = buildString {
        append("Merge(")
        append("inputs=$inputs,")
        append("name=$name,")
        append("primaryKeys=$primaryKeys,")
        append("source=$source")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = inputs.hashCode()
        result = 31 * result + (name.hashCode())
        result = 31 * result + (primaryKeys.hashCode())
        result = 31 * result + (source.hashCode())
        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 Merge

        if (inputs != other.inputs) return false
        if (name != other.name) return false
        if (primaryKeys != other.primaryKeys) return false
        if (source != other.source) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The data inputs identified by their node names.
         */
        public var inputs: List? = null
        /**
         * The name of the transform node.
         */
        public var name: kotlin.String? = null
        /**
         * The list of primary key fields to match records from the source and staging dynamic frames.
         */
        public var primaryKeys: List>? = null
        /**
         * The source `DynamicFrame` that will be merged with a staging `DynamicFrame`.
         */
        public var source: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.glue.model.Merge) : this() {
            this.inputs = x.inputs
            this.name = x.name
            this.primaryKeys = x.primaryKeys
            this.source = x.source
        }

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy