mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2025-12-23 06:35:42 +00:00
add SecureData and DecryptedCredentials
This commit is contained in:
@@ -379,3 +379,17 @@ const val fileHashField = "file_hash"
|
||||
const val fileHashesField = "file_hashes"
|
||||
const val messageField = "message"
|
||||
const val unspecifiedField = "unspecified"
|
||||
|
||||
const val secureDataField = "secure_data"
|
||||
const val nonceField = "nonce"
|
||||
|
||||
const val personalDetailsField = "personal_details"
|
||||
const val passportField = "passport"
|
||||
const val internalPassportField = "internal_passport"
|
||||
const val driverLicenseField = "driver_license"
|
||||
const val identityCardField = "identity_card"
|
||||
const val utilityBillField = "utility_bill"
|
||||
const val bankStatementField = "bank_statement"
|
||||
const val rentalAgreementField = "rental_agreement"
|
||||
const val passportRegistrationField = "passport_registration"
|
||||
const val temporaryRegistrationField = "temporary_registration"
|
||||
|
||||
@@ -2,7 +2,8 @@ package dev.inmo.tgbotapi.types.passport
|
||||
|
||||
import dev.inmo.tgbotapi.types.credentialsField
|
||||
import dev.inmo.tgbotapi.types.dataField
|
||||
import dev.inmo.tgbotapi.types.passport.encrypted_data.abstracts.EncryptedPassportElement
|
||||
import dev.inmo.tgbotapi.types.passport.credentials.EncryptedCredentials
|
||||
import dev.inmo.tgbotapi.types.passport.encrypted.abstracts.EncryptedPassportElement
|
||||
import kotlinx.serialization.SerialName
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
|
||||
@@ -6,8 +6,8 @@ import dev.inmo.micro_utils.crypto.MD5
|
||||
import dev.inmo.micro_utils.crypto.md5
|
||||
import dev.inmo.micro_utils.serialization.base64.Base64BytesToFromStringSerializer
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.passport.encrypted_data.abstracts.*
|
||||
import dev.inmo.tgbotapi.types.passport.encrypted_data.type
|
||||
import dev.inmo.tgbotapi.types.passport.encrypted.abstracts.*
|
||||
import dev.inmo.tgbotapi.types.passport.encrypted.type
|
||||
import dev.inmo.tgbotapi.utils.nonstrictJsonFormat
|
||||
import kotlinx.serialization.*
|
||||
import kotlinx.serialization.descriptors.SerialDescriptor
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
package dev.inmo.tgbotapi.types.passport.credentials
|
||||
|
||||
import dev.inmo.tgbotapi.types.dataHashField
|
||||
import dev.inmo.tgbotapi.types.secretField
|
||||
import kotlinx.serialization.SerialName
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
@Serializable
|
||||
data class DataCredentials(
|
||||
@SerialName(dataHashField)
|
||||
val dataHash: String,
|
||||
@SerialName(secretField)
|
||||
val secret: String
|
||||
)
|
||||
@@ -0,0 +1,15 @@
|
||||
package dev.inmo.tgbotapi.types.passport.credentials
|
||||
|
||||
import dev.inmo.tgbotapi.types.nonceField
|
||||
import dev.inmo.tgbotapi.types.passport.decrypted.SecureData
|
||||
import dev.inmo.tgbotapi.types.secureDataField
|
||||
import kotlinx.serialization.SerialName
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
@Serializable
|
||||
data class DecryptedCredentials(
|
||||
@SerialName(secureDataField)
|
||||
val secureData: List<SecureData>,
|
||||
@SerialName(nonceField)
|
||||
val nonce: String
|
||||
)
|
||||
@@ -1,4 +1,4 @@
|
||||
package dev.inmo.tgbotapi.types.passport
|
||||
package dev.inmo.tgbotapi.types.passport.credentials
|
||||
|
||||
import dev.inmo.micro_utils.crypto.SourceBytes
|
||||
import dev.inmo.micro_utils.serialization.base64.Base64BytesToFromStringSerializer
|
||||
@@ -0,0 +1,13 @@
|
||||
package dev.inmo.tgbotapi.types.passport.credentials
|
||||
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import kotlinx.serialization.SerialName
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
@Serializable
|
||||
data class FileCredentials(
|
||||
@SerialName(fileHashField)
|
||||
val fileHash: String,
|
||||
@SerialName(secretField)
|
||||
val secret: String
|
||||
)
|
||||
@@ -0,0 +1,13 @@
|
||||
package dev.inmo.tgbotapi.types.passport.decrypted
|
||||
|
||||
import dev.inmo.tgbotapi.types.dataField
|
||||
import dev.inmo.tgbotapi.types.passport.credentials.DataCredentials
|
||||
import dev.inmo.tgbotapi.types.passport.decrypted.abstracts.SecureValueWithData
|
||||
import kotlinx.serialization.SerialName
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
@Serializable
|
||||
data class AddressSecureValue(
|
||||
@SerialName(dataField)
|
||||
override val data: DataCredentials
|
||||
) : SecureValueWithData
|
||||
@@ -0,0 +1,39 @@
|
||||
package dev.inmo.tgbotapi.types.passport.decrypted
|
||||
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.passport.credentials.DataCredentials
|
||||
import dev.inmo.tgbotapi.types.passport.credentials.FileCredentials
|
||||
import dev.inmo.tgbotapi.types.passport.decrypted.abstracts.*
|
||||
import kotlinx.serialization.SerialName
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
@Serializable
|
||||
sealed class IdentityWithReverseSideSecureValue : SecureValueIdentity, SecureValueWithData, SecureValueWithTranslations, SecureValueWithReverseSide
|
||||
|
||||
@Serializable
|
||||
data class DriverLicenseSecureValue(
|
||||
@SerialName(dataField)
|
||||
override val data: DataCredentials,
|
||||
@SerialName(frontSideField)
|
||||
override val frontSide: FileCredentials,
|
||||
@SerialName(reverseSideField)
|
||||
override val reverseSide: FileCredentials,
|
||||
@SerialName(selfieField)
|
||||
override val selfie: FileCredentials,
|
||||
@SerialName(translationField)
|
||||
override val translation: List<FileCredentials>
|
||||
) : IdentityWithReverseSideSecureValue()
|
||||
|
||||
@Serializable
|
||||
data class IdentityCardSecureValue(
|
||||
@SerialName(dataField)
|
||||
override val data: DataCredentials,
|
||||
@SerialName(frontSideField)
|
||||
override val frontSide: FileCredentials,
|
||||
@SerialName(reverseSideField)
|
||||
override val reverseSide: FileCredentials,
|
||||
@SerialName(selfieField)
|
||||
override val selfie: FileCredentials,
|
||||
@SerialName(translationField)
|
||||
override val translation: List<FileCredentials>
|
||||
) : IdentityWithReverseSideSecureValue()
|
||||
@@ -0,0 +1,52 @@
|
||||
package dev.inmo.tgbotapi.types.passport.decrypted
|
||||
|
||||
import dev.inmo.tgbotapi.types.filesField
|
||||
import dev.inmo.tgbotapi.types.passport.credentials.FileCredentials
|
||||
import dev.inmo.tgbotapi.types.passport.decrypted.abstracts.SecureValueWithFiles
|
||||
import dev.inmo.tgbotapi.types.passport.decrypted.abstracts.SecureValueWithTranslations
|
||||
import dev.inmo.tgbotapi.types.translationField
|
||||
import kotlinx.serialization.SerialName
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
@Serializable
|
||||
sealed class OtherDocumentsSecureValue : SecureValueWithTranslations, SecureValueWithFiles
|
||||
|
||||
@Serializable
|
||||
data class UtilityBillSecureValue(
|
||||
@SerialName(translationField)
|
||||
override val translation: List<FileCredentials>,
|
||||
@SerialName(filesField)
|
||||
override val files: List<FileCredentials>
|
||||
) : OtherDocumentsSecureValue()
|
||||
|
||||
@Serializable
|
||||
data class BankStatementSecureValue(
|
||||
@SerialName(translationField)
|
||||
override val translation: List<FileCredentials>,
|
||||
@SerialName(filesField)
|
||||
override val files: List<FileCredentials>
|
||||
) : OtherDocumentsSecureValue()
|
||||
|
||||
@Serializable
|
||||
data class RentalAgreementSecureValue(
|
||||
@SerialName(translationField)
|
||||
override val translation: List<FileCredentials>,
|
||||
@SerialName(filesField)
|
||||
override val files: List<FileCredentials>
|
||||
) : OtherDocumentsSecureValue()
|
||||
|
||||
@Serializable
|
||||
data class PassportRegistrationSecureValue(
|
||||
@SerialName(translationField)
|
||||
override val translation: List<FileCredentials>,
|
||||
@SerialName(filesField)
|
||||
override val files: List<FileCredentials>
|
||||
) : OtherDocumentsSecureValue()
|
||||
|
||||
@Serializable
|
||||
data class TemporalRegistrationSecureValue(
|
||||
@SerialName(translationField)
|
||||
override val translation: List<FileCredentials>,
|
||||
@SerialName(filesField)
|
||||
override val files: List<FileCredentials>
|
||||
) : OtherDocumentsSecureValue()
|
||||
@@ -0,0 +1,36 @@
|
||||
package dev.inmo.tgbotapi.types.passport.decrypted
|
||||
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.passport.credentials.DataCredentials
|
||||
import dev.inmo.tgbotapi.types.passport.credentials.FileCredentials
|
||||
import dev.inmo.tgbotapi.types.passport.decrypted.abstracts.*
|
||||
import kotlinx.serialization.SerialName
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
@Serializable
|
||||
sealed class PassportSecureValue : SecureValueIdentity, SecureValueWithData, SecureValueWithTranslations
|
||||
|
||||
@Serializable
|
||||
data class CommonPassportSecureValue(
|
||||
@SerialName(dataField)
|
||||
override val data: DataCredentials,
|
||||
@SerialName(frontSideField)
|
||||
override val frontSide: FileCredentials,
|
||||
@SerialName(selfieField)
|
||||
override val selfie: FileCredentials,
|
||||
@SerialName(translationField)
|
||||
override val translation: List<FileCredentials>
|
||||
) : PassportSecureValue()
|
||||
|
||||
@Serializable
|
||||
data class InternalPassportSecureValue(
|
||||
@SerialName(dataField)
|
||||
override val data: DataCredentials,
|
||||
@SerialName(frontSideField)
|
||||
override val frontSide: FileCredentials,
|
||||
@SerialName(selfieField)
|
||||
override val selfie: FileCredentials,
|
||||
@SerialName(translationField)
|
||||
override val translation: List<FileCredentials>
|
||||
) : PassportSecureValue()
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
package dev.inmo.tgbotapi.types.passport.decrypted
|
||||
|
||||
import dev.inmo.tgbotapi.types.dataField
|
||||
import dev.inmo.tgbotapi.types.passport.credentials.DataCredentials
|
||||
import dev.inmo.tgbotapi.types.passport.decrypted.abstracts.SecureValueWithData
|
||||
import kotlinx.serialization.SerialName
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
@Serializable
|
||||
data class PersonalDetailsSecureValue(
|
||||
@SerialName(dataField)
|
||||
override val data: DataCredentials
|
||||
) : SecureValueWithData
|
||||
@@ -0,0 +1,29 @@
|
||||
package dev.inmo.tgbotapi.types.passport.decrypted
|
||||
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import kotlinx.serialization.SerialName
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
@Serializable
|
||||
data class SecureData(
|
||||
@SerialName(personalDetailsField)
|
||||
val personalDetails: PersonalDetailsSecureValue? = null,
|
||||
@SerialName(passportField)
|
||||
val passport: PassportSecureValue? = null,
|
||||
@SerialName(internalPassportField)
|
||||
val internalPassport: InternalPassportSecureValue? = null,
|
||||
@SerialName(driverLicenseField)
|
||||
val driverLicense: DriverLicenseSecureValue? = null,
|
||||
@SerialName(identityCardField)
|
||||
val identityCard: IdentityCardSecureValue? = null,
|
||||
@SerialName(utilityBillField)
|
||||
val utilityBill: UtilityBillSecureValue? = null,
|
||||
@SerialName(bankStatementField)
|
||||
val bankStatement: BankStatementSecureValue? = null,
|
||||
@SerialName(rentalAgreementField)
|
||||
val rentalAgreement: RentalAgreementSecureValue? = null,
|
||||
@SerialName(passportRegistrationField)
|
||||
val passportRegistration: PassportRegistrationSecureValue? = null,
|
||||
@SerialName(temporaryRegistrationField)
|
||||
val temporaryRegistration: TemporalRegistrationSecureValue? = null,
|
||||
)
|
||||
@@ -0,0 +1,3 @@
|
||||
package dev.inmo.tgbotapi.types.passport.decrypted.abstracts
|
||||
|
||||
interface SecureValue
|
||||
@@ -0,0 +1,8 @@
|
||||
package dev.inmo.tgbotapi.types.passport.decrypted.abstracts
|
||||
|
||||
import dev.inmo.tgbotapi.types.passport.credentials.FileCredentials
|
||||
|
||||
interface SecureValueIdentity : SecureValue {
|
||||
val frontSide: FileCredentials
|
||||
val selfie: FileCredentials
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package dev.inmo.tgbotapi.types.passport.decrypted.abstracts
|
||||
|
||||
import dev.inmo.tgbotapi.types.passport.credentials.DataCredentials
|
||||
|
||||
interface SecureValueWithData : SecureValue {
|
||||
val data: DataCredentials
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package dev.inmo.tgbotapi.types.passport.decrypted.abstracts
|
||||
|
||||
import dev.inmo.tgbotapi.types.passport.credentials.FileCredentials
|
||||
|
||||
interface SecureValueWithFiles : SecureValue {
|
||||
val files: List<FileCredentials>
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package dev.inmo.tgbotapi.types.passport.decrypted.abstracts
|
||||
|
||||
import dev.inmo.tgbotapi.types.passport.credentials.FileCredentials
|
||||
|
||||
interface SecureValueWithReverseSide : SecureValue {
|
||||
val reverseSide: FileCredentials
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
package dev.inmo.tgbotapi.types.passport.decrypted.abstracts
|
||||
|
||||
import dev.inmo.tgbotapi.types.passport.credentials.FileCredentials
|
||||
|
||||
interface SecureValueWithTranslations : SecureValue {
|
||||
val translation: List<FileCredentials>
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
package dev.inmo.tgbotapi.types.passport.encrypted_data
|
||||
package dev.inmo.tgbotapi.types.passport.encrypted
|
||||
|
||||
import dev.inmo.micro_utils.serialization.base64.Base64BytesToFromStringSerializer
|
||||
import dev.inmo.tgbotapi.types.emailField
|
||||
import dev.inmo.tgbotapi.types.hashField
|
||||
import dev.inmo.tgbotapi.types.passport.encrypted_data.abstracts.PassportElementHash
|
||||
import dev.inmo.tgbotapi.types.passport.encrypted_data.abstracts.WithEmail
|
||||
import dev.inmo.tgbotapi.types.passport.encrypted.abstracts.PassportElementHash
|
||||
import dev.inmo.tgbotapi.types.passport.encrypted.abstracts.WithEmail
|
||||
import kotlinx.serialization.SerialName
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package dev.inmo.tgbotapi.types.passport.encrypted_data
|
||||
package dev.inmo.tgbotapi.types.passport.encrypted
|
||||
|
||||
import dev.inmo.micro_utils.serialization.base64.Base64BytesToFromStringSerializer
|
||||
import dev.inmo.tgbotapi.types.dataField
|
||||
import dev.inmo.tgbotapi.types.passport.EncryptedData
|
||||
import dev.inmo.tgbotapi.types.passport.encrypted_data.abstracts.PassportElementHash
|
||||
import dev.inmo.tgbotapi.types.passport.encrypted_data.abstracts.WithData
|
||||
import dev.inmo.tgbotapi.types.passport.credentials.EncryptedData
|
||||
import dev.inmo.tgbotapi.types.passport.encrypted.abstracts.PassportElementHash
|
||||
import dev.inmo.tgbotapi.types.passport.encrypted.abstracts.WithData
|
||||
import kotlinx.serialization.SerialName
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package dev.inmo.tgbotapi.types.passport.encrypted_data
|
||||
package dev.inmo.tgbotapi.types.passport.encrypted
|
||||
|
||||
import dev.inmo.micro_utils.crypto.decodeBase64
|
||||
import dev.inmo.micro_utils.serialization.encapsulator.Encapsulator
|
||||
import dev.inmo.tgbotapi.types.hashField
|
||||
import dev.inmo.tgbotapi.types.passport.encrypted_data.abstracts.EncryptedPassportElement
|
||||
import dev.inmo.tgbotapi.types.passport.encrypted_data.abstracts.UnknownEncryptedPassportElement
|
||||
import dev.inmo.tgbotapi.types.passport.encrypted.abstracts.EncryptedPassportElement
|
||||
import dev.inmo.tgbotapi.types.passport.encrypted.abstracts.UnknownEncryptedPassportElement
|
||||
import dev.inmo.tgbotapi.types.typeField
|
||||
import dev.inmo.tgbotapi.utils.RiskFeature
|
||||
import dev.inmo.tgbotapi.utils.nonstrictJsonFormat
|
||||
@@ -1,10 +1,10 @@
|
||||
package dev.inmo.tgbotapi.types.passport.encrypted_data
|
||||
package dev.inmo.tgbotapi.types.passport.encrypted
|
||||
|
||||
import dev.inmo.micro_utils.serialization.base64.Base64BytesToFromStringSerializer
|
||||
import dev.inmo.tgbotapi.types.dataField
|
||||
import dev.inmo.tgbotapi.types.passport.EncryptedData
|
||||
import dev.inmo.tgbotapi.types.passport.encrypted_data.abstracts.PassportElementHash
|
||||
import dev.inmo.tgbotapi.types.passport.encrypted_data.abstracts.WithData
|
||||
import dev.inmo.tgbotapi.types.passport.credentials.EncryptedData
|
||||
import dev.inmo.tgbotapi.types.passport.encrypted.abstracts.PassportElementHash
|
||||
import dev.inmo.tgbotapi.types.passport.encrypted.abstracts.WithData
|
||||
import kotlinx.serialization.SerialName
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package dev.inmo.tgbotapi.types.passport.encrypted_data
|
||||
package dev.inmo.tgbotapi.types.passport.encrypted
|
||||
|
||||
import dev.inmo.micro_utils.serialization.base64.Base64BytesToFromStringSerializer
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.passport.EncryptedData
|
||||
import dev.inmo.tgbotapi.types.passport.encrypted_data.abstracts.*
|
||||
import dev.inmo.tgbotapi.types.passport.credentials.EncryptedData
|
||||
import dev.inmo.tgbotapi.types.passport.encrypted.abstracts.*
|
||||
import kotlinx.serialization.SerialName
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package dev.inmo.tgbotapi.types.passport.encrypted_data
|
||||
package dev.inmo.tgbotapi.types.passport.encrypted
|
||||
|
||||
import dev.inmo.tgbotapi.requests.abstracts.FileId
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
@@ -1,9 +1,9 @@
|
||||
package dev.inmo.tgbotapi.types.passport.encrypted_data
|
||||
package dev.inmo.tgbotapi.types.passport.encrypted
|
||||
|
||||
import dev.inmo.micro_utils.serialization.base64.Base64BytesToFromStringSerializer
|
||||
import dev.inmo.tgbotapi.types.hashField
|
||||
import dev.inmo.tgbotapi.types.passport.encrypted_data.abstracts.PassportElementHash
|
||||
import dev.inmo.tgbotapi.types.passport.encrypted_data.abstracts.WithPhoneNumber
|
||||
import dev.inmo.tgbotapi.types.passport.encrypted.abstracts.PassportElementHash
|
||||
import dev.inmo.tgbotapi.types.passport.encrypted.abstracts.WithPhoneNumber
|
||||
import dev.inmo.tgbotapi.types.phoneNumberField
|
||||
import kotlinx.serialization.SerialName
|
||||
import kotlinx.serialization.Serializable
|
||||
@@ -1,8 +1,8 @@
|
||||
package dev.inmo.tgbotapi.types.passport.encrypted_data
|
||||
package dev.inmo.tgbotapi.types.passport.encrypted
|
||||
|
||||
import dev.inmo.micro_utils.serialization.base64.Base64BytesToFromStringSerializer
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.passport.encrypted_data.abstracts.*
|
||||
import dev.inmo.tgbotapi.types.passport.encrypted.abstracts.*
|
||||
import kotlinx.serialization.SerialName
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package dev.inmo.tgbotapi.types.passport.encrypted_data
|
||||
package dev.inmo.tgbotapi.types.passport.encrypted
|
||||
|
||||
import dev.inmo.micro_utils.serialization.base64.Base64BytesToFromStringSerializer
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.passport.EncryptedData
|
||||
import dev.inmo.tgbotapi.types.passport.encrypted_data.abstracts.*
|
||||
import dev.inmo.tgbotapi.types.passport.credentials.EncryptedData
|
||||
import dev.inmo.tgbotapi.types.passport.encrypted.abstracts.*
|
||||
import kotlinx.serialization.SerialName
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package dev.inmo.tgbotapi.types.passport.encrypted_data.abstracts
|
||||
package dev.inmo.tgbotapi.types.passport.encrypted.abstracts
|
||||
|
||||
import dev.inmo.micro_utils.crypto.SourceBytes
|
||||
import dev.inmo.micro_utils.serialization.base64.Base64BytesToFromStringSerializer
|
||||
import dev.inmo.tgbotapi.types.passport.encrypted_data.EncryptedElementSerializer
|
||||
import dev.inmo.tgbotapi.types.passport.encrypted.EncryptedElementSerializer
|
||||
import kotlinx.serialization.Serializable
|
||||
import kotlinx.serialization.json.JsonObject
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
package dev.inmo.tgbotapi.types.passport.encrypted.abstracts
|
||||
|
||||
import dev.inmo.tgbotapi.types.passport.encrypted.EncryptedElementSerializer
|
||||
import dev.inmo.tgbotapi.types.passport.encrypted.PassportFile
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
@Serializable(EncryptedElementSerializer::class)
|
||||
interface FilesCollection : EncryptedPassportElement {
|
||||
val files: List<PassportFile>
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package dev.inmo.tgbotapi.types.passport.encrypted.abstracts
|
||||
|
||||
import dev.inmo.tgbotapi.types.passport.encrypted.EncryptedElementSerializer
|
||||
import dev.inmo.tgbotapi.types.passport.encrypted.PassportFile
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
@Serializable(EncryptedElementSerializer::class)
|
||||
interface Translatable : EncryptedPassportElement {
|
||||
val translations: List<PassportFile>
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package dev.inmo.tgbotapi.types.passport.encrypted.abstracts
|
||||
|
||||
import dev.inmo.tgbotapi.types.passport.credentials.EncryptedData
|
||||
import dev.inmo.tgbotapi.types.passport.encrypted.EncryptedElementSerializer
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
@Serializable(EncryptedElementSerializer::class)
|
||||
interface WithData : EncryptedPassportElement {
|
||||
val data: EncryptedData
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
package dev.inmo.tgbotapi.types.passport.encrypted_data.abstracts
|
||||
package dev.inmo.tgbotapi.types.passport.encrypted.abstracts
|
||||
|
||||
import dev.inmo.tgbotapi.types.passport.encrypted_data.EncryptedElementSerializer
|
||||
import dev.inmo.tgbotapi.types.passport.encrypted.EncryptedElementSerializer
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
@Serializable(EncryptedElementSerializer::class)
|
||||
@@ -0,0 +1,10 @@
|
||||
package dev.inmo.tgbotapi.types.passport.encrypted.abstracts
|
||||
|
||||
import dev.inmo.tgbotapi.types.passport.encrypted.EncryptedElementSerializer
|
||||
import dev.inmo.tgbotapi.types.passport.encrypted.PassportFile
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
@Serializable(EncryptedElementSerializer::class)
|
||||
interface WithFrontSide : EncryptedPassportElement {
|
||||
val frontSide: PassportFile?
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
package dev.inmo.tgbotapi.types.passport.encrypted_data.abstracts
|
||||
package dev.inmo.tgbotapi.types.passport.encrypted.abstracts
|
||||
|
||||
import dev.inmo.tgbotapi.types.passport.encrypted_data.EncryptedElementSerializer
|
||||
import dev.inmo.tgbotapi.types.passport.encrypted.EncryptedElementSerializer
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
@Serializable(EncryptedElementSerializer::class)
|
||||
@@ -0,0 +1,10 @@
|
||||
package dev.inmo.tgbotapi.types.passport.encrypted.abstracts
|
||||
|
||||
import dev.inmo.tgbotapi.types.passport.encrypted.EncryptedElementSerializer
|
||||
import dev.inmo.tgbotapi.types.passport.encrypted.PassportFile
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
@Serializable(EncryptedElementSerializer::class)
|
||||
interface WithReverseSide : EncryptedPassportElement {
|
||||
val reverseSide: PassportFile?
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package dev.inmo.tgbotapi.types.passport.encrypted.abstracts
|
||||
|
||||
import dev.inmo.tgbotapi.types.passport.encrypted.EncryptedElementSerializer
|
||||
import dev.inmo.tgbotapi.types.passport.encrypted.PassportFile
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
@Serializable(EncryptedElementSerializer::class)
|
||||
interface WithSelfie : EncryptedPassportElement {
|
||||
val selfie: PassportFile?
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
package dev.inmo.tgbotapi.types.passport.encrypted_data.abstracts
|
||||
|
||||
import dev.inmo.tgbotapi.types.passport.encrypted_data.EncryptedElementSerializer
|
||||
import dev.inmo.tgbotapi.types.passport.encrypted_data.PassportFile
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
@Serializable(EncryptedElementSerializer::class)
|
||||
interface FilesCollection : EncryptedPassportElement {
|
||||
val files: List<PassportFile>
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
package dev.inmo.tgbotapi.types.passport.encrypted_data.abstracts
|
||||
|
||||
import dev.inmo.tgbotapi.types.passport.encrypted_data.EncryptedElementSerializer
|
||||
import dev.inmo.tgbotapi.types.passport.encrypted_data.PassportFile
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
@Serializable(EncryptedElementSerializer::class)
|
||||
interface Translatable : EncryptedPassportElement {
|
||||
val translations: List<PassportFile>
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
package dev.inmo.tgbotapi.types.passport.encrypted_data.abstracts
|
||||
|
||||
import dev.inmo.tgbotapi.types.passport.EncryptedData
|
||||
import dev.inmo.tgbotapi.types.passport.encrypted_data.EncryptedElementSerializer
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
@Serializable(EncryptedElementSerializer::class)
|
||||
interface WithData : EncryptedPassportElement {
|
||||
val data: EncryptedData
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
package dev.inmo.tgbotapi.types.passport.encrypted_data.abstracts
|
||||
|
||||
import dev.inmo.tgbotapi.types.passport.encrypted_data.EncryptedElementSerializer
|
||||
import dev.inmo.tgbotapi.types.passport.encrypted_data.PassportFile
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
@Serializable(EncryptedElementSerializer::class)
|
||||
interface WithFrontSide : EncryptedPassportElement {
|
||||
val frontSide: PassportFile?
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
package dev.inmo.tgbotapi.types.passport.encrypted_data.abstracts
|
||||
|
||||
import dev.inmo.tgbotapi.types.passport.encrypted_data.EncryptedElementSerializer
|
||||
import dev.inmo.tgbotapi.types.passport.encrypted_data.PassportFile
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
@Serializable(EncryptedElementSerializer::class)
|
||||
interface WithReverseSide : EncryptedPassportElement {
|
||||
val reverseSide: PassportFile?
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
package dev.inmo.tgbotapi.types.passport.encrypted_data.abstracts
|
||||
|
||||
import dev.inmo.tgbotapi.types.passport.encrypted_data.EncryptedElementSerializer
|
||||
import dev.inmo.tgbotapi.types.passport.encrypted_data.PassportFile
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
@Serializable(EncryptedElementSerializer::class)
|
||||
interface WithSelfie : EncryptedPassportElement {
|
||||
val selfie: PassportFile?
|
||||
}
|
||||
@@ -3,9 +3,8 @@ package dev.inmo.tgbotapi.utils.passport
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.DownloadFile
|
||||
import dev.inmo.tgbotapi.requests.get.GetFile
|
||||
import dev.inmo.tgbotapi.types.passport.EncryptedCredentials
|
||||
import dev.inmo.tgbotapi.types.passport.encrypted_data.PassportFile
|
||||
import dev.inmo.tgbotapi.types.passport.encrypted_data.abstracts.WithData
|
||||
import dev.inmo.tgbotapi.types.passport.credentials.EncryptedCredentials
|
||||
import dev.inmo.tgbotapi.types.passport.encrypted.PassportFile
|
||||
import dev.inmo.tgbotapi.utils.nonstrictJsonFormat
|
||||
import kotlinx.serialization.json.JsonObject
|
||||
|
||||
|
||||
Reference in New Issue
Block a user