ferrisgram/types/
encrypted_passport_element.rs

1// WARNING: THIS CODE IS AUTOGENERATED.
2// DO NOT EDIT!!!
3
4use crate::types::PassportFile;
5use serde::{Deserialize, Serialize};
6
7/// Describes documents or other Telegram Passport elements shared with the bot by the user.
8/// <https://core.telegram.org/bots/api#encryptedpassportelement>
9#[derive(Serialize, Deserialize, Debug, Clone)]
10pub struct EncryptedPassportElement {
11    /// Element type. One of "personal_details", "passport", "driver_license", "identity_card", "internal_passport", "address", "utility_bill", "bank_statement", "rental_agreement", "passport_registration", "temporary_registration", "phone_number", "email".
12    pub r#type: String,
13    /// Optional. Base64-encoded encrypted Telegram Passport element data provided by the user; available only for "personal_details", "passport", "driver_license", "identity_card", "internal_passport" and "address" types. Can be decrypted and verified using the accompanying EncryptedCredentials.
14    #[serde(skip_serializing_if = "Option::is_none")]
15    pub data: Option<String>,
16    /// Optional. User's verified phone number; available only for "phone_number" type
17    #[serde(skip_serializing_if = "Option::is_none")]
18    pub phone_number: Option<String>,
19    /// Optional. User's verified email address; available only for "email" type
20    #[serde(skip_serializing_if = "Option::is_none")]
21    pub email: Option<String>,
22    /// Optional. Array of encrypted files with documents provided by the user; available only for "utility_bill", "bank_statement", "rental_agreement", "passport_registration" and "temporary_registration" types. Files can be decrypted and verified using the accompanying EncryptedCredentials.
23    #[serde(skip_serializing_if = "Option::is_none")]
24    pub files: Option<Vec<PassportFile>>,
25    /// Optional. Encrypted file with the front side of the document, provided by the user; available only for "passport", "driver_license", "identity_card" and "internal_passport". The file can be decrypted and verified using the accompanying EncryptedCredentials.
26    #[serde(skip_serializing_if = "Option::is_none")]
27    pub front_side: Option<PassportFile>,
28    /// Optional. Encrypted file with the reverse side of the document, provided by the user; available only for "driver_license" and "identity_card". The file can be decrypted and verified using the accompanying EncryptedCredentials.
29    #[serde(skip_serializing_if = "Option::is_none")]
30    pub reverse_side: Option<PassportFile>,
31    /// Optional. Encrypted file with the selfie of the user holding a document, provided by the user; available if requested for "passport", "driver_license", "identity_card" and "internal_passport". The file can be decrypted and verified using the accompanying EncryptedCredentials.
32    #[serde(skip_serializing_if = "Option::is_none")]
33    pub selfie: Option<PassportFile>,
34    /// Optional. Array of encrypted files with translated versions of documents provided by the user; available if requested for "passport", "driver_license", "identity_card", "internal_passport", "utility_bill", "bank_statement", "rental_agreement", "passport_registration" and "temporary_registration" types. Files can be decrypted and verified using the accompanying EncryptedCredentials.
35    #[serde(skip_serializing_if = "Option::is_none")]
36    pub translation: Option<Vec<PassportFile>>,
37    /// Base64-encoded element hash for using in PassportElementErrorUnspecified
38    pub hash: String,
39}