
commonMain.aws.sdk.kotlin.services.lexruntimev2.model.ActiveContextTimeToLive.kt Maven / Gradle / Ivy
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.lexruntimev2.model
import aws.smithy.kotlin.runtime.SdkDsl
/**
* The time that a context is active. You can specify the time to live in seconds or in conversation turns.
*/
public class ActiveContextTimeToLive private constructor(builder: Builder) {
/**
* The number of seconds that the context is active. You can specify between 5 and 86400 seconds (24 hours).
*/
public val timeToLiveInSeconds: kotlin.Int = requireNotNull(builder.timeToLiveInSeconds) { "A non-null value must be provided for timeToLiveInSeconds" }
/**
* The number of turns that the context is active. You can specify up to 20 turns. Each request and response from the bot is a turn.
*/
public val turnsToLive: kotlin.Int = requireNotNull(builder.turnsToLive) { "A non-null value must be provided for turnsToLive" }
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.lexruntimev2.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
result = 31 * result + (turnsToLive)
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.lexruntimev2.model.ActiveContextTimeToLive = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* The number of seconds that the context is active. You can specify between 5 and 86400 seconds (24 hours).
*/
public var timeToLiveInSeconds: kotlin.Int? = null
/**
* The number of turns that the context is active. You can specify up to 20 turns. Each request and response from the bot is a turn.
*/
public var turnsToLive: kotlin.Int? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.lexruntimev2.model.ActiveContextTimeToLive) : this() {
this.timeToLiveInSeconds = x.timeToLiveInSeconds
this.turnsToLive = x.turnsToLive
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.lexruntimev2.model.ActiveContextTimeToLive = ActiveContextTimeToLive(this)
internal fun correctErrors(): Builder {
if (timeToLiveInSeconds == null) timeToLiveInSeconds = 0
if (turnsToLive == null) turnsToLive = 0
return this
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy