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

commonMain.aws.sdk.kotlin.services.transfer.model.HomeDirectoryMapEntry.kt Maven / Gradle / Ivy

There is a newer version: 1.3.79
Show newest version
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.transfer.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * Represents an object that contains entries and targets for `HomeDirectoryMappings`.
 *
 * The following is an `Entry` and `Target` pair example for `chroot`.
 *
 * `[ { "Entry": "/", "Target": "/bucket_name/home/mydirectory" } ]`
 */
public class HomeDirectoryMapEntry private constructor(builder: Builder) {
    /**
     * Represents an entry for `HomeDirectoryMappings`.
     */
    public val entry: kotlin.String = requireNotNull(builder.entry) { "A non-null value must be provided for entry" }
    /**
     * Represents the map target that is used in a `HomeDirectoryMapEntry`.
     */
    public val target: kotlin.String = requireNotNull(builder.target) { "A non-null value must be provided for target" }
    /**
     * Specifies the type of mapping. Set the type to `FILE` if you want the mapping to point to a file, or `DIRECTORY` for the directory to point to a directory.
     *
     * By default, home directory mappings have a `Type` of `DIRECTORY` when you create a Transfer Family server. You would need to explicitly set `Type` to `FILE` if you want a mapping to have a file target.
     */
    public val type: aws.sdk.kotlin.services.transfer.model.MapType? = builder.type

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

    override fun toString(): kotlin.String = buildString {
        append("HomeDirectoryMapEntry(")
        append("entry=$entry,")
        append("target=$target,")
        append("type=$type")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = entry.hashCode()
        result = 31 * result + (target.hashCode())
        result = 31 * result + (type?.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 HomeDirectoryMapEntry

        if (entry != other.entry) return false
        if (target != other.target) return false
        if (type != other.type) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * Represents an entry for `HomeDirectoryMappings`.
         */
        public var entry: kotlin.String? = null
        /**
         * Represents the map target that is used in a `HomeDirectoryMapEntry`.
         */
        public var target: kotlin.String? = null
        /**
         * Specifies the type of mapping. Set the type to `FILE` if you want the mapping to point to a file, or `DIRECTORY` for the directory to point to a directory.
         *
         * By default, home directory mappings have a `Type` of `DIRECTORY` when you create a Transfer Family server. You would need to explicitly set `Type` to `FILE` if you want a mapping to have a file target.
         */
        public var type: aws.sdk.kotlin.services.transfer.model.MapType? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.transfer.model.HomeDirectoryMapEntry) : this() {
            this.entry = x.entry
            this.target = x.target
            this.type = x.type
        }

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

        internal fun correctErrors(): Builder {
            if (entry == null) entry = ""
            if (target == null) target = ""
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy