teloxide_core/types/
passport_file.rs

1use chrono::{DateTime, Utc};
2use derive_more::Deref;
3use serde::{Deserialize, Serialize};
4
5use crate::types::FileMeta;
6
7/// This object represents a file uploaded to Telegram Passport.
8///
9/// Currently all Telegram Passport files are in JPEG format when decrypted and
10/// don't exceed 10MB.
11///
12/// [The official docs](https://core.telegram.org/bots/api#passportfile).
13#[serde_with::skip_serializing_none]
14#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize, Deref)]
15pub struct PassportFile {
16    /// Metadata of the passport file.
17    #[deref]
18    #[serde(flatten)]
19    pub file: FileMeta,
20
21    /// Time when the file was uploaded.
22    #[serde(with = "crate::types::serde_date_from_unix_timestamp")]
23    #[serde(rename = "file_date")]
24    pub date: DateTime<Utc>,
25}