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

aws.sdk.kotlin.services.connect.model.LexBotConfig.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.connect.model



/**
 * Configuration information of an Amazon Lex or Amazon Lex V2 bot.
 */
class LexBotConfig private constructor(builder: BuilderImpl) {
    /**
     * Configuration information of an Amazon Lex bot.
     */
    val lexBot: LexBot? = builder.lexBot
    /**
     * Configuration information of an Amazon Lex V2 bot.
     */
    val lexV2Bot: LexV2Bot? = builder.lexV2Bot

    companion object {
        @JvmStatic
        fun fluentBuilder(): FluentBuilder = BuilderImpl()

        internal fun builder(): DslBuilder = BuilderImpl()

        operator fun invoke(block: DslBuilder.() -> kotlin.Unit): LexBotConfig = BuilderImpl().apply(block).build()

    }

    override fun toString(): kotlin.String = buildString {
        append("LexBotConfig(")
        append("lexBot=$lexBot,")
        append("lexV2Bot=$lexV2Bot)")
    }

    override fun hashCode(): kotlin.Int {
        var result = lexBot?.hashCode() ?: 0
        result = 31 * result + (lexV2Bot?.hashCode() ?: 0)
        return result
    }

    override fun equals(other: kotlin.Any?): kotlin.Boolean {
        if (this === other) return true
        if (javaClass != other?.javaClass) return false

        other as LexBotConfig

        if (lexBot != other.lexBot) return false
        if (lexV2Bot != other.lexV2Bot) return false

        return true
    }

    fun copy(block: DslBuilder.() -> kotlin.Unit = {}): LexBotConfig = BuilderImpl(this).apply(block).build()

    interface FluentBuilder {
        fun build(): LexBotConfig
        /**
         * Configuration information of an Amazon Lex bot.
         */
        fun lexBot(lexBot: LexBot): FluentBuilder
        /**
         * Configuration information of an Amazon Lex V2 bot.
         */
        fun lexV2Bot(lexV2Bot: LexV2Bot): FluentBuilder
    }

    interface DslBuilder {
        /**
         * Configuration information of an Amazon Lex bot.
         */
        var lexBot: LexBot?
        /**
         * Configuration information of an Amazon Lex V2 bot.
         */
        var lexV2Bot: LexV2Bot?

        fun build(): LexBotConfig
        /**
         * construct an [aws.sdk.kotlin.services.connect.model.LexBot] inside the given [block]
         */
        fun lexBot(block: LexBot.DslBuilder.() -> kotlin.Unit) {
            this.lexBot = LexBot.invoke(block)
        }
        /**
         * construct an [aws.sdk.kotlin.services.connect.model.LexV2Bot] inside the given [block]
         */
        fun lexV2Bot(block: LexV2Bot.DslBuilder.() -> kotlin.Unit) {
            this.lexV2Bot = LexV2Bot.invoke(block)
        }
    }

    private class BuilderImpl() : FluentBuilder, DslBuilder {
        override var lexBot: LexBot? = null
        override var lexV2Bot: LexV2Bot? = null

        constructor(x: LexBotConfig) : this() {
            this.lexBot = x.lexBot
            this.lexV2Bot = x.lexV2Bot
        }

        override fun build(): LexBotConfig = LexBotConfig(this)
        override fun lexBot(lexBot: LexBot): FluentBuilder = apply { this.lexBot = lexBot }
        override fun lexV2Bot(lexV2Bot: LexV2Bot): FluentBuilder = apply { this.lexV2Bot = lexV2Bot }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy