#[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "An object of this type can be returned on every function call, in case of an error"] pub struct Error { #[doc = "Error code; subject to future changes. If the error code is 406, the error message must not be processed in any way and must not be displayed to the user"] pub code: i32, #[doc = "Error message; subject to future changes"] pub message: String, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "An object of this type is returned on a successful function call for certain functions"] pub struct Ok {} #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "Contains parameters for TDLib initialization"] pub struct TdlibParameters { #[doc = "If set to true, the Telegram test environment will be used instead of the production environment"] #[serde(default)] pub use_test_dc: bool, #[doc = "The path to the directory for the persistent database; if empty, the current working directory will be used"] pub database_directory: String, #[doc = "The path to the directory for storing files; if empty, database_directory will be used"] pub files_directory: String, #[doc = "If set to true, information about downloaded and uploaded files will be saved between application restarts"] #[serde(default)] pub use_file_database: bool, #[doc = "If set to true, the library will maintain a cache of users, basic groups, supergroups, channels and secret chats. Implies use_file_database"] #[serde(default)] pub use_chat_info_database: bool, #[doc = "If set to true, the library will maintain a cache of chats and messages. Implies use_chat_info_database"] #[serde(default)] pub use_message_database: bool, #[doc = "If set to true, support for secret chats will be enabled"] #[serde(default)] pub use_secret_chats: bool, #[doc = "Application identifier for Telegram API access, which can be obtained at https://my.telegram.org"] pub api_id: i32, #[doc = "Application identifier hash for Telegram API access, which can be obtained at https://my.telegram.org"] pub api_hash: String, #[doc = "IETF language tag of the user's operating system language; must be non-empty"] pub system_language_code: String, #[doc = "Model of the device the application is being run on; must be non-empty"] pub device_model: String, #[doc = "Version of the operating system the application is being run on; must be non-empty"] pub system_version: String, #[doc = "Application version; must be non-empty"] pub application_version: String, #[doc = "If set to true, old files will automatically be deleted"] #[serde(default)] pub enable_storage_optimizer: bool, #[doc = "If set to true, original file names will be ignored. Otherwise, downloaded files will be saved under names as close as possible to the original name"] #[serde(default)] pub ignore_file_names: bool, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "An authentication code is delivered via a private Telegram message, which can be viewed in another client "] pub struct AuthenticationCodeTypeTelegramMessage { #[doc = "Length of the code"] pub length: i32, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "An authentication code is delivered via an SMS message to the specified phone number "] pub struct AuthenticationCodeTypeSms { #[doc = "Length of the code"] pub length: i32, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "An authentication code is delivered via a phone call to the specified phone number "] pub struct AuthenticationCodeTypeCall { #[doc = "Length of the code"] pub length: i32, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "An authentication code is delivered by an immediately cancelled call to the specified phone number. The number from which the call was made is the code "] pub struct AuthenticationCodeTypeFlashCall { #[doc = "Pattern of the phone number from which the call will be made"] pub pattern: String, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "Information about the authentication code that was sent "] pub struct AuthenticationCodeInfo { #[doc = "A phone number that is being authenticated "] pub phone_number: String, #[serde(rename = "type")] #[doc = "Describes the way the code was sent to the user "] pub type_: AuthenticationCodeType, #[doc = "Describes the way the next code will be sent to the user; may be null "] pub next_type: Option, #[doc = "Timeout before the code should be re-sent, in seconds"] pub timeout: i32, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "Information about the email address authentication code that was sent "] pub struct EmailAddressAuthenticationCodeInfo { #[doc = "Pattern of the email address to which an authentication code was sent "] pub email_address_pattern: String, #[doc = "Length of the code; 0 if unknown"] pub length: i32, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "Represents a part of the text that needs to be formatted in some unusual way "] pub struct TextEntity { #[doc = "Offset of the entity in UTF-16 code units "] pub offset: i32, #[doc = "Length of the entity, in UTF-16 code units "] pub length: i32, #[serde(rename = "type")] #[doc = "Type of the entity"] pub type_: TextEntityType, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "Contains a list of text entities "] pub struct TextEntities { #[doc = "List of text entities"] pub entities: Vec, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "A text with some entities "] pub struct FormattedText { #[doc = "The text "] pub text: String, #[doc = "Entities contained in the text. Entities can be nested, but must not mutually intersect with each other.\n Pre, Code and PreCode entities can't contain other entities. Bold, Italic, Underline and Strikethrough entities can contain and to be contained in all other entities. All other entities can't contain each other"] pub entities: Vec, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "Contains Telegram terms of service "] pub struct TermsOfService { #[doc = "Text of the terms of service "] pub text: FormattedText, #[doc = "The minimum age of a user to be able to accept the terms; 0 if any "] pub min_user_age: i32, #[doc = "True, if a blocking popup with terms of service must be shown to the user"] #[serde(default)] pub show_popup: bool, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "TDLib needs TdlibParameters for initialization"] pub struct AuthorizationStateWaitTdlibParameters {} #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "TDLib needs an encryption key to decrypt the local database "] pub struct AuthorizationStateWaitEncryptionKey { #[doc = "True, if the database is currently encrypted"] #[serde(default)] pub is_encrypted: bool, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "TDLib needs the user's phone number to authorize. Call `setAuthenticationPhoneNumber` to provide the phone number, or use `requestQrCodeAuthentication`, or `checkAuthenticationBotToken` for other authentication options"] pub struct AuthorizationStateWaitPhoneNumber {} #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "TDLib needs the user's authentication code to authorize "] pub struct AuthorizationStateWaitCode { #[doc = "Information about the authorization code that was sent"] pub code_info: AuthenticationCodeInfo, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "The user needs to confirm authorization on another logged in device by scanning a QR code with the provided link "] pub struct AuthorizationStateWaitOtherDeviceConfirmation { #[doc = "A tg:// URL for the QR code. The link will be updated frequently"] pub link: String, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "The user is unregistered and need to accept terms of service and enter their first name and last name to finish registration "] pub struct AuthorizationStateWaitRegistration { #[doc = "Telegram terms of service"] pub terms_of_service: TermsOfService, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "The user has been authorized, but needs to enter a password to start using the application "] pub struct AuthorizationStateWaitPassword { #[doc = "Hint for the password; may be empty "] pub password_hint: String, #[doc = "True, if a recovery email address has been set up"] #[serde(default)] pub has_recovery_email_address: bool, #[doc = "Pattern of the email address to which the recovery email was sent; empty until a recovery email has been sent"] pub recovery_email_address_pattern: String, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "The user has been successfully authorized. TDLib is now ready to answer queries"] pub struct AuthorizationStateReady {} #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "The user is currently logging out"] pub struct AuthorizationStateLoggingOut {} #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "TDLib is closing, all subsequent queries will be answered with the error 500. Note that closing TDLib can take a while. All resources will be freed only after authorizationStateClosed has been received"] pub struct AuthorizationStateClosing {} #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "TDLib client is in its final state. All databases are closed and all resources are released. No other updates will be received after this. All queries will be responded to\n with error code 500. To continue working, one should create a new instance of the TDLib client"] pub struct AuthorizationStateClosed {} #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "Represents the current state of 2-step verification "] pub struct PasswordState { #[doc = "True, if a 2-step verification password is set "] #[serde(default)] pub has_password: bool, #[doc = "Hint for the password; may be empty"] pub password_hint: String, #[doc = "True, if a recovery email is set "] #[serde(default)] pub has_recovery_email_address: bool, #[doc = "True, if some Telegram Passport elements were saved"] #[serde(default)] pub has_passport_data: bool, #[doc = "Information about the recovery email address to which the confirmation email was sent; may be null"] pub recovery_email_address_code_info: Option, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "Contains information about the current recovery email address "] pub struct RecoveryEmailAddress { #[doc = "Recovery email address"] pub recovery_email_address: String, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "Returns information about the availability of a temporary password, which can be used for payments "] pub struct TemporaryPasswordState { #[doc = "True, if a temporary password is available "] #[serde(default)] pub has_password: bool, #[doc = "Time left before the temporary password expires, in seconds"] pub valid_for: i32, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "Represents a local file"] pub struct LocalFile { #[doc = "Local path to the locally available file part; may be empty"] pub path: String, #[doc = "True, if it is possible to try to download or generate the file"] #[serde(default)] pub can_be_downloaded: bool, #[doc = "True, if the file can be deleted"] #[serde(default)] pub can_be_deleted: bool, #[doc = "True, if the file is currently being downloaded (or a local copy is being generated by some other means)"] #[serde(default)] pub is_downloading_active: bool, #[doc = "True, if the local copy is fully available"] #[serde(default)] pub is_downloading_completed: bool, #[doc = "Download will be started from this offset. downloaded_prefix_size is calculated from this offset"] pub download_offset: i32, #[doc = "If is_downloading_completed is false, then only some prefix of the file starting from download_offset is ready to be read. downloaded_prefix_size is the size of that prefix"] pub downloaded_prefix_size: i32, #[doc = "Total downloaded file bytes. Should be used only for calculating download progress. The actual file size may be bigger, and some parts of it may contain garbage"] pub downloaded_size: i32, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "Represents a remote file"] pub struct RemoteFile { #[doc = "Remote file identifier; may be empty. Can be used by the current user across application restarts or even from other devices. Uniquely identifies a file, but a file can have a lot of different valid identifiers.\n If the ID starts with \"http://\" or \"https://\", it represents the HTTP URL of the file. TDLib is currently unable to download files if only their URL is known.\n If downloadFile is called on such a file or if it is sent to a secret chat, TDLib starts a file generation process by sending updateFileGenerationStart to the client with the HTTP URL in the original_path and \"#url#\" as the conversion string. Clients should generate the file by downloading it to the specified location"] pub id: String, #[doc = "Unique file identifier; may be empty if unknown. The unique file identifier which is the same for the same file even for different users and is persistent over time"] pub unique_id: String, #[doc = "True, if the file is currently being uploaded (or a remote copy is being generated by some other means)"] #[serde(default)] pub is_uploading_active: bool, #[doc = "True, if a remote copy is fully available"] #[serde(default)] pub is_uploading_completed: bool, #[doc = "Size of the remote available part of the file; 0 if unknown"] pub uploaded_size: i32, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "Represents a file"] pub struct File { #[doc = "Unique file identifier"] pub id: i32, #[doc = "File size; 0 if unknown"] pub size: i32, #[doc = "Expected file size in case the exact file size is unknown, but an approximate size is known. Can be used to show download/upload progress"] pub expected_size: i32, #[doc = "Information about the local copy of the file"] pub local: LocalFile, #[doc = "Information about the remote copy of the file"] pub remote: RemoteFile, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "A file defined by its unique ID "] pub struct InputFileId { #[doc = "Unique file identifier"] pub id: i32, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "A file defined by its remote ID. The remote ID is guaranteed to be usable only if the corresponding file is still accessible to the user and known to TDLib.\n For example, if the file is from a message, then the message must be not deleted and accessible to the user. If the file database is disabled, then the corresponding object with the file must be preloaded by the client"] pub struct InputFileRemote { #[doc = "Remote file identifier"] pub id: String, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "A file defined by a local path "] pub struct InputFileLocal { #[doc = "Local path to the file"] pub path: String, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "A file generated by the client "] pub struct InputFileGenerated { #[doc = "Local path to a file from which the file is generated; may be empty if there is no such file"] pub original_path: String, #[doc = "String specifying the conversion applied to the original file; should be persistent across application restarts. Conversions beginning with '#' are reserved for internal TDLib usage"] pub conversion: String, #[doc = "Expected size of the generated file; 0 if unknown"] pub expected_size: i32, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "Photo description "] pub struct PhotoSize { #[serde(rename = "type")] #[doc = "Thumbnail type (see https://core.telegram.org/constructor/photoSize) "] pub type_: String, #[doc = "Information about the photo file "] pub photo: File, #[doc = "Photo width "] pub width: i32, #[doc = "Photo height"] pub height: i32, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "Thumbnail image of a very poor quality and low resolution "] pub struct Minithumbnail { #[doc = "Thumbnail width, usually doesn't exceed 40 "] pub width: i32, #[doc = "Thumbnail height, usually doesn't exceed 40 "] pub height: i32, #[doc = "The thumbnail in JPEG format"] pub data: String, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "A mask should be placed relatively to the forehead"] pub struct MaskPointForehead {} #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "A mask should be placed relatively to the eyes"] pub struct MaskPointEyes {} #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "A mask should be placed relatively to the mouth"] pub struct MaskPointMouth {} #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "A mask should be placed relatively to the chin"] pub struct MaskPointChin {} #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "Position on a photo where a mask should be placed "] pub struct MaskPosition { #[doc = "Part of the face, relative to which the mask should be placed"] pub point: MaskPoint, #[doc = "Shift by X-axis measured in widths of the mask scaled to the face size, from left to right. (For example, -1.0 will place the mask just to the left of the default mask position)"] pub x_shift: f64, #[doc = "Shift by Y-axis measured in heights of the mask scaled to the face size, from top to bottom. (For example, 1.0 will place the mask just below the default mask position)"] pub y_shift: f64, #[doc = "Mask scaling coefficient. (For example, 2.0 means a doubled size)"] pub scale: f64, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "Describes one answer option of a poll "] pub struct PollOption { #[doc = "Option text, 1-100 characters "] pub text: String, #[doc = "Number of voters for this option, available only for closed or voted polls "] pub voter_count: i32, #[doc = "The percentage of votes for this option, 0-100"] pub vote_percentage: i32, #[doc = "True, if the option was chosen by the user "] #[serde(default)] pub is_chosen: bool, #[doc = "True, if the option is being chosen by a pending setPollAnswer request"] #[serde(default)] pub is_being_chosen: bool, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "A regular poll "] pub struct PollTypeRegular { #[doc = "True, if multiple answer options can be chosen simultaneously"] #[serde(default)] pub allow_multiple_answers: bool, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "A poll in quiz mode, which has exactly one correct answer option and can be answered only once"] pub struct PollTypeQuiz { #[doc = "0-based identifier of the correct answer option; -1 for a yet unanswered poll"] pub correct_option_id: i32, #[doc = "Text that is shown when the user chooses an incorrect answer or taps on the lamp icon, 0-200 characters with at most 2 line feeds; empty for a yet unanswered poll"] pub explanation: FormattedText, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "Describes an animation file. The animation must be encoded in GIF or MPEG4 format "] pub struct Animation { #[doc = "Duration of the animation, in seconds; as defined by the sender "] pub duration: i32, #[doc = "Width of the animation "] pub width: i32, #[doc = "Height of the animation"] pub height: i32, #[doc = "Original name of the file; as defined by the sender "] pub file_name: String, #[doc = "MIME type of the file, usually \"image/gif\" or \"video/mp4\""] pub mime_type: String, #[doc = "Animation minithumbnail; may be null "] pub minithumbnail: Option, #[doc = "Animation thumbnail; may be null "] pub thumbnail: Option, #[doc = "File containing the animation"] pub animation: File, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "Describes an audio file. Audio is usually in MP3 or M4A format "] pub struct Audio { #[doc = "Duration of the audio, in seconds; as defined by the sender "] pub duration: i32, #[doc = "Title of the audio; as defined by the sender "] pub title: String, #[doc = "Performer of the audio; as defined by the sender"] pub performer: String, #[doc = "Original name of the file; as defined by the sender "] pub file_name: String, #[doc = "The MIME type of the file; as defined by the sender "] pub mime_type: String, #[doc = "The minithumbnail of the album cover; may be null "] pub album_cover_minithumbnail: Option, #[doc = "The thumbnail of the album cover; as defined by the sender. The full size thumbnail should be extracted from the downloaded file; may be null "] pub album_cover_thumbnail: Option, #[doc = "File containing the audio"] pub audio: File, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "Describes a document of any type "] pub struct Document { #[doc = "Original name of the file; as defined by the sender "] pub file_name: String, #[doc = "MIME type of the file; as defined by the sender"] pub mime_type: String, #[doc = "Document minithumbnail; may be null "] pub minithumbnail: Option, #[doc = "Document thumbnail in JPEG or PNG format (PNG will be used only for background patterns); as defined by the sender; may be null "] pub thumbnail: Option, #[doc = "File containing the document"] pub document: File, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "Describes a photo "] pub struct Photo { #[doc = "True, if stickers were added to the photo "] #[serde(default)] pub has_stickers: bool, #[doc = "Photo minithumbnail; may be null "] pub minithumbnail: Option, #[doc = "Available variants of the photo, in different sizes"] pub sizes: Vec, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "Describes a sticker "] pub struct Sticker { #[doc = "The identifier of the sticker set to which the sticker belongs; 0 if none "] #[serde(deserialize_with = "::serde_aux::field_attributes::deserialize_number_from_string")] pub set_id: i64, #[doc = "Sticker width; as defined by the sender "] pub width: i32, #[doc = "Sticker height; as defined by the sender"] pub height: i32, #[doc = "Emoji corresponding to the sticker "] pub emoji: String, #[doc = "True, if the sticker is an animated sticker in TGS format "] #[serde(default)] pub is_animated: bool, #[doc = "True, if the sticker is a mask "] #[serde(default)] pub is_mask: bool, #[doc = "Position where the mask should be placed; may be null "] pub mask_position: Option, #[doc = "Sticker thumbnail in WEBP or JPEG format; may be null "] pub thumbnail: Option, #[doc = "File containing the sticker"] pub sticker: File, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "Describes a video file "] pub struct Video { #[doc = "Duration of the video, in seconds; as defined by the sender "] pub duration: i32, #[doc = "Video width; as defined by the sender "] pub width: i32, #[doc = "Video height; as defined by the sender"] pub height: i32, #[doc = "Original name of the file; as defined by the sender "] pub file_name: String, #[doc = "MIME type of the file; as defined by the sender "] pub mime_type: String, #[doc = "True, if stickers were added to the video"] #[serde(default)] pub has_stickers: bool, #[doc = "True, if the video should be tried to be streamed "] #[serde(default)] pub supports_streaming: bool, #[doc = "Video minithumbnail; may be null "] pub minithumbnail: Option, #[doc = "Video thumbnail; as defined by the sender; may be null "] pub thumbnail: Option, #[doc = "File containing the video"] pub video: File, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "Describes a video note. The video must be equal in width and height, cropped to a circle, and stored in MPEG4 format "] pub struct VideoNote { #[doc = "Duration of the video, in seconds; as defined by the sender "] pub duration: i32, #[doc = "Video width and height; as defined by the sender "] pub length: i32, #[doc = "Video minithumbnail; may be null "] pub minithumbnail: Option, #[doc = "Video thumbnail; as defined by the sender; may be null "] pub thumbnail: Option, #[doc = "File containing the video"] pub video: File, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "Describes a voice note. The voice note must be encoded with the Opus codec, and stored inside an OGG container. Voice notes can have only a single audio channel "] pub struct VoiceNote { #[doc = "Duration of the voice note, in seconds; as defined by the sender"] pub duration: i32, #[doc = "A waveform representation of the voice note in 5-bit format "] pub waveform: String, #[doc = "MIME type of the file; as defined by the sender "] pub mime_type: String, #[doc = "File containing the voice note"] pub voice: File, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "Describes a user contact "] pub struct Contact { #[doc = "Phone number of the user "] pub phone_number: String, #[doc = "First name of the user; 1-255 characters in length "] pub first_name: String, #[doc = "Last name of the user "] pub last_name: String, #[doc = "Additional data about the user in a form of vCard; 0-2048 bytes in length "] pub vcard: String, #[doc = "Identifier of the user, if known; otherwise 0"] pub user_id: i32, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "Describes a location on planet Earth "] pub struct Location { #[doc = "Latitude of the location in degrees; as defined by the sender "] pub latitude: f64, #[doc = "Longitude of the location, in degrees; as defined by the sender"] pub longitude: f64, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "Describes a venue "] pub struct Venue { #[doc = "Venue location; as defined by the sender "] pub location: Location, #[doc = "Venue name; as defined by the sender "] pub title: String, #[doc = "Venue address; as defined by the sender "] pub address: String, #[doc = "Provider of the venue database; as defined by the sender. Currently only \"foursquare\" needs to be supported"] pub provider: String, #[doc = "Identifier of the venue in the provider database; as defined by the sender "] pub id: String, #[serde(rename = "type")] #[doc = "Type of the venue in the provider database; as defined by the sender"] pub type_: String, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "Describes a game "] pub struct Game { #[doc = "Game ID "] #[serde(deserialize_with = "::serde_aux::field_attributes::deserialize_number_from_string")] pub id: i64, #[doc = "Game short name. To share a game use the URL https://t.me/{bot_username}?game={game_short_name} "] pub short_name: String, #[doc = "Game title "] pub title: String, #[doc = "Game text, usually containing scoreboards for a game"] pub text: FormattedText, #[doc = "Game description "] pub description: String, #[doc = "Game photo "] pub photo: Photo, #[doc = "Game animation; may be null"] pub animation: Option, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "Describes a poll "] pub struct Poll { #[doc = "Unique poll identifier "] #[serde(deserialize_with = "::serde_aux::field_attributes::deserialize_number_from_string")] pub id: i64, #[doc = "Poll question, 1-255 characters "] pub question: String, #[doc = "List of poll answer options"] pub options: Vec, #[doc = "Total number of voters, participating in the poll "] pub total_voter_count: i32, #[doc = "User identifiers of recent voters, if the poll is non-anonymous"] pub recent_voter_user_ids: Vec, #[doc = "True, if the poll is anonymous "] #[serde(default)] pub is_anonymous: bool, #[serde(rename = "type")] #[doc = "Type of the poll"] pub type_: PollType, #[doc = "Amount of time the poll will be active after creation, in seconds "] pub open_period: i32, #[doc = "Point in time (Unix timestamp) when the poll will be automatically closed "] pub close_date: i32, #[doc = "True, if the poll is closed"] #[serde(default)] pub is_closed: bool, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "Describes a user profile photo "] pub struct ProfilePhoto { #[doc = "Photo identifier; 0 for an empty photo. Can be used to find a photo in a list of userProfilePhotos"] #[serde(deserialize_with = "::serde_aux::field_attributes::deserialize_number_from_string")] pub id: i64, #[doc = "A small (160x160) user profile photo. The file can be downloaded only before the photo is changed "] pub small: File, #[doc = "A big (640x640) user profile photo. The file can be downloaded only before the photo is changed"] pub big: File, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "Describes the photo of a chat "] pub struct ChatPhoto { #[doc = "A small (160x160) chat photo. The file can be downloaded only before the photo is changed "] pub small: File, #[doc = "A big (640x640) chat photo. The file can be downloaded only before the photo is changed"] pub big: File, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "A regular user"] pub struct UserTypeRegular {} #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "A deleted user or deleted bot. No information on the user besides the user identifier is available. It is not possible to perform any active actions on this type of user"] pub struct UserTypeDeleted {} #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "A bot (see https://core.telegram.org/bots) "] pub struct UserTypeBot { #[doc = "True, if the bot can be invited to basic group and supergroup chats"] #[serde(default)] pub can_join_groups: bool, #[doc = "True, if the bot can read all messages in basic group or supergroup chats and not just those addressed to the bot. In private and channel chats a bot can always read all messages"] #[serde(default)] pub can_read_all_group_messages: bool, #[doc = "True, if the bot supports inline queries "] #[serde(default)] pub is_inline: bool, #[doc = "Placeholder for inline queries (displayed on the client input field) "] pub inline_query_placeholder: String, #[doc = "True, if the location of the user should be sent with every inline query to this bot"] #[serde(default)] pub need_location: bool, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "No information on the user besides the user identifier is available, yet this user has not been deleted. This object is extremely rare and must be handled like a deleted user. It is not possible to perform any actions on users of this type"] pub struct UserTypeUnknown {} #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "Represents a command supported by a bot "] pub struct BotCommand { #[doc = "Text of the bot command "] pub command: String, #[doc = "Description of the bot command"] pub description: String, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "Provides information about a bot and its supported commands "] pub struct BotInfo { #[doc = "Long description shown on the user info page "] pub description: String, #[doc = "A list of commands supported by the bot"] pub commands: Vec, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "Represents a location to which a chat is connected "] pub struct ChatLocation { #[doc = "The location "] pub location: Location, #[doc = "Location address; 1-64 characters, as defined by the chat owner"] pub address: String, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "Represents a user "] pub struct User { #[doc = "User identifier "] pub id: i32, #[doc = "First name of the user "] pub first_name: String, #[doc = "Last name of the user "] pub last_name: String, #[doc = "Username of the user"] pub username: String, #[doc = "Phone number of the user "] pub phone_number: String, #[doc = "Current online status of the user "] pub status: UserStatus, #[doc = "Profile photo of the user; may be null"] pub profile_photo: Option, #[doc = "The user is a contact of the current user"] #[serde(default)] pub is_contact: bool, #[doc = "The user is a contact of the current user and the current user is a contact of the user"] #[serde(default)] pub is_mutual_contact: bool, #[doc = "True, if the user is verified "] #[serde(default)] pub is_verified: bool, #[doc = "True, if the user is Telegram support account"] #[serde(default)] pub is_support: bool, #[doc = "If non-empty, it contains a human-readable description of the reason why access to this user must be restricted"] pub restriction_reason: String, #[doc = "True, if many users reported this user as a scam"] #[serde(default)] pub is_scam: bool, #[doc = "If false, the user is inaccessible, and the only information known about the user is inside this class. It can't be passed to any method except GetUser "] #[serde(default)] pub have_access: bool, #[serde(rename = "type")] #[doc = "Type of the user "] pub type_: UserType, #[doc = "IETF language tag of the user's language; only available to bots"] pub language_code: Option, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "Contains full information about a user (except the full list of profile photos) "] pub struct UserFullInfo { #[doc = "True, if the user is blacklisted by the current user"] #[serde(default)] pub is_blocked: bool, #[doc = "True, if the user can be called "] #[serde(default)] pub can_be_called: bool, #[doc = "True, if the user can't be called due to their privacy settings"] #[serde(default)] pub has_private_calls: bool, #[doc = "True, if the current user needs to explicitly allow to share their phone number with the user when the method addContact is used"] #[serde(default)] pub need_phone_number_privacy_exception: bool, #[doc = "A short user bio "] pub bio: String, #[doc = "For bots, the text that is included with the link when users share the bot "] pub share_text: String, #[doc = "Number of group chats where both the other user and the current user are a member; 0 for the current user "] pub group_in_common_count: i32, #[doc = "If the user is a bot, information about the bot; may be null"] pub bot_info: Option, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "Contains full information about a user profile photo "] pub struct UserProfilePhoto { #[doc = "Unique user profile photo identifier "] #[serde(deserialize_with = "::serde_aux::field_attributes::deserialize_number_from_string")] pub id: i64, #[doc = "Point in time (Unix timestamp) when the photo has been added "] pub added_date: i32, #[doc = "Available variants of the user photo, in different sizes"] pub sizes: Vec, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "Contains part of the list of user photos "] pub struct UserProfilePhotos { #[doc = "Total number of user profile photos "] pub total_count: i32, #[doc = "A list of photos"] pub photos: Vec, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "Represents a list of users "] pub struct Users { #[doc = "Approximate total count of users found "] pub total_count: i32, #[doc = "A list of user identifiers"] pub user_ids: Vec, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "Contains information about a chat administrator "] pub struct ChatAdministrator { #[doc = "User identifier of the administrator "] pub user_id: i32, #[doc = "Custom title of the administrator "] pub custom_title: String, #[doc = "True, if the user is the owner of the chat"] #[serde(default)] pub is_owner: bool, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "Represents a list of chat administrators "] pub struct ChatAdministrators { #[doc = "A list of chat administrators"] pub administrators: Vec, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "Describes actions that a user is allowed to take in a chat"] pub struct ChatPermissions { #[doc = "True, if the user can send text messages, contacts, locations, and venues"] #[serde(default)] pub can_send_messages: bool, #[doc = "True, if the user can send audio files, documents, photos, videos, video notes, and voice notes. Implies can_send_messages permissions"] #[serde(default)] pub can_send_media_messages: bool, #[doc = "True, if the user can send polls. Implies can_send_messages permissions"] #[serde(default)] pub can_send_polls: bool, #[doc = "True, if the user can send animations, games, and stickers and use inline bots. Implies can_send_messages permissions"] #[serde(default)] pub can_send_other_messages: bool, #[doc = "True, if the user may add a web page preview to their messages. Implies can_send_messages permissions"] #[serde(default)] pub can_add_web_page_previews: bool, #[doc = "True, if the user can change the chat title, photo, and other settings"] #[serde(default)] pub can_change_info: bool, #[doc = "True, if the user can invite new users to the chat"] #[serde(default)] pub can_invite_users: bool, #[doc = "True, if the user can pin messages"] #[serde(default)] pub can_pin_messages: bool, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "The user is the owner of a chat and has all the administrator privileges"] pub struct ChatMemberStatusCreator { #[doc = "A custom title of the owner; 0-16 characters without emojis; applicable to supergroups only"] pub custom_title: String, #[doc = "True, if the user is a member of the chat"] #[serde(default)] pub is_member: bool, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "The user is a member of a chat and has some additional privileges. In basic groups, administrators can edit and delete messages sent by others, add new members, and ban unprivileged members. In supergroups and channels, there are more detailed options for administrator privileges"] pub struct ChatMemberStatusAdministrator { #[doc = "A custom title of the administrator; 0-16 characters without emojis; applicable to supergroups only"] pub custom_title: String, #[doc = "True, if the current user can edit the administrator privileges for the called user"] #[serde(default)] pub can_be_edited: bool, #[doc = "True, if the administrator can change the chat title, photo, and other settings"] #[serde(default)] pub can_change_info: bool, #[doc = "True, if the administrator can create channel posts; applicable to channels only"] #[serde(default)] pub can_post_messages: bool, #[doc = "True, if the administrator can edit messages of other users and pin messages; applicable to channels only"] #[serde(default)] pub can_edit_messages: bool, #[doc = "True, if the administrator can delete messages of other users"] #[serde(default)] pub can_delete_messages: bool, #[doc = "True, if the administrator can invite new users to the chat"] #[serde(default)] pub can_invite_users: bool, #[doc = "True, if the administrator can restrict, ban, or unban chat members"] #[serde(default)] pub can_restrict_members: bool, #[doc = "True, if the administrator can pin messages; applicable to groups only"] #[serde(default)] pub can_pin_messages: bool, #[doc = "True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that were directly or indirectly promoted by them"] #[serde(default)] pub can_promote_members: bool, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "The user is a member of a chat, without any additional privileges or restrictions"] pub struct ChatMemberStatusMember {} #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "The user is under certain restrictions in the chat. Not supported in basic groups and channels"] pub struct ChatMemberStatusRestricted { #[doc = "True, if the user is a member of the chat"] #[serde(default)] pub is_member: bool, #[doc = "Point in time (Unix timestamp) when restrictions will be lifted from the user; 0 if never. If the user is restricted for more than 366 days or for less than 30 seconds from the current time, the user is considered to be restricted forever"] pub restricted_until_date: i32, #[doc = "User permissions in the chat"] pub permissions: ChatPermissions, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "The user is not a chat member"] pub struct ChatMemberStatusLeft {} #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "The user was banned (and hence is not a member of the chat). Implies the user can't return to the chat or view messages"] pub struct ChatMemberStatusBanned { #[doc = "Point in time (Unix timestamp) when the user will be unbanned; 0 if never. If the user is banned for more than 366 days or for less than 30 seconds from the current time, the user is considered to be banned forever"] pub banned_until_date: i32, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "A user with information about joining/leaving a chat "] pub struct ChatMember { #[doc = "User identifier of the chat member "] pub user_id: i32, #[doc = "Identifier of a user that invited/promoted/banned this member in the chat; 0 if unknown"] pub inviter_user_id: i32, #[doc = "Point in time (Unix timestamp) when the user joined a chat "] pub joined_chat_date: i32, #[doc = "Status of the member in the chat "] pub status: ChatMemberStatus, #[doc = "If the user is a bot, information about the bot; may be null. Can be null even for a bot if the bot is not a chat member"] pub bot_info: Option, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "Contains a list of chat members "] pub struct ChatMembers { #[doc = "Approximate total count of chat members found "] pub total_count: i32, #[doc = "A list of chat members"] pub members: Vec, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "Returns contacts of the user"] pub struct ChatMembersFilterContacts {} #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "Returns the owner and administrators"] pub struct ChatMembersFilterAdministrators {} #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "Returns all chat members, including restricted chat members"] pub struct ChatMembersFilterMembers {} #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "Returns users under certain restrictions in the chat; can be used only by administrators in a supergroup"] pub struct ChatMembersFilterRestricted {} #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "Returns users banned from the chat; can be used only by administrators in a supergroup or in a channel"] pub struct ChatMembersFilterBanned {} #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "Returns bot members of the chat"] pub struct ChatMembersFilterBots {} #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "Returns recently active users in reverse chronological order"] pub struct SupergroupMembersFilterRecent {} #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "Returns contacts of the user, which are members of the supergroup or channel "] pub struct SupergroupMembersFilterContacts { #[doc = "Query to search for"] pub query: String, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "Returns the owner and administrators"] pub struct SupergroupMembersFilterAdministrators {} #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "Used to search for supergroup or channel members via a (string) query "] pub struct SupergroupMembersFilterSearch { #[doc = "Query to search for"] pub query: String, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "Returns restricted supergroup members; can be used only by administrators "] pub struct SupergroupMembersFilterRestricted { #[doc = "Query to search for"] pub query: String, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "Returns users banned from the supergroup or channel; can be used only by administrators "] pub struct SupergroupMembersFilterBanned { #[doc = "Query to search for"] pub query: String, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "Returns bot members of the supergroup or channel"] pub struct SupergroupMembersFilterBots {} #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "Represents a basic group of 0-200 users (must be upgraded to a supergroup to accommodate more than 200 users)"] pub struct BasicGroup { #[doc = "Group identifier"] pub id: i32, #[doc = "Number of members in the group"] pub member_count: i32, #[doc = "Status of the current user in the group"] pub status: ChatMemberStatus, #[doc = "True, if the group is active"] #[serde(default)] pub is_active: bool, #[doc = "Identifier of the supergroup to which this group was upgraded; 0 if none"] pub upgraded_to_supergroup_id: i32, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "Contains full information about a basic group "] pub struct BasicGroupFullInfo { #[doc = "Group description "] pub description: String, #[doc = "User identifier of the creator of the group; 0 if unknown "] pub creator_user_id: i32, #[doc = "Group members "] pub members: Vec, #[doc = "Invite link for this group; available only after it has been generated at least once and only for the group creator"] pub invite_link: String, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "Represents a supergroup or channel with zero or more members (subscribers in the case of channels). From the point of view of the system, a channel is a special kind of a supergroup: only administrators can post and see the list of members, and posts from all administrators use the name and photo of the channel instead of individual names and profile photos. Unlike supergroups, channels can have an unlimited number of subscribers"] pub struct Supergroup { #[doc = "Supergroup or channel identifier"] pub id: i32, #[doc = "Username of the supergroup or channel; empty for private supergroups or channels"] pub username: String, #[doc = "Point in time (Unix timestamp) when the current user joined, or the point in time when the supergroup or channel was created, in case the user is not a member"] pub date: i32, #[doc = "Status of the current user in the supergroup or channel; custom title will be always empty"] pub status: ChatMemberStatus, #[doc = "Number of members in the supergroup or channel; 0 if unknown. Currently it is guaranteed to be known only if the supergroup or channel was found through SearchPublicChats"] pub member_count: i32, #[doc = "True, if the channel has a discussion group, or the supergroup is the designated discussion group for a channel"] #[serde(default)] pub has_linked_chat: bool, #[doc = "True, if the supergroup is connected to a location, i.e. the supergroup is a location-based supergroup"] #[serde(default)] pub has_location: bool, #[doc = "True, if messages sent to the channel should contain information about the sender. This field is only applicable to channels"] #[serde(default)] pub sign_messages: bool, #[doc = "True, if the slow mode is enabled in the supergroup"] #[serde(default)] pub is_slow_mode_enabled: bool, #[doc = "True, if the supergroup is a channel"] #[serde(default)] pub is_channel: bool, #[doc = "True, if the supergroup or channel is verified"] #[serde(default)] pub is_verified: bool, #[doc = "If non-empty, contains a human-readable description of the reason why access to this supergroup or channel must be restricted"] pub restriction_reason: String, #[doc = "True, if many users reported this supergroup as a scam"] #[serde(default)] pub is_scam: bool, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "Contains full information about a supergroup or channel"] pub struct SupergroupFullInfo { #[doc = "Supergroup or channel description"] pub description: String, #[doc = "Number of members in the supergroup or channel; 0 if unknown"] pub member_count: i32, #[doc = "Number of privileged users in the supergroup or channel; 0 if unknown"] pub administrator_count: i32, #[doc = "Number of restricted users in the supergroup; 0 if unknown"] pub restricted_count: i32, #[doc = "Number of users banned from chat; 0 if unknown"] pub banned_count: i32, #[doc = "Chat identifier of a discussion group for the channel, or a channel, for which the supergroup is the designated discussion group; 0 if none or unknown"] #[serde(deserialize_with = "::serde_aux::field_attributes::deserialize_number_from_string")] pub linked_chat_id: i64, #[doc = "Delay between consecutive sent messages for non-administrator supergroup members, in seconds"] pub slow_mode_delay: i32, #[doc = "Time left before next message can be sent in the supergroup, in seconds. An updateSupergroupFullInfo update is not triggered when value of this field changes, but both new and old values are non-zero"] pub slow_mode_delay_expires_in: f64, #[doc = "True, if members of the chat can be retrieved"] #[serde(default)] pub can_get_members: bool, #[doc = "True, if the chat username can be changed"] #[serde(default)] pub can_set_username: bool, #[doc = "True, if the supergroup sticker set can be changed"] #[serde(default)] pub can_set_sticker_set: bool, #[doc = "True, if the supergroup location can be changed"] #[serde(default)] pub can_set_location: bool, #[doc = "True, if the channel statistics is available"] #[serde(default)] pub can_view_statistics: bool, #[doc = "True, if new chat members will have access to old messages. In public or discussion groups and both public and private channels, old messages are always available, so this option affects only private supergroups without a linked chat. The value of this field is only available for chat administrators"] #[serde(default)] pub is_all_history_available: bool, #[doc = "Identifier of the supergroup sticker set; 0 if none"] #[serde(deserialize_with = "::serde_aux::field_attributes::deserialize_number_from_string")] pub sticker_set_id: i64, #[doc = "Location to which the supergroup is connected; may be null"] pub location: Option, #[doc = "Invite link for this chat"] pub invite_link: String, #[doc = "Identifier of the basic group from which supergroup was upgraded; 0 if none"] pub upgraded_from_basic_group_id: i32, #[doc = "Identifier of the last message in the basic group from which supergroup was upgraded; 0 if none"] #[serde(deserialize_with = "::serde_aux::field_attributes::deserialize_number_from_string")] pub upgraded_from_max_message_id: i64, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "The secret chat is not yet created; waiting for the other user to get online"] pub struct SecretChatStatePending {} #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "The secret chat is ready to use"] pub struct SecretChatStateReady {} #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "The secret chat is closed"] pub struct SecretChatStateClosed {} #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "Represents a secret chat"] pub struct SecretChat { #[doc = "Secret chat identifier"] pub id: i32, #[doc = "Identifier of the chat partner"] pub user_id: i32, #[doc = "State of the secret chat"] pub state: SecretChatState, #[doc = "True, if the chat was created by the current user; otherwise false"] #[serde(default)] pub is_outbound: bool, #[doc = "Current message Time To Live setting (self-destruct timer) for the chat, in seconds"] pub ttl: i32, #[doc = "Hash of the currently used key for comparison with the hash of the chat partner's key. This is a string of 36 little-endian bytes, which must be split into groups of 2 bits, each denoting a pixel of one of 4 colors FFFFFF, D5E6F3, 2D5775, and 2F99C9.\n The pixels must be used to make a 12x12 square image filled from left to right, top to bottom. Alternatively, the first 32 bytes of the hash can be converted to the hexadecimal format and printed as 32 2-digit hex numbers"] pub key_hash: String, #[doc = "Secret chat layer; determines features supported by the other client. Video notes are supported if the layer >= 66; nested text entities and underline and strikethrough entities are supported if the layer >= 101"] pub layer: i32, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "The message was originally written by a known user "] pub struct MessageForwardOriginUser { #[doc = "Identifier of the user that originally sent the message"] pub sender_user_id: i32, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "The message was originally written by a user, which is hidden by their privacy settings "] pub struct MessageForwardOriginHiddenUser { #[doc = "Name of the sender"] pub sender_name: String, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "The message was originally a post in a channel"] pub struct MessageForwardOriginChannel { #[doc = "Identifier of the chat from which the message was originally forwarded"] #[serde(deserialize_with = "::serde_aux::field_attributes::deserialize_number_from_string")] pub chat_id: i64, #[doc = "Message identifier of the original message; 0 if unknown"] #[serde(deserialize_with = "::serde_aux::field_attributes::deserialize_number_from_string")] pub message_id: i64, #[doc = "Original post author signature"] pub author_signature: String, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "Contains information about a forwarded message"] pub struct MessageForwardInfo { #[doc = "Origin of a forwarded message"] pub origin: MessageForwardOrigin, #[doc = "Point in time (Unix timestamp) when the message was originally sent"] pub date: i32, #[doc = "The type of a public service announcement for the forwarded message"] pub public_service_announcement_type: String, #[doc = "For messages forwarded to the chat with the current user (Saved Messages) or to the channel's discussion group, the identifier of the chat from which the message was forwarded last time; 0 if unknown"] #[serde(deserialize_with = "::serde_aux::field_attributes::deserialize_number_from_string")] pub from_chat_id: i64, #[doc = "For messages forwarded to the chat with the current user (Saved Messages) or to the channel's discussion group, the identifier of the original message from which the new message was forwarded last time; 0 if unknown"] #[serde(deserialize_with = "::serde_aux::field_attributes::deserialize_number_from_string")] pub from_message_id: i64, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "The message is being sent now, but has not yet been delivered to the server"] pub struct MessageSendingStatePending {} #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "The message failed to be sent "] pub struct MessageSendingStateFailed { #[doc = "An error code; 0 if unknown "] pub error_code: i32, #[doc = "Error message"] pub error_message: String, #[doc = "True, if the message can be re-sent "] #[serde(default)] pub can_retry: bool, #[doc = "Time left before the message can be re-sent, in seconds. No update is sent when this field changes"] pub retry_after: f64, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "Describes a message"] pub struct Message { #[doc = "Message identifier, unique for the chat to which the message belongs"] #[serde(deserialize_with = "::serde_aux::field_attributes::deserialize_number_from_string")] pub id: i64, #[doc = "Identifier of the user who sent the message; 0 if unknown. Currently, it is unknown for channel posts and for channel posts automatically forwarded to discussion group"] pub sender_user_id: i32, #[doc = "Chat identifier"] #[serde(deserialize_with = "::serde_aux::field_attributes::deserialize_number_from_string")] pub chat_id: i64, #[doc = "Information about the sending state of the message; may be null"] pub sending_state: Option, #[doc = "Information about the scheduling state of the message; may be null"] pub scheduling_state: Option, #[doc = "True, if the message is outgoing"] #[serde(default)] pub is_outgoing: bool, #[doc = "True, if the message can be edited. For live location and poll messages this fields shows whether editMessageLiveLocation or stopPoll can be used with this message by the client"] #[serde(default)] pub can_be_edited: bool, #[doc = "True, if the message can be forwarded"] #[serde(default)] pub can_be_forwarded: bool, #[doc = "True, if the message can be deleted only for the current user while other users will continue to see it"] #[serde(default)] pub can_be_deleted_only_for_self: bool, #[doc = "True, if the message can be deleted for all users"] #[serde(default)] pub can_be_deleted_for_all_users: bool, #[doc = "True, if the message is a channel post. All messages to channels are channel posts, all other messages are not channel posts"] #[serde(default)] pub is_channel_post: bool, #[doc = "True, if the message contains an unread mention for the current user"] #[serde(default)] pub contains_unread_mention: bool, #[doc = "Point in time (Unix timestamp) when the message was sent"] pub date: i32, #[doc = "Point in time (Unix timestamp) when the message was last edited"] pub edit_date: i32, #[doc = "Information about the initial message sender; may be null"] pub forward_info: Option, #[doc = "If non-zero, the identifier of the message this message is replying to; can be the identifier of a deleted message"] #[serde(deserialize_with = "::serde_aux::field_attributes::deserialize_number_from_string")] pub reply_to_message_id: i64, #[doc = "For self-destructing messages, the message's TTL (Time To Live), in seconds; 0 if none. TDLib will send updateDeleteMessages or updateMessageContent once the TTL expires"] pub ttl: i32, #[doc = "Time left before the message expires, in seconds"] pub ttl_expires_in: f64, #[doc = "If non-zero, the user identifier of the bot through which this message was sent"] pub via_bot_user_id: i32, #[doc = "For channel posts, optional author signature"] pub author_signature: String, #[doc = "Number of times this message was viewed"] pub views: i32, #[doc = "Unique identifier of an album this message belongs to. Only photos and videos can be grouped together in albums"] #[serde(deserialize_with = "::serde_aux::field_attributes::deserialize_number_from_string")] pub media_album_id: i64, #[doc = "If non-empty, contains a human-readable description of the reason why access to this message must be restricted"] pub restriction_reason: String, #[doc = "Content of the message"] pub content: MessageContent, #[doc = "Reply markup for the message; may be null"] pub reply_markup: Option, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "Contains a list of messages "] pub struct Messages { #[doc = "Approximate total count of messages found "] pub total_count: i32, #[doc = "List of messages; messages may be null"] pub messages: Option>, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "Contains a list of messages found by a search "] pub struct FoundMessages { #[doc = "List of messages "] pub messages: Vec, #[doc = "Value to pass as from_search_id to get more results"] #[serde(deserialize_with = "::serde_aux::field_attributes::deserialize_number_from_string")] pub next_from_search_id: i64, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "Notification settings applied to all private and secret chats when the corresponding chat setting has a default value"] pub struct NotificationSettingsScopePrivateChats {} #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "Notification settings applied to all basic groups and supergroups when the corresponding chat setting has a default value"] pub struct NotificationSettingsScopeGroupChats {} #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "Notification settings applied to all channels when the corresponding chat setting has a default value"] pub struct NotificationSettingsScopeChannelChats {} #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "Contains information about notification settings for a chat"] pub struct ChatNotificationSettings { #[doc = "If true, mute_for is ignored and the value for the relevant type of chat is used instead "] #[serde(default)] pub use_default_mute_for: bool, #[doc = "Time left before notifications will be unmuted, in seconds"] pub mute_for: i32, #[doc = "If true, sound is ignored and the value for the relevant type of chat is used instead "] #[serde(default)] pub use_default_sound: bool, #[doc = "The name of an audio file to be used for notification sounds; only applies to iOS applications"] pub sound: String, #[doc = "If true, show_preview is ignored and the value for the relevant type of chat is used instead "] #[serde(default)] pub use_default_show_preview: bool, #[doc = "True, if message content should be displayed in notifications"] #[serde(default)] pub show_preview: bool, #[doc = "If true, disable_pinned_message_notifications is ignored and the value for the relevant type of chat is used instead "] #[serde(default)] pub use_default_disable_pinned_message_notifications: bool, #[doc = "If true, notifications for incoming pinned messages will be created as for an ordinary unread message"] #[serde(default)] pub disable_pinned_message_notifications: bool, #[doc = "If true, disable_mention_notifications is ignored and the value for the relevant type of chat is used instead "] #[serde(default)] pub use_default_disable_mention_notifications: bool, #[doc = "If true, notifications for messages with mentions will be created as for an ordinary unread message"] #[serde(default)] pub disable_mention_notifications: bool, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "Contains information about notification settings for several chats"] pub struct ScopeNotificationSettings { #[doc = "Time left before notifications will be unmuted, in seconds"] pub mute_for: i32, #[doc = "The name of an audio file to be used for notification sounds; only applies to iOS applications"] pub sound: String, #[doc = "True, if message content should be displayed in notifications"] #[serde(default)] pub show_preview: bool, #[doc = "True, if notifications for incoming pinned messages will be created as for an ordinary unread message"] #[serde(default)] pub disable_pinned_message_notifications: bool, #[doc = "True, if notifications for messages with mentions will be created as for an ordinary unread message"] #[serde(default)] pub disable_mention_notifications: bool, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "Contains information about a message draft"] pub struct DraftMessage { #[doc = "Identifier of the message to reply to; 0 if none"] #[serde(deserialize_with = "::serde_aux::field_attributes::deserialize_number_from_string")] pub reply_to_message_id: i64, #[doc = "Point in time (Unix timestamp) when the draft was created"] pub date: i32, #[doc = "Content of the message draft; this should always be of type inputMessageText"] pub input_message_text: InputMessageContent, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "An ordinary chat with a user "] pub struct ChatTypePrivate { #[doc = "User identifier"] pub user_id: i32, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "A basic group (i.e., a chat with 0-200 other users) "] pub struct ChatTypeBasicGroup { #[doc = "Basic group identifier"] pub basic_group_id: i32, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "A supergroup (i.e. a chat with up to GetOption(\"supergroup_max_size\") other users), or channel (with unlimited members) "] pub struct ChatTypeSupergroup { #[doc = "Supergroup or channel identifier "] pub supergroup_id: i32, #[doc = "True, if the supergroup is a channel"] #[serde(default)] pub is_channel: bool, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "A secret chat with a user "] pub struct ChatTypeSecret { #[doc = "Secret chat identifier "] pub secret_chat_id: i32, #[doc = "User identifier of the secret chat peer"] pub user_id: i32, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "A main list of chats"] pub struct ChatListMain {} #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "A list of chats usually located at the top of the main chat list. Unmuted chats are automatically moved from the Archive to the Main chat list when a new message arrives"] pub struct ChatListArchive {} #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "The chat is sponsored by the user's MTProxy server"] pub struct ChatSourceMtprotoProxy {} #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "The chat contains a public service announcement "] pub struct ChatSourcePublicServiceAnnouncement { #[serde(rename = "type")] #[doc = "The type of the announcement "] pub type_: String, #[doc = "The text of the announcement"] pub text: String, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "A chat. (Can be a private chat, basic group, supergroup, or secret chat)"] pub struct Chat { #[doc = "Chat unique identifier"] #[serde(deserialize_with = "::serde_aux::field_attributes::deserialize_number_from_string")] pub id: i64, #[serde(rename = "type")] #[doc = "Type of the chat"] pub type_: ChatType, #[doc = "A chat list to which the chat belongs; may be null"] pub chat_list: Option, #[doc = "Chat title"] pub title: String, #[doc = "Chat photo; may be null"] pub photo: Option, #[doc = "Actions that non-administrator chat members are allowed to take in the chat"] pub permissions: ChatPermissions, #[doc = "Last message in the chat; may be null"] pub last_message: Option, #[doc = "Descending parameter by which chats are sorted in the main chat list. If the order number of two chats is the same, they must be sorted in descending order by ID. If 0, the position of the chat in the list is undetermined"] #[serde(deserialize_with = "::serde_aux::field_attributes::deserialize_number_from_string")] pub order: i64, #[doc = "Source of the chat in a chat list; may be null"] pub source: Option, #[doc = "True, if the chat is pinned"] #[serde(default)] pub is_pinned: bool, #[doc = "True, if the chat is marked as unread"] #[serde(default)] pub is_marked_as_unread: bool, #[doc = "True, if the chat has scheduled messages"] #[serde(default)] pub has_scheduled_messages: bool, #[doc = "True, if the chat messages can be deleted only for the current user while other users will continue to see the messages"] #[serde(default)] pub can_be_deleted_only_for_self: bool, #[doc = "True, if the chat messages can be deleted for all users"] #[serde(default)] pub can_be_deleted_for_all_users: bool, #[doc = "True, if the chat can be reported to Telegram moderators through reportChat"] #[serde(default)] pub can_be_reported: bool, #[doc = "Default value of the disable_notification parameter, used when a message is sent to the chat"] #[serde(default)] pub default_disable_notification: bool, #[doc = "Number of unread messages in the chat"] pub unread_count: i32, #[doc = "Identifier of the last read incoming message"] #[serde(deserialize_with = "::serde_aux::field_attributes::deserialize_number_from_string")] pub last_read_inbox_message_id: i64, #[doc = "Identifier of the last read outgoing message"] #[serde(deserialize_with = "::serde_aux::field_attributes::deserialize_number_from_string")] pub last_read_outbox_message_id: i64, #[doc = "Number of unread messages with a mention/reply in the chat"] pub unread_mention_count: i32, #[doc = "Notification settings for this chat"] pub notification_settings: ChatNotificationSettings, #[doc = "Describes actions which should be possible to do through a chat action bar; may be null"] pub action_bar: Option, #[doc = "Identifier of the pinned message in the chat; 0 if none"] #[serde(deserialize_with = "::serde_aux::field_attributes::deserialize_number_from_string")] pub pinned_message_id: i64, #[doc = "Identifier of the message from which reply markup needs to be used; 0 if there is no default custom reply markup in the chat"] #[serde(deserialize_with = "::serde_aux::field_attributes::deserialize_number_from_string")] pub reply_markup_message_id: i64, #[doc = "A draft of a message in the chat; may be null"] pub draft_message: Option, #[doc = "Contains client-specific data associated with the chat. (For example, the chat position or local chat notification settings can be stored here.) Persistent if the message database is used"] pub client_data: String, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "Represents a list of chats "] pub struct Chats { #[doc = "List of chat identifiers"] pub chat_ids: Vec, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "Describes a chat located nearby "] pub struct ChatNearby { #[doc = "Chat identifier "] #[serde(deserialize_with = "::serde_aux::field_attributes::deserialize_number_from_string")] pub chat_id: i64, #[doc = "Distance to the chat location in meters"] pub distance: i32, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "Represents a list of chats located nearby "] pub struct ChatsNearby { #[doc = "List of users nearby "] pub users_nearby: Vec, #[doc = "List of location-based supergroups nearby"] pub supergroups_nearby: Vec, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "Contains a chat invite link "] pub struct ChatInviteLink { #[doc = "Chat invite link"] pub invite_link: String, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "Contains information about a chat invite link"] pub struct ChatInviteLinkInfo { #[doc = "Chat identifier of the invite link; 0 if the user is not a member of this chat"] #[serde(deserialize_with = "::serde_aux::field_attributes::deserialize_number_from_string")] pub chat_id: i64, #[serde(rename = "type")] #[doc = "Contains information about the type of the chat"] pub type_: ChatType, #[doc = "Title of the chat"] pub title: String, #[doc = "Chat photo; may be null"] pub photo: Option, #[doc = "Number of members in the chat"] pub member_count: i32, #[doc = "User identifiers of some chat members that may be known to the current user"] pub member_user_ids: Vec, #[doc = "True, if the chat is a public supergroup or channel, i.e. it has a username or it is a location-based supergroup"] #[serde(default)] pub is_public: bool, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "The chat is public, because it has username"] pub struct PublicChatTypeHasUsername {} #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "The chat is public, because it is a location-based supergroup"] pub struct PublicChatTypeIsLocationBased {} #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "The chat can be reported as spam using the method reportChat with the reason chatReportReasonSpam"] pub struct ChatActionBarReportSpam {} #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "The chat is a location-based supergroup, which can be reported as having unrelated location using the method reportChat with the reason chatReportReasonUnrelatedLocation"] pub struct ChatActionBarReportUnrelatedLocation {} #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "The chat is a private or secret chat, which can be reported using the method reportChat, or the other user can be added to the contact list using the method addContact, or the other user can be blocked using the method blockUser"] pub struct ChatActionBarReportAddBlock {} #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "The chat is a private or secret chat and the other user can be added to the contact list using the method addContact"] pub struct ChatActionBarAddContact {} #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "The chat is a private or secret chat with a mutual contact and the user's phone number can be shared with the other user using the method sharePhoneNumber"] pub struct ChatActionBarSharePhoneNumber {} #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "A simple button, with text that should be sent when the button is pressed"] pub struct KeyboardButtonTypeText {} #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "A button that sends the user's phone number when pressed; available only in private chats"] pub struct KeyboardButtonTypeRequestPhoneNumber {} #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "A button that sends the user's location when pressed; available only in private chats"] pub struct KeyboardButtonTypeRequestLocation {} #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "A button that allows the user to create and send a poll when pressed; available only in private chats "] pub struct KeyboardButtonTypeRequestPoll { #[doc = "If true, only regular polls must be allowed to create "] #[serde(default)] pub force_regular: bool, #[doc = "If true, only polls in quiz mode must be allowed to create"] #[serde(default)] pub force_quiz: bool, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "Represents a single button in a bot keyboard "] pub struct KeyboardButton { #[doc = "Text of the button "] pub text: String, #[serde(rename = "type")] #[doc = "Type of the button"] pub type_: KeyboardButtonType, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "A button that opens a specified URL "] pub struct InlineKeyboardButtonTypeUrl { #[doc = "HTTP or tg:// URL to open"] pub url: String, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "A button that opens a specified URL and automatically logs in in current user if they allowed to do that "] pub struct InlineKeyboardButtonTypeLoginUrl { #[doc = "An HTTP URL to open "] pub url: String, #[doc = "Unique button identifier "] pub id: i32, #[doc = "If non-empty, new text of the button in forwarded messages"] pub forward_text: String, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "A button that sends a special callback query to a bot "] pub struct InlineKeyboardButtonTypeCallback { #[doc = "Data to be sent to the bot via a callback query"] pub data: String, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "A button with a game that sends a special callback query to a bot. This button must be in the first column and row of the keyboard and can be attached only to a message with content of the type messageGame"] pub struct InlineKeyboardButtonTypeCallbackGame {} #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "A button that forces an inline query to the bot to be inserted in the input field "] pub struct InlineKeyboardButtonTypeSwitchInline { #[doc = "Inline query to be sent to the bot "] pub query: String, #[doc = "True, if the inline query should be sent from the current chat"] #[serde(default)] pub in_current_chat: bool, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "A button to buy something. This button must be in the first column and row of the keyboard and can be attached only to a message with content of the type messageInvoice"] pub struct InlineKeyboardButtonTypeBuy {} #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "Represents a single button in an inline keyboard "] pub struct InlineKeyboardButton { #[doc = "Text of the button "] pub text: String, #[serde(rename = "type")] #[doc = "Type of the button"] pub type_: InlineKeyboardButtonType, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "Instructs clients to remove the keyboard once this message has been received. This kind of keyboard can't be received in an incoming message; instead, UpdateChatReplyMarkup with message_id == 0 will be sent"] pub struct ReplyMarkupRemoveKeyboard { #[doc = "True, if the keyboard is removed only for the mentioned users or the target user of a reply"] #[serde(default)] pub is_personal: bool, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "Instructs clients to force a reply to this message"] pub struct ReplyMarkupForceReply { #[doc = "True, if a forced reply must automatically be shown to the current user. For outgoing messages, specify true to show the forced reply only for the mentioned users and for the target user of a reply"] #[serde(default)] pub is_personal: bool, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "Contains a custom keyboard layout to quickly reply to bots"] pub struct ReplyMarkupShowKeyboard { #[doc = "A list of rows of bot keyboard buttons"] pub rows: Vec>, #[doc = "True, if the client needs to resize the keyboard vertically"] #[serde(default)] pub resize_keyboard: bool, #[doc = "True, if the client needs to hide the keyboard after use"] #[serde(default)] pub one_time: bool, #[doc = "True, if the keyboard must automatically be shown to the current user. For outgoing messages, specify true to show the keyboard only for the mentioned users and for the target user of a reply"] #[serde(default)] pub is_personal: bool, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "Contains an inline keyboard layout"] pub struct ReplyMarkupInlineKeyboard { #[doc = "A list of rows of inline keyboard buttons"] pub rows: Vec>, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "An HTTP url needs to be open "] pub struct LoginUrlInfoOpen { #[doc = "The URL to open "] pub url: String, #[doc = "True, if there is no need to show an ordinary open URL confirm"] #[serde(default)] pub skip_confirm: bool, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "An authorization confirmation dialog needs to be shown to the user "] pub struct LoginUrlInfoRequestConfirmation { #[doc = "An HTTP URL to be opened "] pub url: String, #[doc = "A domain of the URL"] pub domain: String, #[doc = "User identifier of a bot linked with the website "] pub bot_user_id: i32, #[doc = "True, if the user needs to be requested to give the permission to the bot to send them messages"] #[serde(default)] pub request_write_access: bool, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "A plain text "] pub struct RichTextPlain { #[doc = "Text"] pub text: String, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "A bold rich text "] pub struct RichTextBold { #[doc = "Text"] pub text: Box, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "An italicized rich text "] pub struct RichTextItalic { #[doc = "Text"] pub text: Box, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "An underlined rich text "] pub struct RichTextUnderline { #[doc = "Text"] pub text: Box, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "A strikethrough rich text "] pub struct RichTextStrikethrough { #[doc = "Text"] pub text: Box, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "A fixed-width rich text "] pub struct RichTextFixed { #[doc = "Text"] pub text: Box, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "A rich text URL link "] pub struct RichTextUrl { #[doc = "Text "] pub text: Box, #[doc = "URL "] pub url: String, #[doc = "True, if the URL has cached instant view server-side"] #[serde(default)] pub is_cached: bool, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "A rich text email link "] pub struct RichTextEmailAddress { #[doc = "Text "] pub text: Box, #[doc = "Email address"] pub email_address: String, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "A subscript rich text "] pub struct RichTextSubscript { #[doc = "Text"] pub text: Box, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "A superscript rich text "] pub struct RichTextSuperscript { #[doc = "Text"] pub text: Box, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "A marked rich text "] pub struct RichTextMarked { #[doc = "Text"] pub text: Box, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "A rich text phone number "] pub struct RichTextPhoneNumber { #[doc = "Text "] pub text: Box, #[doc = "Phone number"] pub phone_number: String, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "A small image inside the text "] pub struct RichTextIcon { #[doc = "The image represented as a document. The image can be in GIF, JPEG or PNG format"] pub document: Document, #[doc = "Width of a bounding box in which the image should be shown; 0 if unknown"] pub width: i32, #[doc = "Height of a bounding box in which the image should be shown; 0 if unknown"] pub height: i32, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "A rich text reference of a text on the same web page "] pub struct RichTextReference { #[doc = "The text "] pub text: Box, #[doc = "The text to show on click "] pub reference_text: Box, #[doc = "An HTTP URL, opening the reference"] pub url: String, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "An anchor "] pub struct RichTextAnchor { #[doc = "Anchor name"] pub name: String, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "A link to an anchor on the same web page "] pub struct RichTextAnchorLink { #[doc = "The link text "] pub text: Box, #[doc = "The anchor name. If the name is empty, the link should bring back to top "] pub name: String, #[doc = "An HTTP URL, opening the anchor"] pub url: String, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "A concatenation of rich texts "] pub struct RichTexts { #[doc = "Texts"] pub texts: Vec, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "Contains a caption of an instant view web page block, consisting of a text and a trailing credit "] pub struct PageBlockCaption { #[doc = "Content of the caption "] pub text: RichText, #[doc = "Block credit (like HTML tag )"] pub credit: RichText, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "Describes an item of a list page block "] pub struct PageBlockListItem { #[doc = "Item label "] pub label: String, #[doc = "Item blocks"] pub page_blocks: Vec, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "The content should be left-aligned"] pub struct PageBlockHorizontalAlignmentLeft {} #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "The content should be center-aligned"] pub struct PageBlockHorizontalAlignmentCenter {} #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "The content should be right-aligned"] pub struct PageBlockHorizontalAlignmentRight {} #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "The content should be top-aligned"] pub struct PageBlockVerticalAlignmentTop {} #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "The content should be middle-aligned"] pub struct PageBlockVerticalAlignmentMiddle {} #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "The content should be bottom-aligned"] pub struct PageBlockVerticalAlignmentBottom {} #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "Represents a cell of a table "] pub struct PageBlockTableCell { #[doc = "Cell text; may be null. If the text is null, then the cell should be invisible "] pub text: Option, #[doc = "True, if it is a header cell"] #[serde(default)] pub is_header: bool, #[doc = "The number of columns the cell should span "] pub colspan: i32, #[doc = "The number of rows the cell should span"] pub rowspan: i32, #[doc = "Horizontal cell content alignment "] pub align: PageBlockHorizontalAlignment, #[doc = "Vertical cell content alignment"] pub valign: PageBlockVerticalAlignment, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "Contains information about a related article "] pub struct PageBlockRelatedArticle { #[doc = "Related article URL "] pub url: String, #[doc = "Article title; may be empty "] pub title: String, #[doc = "Article description; may be empty"] pub description: String, #[doc = "Article photo; may be null "] pub photo: Option, #[doc = "Article author; may be empty "] pub author: String, #[doc = "Point in time (Unix timestamp) when the article was published; 0 if unknown"] pub publish_date: i32, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "The title of a page "] pub struct PageBlockTitle { #[doc = "Title"] pub title: RichText, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "The subtitle of a page "] pub struct PageBlockSubtitle { #[doc = "Subtitle"] pub subtitle: RichText, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "The author and publishing date of a page "] pub struct PageBlockAuthorDate { #[doc = "Author "] pub author: RichText, #[doc = "Point in time (Unix timestamp) when the article was published; 0 if unknown"] pub publish_date: i32, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "A header "] pub struct PageBlockHeader { #[doc = "Header"] pub header: RichText, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "A subheader "] pub struct PageBlockSubheader { #[doc = "Subheader"] pub subheader: RichText, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "A kicker "] pub struct PageBlockKicker { #[doc = "Kicker"] pub kicker: RichText, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "A text paragraph "] pub struct PageBlockParagraph { #[doc = "Paragraph text"] pub text: RichText, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "A preformatted text paragraph "] pub struct PageBlockPreformatted { #[doc = "Paragraph text "] pub text: RichText, #[doc = "Programming language for which the text should be formatted"] pub language: String, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "The footer of a page "] pub struct PageBlockFooter { #[doc = "Footer"] pub footer: RichText, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "An empty block separating a page"] pub struct PageBlockDivider {} #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "An invisible anchor on a page, which can be used in a URL to open the page from the specified anchor "] pub struct PageBlockAnchor { #[doc = "Name of the anchor"] pub name: String, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "A list of data blocks "] pub struct PageBlockList { #[doc = "The items of the list"] pub items: Vec, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "A block quote "] pub struct PageBlockBlockQuote { #[doc = "Quote text "] pub text: RichText, #[doc = "Quote credit"] pub credit: RichText, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "A pull quote "] pub struct PageBlockPullQuote { #[doc = "Quote text "] pub text: RichText, #[doc = "Quote credit"] pub credit: RichText, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "An animation "] pub struct PageBlockAnimation { #[doc = "Animation file; may be null "] pub animation: Option, #[doc = "Animation caption "] pub caption: PageBlockCaption, #[doc = "True, if the animation should be played automatically"] #[serde(default)] pub need_autoplay: bool, } #[derive(Serialize, Deserialize, Debug, Clone)] #[doc = "An audio file "] pub struct PageBlockAudio { #[doc = "Audio file; may be null "] pub audio: Option