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

commonMain.aws.sdk.kotlin.services.rekognition.model.Instance.kt Maven / Gradle / Ivy

// Code generated by smithy-kotlin-codegen. DO NOT EDIT!

package aws.sdk.kotlin.services.rekognition.model



/**
 * An instance of a label returned by Amazon Rekognition Image (DetectLabels) or by Amazon Rekognition Video (GetLabelDetection).
 */
public class Instance private constructor(builder: Builder) {
    /**
     * The position of the label instance on the image.
     */
    public val boundingBox: aws.sdk.kotlin.services.rekognition.model.BoundingBox? = builder.boundingBox
    /**
     * The confidence that Amazon Rekognition has in the accuracy of the bounding box.
     */
    public val confidence: kotlin.Float? = builder.confidence
    /**
     * The dominant colors found in an individual instance of a label.
     */
    public val dominantColors: List? = builder.dominantColors

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

    override fun toString(): kotlin.String = buildString {
        append("Instance(")
        append("boundingBox=$boundingBox,")
        append("confidence=$confidence,")
        append("dominantColors=$dominantColors")
        append(")")
    }

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

        if (boundingBox != other.boundingBox) return false
        if (confidence != other.confidence) return false
        if (dominantColors != other.dominantColors) return false

        return true
    }

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

    public class Builder {
        /**
         * The position of the label instance on the image.
         */
        public var boundingBox: aws.sdk.kotlin.services.rekognition.model.BoundingBox? = null
        /**
         * The confidence that Amazon Rekognition has in the accuracy of the bounding box.
         */
        public var confidence: kotlin.Float? = null
        /**
         * The dominant colors found in an individual instance of a label.
         */
        public var dominantColors: List? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.rekognition.model.Instance) : this() {
            this.boundingBox = x.boundingBox
            this.confidence = x.confidence
            this.dominantColors = x.dominantColors
        }

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

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

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




© 2015 - 2025 Weber Informatics LLC | Privacy Policy