commonMain.aws.sdk.kotlin.services.lexruntimeservice.model.SentimentResponse.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of lexruntimeservice-jvm Show documentation
Show all versions of lexruntimeservice-jvm Show documentation
The AWS Kotlin client for Lex Runtime Service
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.lexruntimeservice.model
/**
* The sentiment expressed in an utterance.
*
* When the bot is configured to send utterances to Amazon Comprehend for sentiment analysis, this field structure contains the result of the analysis.
*/
public class SentimentResponse private constructor(builder: Builder) {
/**
* The inferred sentiment that Amazon Comprehend has the highest confidence in.
*/
public val sentimentLabel: kotlin.String? = builder.sentimentLabel
/**
* The likelihood that the sentiment was correctly inferred.
*/
public val sentimentScore: kotlin.String? = builder.sentimentScore
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.lexruntimeservice.model.SentimentResponse = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("SentimentResponse(")
append("sentimentLabel=$sentimentLabel,")
append("sentimentScore=$sentimentScore")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = sentimentLabel?.hashCode() ?: 0
result = 31 * result + (sentimentScore?.hashCode() ?: 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 SentimentResponse
if (sentimentLabel != other.sentimentLabel) return false
if (sentimentScore != other.sentimentScore) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.lexruntimeservice.model.SentimentResponse = Builder(this).apply(block).build()
public class Builder {
/**
* The inferred sentiment that Amazon Comprehend has the highest confidence in.
*/
public var sentimentLabel: kotlin.String? = null
/**
* The likelihood that the sentiment was correctly inferred.
*/
public var sentimentScore: kotlin.String? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.lexruntimeservice.model.SentimentResponse) : this() {
this.sentimentLabel = x.sentimentLabel
this.sentimentScore = x.sentimentScore
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.lexruntimeservice.model.SentimentResponse = SentimentResponse(this)
internal fun correctErrors(): Builder {
return this
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy