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

commonMain.aws.sdk.kotlin.services.lexmodelbuildingservice.model.StartImportRequest.kt Maven / Gradle / Ivy

// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.lexmodelbuildingservice.model

import aws.smithy.kotlin.runtime.SdkDsl

public class StartImportRequest private constructor(builder: Builder) {
    /**
     * Specifies the action that the `StartImport` operation should take when there is an existing resource with the same name.
     * + FAIL_ON_CONFLICT - The import operation is stopped on the first conflict between a resource in the import file and an existing resource. The name of the resource causing the conflict is in the `failureReason` field of the response to the `GetImport` operation.OVERWRITE_LATEST - The import operation proceeds even if there is a conflict with an existing resource. The $LASTEST version of the existing resource is overwritten with the data from the import file.
     */
    public val mergeStrategy: aws.sdk.kotlin.services.lexmodelbuildingservice.model.MergeStrategy? = builder.mergeStrategy
    /**
     * A zip archive in binary format. The archive should contain one file, a JSON file containing the resource to import. The resource should match the type specified in the `resourceType` field.
     */
    public val payload: kotlin.ByteArray? = builder.payload
    /**
     * Specifies the type of resource to export. Each resource also exports any resources that it depends on.
     * + A bot exports dependent intents.
     * + An intent exports dependent slot types.
     */
    public val resourceType: aws.sdk.kotlin.services.lexmodelbuildingservice.model.ResourceType? = builder.resourceType
    /**
     * A list of tags to add to the imported bot. You can only add tags when you import a bot, you can't add tags to an intent or slot type.
     */
    public val tags: List? = builder.tags

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

    override fun toString(): kotlin.String = buildString {
        append("StartImportRequest(")
        append("mergeStrategy=$mergeStrategy,")
        append("payload=$payload,")
        append("resourceType=$resourceType,")
        append("tags=$tags")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = mergeStrategy?.hashCode() ?: 0
        result = 31 * result + (payload?.contentHashCode() ?: 0)
        result = 31 * result + (resourceType?.hashCode() ?: 0)
        result = 31 * result + (tags?.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 StartImportRequest

        if (mergeStrategy != other.mergeStrategy) return false
        if (payload != null) {
            if (other.payload == null) return false
            if (!payload.contentEquals(other.payload)) return false
        } else if (other.payload != null) return false
        if (resourceType != other.resourceType) return false
        if (tags != other.tags) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * Specifies the action that the `StartImport` operation should take when there is an existing resource with the same name.
         * + FAIL_ON_CONFLICT - The import operation is stopped on the first conflict between a resource in the import file and an existing resource. The name of the resource causing the conflict is in the `failureReason` field of the response to the `GetImport` operation.OVERWRITE_LATEST - The import operation proceeds even if there is a conflict with an existing resource. The $LASTEST version of the existing resource is overwritten with the data from the import file.
         */
        public var mergeStrategy: aws.sdk.kotlin.services.lexmodelbuildingservice.model.MergeStrategy? = null
        /**
         * A zip archive in binary format. The archive should contain one file, a JSON file containing the resource to import. The resource should match the type specified in the `resourceType` field.
         */
        public var payload: kotlin.ByteArray? = null
        /**
         * Specifies the type of resource to export. Each resource also exports any resources that it depends on.
         * + A bot exports dependent intents.
         * + An intent exports dependent slot types.
         */
        public var resourceType: aws.sdk.kotlin.services.lexmodelbuildingservice.model.ResourceType? = null
        /**
         * A list of tags to add to the imported bot. You can only add tags when you import a bot, you can't add tags to an intent or slot type.
         */
        public var tags: List? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.lexmodelbuildingservice.model.StartImportRequest) : this() {
            this.mergeStrategy = x.mergeStrategy
            this.payload = x.payload
            this.resourceType = x.resourceType
            this.tags = x.tags
        }

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy