commonMain.aws.sdk.kotlin.services.lexmodelbuildingservice.model.OutputContext.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
/**
* The specification of an output context that is set when an intent is fulfilled.
*/
public class OutputContext private constructor(builder: Builder) {
/**
* The name of the context.
*/
public val name: kotlin.String = requireNotNull(builder.name) { "A non-null value must be provided for name" }
/**
* 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 = requireNotNull(builder.timeToLiveInSeconds) { "A non-null value must be provided for 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 = 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.lexmodelbuildingservice.model.OutputContext = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("OutputContext(")
append("name=$name,")
append("timeToLiveInSeconds=$timeToLiveInSeconds,")
append("turnsToLive=$turnsToLive")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = name.hashCode()
result = 31 * 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 OutputContext
if (name != other.name) return false
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.lexmodelbuildingservice.model.OutputContext = Builder(this).apply(block).build()
@SdkDsl
public class Builder {
/**
* The name of the context.
*/
public var name: kotlin.String? = null
/**
* 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.lexmodelbuildingservice.model.OutputContext) : this() {
this.name = x.name
this.timeToLiveInSeconds = x.timeToLiveInSeconds
this.turnsToLive = x.turnsToLive
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.lexmodelbuildingservice.model.OutputContext = OutputContext(this)
internal fun correctErrors(): Builder {
if (name == null) name = ""
if (timeToLiveInSeconds == null) timeToLiveInSeconds = 0
if (turnsToLive == null) turnsToLive = 0
return this
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy