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

commonMain.aws.sdk.kotlin.services.textract.model.AnalyzeIdDetections.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

/**
 * Used to contain the information detected by an AnalyzeID operation.
 */
public class AnalyzeIdDetections private constructor(builder: Builder) {
    /**
     * The confidence score of the detected text.
     */
    public val confidence: kotlin.Float? = builder.confidence
    /**
     * Only returned for dates, returns the type of value detected and the date written in a more machine readable way.
     */
    public val normalizedValue: aws.sdk.kotlin.services.textract.model.NormalizedValue? = builder.normalizedValue
    /**
     * Text of either the normalized field or value associated with it.
     */
    public val text: kotlin.String = requireNotNull(builder.text) { "A non-null value must be provided for text" }

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

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

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

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

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The confidence score of the detected text.
         */
        public var confidence: kotlin.Float? = null
        /**
         * Only returned for dates, returns the type of value detected and the date written in a more machine readable way.
         */
        public var normalizedValue: aws.sdk.kotlin.services.textract.model.NormalizedValue? = null
        /**
         * Text of either the normalized field or value associated with it.
         */
        public var text: kotlin.String? = null

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

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

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

        internal fun correctErrors(): Builder {
            if (text == null) text = ""
            return this
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy