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

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

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

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

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * Specifies a Lambda function that verifies requests to a bot or fulfills the user's request to a bot..
 */
public class CodeHook private constructor(builder: Builder) {
    /**
     * The version of the request-response that you want Amazon Lex to use to invoke your Lambda function. For more information, see using-lambda.
     */
    public val messageVersion: kotlin.String = requireNotNull(builder.messageVersion) { "A non-null value must be provided for messageVersion" }
    /**
     * The Amazon Resource Name (ARN) of the Lambda function.
     */
    public val uri: kotlin.String = requireNotNull(builder.uri) { "A non-null value must be provided for uri" }

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

    override fun toString(): kotlin.String = buildString {
        append("CodeHook(")
        append("messageVersion=$messageVersion,")
        append("uri=$uri")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = messageVersion.hashCode()
        result = 31 * result + (uri.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 CodeHook

        if (messageVersion != other.messageVersion) return false
        if (uri != other.uri) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The version of the request-response that you want Amazon Lex to use to invoke your Lambda function. For more information, see using-lambda.
         */
        public var messageVersion: kotlin.String? = null
        /**
         * The Amazon Resource Name (ARN) of the Lambda function.
         */
        public var uri: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.lexmodelbuildingservice.model.CodeHook) : this() {
            this.messageVersion = x.messageVersion
            this.uri = x.uri
        }

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

        internal fun correctErrors(): Builder {
            if (messageVersion == null) messageVersion = ""
            if (uri == null) uri = ""
            return this
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy