2021-01-28 11:08:25 +00:00
|
|
|
package dev.inmo.tgbotapi.types.passport.encrypted.abstracts
|
2021-01-14 08:03:25 +00:00
|
|
|
|
2021-01-28 10:03:30 +00:00
|
|
|
import dev.inmo.micro_utils.crypto.SourceBytes
|
|
|
|
import dev.inmo.micro_utils.serialization.base64.Base64BytesToFromStringSerializer
|
2022-08-05 18:39:46 +00:00
|
|
|
import dev.inmo.tgbotapi.utils.internal.ClassCastsIncluded
|
2021-01-28 11:08:25 +00:00
|
|
|
import dev.inmo.tgbotapi.types.passport.encrypted.EncryptedElementSerializer
|
2021-01-14 08:03:25 +00:00
|
|
|
import kotlinx.serialization.Serializable
|
|
|
|
import kotlinx.serialization.json.JsonObject
|
|
|
|
|
2021-01-28 10:03:30 +00:00
|
|
|
typealias PassportElementHash = SourceBytes
|
|
|
|
|
2021-01-14 08:03:25 +00:00
|
|
|
@Serializable(EncryptedElementSerializer::class)
|
2022-08-05 10:31:39 +00:00
|
|
|
@ClassCastsIncluded
|
2021-01-14 08:03:25 +00:00
|
|
|
interface EncryptedPassportElement {
|
2021-01-28 10:03:30 +00:00
|
|
|
val hash: PassportElementHash
|
2021-01-14 08:03:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Serializable(EncryptedElementSerializer::class)
|
|
|
|
data class UnknownEncryptedPassportElement(
|
|
|
|
val rawJson: JsonObject,
|
2021-01-28 10:03:30 +00:00
|
|
|
@Serializable(Base64BytesToFromStringSerializer::class)
|
|
|
|
override val hash: PassportElementHash
|
2021-01-14 08:03:25 +00:00
|
|
|
) : EncryptedPassportElement
|