
commonMain.aws.sdk.kotlin.services.comprehend.model.DetectSentimentResponse.kt Maven / Gradle / Ivy
// Code generated by smithy-kotlin-codegen. DO NOT EDIT!
package aws.sdk.kotlin.services.comprehend.model
public class DetectSentimentResponse private constructor(builder: Builder) {
/**
* The inferred sentiment that Amazon Comprehend has the highest level of confidence in.
*/
public val sentiment: aws.sdk.kotlin.services.comprehend.model.SentimentType? = builder.sentiment
/**
* An object that lists the sentiments, and their corresponding confidence levels.
*/
public val sentimentScore: aws.sdk.kotlin.services.comprehend.model.SentimentScore? = builder.sentimentScore
public companion object {
public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.comprehend.model.DetectSentimentResponse = Builder().apply(block).build()
}
override fun toString(): kotlin.String = buildString {
append("DetectSentimentResponse(")
append("*** Sensitive Data Redacted ***")
append(")")
}
override fun hashCode(): kotlin.Int {
var result = sentiment?.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 DetectSentimentResponse
if (sentiment != other.sentiment) return false
if (sentimentScore != other.sentimentScore) return false
return true
}
public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.comprehend.model.DetectSentimentResponse = Builder(this).apply(block).build()
public class Builder {
/**
* The inferred sentiment that Amazon Comprehend has the highest level of confidence in.
*/
public var sentiment: aws.sdk.kotlin.services.comprehend.model.SentimentType? = null
/**
* An object that lists the sentiments, and their corresponding confidence levels.
*/
public var sentimentScore: aws.sdk.kotlin.services.comprehend.model.SentimentScore? = null
@PublishedApi
internal constructor()
@PublishedApi
internal constructor(x: aws.sdk.kotlin.services.comprehend.model.DetectSentimentResponse) : this() {
this.sentiment = x.sentiment
this.sentimentScore = x.sentimentScore
}
@PublishedApi
internal fun build(): aws.sdk.kotlin.services.comprehend.model.DetectSentimentResponse = DetectSentimentResponse(this)
/**
* construct an [aws.sdk.kotlin.services.comprehend.model.SentimentScore] inside the given [block]
*/
public fun sentimentScore(block: aws.sdk.kotlin.services.comprehend.model.SentimentScore.Builder.() -> kotlin.Unit) {
this.sentimentScore = aws.sdk.kotlin.services.comprehend.model.SentimentScore.invoke(block)
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy