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

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

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

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

import aws.smithy.kotlin.runtime.SdkDsl

/**
 * A custom label detected in an image by a call to DetectCustomLabels.
 */
public class CustomLabel private constructor(builder: Builder) {
    /**
     * The confidence that the model has in the detection of the custom label. The range is 0-100. A higher value indicates a higher confidence.
     */
    public val confidence: kotlin.Float? = builder.confidence
    /**
     * The location of the detected object on the image that corresponds to the custom label. Includes an axis aligned coarse bounding box surrounding the object and a finer grain polygon for more accurate spatial information.
     */
    public val geometry: aws.sdk.kotlin.services.rekognition.model.Geometry? = builder.geometry
    /**
     * The name of the custom label.
     */
    public val name: kotlin.String? = builder.name

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

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

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

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

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The confidence that the model has in the detection of the custom label. The range is 0-100. A higher value indicates a higher confidence.
         */
        public var confidence: kotlin.Float? = null
        /**
         * The location of the detected object on the image that corresponds to the custom label. Includes an axis aligned coarse bounding box surrounding the object and a finer grain polygon for more accurate spatial information.
         */
        public var geometry: aws.sdk.kotlin.services.rekognition.model.Geometry? = null
        /**
         * The name of the custom label.
         */
        public var name: kotlin.String? = null

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.rekognition.model.CustomLabel) : this() {
            this.confidence = x.confidence
            this.geometry = x.geometry
            this.name = x.name
        }

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy