diff options
Diffstat (limited to 'src/client_ext/generated.rs')
-rw-r--r-- | src/client_ext/generated.rs | 1592 |
1 files changed, 1592 insertions, 0 deletions
diff --git a/src/client_ext/generated.rs b/src/client_ext/generated.rs new file mode 100644 index 0000000..4ef5fa9 --- /dev/null +++ b/src/client_ext/generated.rs @@ -0,0 +1,1592 @@ +#[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"] + 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"] + 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"] + 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"] + pub use_message_database: bool, + #[doc = "If set to true, support for secret chats will be enabled"] + 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. If empty, the version is automatically detected by TDLib"] + 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"] + 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"] + pub ignore_file_names: bool, +} +#[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"] + pub is_encrypted: bool, +} +#[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 \n\nOriginal type: AuthenticationCodeInfo"] + pub code_info: SerdeJsonValue, +} +#[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 \n\nOriginal type: TermsOfService"] + pub terms_of_service: SerdeJsonValue, +} +#[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"] + 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 = "Describes an image in JPEG format "] +pub struct PhotoSize { + #[serde(rename = "type")] + #[doc = "Image type (see https://core.telegram.org/constructor/photoSize)"] + pub type_: String, + #[doc = "Information about the image file \n\nOriginal type: File"] + pub photo: SerdeJsonValue, + #[doc = "Image width "] + pub width: i32, + #[doc = "Image height"] + pub height: i32, + #[doc = "Sizes of progressive JPEG file prefixes, which can be used to preliminarily show the image"] + pub progressive_sizes: Vec<i32>, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "Describes a game "] +pub struct Game { + #[doc = "Game ID "] + #[serde(deserialize_with = "deserialize_i64_0")] + 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 \n\nOriginal type: FormattedText"] + pub text: SerdeJsonValue, + #[doc = "Game description "] + pub description: String, + #[doc = "Game photo \n\nOriginal type: Photo"] + pub photo: SerdeJsonValue, + #[doc = "Game animation; may be null \n\nOriginal type: Option<Animation>"] + pub animation: SerdeJsonValue, +} +#[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 \n\nOriginal type: UserStatus"] + pub status: SerdeJsonValue, + #[doc = "Profile photo of the user; may be null \n\nOriginal type: Option<ProfilePhoto>"] + pub profile_photo: SerdeJsonValue, + #[doc = "The user is a contact of the current user"] + pub is_contact: bool, + #[doc = "The user is a contact of the current user and the current user is a contact of the user"] + pub is_mutual_contact: bool, + #[doc = "True, if the user is verified"] + pub is_verified: bool, + #[doc = "True, if the user is Telegram support account"] + 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"] + 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"] + pub have_access: bool, + #[serde(rename = "type")] + #[doc = "Type of the user \n\nOriginal type: UserType"] + pub type_: SerdeJsonValue, + #[doc = "IETF language tag of the user's language; only available to bots"] + pub language_code: Option<String>, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "Describes a message"] +pub struct Message { + #[doc = "Message identifier; unique for the chat to which the message belongs"] + pub id: i64, + #[doc = "The sender of the message \n\nOriginal type: MessageSender"] + pub sender: SerdeJsonValue, + #[doc = "Chat identifier"] + pub chat_id: i64, + #[doc = "Information about the sending state of the message; may be null \n\nOriginal type: Option<MessageSendingState>"] + pub sending_state: SerdeJsonValue, + #[doc = "Information about the scheduling state of the message; may be null \n\nOriginal type: Option<MessageSchedulingState>"] + pub scheduling_state: SerdeJsonValue, + #[doc = "True, if the message is outgoing"] + pub is_outgoing: bool, + #[doc = "True, if the message is pinned"] + pub is_pinned: 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 application"] + pub can_be_edited: bool, + #[doc = "True, if the message can be forwarded"] + 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"] + pub can_be_deleted_only_for_self: bool, + #[doc = "True, if the message can be deleted for all users"] + pub can_be_deleted_for_all_users: bool, + #[doc = "True, if the message statistics are available"] + pub can_get_statistics: bool, + #[doc = "True, if the message thread info is available"] + pub can_get_message_thread: bool, + #[doc = "True, if the message is a channel post. All messages to channels are channel posts, all other messages are not channel posts"] + pub is_channel_post: bool, + #[doc = "True, if the message contains an unread mention for the current user"] + 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 \n\nOriginal type: Option<MessageForwardInfo>"] + pub forward_info: SerdeJsonValue, + #[doc = "Information about interactions with the message; may be null \n\nOriginal type: Option<MessageInteractionInfo>"] + pub interaction_info: SerdeJsonValue, + #[doc = "If non-zero, the identifier of the chat to which the replied message belongs; Currently, only messages in the Replies chat can have different reply_in_chat_id and chat_id"] + pub reply_in_chat_id: i64, + #[doc = "If non-zero, the identifier of the message this message is replying to; can be the identifier of a deleted message"] + pub reply_to_message_id: i64, + #[doc = "If non-zero, the identifier of the message thread the message belongs to; unique within the chat to which the message belongs"] + pub message_thread_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 and anonymous group messages, optional author signature"] + pub author_signature: String, + #[doc = "Unique identifier of an album this message belongs to. Only audios, documents, photos and videos can be grouped together in albums"] + #[serde(deserialize_with = "deserialize_i64_0")] + 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 \n\nOriginal type: Option<ReplyMarkup>"] + pub reply_markup: SerdeJsonValue, +} +#[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"] + pub id: i64, + #[serde(rename = "type")] + #[doc = "Type of the chat \n\nOriginal type: ChatType"] + pub type_: SerdeJsonValue, + #[doc = "Chat title"] + pub title: String, + #[doc = "Chat photo; may be null \n\nOriginal type: Option<ChatPhotoInfo>"] + pub photo: SerdeJsonValue, + #[doc = "Actions that non-administrator chat members are allowed to take in the chat \n\nOriginal type: ChatPermissions"] + pub permissions: SerdeJsonValue, + #[doc = "Last message in the chat; may be null"] + pub last_message: Option<Message>, + #[doc = "Positions of the chat in chat lists \n\nOriginal type: Vec<ChatPosition>"] + pub positions: SerdeJsonValue, + #[doc = "True, if the chat is marked as unread"] + pub is_marked_as_unread: bool, + #[doc = "True, if the chat is blocked by the current user and private messages from the chat can't be received"] + pub is_blocked: bool, + #[doc = "True, if the chat has scheduled messages"] + 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"] + pub can_be_deleted_only_for_self: bool, + #[doc = "True, if the chat messages can be deleted for all users"] + pub can_be_deleted_for_all_users: bool, + #[doc = "True, if the chat can be reported to Telegram moderators through reportChat"] + pub can_be_reported: bool, + #[doc = "Default value of the disable_notification parameter, used when a message is sent to the chat"] + 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"] + pub last_read_inbox_message_id: i64, + #[doc = "Identifier of the last read outgoing message"] + 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 \n\nOriginal type: ChatNotificationSettings"] + pub notification_settings: SerdeJsonValue, + #[doc = "Describes actions which should be possible to do through a chat action bar; may be null \n\nOriginal type: Option<ChatActionBar>"] + pub action_bar: SerdeJsonValue, + #[doc = "Group call identifier of an active voice chat; 0 if none or unknown. The voice chat can be received through the method getGroupCall"] + pub voice_chat_group_call_id: i32, + #[doc = "True, if an active voice chat is empty"] + pub is_voice_chat_empty: bool, + #[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"] + pub reply_markup_message_id: i64, + #[doc = "A draft of a message in the chat; may be null \n\nOriginal type: Option<DraftMessage>"] + pub draft_message: SerdeJsonValue, + #[doc = "Contains application-specific data associated with the chat. (For example, the chat scroll 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 = "A text message "] +pub struct MessageText { + #[doc = "Text of the message \n\nOriginal type: FormattedText"] + pub text: SerdeJsonValue, + #[doc = "A preview of the web page that's mentioned in the text; may be null \n\nOriginal type: Option<WebPage>"] + pub web_page: SerdeJsonValue, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "An animation message (GIF-style). "] +pub struct MessageAnimation { + #[doc = "The animation description \n\nOriginal type: Animation"] + pub animation: SerdeJsonValue, + #[doc = "Animation caption \n\nOriginal type: FormattedText"] + pub caption: SerdeJsonValue, + #[doc = "True, if the animation thumbnail must be blurred and the animation must be shown only while tapped"] + pub is_secret: bool, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "An audio message "] +pub struct MessageAudio { + #[doc = "The audio description \n\nOriginal type: Audio"] + pub audio: SerdeJsonValue, + #[doc = "Audio caption \n\nOriginal type: FormattedText"] + pub caption: SerdeJsonValue, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "A document message (general file) "] +pub struct MessageDocument { + #[doc = "The document description \n\nOriginal type: Document"] + pub document: SerdeJsonValue, + #[doc = "Document caption \n\nOriginal type: FormattedText"] + pub caption: SerdeJsonValue, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "A photo message "] +pub struct MessagePhoto { + #[doc = "The photo description \n\nOriginal type: Photo"] + pub photo: SerdeJsonValue, + #[doc = "Photo caption \n\nOriginal type: FormattedText"] + pub caption: SerdeJsonValue, + #[doc = "True, if the photo must be blurred and must be shown only while tapped"] + pub is_secret: bool, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "A sticker message "] +pub struct MessageSticker { + #[doc = "The sticker description \n\nOriginal type: Sticker"] + pub sticker: SerdeJsonValue, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "A video message "] +pub struct MessageVideo { + #[doc = "The video description \n\nOriginal type: Video"] + pub video: SerdeJsonValue, + #[doc = "Video caption \n\nOriginal type: FormattedText"] + pub caption: SerdeJsonValue, + #[doc = "True, if the video thumbnail must be blurred and the video must be shown only while tapped"] + pub is_secret: bool, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "A video note message "] +pub struct MessageVideoNote { + #[doc = "The video note description \n\nOriginal type: VideoNote"] + pub video_note: SerdeJsonValue, + #[doc = "True, if at least one of the recipients has viewed the video note "] + pub is_viewed: bool, + #[doc = "True, if the video note thumbnail must be blurred and the video note must be shown only while tapped"] + pub is_secret: bool, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "A voice note message "] +pub struct MessageVoiceNote { + #[doc = "The voice note description \n\nOriginal type: VoiceNote"] + pub voice_note: SerdeJsonValue, + #[doc = "Voice note caption \n\nOriginal type: FormattedText"] + pub caption: SerdeJsonValue, + #[doc = "True, if at least one of the recipients has listened to the voice note"] + pub is_listened: bool, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "A message with a location "] +pub struct MessageLocation { + #[doc = "The location description \n\nOriginal type: Location"] + pub location: SerdeJsonValue, + #[doc = "Time relative to the message send date, for which the location can be updated, in seconds"] + pub live_period: i32, + #[doc = "Left time for which the location can be updated, in seconds. updateMessageContent is not sent when this field changes"] + pub expires_in: i32, + #[doc = "For live locations, a direction in which the location moves, in degrees; 1-360. If 0 the direction is unknown"] + pub heading: i32, + #[doc = "For live locations, a maximum distance to another chat member for proximity alerts, in meters (0-100000). 0 if the notification is disabled. Available only for the message sender"] + pub proximity_alert_radius: i32, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "A message with information about a venue "] +pub struct MessageVenue { + #[doc = "The venue description \n\nOriginal type: Venue"] + pub venue: SerdeJsonValue, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "A message with a user contact "] +pub struct MessageContact { + #[doc = "The contact description \n\nOriginal type: Contact"] + pub contact: SerdeJsonValue, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "A dice message. The dice value is randomly generated by the server"] +pub struct MessageDice { + #[doc = "The animated stickers with the initial dice animation; may be null if unknown. updateMessageContent will be sent when the sticker became known \n\nOriginal type: Option<DiceStickers>"] + pub initial_state: SerdeJsonValue, + #[doc = "The animated stickers with the final dice animation; may be null if unknown. updateMessageContent will be sent when the sticker became known \n\nOriginal type: Option<DiceStickers>"] + pub final_state: SerdeJsonValue, + #[doc = "Emoji on which the dice throw animation is based"] + pub emoji: String, + #[doc = "The dice value. If the value is 0, the dice don't have final state yet"] + pub value: i32, + #[doc = "Number of frame after which a success animation like a shower of confetti needs to be shown on updateMessageSendSucceeded"] + pub success_animation_frame_number: i32, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "A message with a game "] +pub struct MessageGame { + #[doc = "The game description"] + pub game: Game, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "A message with a poll "] +pub struct MessagePoll { + #[doc = "The poll description \n\nOriginal type: Poll"] + pub poll: SerdeJsonValue, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "A message with an invoice from a bot "] +pub struct MessageInvoice { + #[doc = "Product title "] + pub title: String, + #[doc = "Product description "] + pub description: String, + #[doc = "Product photo; may be null \n\nOriginal type: Option<Photo>"] + pub photo: SerdeJsonValue, + #[doc = "Currency for the product price "] + pub currency: String, + #[doc = "Product total price in the minimal quantity of the currency"] + pub total_amount: i64, + #[doc = "Unique invoice bot start_parameter. To share an invoice use the URL https://t.me/{bot_username}?start={start_parameter} "] + pub start_parameter: String, + #[doc = "True, if the invoice is a test invoice"] + pub is_test: bool, + #[doc = "True, if the shipping address should be specified "] + pub need_shipping_address: bool, + #[doc = "The identifier of the message with the receipt, after the product has been purchased"] + pub receipt_message_id: i64, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "A message with information about an ended call "] +pub struct MessageCall { + #[doc = "True, if the call was a video call "] + pub is_video: bool, + #[doc = "Reason why the call was discarded \n\nOriginal type: CallDiscardReason"] + pub discard_reason: SerdeJsonValue, + #[doc = "Call duration, in seconds"] + pub duration: i32, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "A newly created voice chat "] +pub struct MessageVoiceChatStarted { + #[doc = "Identifier of the voice chat. The voice chat can be received through the method getGroupCall"] + pub group_call_id: i32, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "A message with information about an ended voice chat "] +pub struct MessageVoiceChatEnded { + #[doc = "Call duration"] + pub duration: i32, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "A message with information about an invite to a voice chat "] +pub struct MessageInviteVoiceChatParticipants { + #[doc = "Identifier of the voice chat. The voice chat can be received through the method getGroupCall "] + pub group_call_id: i32, + #[doc = "Invited user identifiers"] + pub user_ids: Vec<i32>, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "A newly created basic group "] +pub struct MessageBasicGroupChatCreate { + #[doc = "Title of the basic group "] + pub title: String, + #[doc = "User identifiers of members in the basic group"] + pub member_user_ids: Vec<i32>, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "A newly created supergroup or channel "] +pub struct MessageSupergroupChatCreate { + #[doc = "Title of the supergroup or channel"] + pub title: String, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "An updated chat title "] +pub struct MessageChatChangeTitle { + #[doc = "New chat title"] + pub title: String, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "An updated chat photo "] +pub struct MessageChatChangePhoto { + #[doc = "New chat photo \n\nOriginal type: ChatPhoto"] + pub photo: SerdeJsonValue, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "New chat members were added "] +pub struct MessageChatAddMembers { + #[doc = "User identifiers of the new members"] + pub member_user_ids: Vec<i32>, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "A chat member was deleted "] +pub struct MessageChatDeleteMember { + #[doc = "User identifier of the deleted chat member"] + pub user_id: i32, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "A basic group was upgraded to a supergroup and was deactivated as the result "] +pub struct MessageChatUpgradeTo { + #[doc = "Identifier of the supergroup to which the basic group was upgraded"] + pub supergroup_id: i32, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "A supergroup has been created from a basic group "] +pub struct MessageChatUpgradeFrom { + #[doc = "Title of the newly created supergroup "] + pub title: String, + #[doc = "The identifier of the original basic group"] + pub basic_group_id: i32, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "A message has been pinned "] +pub struct MessagePinMessage { + #[doc = "Identifier of the pinned message, can be an identifier of a deleted message or 0"] + pub message_id: i64, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "The TTL (Time To Live) setting messages in a secret chat has been changed "] +pub struct MessageChatSetTtl { + #[doc = "New TTL"] + pub ttl: i32, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "A non-standard action has happened in the chat "] +pub struct MessageCustomServiceAction { + #[doc = "Message text to be shown in the chat"] + pub text: String, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "A new high score was achieved in a game "] +pub struct MessageGameScore { + #[doc = "Identifier of the message with the game, can be an identifier of a deleted message "] + pub game_message_id: i64, + #[doc = "Identifier of the game; may be different from the games presented in the message with the game "] + #[serde(deserialize_with = "deserialize_i64_0")] + pub game_id: i64, + #[doc = "New score"] + pub score: i32, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "A payment has been completed "] +pub struct MessagePaymentSuccessful { + #[doc = "Identifier of the message with the corresponding invoice; can be an identifier of a deleted message "] + pub invoice_message_id: i64, + #[doc = "Currency for the price of the product "] + pub currency: String, + #[doc = "Total price for the product, in the minimal quantity of the currency"] + pub total_amount: i64, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "A payment has been completed; for bots only "] +pub struct MessagePaymentSuccessfulBot { + #[doc = "Identifier of the message with the corresponding invoice; can be an identifier of a deleted message "] + pub invoice_message_id: i64, + #[doc = "Currency for price of the product"] + pub currency: String, + #[doc = "Total price for the product, in the minimal quantity of the currency "] + pub total_amount: i64, + #[doc = "Invoice payload "] + pub invoice_payload: String, + #[doc = "Identifier of the shipping option chosen by the user; may be empty if not applicable "] + pub shipping_option_id: String, + #[doc = "Information about the order; may be null \n\nOriginal type: Option<OrderInfo>"] + pub order_info: SerdeJsonValue, + #[doc = "Telegram payment identifier "] + pub telegram_payment_charge_id: String, + #[doc = "Provider payment identifier"] + pub provider_payment_charge_id: String, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "The current user has connected a website by logging in using Telegram Login Widget on it "] +pub struct MessageWebsiteConnected { + #[doc = "Domain name of the connected website"] + pub domain_name: String, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "Telegram Passport data has been sent "] +pub struct MessagePassportDataSent { + #[doc = "List of Telegram Passport element types sent \n\nOriginal type: Vec<PassportElementType>"] + pub types: SerdeJsonValue, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "Telegram Passport data has been received; for bots only "] +pub struct MessagePassportDataReceived { + #[doc = "List of received Telegram Passport elements \n\nOriginal type: Vec<EncryptedPassportElement>"] + pub elements: SerdeJsonValue, + #[doc = "Encrypted data credentials \n\nOriginal type: EncryptedCredentials"] + pub credentials: SerdeJsonValue, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "A user in the chat came within proximity alert range "] +pub struct MessageProximityAlertTriggered { + #[doc = "The user or chat, which triggered the proximity alert \n\nOriginal type: MessageSender"] + pub traveler: SerdeJsonValue, + #[doc = "The user or chat, which subscribed for the proximity alert \n\nOriginal type: MessageSender"] + pub watcher: SerdeJsonValue, + #[doc = "The distance between the users"] + pub distance: i32, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "Contains settings for the authentication of the user's phone number"] +pub struct PhoneNumberAuthenticationSettings { + #[doc = "Pass true if the authentication code may be sent via flash call to the specified phone number"] + pub allow_flash_call: bool, + #[doc = "Pass true if the authenticated phone number is used on the current device"] + pub is_current_phone_number: bool, + #[doc = "For official applications only. True, if the application can use Android SMS Retriever API (requires Google Play Services >= 10.2) to automatically receive the authentication code from the SMS. See https://developers.google.com/identity/sms-retriever/ for more details"] + pub allow_sms_retriever_api: bool, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "The user authorization state has changed "] +pub struct UpdateAuthorizationState { + #[doc = "New authorization state"] + pub authorization_state: AuthorizationState, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "A new message was received; can also be an outgoing message "] +pub struct UpdateNewMessage { + #[doc = "The new message"] + pub message: Message, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "A request to send a message has reached the Telegram server. This doesn't mean that the message will be sent successfully or even that the send message request will be processed. This update will be sent only if the option \"use_quick_ack\" is set to true. This update may be sent multiple times for the same message"] +pub struct UpdateMessageSendAcknowledged { + #[doc = "The chat identifier of the sent message "] + pub chat_id: i64, + #[doc = "A temporary message identifier"] + pub message_id: i64, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "A message has been successfully sent "] +pub struct UpdateMessageSendSucceeded { + #[doc = "Information about the sent message. Usually only the message identifier, date, and content are changed, but almost all other fields can also change "] + pub message: Message, + #[doc = "The previous temporary message identifier"] + pub old_message_id: i64, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "A message failed to send. Be aware that some messages being sent can be irrecoverably deleted, in which case updateDeleteMessages will be received instead of this update"] +pub struct UpdateMessageSendFailed { + #[doc = "Contains information about the message which failed to send "] + pub message: Message, + #[doc = "The previous temporary message identifier "] + pub old_message_id: i64, + #[doc = "An error code "] + pub error_code: i32, + #[doc = "Error message"] + pub error_message: String, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "The message content has changed "] +pub struct UpdateMessageContent { + #[doc = "Chat identifier "] + pub chat_id: i64, + #[doc = "Message identifier "] + pub message_id: i64, + #[doc = "New message content"] + pub new_content: MessageContent, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "A message was edited. Changes in the message content will come in a separate updateMessageContent "] +pub struct UpdateMessageEdited { + #[doc = "Chat identifier "] + pub chat_id: i64, + #[doc = "Message identifier "] + pub message_id: i64, + #[doc = "Point in time (Unix timestamp) when the message was edited "] + pub edit_date: i32, + #[doc = "New message reply markup; may be null \n\nOriginal type: Option<ReplyMarkup>"] + pub reply_markup: SerdeJsonValue, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "The message pinned state was changed "] +pub struct UpdateMessageIsPinned { + #[doc = "Chat identifier "] + pub chat_id: i64, + #[doc = "The message identifier "] + pub message_id: i64, + #[doc = "True, if the message is pinned"] + pub is_pinned: bool, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "The information about interactions with a message has changed "] +pub struct UpdateMessageInteractionInfo { + #[doc = "Chat identifier "] + pub chat_id: i64, + #[doc = "Message identifier "] + pub message_id: i64, + #[doc = "New information about interactions with the message; may be null \n\nOriginal type: Option<MessageInteractionInfo>"] + pub interaction_info: SerdeJsonValue, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "The message content was opened. Updates voice note messages to \"listened\", video note messages to \"viewed\" and starts the TTL timer for self-destructing messages "] +pub struct UpdateMessageContentOpened { + #[doc = "Chat identifier "] + pub chat_id: i64, + #[doc = "Message identifier"] + pub message_id: i64, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "A message with an unread mention was read "] +pub struct UpdateMessageMentionRead { + #[doc = "Chat identifier "] + pub chat_id: i64, + #[doc = "Message identifier "] + pub message_id: i64, + #[doc = "The new number of unread mention messages left in the chat"] + pub unread_mention_count: i32, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "A message with a live location was viewed. When the update is received, the application is supposed to update the live location"] +pub struct UpdateMessageLiveLocationViewed { + #[doc = "Identifier of the chat with the live location message "] + pub chat_id: i64, + #[doc = "Identifier of the message with live location"] + pub message_id: i64, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "A new chat has been loaded/created. This update is guaranteed to come before the chat identifier is returned to the application. The chat field changes will be reported through separate updates "] +pub struct UpdateNewChat { + #[doc = "The chat"] + pub chat: Chat, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "The title of a chat was changed "] +pub struct UpdateChatTitle { + #[doc = "Chat identifier "] + pub chat_id: i64, + #[doc = "The new chat title"] + pub title: String, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "A chat photo was changed "] +pub struct UpdateChatPhoto { + #[doc = "Chat identifier "] + pub chat_id: i64, + #[doc = "The new chat photo; may be null \n\nOriginal type: Option<ChatPhotoInfo>"] + pub photo: SerdeJsonValue, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "Chat permissions was changed "] +pub struct UpdateChatPermissions { + #[doc = "Chat identifier "] + pub chat_id: i64, + #[doc = "The new chat permissions \n\nOriginal type: ChatPermissions"] + pub permissions: SerdeJsonValue, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "The last message of a chat was changed. If last_message is null, then the last message in the chat became unknown. Some new unknown messages might be added to the chat in this case "] +pub struct UpdateChatLastMessage { + #[doc = "Chat identifier "] + pub chat_id: i64, + #[doc = "The new last message in the chat; may be null "] + pub last_message: Option<Message>, + #[doc = "The new chat positions in the chat lists \n\nOriginal type: Vec<ChatPosition>"] + pub positions: SerdeJsonValue, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "The position of a chat in a chat list has changed. Instead of this update updateChatLastMessage or updateChatDraftMessage might be sent "] +pub struct UpdateChatPosition { + #[doc = "Chat identifier "] + pub chat_id: i64, + #[doc = "New chat position. If new order is 0, then the chat needs to be removed from the list \n\nOriginal type: ChatPosition"] + pub position: SerdeJsonValue, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "A chat was marked as unread or was read "] +pub struct UpdateChatIsMarkedAsUnread { + #[doc = "Chat identifier "] + pub chat_id: i64, + #[doc = "New value of is_marked_as_unread"] + pub is_marked_as_unread: bool, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "A chat was blocked or unblocked "] +pub struct UpdateChatIsBlocked { + #[doc = "Chat identifier "] + pub chat_id: i64, + #[doc = "New value of is_blocked"] + pub is_blocked: bool, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "A chat's has_scheduled_messages field has changed "] +pub struct UpdateChatHasScheduledMessages { + #[doc = "Chat identifier "] + pub chat_id: i64, + #[doc = "New value of has_scheduled_messages"] + pub has_scheduled_messages: bool, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "A chat voice chat state has changed "] +pub struct UpdateChatVoiceChat { + #[doc = "Chat identifier "] + pub chat_id: i64, + #[doc = "New value of voice_chat_group_call_id "] + pub voice_chat_group_call_id: i32, + #[doc = "New value of is_voice_chat_empty"] + pub is_voice_chat_empty: bool, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "The value of the default disable_notification parameter, used when a message is sent to the chat, was changed "] +pub struct UpdateChatDefaultDisableNotification { + #[doc = "Chat identifier "] + pub chat_id: i64, + #[doc = "The new default_disable_notification value"] + pub default_disable_notification: bool, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "Incoming messages were read or number of unread messages has been changed "] +pub struct UpdateChatReadInbox { + #[doc = "Chat identifier "] + pub chat_id: i64, + #[doc = "Identifier of the last read incoming message "] + pub last_read_inbox_message_id: i64, + #[doc = "The number of unread messages left in the chat"] + pub unread_count: i32, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "Outgoing messages were read "] +pub struct UpdateChatReadOutbox { + #[doc = "Chat identifier "] + pub chat_id: i64, + #[doc = "Identifier of last read outgoing message"] + pub last_read_outbox_message_id: i64, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "The chat unread_mention_count has changed "] +pub struct UpdateChatUnreadMentionCount { + #[doc = "Chat identifier "] + pub chat_id: i64, + #[doc = "The number of unread mention messages left in the chat"] + pub unread_mention_count: i32, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "Notification settings for a chat were changed "] +pub struct UpdateChatNotificationSettings { + #[doc = "Chat identifier "] + pub chat_id: i64, + #[doc = "The new notification settings \n\nOriginal type: ChatNotificationSettings"] + pub notification_settings: SerdeJsonValue, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "Notification settings for some type of chats were updated "] +pub struct UpdateScopeNotificationSettings { + #[doc = "Types of chats for which notification settings were updated \n\nOriginal type: NotificationSettingsScope"] + pub scope: SerdeJsonValue, + #[doc = "The new notification settings \n\nOriginal type: ScopeNotificationSettings"] + pub notification_settings: SerdeJsonValue, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "The chat action bar was changed "] +pub struct UpdateChatActionBar { + #[doc = "Chat identifier "] + pub chat_id: i64, + #[doc = "The new value of the action bar; may be null \n\nOriginal type: Option<ChatActionBar>"] + pub action_bar: SerdeJsonValue, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "The default chat reply markup was changed. Can occur because new messages with reply markup were received or because an old reply markup was hidden by the user"] +pub struct UpdateChatReplyMarkup { + #[doc = "Chat identifier "] + pub chat_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"] + pub reply_markup_message_id: i64, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "A chat draft has changed. Be aware that the update may come in the currently opened chat but with old content of the draft. If the user has changed the content of the draft, this update shouldn't be applied "] +pub struct UpdateChatDraftMessage { + #[doc = "Chat identifier "] + pub chat_id: i64, + #[doc = "The new draft message; may be null \n\nOriginal type: Option<DraftMessage>"] + pub draft_message: SerdeJsonValue, + #[doc = "The new chat positions in the chat lists \n\nOriginal type: Vec<ChatPosition>"] + pub positions: SerdeJsonValue, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "The list of chat filters or a chat filter has changed "] +pub struct UpdateChatFilters { + #[doc = "The new list of chat filters \n\nOriginal type: Vec<ChatFilterInfo>"] + pub chat_filters: SerdeJsonValue, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "The number of online group members has changed. This update with non-zero count is sent only for currently opened chats. There is no guarantee that it will be sent just after the count has changed "] +pub struct UpdateChatOnlineMemberCount { + #[doc = "Identifier of the chat "] + pub chat_id: i64, + #[doc = "New number of online members in the chat, or 0 if unknown"] + pub online_member_count: i32, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "A notification was changed "] +pub struct UpdateNotification { + #[doc = "Unique notification group identifier "] + pub notification_group_id: i32, + #[doc = "Changed notification \n\nOriginal type: Notification"] + pub notification: SerdeJsonValue, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "A list of active notifications in a notification group has changed"] +pub struct UpdateNotificationGroup { + #[doc = "Unique notification group identifier"] + pub notification_group_id: i32, + #[serde(rename = "type")] + #[doc = "New type of the notification group \n\nOriginal type: NotificationGroupType"] + pub type_: SerdeJsonValue, + #[doc = "Identifier of a chat to which all notifications in the group belong"] + pub chat_id: i64, + #[doc = "Chat identifier, which notification settings must be applied to the added notifications"] + pub notification_settings_chat_id: i64, + #[doc = "True, if the notifications should be shown without sound"] + pub is_silent: bool, + #[doc = "Total number of unread notifications in the group, can be bigger than number of active notifications"] + pub total_count: i32, + #[doc = "List of added group notifications, sorted by notification ID \n\nOriginal type: Vec<Notification>"] + pub added_notifications: SerdeJsonValue, + #[doc = "Identifiers of removed group notifications, sorted by notification ID"] + pub removed_notification_ids: Vec<i32>, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "Contains active notifications that was shown on previous application launches. This update is sent only if the message database is used. In that case it comes once before any updateNotification and updateNotificationGroup update "] +pub struct UpdateActiveNotifications { + #[doc = "Lists of active notification groups \n\nOriginal type: Vec<NotificationGroup>"] + pub groups: SerdeJsonValue, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "Describes whether there are some pending notification updates. Can be used to prevent application from killing, while there are some pending notifications"] +pub struct UpdateHavePendingNotifications { + #[doc = "True, if there are some delayed notification updates, which will be sent soon"] + pub have_delayed_notifications: bool, + #[doc = "True, if there can be some yet unreceived notifications, which are being fetched from the server"] + pub have_unreceived_notifications: bool, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "Some messages were deleted "] +pub struct UpdateDeleteMessages { + #[doc = "Chat identifier "] + pub chat_id: i64, + #[doc = "Identifiers of the deleted messages"] + pub message_ids: Vec<i64>, + #[doc = "True, if the messages are permanently deleted by a user (as opposed to just becoming inaccessible)"] + pub is_permanent: bool, + #[doc = "True, if the messages are deleted only from the cache and can possibly be retrieved again in the future"] + pub from_cache: bool, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "User activity in the chat has changed "] +pub struct UpdateUserChatAction { + #[doc = "Chat identifier "] + pub chat_id: i64, + #[doc = "If not 0, a message thread identifier in which the action was performed "] + pub message_thread_id: i64, + #[doc = "Identifier of a user performing an action "] + pub user_id: i32, + #[doc = "The action description \n\nOriginal type: ChatAction"] + pub action: SerdeJsonValue, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "The user went online or offline "] +pub struct UpdateUserStatus { + #[doc = "User identifier "] + pub user_id: i32, + #[doc = "New status of the user \n\nOriginal type: UserStatus"] + pub status: SerdeJsonValue, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "Some data of a user has changed. This update is guaranteed to come before the user identifier is returned to the application "] +pub struct UpdateUser { + #[doc = "New data about the user"] + pub user: User, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "Some data of a basic group has changed. This update is guaranteed to come before the basic group identifier is returned to the application "] +pub struct UpdateBasicGroup { + #[doc = "New data about the group \n\nOriginal type: BasicGroup"] + pub basic_group: SerdeJsonValue, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "Some data of a supergroup or a channel has changed. This update is guaranteed to come before the supergroup identifier is returned to the application "] +pub struct UpdateSupergroup { + #[doc = "New data about the supergroup \n\nOriginal type: Supergroup"] + pub supergroup: SerdeJsonValue, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "Some data of a secret chat has changed. This update is guaranteed to come before the secret chat identifier is returned to the application "] +pub struct UpdateSecretChat { + #[doc = "New data about the secret chat \n\nOriginal type: SecretChat"] + pub secret_chat: SerdeJsonValue, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "Some data from userFullInfo has been changed "] +pub struct UpdateUserFullInfo { + #[doc = "User identifier "] + pub user_id: i32, + #[doc = "New full information about the user \n\nOriginal type: UserFullInfo"] + pub user_full_info: SerdeJsonValue, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "Some data from basicGroupFullInfo has been changed "] +pub struct UpdateBasicGroupFullInfo { + #[doc = "Identifier of a basic group "] + pub basic_group_id: i32, + #[doc = "New full information about the group \n\nOriginal type: BasicGroupFullInfo"] + pub basic_group_full_info: SerdeJsonValue, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "Some data from supergroupFullInfo has been changed "] +pub struct UpdateSupergroupFullInfo { + #[doc = "Identifier of the supergroup or channel "] + pub supergroup_id: i32, + #[doc = "New full information about the supergroup \n\nOriginal type: SupergroupFullInfo"] + pub supergroup_full_info: SerdeJsonValue, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "Service notification from the server. Upon receiving this the application must show a popup with the content of the notification"] +pub struct UpdateServiceNotification { + #[serde(rename = "type")] + #[doc = "Notification type. If type begins with \"AUTH_KEY_DROP_\", then two buttons \"Cancel\" and \"Log out\" should be shown under notification; if user presses the second, all local data should be destroyed using Destroy method"] + pub type_: String, + #[doc = "Notification content"] + pub content: MessageContent, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "Information about a file was updated "] +pub struct UpdateFile { + #[doc = "New data about the file \n\nOriginal type: File"] + pub file: SerdeJsonValue, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "The file generation process needs to be started by the application"] +pub struct UpdateFileGenerationStart { + #[doc = "Unique identifier for the generation process"] + #[serde(deserialize_with = "deserialize_i64_0")] + pub generation_id: i64, + #[doc = "The path to a file from which a new file is generated; may be empty"] + pub original_path: String, + #[doc = "The path to a file that should be created and where the new file should be generated"] + pub destination_path: String, + #[doc = "String specifying the conversion applied to the original file. If conversion is \"#url#\" than original_path contains an HTTP/HTTPS URL of a file, which should be downloaded by the application"] + pub conversion: String, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "File generation is no longer needed "] +pub struct UpdateFileGenerationStop { + #[doc = "Unique identifier for the generation process"] + #[serde(deserialize_with = "deserialize_i64_0")] + pub generation_id: i64, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "New call was created or information about a call was updated "] +pub struct UpdateCall { + #[doc = "New data about a call \n\nOriginal type: Call"] + pub call: SerdeJsonValue, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "Information about a group call was updated "] +pub struct UpdateGroupCall { + #[doc = "New data about a group call \n\nOriginal type: GroupCall"] + pub group_call: SerdeJsonValue, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "Information about a group call participant was changed. The updates are sent only after the group call is received through getGroupCall and only if the call is joined or being joined"] +pub struct UpdateGroupCallParticipant { + #[doc = "Identifier of group call "] + pub group_call_id: i32, + #[doc = "New data about a participant \n\nOriginal type: GroupCallParticipant"] + pub participant: SerdeJsonValue, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "New call signaling data arrived "] +pub struct UpdateNewCallSignalingData { + #[doc = "The call identifier "] + pub call_id: i32, + #[doc = "The data"] + pub data: String, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "Some privacy setting rules have been changed "] +pub struct UpdateUserPrivacySettingRules { + #[doc = "The privacy setting \n\nOriginal type: UserPrivacySetting"] + pub setting: SerdeJsonValue, + #[doc = "New privacy rules \n\nOriginal type: UserPrivacySettingRules"] + pub rules: SerdeJsonValue, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "Number of unread messages in a chat list has changed. This update is sent only if the message database is used "] +pub struct UpdateUnreadMessageCount { + #[doc = "The chat list with changed number of unread messages \n\nOriginal type: ChatList"] + pub chat_list: SerdeJsonValue, + #[doc = "Total number of unread messages "] + pub unread_count: i32, + #[doc = "Total number of unread messages in unmuted chats"] + pub unread_unmuted_count: i32, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "Number of unread chats, i.e. with unread messages or marked as unread, has changed. This update is sent only if the message database is used"] +pub struct UpdateUnreadChatCount { + #[doc = "The chat list with changed number of unread messages \n\nOriginal type: ChatList"] + pub chat_list: SerdeJsonValue, + #[doc = "Approximate total number of chats in the chat list"] + pub total_count: i32, + #[doc = "Total number of unread chats "] + pub unread_count: i32, + #[doc = "Total number of unread unmuted chats"] + pub unread_unmuted_count: i32, + #[doc = "Total number of chats marked as unread "] + pub marked_as_unread_count: i32, + #[doc = "Total number of unmuted chats marked as unread"] + pub marked_as_unread_unmuted_count: i32, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "An option changed its value "] +pub struct UpdateOption { + #[doc = "The option name "] + pub name: String, + #[doc = "The new option value \n\nOriginal type: OptionValue"] + pub value: SerdeJsonValue, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "A sticker set has changed "] +pub struct UpdateStickerSet { + #[doc = "The sticker set \n\nOriginal type: StickerSet"] + pub sticker_set: SerdeJsonValue, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "The list of installed sticker sets was updated "] +pub struct UpdateInstalledStickerSets { + #[doc = "True, if the list of installed mask sticker sets was updated "] + pub is_masks: bool, + #[doc = "The new list of installed ordinary sticker sets"] + #[serde(deserialize_with = "deserialize_i64_1")] + pub sticker_set_ids: Vec<i64>, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "The list of trending sticker sets was updated or some of them were viewed "] +pub struct UpdateTrendingStickerSets { + #[doc = "The prefix of the list of trending sticker sets with the newest trending sticker sets \n\nOriginal type: StickerSets"] + pub sticker_sets: SerdeJsonValue, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "The list of recently used stickers was updated "] +pub struct UpdateRecentStickers { + #[doc = "True, if the list of stickers attached to photo or video files was updated, otherwise the list of sent stickers is updated "] + pub is_attached: bool, + #[doc = "The new list of file identifiers of recently used stickers"] + pub sticker_ids: Vec<i32>, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "The list of favorite stickers was updated "] +pub struct UpdateFavoriteStickers { + #[doc = "The new list of file identifiers of favorite stickers"] + pub sticker_ids: Vec<i32>, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "The list of saved animations was updated "] +pub struct UpdateSavedAnimations { + #[doc = "The new list of file identifiers of saved animations"] + pub animation_ids: Vec<i32>, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "The selected background has changed "] +pub struct UpdateSelectedBackground { + #[doc = "True, if background for dark theme has changed "] + pub for_dark_theme: bool, + #[doc = "The new selected background; may be null \n\nOriginal type: Option<Background>"] + pub background: SerdeJsonValue, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "Some language pack strings have been updated "] +pub struct UpdateLanguagePackStrings { + #[doc = "Localization target to which the language pack belongs "] + pub localization_target: String, + #[doc = "Identifier of the updated language pack "] + pub language_pack_id: String, + #[doc = "List of changed language pack strings \n\nOriginal type: Vec<LanguagePackString>"] + pub strings: SerdeJsonValue, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "The connection state has changed. This update must be used only to show a human-readable description of the connection state "] +pub struct UpdateConnectionState { + #[doc = "The new connection state \n\nOriginal type: ConnectionState"] + pub state: SerdeJsonValue, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "New terms of service must be accepted by the user. If the terms of service are declined, then the deleteAccount method should be called with the reason \"Decline ToS update\" "] +pub struct UpdateTermsOfService { + #[doc = "Identifier of the terms of service "] + pub terms_of_service_id: String, + #[doc = "The new terms of service \n\nOriginal type: TermsOfService"] + pub terms_of_service: SerdeJsonValue, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "The list of users nearby has changed. The update is guaranteed to be sent only 60 seconds after a successful searchChatsNearby request "] +pub struct UpdateUsersNearby { + #[doc = "The new list of users nearby \n\nOriginal type: Vec<ChatNearby>"] + pub users_nearby: SerdeJsonValue, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "The list of supported dice emojis has changed "] +pub struct UpdateDiceEmojis { + #[doc = "The new list of supported dice emojis"] + pub emojis: Vec<String>, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "The parameters of animation search through GetOption(\"animation_search_bot_username\") bot has changed "] +pub struct UpdateAnimationSearchParameters { + #[doc = "Name of the animation search provider "] + pub provider: String, + #[doc = "The new list of emojis suggested for searching"] + pub emojis: Vec<String>, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "The list of suggested to the user actions has changed "] +pub struct UpdateSuggestedActions { + #[doc = "Added suggested actions \n\nOriginal type: Vec<SuggestedAction>"] + pub added_actions: SerdeJsonValue, + #[doc = "Removed suggested actions \n\nOriginal type: Vec<SuggestedAction>"] + pub removed_actions: SerdeJsonValue, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "A new incoming inline query; for bots only "] +pub struct UpdateNewInlineQuery { + #[doc = "Unique query identifier "] + #[serde(deserialize_with = "deserialize_i64_0")] + pub id: i64, + #[doc = "Identifier of the user who sent the query "] + pub sender_user_id: i32, + #[doc = "User location; may be null \n\nOriginal type: Option<Location>"] + pub user_location: SerdeJsonValue, + #[doc = "Contains information about the type of the chat, from which the query originated; may be null if unknown \n\nOriginal type: Option<ChatType>"] + pub chat_type: SerdeJsonValue, + #[doc = "Text of the query "] + pub query: String, + #[doc = "Offset of the first entry to return"] + pub offset: String, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "The user has chosen a result of an inline query; for bots only "] +pub struct UpdateNewChosenInlineResult { + #[doc = "Identifier of the user who sent the query "] + pub sender_user_id: i32, + #[doc = "User location; may be null \n\nOriginal type: Option<Location>"] + pub user_location: SerdeJsonValue, + #[doc = "Text of the query "] + pub query: String, + #[doc = "Identifier of the chosen result "] + pub result_id: String, + #[doc = "Identifier of the sent inline message, if known"] + pub inline_message_id: String, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "A new incoming callback query; for bots only "] +pub struct UpdateNewCallbackQuery { + #[doc = "Unique query identifier "] + #[serde(deserialize_with = "deserialize_i64_0")] + pub id: i64, + #[doc = "Identifier of the user who sent the query"] + pub sender_user_id: i32, + #[doc = "Identifier of the chat where the query was sent "] + pub chat_id: i64, + #[doc = "Identifier of the message, from which the query originated"] + pub message_id: i64, + #[doc = "Identifier that uniquely corresponds to the chat to which the message was sent "] + #[serde(deserialize_with = "deserialize_i64_0")] + pub chat_instance: i64, + #[doc = "Query payload \n\nOriginal type: CallbackQueryPayload"] + pub payload: SerdeJsonValue, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "A new incoming callback query from a message sent via a bot; for bots only "] +pub struct UpdateNewInlineCallbackQuery { + #[doc = "Unique query identifier "] + #[serde(deserialize_with = "deserialize_i64_0")] + pub id: i64, + #[doc = "Identifier of the user who sent the query "] + pub sender_user_id: i32, + #[doc = "Identifier of the inline message, from which the query originated"] + pub inline_message_id: String, + #[doc = "An identifier uniquely corresponding to the chat a message was sent to "] + #[serde(deserialize_with = "deserialize_i64_0")] + pub chat_instance: i64, + #[doc = "Query payload \n\nOriginal type: CallbackQueryPayload"] + pub payload: SerdeJsonValue, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "A new incoming shipping query; for bots only. Only for invoices with flexible price "] +pub struct UpdateNewShippingQuery { + #[doc = "Unique query identifier "] + #[serde(deserialize_with = "deserialize_i64_0")] + pub id: i64, + #[doc = "Identifier of the user who sent the query "] + pub sender_user_id: i32, + #[doc = "Invoice payload "] + pub invoice_payload: String, + #[doc = "User shipping address \n\nOriginal type: Address"] + pub shipping_address: SerdeJsonValue, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "A new incoming pre-checkout query; for bots only. Contains full information about a checkout "] +pub struct UpdateNewPreCheckoutQuery { + #[doc = "Unique query identifier "] + #[serde(deserialize_with = "deserialize_i64_0")] + pub id: i64, + #[doc = "Identifier of the user who sent the query "] + pub sender_user_id: i32, + #[doc = "Currency for the product price "] + pub currency: String, + #[doc = "Total price for the product, in the minimal quantity of the currency"] + pub total_amount: i64, + #[doc = "Invoice payload "] + pub invoice_payload: String, + #[doc = "Identifier of a shipping option chosen by the user; may be empty if not applicable "] + pub shipping_option_id: String, + #[doc = "Information about the order; may be null \n\nOriginal type: Option<OrderInfo>"] + pub order_info: SerdeJsonValue, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "A new incoming event; for bots only "] +pub struct UpdateNewCustomEvent { + #[doc = "A JSON-serialized event"] + pub event: String, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "A new incoming query; for bots only "] +pub struct UpdateNewCustomQuery { + #[doc = "The query identifier "] + #[serde(deserialize_with = "deserialize_i64_0")] + pub id: i64, + #[doc = "JSON-serialized query data "] + pub data: String, + #[doc = "Query timeout"] + pub timeout: i32, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "A poll was updated; for bots only "] +pub struct UpdatePoll { + #[doc = "New data about the poll \n\nOriginal type: Poll"] + pub poll: SerdeJsonValue, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "A user changed the answer to a poll; for bots only "] +pub struct UpdatePollAnswer { + #[doc = "Unique poll identifier "] + #[serde(deserialize_with = "deserialize_i64_0")] + pub poll_id: i64, + #[doc = "The user, who changed the answer to the poll "] + pub user_id: i32, + #[doc = "0-based identifiers of answer options, chosen by the user"] + pub option_ids: Vec<i32>, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "Represents the current authorization state of the TDLib client"] +#[serde(tag = "@type")] +pub enum AuthorizationState { + #[doc = "TDLib needs TdlibParameters for initialization"] + AuthorizationStateWaitTdlibParameters, + AuthorizationStateWaitEncryptionKey(AuthorizationStateWaitEncryptionKey), + #[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"] + AuthorizationStateWaitPhoneNumber, + AuthorizationStateWaitCode(AuthorizationStateWaitCode), + AuthorizationStateWaitOtherDeviceConfirmation(AuthorizationStateWaitOtherDeviceConfirmation), + AuthorizationStateWaitRegistration(AuthorizationStateWaitRegistration), + AuthorizationStateWaitPassword(AuthorizationStateWaitPassword), + #[doc = "The user has been successfully authorized. TDLib is now ready to answer queries"] + AuthorizationStateReady, + #[doc = "The user is currently logging out"] + AuthorizationStateLoggingOut, + #[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"] + AuthorizationStateClosing, + #[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 \nwith error code 500. To continue working, one should create a new instance of the TDLib client"] + AuthorizationStateClosed, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "Contains the content of a message"] +#[serde(tag = "@type")] +pub enum MessageContent { + MessageText(MessageText), + MessageAnimation(MessageAnimation), + MessageAudio(MessageAudio), + MessageDocument(MessageDocument), + MessagePhoto(MessagePhoto), + #[doc = "An expired photo message (self-destructed after TTL has elapsed)"] + MessageExpiredPhoto, + MessageSticker(MessageSticker), + MessageVideo(MessageVideo), + #[doc = "An expired video message (self-destructed after TTL has elapsed)"] + MessageExpiredVideo, + MessageVideoNote(MessageVideoNote), + MessageVoiceNote(MessageVoiceNote), + MessageLocation(MessageLocation), + MessageVenue(MessageVenue), + MessageContact(MessageContact), + MessageDice(MessageDice), + MessageGame(MessageGame), + MessagePoll(MessagePoll), + MessageInvoice(MessageInvoice), + MessageCall(MessageCall), + MessageVoiceChatStarted(MessageVoiceChatStarted), + MessageVoiceChatEnded(MessageVoiceChatEnded), + MessageInviteVoiceChatParticipants(MessageInviteVoiceChatParticipants), + MessageBasicGroupChatCreate(MessageBasicGroupChatCreate), + MessageSupergroupChatCreate(MessageSupergroupChatCreate), + MessageChatChangeTitle(MessageChatChangeTitle), + MessageChatChangePhoto(MessageChatChangePhoto), + #[doc = "A deleted chat photo"] + MessageChatDeletePhoto, + MessageChatAddMembers(MessageChatAddMembers), + #[doc = "A new member joined the chat by invite link"] + MessageChatJoinByLink, + MessageChatDeleteMember(MessageChatDeleteMember), + MessageChatUpgradeTo(MessageChatUpgradeTo), + MessageChatUpgradeFrom(MessageChatUpgradeFrom), + MessagePinMessage(MessagePinMessage), + #[doc = "A screenshot of a message in the chat has been taken"] + MessageScreenshotTaken, + MessageChatSetTtl(MessageChatSetTtl), + MessageCustomServiceAction(MessageCustomServiceAction), + MessageGameScore(MessageGameScore), + MessagePaymentSuccessful(MessagePaymentSuccessful), + MessagePaymentSuccessfulBot(MessagePaymentSuccessfulBot), + #[doc = "A contact has registered with Telegram"] + MessageContactRegistered, + MessageWebsiteConnected(MessageWebsiteConnected), + MessagePassportDataSent(MessagePassportDataSent), + MessagePassportDataReceived(MessagePassportDataReceived), + MessageProximityAlertTriggered(MessageProximityAlertTriggered), + #[doc = "Message content that is not supported in the current TDLib version"] + MessageUnsupported, +} +#[derive(Serialize, Deserialize, Debug, Clone)] +#[doc = "Contains notifications about data changes"] +#[serde(tag = "@type")] +pub enum Update { + UpdateAuthorizationState(UpdateAuthorizationState), + UpdateNewMessage(UpdateNewMessage), + UpdateMessageSendAcknowledged(UpdateMessageSendAcknowledged), + UpdateMessageSendSucceeded(UpdateMessageSendSucceeded), + UpdateMessageSendFailed(UpdateMessageSendFailed), + UpdateMessageContent(UpdateMessageContent), + UpdateMessageEdited(UpdateMessageEdited), + UpdateMessageIsPinned(UpdateMessageIsPinned), + UpdateMessageInteractionInfo(UpdateMessageInteractionInfo), + UpdateMessageContentOpened(UpdateMessageContentOpened), + UpdateMessageMentionRead(UpdateMessageMentionRead), + UpdateMessageLiveLocationViewed(UpdateMessageLiveLocationViewed), + UpdateNewChat(UpdateNewChat), + UpdateChatTitle(UpdateChatTitle), + UpdateChatPhoto(UpdateChatPhoto), + UpdateChatPermissions(UpdateChatPermissions), + UpdateChatLastMessage(UpdateChatLastMessage), + UpdateChatPosition(UpdateChatPosition), + UpdateChatIsMarkedAsUnread(UpdateChatIsMarkedAsUnread), + UpdateChatIsBlocked(UpdateChatIsBlocked), + UpdateChatHasScheduledMessages(UpdateChatHasScheduledMessages), + UpdateChatVoiceChat(UpdateChatVoiceChat), + UpdateChatDefaultDisableNotification(UpdateChatDefaultDisableNotification), + UpdateChatReadInbox(UpdateChatReadInbox), + UpdateChatReadOutbox(UpdateChatReadOutbox), + UpdateChatUnreadMentionCount(UpdateChatUnreadMentionCount), + UpdateChatNotificationSettings(UpdateChatNotificationSettings), + UpdateScopeNotificationSettings(UpdateScopeNotificationSettings), + UpdateChatActionBar(UpdateChatActionBar), + UpdateChatReplyMarkup(UpdateChatReplyMarkup), + UpdateChatDraftMessage(UpdateChatDraftMessage), + UpdateChatFilters(UpdateChatFilters), + UpdateChatOnlineMemberCount(UpdateChatOnlineMemberCount), + UpdateNotification(UpdateNotification), + UpdateNotificationGroup(UpdateNotificationGroup), + UpdateActiveNotifications(UpdateActiveNotifications), + UpdateHavePendingNotifications(UpdateHavePendingNotifications), + UpdateDeleteMessages(UpdateDeleteMessages), + UpdateUserChatAction(UpdateUserChatAction), + UpdateUserStatus(UpdateUserStatus), + UpdateUser(UpdateUser), + UpdateBasicGroup(UpdateBasicGroup), + UpdateSupergroup(UpdateSupergroup), + UpdateSecretChat(UpdateSecretChat), + UpdateUserFullInfo(UpdateUserFullInfo), + UpdateBasicGroupFullInfo(UpdateBasicGroupFullInfo), + UpdateSupergroupFullInfo(UpdateSupergroupFullInfo), + UpdateServiceNotification(UpdateServiceNotification), + UpdateFile(UpdateFile), + UpdateFileGenerationStart(UpdateFileGenerationStart), + UpdateFileGenerationStop(UpdateFileGenerationStop), + UpdateCall(UpdateCall), + UpdateGroupCall(UpdateGroupCall), + UpdateGroupCallParticipant(UpdateGroupCallParticipant), + UpdateNewCallSignalingData(UpdateNewCallSignalingData), + UpdateUserPrivacySettingRules(UpdateUserPrivacySettingRules), + UpdateUnreadMessageCount(UpdateUnreadMessageCount), + UpdateUnreadChatCount(UpdateUnreadChatCount), + UpdateOption(UpdateOption), + UpdateStickerSet(UpdateStickerSet), + UpdateInstalledStickerSets(UpdateInstalledStickerSets), + UpdateTrendingStickerSets(UpdateTrendingStickerSets), + UpdateRecentStickers(UpdateRecentStickers), + UpdateFavoriteStickers(UpdateFavoriteStickers), + UpdateSavedAnimations(UpdateSavedAnimations), + UpdateSelectedBackground(UpdateSelectedBackground), + UpdateLanguagePackStrings(UpdateLanguagePackStrings), + UpdateConnectionState(UpdateConnectionState), + UpdateTermsOfService(UpdateTermsOfService), + UpdateUsersNearby(UpdateUsersNearby), + UpdateDiceEmojis(UpdateDiceEmojis), + UpdateAnimationSearchParameters(UpdateAnimationSearchParameters), + UpdateSuggestedActions(UpdateSuggestedActions), + UpdateNewInlineQuery(UpdateNewInlineQuery), + UpdateNewChosenInlineResult(UpdateNewChosenInlineResult), + UpdateNewCallbackQuery(UpdateNewCallbackQuery), + UpdateNewInlineCallbackQuery(UpdateNewInlineCallbackQuery), + UpdateNewShippingQuery(UpdateNewShippingQuery), + UpdateNewPreCheckoutQuery(UpdateNewPreCheckoutQuery), + UpdateNewCustomEvent(UpdateNewCustomEvent), + UpdateNewCustomQuery(UpdateNewCustomQuery), + UpdatePoll(UpdatePoll), + UpdatePollAnswer(UpdatePollAnswer), +} +pub trait ClientExt: ClientLike { + #[doc = "Sets the parameters for TDLib initialization. Works only when the current authorization state is authorizationStateWaitTdlibParameters "] + #[doc = " \n\n"] + #[doc = "parameters: "] + #[doc = " * `parameters`: Parameters"] + fn set_tdlib_parameters(&self, parameters: TdlibParameters) -> ResponseFuture<Ok> { + self.send(json!({ + "parameters": parameters, + "@type": "setTdlibParameters" + })) + } + #[doc = "Sets the phone number of the user and sends an authentication code to the user. Works only when the current authorization state is authorizationStateWaitPhoneNumber, \nor if there is no pending authentication query and the current authorization state is authorizationStateWaitCode, authorizationStateWaitRegistration, or authorizationStateWaitPassword"] + #[doc = " \n\n"] + #[doc = "parameters: "] + #[doc = " * `phone_number`: The phone number of the user, in international format "] + #[doc = " \n\n"] + #[doc = "parameters: "] + #[doc = " * `settings`: Settings for the authentication of the user's phone number"] + fn set_authentication_phone_number( + &self, + phone_number: String, + settings: PhoneNumberAuthenticationSettings, + ) -> ResponseFuture<Ok> { + self.send(json!({ + "phone_number": phone_number, + "settings": settings, + "@type": "setAuthenticationPhoneNumber" + })) + } + #[doc = "Checks the authentication code. Works only when the current authorization state is authorizationStateWaitCode "] + #[doc = " \n\n"] + #[doc = "parameters: "] + #[doc = " * `code`: The verification code received via SMS, Telegram message, phone call, or flash call"] + fn check_authentication_code(&self, code: String) -> ResponseFuture<Ok> { + self.send(json!({ + "code": code, + "@type": "checkAuthenticationCode" + })) + } + #[doc = "Checks the authentication password for correctness. Works only when the current authorization state is authorizationStateWaitPassword "] + #[doc = " \n\n"] + #[doc = "parameters: "] + #[doc = " * `password`: The password to check"] + fn check_authentication_password(&self, password: String) -> ResponseFuture<Ok> { + self.send(json!({ + "password": password, + "@type": "checkAuthenticationPassword" + })) + } + #[doc = "Changes the database encryption key. Usually the encryption key is never changed and is stored in some OS keychain "] + #[doc = " \n\n"] + #[doc = "parameters: "] + #[doc = " * `new_encryption_key`: New encryption key"] + fn set_database_encryption_key(&self, new_encryption_key: String) -> ResponseFuture<Ok> { + self.send(json!({ + "new_encryption_key": new_encryption_key, + "@type": "setDatabaseEncryptionKey" + })) + } + #[doc = "Returns network data usage statistics. Can be called before authorization "] + #[doc = " \n\n"] + #[doc = "parameters: "] + #[doc = " * `only_current`: If true, returns only data for the current library launch"] + #[doc = " \n\n"] + #[doc = "Original return type: `NetworkStatistics`"] + fn get_network_statistics(&self, only_current: bool) -> ResponseFuture<SerdeJsonValue> { + self.send(json!({ + "only_current": only_current, + "@type": "getNetworkStatistics" + })) + } + #[doc = "Returns application config, provided by the server. Can be called before authorization"] + #[doc = " \n\n"] + #[doc = "Original return type: `JsonValue`"] + fn get_application_config(&self) -> ResponseFuture<SerdeJsonValue> { + self.send(json!({ + "@type": "getApplicationConfig" + })) + } +} |