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

com.onfido.api.client.data.LiveVideoChallenges.kt Maven / Gradle / Ivy

package com.onfido.api.client.data

import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
import kotlinx.serialization.Transient

@Serializable
public data class LiveVideoChallenges(
    @SerialName("data")
    val data: LiveVideoChallengesData? = null
) {

    @Serializable
    public data class LiveVideoChallengesData(
        @SerialName("id")
        val id: String? = null,
        @SerialName("challenge")
        val challenge: List? = null
    )

    @Serializable
    public sealed class LiveVideoChallenge {

        // kotlin has it's own "type" variable added to the serialization
        // this is due to the sealed class behaviour
        // the value of the type can be changed by changing the
        // @SerialName() on top of the subclass definitions
        public abstract val type: String
        public abstract val query: Any

        @Serializable
        @SerialName("recite")
        public data class ReciteQuery @JvmOverloads constructor(
            @SerialName("query")
            override val query: List,

            @Transient
            override val type: String = "recite",
        ) : LiveVideoChallenge()

        @Serializable
        @SerialName("movement")
        public data class MovementQuery @JvmOverloads constructor(
            @SerialName("query")
            override val query: String,
            @Transient
            override val type: String = "movement",
        ) : LiveVideoChallenge()
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy