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

commonMain.aws.sdk.kotlin.services.textract.model.ExpenseDetection.kt Maven / Gradle / Ivy

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

package aws.sdk.kotlin.services.textract.model

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * An object used to store information about the Value or Label detected by Amazon Textract.
 */
public class ExpenseDetection private constructor(builder: Builder) {
    /**
     * The confidence in detection, as a percentage
     */
    public val confidence: kotlin.Float? = builder.confidence
    /**
     * Information about where the following items are located on a document page: detected page, text, key-value pairs, tables, table cells, and selection elements.
     */
    public val geometry: aws.sdk.kotlin.services.textract.model.Geometry? = builder.geometry
    /**
     * The word or line of text recognized by Amazon Textract
     */
    public val text: kotlin.String? = builder.text

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

    override fun toString(): kotlin.String = buildString {
        append("ExpenseDetection(")
        append("confidence=$confidence,")
        append("geometry=$geometry,")
        append("text=$text")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = confidence?.hashCode() ?: 0
        result = 31 * result + (geometry?.hashCode() ?: 0)
        result = 31 * result + (text?.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 ExpenseDetection

        if (!(confidence?.equals(other.confidence) ?: (other.confidence == null))) return false
        if (geometry != other.geometry) return false
        if (text != other.text) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The confidence in detection, as a percentage
         */
        public var confidence: kotlin.Float? = null
        /**
         * Information about where the following items are located on a document page: detected page, text, key-value pairs, tables, table cells, and selection elements.
         */
        public var geometry: aws.sdk.kotlin.services.textract.model.Geometry? = null
        /**
         * The word or line of text recognized by Amazon Textract
         */
        public var text: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.textract.model.ExpenseDetection) : this() {
            this.confidence = x.confidence
            this.geometry = x.geometry
            this.text = x.text
        }

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

        /**
         * construct an [aws.sdk.kotlin.services.textract.model.Geometry] inside the given [block]
         */
        public fun geometry(block: aws.sdk.kotlin.services.textract.model.Geometry.Builder.() -> kotlin.Unit) {
            this.geometry = aws.sdk.kotlin.services.textract.model.Geometry.invoke(block)
        }

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy