tg_flows/types/
video.rs

1use mime::Mime;
2use serde::{Deserialize, Serialize};
3
4use crate::types::{FileMeta, PhotoSize};
5
6/// This object represents a video file.
7///
8/// [The official docs](https://core.telegram.org/bots/api#video).
9#[serde_with_macros::skip_serializing_none]
10#[derive(Clone, Debug, Eq, Hash, PartialEq, Serialize, Deserialize)]
11pub struct Video {
12    /// Metadata of the video file.
13    #[serde(flatten)]
14    pub file: FileMeta,
15
16    /// Video width as defined by sender.
17    pub width: u32,
18
19    /// Video height as defined by sender.
20    pub height: u32,
21
22    /// Duration of the video in seconds as defined by sender.
23    pub duration: u32,
24
25    /// Video thumbnail.
26    pub thumb: Option<PhotoSize>,
27
28    /// Original filename as defined by sender
29    pub file_name: Option<String>,
30
31    /// Mime type of a file as defined by sender.
32    #[serde(with = "crate::types::non_telegram_types::mime::opt_deser")]
33    pub mime_type: Option<Mime>,
34}