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

commonMain.aws.sdk.kotlin.services.rekognition.model.FaceDetection.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 face detected in a video analysis request and the time the face was detected in the video.
 */
public class FaceDetection private constructor(builder: Builder) {
    /**
     * The face properties for the detected face.
     */
    public val face: aws.sdk.kotlin.services.rekognition.model.FaceDetail? = builder.face
    /**
     * Time, in milliseconds from the start of the video, that the face was detected. Note that `Timestamp` is not guaranteed to be accurate to the individual frame where the face 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.FaceDetection = Builder().apply(block).build()
    }

    override fun toString(): kotlin.String = buildString {
        append("FaceDetection(")
        append("face=$face,")
        append("timestamp=$timestamp")
        append(")")
    }

    override fun hashCode(): kotlin.Int {
        var result = face?.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 FaceDetection

        if (face != other.face) return false
        if (timestamp != other.timestamp) return false

        return true
    }

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

    @SdkDsl
    public class Builder {
        /**
         * The face properties for the detected face.
         */
        public var face: aws.sdk.kotlin.services.rekognition.model.FaceDetail? = null
        /**
         * Time, in milliseconds from the start of the video, that the face was detected. Note that `Timestamp` is not guaranteed to be accurate to the individual frame where the face first appears.
         */
        public var timestamp: kotlin.Long = 0L

        @PublishedApi
        internal constructor()
        @PublishedApi
        internal constructor(x: aws.sdk.kotlin.services.rekognition.model.FaceDetection) : this() {
            this.face = x.face
            this.timestamp = x.timestamp
        }

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy