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

commonMain.aws.sdk.kotlin.services.comprehend.model.DocumentLabel.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

/**
 * Specifies one of the label or labels that categorize the document being analyzed.
 */
public class DocumentLabel private constructor(builder: Builder) {
    /**
     * The name of the label.
     */
    public val name: kotlin.String? = builder.name
    /**
     * Page number where the label occurs. This field is present in the response only if your request includes the `Byte` parameter.
     */
    public val page: kotlin.Int? = builder.page
    /**
     * The confidence score that Amazon Comprehend has this label correctly attributed.
     */
    public val score: kotlin.Float? = builder.score

    public companion object {
        public operator fun invoke(block: Builder.() -> kotlin.Unit): aws.sdk.kotlin.services.comprehend.model.DocumentLabel = Builder().apply(block).build()
    }

    override fun toString(): kotlin.String = buildString {
        append("DocumentLabel(")
        append("name=$name,")
        append("page=$page,")
        append("score=$score")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = name?.hashCode() ?: 0
        result = 31 * result + (page ?: 0)
        result = 31 * result + (score?.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 DocumentLabel

        if (name != other.name) return false
        if (page != other.page) return false
        if (!(score?.equals(other.score) ?: (other.score == null))) return false

        return true
    }

    public inline fun copy(block: Builder.() -> kotlin.Unit = {}): aws.sdk.kotlin.services.comprehend.model.DocumentLabel = Builder(this).apply(block).build()

    @SdkDsl
    public class Builder {
        /**
         * The name of the label.
         */
        public var name: kotlin.String? = null
        /**
         * Page number where the label occurs. This field is present in the response only if your request includes the `Byte` parameter.
         */
        public var page: kotlin.Int? = null
        /**
         * The confidence score that Amazon Comprehend has this label correctly attributed.
         */
        public var score: kotlin.Float? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.comprehend.model.DocumentLabel) : this() {
            this.name = x.name
            this.page = x.page
            this.score = x.score
        }

        @PublishedApi
        internal fun build(): aws.sdk.kotlin.services.comprehend.model.DocumentLabel = DocumentLabel(this)

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy