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

commonMain.aws.sdk.kotlin.services.lexruntimeservice.model.ActiveContextTimeToLive.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.lexruntimeservice.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * The length of time or number of turns that a context remains active.
 */
public class ActiveContextTimeToLive private constructor(builder: Builder) {
    /**
     * The number of seconds that the context should be active after it is first sent in a `PostContent` or `PostText` response. You can set the value between 5 and 86,400 seconds (24 hours).
     */
    public val timeToLiveInSeconds: kotlin.Int? = builder.timeToLiveInSeconds
    /**
     * The number of conversation turns that the context should be active. A conversation turn is one `PostContent` or `PostText` request and the corresponding response from Amazon Lex.
     */
    public val turnsToLive: kotlin.Int? = builder.turnsToLive

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

    override fun toString(): kotlin.String = buildString {
        append("ActiveContextTimeToLive(")
        append("timeToLiveInSeconds=$timeToLiveInSeconds,")
        append("turnsToLive=$turnsToLive")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = timeToLiveInSeconds ?: 0
        result = 31 * result + (turnsToLive ?: 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 ActiveContextTimeToLive

        if (timeToLiveInSeconds != other.timeToLiveInSeconds) return false
        if (turnsToLive != other.turnsToLive) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The number of seconds that the context should be active after it is first sent in a `PostContent` or `PostText` response. You can set the value between 5 and 86,400 seconds (24 hours).
         */
        public var timeToLiveInSeconds: kotlin.Int? = null
        /**
         * The number of conversation turns that the context should be active. A conversation turn is one `PostContent` or `PostText` request and the corresponding response from Amazon Lex.
         */
        public var turnsToLive: kotlin.Int? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.lexruntimeservice.model.ActiveContextTimeToLive) : this() {
            this.timeToLiveInSeconds = x.timeToLiveInSeconds
            this.turnsToLive = x.turnsToLive
        }

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy