From c1ab9da4c4d3f2eb986a055cf3dd21d63ba74447 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Sun, 17 Jan 2021 16:11:38 +0600 Subject: [PATCH] fix error with deserialization of passport data --- .../tgbotapi/types/passport/encrypted_data/Email.kt | 2 +- .../types/passport/encrypted_data/EncryptedAddress.kt | 2 +- .../encrypted_data/EncryptedPersonalDetails.kt | 2 +- .../tgbotapi/types/passport/encrypted_data/Passport.kt | 4 ++-- .../types/passport/encrypted_data/PhoneNumber.kt | 2 +- .../encrypted_data/TranslatableFilesCollection.kt | 10 +++++----- .../passport/encrypted_data/TranslatableIDDocument.kt | 4 ++-- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted_data/Email.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted_data/Email.kt index 9692375ed7..4770506f5d 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted_data/Email.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted_data/Email.kt @@ -6,7 +6,7 @@ import dev.inmo.tgbotapi.types.passport.encrypted_data.abstracts.WithEmail import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable -@Serializable(EncryptedElementSerializer::class) +@Serializable data class Email( @SerialName(emailField) override val email: String, diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted_data/EncryptedAddress.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted_data/EncryptedAddress.kt index 277bd63670..f31177f85b 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted_data/EncryptedAddress.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted_data/EncryptedAddress.kt @@ -7,7 +7,7 @@ import dev.inmo.tgbotapi.types.passport.encrypted_data.abstracts.WithData import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable -@Serializable(EncryptedElementSerializer::class) +@Serializable data class EncryptedAddress( @SerialName(dataField) override val data: EncryptedData, diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted_data/EncryptedPersonalDetails.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted_data/EncryptedPersonalDetails.kt index 6a21d51bb6..0c5e0cf191 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted_data/EncryptedPersonalDetails.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted_data/EncryptedPersonalDetails.kt @@ -7,7 +7,7 @@ import dev.inmo.tgbotapi.types.passport.encrypted_data.abstracts.WithData import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable -@Serializable(EncryptedElementSerializer::class) +@Serializable data class EncryptedPersonalDetails( @SerialName(dataField) @Serializable(Base64StringSerializer::class) diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted_data/Passport.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted_data/Passport.kt index a666120399..2ddd805bee 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted_data/Passport.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted_data/Passport.kt @@ -10,7 +10,7 @@ import kotlinx.serialization.Serializable @Serializable(EncryptedElementSerializer::class) sealed class Passport : WithData, WithFrontSide, WithSelfie, Translatable -@Serializable(EncryptedElementSerializer::class) +@Serializable data class CommonPassport( @SerialName(dataField) override val data: EncryptedData, @@ -24,7 +24,7 @@ data class CommonPassport( @Serializable(Base64StringSerializer::class) override val hash: String ) : Passport() -@Serializable(EncryptedElementSerializer::class) +@Serializable data class InternalPassport( @SerialName(dataField) override val data: EncryptedData, diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted_data/PhoneNumber.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted_data/PhoneNumber.kt index 8464429264..563339ade1 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted_data/PhoneNumber.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted_data/PhoneNumber.kt @@ -7,7 +7,7 @@ import dev.inmo.tgbotapi.types.phoneNumberField import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable -@Serializable(EncryptedElementSerializer::class) +@Serializable data class PhoneNumber( @SerialName(phoneNumberField) override val phoneNumber: String, diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted_data/TranslatableFilesCollection.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted_data/TranslatableFilesCollection.kt index 1151f305fd..4386527c77 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted_data/TranslatableFilesCollection.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted_data/TranslatableFilesCollection.kt @@ -10,7 +10,7 @@ import kotlinx.serialization.Serializable @Serializable(EncryptedElementSerializer::class) sealed class TranslatableFilesCollection : Translatable, FilesCollection -@Serializable(EncryptedElementSerializer::class) +@Serializable data class UtilityBill( @SerialName(filesField) override val files: List, @@ -20,7 +20,7 @@ data class UtilityBill( @Serializable(Base64StringSerializer::class) override val hash: String ) : TranslatableFilesCollection() -@Serializable(EncryptedElementSerializer::class) +@Serializable data class BankStatement( @SerialName(filesField) override val files: List, @@ -30,7 +30,7 @@ data class BankStatement( @Serializable(Base64StringSerializer::class) override val hash: String ) : TranslatableFilesCollection() -@Serializable(EncryptedElementSerializer::class) +@Serializable data class RentalAgreement( @SerialName(filesField) override val files: List, @@ -40,7 +40,7 @@ data class RentalAgreement( @Serializable(Base64StringSerializer::class) override val hash: String ) : TranslatableFilesCollection() -@Serializable(EncryptedElementSerializer::class) +@Serializable data class PassportRegistration( @SerialName(filesField) override val files: List, @@ -50,7 +50,7 @@ data class PassportRegistration( @Serializable(Base64StringSerializer::class) override val hash: String ) : TranslatableFilesCollection() -@Serializable(EncryptedElementSerializer::class) +@Serializable data class TemporaryRegistration( @SerialName(filesField) override val files: List, diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted_data/TranslatableIDDocument.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted_data/TranslatableIDDocument.kt index e65c856c4e..e6d9fabfc9 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted_data/TranslatableIDDocument.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/passport/encrypted_data/TranslatableIDDocument.kt @@ -10,7 +10,7 @@ import kotlinx.serialization.Serializable @Serializable(EncryptedElementSerializer::class) sealed class TranslatableIDDocument : WithData, WithFrontSide, WithReverseSide, WithSelfie, Translatable -@Serializable(EncryptedElementSerializer::class) +@Serializable data class DriverLicense( @SerialName(dataField) override val data: EncryptedData, @@ -27,7 +27,7 @@ data class DriverLicense( override val hash: String ) : TranslatableIDDocument() -@Serializable(EncryptedElementSerializer::class) +@Serializable data class IdentityCard( @SerialName(dataField) override val data: EncryptedData,