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

commonMain.aws.sdk.kotlin.services.rekognition.model.LabelDetection.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

/**
 * Information about a label detected in a video analysis request and the time the label was detected in the video.
 */
public class LabelDetection private constructor(builder: Builder) {
    /**
     * The time duration of a segment in milliseconds, I.e. time elapsed from StartTimestampMillis to EndTimestampMillis.
     */
    public val durationMillis: kotlin.Long? = builder.durationMillis
    /**
     * The time in milliseconds defining the end of the timeline segment containing a continuously detected label.
     */
    public val endTimestampMillis: kotlin.Long? = builder.endTimestampMillis
    /**
     * Details about the detected label.
     */
    public val label: aws.sdk.kotlin.services.rekognition.model.Label? = builder.label
    /**
     * The time in milliseconds defining the start of the timeline segment containing a continuously detected label.
     */
    public val startTimestampMillis: kotlin.Long? = builder.startTimestampMillis
    /**
     * Time, in milliseconds from the start of the video, that the label was detected. Note that `Timestamp` is not guaranteed to be accurate to the individual frame where the label first appears.
     */
    public val timestamp: kotlin.Long = builder.timestamp

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

    override fun toString(): kotlin.String = buildString {
        append("LabelDetection(")
        append("durationMillis=$durationMillis,")
        append("endTimestampMillis=$endTimestampMillis,")
        append("label=$label,")
        append("startTimestampMillis=$startTimestampMillis,")
        append("timestamp=$timestamp")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = durationMillis?.hashCode() ?: 0
        result = 31 * result + (endTimestampMillis?.hashCode() ?: 0)
        result = 31 * result + (label?.hashCode() ?: 0)
        result = 31 * result + (startTimestampMillis?.hashCode() ?: 0)
        result = 31 * result + (timestamp.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 LabelDetection

        if (durationMillis != other.durationMillis) return false
        if (endTimestampMillis != other.endTimestampMillis) return false
        if (label != other.label) return false
        if (startTimestampMillis != other.startTimestampMillis) return false
        if (timestamp != other.timestamp) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The time duration of a segment in milliseconds, I.e. time elapsed from StartTimestampMillis to EndTimestampMillis.
         */
        public var durationMillis: kotlin.Long? = null
        /**
         * The time in milliseconds defining the end of the timeline segment containing a continuously detected label.
         */
        public var endTimestampMillis: kotlin.Long? = null
        /**
         * Details about the detected label.
         */
        public var label: aws.sdk.kotlin.services.rekognition.model.Label? = null
        /**
         * The time in milliseconds defining the start of the timeline segment containing a continuously detected label.
         */
        public var startTimestampMillis: kotlin.Long? = null
        /**
         * Time, in milliseconds from the start of the video, that the label was detected. Note that `Timestamp` is not guaranteed to be accurate to the individual frame where the label first appears.
         */
        public var timestamp: kotlin.Long = 0L

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.rekognition.model.LabelDetection) : this() {
            this.durationMillis = x.durationMillis
            this.endTimestampMillis = x.endTimestampMillis
            this.label = x.label
            this.startTimestampMillis = x.startTimestampMillis
            this.timestamp = x.timestamp
        }

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy