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

commonMain.aws.sdk.kotlin.services.comprehend.model.BatchDetectSentimentItemResult.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.comprehend.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * The result of calling the operation. The operation returns one object for each document that is successfully processed by the operation.
 */
public class BatchDetectSentimentItemResult private constructor(builder: Builder) {
    /**
     * The zero-based index of the document in the input list.
     */
    public val index: kotlin.Int? = builder.index
    /**
     * The sentiment detected in the document.
     */
    public val sentiment: aws.sdk.kotlin.services.comprehend.model.SentimentType? = builder.sentiment
    /**
     * The level of confidence that Amazon Comprehend has in the accuracy of its sentiment detection.
     */
    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.BatchDetectSentimentItemResult = Builder().apply(block).build()
    }

    override fun toString(): kotlin.String = buildString {
        append("BatchDetectSentimentItemResult(")
        append("index=$index,")
        append("sentiment=$sentiment,")
        append("sentimentScore=$sentimentScore")
        append(")")
    }

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

        if (index != other.index) return false
        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.BatchDetectSentimentItemResult = Builder(this).apply(block).build()

    @SdkDsl
    public class Builder {
        /**
         * The zero-based index of the document in the input list.
         */
        public var index: kotlin.Int? = null
        /**
         * The sentiment detected in the document.
         */
        public var sentiment: aws.sdk.kotlin.services.comprehend.model.SentimentType? = null
        /**
         * The level of confidence that Amazon Comprehend has in the accuracy of its sentiment detection.
         */
        public var sentimentScore: aws.sdk.kotlin.services.comprehend.model.SentimentScore? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.comprehend.model.BatchDetectSentimentItemResult) : this() {
            this.index = x.index
            this.sentiment = x.sentiment
            this.sentimentScore = x.sentimentScore
        }

        @PublishedApi
        internal fun build(): aws.sdk.kotlin.services.comprehend.model.BatchDetectSentimentItemResult = BatchDetectSentimentItemResult(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)
        }

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy