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

commonMain.aws.sdk.kotlin.services.glue.model.Mapping.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 the mapping of data property keys.
 */
public class Mapping private constructor(builder: Builder) {
    /**
     * Only applicable to nested data structures. If you want to change the parent structure, but also one of its children, you can fill out this data strucutre. It is also `Mapping`, but its `FromPath` will be the parent's `FromPath` plus the `FromPath` from this structure.
     *
     * For the children part, suppose you have the structure:
     *
     * `{ "FromPath": "OuterStructure", "ToKey": "OuterStructure", "ToType": "Struct", "Dropped": false, "Chidlren": [{ "FromPath": "inner", "ToKey": "inner", "ToType": "Double", "Dropped": false, }] }`
     *
     * You can specify a `Mapping` that looks like:
     *
     * `{ "FromPath": "OuterStructure", "ToKey": "OuterStructure", "ToType": "Struct", "Dropped": false, "Chidlren": [{ "FromPath": "inner", "ToKey": "inner", "ToType": "Double", "Dropped": false, }] }`
     */
    public val children: List? = builder.children
    /**
     * If true, then the column is removed.
     */
    public val dropped: kotlin.Boolean? = builder.dropped
    /**
     * The table or column to be modified.
     */
    public val fromPath: List? = builder.fromPath
    /**
     * The type of the data to be modified.
     */
    public val fromType: kotlin.String? = builder.fromType
    /**
     * After the apply mapping, what the name of the column should be. Can be the same as `FromPath`.
     */
    public val toKey: kotlin.String? = builder.toKey
    /**
     * The data type that the data is to be modified to.
     */
    public val toType: kotlin.String? = builder.toType

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

    override fun toString(): kotlin.String = buildString {
        append("Mapping(")
        append("children=$children,")
        append("dropped=$dropped,")
        append("fromPath=$fromPath,")
        append("fromType=$fromType,")
        append("toKey=$toKey,")
        append("toType=$toType")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = children?.hashCode() ?: 0
        result = 31 * result + (dropped?.hashCode() ?: 0)
        result = 31 * result + (fromPath?.hashCode() ?: 0)
        result = 31 * result + (fromType?.hashCode() ?: 0)
        result = 31 * result + (toKey?.hashCode() ?: 0)
        result = 31 * result + (toType?.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 Mapping

        if (children != other.children) return false
        if (dropped != other.dropped) return false
        if (fromPath != other.fromPath) return false
        if (fromType != other.fromType) return false
        if (toKey != other.toKey) return false
        if (toType != other.toType) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * Only applicable to nested data structures. If you want to change the parent structure, but also one of its children, you can fill out this data strucutre. It is also `Mapping`, but its `FromPath` will be the parent's `FromPath` plus the `FromPath` from this structure.
         *
         * For the children part, suppose you have the structure:
         *
         * `{ "FromPath": "OuterStructure", "ToKey": "OuterStructure", "ToType": "Struct", "Dropped": false, "Chidlren": [{ "FromPath": "inner", "ToKey": "inner", "ToType": "Double", "Dropped": false, }] }`
         *
         * You can specify a `Mapping` that looks like:
         *
         * `{ "FromPath": "OuterStructure", "ToKey": "OuterStructure", "ToType": "Struct", "Dropped": false, "Chidlren": [{ "FromPath": "inner", "ToKey": "inner", "ToType": "Double", "Dropped": false, }] }`
         */
        public var children: List? = null
        /**
         * If true, then the column is removed.
         */
        public var dropped: kotlin.Boolean? = null
        /**
         * The table or column to be modified.
         */
        public var fromPath: List? = null
        /**
         * The type of the data to be modified.
         */
        public var fromType: kotlin.String? = null
        /**
         * After the apply mapping, what the name of the column should be. Can be the same as `FromPath`.
         */
        public var toKey: kotlin.String? = null
        /**
         * The data type that the data is to be modified to.
         */
        public var toType: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.glue.model.Mapping) : this() {
            this.children = x.children
            this.dropped = x.dropped
            this.fromPath = x.fromPath
            this.fromType = x.fromType
            this.toKey = x.toKey
            this.toType = x.toType
        }

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

        internal fun correctErrors(): Builder {
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy