1
use serde :: { Deserialize , Serialize } ; use std :: fmt ; use anyhow :: { anyhow , Result } ; use reqwest :: multipart :: { Form , Part } ; trait TraitFile { # [doc = "Identifier for this file, which can be used to download or reuse the file"] fn get_file_id < 'a > (& 'a self) -> & 'a str ; # [doc = "Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file."] fn get_file_unique_id < 'a > (& 'a self) -> & 'a str ; # [doc = "Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value."] fn get_file_size < 'a > (& 'a self) -> Option < i64 > ; # [doc = "Optional. File path. Use https://api.telegram.org/file/bot<token>/<file_path> to get the file."] fn get_file_path < 'a > (& 'a self) -> Option < & 'a str > ; } trait TraitForceReply { # [doc = "Shows reply interface to the user, as if they manually selected the bot's message and tapped 'Reply'"] fn get_force_reply < 'a > (& 'a self) -> bool ; # [doc = "Optional. The placeholder to be shown in the input field when the reply is active; 1-64 characters"] fn get_input_field_placeholder < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. Use this parameter if you want to force reply from specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply (has reply_to_message_id), sender of the original message."] fn get_selective < 'a > (& 'a self) -> Option < bool > ; } trait TraitPassportElementErrorTranslationFile { # [doc = "Error source, must be translation_file"] fn get_source < 'a > (& 'a self) -> & 'a str ; # [doc = "Type of element of the user's Telegram Passport which has the issue, one of \"passport\", \"driver_license\", \"identity_card\", \"internal_passport\", \"utility_bill\", \"bank_statement\", \"rental_agreement\", \"passport_registration\", \"temporary_registration\""] fn get_tg_type < 'a > (& 'a self) -> & 'a str ; # [doc = "Base64-encoded file hash"] fn get_file_hash < 'a > (& 'a self) -> & 'a str ; # [doc = "Error message"] fn get_message < 'a > (& 'a self) -> & 'a str ; } trait TraitVideoChatScheduled { # [doc = "Point in time (Unix timestamp) when the video chat is supposed to be started by a chat administrator"] fn get_start_date < 'a > (& 'a self) -> i64 ; } trait TraitBotCommandScope : TraitBotCommandScopeDefault + TraitBotCommandScopeAllPrivateChats + TraitBotCommandScopeAllGroupChats + TraitBotCommandScopeAllChatAdministrators + TraitBotCommandScopeChat + TraitBotCommandScopeChatAdministrators + TraitBotCommandScopeChatMember { } trait TraitStickerSet { # [doc = "Sticker set name"] fn get_name < 'a > (& 'a self) -> & 'a str ; # [doc = "Sticker set title"] fn get_title < 'a > (& 'a self) -> & 'a str ; # [doc = "Type of stickers in the set, currently one of \"regular\", \"mask\", \"custom_emoji\""] fn get_sticker_type < 'a > (& 'a self) -> & 'a str ; # [doc = "True, if the sticker set contains animated stickers"] fn get_is_animated < 'a > (& 'a self) -> bool ; # [doc = "True, if the sticker set contains video stickers"] fn get_is_video < 'a > (& 'a self) -> bool ; # [doc = "List of all set stickers"] fn get_stickers < 'a > (& 'a self) -> & 'a Vec < Sticker > ; # [doc = "Optional. Sticker set thumbnail in the .WEBP, .TGS, or .WEBM format"] fn get_thumb < 'a > (& 'a self) -> Option < & 'a PhotoSize > ; } trait TraitOrderInfo { # [doc = "Optional. User name"] fn get_name < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. User's phone number"] fn get_phone_number < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. User email"] fn get_email < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. User shipping address"] fn get_shipping_address < 'a > (& 'a self) -> Option < & 'a ShippingAddress > ; } trait TraitDice { # [doc = "Emoji on which the dice throw animation is based"] fn get_emoji < 'a > (& 'a self) -> & 'a str ; # [doc = "Value of the dice, 1-6 for \"🎲\", \"🎯\" and \"🎳\" base emoji, 1-5 for \"🏀\" and \"⚽\" base emoji, 1-64 for \"🎰\" base emoji"] fn get_value < 'a > (& 'a self) -> i64 ; } trait TraitChatLocation { # [doc = "The location to which the supergroup is connected. Can't be a live location."] fn get_location < 'a > (& 'a self) -> & 'a Location ; # [doc = "Location address; 1-64 characters, as defined by the chat owner"] fn get_address < 'a > (& 'a self) -> & 'a str ; } trait TraitUser { # [doc = "Unique identifier for this user or bot. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier."] fn get_id < 'a > (& 'a self) -> i64 ; # [doc = "True, if this user is a bot"] fn get_is_bot < 'a > (& 'a self) -> bool ; # [doc = "User's or bot's first name"] fn get_first_name < 'a > (& 'a self) -> & 'a str ; # [doc = "Optional. User's or bot's last name"] fn get_last_name < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. User's or bot's username"] fn get_username < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. IETF language tag of the user's language"] fn get_language_code < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. True, if this user is a Telegram Premium user"] fn get_is_premium < 'a > (& 'a self) -> Option < bool > ; # [doc = "Optional. True, if this user added the bot to the attachment menu"] fn get_added_to_attachment_menu < 'a > (& 'a self) -> Option < bool > ; # [doc = "Optional. True, if the bot can be invited to groups. Returned only in getMe."] fn get_can_join_groups < 'a > (& 'a self) -> Option < bool > ; # [doc = "Optional. True, if privacy mode is disabled for the bot. Returned only in getMe."] fn get_can_read_all_group_messages < 'a > (& 'a self) -> Option < bool > ; # [doc = "Optional. True, if the bot supports inline queries. Returned only in getMe."] fn get_supports_inline_queries < 'a > (& 'a self) -> Option < bool > ; } trait TraitUpdate { # [doc = "The update's unique identifier. Update identifiers start from a certain positive number and increase sequentially. This ID becomes especially handy if you're using webhooks, since it allows you to ignore repeated updates or to restore the correct update sequence, should they get out of order. If there are no new updates for at least a week, then identifier of the next update will be chosen randomly instead of sequentially."] fn get_update_id < 'a > (& 'a self) -> i64 ; # [doc = "Optional. New incoming message of any kind - text, photo, sticker, etc."] fn get_message < 'a > (& 'a self) -> Option < & 'a Message > ; # [doc = "Optional. New version of a message that is known to the bot and was edited"] fn get_edited_message < 'a > (& 'a self) -> Option < & 'a Message > ; # [doc = "Optional. New incoming channel post of any kind - text, photo, sticker, etc."] fn get_channel_post < 'a > (& 'a self) -> Option < & 'a Message > ; # [doc = "Optional. New version of a channel post that is known to the bot and was edited"] fn get_edited_channel_post < 'a > (& 'a self) -> Option < & 'a Message > ; # [doc = "Optional. New incoming inline query"] fn get_inline_query < 'a > (& 'a self) -> Option < & 'a InlineQuery > ; # [doc = "Optional. The result of an inline query that was chosen by a user and sent to their chat partner. Please see our documentation on the feedback collecting for details on how to enable these updates for your bot."] fn get_chosen_inline_result < 'a > (& 'a self) -> Option < & 'a ChosenInlineResult > ; # [doc = "Optional. New incoming callback query"] fn get_callback_query < 'a > (& 'a self) -> Option < & 'a CallbackQuery > ; # [doc = "Optional. New incoming shipping query. Only for invoices with flexible price"] fn get_shipping_query < 'a > (& 'a self) -> Option < & 'a ShippingQuery > ; # [doc = "Optional. New incoming pre-checkout query. Contains full information about checkout"] fn get_pre_checkout_query < 'a > (& 'a self) -> Option < & 'a PreCheckoutQuery > ; # [doc = "Optional. New poll state. Bots receive only updates about stopped polls and polls, which are sent by the bot"] fn get_poll < 'a > (& 'a self) -> Option < & 'a Poll > ; # [doc = "Optional. A user changed their answer in a non-anonymous poll. Bots receive new votes only in polls that were sent by the bot itself."] fn get_poll_answer < 'a > (& 'a self) -> Option < & 'a PollAnswer > ; # [doc = "Optional. The bot's chat member status was updated in a chat. For private chats, this update is received only when the bot is blocked or unblocked by the user."] fn get_my_chat_member < 'a > (& 'a self) -> Option < & 'a ChatMemberUpdated > ; # [doc = "Optional. A chat member's status was updated in a chat. The bot must be an administrator in the chat and must explicitly specify \"chat_member\" in the list of allowed_updates to receive these updates."] fn get_chat_member < 'a > (& 'a self) -> Option < & 'a ChatMemberUpdated > ; # [doc = "Optional. A request to join the chat has been sent. The bot must have the can_invite_users administrator right in the chat to receive these updates."] fn get_chat_join_request < 'a > (& 'a self) -> Option < & 'a ChatJoinRequest > ; } trait TraitShippingAddress { # [doc = "Two-letter ISO 3166-1 alpha-2 country code"] fn get_country_code < 'a > (& 'a self) -> & 'a str ; # [doc = "State, if applicable"] fn get_state < 'a > (& 'a self) -> & 'a str ; # [doc = "City"] fn get_city < 'a > (& 'a self) -> & 'a str ; # [doc = "First line for the address"] fn get_street_line_1 < 'a > (& 'a self) -> & 'a str ; # [doc = "Second line for the address"] fn get_street_line_2 < 'a > (& 'a self) -> & 'a str ; # [doc = "Address post code"] fn get_post_code < 'a > (& 'a self) -> & 'a str ; } trait TraitInlineQueryResultCachedPhoto { # [doc = "Type of the result, must be photo"] fn get_tg_type < 'a > (& 'a self) -> & 'a str ; # [doc = "Unique identifier for this result, 1-64 bytes"] fn get_id < 'a > (& 'a self) -> & 'a str ; # [doc = "A valid file identifier of the photo"] fn get_photo_file_id < 'a > (& 'a self) -> & 'a str ; # [doc = "Optional. Title for the result"] fn get_title < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. Short description of the result"] fn get_description < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. Caption of the photo to be sent, 0-1024 characters after entities parsing"] fn get_caption < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. Mode for parsing entities in the photo caption. See formatting options for more details."] fn get_parse_mode < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode"] fn get_caption_entities < 'a > (& 'a self) -> Option < & 'a Vec < MessageEntity > > ; # [doc = "Optional. Inline keyboard attached to the message"] fn get_reply_markup < 'a > (& 'a self) -> Option < & 'a InlineKeyboardMarkup > ; # [doc = "Optional. Content of the message to be sent instead of the photo"] fn get_input_message_content < 'a > (& 'a self) -> Option < & 'a InputMessageContent > ; } trait TraitChatPhoto { # [doc = "File identifier of small (160x160) chat photo. This file_id can be used only for photo download and only for as long as the photo is not changed."] fn get_small_file_id < 'a > (& 'a self) -> & 'a str ; # [doc = "Unique file identifier of small (160x160) chat photo, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file."] fn get_small_file_unique_id < 'a > (& 'a self) -> & 'a str ; # [doc = "File identifier of big (640x640) chat photo. This file_id can be used only for photo download and only for as long as the photo is not changed."] fn get_big_file_id < 'a > (& 'a self) -> & 'a str ; # [doc = "Unique file identifier of big (640x640) chat photo, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file."] fn get_big_file_unique_id < 'a > (& 'a self) -> & 'a str ; } trait TraitInputMediaDocument { # [doc = "Type of the result, must be document"] fn get_tg_type < 'a > (& 'a self) -> & 'a str ; # [doc = "File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass \"attach://<file_attach_name>\" to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files: https://core.telegram.org/bots/api#sending-files"] fn get_media < 'a > (& 'a self) -> & 'a Option < InputFile > ; # [doc = "Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass \"attach://<file_attach_name>\" if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files: https://core.telegram.org/bots/api#sending-files"] fn get_thumb < 'a > (& 'a self) -> Option < & 'a InputFile > ; # [doc = "Optional. Caption of the document to be sent, 0-1024 characters after entities parsing"] fn get_caption < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. Mode for parsing entities in the document caption. See formatting options for more details."] fn get_parse_mode < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode"] fn get_caption_entities < 'a > (& 'a self) -> Option < & 'a Vec < MessageEntity > > ; # [doc = "Optional. Disables automatic server-side content type detection for files uploaded using multipart/form-data. Always True, if the document is sent as part of an album."] fn get_disable_content_type_detection < 'a > (& 'a self) -> Option < bool > ; } trait TraitPhotoSize { # [doc = "Identifier for this file, which can be used to download or reuse the file"] fn get_file_id < 'a > (& 'a self) -> & 'a str ; # [doc = "Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file."] fn get_file_unique_id < 'a > (& 'a self) -> & 'a str ; # [doc = "Photo width"] fn get_width < 'a > (& 'a self) -> i64 ; # [doc = "Photo height"] fn get_height < 'a > (& 'a self) -> i64 ; # [doc = "Optional. File size in bytes"] fn get_file_size < 'a > (& 'a self) -> Option < i64 > ; } trait TraitContact { # [doc = "Contact's phone number"] fn get_phone_number < 'a > (& 'a self) -> & 'a str ; # [doc = "Contact's first name"] fn get_first_name < 'a > (& 'a self) -> & 'a str ; # [doc = "Optional. Contact's last name"] fn get_last_name < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. Contact's user identifier in Telegram. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier."] fn get_user_id < 'a > (& 'a self) -> Option < i64 > ; # [doc = "Optional. Additional data about the contact in the form of a vCard"] fn get_vcard < 'a > (& 'a self) -> Option < & 'a str > ; } trait TraitInputMedia : TraitInputMediaAnimation + TraitInputMediaDocument + TraitInputMediaAudio + TraitInputMediaPhoto + TraitInputMediaVideo { } trait TraitChosenInlineResult { # [doc = "The unique identifier for the result that was chosen"] fn get_result_id < 'a > (& 'a self) -> & 'a str ; # [doc = "The user that chose the result"] fn get_from < 'a > (& 'a self) -> & 'a User ; # [doc = "Optional. Sender location, only for bots that require user location"] fn get_location < 'a > (& 'a self) -> Option < & 'a Location > ; # [doc = "Optional. Identifier of the sent inline message. Available only if there is an inline keyboard attached to the message. Will be also received in callback queries and can be used to edit the message."] fn get_inline_message_id < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "The query that was used to obtain the result"] fn get_query < 'a > (& 'a self) -> & 'a str ; } trait TraitInputContactMessageContent { # [doc = "Contact's phone number"] fn get_phone_number < 'a > (& 'a self) -> & 'a str ; # [doc = "Contact's first name"] fn get_first_name < 'a > (& 'a self) -> & 'a str ; # [doc = "Optional. Contact's last name"] fn get_last_name < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. Additional data about the contact in the form of a vCard, 0-2048 bytes"] fn get_vcard < 'a > (& 'a self) -> Option < & 'a str > ; } trait TraitChatMemberLeft { # [doc = "The member's status in the chat, always \"left\""] fn get_status < 'a > (& 'a self) -> & 'a str ; # [doc = "Information about the user"] fn get_user < 'a > (& 'a self) -> & 'a User ; } trait TraitSticker { # [doc = "Identifier for this file, which can be used to download or reuse the file"] fn get_file_id < 'a > (& 'a self) -> & 'a str ; # [doc = "Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file."] fn get_file_unique_id < 'a > (& 'a self) -> & 'a str ; # [doc = "Type of the sticker, currently one of \"regular\", \"mask\", \"custom_emoji\". The type of the sticker is independent from its format, which is determined by the fields is_animated and is_video."] fn get_tg_type < 'a > (& 'a self) -> & 'a str ; # [doc = "Sticker width"] fn get_width < 'a > (& 'a self) -> i64 ; # [doc = "Sticker height"] fn get_height < 'a > (& 'a self) -> i64 ; # [doc = "True, if the sticker is animated"] fn get_is_animated < 'a > (& 'a self) -> bool ; # [doc = "True, if the sticker is a video sticker"] fn get_is_video < 'a > (& 'a self) -> bool ; # [doc = "Optional. Sticker thumbnail in the .WEBP or .JPG format"] fn get_thumb < 'a > (& 'a self) -> Option < & 'a PhotoSize > ; # [doc = "Optional. Emoji associated with the sticker"] fn get_emoji < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. Name of the sticker set to which the sticker belongs"] fn get_set_name < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. For premium regular stickers, premium animation for the sticker"] fn get_premium_animation < 'a > (& 'a self) -> Option < & 'a File > ; # [doc = "Optional. For mask stickers, the position where the mask should be placed"] fn get_mask_position < 'a > (& 'a self) -> Option < & 'a MaskPosition > ; # [doc = "Optional. For custom emoji stickers, unique identifier of the custom emoji"] fn get_custom_emoji_id < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. File size in bytes"] fn get_file_size < 'a > (& 'a self) -> Option < i64 > ; } trait TraitInlineQueryResultCachedGif { # [doc = "Type of the result, must be gif"] fn get_tg_type < 'a > (& 'a self) -> & 'a str ; # [doc = "Unique identifier for this result, 1-64 bytes"] fn get_id < 'a > (& 'a self) -> & 'a str ; # [doc = "A valid file identifier for the GIF file"] fn get_gif_file_id < 'a > (& 'a self) -> & 'a str ; # [doc = "Optional. Title for the result"] fn get_title < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. Caption of the GIF file to be sent, 0-1024 characters after entities parsing"] fn get_caption < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. Mode for parsing entities in the caption. See formatting options for more details."] fn get_parse_mode < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode"] fn get_caption_entities < 'a > (& 'a self) -> Option < & 'a Vec < MessageEntity > > ; # [doc = "Optional. Inline keyboard attached to the message"] fn get_reply_markup < 'a > (& 'a self) -> Option < & 'a InlineKeyboardMarkup > ; # [doc = "Optional. Content of the message to be sent instead of the GIF animation"] fn get_input_message_content < 'a > (& 'a self) -> Option < & 'a InputMessageContent > ; } trait TraitInlineKeyboardButton { # [doc = "Label text on the button"] fn get_text < 'a > (& 'a self) -> & 'a str ; # [doc = "Optional. HTTP or tg:// URL to be opened when the button is pressed. Links tg://user?id=<user_id> can be used to mention a user by their ID without using a username, if this is allowed by their privacy settings."] fn get_url < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. Data to be sent in a callback query to the bot when button is pressed, 1-64 bytes"] fn get_callback_data < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. Description of the Web App that will be launched when the user presses the button. The Web App will be able to send an arbitrary message on behalf of the user using the method answerWebAppQuery. Available only in private chats between a user and the bot."] fn get_web_app < 'a > (& 'a self) -> Option < & 'a WebAppInfo > ; # [doc = "Optional. An HTTPS URL used to automatically authorize the user. Can be used as a replacement for the Telegram Login Widget."] fn get_login_url < 'a > (& 'a self) -> Option < & 'a LoginUrl > ; # [doc = "Optional. If set, pressing the button will prompt the user to select one of their chats, open that chat and insert the bot's username and the specified inline query in the input field. May be empty, in which case just the bot's username will be inserted. Note: This offers an easy way for users to start using your bot in inline mode when they are currently in a private chat with it. Especially useful when combined with switch_pm... actions - in this case the user will be automatically returned to the chat they switched from, skipping the chat selection screen."] fn get_switch_inline_query < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. If set, pressing the button will insert the bot's username and the specified inline query in the current chat's input field. May be empty, in which case only the bot's username will be inserted. This offers a quick way for the user to open your bot in inline mode in the same chat - good for selecting something from multiple options."] fn get_switch_inline_query_current_chat < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. Description of the game that will be launched when the user presses the button. NOTE: This type of button must always be the first button in the first row."] fn get_callback_game < 'a > (& 'a self) -> Option < & 'a CallbackGame > ; # [doc = "Optional. Specify True, to send a Pay button. NOTE: This type of button must always be the first button in the first row and can only be used in invoice messages."] fn get_pay < 'a > (& 'a self) -> Option < bool > ; } trait TraitInlineQuery { # [doc = "Unique identifier for this query"] fn get_id < 'a > (& 'a self) -> & 'a str ; # [doc = "Sender"] fn get_from < 'a > (& 'a self) -> & 'a User ; # [doc = "Text of the query (up to 256 characters)"] fn get_query < 'a > (& 'a self) -> & 'a str ; # [doc = "Offset of the results to be returned, can be controlled by the bot"] fn get_offset < 'a > (& 'a self) -> & 'a str ; # [doc = "Optional. Type of the chat from which the inline query was sent. Can be either \"sender\" for a private chat with the inline query sender, \"private\", \"group\", \"supergroup\", or \"channel\". The chat type should be always known for requests sent from official clients and most third-party clients, unless the request was sent from a secret chat"] fn get_chat_type < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. Sender location, only for bots that request user location"] fn get_location < 'a > (& 'a self) -> Option < & 'a Location > ; } trait TraitMessageId { # [doc = "Unique message identifier"] fn get_message_id < 'a > (& 'a self) -> i64 ; } trait TraitBotCommandScopeChatMember { # [doc = "Scope type, must be chat_member"] fn get_tg_type < 'a > (& 'a self) -> & 'a str ; # [doc = "Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)"] fn get_chat_id < 'a > (& 'a self) -> i64 ; # [doc = "Unique identifier of the target user"] fn get_user_id < 'a > (& 'a self) -> i64 ; } trait TraitInputMediaAnimation { # [doc = "Type of the result, must be animation"] fn get_tg_type < 'a > (& 'a self) -> & 'a str ; # [doc = "File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass \"attach://<file_attach_name>\" to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files: https://core.telegram.org/bots/api#sending-files"] fn get_media < 'a > (& 'a self) -> & 'a Option < InputFile > ; # [doc = "Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass \"attach://<file_attach_name>\" if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files: https://core.telegram.org/bots/api#sending-files"] fn get_thumb < 'a > (& 'a self) -> Option < & 'a InputFile > ; # [doc = "Optional. Caption of the animation to be sent, 0-1024 characters after entities parsing"] fn get_caption < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. Mode for parsing entities in the animation caption. See formatting options for more details."] fn get_parse_mode < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode"] fn get_caption_entities < 'a > (& 'a self) -> Option < & 'a Vec < MessageEntity > > ; # [doc = "Optional. Animation width"] fn get_width < 'a > (& 'a self) -> Option < i64 > ; # [doc = "Optional. Animation height"] fn get_height < 'a > (& 'a self) -> Option < i64 > ; # [doc = "Optional. Animation duration in seconds"] fn get_duration < 'a > (& 'a self) -> Option < i64 > ; } trait TraitInlineQueryResultVoice { # [doc = "Type of the result, must be voice"] fn get_tg_type < 'a > (& 'a self) -> & 'a str ; # [doc = "Unique identifier for this result, 1-64 bytes"] fn get_id < 'a > (& 'a self) -> & 'a str ; # [doc = "A valid URL for the voice recording"] fn get_voice_url < 'a > (& 'a self) -> & 'a str ; # [doc = "Recording title"] fn get_title < 'a > (& 'a self) -> & 'a str ; # [doc = "Optional. Caption, 0-1024 characters after entities parsing"] fn get_caption < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. Mode for parsing entities in the voice message caption. See formatting options for more details."] fn get_parse_mode < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode"] fn get_caption_entities < 'a > (& 'a self) -> Option < & 'a Vec < MessageEntity > > ; # [doc = "Optional. Recording duration in seconds"] fn get_voice_duration < 'a > (& 'a self) -> Option < i64 > ; # [doc = "Optional. Inline keyboard attached to the message"] fn get_reply_markup < 'a > (& 'a self) -> Option < & 'a InlineKeyboardMarkup > ; # [doc = "Optional. Content of the message to be sent instead of the voice recording"] fn get_input_message_content < 'a > (& 'a self) -> Option < & 'a InputMessageContent > ; } trait TraitInlineQueryResultContact { # [doc = "Type of the result, must be contact"] fn get_tg_type < 'a > (& 'a self) -> & 'a str ; # [doc = "Unique identifier for this result, 1-64 Bytes"] fn get_id < 'a > (& 'a self) -> & 'a str ; # [doc = "Contact's phone number"] fn get_phone_number < 'a > (& 'a self) -> & 'a str ; # [doc = "Contact's first name"] fn get_first_name < 'a > (& 'a self) -> & 'a str ; # [doc = "Optional. Contact's last name"] fn get_last_name < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. Additional data about the contact in the form of a vCard, 0-2048 bytes"] fn get_vcard < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. Inline keyboard attached to the message"] fn get_reply_markup < 'a > (& 'a self) -> Option < & 'a InlineKeyboardMarkup > ; # [doc = "Optional. Content of the message to be sent instead of the contact"] fn get_input_message_content < 'a > (& 'a self) -> Option < & 'a InputMessageContent > ; # [doc = "Optional. Url of the thumbnail for the result"] fn get_thumb_url < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. Thumbnail width"] fn get_thumb_width < 'a > (& 'a self) -> Option < i64 > ; # [doc = "Optional. Thumbnail height"] fn get_thumb_height < 'a > (& 'a self) -> Option < i64 > ; } trait TraitMaskPosition { # [doc = "The part of the face relative to which the mask should be placed. One of \"forehead\", \"eyes\", \"mouth\", or \"chin\"."] fn get_point < 'a > (& 'a self) -> & 'a str ; # [doc = "Shift by X-axis measured in widths of the mask scaled to the face size, from left to right. For example, choosing -1.0 will place mask just to the left of the default mask position."] fn get_x_shift < 'a > (& 'a self) -> 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."] fn get_y_shift < 'a > (& 'a self) -> f64 ; # [doc = "Mask scaling coefficient. For example, 2.0 means double size."] fn get_scale < 'a > (& 'a self) -> f64 ; } trait TraitPassportElementError : TraitPassportElementErrorDataField + TraitPassportElementErrorFrontSide + TraitPassportElementErrorReverseSide + TraitPassportElementErrorSelfie + TraitPassportElementErrorFile + TraitPassportElementErrorFiles + TraitPassportElementErrorTranslationFile + TraitPassportElementErrorTranslationFiles + TraitPassportElementErrorUnspecified { } trait TraitShippingOption { # [doc = "Shipping option identifier"] fn get_id < 'a > (& 'a self) -> & 'a str ; # [doc = "Option title"] fn get_title < 'a > (& 'a self) -> & 'a str ; # [doc = "List of price portions"] fn get_prices < 'a > (& 'a self) -> & 'a Vec < LabeledPrice > ; } trait TraitPassportElementErrorReverseSide { # [doc = "Error source, must be reverse_side"] fn get_source < 'a > (& 'a self) -> & 'a str ; # [doc = "The section of the user's Telegram Passport which has the issue, one of \"driver_license\", \"identity_card\""] fn get_tg_type < 'a > (& 'a self) -> & 'a str ; # [doc = "Base64-encoded hash of the file with the reverse side of the document"] fn get_file_hash < 'a > (& 'a self) -> & 'a str ; # [doc = "Error message"] fn get_message < 'a > (& 'a self) -> & 'a str ; } trait TraitChatMemberRestricted { # [doc = "The member's status in the chat, always \"restricted\""] fn get_status < 'a > (& 'a self) -> & 'a str ; # [doc = "Information about the user"] fn get_user < 'a > (& 'a self) -> & 'a User ; # [doc = "True, if the user is a member of the chat at the moment of the request"] fn get_is_member < 'a > (& 'a self) -> bool ; # [doc = "True, if the user is allowed to change the chat title, photo and other settings"] fn get_can_change_info < 'a > (& 'a self) -> bool ; # [doc = "True, if the user is allowed to invite new users to the chat"] fn get_can_invite_users < 'a > (& 'a self) -> bool ; # [doc = "True, if the user is allowed to pin messages"] fn get_can_pin_messages < 'a > (& 'a self) -> bool ; # [doc = "True, if the user is allowed to send text messages, contacts, locations and venues"] fn get_can_send_messages < 'a > (& 'a self) -> bool ; # [doc = "True, if the user is allowed to send audios, documents, photos, videos, video notes and voice notes"] fn get_can_send_media_messages < 'a > (& 'a self) -> bool ; # [doc = "True, if the user is allowed to send polls"] fn get_can_send_polls < 'a > (& 'a self) -> bool ; # [doc = "True, if the user is allowed to send animations, games, stickers and use inline bots"] fn get_can_send_other_messages < 'a > (& 'a self) -> bool ; # [doc = "True, if the user is allowed to add web page previews to their messages"] fn get_can_add_web_page_previews < 'a > (& 'a self) -> bool ; # [doc = "Date when restrictions will be lifted for this user; unix time. If 0, then the user is restricted forever"] fn get_until_date < 'a > (& 'a self) -> i64 ; } trait TraitBotCommandScopeChat { # [doc = "Scope type, must be chat"] fn get_tg_type < 'a > (& 'a self) -> & 'a str ; # [doc = "Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)"] fn get_chat_id < 'a > (& 'a self) -> i64 ; } trait TraitPreCheckoutQuery { # [doc = "Unique query identifier"] fn get_id < 'a > (& 'a self) -> & 'a str ; # [doc = "User who sent the query"] fn get_from < 'a > (& 'a self) -> & 'a User ; # [doc = "Three-letter ISO 4217 currency code"] fn get_currency < 'a > (& 'a self) -> & 'a str ; # [doc = "Total price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies)."] fn get_total_amount < 'a > (& 'a self) -> i64 ; # [doc = "Bot specified invoice payload"] fn get_invoice_payload < 'a > (& 'a self) -> & 'a str ; # [doc = "Optional. Identifier of the shipping option chosen by the user"] fn get_shipping_option_id < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. Order information provided by the user"] fn get_order_info < 'a > (& 'a self) -> Option < & 'a OrderInfo > ; } trait TraitInlineQueryResultPhoto { # [doc = "Type of the result, must be photo"] fn get_tg_type < 'a > (& 'a self) -> & 'a str ; # [doc = "Unique identifier for this result, 1-64 bytes"] fn get_id < 'a > (& 'a self) -> & 'a str ; # [doc = "A valid URL of the photo. Photo must be in JPEG format. Photo size must not exceed 5MB"] fn get_photo_url < 'a > (& 'a self) -> & 'a str ; # [doc = "URL of the thumbnail for the photo"] fn get_thumb_url < 'a > (& 'a self) -> & 'a str ; # [doc = "Optional. Width of the photo"] fn get_photo_width < 'a > (& 'a self) -> Option < i64 > ; # [doc = "Optional. Height of the photo"] fn get_photo_height < 'a > (& 'a self) -> Option < i64 > ; # [doc = "Optional. Title for the result"] fn get_title < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. Short description of the result"] fn get_description < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. Caption of the photo to be sent, 0-1024 characters after entities parsing"] fn get_caption < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. Mode for parsing entities in the photo caption. See formatting options for more details."] fn get_parse_mode < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode"] fn get_caption_entities < 'a > (& 'a self) -> Option < & 'a Vec < MessageEntity > > ; # [doc = "Optional. Inline keyboard attached to the message"] fn get_reply_markup < 'a > (& 'a self) -> Option < & 'a InlineKeyboardMarkup > ; # [doc = "Optional. Content of the message to be sent instead of the photo"] fn get_input_message_content < 'a > (& 'a self) -> Option < & 'a InputMessageContent > ; } trait TraitChatMemberBanned { # [doc = "The member's status in the chat, always \"kicked\""] fn get_status < 'a > (& 'a self) -> & 'a str ; # [doc = "Information about the user"] fn get_user < 'a > (& 'a self) -> & 'a User ; # [doc = "Date when restrictions will be lifted for this user; unix time. If 0, then the user is banned forever"] fn get_until_date < 'a > (& 'a self) -> i64 ; } trait TraitPassportElementErrorTranslationFiles { # [doc = "Error source, must be translation_files"] fn get_source < 'a > (& 'a self) -> & 'a str ; # [doc = "Type of element of the user's Telegram Passport which has the issue, one of \"passport\", \"driver_license\", \"identity_card\", \"internal_passport\", \"utility_bill\", \"bank_statement\", \"rental_agreement\", \"passport_registration\", \"temporary_registration\""] fn get_tg_type < 'a > (& 'a self) -> & 'a str ; # [doc = "List of base64-encoded file hashes"] fn get_file_hashes < 'a > (& 'a self) -> & 'a Vec < String > ; # [doc = "Error message"] fn get_message < 'a > (& 'a self) -> & 'a str ; } trait TraitCallbackGame { } trait TraitPollAnswer { # [doc = "Unique poll identifier"] fn get_poll_id < 'a > (& 'a self) -> & 'a str ; # [doc = "The user, who changed the answer to the poll"] fn get_user < 'a > (& 'a self) -> & 'a User ; # [doc = "0-based identifiers of answer options, chosen by the user. May be empty if the user retracted their vote."] fn get_option_ids < 'a > (& 'a self) -> & 'a Vec < i64 > ; } trait TraitInlineQueryResultCachedVideo { # [doc = "Type of the result, must be video"] fn get_tg_type < 'a > (& 'a self) -> & 'a str ; # [doc = "Unique identifier for this result, 1-64 bytes"] fn get_id < 'a > (& 'a self) -> & 'a str ; # [doc = "A valid file identifier for the video file"] fn get_video_file_id < 'a > (& 'a self) -> & 'a str ; # [doc = "Title for the result"] fn get_title < 'a > (& 'a self) -> & 'a str ; # [doc = "Optional. Short description of the result"] fn get_description < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. Caption of the video to be sent, 0-1024 characters after entities parsing"] fn get_caption < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. Mode for parsing entities in the video caption. See formatting options for more details."] fn get_parse_mode < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode"] fn get_caption_entities < 'a > (& 'a self) -> Option < & 'a Vec < MessageEntity > > ; # [doc = "Optional. Inline keyboard attached to the message"] fn get_reply_markup < 'a > (& 'a self) -> Option < & 'a InlineKeyboardMarkup > ; # [doc = "Optional. Content of the message to be sent instead of the video"] fn get_input_message_content < 'a > (& 'a self) -> Option < & 'a InputMessageContent > ; } trait TraitWebAppData { # [doc = "The data. Be aware that a bad client can send arbitrary data in this field."] fn get_data < 'a > (& 'a self) -> & 'a str ; # [doc = "Text of the web_app keyboard button from which the Web App was opened. Be aware that a bad client can send arbitrary data in this field."] fn get_button_text < 'a > (& 'a self) -> & 'a str ; } trait TraitChatMemberAdministrator { # [doc = "The member's status in the chat, always \"administrator\""] fn get_status < 'a > (& 'a self) -> & 'a str ; # [doc = "Information about the user"] fn get_user < 'a > (& 'a self) -> & 'a User ; # [doc = "True, if the bot is allowed to edit administrator privileges of that user"] fn get_can_be_edited < 'a > (& 'a self) -> bool ; # [doc = "True, if the user's presence in the chat is hidden"] fn get_is_anonymous < 'a > (& 'a self) -> bool ; # [doc = "True, if the administrator can access the chat event log, chat statistics, message statistics in channels, see channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other administrator privilege"] fn get_can_manage_chat < 'a > (& 'a self) -> bool ; # [doc = "True, if the administrator can delete messages of other users"] fn get_can_delete_messages < 'a > (& 'a self) -> bool ; # [doc = "True, if the administrator can manage video chats"] fn get_can_manage_video_chats < 'a > (& 'a self) -> bool ; # [doc = "True, if the administrator can restrict, ban or unban chat members"] fn get_can_restrict_members < 'a > (& 'a self) -> bool ; # [doc = "True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by the user)"] fn get_can_promote_members < 'a > (& 'a self) -> bool ; # [doc = "True, if the user is allowed to change the chat title, photo and other settings"] fn get_can_change_info < 'a > (& 'a self) -> bool ; # [doc = "True, if the user is allowed to invite new users to the chat"] fn get_can_invite_users < 'a > (& 'a self) -> bool ; # [doc = "Optional. True, if the administrator can post in the channel; channels only"] fn get_can_post_messages < 'a > (& 'a self) -> Option < bool > ; # [doc = "Optional. True, if the administrator can edit messages of other users and can pin messages; channels only"] fn get_can_edit_messages < 'a > (& 'a self) -> Option < bool > ; # [doc = "Optional. True, if the user is allowed to pin messages; groups and supergroups only"] fn get_can_pin_messages < 'a > (& 'a self) -> Option < bool > ; # [doc = "Optional. Custom title for this user"] fn get_custom_title < 'a > (& 'a self) -> Option < & 'a str > ; } trait TraitPassportElementErrorUnspecified { # [doc = "Error source, must be unspecified"] fn get_source < 'a > (& 'a self) -> & 'a str ; # [doc = "Type of element of the user's Telegram Passport which has the issue"] fn get_tg_type < 'a > (& 'a self) -> & 'a str ; # [doc = "Base64-encoded element hash"] fn get_element_hash < 'a > (& 'a self) -> & 'a str ; # [doc = "Error message"] fn get_message < 'a > (& 'a self) -> & 'a str ; } trait TraitInputInvoiceMessageContent { # [doc = "Product name, 1-32 characters"] fn get_title < 'a > (& 'a self) -> & 'a str ; # [doc = "Product description, 1-255 characters"] fn get_description < 'a > (& 'a self) -> & 'a str ; # [doc = "Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes."] fn get_payload < 'a > (& 'a self) -> & 'a str ; # [doc = "Payment provider token, obtained via @BotFather"] fn get_provider_token < 'a > (& 'a self) -> & 'a str ; # [doc = "Three-letter ISO 4217 currency code, see more on currencies"] fn get_currency < 'a > (& 'a self) -> & 'a str ; # [doc = "Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.)"] fn get_prices < 'a > (& 'a self) -> & 'a Vec < LabeledPrice > ; # [doc = "Optional. The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass max_tip_amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0"] fn get_max_tip_amount < 'a > (& 'a self) -> Option < i64 > ; # [doc = "Optional. A JSON-serialized array of suggested amounts of tip in the smallest units of the currency (integer, not float/double). At most 4 suggested tip amounts can be specified. The suggested tip amounts must be positive, passed in a strictly increased order and must not exceed max_tip_amount."] fn get_suggested_tip_amounts < 'a > (& 'a self) -> Option < & 'a Vec < i64 > > ; # [doc = "Optional. A JSON-serialized object for data about the invoice, which will be shared with the payment provider. A detailed description of the required fields should be provided by the payment provider."] fn get_provider_data < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. URL of the product photo for the invoice. Can be a photo of the goods or a marketing image for a service."] fn get_photo_url < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. Photo size in bytes"] fn get_photo_size < 'a > (& 'a self) -> Option < i64 > ; # [doc = "Optional. Photo width"] fn get_photo_width < 'a > (& 'a self) -> Option < i64 > ; # [doc = "Optional. Photo height"] fn get_photo_height < 'a > (& 'a self) -> Option < i64 > ; # [doc = "Optional. Pass True if you require the user's full name to complete the order"] fn get_need_name < 'a > (& 'a self) -> Option < bool > ; # [doc = "Optional. Pass True if you require the user's phone number to complete the order"] fn get_need_phone_number < 'a > (& 'a self) -> Option < bool > ; # [doc = "Optional. Pass True if you require the user's email address to complete the order"] fn get_need_email < 'a > (& 'a self) -> Option < bool > ; # [doc = "Optional. Pass True if you require the user's shipping address to complete the order"] fn get_need_shipping_address < 'a > (& 'a self) -> Option < bool > ; # [doc = "Optional. Pass True if the user's phone number should be sent to provider"] fn get_send_phone_number_to_provider < 'a > (& 'a self) -> Option < bool > ; # [doc = "Optional. Pass True if the user's email address should be sent to provider"] fn get_send_email_to_provider < 'a > (& 'a self) -> Option < bool > ; # [doc = "Optional. Pass True if the final price depends on the shipping method"] fn get_is_flexible < 'a > (& 'a self) -> Option < bool > ; } trait TraitMenuButtonWebApp { # [doc = "Type of the button, must be web_app"] fn get_tg_type < 'a > (& 'a self) -> & 'a str ; # [doc = "Text on the button"] fn get_text < 'a > (& 'a self) -> & 'a str ; # [doc = "Description of the Web App that will be launched when the user presses the button. The Web App will be able to send an arbitrary message on behalf of the user using the method answerWebAppQuery."] fn get_web_app < 'a > (& 'a self) -> & 'a WebAppInfo ; } trait TraitAudio { # [doc = "Identifier for this file, which can be used to download or reuse the file"] fn get_file_id < 'a > (& 'a self) -> & 'a str ; # [doc = "Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file."] fn get_file_unique_id < 'a > (& 'a self) -> & 'a str ; # [doc = "Duration of the audio in seconds as defined by sender"] fn get_duration < 'a > (& 'a self) -> i64 ; # [doc = "Optional. Performer of the audio as defined by sender or by audio tags"] fn get_performer < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. Title of the audio as defined by sender or by audio tags"] fn get_title < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. Original filename as defined by sender"] fn get_file_name < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. MIME type of the file as defined by sender"] fn get_mime_type < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value."] fn get_file_size < 'a > (& 'a self) -> Option < i64 > ; # [doc = "Optional. Thumbnail of the album cover to which the music file belongs"] fn get_thumb < 'a > (& 'a self) -> Option < & 'a PhotoSize > ; } trait TraitLoginUrl { # [doc = "An HTTPS URL to be opened with user authorization data added to the query string when the button is pressed. If the user refuses to provide authorization data, the original URL without information about the user will be opened. The data added is the same as described in Receiving authorization data. NOTE: You must always check the hash of the received data to verify the authentication and the integrity of the data as described in Checking authorization."] fn get_url < 'a > (& 'a self) -> & 'a str ; # [doc = "Optional. New text of the button in forwarded messages."] fn get_forward_text < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. Username of a bot, which will be used for user authorization. See Setting up a bot for more details. If not specified, the current bot's username will be assumed. The url's domain must be the same as the domain linked with the bot. See Linking your domain to the bot for more details."] fn get_bot_username < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. Pass True to request the permission for your bot to send messages to the user."] fn get_request_write_access < 'a > (& 'a self) -> Option < bool > ; } trait TraitInlineQueryResultGif { # [doc = "Type of the result, must be gif"] fn get_tg_type < 'a > (& 'a self) -> & 'a str ; # [doc = "Unique identifier for this result, 1-64 bytes"] fn get_id < 'a > (& 'a self) -> & 'a str ; # [doc = "A valid URL for the GIF file. File size must not exceed 1MB"] fn get_gif_url < 'a > (& 'a self) -> & 'a str ; # [doc = "Optional. Width of the GIF"] fn get_gif_width < 'a > (& 'a self) -> Option < i64 > ; # [doc = "Optional. Height of the GIF"] fn get_gif_height < 'a > (& 'a self) -> Option < i64 > ; # [doc = "Optional. Duration of the GIF in seconds"] fn get_gif_duration < 'a > (& 'a self) -> Option < i64 > ; # [doc = "URL of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the result"] fn get_thumb_url < 'a > (& 'a self) -> & 'a str ; # [doc = "Optional. MIME type of the thumbnail, must be one of \"image/jpeg\", \"image/gif\", or \"video/mp4\". Defaults to \"image/jpeg\""] fn get_thumb_mime_type < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. Title for the result"] fn get_title < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. Caption of the GIF file to be sent, 0-1024 characters after entities parsing"] fn get_caption < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. Mode for parsing entities in the caption. See formatting options for more details."] fn get_parse_mode < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode"] fn get_caption_entities < 'a > (& 'a self) -> Option < & 'a Vec < MessageEntity > > ; # [doc = "Optional. Inline keyboard attached to the message"] fn get_reply_markup < 'a > (& 'a self) -> Option < & 'a InlineKeyboardMarkup > ; # [doc = "Optional. Content of the message to be sent instead of the GIF animation"] fn get_input_message_content < 'a > (& 'a self) -> Option < & 'a InputMessageContent > ; } trait TraitWebhookInfo { # [doc = "Webhook URL, may be empty if webhook is not set up"] fn get_url < 'a > (& 'a self) -> & 'a str ; # [doc = "True, if a custom certificate was provided for webhook certificate checks"] fn get_has_custom_certificate < 'a > (& 'a self) -> bool ; # [doc = "Number of updates awaiting delivery"] fn get_pending_update_count < 'a > (& 'a self) -> i64 ; # [doc = "Optional. Currently used webhook IP address"] fn get_ip_address < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. Unix time for the most recent error that happened when trying to deliver an update via webhook"] fn get_last_error_date < 'a > (& 'a self) -> Option < i64 > ; # [doc = "Optional. Error message in human-readable format for the most recent error that happened when trying to deliver an update via webhook"] fn get_last_error_message < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. Unix time of the most recent error that happened when trying to synchronize available updates with Telegram datacenters"] fn get_last_synchronization_error_date < 'a > (& 'a self) -> Option < i64 > ; # [doc = "Optional. The maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery"] fn get_max_connections < 'a > (& 'a self) -> Option < i64 > ; # [doc = "Optional. A list of update types the bot is subscribed to. Defaults to all update types except chat_member"] fn get_allowed_updates < 'a > (& 'a self) -> Option < & 'a Vec < String > > ; } trait TraitSuccessfulPayment { # [doc = "Three-letter ISO 4217 currency code"] fn get_currency < 'a > (& 'a self) -> & 'a str ; # [doc = "Total price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies)."] fn get_total_amount < 'a > (& 'a self) -> i64 ; # [doc = "Bot specified invoice payload"] fn get_invoice_payload < 'a > (& 'a self) -> & 'a str ; # [doc = "Optional. Identifier of the shipping option chosen by the user"] fn get_shipping_option_id < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. Order information provided by the user"] fn get_order_info < 'a > (& 'a self) -> Option < & 'a OrderInfo > ; # [doc = "Telegram payment identifier"] fn get_telegram_payment_charge_id < 'a > (& 'a self) -> & 'a str ; # [doc = "Provider payment identifier"] fn get_provider_payment_charge_id < 'a > (& 'a self) -> & 'a str ; } trait TraitAnimation { # [doc = "Identifier for this file, which can be used to download or reuse the file"] fn get_file_id < 'a > (& 'a self) -> & 'a str ; # [doc = "Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file."] fn get_file_unique_id < 'a > (& 'a self) -> & 'a str ; # [doc = "Video width as defined by sender"] fn get_width < 'a > (& 'a self) -> i64 ; # [doc = "Video height as defined by sender"] fn get_height < 'a > (& 'a self) -> i64 ; # [doc = "Duration of the video in seconds as defined by sender"] fn get_duration < 'a > (& 'a self) -> i64 ; # [doc = "Optional. Animation thumbnail as defined by sender"] fn get_thumb < 'a > (& 'a self) -> Option < & 'a PhotoSize > ; # [doc = "Optional. Original animation filename as defined by sender"] fn get_file_name < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. MIME type of the file as defined by sender"] fn get_mime_type < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value."] fn get_file_size < 'a > (& 'a self) -> Option < i64 > ; } trait TraitInlineQueryResultVenue { # [doc = "Type of the result, must be venue"] fn get_tg_type < 'a > (& 'a self) -> & 'a str ; # [doc = "Unique identifier for this result, 1-64 Bytes"] fn get_id < 'a > (& 'a self) -> & 'a str ; # [doc = "Latitude of the venue location in degrees"] fn get_latitude < 'a > (& 'a self) -> f64 ; # [doc = "Longitude of the venue location in degrees"] fn get_longitude < 'a > (& 'a self) -> f64 ; # [doc = "Title of the venue"] fn get_title < 'a > (& 'a self) -> & 'a str ; # [doc = "Address of the venue"] fn get_address < 'a > (& 'a self) -> & 'a str ; # [doc = "Optional. Foursquare identifier of the venue if known"] fn get_foursquare_id < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. Foursquare type of the venue, if known. (For example, \"arts_entertainment/default\", \"arts_entertainment/aquarium\" or \"food/icecream\".)"] fn get_foursquare_type < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. Google Places identifier of the venue"] fn get_google_place_id < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. Google Places type of the venue. (See supported types.)"] fn get_google_place_type < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. Inline keyboard attached to the message"] fn get_reply_markup < 'a > (& 'a self) -> Option < & 'a InlineKeyboardMarkup > ; # [doc = "Optional. Content of the message to be sent instead of the venue"] fn get_input_message_content < 'a > (& 'a self) -> Option < & 'a InputMessageContent > ; # [doc = "Optional. Url of the thumbnail for the result"] fn get_thumb_url < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. Thumbnail width"] fn get_thumb_width < 'a > (& 'a self) -> Option < i64 > ; # [doc = "Optional. Thumbnail height"] fn get_thumb_height < 'a > (& 'a self) -> Option < i64 > ; } trait TraitPassportElementErrorDataField { # [doc = "Error source, must be data"] fn get_source < 'a > (& 'a self) -> & 'a str ; # [doc = "The section of the user's Telegram Passport which has the error, one of \"personal_details\", \"passport\", \"driver_license\", \"identity_card\", \"internal_passport\", \"address\""] fn get_tg_type < 'a > (& 'a self) -> & 'a str ; # [doc = "Name of the data field which has the error"] fn get_field_name < 'a > (& 'a self) -> & 'a str ; # [doc = "Base64-encoded data hash"] fn get_data_hash < 'a > (& 'a self) -> & 'a str ; # [doc = "Error message"] fn get_message < 'a > (& 'a self) -> & 'a str ; } trait TraitResponseParameters { # [doc = "Optional. The group has been migrated to a supergroup with the specified identifier. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier."] fn get_migrate_to_chat_id < 'a > (& 'a self) -> Option < i64 > ; # [doc = "Optional. In case of exceeding flood control, the number of seconds left to wait before the request can be repeated"] fn get_retry_after < 'a > (& 'a self) -> Option < i64 > ; } trait TraitVideoChatStarted { } trait TraitReplyKeyboardMarkup { # [doc = "Array of button rows, each represented by an Array of KeyboardButton objects"] fn get_keyboard < 'a > (& 'a self) -> & 'a Vec < Vec < KeyboardButton > > ; # [doc = "Optional. Requests clients to resize the keyboard vertically for optimal fit (e.g., make the keyboard smaller if there are just two rows of buttons). Defaults to false, in which case the custom keyboard is always of the same height as the app's standard keyboard."] fn get_resize_keyboard < 'a > (& 'a self) -> Option < bool > ; # [doc = "Optional. Requests clients to hide the keyboard as soon as it's been used. The keyboard will still be available, but clients will automatically display the usual letter-keyboard in the chat - the user can press a special button in the input field to see the custom keyboard again. Defaults to false."] fn get_one_time_keyboard < 'a > (& 'a self) -> Option < bool > ; # [doc = "Optional. The placeholder to be shown in the input field when the keyboard is active; 1-64 characters"] fn get_input_field_placeholder < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. Use this parameter if you want to show the keyboard to specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply (has reply_to_message_id), sender of the original message. Example: A user requests to change the bot's language, bot replies to the request with a keyboard to select the new language. Other users in the group don't see the keyboard."] fn get_selective < 'a > (& 'a self) -> Option < bool > ; } trait TraitInlineQueryResult : TraitInlineQueryResultCachedAudio + TraitInlineQueryResultCachedDocument + TraitInlineQueryResultCachedGif + TraitInlineQueryResultCachedMpeg4Gif + TraitInlineQueryResultCachedPhoto + TraitInlineQueryResultCachedSticker + TraitInlineQueryResultCachedVideo + TraitInlineQueryResultCachedVoice + TraitInlineQueryResultArticle + TraitInlineQueryResultAudio + TraitInlineQueryResultContact + TraitInlineQueryResultGame + TraitInlineQueryResultDocument + TraitInlineQueryResultGif + TraitInlineQueryResultLocation + TraitInlineQueryResultMpeg4Gif + TraitInlineQueryResultPhoto + TraitInlineQueryResultVenue + TraitInlineQueryResultVideo + TraitInlineQueryResultVoice { } trait TraitBotCommandScopeAllChatAdministrators { # [doc = "Scope type, must be all_chat_administrators"] fn get_tg_type < 'a > (& 'a self) -> & 'a str ; } trait TraitPoll { # [doc = "Unique poll identifier"] fn get_id < 'a > (& 'a self) -> & 'a str ; # [doc = "Poll question, 1-300 characters"] fn get_question < 'a > (& 'a self) -> & 'a str ; # [doc = "List of poll options"] fn get_options < 'a > (& 'a self) -> & 'a Vec < PollOption > ; # [doc = "Total number of users that voted in the poll"] fn get_total_voter_count < 'a > (& 'a self) -> i64 ; # [doc = "True, if the poll is closed"] fn get_is_closed < 'a > (& 'a self) -> bool ; # [doc = "True, if the poll is anonymous"] fn get_is_anonymous < 'a > (& 'a self) -> bool ; # [doc = "Poll type, currently can be \"regular\" or \"quiz\""] fn get_tg_type < 'a > (& 'a self) -> & 'a str ; # [doc = "True, if the poll allows multiple answers"] fn get_allows_multiple_answers < 'a > (& 'a self) -> bool ; # [doc = "Optional. 0-based identifier of the correct answer option. Available only for polls in the quiz mode, which are closed, or was sent (not forwarded) by the bot or to the private chat with the bot."] fn get_correct_option_id < 'a > (& 'a self) -> Option < i64 > ; # [doc = "Optional. Text that is shown when a user chooses an incorrect answer or taps on the lamp icon in a quiz-style poll, 0-200 characters"] fn get_explanation < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. Special entities like usernames, URLs, bot commands, etc. that appear in the explanation"] fn get_explanation_entities < 'a > (& 'a self) -> Option < & 'a Vec < MessageEntity > > ; # [doc = "Optional. Amount of time in seconds the poll will be active after creation"] fn get_open_period < 'a > (& 'a self) -> Option < i64 > ; # [doc = "Optional. Point in time (Unix timestamp) when the poll will be automatically closed"] fn get_close_date < 'a > (& 'a self) -> Option < i64 > ; } trait TraitMenuButtonDefault { # [doc = "Type of the button, must be default"] fn get_tg_type < 'a > (& 'a self) -> & 'a str ; } trait TraitKeyboardButtonPollType { # [doc = "Optional. If quiz is passed, the user will be allowed to create only polls in the quiz mode. If regular is passed, only regular polls will be allowed. Otherwise, the user will be allowed to create a poll of any type."] fn get_tg_type < 'a > (& 'a self) -> Option < & 'a str > ; } trait TraitChatAdministratorRights { # [doc = "True, if the user's presence in the chat is hidden"] fn get_is_anonymous < 'a > (& 'a self) -> bool ; # [doc = "True, if the administrator can access the chat event log, chat statistics, message statistics in channels, see channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other administrator privilege"] fn get_can_manage_chat < 'a > (& 'a self) -> bool ; # [doc = "True, if the administrator can delete messages of other users"] fn get_can_delete_messages < 'a > (& 'a self) -> bool ; # [doc = "True, if the administrator can manage video chats"] fn get_can_manage_video_chats < 'a > (& 'a self) -> bool ; # [doc = "True, if the administrator can restrict, ban or unban chat members"] fn get_can_restrict_members < 'a > (& 'a self) -> bool ; # [doc = "True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by the user)"] fn get_can_promote_members < 'a > (& 'a self) -> bool ; # [doc = "True, if the user is allowed to change the chat title, photo and other settings"] fn get_can_change_info < 'a > (& 'a self) -> bool ; # [doc = "True, if the user is allowed to invite new users to the chat"] fn get_can_invite_users < 'a > (& 'a self) -> bool ; # [doc = "Optional. True, if the administrator can post in the channel; channels only"] fn get_can_post_messages < 'a > (& 'a self) -> Option < bool > ; # [doc = "Optional. True, if the administrator can edit messages of other users and can pin messages; channels only"] fn get_can_edit_messages < 'a > (& 'a self) -> Option < bool > ; # [doc = "Optional. True, if the user is allowed to pin messages; groups and supergroups only"] fn get_can_pin_messages < 'a > (& 'a self) -> Option < bool > ; } trait TraitProximityAlertTriggered { # [doc = "User that triggered the alert"] fn get_traveler < 'a > (& 'a self) -> & 'a User ; # [doc = "User that set the alert"] fn get_watcher < 'a > (& 'a self) -> & 'a User ; # [doc = "The distance between the users"] fn get_distance < 'a > (& 'a self) -> i64 ; } trait TraitChatMemberMember { # [doc = "The member's status in the chat, always \"member\""] fn get_status < 'a > (& 'a self) -> & 'a str ; # [doc = "Information about the user"] fn get_user < 'a > (& 'a self) -> & 'a User ; } trait TraitVoice { # [doc = "Identifier for this file, which can be used to download or reuse the file"] fn get_file_id < 'a > (& 'a self) -> & 'a str ; # [doc = "Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file."] fn get_file_unique_id < 'a > (& 'a self) -> & 'a str ; # [doc = "Duration of the audio in seconds as defined by sender"] fn get_duration < 'a > (& 'a self) -> i64 ; # [doc = "Optional. MIME type of the file as defined by sender"] fn get_mime_type < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value."] fn get_file_size < 'a > (& 'a self) -> Option < i64 > ; } trait TraitEncryptedPassportElement { # [doc = "Element type. One of \"personal_details\", \"passport\", \"driver_license\", \"identity_card\", \"internal_passport\", \"address\", \"utility_bill\", \"bank_statement\", \"rental_agreement\", \"passport_registration\", \"temporary_registration\", \"phone_number\", \"email\"."] fn get_tg_type < 'a > (& 'a self) -> & 'a str ; # [doc = "Optional. Base64-encoded encrypted Telegram Passport element data provided by the user, available for \"personal_details\", \"passport\", \"driver_license\", \"identity_card\", \"internal_passport\" and \"address\" types. Can be decrypted and verified using the accompanying EncryptedCredentials."] fn get_data < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. User's verified phone number, available only for \"phone_number\" type"] fn get_phone_number < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. User's verified email address, available only for \"email\" type"] fn get_email < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. Array of encrypted files with documents provided by the user, available for \"utility_bill\", \"bank_statement\", \"rental_agreement\", \"passport_registration\" and \"temporary_registration\" types. Files can be decrypted and verified using the accompanying EncryptedCredentials."] fn get_files < 'a > (& 'a self) -> Option < & 'a Vec < PassportFile > > ; # [doc = "Optional. Encrypted file with the front side of the document, provided by the user. Available for \"passport\", \"driver_license\", \"identity_card\" and \"internal_passport\". The file can be decrypted and verified using the accompanying EncryptedCredentials."] fn get_front_side < 'a > (& 'a self) -> Option < & 'a PassportFile > ; # [doc = "Optional. Encrypted file with the reverse side of the document, provided by the user. Available for \"driver_license\" and \"identity_card\". The file can be decrypted and verified using the accompanying EncryptedCredentials."] fn get_reverse_side < 'a > (& 'a self) -> Option < & 'a PassportFile > ; # [doc = "Optional. Encrypted file with the selfie of the user holding a document, provided by the user; available for \"passport\", \"driver_license\", \"identity_card\" and \"internal_passport\". The file can be decrypted and verified using the accompanying EncryptedCredentials."] fn get_selfie < 'a > (& 'a self) -> Option < & 'a PassportFile > ; # [doc = "Optional. Array of encrypted files with translated versions of documents provided by the user. Available if requested for \"passport\", \"driver_license\", \"identity_card\", \"internal_passport\", \"utility_bill\", \"bank_statement\", \"rental_agreement\", \"passport_registration\" and \"temporary_registration\" types. Files can be decrypted and verified using the accompanying EncryptedCredentials."] fn get_translation < 'a > (& 'a self) -> Option < & 'a Vec < PassportFile > > ; # [doc = "Base64-encoded element hash for using in PassportElementErrorUnspecified"] fn get_hash < 'a > (& 'a self) -> & 'a str ; } trait TraitLocation { # [doc = "Longitude as defined by sender"] fn get_longitude < 'a > (& 'a self) -> f64 ; # [doc = "Latitude as defined by sender"] fn get_latitude < 'a > (& 'a self) -> f64 ; # [doc = "Optional. The radius of uncertainty for the location, measured in meters; 0-1500"] fn get_horizontal_accuracy < 'a > (& 'a self) -> Option < f64 > ; # [doc = "Optional. Time relative to the message sending date, during which the location can be updated; in seconds. For active live locations only."] fn get_live_period < 'a > (& 'a self) -> Option < i64 > ; # [doc = "Optional. The direction in which user is moving, in degrees; 1-360. For active live locations only."] fn get_heading < 'a > (& 'a self) -> Option < i64 > ; # [doc = "Optional. The maximum distance for proximity alerts about approaching another chat member, in meters. For sent live locations only."] fn get_proximity_alert_radius < 'a > (& 'a self) -> Option < i64 > ; } trait TraitInlineQueryResultCachedMpeg4Gif { # [doc = "Type of the result, must be mpeg4_gif"] fn get_tg_type < 'a > (& 'a self) -> & 'a str ; # [doc = "Unique identifier for this result, 1-64 bytes"] fn get_id < 'a > (& 'a self) -> & 'a str ; # [doc = "A valid file identifier for the MPEG4 file"] fn get_mpeg_4_file_id < 'a > (& 'a self) -> & 'a str ; # [doc = "Optional. Title for the result"] fn get_title < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. Caption of the MPEG-4 file to be sent, 0-1024 characters after entities parsing"] fn get_caption < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. Mode for parsing entities in the caption. See formatting options for more details."] fn get_parse_mode < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode"] fn get_caption_entities < 'a > (& 'a self) -> Option < & 'a Vec < MessageEntity > > ; # [doc = "Optional. Inline keyboard attached to the message"] fn get_reply_markup < 'a > (& 'a self) -> Option < & 'a InlineKeyboardMarkup > ; # [doc = "Optional. Content of the message to be sent instead of the video animation"] fn get_input_message_content < 'a > (& 'a self) -> Option < & 'a InputMessageContent > ; } trait TraitMessageAutoDeleteTimerChanged { # [doc = "New auto-delete time for messages in the chat; in seconds"] fn get_message_auto_delete_time < 'a > (& 'a self) -> i64 ; } trait TraitGame { # [doc = "Title of the game"] fn get_title < 'a > (& 'a self) -> & 'a str ; # [doc = "Description of the game"] fn get_description < 'a > (& 'a self) -> & 'a str ; # [doc = "Photo that will be displayed in the game message in chats."] fn get_photo < 'a > (& 'a self) -> & 'a Vec < PhotoSize > ; # [doc = "Optional. Brief description of the game or high scores included in the game message. Can be automatically edited to include current high scores for the game when the bot calls setGameScore, or manually edited using editMessageText. 0-4096 characters."] fn get_text < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. Special entities that appear in text, such as usernames, URLs, bot commands, etc."] fn get_text_entities < 'a > (& 'a self) -> Option < & 'a Vec < MessageEntity > > ; # [doc = "Optional. Animation that will be displayed in the game message in chats. Upload via BotFather"] fn get_animation < 'a > (& 'a self) -> Option < & 'a Animation > ; } trait TraitGameHighScore { # [doc = "Position in high score table for the game"] fn get_position < 'a > (& 'a self) -> i64 ; # [doc = "User"] fn get_user < 'a > (& 'a self) -> & 'a User ; # [doc = "Score"] fn get_score < 'a > (& 'a self) -> i64 ; } trait TraitChatPermissions { # [doc = "Optional. True, if the user is allowed to send text messages, contacts, locations and venues"] fn get_can_send_messages < 'a > (& 'a self) -> Option < bool > ; # [doc = "Optional. True, if the user is allowed to send audios, documents, photos, videos, video notes and voice notes, implies can_send_messages"] fn get_can_send_media_messages < 'a > (& 'a self) -> Option < bool > ; # [doc = "Optional. True, if the user is allowed to send polls, implies can_send_messages"] fn get_can_send_polls < 'a > (& 'a self) -> Option < bool > ; # [doc = "Optional. True, if the user is allowed to send animations, games, stickers and use inline bots, implies can_send_media_messages"] fn get_can_send_other_messages < 'a > (& 'a self) -> Option < bool > ; # [doc = "Optional. True, if the user is allowed to add web page previews to their messages, implies can_send_media_messages"] fn get_can_add_web_page_previews < 'a > (& 'a self) -> Option < bool > ; # [doc = "Optional. True, if the user is allowed to change the chat title, photo and other settings. Ignored in public supergroups"] fn get_can_change_info < 'a > (& 'a self) -> Option < bool > ; # [doc = "Optional. True, if the user is allowed to invite new users to the chat"] fn get_can_invite_users < 'a > (& 'a self) -> Option < bool > ; # [doc = "Optional. True, if the user is allowed to pin messages. Ignored in public supergroups"] fn get_can_pin_messages < 'a > (& 'a self) -> Option < bool > ; } trait TraitInlineQueryResultCachedSticker { # [doc = "Type of the result, must be sticker"] fn get_tg_type < 'a > (& 'a self) -> & 'a str ; # [doc = "Unique identifier for this result, 1-64 bytes"] fn get_id < 'a > (& 'a self) -> & 'a str ; # [doc = "A valid file identifier of the sticker"] fn get_sticker_file_id < 'a > (& 'a self) -> & 'a str ; # [doc = "Optional. Inline keyboard attached to the message"] fn get_reply_markup < 'a > (& 'a self) -> Option < & 'a InlineKeyboardMarkup > ; # [doc = "Optional. Content of the message to be sent instead of the sticker"] fn get_input_message_content < 'a > (& 'a self) -> Option < & 'a InputMessageContent > ; } trait TraitBotCommandScopeAllPrivateChats { # [doc = "Scope type, must be all_private_chats"] fn get_tg_type < 'a > (& 'a self) -> & 'a str ; } trait TraitMenuButton : TraitMenuButtonCommands + TraitMenuButtonWebApp + TraitMenuButtonDefault { } trait TraitInlineQueryResultAudio { # [doc = "Type of the result, must be audio"] fn get_tg_type < 'a > (& 'a self) -> & 'a str ; # [doc = "Unique identifier for this result, 1-64 bytes"] fn get_id < 'a > (& 'a self) -> & 'a str ; # [doc = "A valid URL for the audio file"] fn get_audio_url < 'a > (& 'a self) -> & 'a str ; # [doc = "Title"] fn get_title < 'a > (& 'a self) -> & 'a str ; # [doc = "Optional. Caption, 0-1024 characters after entities parsing"] fn get_caption < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. Mode for parsing entities in the audio caption. See formatting options for more details."] fn get_parse_mode < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode"] fn get_caption_entities < 'a > (& 'a self) -> Option < & 'a Vec < MessageEntity > > ; # [doc = "Optional. Performer"] fn get_performer < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. Audio duration in seconds"] fn get_audio_duration < 'a > (& 'a self) -> Option < i64 > ; # [doc = "Optional. Inline keyboard attached to the message"] fn get_reply_markup < 'a > (& 'a self) -> Option < & 'a InlineKeyboardMarkup > ; # [doc = "Optional. Content of the message to be sent instead of the audio"] fn get_input_message_content < 'a > (& 'a self) -> Option < & 'a InputMessageContent > ; } trait TraitBotCommandScopeAllGroupChats { # [doc = "Scope type, must be all_group_chats"] fn get_tg_type < 'a > (& 'a self) -> & 'a str ; } trait TraitBotCommandScopeChatAdministrators { # [doc = "Scope type, must be chat_administrators"] fn get_tg_type < 'a > (& 'a self) -> & 'a str ; # [doc = "Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)"] fn get_chat_id < 'a > (& 'a self) -> i64 ; } trait TraitEncryptedCredentials { # [doc = "Base64-encoded encrypted JSON-serialized data with unique user's payload, data hashes and secrets required for EncryptedPassportElement decryption and authentication"] fn get_data < 'a > (& 'a self) -> & 'a str ; # [doc = "Base64-encoded data hash for data authentication"] fn get_hash < 'a > (& 'a self) -> & 'a str ; # [doc = "Base64-encoded secret, encrypted with the bot's public RSA key, required for data decryption"] fn get_secret < 'a > (& 'a self) -> & 'a str ; } trait TraitVideoChatParticipantsInvited { # [doc = "New members that were invited to the video chat"] fn get_users < 'a > (& 'a self) -> & 'a Vec < User > ; } trait TraitVideoChatEnded { # [doc = "Video chat duration in seconds"] fn get_duration < 'a > (& 'a self) -> i64 ; } trait TraitInputVenueMessageContent { # [doc = "Latitude of the venue in degrees"] fn get_latitude < 'a > (& 'a self) -> f64 ; # [doc = "Longitude of the venue in degrees"] fn get_longitude < 'a > (& 'a self) -> f64 ; # [doc = "Name of the venue"] fn get_title < 'a > (& 'a self) -> & 'a str ; # [doc = "Address of the venue"] fn get_address < 'a > (& 'a self) -> & 'a str ; # [doc = "Optional. Foursquare identifier of the venue, if known"] fn get_foursquare_id < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. Foursquare type of the venue, if known. (For example, \"arts_entertainment/default\", \"arts_entertainment/aquarium\" or \"food/icecream\".)"] fn get_foursquare_type < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. Google Places identifier of the venue"] fn get_google_place_id < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. Google Places type of the venue. (See supported types.)"] fn get_google_place_type < 'a > (& 'a self) -> Option < & 'a str > ; } trait TraitChatJoinRequest { # [doc = "Chat to which the request was sent"] fn get_chat < 'a > (& 'a self) -> & 'a Chat ; # [doc = "User that sent the join request"] fn get_from < 'a > (& 'a self) -> & 'a User ; # [doc = "Date the request was sent in Unix time"] fn get_date < 'a > (& 'a self) -> i64 ; # [doc = "Optional. Bio of the user."] fn get_bio < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. Chat invite link that was used by the user to send the join request"] fn get_invite_link < 'a > (& 'a self) -> Option < & 'a ChatInviteLink > ; } trait TraitPassportElementErrorFiles { # [doc = "Error source, must be files"] fn get_source < 'a > (& 'a self) -> & 'a str ; # [doc = "The section of the user's Telegram Passport which has the issue, one of \"utility_bill\", \"bank_statement\", \"rental_agreement\", \"passport_registration\", \"temporary_registration\""] fn get_tg_type < 'a > (& 'a self) -> & 'a str ; # [doc = "List of base64-encoded file hashes"] fn get_file_hashes < 'a > (& 'a self) -> & 'a Vec < String > ; # [doc = "Error message"] fn get_message < 'a > (& 'a self) -> & 'a str ; } trait TraitInlineQueryResultCachedDocument { # [doc = "Type of the result, must be document"] fn get_tg_type < 'a > (& 'a self) -> & 'a str ; # [doc = "Unique identifier for this result, 1-64 bytes"] fn get_id < 'a > (& 'a self) -> & 'a str ; # [doc = "Title for the result"] fn get_title < 'a > (& 'a self) -> & 'a str ; # [doc = "A valid file identifier for the file"] fn get_document_file_id < 'a > (& 'a self) -> & 'a str ; # [doc = "Optional. Short description of the result"] fn get_description < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. Caption of the document to be sent, 0-1024 characters after entities parsing"] fn get_caption < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. Mode for parsing entities in the document caption. See formatting options for more details."] fn get_parse_mode < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode"] fn get_caption_entities < 'a > (& 'a self) -> Option < & 'a Vec < MessageEntity > > ; # [doc = "Optional. Inline keyboard attached to the message"] fn get_reply_markup < 'a > (& 'a self) -> Option < & 'a InlineKeyboardMarkup > ; # [doc = "Optional. Content of the message to be sent instead of the file"] fn get_input_message_content < 'a > (& 'a self) -> Option < & 'a InputMessageContent > ; } trait TraitInlineQueryResultCachedAudio { # [doc = "Type of the result, must be audio"] fn get_tg_type < 'a > (& 'a self) -> & 'a str ; # [doc = "Unique identifier for this result, 1-64 bytes"] fn get_id < 'a > (& 'a self) -> & 'a str ; # [doc = "A valid file identifier for the audio file"] fn get_audio_file_id < 'a > (& 'a self) -> & 'a str ; # [doc = "Optional. Caption, 0-1024 characters after entities parsing"] fn get_caption < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. Mode for parsing entities in the audio caption. See formatting options for more details."] fn get_parse_mode < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode"] fn get_caption_entities < 'a > (& 'a self) -> Option < & 'a Vec < MessageEntity > > ; # [doc = "Optional. Inline keyboard attached to the message"] fn get_reply_markup < 'a > (& 'a self) -> Option < & 'a InlineKeyboardMarkup > ; # [doc = "Optional. Content of the message to be sent instead of the audio"] fn get_input_message_content < 'a > (& 'a self) -> Option < & 'a InputMessageContent > ; } trait TraitChatInviteLink { # [doc = "The invite link. If the link was created by another chat administrator, then the second part of the link will be replaced with \"...\"."] fn get_invite_link < 'a > (& 'a self) -> & 'a str ; # [doc = "Creator of the link"] fn get_creator < 'a > (& 'a self) -> & 'a User ; # [doc = "True, if users joining the chat via the link need to be approved by chat administrators"] fn get_creates_join_request < 'a > (& 'a self) -> bool ; # [doc = "True, if the link is primary"] fn get_is_primary < 'a > (& 'a self) -> bool ; # [doc = "True, if the link is revoked"] fn get_is_revoked < 'a > (& 'a self) -> bool ; # [doc = "Optional. Invite link name"] fn get_name < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. Point in time (Unix timestamp) when the link will expire or has been expired"] fn get_expire_date < 'a > (& 'a self) -> Option < i64 > ; # [doc = "Optional. The maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999"] fn get_member_limit < 'a > (& 'a self) -> Option < i64 > ; # [doc = "Optional. Number of pending join requests created using this link"] fn get_pending_join_request_count < 'a > (& 'a self) -> Option < i64 > ; } trait TraitInputMediaAudio { # [doc = "Type of the result, must be audio"] fn get_tg_type < 'a > (& 'a self) -> & 'a str ; # [doc = "File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass \"attach://<file_attach_name>\" to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files: https://core.telegram.org/bots/api#sending-files"] fn get_media < 'a > (& 'a self) -> & 'a Option < InputFile > ; # [doc = "Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass \"attach://<file_attach_name>\" if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files: https://core.telegram.org/bots/api#sending-files"] fn get_thumb < 'a > (& 'a self) -> Option < & 'a InputFile > ; # [doc = "Optional. Caption of the audio to be sent, 0-1024 characters after entities parsing"] fn get_caption < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. Mode for parsing entities in the audio caption. See formatting options for more details."] fn get_parse_mode < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode"] fn get_caption_entities < 'a > (& 'a self) -> Option < & 'a Vec < MessageEntity > > ; # [doc = "Optional. Duration of the audio in seconds"] fn get_duration < 'a > (& 'a self) -> Option < i64 > ; # [doc = "Optional. Performer of the audio"] fn get_performer < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. Title of the audio"] fn get_title < 'a > (& 'a self) -> Option < & 'a str > ; } trait TraitMenuButtonCommands { # [doc = "Type of the button, must be commands"] fn get_tg_type < 'a > (& 'a self) -> & 'a str ; } trait TraitInputFile { } trait TraitMessage { # [doc = "Unique message identifier inside this chat"] fn get_message_id < 'a > (& 'a self) -> i64 ; # [doc = "Optional. Sender of the message; empty for messages sent to channels. For backward compatibility, the field contains a fake sender user in non-channel chats, if the message was sent on behalf of a chat."] fn get_from < 'a > (& 'a self) -> Option < & 'a User > ; # [doc = "Optional. Sender of the message, sent on behalf of a chat. For example, the channel itself for channel posts, the supergroup itself for messages from anonymous group administrators, the linked channel for messages automatically forwarded to the discussion group. For backward compatibility, the field from contains a fake sender user in non-channel chats, if the message was sent on behalf of a chat."] fn get_sender_chat < 'a > (& 'a self) -> Option < & 'a Chat > ; # [doc = "Date the message was sent in Unix time"] fn get_date < 'a > (& 'a self) -> i64 ; # [doc = "Conversation the message belongs to"] fn get_chat < 'a > (& 'a self) -> & 'a Chat ; # [doc = "Optional. For forwarded messages, sender of the original message"] fn get_forward_from < 'a > (& 'a self) -> Option < & 'a User > ; # [doc = "Optional. For messages forwarded from channels or from anonymous administrators, information about the original sender chat"] fn get_forward_from_chat < 'a > (& 'a self) -> Option < & 'a Chat > ; # [doc = "Optional. For messages forwarded from channels, identifier of the original message in the channel"] fn get_forward_from_message_id < 'a > (& 'a self) -> Option < i64 > ; # [doc = "Optional. For forwarded messages that were originally sent in channels or by an anonymous chat administrator, signature of the message sender if present"] fn get_forward_signature < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. Sender's name for messages forwarded from users who disallow adding a link to their account in forwarded messages"] fn get_forward_sender_name < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. For forwarded messages, date the original message was sent in Unix time"] fn get_forward_date < 'a > (& 'a self) -> Option < i64 > ; # [doc = "Optional. True, if the message is a channel post that was automatically forwarded to the connected discussion group"] fn get_is_automatic_forward < 'a > (& 'a self) -> Option < bool > ; # [doc = "Optional. For replies, the original message. Note that the Message object in this field will not contain further reply_to_message fields even if it itself is a reply."] fn get_reply_to_message < 'a > (& 'a self) -> Option < & 'a Message > ; # [doc = "Optional. Bot through which the message was sent"] fn get_via_bot < 'a > (& 'a self) -> Option < & 'a User > ; # [doc = "Optional. Date the message was last edited in Unix time"] fn get_edit_date < 'a > (& 'a self) -> Option < i64 > ; # [doc = "Optional. True, if the message can't be forwarded"] fn get_has_protected_content < 'a > (& 'a self) -> Option < bool > ; # [doc = "Optional. The unique identifier of a media message group this message belongs to"] fn get_media_group_id < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. Signature of the post author for messages in channels, or the custom title of an anonymous group administrator"] fn get_author_signature < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. For text messages, the actual UTF-8 text of the message"] fn get_text < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text"] fn get_entities < 'a > (& 'a self) -> Option < & 'a Vec < MessageEntity > > ; # [doc = "Optional. Message is an animation, information about the animation. For backward compatibility, when this field is set, the document field will also be set"] fn get_animation < 'a > (& 'a self) -> Option < & 'a Animation > ; # [doc = "Optional. Message is an audio file, information about the file"] fn get_audio < 'a > (& 'a self) -> Option < & 'a Audio > ; # [doc = "Optional. Message is a general file, information about the file"] fn get_document < 'a > (& 'a self) -> Option < & 'a Document > ; # [doc = "Optional. Message is a photo, available sizes of the photo"] fn get_photo < 'a > (& 'a self) -> Option < & 'a Vec < PhotoSize > > ; # [doc = "Optional. Message is a sticker, information about the sticker"] fn get_sticker < 'a > (& 'a self) -> Option < & 'a Sticker > ; # [doc = "Optional. Message is a video, information about the video"] fn get_video < 'a > (& 'a self) -> Option < & 'a Video > ; # [doc = "Optional. Message is a video note, information about the video message"] fn get_video_note < 'a > (& 'a self) -> Option < & 'a VideoNote > ; # [doc = "Optional. Message is a voice message, information about the file"] fn get_voice < 'a > (& 'a self) -> Option < & 'a Voice > ; # [doc = "Optional. Caption for the animation, audio, document, photo, video or voice"] fn get_caption < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. For messages with a caption, special entities like usernames, URLs, bot commands, etc. that appear in the caption"] fn get_caption_entities < 'a > (& 'a self) -> Option < & 'a Vec < MessageEntity > > ; # [doc = "Optional. Message is a shared contact, information about the contact"] fn get_contact < 'a > (& 'a self) -> Option < & 'a Contact > ; # [doc = "Optional. Message is a dice with random value"] fn get_dice < 'a > (& 'a self) -> Option < & 'a Dice > ; # [doc = "Optional. Message is a game, information about the game. More about games: https://core.telegram.org/bots/api#games"] fn get_game < 'a > (& 'a self) -> Option < & 'a Game > ; # [doc = "Optional. Message is a native poll, information about the poll"] fn get_poll < 'a > (& 'a self) -> Option < & 'a Poll > ; # [doc = "Optional. Message is a venue, information about the venue. For backward compatibility, when this field is set, the location field will also be set"] fn get_venue < 'a > (& 'a self) -> Option < & 'a Venue > ; # [doc = "Optional. Message is a shared location, information about the location"] fn get_location < 'a > (& 'a self) -> Option < & 'a Location > ; # [doc = "Optional. New members that were added to the group or supergroup and information about them (the bot itself may be one of these members)"] fn get_new_chat_members < 'a > (& 'a self) -> Option < & 'a Vec < User > > ; # [doc = "Optional. A member was removed from the group, information about them (this member may be the bot itself)"] fn get_left_chat_member < 'a > (& 'a self) -> Option < & 'a User > ; # [doc = "Optional. A chat title was changed to this value"] fn get_new_chat_title < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. A chat photo was change to this value"] fn get_new_chat_photo < 'a > (& 'a self) -> Option < & 'a Vec < PhotoSize > > ; # [doc = "Optional. Service message: the chat photo was deleted"] fn get_delete_chat_photo < 'a > (& 'a self) -> Option < bool > ; # [doc = "Optional. Service message: the group has been created"] fn get_group_chat_created < 'a > (& 'a self) -> Option < bool > ; # [doc = "Optional. Service message: the supergroup has been created. This field can't be received in a message coming through updates, because bot can't be a member of a supergroup when it is created. It can only be found in reply_to_message if someone replies to a very first message in a directly created supergroup."] fn get_supergroup_chat_created < 'a > (& 'a self) -> Option < bool > ; # [doc = "Optional. Service message: the channel has been created. This field can't be received in a message coming through updates, because bot can't be a member of a channel when it is created. It can only be found in reply_to_message if someone replies to a very first message in a channel."] fn get_channel_chat_created < 'a > (& 'a self) -> Option < bool > ; # [doc = "Optional. Service message: auto-delete timer settings changed in the chat"] fn get_message_auto_delete_timer_changed < 'a > (& 'a self) -> Option < & 'a MessageAutoDeleteTimerChanged > ; # [doc = "Optional. The group has been migrated to a supergroup with the specified identifier. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier."] fn get_migrate_to_chat_id < 'a > (& 'a self) -> Option < i64 > ; # [doc = "Optional. The supergroup has been migrated from a group with the specified identifier. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier."] fn get_migrate_from_chat_id < 'a > (& 'a self) -> Option < i64 > ; # [doc = "Optional. Specified message was pinned. Note that the Message object in this field will not contain further reply_to_message fields even if it is itself a reply."] fn get_pinned_message < 'a > (& 'a self) -> Option < & 'a Message > ; # [doc = "Optional. Message is an invoice for a payment, information about the invoice. More about payments: https://core.telegram.org/bots/api#payments"] fn get_invoice < 'a > (& 'a self) -> Option < & 'a Invoice > ; # [doc = "Optional. Message is a service message about a successful payment, information about the payment. More about payments: https://core.telegram.org/bots/api#payments"] fn get_successful_payment < 'a > (& 'a self) -> Option < & 'a SuccessfulPayment > ; # [doc = "Optional. The domain name of the website on which the user has logged in. More about Telegram Login: https://core.telegram.org/widgets/login"] fn get_connected_website < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. Telegram Passport data"] fn get_passport_data < 'a > (& 'a self) -> Option < & 'a PassportData > ; # [doc = "Optional. Service message. A user in the chat triggered another user's proximity alert while sharing Live Location."] fn get_proximity_alert_triggered < 'a > (& 'a self) -> Option < & 'a ProximityAlertTriggered > ; # [doc = "Optional. Service message: video chat scheduled"] fn get_video_chat_scheduled < 'a > (& 'a self) -> Option < & 'a VideoChatScheduled > ; # [doc = "Optional. Service message: video chat started"] fn get_video_chat_started < 'a > (& 'a self) -> Option < & 'a VideoChatStarted > ; # [doc = "Optional. Service message: video chat ended"] fn get_video_chat_ended < 'a > (& 'a self) -> Option < & 'a VideoChatEnded > ; # [doc = "Optional. Service message: new participants invited to a video chat"] fn get_video_chat_participants_invited < 'a > (& 'a self) -> Option < & 'a VideoChatParticipantsInvited > ; # [doc = "Optional. Service message: data sent by a Web App"] fn get_web_app_data < 'a > (& 'a self) -> Option < & 'a WebAppData > ; # [doc = "Optional. Inline keyboard attached to the message. login_url buttons are represented as ordinary url buttons."] fn get_reply_markup < 'a > (& 'a self) -> Option < & 'a InlineKeyboardMarkup > ; } trait TraitInlineQueryResultDocument { # [doc = "Type of the result, must be document"] fn get_tg_type < 'a > (& 'a self) -> & 'a str ; # [doc = "Unique identifier for this result, 1-64 bytes"] fn get_id < 'a > (& 'a self) -> & 'a str ; # [doc = "Title for the result"] fn get_title < 'a > (& 'a self) -> & 'a str ; # [doc = "Optional. Caption of the document to be sent, 0-1024 characters after entities parsing"] fn get_caption < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. Mode for parsing entities in the document caption. See formatting options for more details."] fn get_parse_mode < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode"] fn get_caption_entities < 'a > (& 'a self) -> Option < & 'a Vec < MessageEntity > > ; # [doc = "A valid URL for the file"] fn get_document_url < 'a > (& 'a self) -> & 'a str ; # [doc = "MIME type of the content of the file, either \"application/pdf\" or \"application/zip\""] fn get_mime_type < 'a > (& 'a self) -> & 'a str ; # [doc = "Optional. Short description of the result"] fn get_description < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. Inline keyboard attached to the message"] fn get_reply_markup < 'a > (& 'a self) -> Option < & 'a InlineKeyboardMarkup > ; # [doc = "Optional. Content of the message to be sent instead of the file"] fn get_input_message_content < 'a > (& 'a self) -> Option < & 'a InputMessageContent > ; # [doc = "Optional. URL of the thumbnail (JPEG only) for the file"] fn get_thumb_url < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. Thumbnail width"] fn get_thumb_width < 'a > (& 'a self) -> Option < i64 > ; # [doc = "Optional. Thumbnail height"] fn get_thumb_height < 'a > (& 'a self) -> Option < i64 > ; } trait TraitChatMember : TraitChatMemberOwner + TraitChatMemberAdministrator + TraitChatMemberMember + TraitChatMemberRestricted + TraitChatMemberLeft + TraitChatMemberBanned { } trait TraitVideo { # [doc = "Identifier for this file, which can be used to download or reuse the file"] fn get_file_id < 'a > (& 'a self) -> & 'a str ; # [doc = "Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file."] fn get_file_unique_id < 'a > (& 'a self) -> & 'a str ; # [doc = "Video width as defined by sender"] fn get_width < 'a > (& 'a self) -> i64 ; # [doc = "Video height as defined by sender"] fn get_height < 'a > (& 'a self) -> i64 ; # [doc = "Duration of the video in seconds as defined by sender"] fn get_duration < 'a > (& 'a self) -> i64 ; # [doc = "Optional. Video thumbnail"] fn get_thumb < 'a > (& 'a self) -> Option < & 'a PhotoSize > ; # [doc = "Optional. Original filename as defined by sender"] fn get_file_name < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. MIME type of the file as defined by sender"] fn get_mime_type < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value."] fn get_file_size < 'a > (& 'a self) -> Option < i64 > ; } trait TraitInlineQueryResultArticle { # [doc = "Type of the result, must be article"] fn get_tg_type < 'a > (& 'a self) -> & 'a str ; # [doc = "Unique identifier for this result, 1-64 Bytes"] fn get_id < 'a > (& 'a self) -> & 'a str ; # [doc = "Title of the result"] fn get_title < 'a > (& 'a self) -> & 'a str ; # [doc = "Content of the message to be sent"] fn get_input_message_content < 'a > (& 'a self) -> & 'a InputMessageContent ; # [doc = "Optional. Inline keyboard attached to the message"] fn get_reply_markup < 'a > (& 'a self) -> Option < & 'a InlineKeyboardMarkup > ; # [doc = "Optional. URL of the result"] fn get_url < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. Pass True if you don't want the URL to be shown in the message"] fn get_hide_url < 'a > (& 'a self) -> Option < bool > ; # [doc = "Optional. Short description of the result"] fn get_description < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. Url of the thumbnail for the result"] fn get_thumb_url < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. Thumbnail width"] fn get_thumb_width < 'a > (& 'a self) -> Option < i64 > ; # [doc = "Optional. Thumbnail height"] fn get_thumb_height < 'a > (& 'a self) -> Option < i64 > ; } trait TraitPassportElementErrorSelfie { # [doc = "Error source, must be selfie"] fn get_source < 'a > (& 'a self) -> & 'a str ; # [doc = "The section of the user's Telegram Passport which has the issue, one of \"passport\", \"driver_license\", \"identity_card\", \"internal_passport\""] fn get_tg_type < 'a > (& 'a self) -> & 'a str ; # [doc = "Base64-encoded hash of the file with the selfie"] fn get_file_hash < 'a > (& 'a self) -> & 'a str ; # [doc = "Error message"] fn get_message < 'a > (& 'a self) -> & 'a str ; } trait TraitMessageEntity { # [doc = "Type of the entity. Currently, can be \"mention\" (@username), \"hashtag\" (#hashtag), \"cashtag\" ($USD), \"bot_command\" (/start@jobs_bot), \"url\" (https://telegram.org), \"email\" (do-not-reply@telegram.org), \"phone_number\" (+1-212-555-0123), \"bold\" (bold text), \"italic\" (italic text), \"underline\" (underlined text), \"strikethrough\" (strikethrough text), \"spoiler\" (spoiler message), \"code\" (monowidth string), \"pre\" (monowidth block), \"text_link\" (for clickable text URLs), \"text_mention\" (for users without usernames), \"custom_emoji\" (for inline custom emoji stickers)"] fn get_tg_type < 'a > (& 'a self) -> & 'a str ; # [doc = "Offset in UTF-16 code units to the start of the entity"] fn get_offset < 'a > (& 'a self) -> i64 ; # [doc = "Length of the entity in UTF-16 code units"] fn get_length < 'a > (& 'a self) -> i64 ; # [doc = "Optional. For \"text_link\" only, URL that will be opened after user taps on the text"] fn get_url < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. For \"text_mention\" only, the mentioned user"] fn get_user < 'a > (& 'a self) -> Option < & 'a User > ; # [doc = "Optional. For \"pre\" only, the programming language of the entity text"] fn get_language < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. For \"custom_emoji\" only, unique identifier of the custom emoji. Use getCustomEmojiStickers to get full information about the sticker"] fn get_custom_emoji_id < 'a > (& 'a self) -> Option < & 'a str > ; } trait TraitBotCommand { # [doc = "Text of the command; 1-32 characters. Can contain only lowercase English letters, digits and underscores."] fn get_command < 'a > (& 'a self) -> & 'a str ; # [doc = "Description of the command; 1-256 characters."] fn get_description < 'a > (& 'a self) -> & 'a str ; } trait TraitInvoice { # [doc = "Product name"] fn get_title < 'a > (& 'a self) -> & 'a str ; # [doc = "Product description"] fn get_description < 'a > (& 'a self) -> & 'a str ; # [doc = "Unique bot deep-linking parameter that can be used to generate this invoice"] fn get_start_parameter < 'a > (& 'a self) -> & 'a str ; # [doc = "Three-letter ISO 4217 currency code"] fn get_currency < 'a > (& 'a self) -> & 'a str ; # [doc = "Total price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies)."] fn get_total_amount < 'a > (& 'a self) -> i64 ; } trait TraitChatMemberUpdated { # [doc = "Chat the user belongs to"] fn get_chat < 'a > (& 'a self) -> & 'a Chat ; # [doc = "Performer of the action, which resulted in the change"] fn get_from < 'a > (& 'a self) -> & 'a User ; # [doc = "Date the change was done in Unix time"] fn get_date < 'a > (& 'a self) -> i64 ; # [doc = "Previous information about the chat member"] fn get_old_chat_member < 'a > (& 'a self) -> & 'a ChatMember ; # [doc = "New information about the chat member"] fn get_new_chat_member < 'a > (& 'a self) -> & 'a ChatMember ; # [doc = "Optional. Chat invite link, which was used by the user to join the chat; for joining by invite link events only."] fn get_invite_link < 'a > (& 'a self) -> Option < & 'a ChatInviteLink > ; } trait TraitBotCommandScopeDefault { # [doc = "Scope type, must be default"] fn get_tg_type < 'a > (& 'a self) -> & 'a str ; } trait TraitInlineQueryResultMpeg4Gif { # [doc = "Type of the result, must be mpeg4_gif"] fn get_tg_type < 'a > (& 'a self) -> & 'a str ; # [doc = "Unique identifier for this result, 1-64 bytes"] fn get_id < 'a > (& 'a self) -> & 'a str ; # [doc = "A valid URL for the MPEG4 file. File size must not exceed 1MB"] fn get_mpeg_4_url < 'a > (& 'a self) -> & 'a str ; # [doc = "Optional. Video width"] fn get_mpeg_4_width < 'a > (& 'a self) -> Option < i64 > ; # [doc = "Optional. Video height"] fn get_mpeg_4_height < 'a > (& 'a self) -> Option < i64 > ; # [doc = "Optional. Video duration in seconds"] fn get_mpeg_4_duration < 'a > (& 'a self) -> Option < i64 > ; # [doc = "URL of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the result"] fn get_thumb_url < 'a > (& 'a self) -> & 'a str ; # [doc = "Optional. MIME type of the thumbnail, must be one of \"image/jpeg\", \"image/gif\", or \"video/mp4\". Defaults to \"image/jpeg\""] fn get_thumb_mime_type < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. Title for the result"] fn get_title < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. Caption of the MPEG-4 file to be sent, 0-1024 characters after entities parsing"] fn get_caption < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. Mode for parsing entities in the caption. See formatting options for more details."] fn get_parse_mode < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode"] fn get_caption_entities < 'a > (& 'a self) -> Option < & 'a Vec < MessageEntity > > ; # [doc = "Optional. Inline keyboard attached to the message"] fn get_reply_markup < 'a > (& 'a self) -> Option < & 'a InlineKeyboardMarkup > ; # [doc = "Optional. Content of the message to be sent instead of the video animation"] fn get_input_message_content < 'a > (& 'a self) -> Option < & 'a InputMessageContent > ; } trait TraitShippingQuery { # [doc = "Unique query identifier"] fn get_id < 'a > (& 'a self) -> & 'a str ; # [doc = "User who sent the query"] fn get_from < 'a > (& 'a self) -> & 'a User ; # [doc = "Bot specified invoice payload"] fn get_invoice_payload < 'a > (& 'a self) -> & 'a str ; # [doc = "User specified shipping address"] fn get_shipping_address < 'a > (& 'a self) -> & 'a ShippingAddress ; } trait TraitInputTextMessageContent { # [doc = "Text of the message to be sent, 1-4096 characters"] fn get_message_text < 'a > (& 'a self) -> & 'a str ; # [doc = "Optional. Mode for parsing entities in the message text. See formatting options for more details."] fn get_parse_mode < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. List of special entities that appear in message text, which can be specified instead of parse_mode"] fn get_entities < 'a > (& 'a self) -> Option < & 'a Vec < MessageEntity > > ; # [doc = "Optional. Disables link previews for links in the sent message"] fn get_disable_web_page_preview < 'a > (& 'a self) -> Option < bool > ; } trait TraitInputLocationMessageContent { # [doc = "Latitude of the location in degrees"] fn get_latitude < 'a > (& 'a self) -> f64 ; # [doc = "Longitude of the location in degrees"] fn get_longitude < 'a > (& 'a self) -> f64 ; # [doc = "Optional. The radius of uncertainty for the location, measured in meters; 0-1500"] fn get_horizontal_accuracy < 'a > (& 'a self) -> Option < f64 > ; # [doc = "Optional. Period in seconds for which the location can be updated, should be between 60 and 86400."] fn get_live_period < 'a > (& 'a self) -> Option < i64 > ; # [doc = "Optional. For live locations, a direction in which the user is moving, in degrees. Must be between 1 and 360 if specified."] fn get_heading < 'a > (& 'a self) -> Option < i64 > ; # [doc = "Optional. For live locations, a maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified."] fn get_proximity_alert_radius < 'a > (& 'a self) -> Option < i64 > ; } trait TraitInlineQueryResultGame { # [doc = "Type of the result, must be game"] fn get_tg_type < 'a > (& 'a self) -> & 'a str ; # [doc = "Unique identifier for this result, 1-64 bytes"] fn get_id < 'a > (& 'a self) -> & 'a str ; # [doc = "Short name of the game"] fn get_game_short_name < 'a > (& 'a self) -> & 'a str ; # [doc = "Optional. Inline keyboard attached to the message"] fn get_reply_markup < 'a > (& 'a self) -> Option < & 'a InlineKeyboardMarkup > ; } trait TraitVideoNote { # [doc = "Identifier for this file, which can be used to download or reuse the file"] fn get_file_id < 'a > (& 'a self) -> & 'a str ; # [doc = "Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file."] fn get_file_unique_id < 'a > (& 'a self) -> & 'a str ; # [doc = "Video width and height (diameter of the video message) as defined by sender"] fn get_length < 'a > (& 'a self) -> i64 ; # [doc = "Duration of the video in seconds as defined by sender"] fn get_duration < 'a > (& 'a self) -> i64 ; # [doc = "Optional. Video thumbnail"] fn get_thumb < 'a > (& 'a self) -> Option < & 'a PhotoSize > ; # [doc = "Optional. File size in bytes"] fn get_file_size < 'a > (& 'a self) -> Option < i64 > ; } trait TraitPassportFile { # [doc = "Identifier for this file, which can be used to download or reuse the file"] fn get_file_id < 'a > (& 'a self) -> & 'a str ; # [doc = "Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file."] fn get_file_unique_id < 'a > (& 'a self) -> & 'a str ; # [doc = "File size in bytes"] fn get_file_size < 'a > (& 'a self) -> i64 ; # [doc = "Unix time when the file was uploaded"] fn get_file_date < 'a > (& 'a self) -> i64 ; } trait TraitPassportElementErrorFrontSide { # [doc = "Error source, must be front_side"] fn get_source < 'a > (& 'a self) -> & 'a str ; # [doc = "The section of the user's Telegram Passport which has the issue, one of \"passport\", \"driver_license\", \"identity_card\", \"internal_passport\""] fn get_tg_type < 'a > (& 'a self) -> & 'a str ; # [doc = "Base64-encoded hash of the file with the front side of the document"] fn get_file_hash < 'a > (& 'a self) -> & 'a str ; # [doc = "Error message"] fn get_message < 'a > (& 'a self) -> & 'a str ; } trait TraitPassportElementErrorFile { # [doc = "Error source, must be file"] fn get_source < 'a > (& 'a self) -> & 'a str ; # [doc = "The section of the user's Telegram Passport which has the issue, one of \"utility_bill\", \"bank_statement\", \"rental_agreement\", \"passport_registration\", \"temporary_registration\""] fn get_tg_type < 'a > (& 'a self) -> & 'a str ; # [doc = "Base64-encoded file hash"] fn get_file_hash < 'a > (& 'a self) -> & 'a str ; # [doc = "Error message"] fn get_message < 'a > (& 'a self) -> & 'a str ; } trait TraitInlineQueryResultVideo { # [doc = "Type of the result, must be video"] fn get_tg_type < 'a > (& 'a self) -> & 'a str ; # [doc = "Unique identifier for this result, 1-64 bytes"] fn get_id < 'a > (& 'a self) -> & 'a str ; # [doc = "A valid URL for the embedded video player or video file"] fn get_video_url < 'a > (& 'a self) -> & 'a str ; # [doc = "MIME type of the content of the video URL, \"text/html\" or \"video/mp4\""] fn get_mime_type < 'a > (& 'a self) -> & 'a str ; # [doc = "URL of the thumbnail (JPEG only) for the video"] fn get_thumb_url < 'a > (& 'a self) -> & 'a str ; # [doc = "Title for the result"] fn get_title < 'a > (& 'a self) -> & 'a str ; # [doc = "Optional. Caption of the video to be sent, 0-1024 characters after entities parsing"] fn get_caption < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. Mode for parsing entities in the video caption. See formatting options for more details."] fn get_parse_mode < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode"] fn get_caption_entities < 'a > (& 'a self) -> Option < & 'a Vec < MessageEntity > > ; # [doc = "Optional. Video width"] fn get_video_width < 'a > (& 'a self) -> Option < i64 > ; # [doc = "Optional. Video height"] fn get_video_height < 'a > (& 'a self) -> Option < i64 > ; # [doc = "Optional. Video duration in seconds"] fn get_video_duration < 'a > (& 'a self) -> Option < i64 > ; # [doc = "Optional. Short description of the result"] fn get_description < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. Inline keyboard attached to the message"] fn get_reply_markup < 'a > (& 'a self) -> Option < & 'a InlineKeyboardMarkup > ; # [doc = "Optional. Content of the message to be sent instead of the video. This field is required if InlineQueryResultVideo is used to send an HTML-page as a result (e.g., a YouTube video)."] fn get_input_message_content < 'a > (& 'a self) -> Option < & 'a InputMessageContent > ; } trait TraitDocument { # [doc = "Identifier for this file, which can be used to download or reuse the file"] fn get_file_id < 'a > (& 'a self) -> & 'a str ; # [doc = "Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file."] fn get_file_unique_id < 'a > (& 'a self) -> & 'a str ; # [doc = "Optional. Document thumbnail as defined by sender"] fn get_thumb < 'a > (& 'a self) -> Option < & 'a PhotoSize > ; # [doc = "Optional. Original filename as defined by sender"] fn get_file_name < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. MIME type of the file as defined by sender"] fn get_mime_type < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value."] fn get_file_size < 'a > (& 'a self) -> Option < i64 > ; } trait TraitWebAppInfo { # [doc = "An HTTPS URL of a Web App to be opened with additional data as specified in Initializing Web Apps"] fn get_url < 'a > (& 'a self) -> & 'a str ; } trait TraitPassportData { # [doc = "Array with information about documents and other Telegram Passport elements that was shared with the bot"] fn get_data < 'a > (& 'a self) -> & 'a Vec < EncryptedPassportElement > ; # [doc = "Encrypted credentials required to decrypt the data"] fn get_credentials < 'a > (& 'a self) -> & 'a EncryptedCredentials ; } trait TraitChat { # [doc = "Unique identifier for this chat. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier."] fn get_id < 'a > (& 'a self) -> i64 ; # [doc = "Type of chat, can be either \"private\", \"group\", \"supergroup\" or \"channel\""] fn get_tg_type < 'a > (& 'a self) -> & 'a str ; # [doc = "Optional. Title, for supergroups, channels and group chats"] fn get_title < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. Username, for private chats, supergroups and channels if available"] fn get_username < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. First name of the other party in a private chat"] fn get_first_name < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. Last name of the other party in a private chat"] fn get_last_name < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. Chat photo. Returned only in getChat."] fn get_photo < 'a > (& 'a self) -> Option < & 'a ChatPhoto > ; # [doc = "Optional. Bio of the other party in a private chat. Returned only in getChat."] fn get_bio < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. True, if privacy settings of the other party in the private chat allows to use tg://user?id=<user_id> links only in chats with the user. Returned only in getChat."] fn get_has_private_forwards < 'a > (& 'a self) -> Option < bool > ; # [doc = "Optional. True, if the privacy settings of the other party restrict sending voice and video note messages in the private chat. Returned only in getChat."] fn get_has_restricted_voice_and_video_messages < 'a > (& 'a self) -> Option < bool > ; # [doc = "Optional. True, if users need to join the supergroup before they can send messages. Returned only in getChat."] fn get_join_to_send_messages < 'a > (& 'a self) -> Option < bool > ; # [doc = "Optional. True, if all users directly joining the supergroup need to be approved by supergroup administrators. Returned only in getChat."] fn get_join_by_request < 'a > (& 'a self) -> Option < bool > ; # [doc = "Optional. Description, for groups, supergroups and channel chats. Returned only in getChat."] fn get_description < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. Primary invite link, for groups, supergroups and channel chats. Returned only in getChat."] fn get_invite_link < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. The most recent pinned message (by sending date). Returned only in getChat."] fn get_pinned_message < 'a > (& 'a self) -> Option < & 'a Message > ; # [doc = "Optional. Default chat member permissions, for groups and supergroups. Returned only in getChat."] fn get_permissions < 'a > (& 'a self) -> Option < & 'a ChatPermissions > ; # [doc = "Optional. For supergroups, the minimum allowed delay between consecutive messages sent by each unpriviledged user; in seconds. Returned only in getChat."] fn get_slow_mode_delay < 'a > (& 'a self) -> Option < i64 > ; # [doc = "Optional. The time after which all messages sent to the chat will be automatically deleted; in seconds. Returned only in getChat."] fn get_message_auto_delete_time < 'a > (& 'a self) -> Option < i64 > ; # [doc = "Optional. True, if messages from the chat can't be forwarded to other chats. Returned only in getChat."] fn get_has_protected_content < 'a > (& 'a self) -> Option < bool > ; # [doc = "Optional. For supergroups, name of group sticker set. Returned only in getChat."] fn get_sticker_set_name < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. True, if the bot can change the group sticker set. Returned only in getChat."] fn get_can_set_sticker_set < 'a > (& 'a self) -> Option < bool > ; # [doc = "Optional. Unique identifier for the linked chat, i.e. the discussion group identifier for a channel and vice versa; for supergroups and channel chats. This identifier may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier. Returned only in getChat."] fn get_linked_chat_id < 'a > (& 'a self) -> Option < i64 > ; # [doc = "Optional. For supergroups, the location to which the supergroup is connected. Returned only in getChat."] fn get_location < 'a > (& 'a self) -> Option < & 'a ChatLocation > ; } trait TraitCallbackQuery { # [doc = "Unique identifier for this query"] fn get_id < 'a > (& 'a self) -> & 'a str ; # [doc = "Sender"] fn get_from < 'a > (& 'a self) -> & 'a User ; # [doc = "Optional. Message with the callback button that originated the query. Note that message content and message date will not be available if the message is too old"] fn get_message < 'a > (& 'a self) -> Option < & 'a Message > ; # [doc = "Optional. Identifier of the message sent via the bot in inline mode, that originated the query."] fn get_inline_message_id < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Global identifier, uniquely corresponding to the chat to which the message with the callback button was sent. Useful for high scores in games."] fn get_chat_instance < 'a > (& 'a self) -> & 'a str ; # [doc = "Optional. Data associated with the callback button. Be aware that the message originated the query can contain no callback buttons with this data."] fn get_data < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. Short name of a Game to be returned, serves as the unique identifier for the game"] fn get_game_short_name < 'a > (& 'a self) -> Option < & 'a str > ; } trait TraitInputMessageContent : TraitInputTextMessageContent + TraitInputLocationMessageContent + TraitInputVenueMessageContent + TraitInputContactMessageContent + TraitInputInvoiceMessageContent { } trait TraitReplyKeyboardRemove { # [doc = "Requests clients to remove the custom keyboard (user will not be able to summon this keyboard; if you want to hide the keyboard from sight but keep it accessible, use one_time_keyboard in ReplyKeyboardMarkup)"] fn get_remove_keyboard < 'a > (& 'a self) -> bool ; # [doc = "Optional. Use this parameter if you want to remove the keyboard for specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply (has reply_to_message_id), sender of the original message. Example: A user votes in a poll, bot returns confirmation message in reply to the vote and removes the keyboard for that user, while still showing the keyboard with poll options to users who haven't voted yet."] fn get_selective < 'a > (& 'a self) -> Option < bool > ; } trait TraitUserProfilePhotos { # [doc = "Total number of profile pictures the target user has"] fn get_total_count < 'a > (& 'a self) -> i64 ; # [doc = "Requested profile pictures (in up to 4 sizes each)"] fn get_photos < 'a > (& 'a self) -> & 'a Vec < Vec < PhotoSize > > ; } trait TraitInlineQueryResultLocation { # [doc = "Type of the result, must be location"] fn get_tg_type < 'a > (& 'a self) -> & 'a str ; # [doc = "Unique identifier for this result, 1-64 Bytes"] fn get_id < 'a > (& 'a self) -> & 'a str ; # [doc = "Location latitude in degrees"] fn get_latitude < 'a > (& 'a self) -> f64 ; # [doc = "Location longitude in degrees"] fn get_longitude < 'a > (& 'a self) -> f64 ; # [doc = "Location title"] fn get_title < 'a > (& 'a self) -> & 'a str ; # [doc = "Optional. The radius of uncertainty for the location, measured in meters; 0-1500"] fn get_horizontal_accuracy < 'a > (& 'a self) -> Option < f64 > ; # [doc = "Optional. Period in seconds for which the location can be updated, should be between 60 and 86400."] fn get_live_period < 'a > (& 'a self) -> Option < i64 > ; # [doc = "Optional. For live locations, a direction in which the user is moving, in degrees. Must be between 1 and 360 if specified."] fn get_heading < 'a > (& 'a self) -> Option < i64 > ; # [doc = "Optional. For live locations, a maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified."] fn get_proximity_alert_radius < 'a > (& 'a self) -> Option < i64 > ; # [doc = "Optional. Inline keyboard attached to the message"] fn get_reply_markup < 'a > (& 'a self) -> Option < & 'a InlineKeyboardMarkup > ; # [doc = "Optional. Content of the message to be sent instead of the location"] fn get_input_message_content < 'a > (& 'a self) -> Option < & 'a InputMessageContent > ; # [doc = "Optional. Url of the thumbnail for the result"] fn get_thumb_url < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. Thumbnail width"] fn get_thumb_width < 'a > (& 'a self) -> Option < i64 > ; # [doc = "Optional. Thumbnail height"] fn get_thumb_height < 'a > (& 'a self) -> Option < i64 > ; } trait TraitPollOption { # [doc = "Option text, 1-100 characters"] fn get_text < 'a > (& 'a self) -> & 'a str ; # [doc = "Number of users that voted for this option"] fn get_voter_count < 'a > (& 'a self) -> i64 ; } trait TraitInlineKeyboardMarkup { # [doc = "Array of button rows, each represented by an Array of InlineKeyboardButton objects"] fn get_inline_keyboard < 'a > (& 'a self) -> & 'a Vec < Vec < InlineKeyboardButton > > ; } trait TraitChatMemberOwner { # [doc = "The member's status in the chat, always \"creator\""] fn get_status < 'a > (& 'a self) -> & 'a str ; # [doc = "Information about the user"] fn get_user < 'a > (& 'a self) -> & 'a User ; # [doc = "True, if the user's presence in the chat is hidden"] fn get_is_anonymous < 'a > (& 'a self) -> bool ; # [doc = "Optional. Custom title for this user"] fn get_custom_title < 'a > (& 'a self) -> Option < & 'a str > ; } trait TraitSentWebAppMessage { # [doc = "Optional. Identifier of the sent inline message. Available only if there is an inline keyboard attached to the message."] fn get_inline_message_id < 'a > (& 'a self) -> Option < & 'a str > ; } trait TraitLabeledPrice { # [doc = "Portion label"] fn get_label < 'a > (& 'a self) -> & 'a str ; # [doc = "Price of the product in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies)."] fn get_amount < 'a > (& 'a self) -> i64 ; } trait TraitInputMediaPhoto { # [doc = "Type of the result, must be photo"] fn get_tg_type < 'a > (& 'a self) -> & 'a str ; # [doc = "File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass \"attach://<file_attach_name>\" to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files: https://core.telegram.org/bots/api#sending-files"] fn get_media < 'a > (& 'a self) -> & 'a Option < InputFile > ; # [doc = "Optional. Caption of the photo to be sent, 0-1024 characters after entities parsing"] fn get_caption < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. Mode for parsing entities in the photo caption. See formatting options for more details."] fn get_parse_mode < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode"] fn get_caption_entities < 'a > (& 'a self) -> Option < & 'a Vec < MessageEntity > > ; } trait TraitInlineQueryResultCachedVoice { # [doc = "Type of the result, must be voice"] fn get_tg_type < 'a > (& 'a self) -> & 'a str ; # [doc = "Unique identifier for this result, 1-64 bytes"] fn get_id < 'a > (& 'a self) -> & 'a str ; # [doc = "A valid file identifier for the voice message"] fn get_voice_file_id < 'a > (& 'a self) -> & 'a str ; # [doc = "Voice message title"] fn get_title < 'a > (& 'a self) -> & 'a str ; # [doc = "Optional. Caption, 0-1024 characters after entities parsing"] fn get_caption < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. Mode for parsing entities in the voice message caption. See formatting options for more details."] fn get_parse_mode < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode"] fn get_caption_entities < 'a > (& 'a self) -> Option < & 'a Vec < MessageEntity > > ; # [doc = "Optional. Inline keyboard attached to the message"] fn get_reply_markup < 'a > (& 'a self) -> Option < & 'a InlineKeyboardMarkup > ; # [doc = "Optional. Content of the message to be sent instead of the voice message"] fn get_input_message_content < 'a > (& 'a self) -> Option < & 'a InputMessageContent > ; } trait TraitVenue { # [doc = "Venue location. Can't be a live location"] fn get_location < 'a > (& 'a self) -> & 'a Location ; # [doc = "Name of the venue"] fn get_title < 'a > (& 'a self) -> & 'a str ; # [doc = "Address of the venue"] fn get_address < 'a > (& 'a self) -> & 'a str ; # [doc = "Optional. Foursquare identifier of the venue"] fn get_foursquare_id < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. Foursquare type of the venue. (For example, \"arts_entertainment/default\", \"arts_entertainment/aquarium\" or \"food/icecream\".)"] fn get_foursquare_type < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. Google Places identifier of the venue"] fn get_google_place_id < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. Google Places type of the venue. (See supported types.)"] fn get_google_place_type < 'a > (& 'a self) -> Option < & 'a str > ; } trait TraitKeyboardButton { # [doc = "Text of the button. If none of the optional fields are used, it will be sent as a message when the button is pressed"] fn get_text < 'a > (& 'a self) -> & 'a str ; # [doc = "Optional. If True, the user's phone number will be sent as a contact when the button is pressed. Available in private chats only."] fn get_request_contact < 'a > (& 'a self) -> Option < bool > ; # [doc = "Optional. If True, the user's current location will be sent when the button is pressed. Available in private chats only."] fn get_request_location < 'a > (& 'a self) -> Option < bool > ; # [doc = "Optional. If specified, the user will be asked to create a poll and send it to the bot when the button is pressed. Available in private chats only."] fn get_request_poll < 'a > (& 'a self) -> Option < & 'a KeyboardButtonPollType > ; # [doc = "Optional. If specified, the described Web App will be launched when the button is pressed. The Web App will be able to send a \"web_app_data\" service message. Available in private chats only."] fn get_web_app < 'a > (& 'a self) -> Option < & 'a WebAppInfo > ; } trait TraitInputMediaVideo { # [doc = "Type of the result, must be video"] fn get_tg_type < 'a > (& 'a self) -> & 'a str ; # [doc = "File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass \"attach://<file_attach_name>\" to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files: https://core.telegram.org/bots/api#sending-files"] fn get_media < 'a > (& 'a self) -> & 'a Option < InputFile > ; # [doc = "Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass \"attach://<file_attach_name>\" if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files: https://core.telegram.org/bots/api#sending-files"] fn get_thumb < 'a > (& 'a self) -> Option < & 'a InputFile > ; # [doc = "Optional. Caption of the video to be sent, 0-1024 characters after entities parsing"] fn get_caption < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. Mode for parsing entities in the video caption. See formatting options for more details."] fn get_parse_mode < 'a > (& 'a self) -> Option < & 'a str > ; # [doc = "Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode"] fn get_caption_entities < 'a > (& 'a self) -> Option < & 'a Vec < MessageEntity > > ; # [doc = "Optional. Video width"] fn get_width < 'a > (& 'a self) -> Option < i64 > ; # [doc = "Optional. Video height"] fn get_height < 'a > (& 'a self) -> Option < i64 > ; # [doc = "Optional. Video duration in seconds"] fn get_duration < 'a > (& 'a self) -> Option < i64 > ; # [doc = "Optional. Pass True if the uploaded video is suitable for streaming"] fn get_supports_streaming < 'a > (& 'a self) -> Option < bool > ; } # [doc = "This object represents a file ready to be downloaded. The file can be downloaded via the link https://api.telegram.org/file/bot<token>/<file_path>. It is guaranteed that the link will be valid for at least 1 hour. When the link expires, a new one can be requested by calling getFile."] # [derive (Serialize , Deserialize , Debug)] pub struct File { # [doc = "Identifier for this file, which can be used to download or reuse the file"] # [serde (rename = "file_id")] file_id : String , # [doc = "Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file."] # [serde (rename = "file_unique_id")] file_unique_id : String , # [doc = "Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value."] # [serde (skip_serializing_if = "Option::is_none" , rename = "file_size")] file_size : Option < i64 > , # [doc = "Optional. File path. Use https://api.telegram.org/file/bot<token>/<file_path> to get the file."] # [serde (skip_serializing_if = "Option::is_none" , rename = "file_path")] file_path : Option < String > } # [doc = "This object represents a file ready to be downloaded. The file can be downloaded via the link https://api.telegram.org/file/bot<token>/<file_path>. It is guaranteed that the link will be valid for at least 1 hour. When the link expires, a new one can be requested by calling getFile."] # [derive (Serialize , Deserialize , Debug)] pub struct FileBuilder { # [doc = "Identifier for this file, which can be used to download or reuse the file"] # [serde (rename = "file_id")] file_id : String , # [doc = "Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file."] # [serde (rename = "file_unique_id")] file_unique_id : String , # [doc = "Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value."] # [serde (skip_serializing_if = "Option::is_none" , rename = "file_size")] file_size : Option < i64 > , # [doc = "Optional. File path. Use https://api.telegram.org/file/bot<token>/<file_path> to get the file."] # [serde (skip_serializing_if = "Option::is_none" , rename = "file_path")] file_path : Option < String > } impl FileBuilder { pub fn new (file_id : String , file_unique_id : String) -> Self { Self { file_id , file_unique_id , file_size : None , file_path : None } } pub fn set_file_id (mut self , file_id : String) -> Self { self . file_id = file_id ; self } pub fn set_file_unique_id (mut self , file_unique_id : String) -> Self { self . file_unique_id = file_unique_id ; self } pub fn set_file_size (mut self , file_size : Option < i64 >) -> Self { self . file_size = file_size ; self } pub fn set_file_path (mut self , file_path : Option < String >) -> Self { self . file_path = file_path ; self } pub fn build (self) -> File { File { file_id : self . file_id , file_unique_id : self . file_unique_id , file_size : self . file_size , file_path : self . file_path } } } # [doc = "Upon receiving a message with this object, Telegram clients will display a reply interface to the user (act as if the user has selected the bot's message and tapped 'Reply'). This can be extremely useful if you want to create user-friendly step-by-step interfaces without having to sacrifice privacy mode."] # [derive (Serialize , Deserialize , Debug)] pub struct ForceReply { # [doc = "Shows reply interface to the user, as if they manually selected the bot's message and tapped 'Reply'"] # [serde (rename = "force_reply")] force_reply : bool , # [doc = "Optional. The placeholder to be shown in the input field when the reply is active; 1-64 characters"] # [serde (skip_serializing_if = "Option::is_none" , rename = "input_field_placeholder")] input_field_placeholder : Option < String > , # [doc = "Optional. Use this parameter if you want to force reply from specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply (has reply_to_message_id), sender of the original message."] # [serde (skip_serializing_if = "Option::is_none" , rename = "selective")] selective : Option < bool > } # [doc = "Upon receiving a message with this object, Telegram clients will display a reply interface to the user (act as if the user has selected the bot's message and tapped 'Reply'). This can be extremely useful if you want to create user-friendly step-by-step interfaces without having to sacrifice privacy mode."] # [derive (Serialize , Deserialize , Debug)] pub struct ForceReplyBuilder { # [doc = "Shows reply interface to the user, as if they manually selected the bot's message and tapped 'Reply'"] # [serde (rename = "force_reply")] force_reply : bool , # [doc = "Optional. The placeholder to be shown in the input field when the reply is active; 1-64 characters"] # [serde (skip_serializing_if = "Option::is_none" , rename = "input_field_placeholder")] input_field_placeholder : Option < String > , # [doc = "Optional. Use this parameter if you want to force reply from specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply (has reply_to_message_id), sender of the original message."] # [serde (skip_serializing_if = "Option::is_none" , rename = "selective")] selective : Option < bool > } impl ForceReplyBuilder { pub fn new (force_reply : bool) -> Self { Self { force_reply , input_field_placeholder : None , selective : None } } pub fn set_force_reply (mut self , force_reply : bool) -> Self { self . force_reply = force_reply ; self } pub fn set_input_field_placeholder (mut self , input_field_placeholder : Option < String >) -> Self { self . input_field_placeholder = input_field_placeholder ; self } pub fn set_selective (mut self , selective : Option < bool >) -> Self { self . selective = selective ; self } pub fn build (self) -> ForceReply { ForceReply { force_reply : self . force_reply , input_field_placeholder : self . input_field_placeholder , selective : self . selective } } } # [doc = "Represents an issue with one of the files that constitute the translation of a document. The error is considered resolved when the file changes."] # [derive (Serialize , Deserialize , Debug)] pub struct PassportElementErrorTranslationFile { # [doc = "Error source, must be translation_file"] # [serde (rename = "source")] source : String , # [doc = "Type of element of the user's Telegram Passport which has the issue, one of \"passport\", \"driver_license\", \"identity_card\", \"internal_passport\", \"utility_bill\", \"bank_statement\", \"rental_agreement\", \"passport_registration\", \"temporary_registration\""] # [serde (rename = "type")] tg_type : String , # [doc = "Base64-encoded file hash"] # [serde (rename = "file_hash")] file_hash : String , # [doc = "Error message"] # [serde (rename = "message")] message : String } # [doc = "Represents an issue with one of the files that constitute the translation of a document. The error is considered resolved when the file changes."] # [derive (Serialize , Deserialize , Debug)] pub struct PassportElementErrorTranslationFileBuilder { # [doc = "Error source, must be translation_file"] # [serde (rename = "source")] source : String , # [doc = "Type of element of the user's Telegram Passport which has the issue, one of \"passport\", \"driver_license\", \"identity_card\", \"internal_passport\", \"utility_bill\", \"bank_statement\", \"rental_agreement\", \"passport_registration\", \"temporary_registration\""] # [serde (rename = "type")] tg_type : String , # [doc = "Base64-encoded file hash"] # [serde (rename = "file_hash")] file_hash : String , # [doc = "Error message"] # [serde (rename = "message")] message : String } impl PassportElementErrorTranslationFileBuilder { pub fn new (source : String , file_hash : String , message : String) -> Self { Self { tg_type : "PassportElementErrorTranslationFile" . to_owned () , source , file_hash , message , } } pub fn set_source (mut self , source : String) -> Self { self . source = source ; self } pub fn set_type (mut self , tg_type : String) -> Self { self . tg_type = tg_type ; self } pub fn set_file_hash (mut self , file_hash : String) -> Self { self . file_hash = file_hash ; self } pub fn set_message (mut self , message : String) -> Self { self . message = message ; self } pub fn build (self) -> PassportElementErrorTranslationFile { PassportElementErrorTranslationFile { source : self . source , tg_type : self . tg_type , file_hash : self . file_hash , message : self . message } } } # [doc = "This object represents a service message about a video chat scheduled in the chat."] # [derive (Serialize , Deserialize , Debug)] pub struct VideoChatScheduled { # [doc = "Point in time (Unix timestamp) when the video chat is supposed to be started by a chat administrator"] # [serde (rename = "start_date")] start_date : i64 } # [doc = "This object represents a service message about a video chat scheduled in the chat."] # [derive (Serialize , Deserialize , Debug)] pub struct VideoChatScheduledBuilder { # [doc = "Point in time (Unix timestamp) when the video chat is supposed to be started by a chat administrator"] # [serde (rename = "start_date")] start_date : i64 } impl VideoChatScheduledBuilder { pub fn new (start_date : i64) -> Self { Self { start_date , } } pub fn set_start_date (mut self , start_date : i64) -> Self { self . start_date = start_date ; self } pub fn build (self) -> VideoChatScheduled { VideoChatScheduled { start_date : self . start_date } } } # [derive (Serialize , Deserialize , Debug)] # [serde (untagged)] pub enum BotCommandScope { BotCommandScopeDefault (BotCommandScopeDefault) , BotCommandScopeAllPrivateChats (BotCommandScopeAllPrivateChats) , BotCommandScopeAllGroupChats (BotCommandScopeAllGroupChats) , BotCommandScopeAllChatAdministrators (BotCommandScopeAllChatAdministrators) , BotCommandScopeChat (BotCommandScopeChat) , BotCommandScopeChatAdministrators (BotCommandScopeChatAdministrators) , BotCommandScopeChatMember (BotCommandScopeChatMember) } # [doc = "This object represents a sticker set."] # [derive (Serialize , Deserialize , Debug)] pub struct StickerSet { # [doc = "Sticker set name"] # [serde (rename = "name")] name : String , # [doc = "Sticker set title"] # [serde (rename = "title")] title : String , # [doc = "Type of stickers in the set, currently one of \"regular\", \"mask\", \"custom_emoji\""] # [serde (rename = "sticker_type")] sticker_type : String , # [doc = "True, if the sticker set contains animated stickers"] # [serde (rename = "is_animated")] is_animated : bool , # [doc = "True, if the sticker set contains video stickers"] # [serde (rename = "is_video")] is_video : bool , # [doc = "List of all set stickers"] # [serde (rename = "stickers")] stickers : Vec < Sticker > , # [doc = "Optional. Sticker set thumbnail in the .WEBP, .TGS, or .WEBM format"] # [serde (skip_serializing_if = "Option::is_none" , rename = "thumb")] thumb : Option < PhotoSize > } # [doc = "This object represents a sticker set."] # [derive (Serialize , Deserialize , Debug)] pub struct StickerSetBuilder { # [doc = "Sticker set name"] # [serde (rename = "name")] name : String , # [doc = "Sticker set title"] # [serde (rename = "title")] title : String , # [doc = "Type of stickers in the set, currently one of \"regular\", \"mask\", \"custom_emoji\""] # [serde (rename = "sticker_type")] sticker_type : String , # [doc = "True, if the sticker set contains animated stickers"] # [serde (rename = "is_animated")] is_animated : bool , # [doc = "True, if the sticker set contains video stickers"] # [serde (rename = "is_video")] is_video : bool , # [doc = "List of all set stickers"] # [serde (rename = "stickers")] stickers : Vec < Sticker > , # [doc = "Optional. Sticker set thumbnail in the .WEBP, .TGS, or .WEBM format"] # [serde (skip_serializing_if = "Option::is_none" , rename = "thumb")] thumb : Option < PhotoSize > } impl StickerSetBuilder { pub fn new (name : String , title : String , sticker_type : String , is_animated : bool , is_video : bool , stickers : Vec < Sticker >) -> Self { Self { name , title , sticker_type , is_animated , is_video , stickers , thumb : None } } pub fn set_name (mut self , name : String) -> Self { self . name = name ; self } pub fn set_title (mut self , title : String) -> Self { self . title = title ; self } pub fn set_sticker_type (mut self , sticker_type : String) -> Self { self . sticker_type = sticker_type ; self } pub fn set_is_animated (mut self , is_animated : bool) -> Self { self . is_animated = is_animated ; self } pub fn set_is_video (mut self , is_video : bool) -> Self { self . is_video = is_video ; self } pub fn set_stickers (mut self , stickers : Vec < Sticker >) -> Self { self . stickers = stickers ; self } pub fn set_thumb (mut self , thumb : Option < PhotoSize >) -> Self { self . thumb = thumb ; self } pub fn build (self) -> StickerSet { StickerSet { name : self . name , title : self . title , sticker_type : self . sticker_type , is_animated : self . is_animated , is_video : self . is_video , stickers : self . stickers , thumb : self . thumb } } } # [doc = "This object represents information about an order."] # [derive (Serialize , Deserialize , Debug)] pub struct OrderInfo { # [doc = "Optional. User name"] # [serde (skip_serializing_if = "Option::is_none" , rename = "name")] name : Option < String > , # [doc = "Optional. User's phone number"] # [serde (skip_serializing_if = "Option::is_none" , rename = "phone_number")] phone_number : Option < String > , # [doc = "Optional. User email"] # [serde (skip_serializing_if = "Option::is_none" , rename = "email")] email : Option < String > , # [doc = "Optional. User shipping address"] # [serde (skip_serializing_if = "Option::is_none" , rename = "shipping_address")] shipping_address : Option < ShippingAddress > } # [doc = "This object represents information about an order."] # [derive (Serialize , Deserialize , Debug)] pub struct OrderInfoBuilder { # [doc = "Optional. User name"] # [serde (skip_serializing_if = "Option::is_none" , rename = "name")] name : Option < String > , # [doc = "Optional. User's phone number"] # [serde (skip_serializing_if = "Option::is_none" , rename = "phone_number")] phone_number : Option < String > , # [doc = "Optional. User email"] # [serde (skip_serializing_if = "Option::is_none" , rename = "email")] email : Option < String > , # [doc = "Optional. User shipping address"] # [serde (skip_serializing_if = "Option::is_none" , rename = "shipping_address")] shipping_address : Option < ShippingAddress > } impl OrderInfoBuilder { pub fn new () -> Self { Self { name : None , phone_number : None , email : None , shipping_address : None } } pub fn set_name (mut self , name : Option < String >) -> Self { self . name = name ; self } pub fn set_phone_number (mut self , phone_number : Option < String >) -> Self { self . phone_number = phone_number ; self } pub fn set_email (mut self , email : Option < String >) -> Self { self . email = email ; self } pub fn set_shipping_address (mut self , shipping_address : Option < ShippingAddress >) -> Self { self . shipping_address = shipping_address ; self } pub fn build (self) -> OrderInfo { OrderInfo { name : self . name , phone_number : self . phone_number , email : self . email , shipping_address : self . shipping_address } } } # [doc = "This object represents an animated emoji that displays a random value."] # [derive (Serialize , Deserialize , Debug)] pub struct Dice { # [doc = "Emoji on which the dice throw animation is based"] # [serde (rename = "emoji")] emoji : String , # [doc = "Value of the dice, 1-6 for \"🎲\", \"🎯\" and \"🎳\" base emoji, 1-5 for \"🏀\" and \"⚽\" base emoji, 1-64 for \"🎰\" base emoji"] # [serde (rename = "value")] value : i64 } # [doc = "This object represents an animated emoji that displays a random value."] # [derive (Serialize , Deserialize , Debug)] pub struct DiceBuilder { # [doc = "Emoji on which the dice throw animation is based"] # [serde (rename = "emoji")] emoji : String , # [doc = "Value of the dice, 1-6 for \"🎲\", \"🎯\" and \"🎳\" base emoji, 1-5 for \"🏀\" and \"⚽\" base emoji, 1-64 for \"🎰\" base emoji"] # [serde (rename = "value")] value : i64 } impl DiceBuilder { pub fn new (emoji : String , value : i64) -> Self { Self { emoji , value , } } pub fn set_emoji (mut self , emoji : String) -> Self { self . emoji = emoji ; self } pub fn set_value (mut self , value : i64) -> Self { self . value = value ; self } pub fn build (self) -> Dice { Dice { emoji : self . emoji , value : self . value } } } # [doc = "Represents a location to which a chat is connected."] # [derive (Serialize , Deserialize , Debug)] pub struct ChatLocation { # [doc = "The location to which the supergroup is connected. Can't be a live location."] # [serde (rename = "location")] location : Location , # [doc = "Location address; 1-64 characters, as defined by the chat owner"] # [serde (rename = "address")] address : String } # [doc = "Represents a location to which a chat is connected."] # [derive (Serialize , Deserialize , Debug)] pub struct ChatLocationBuilder { # [doc = "The location to which the supergroup is connected. Can't be a live location."] # [serde (rename = "location")] location : Location , # [doc = "Location address; 1-64 characters, as defined by the chat owner"] # [serde (rename = "address")] address : String } impl ChatLocationBuilder { pub fn new (location : Location , address : String) -> Self { Self { location , address , } } pub fn set_location (mut self , location : Location) -> Self { self . location = location ; self } pub fn set_address (mut self , address : String) -> Self { self . address = address ; self } pub fn build (self) -> ChatLocation { ChatLocation { location : self . location , address : self . address } } } # [doc = "This object represents a Telegram user or bot."] # [derive (Serialize , Deserialize , Debug)] pub struct User { # [doc = "Unique identifier for this user or bot. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier."] # [serde (rename = "id")] id : i64 , # [doc = "True, if this user is a bot"] # [serde (rename = "is_bot")] is_bot : bool , # [doc = "User's or bot's first name"] # [serde (rename = "first_name")] first_name : String , # [doc = "Optional. User's or bot's last name"] # [serde (skip_serializing_if = "Option::is_none" , rename = "last_name")] last_name : Option < String > , # [doc = "Optional. User's or bot's username"] # [serde (skip_serializing_if = "Option::is_none" , rename = "username")] username : Option < String > , # [doc = "Optional. IETF language tag of the user's language"] # [serde (skip_serializing_if = "Option::is_none" , rename = "language_code")] language_code : Option < String > , # [doc = "Optional. True, if this user is a Telegram Premium user"] # [serde (skip_serializing_if = "Option::is_none" , rename = "is_premium")] is_premium : Option < bool > , # [doc = "Optional. True, if this user added the bot to the attachment menu"] # [serde (skip_serializing_if = "Option::is_none" , rename = "added_to_attachment_menu")] added_to_attachment_menu : Option < bool > , # [doc = "Optional. True, if the bot can be invited to groups. Returned only in getMe."] # [serde (skip_serializing_if = "Option::is_none" , rename = "can_join_groups")] can_join_groups : Option < bool > , # [doc = "Optional. True, if privacy mode is disabled for the bot. Returned only in getMe."] # [serde (skip_serializing_if = "Option::is_none" , rename = "can_read_all_group_messages")] can_read_all_group_messages : Option < bool > , # [doc = "Optional. True, if the bot supports inline queries. Returned only in getMe."] # [serde (skip_serializing_if = "Option::is_none" , rename = "supports_inline_queries")] supports_inline_queries : Option < bool > } # [doc = "This object represents a Telegram user or bot."] # [derive (Serialize , Deserialize , Debug)] pub struct UserBuilder { # [doc = "Unique identifier for this user or bot. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier."] # [serde (rename = "id")] id : i64 , # [doc = "True, if this user is a bot"] # [serde (rename = "is_bot")] is_bot : bool , # [doc = "User's or bot's first name"] # [serde (rename = "first_name")] first_name : String , # [doc = "Optional. User's or bot's last name"] # [serde (skip_serializing_if = "Option::is_none" , rename = "last_name")] last_name : Option < String > , # [doc = "Optional. User's or bot's username"] # [serde (skip_serializing_if = "Option::is_none" , rename = "username")] username : Option < String > , # [doc = "Optional. IETF language tag of the user's language"] # [serde (skip_serializing_if = "Option::is_none" , rename = "language_code")] language_code : Option < String > , # [doc = "Optional. True, if this user is a Telegram Premium user"] # [serde (skip_serializing_if = "Option::is_none" , rename = "is_premium")] is_premium : Option < bool > , # [doc = "Optional. True, if this user added the bot to the attachment menu"] # [serde (skip_serializing_if = "Option::is_none" , rename = "added_to_attachment_menu")] added_to_attachment_menu : Option < bool > , # [doc = "Optional. True, if the bot can be invited to groups. Returned only in getMe."] # [serde (skip_serializing_if = "Option::is_none" , rename = "can_join_groups")] can_join_groups : Option < bool > , # [doc = "Optional. True, if privacy mode is disabled for the bot. Returned only in getMe."] # [serde (skip_serializing_if = "Option::is_none" , rename = "can_read_all_group_messages")] can_read_all_group_messages : Option < bool > , # [doc = "Optional. True, if the bot supports inline queries. Returned only in getMe."] # [serde (skip_serializing_if = "Option::is_none" , rename = "supports_inline_queries")] supports_inline_queries : Option < bool > } impl UserBuilder { pub fn new (id : i64 , is_bot : bool , first_name : String) -> Self { Self { id , is_bot , first_name , last_name : None , username : None , language_code : None , is_premium : None , added_to_attachment_menu : None , can_join_groups : None , can_read_all_group_messages : None , supports_inline_queries : None } } pub fn set_id (mut self , id : i64) -> Self { self . id = id ; self } pub fn set_is_bot (mut self , is_bot : bool) -> Self { self . is_bot = is_bot ; self } pub fn set_first_name (mut self , first_name : String) -> Self { self . first_name = first_name ; self } pub fn set_last_name (mut self , last_name : Option < String >) -> Self { self . last_name = last_name ; self } pub fn set_username (mut self , username : Option < String >) -> Self { self . username = username ; self } pub fn set_language_code (mut self , language_code : Option < String >) -> Self { self . language_code = language_code ; self } pub fn set_is_premium (mut self , is_premium : Option < bool >) -> Self { self . is_premium = is_premium ; self } pub fn set_added_to_attachment_menu (mut self , added_to_attachment_menu : Option < bool >) -> Self { self . added_to_attachment_menu = added_to_attachment_menu ; self } pub fn set_can_join_groups (mut self , can_join_groups : Option < bool >) -> Self { self . can_join_groups = can_join_groups ; self } pub fn set_can_read_all_group_messages (mut self , can_read_all_group_messages : Option < bool >) -> Self { self . can_read_all_group_messages = can_read_all_group_messages ; self } pub fn set_supports_inline_queries (mut self , supports_inline_queries : Option < bool >) -> Self { self . supports_inline_queries = supports_inline_queries ; self } pub fn build (self) -> User { User { id : self . id , is_bot : self . is_bot , first_name : self . first_name , last_name : self . last_name , username : self . username , language_code : self . language_code , is_premium : self . is_premium , added_to_attachment_menu : self . added_to_attachment_menu , can_join_groups : self . can_join_groups , can_read_all_group_messages : self . can_read_all_group_messages , supports_inline_queries : self . supports_inline_queries } } } # [doc = "This object represents an incoming update.At most one of the optional parameters can be present in any given update."] # [derive (Serialize , Deserialize , Debug)] pub struct Update { # [doc = "The update's unique identifier. Update identifiers start from a certain positive number and increase sequentially. This ID becomes especially handy if you're using webhooks, since it allows you to ignore repeated updates or to restore the correct update sequence, should they get out of order. If there are no new updates for at least a week, then identifier of the next update will be chosen randomly instead of sequentially."] # [serde (rename = "update_id")] update_id : i64 , # [doc = "Optional. New incoming message of any kind - text, photo, sticker, etc."] # [serde (skip_serializing_if = "Option::is_none" , rename = "message")] message : Option < Box < Message > > , # [doc = "Optional. New version of a message that is known to the bot and was edited"] # [serde (skip_serializing_if = "Option::is_none" , rename = "edited_message")] edited_message : Option < Box < Message > > , # [doc = "Optional. New incoming channel post of any kind - text, photo, sticker, etc."] # [serde (skip_serializing_if = "Option::is_none" , rename = "channel_post")] channel_post : Option < Box < Message > > , # [doc = "Optional. New version of a channel post that is known to the bot and was edited"] # [serde (skip_serializing_if = "Option::is_none" , rename = "edited_channel_post")] edited_channel_post : Option < Box < Message > > , # [doc = "Optional. New incoming inline query"] # [serde (skip_serializing_if = "Option::is_none" , rename = "inline_query")] inline_query : Option < InlineQuery > , # [doc = "Optional. The result of an inline query that was chosen by a user and sent to their chat partner. Please see our documentation on the feedback collecting for details on how to enable these updates for your bot."] # [serde (skip_serializing_if = "Option::is_none" , rename = "chosen_inline_result")] chosen_inline_result : Option < ChosenInlineResult > , # [doc = "Optional. New incoming callback query"] # [serde (skip_serializing_if = "Option::is_none" , rename = "callback_query")] callback_query : Option < Box < CallbackQuery > > , # [doc = "Optional. New incoming shipping query. Only for invoices with flexible price"] # [serde (skip_serializing_if = "Option::is_none" , rename = "shipping_query")] shipping_query : Option < ShippingQuery > , # [doc = "Optional. New incoming pre-checkout query. Contains full information about checkout"] # [serde (skip_serializing_if = "Option::is_none" , rename = "pre_checkout_query")] pre_checkout_query : Option < PreCheckoutQuery > , # [doc = "Optional. New poll state. Bots receive only updates about stopped polls and polls, which are sent by the bot"] # [serde (skip_serializing_if = "Option::is_none" , rename = "poll")] poll : Option < Poll > , # [doc = "Optional. A user changed their answer in a non-anonymous poll. Bots receive new votes only in polls that were sent by the bot itself."] # [serde (skip_serializing_if = "Option::is_none" , rename = "poll_answer")] poll_answer : Option < PollAnswer > , # [doc = "Optional. The bot's chat member status was updated in a chat. For private chats, this update is received only when the bot is blocked or unblocked by the user."] # [serde (skip_serializing_if = "Option::is_none" , rename = "my_chat_member")] my_chat_member : Option < ChatMemberUpdated > , # [doc = "Optional. A chat member's status was updated in a chat. The bot must be an administrator in the chat and must explicitly specify \"chat_member\" in the list of allowed_updates to receive these updates."] # [serde (skip_serializing_if = "Option::is_none" , rename = "chat_member")] chat_member : Option < ChatMemberUpdated > , # [doc = "Optional. A request to join the chat has been sent. The bot must have the can_invite_users administrator right in the chat to receive these updates."] # [serde (skip_serializing_if = "Option::is_none" , rename = "chat_join_request")] chat_join_request : Option < ChatJoinRequest > } # [derive (Debug)] pub enum UpdateExt { Message (Box < Message >) , EditedMessage (Box < Message >) , ChannelPost (Box < Message >) , EditedChannelPost (Box < Message >) , InlineQuery (InlineQuery) , ChosenInlineResult (ChosenInlineResult) , CallbackQuery (Box < CallbackQuery >) , ShippingQuery (ShippingQuery) , PreCheckoutQuery (PreCheckoutQuery) , Poll (Poll) , PollAnswer (PollAnswer) , MyChatMember (ChatMemberUpdated) , ChatMember (ChatMemberUpdated) , ChatJoinRequest (ChatJoinRequest) , Invalid } impl From < Update > for UpdateExt { fn from (update : Update) -> Self { if let Some (thing) = update . message { return Self :: Message (thing) ; } if let Some (thing) = update . edited_message { return Self :: EditedMessage (thing) ; } if let Some (thing) = update . channel_post { return Self :: ChannelPost (thing) ; } if let Some (thing) = update . edited_channel_post { return Self :: EditedChannelPost (thing) ; } if let Some (thing) = update . inline_query { return Self :: InlineQuery (thing) ; } if let Some (thing) = update . chosen_inline_result { return Self :: ChosenInlineResult (thing) ; } if let Some (thing) = update . callback_query { return Self :: CallbackQuery (thing) ; } if let Some (thing) = update . shipping_query { return Self :: ShippingQuery (thing) ; } if let Some (thing) = update . pre_checkout_query { return Self :: PreCheckoutQuery (thing) ; } if let Some (thing) = update . poll { return Self :: Poll (thing) ; } if let Some (thing) = update . poll_answer { return Self :: PollAnswer (thing) ; } if let Some (thing) = update . my_chat_member { return Self :: MyChatMember (thing) ; } if let Some (thing) = update . chat_member { return Self :: ChatMember (thing) ; } if let Some (thing) = update . chat_join_request { return Self :: ChatJoinRequest (thing) ; } Self :: Invalid } } # [doc = "This object represents an incoming update.At most one of the optional parameters can be present in any given update."] # [derive (Serialize , Deserialize , Debug)] pub struct UpdateBuilder { # [doc = "The update's unique identifier. Update identifiers start from a certain positive number and increase sequentially. This ID becomes especially handy if you're using webhooks, since it allows you to ignore repeated updates or to restore the correct update sequence, should they get out of order. If there are no new updates for at least a week, then identifier of the next update will be chosen randomly instead of sequentially."] # [serde (rename = "update_id")] update_id : i64 , # [doc = "Optional. New incoming message of any kind - text, photo, sticker, etc."] # [serde (skip_serializing_if = "Option::is_none" , rename = "message")] message : Option < Box < Message > > , # [doc = "Optional. New version of a message that is known to the bot and was edited"] # [serde (skip_serializing_if = "Option::is_none" , rename = "edited_message")] edited_message : Option < Box < Message > > , # [doc = "Optional. New incoming channel post of any kind - text, photo, sticker, etc."] # [serde (skip_serializing_if = "Option::is_none" , rename = "channel_post")] channel_post : Option < Box < Message > > , # [doc = "Optional. New version of a channel post that is known to the bot and was edited"] # [serde (skip_serializing_if = "Option::is_none" , rename = "edited_channel_post")] edited_channel_post : Option < Box < Message > > , # [doc = "Optional. New incoming inline query"] # [serde (skip_serializing_if = "Option::is_none" , rename = "inline_query")] inline_query : Option < InlineQuery > , # [doc = "Optional. The result of an inline query that was chosen by a user and sent to their chat partner. Please see our documentation on the feedback collecting for details on how to enable these updates for your bot."] # [serde (skip_serializing_if = "Option::is_none" , rename = "chosen_inline_result")] chosen_inline_result : Option < ChosenInlineResult > , # [doc = "Optional. New incoming callback query"] # [serde (skip_serializing_if = "Option::is_none" , rename = "callback_query")] callback_query : Option < Box < CallbackQuery > > , # [doc = "Optional. New incoming shipping query. Only for invoices with flexible price"] # [serde (skip_serializing_if = "Option::is_none" , rename = "shipping_query")] shipping_query : Option < ShippingQuery > , # [doc = "Optional. New incoming pre-checkout query. Contains full information about checkout"] # [serde (skip_serializing_if = "Option::is_none" , rename = "pre_checkout_query")] pre_checkout_query : Option < PreCheckoutQuery > , # [doc = "Optional. New poll state. Bots receive only updates about stopped polls and polls, which are sent by the bot"] # [serde (skip_serializing_if = "Option::is_none" , rename = "poll")] poll : Option < Poll > , # [doc = "Optional. A user changed their answer in a non-anonymous poll. Bots receive new votes only in polls that were sent by the bot itself."] # [serde (skip_serializing_if = "Option::is_none" , rename = "poll_answer")] poll_answer : Option < PollAnswer > , # [doc = "Optional. The bot's chat member status was updated in a chat. For private chats, this update is received only when the bot is blocked or unblocked by the user."] # [serde (skip_serializing_if = "Option::is_none" , rename = "my_chat_member")] my_chat_member : Option < ChatMemberUpdated > , # [doc = "Optional. A chat member's status was updated in a chat. The bot must be an administrator in the chat and must explicitly specify \"chat_member\" in the list of allowed_updates to receive these updates."] # [serde (skip_serializing_if = "Option::is_none" , rename = "chat_member")] chat_member : Option < ChatMemberUpdated > , # [doc = "Optional. A request to join the chat has been sent. The bot must have the can_invite_users administrator right in the chat to receive these updates."] # [serde (skip_serializing_if = "Option::is_none" , rename = "chat_join_request")] chat_join_request : Option < ChatJoinRequest > } impl UpdateBuilder { pub fn new (update_id : i64) -> Self { Self { update_id , message : None , edited_message : None , channel_post : None , edited_channel_post : None , inline_query : None , chosen_inline_result : None , callback_query : None , shipping_query : None , pre_checkout_query : None , poll : None , poll_answer : None , my_chat_member : None , chat_member : None , chat_join_request : None } } pub fn set_update_id (mut self , update_id : i64) -> Self { self . update_id = update_id ; self } pub fn set_message (mut self , message : Option < Box < Message > >) -> Self { self . message = message ; self } pub fn set_edited_message (mut self , edited_message : Option < Box < Message > >) -> Self { self . edited_message = edited_message ; self } pub fn set_channel_post (mut self , channel_post : Option < Box < Message > >) -> Self { self . channel_post = channel_post ; self } pub fn set_edited_channel_post (mut self , edited_channel_post : Option < Box < Message > >) -> Self { self . edited_channel_post = edited_channel_post ; self } pub fn set_inline_query (mut self , inline_query : Option < InlineQuery >) -> Self { self . inline_query = inline_query ; self } pub fn set_chosen_inline_result (mut self , chosen_inline_result : Option < ChosenInlineResult >) -> Self { self . chosen_inline_result = chosen_inline_result ; self } pub fn set_callback_query (mut self , callback_query : Option < Box < CallbackQuery > >) -> Self { self . callback_query = callback_query ; self } pub fn set_shipping_query (mut self , shipping_query : Option < ShippingQuery >) -> Self { self . shipping_query = shipping_query ; self } pub fn set_pre_checkout_query (mut self , pre_checkout_query : Option < PreCheckoutQuery >) -> Self { self . pre_checkout_query = pre_checkout_query ; self } pub fn set_poll (mut self , poll : Option < Poll >) -> Self { self . poll = poll ; self } pub fn set_poll_answer (mut self , poll_answer : Option < PollAnswer >) -> Self { self . poll_answer = poll_answer ; self } pub fn set_my_chat_member (mut self , my_chat_member : Option < ChatMemberUpdated >) -> Self { self . my_chat_member = my_chat_member ; self } pub fn set_chat_member (mut self , chat_member : Option < ChatMemberUpdated >) -> Self { self . chat_member = chat_member ; self } pub fn set_chat_join_request (mut self , chat_join_request : Option < ChatJoinRequest >) -> Self { self . chat_join_request = chat_join_request ; self } pub fn build (self) -> Update { Update { update_id : self . update_id , message : self . message , edited_message : self . edited_message , channel_post : self . channel_post , edited_channel_post : self . edited_channel_post , inline_query : self . inline_query , chosen_inline_result : self . chosen_inline_result , callback_query : self . callback_query , shipping_query : self . shipping_query , pre_checkout_query : self . pre_checkout_query , poll : self . poll , poll_answer : self . poll_answer , my_chat_member : self . my_chat_member , chat_member : self . chat_member , chat_join_request : self . chat_join_request } } } # [doc = "This object represents a shipping address."] # [derive (Serialize , Deserialize , Debug)] pub struct ShippingAddress { # [doc = "Two-letter ISO 3166-1 alpha-2 country code"] # [serde (rename = "country_code")] country_code : String , # [doc = "State, if applicable"] # [serde (rename = "state")] state : String , # [doc = "City"] # [serde (rename = "city")] city : String , # [doc = "First line for the address"] # [serde (rename = "street_line1")] street_line_1 : String , # [doc = "Second line for the address"] # [serde (rename = "street_line2")] street_line_2 : String , # [doc = "Address post code"] # [serde (rename = "post_code")] post_code : String } # [doc = "This object represents a shipping address."] # [derive (Serialize , Deserialize , Debug)] pub struct ShippingAddressBuilder { # [doc = "Two-letter ISO 3166-1 alpha-2 country code"] # [serde (rename = "country_code")] country_code : String , # [doc = "State, if applicable"] # [serde (rename = "state")] state : String , # [doc = "City"] # [serde (rename = "city")] city : String , # [doc = "First line for the address"] # [serde (rename = "street_line1")] street_line_1 : String , # [doc = "Second line for the address"] # [serde (rename = "street_line2")] street_line_2 : String , # [doc = "Address post code"] # [serde (rename = "post_code")] post_code : String } impl ShippingAddressBuilder { pub fn new (country_code : String , state : String , city : String , street_line_1 : String , street_line_2 : String , post_code : String) -> Self { Self { country_code , state , city , street_line_1 , street_line_2 , post_code , } } pub fn set_country_code (mut self , country_code : String) -> Self { self . country_code = country_code ; self } pub fn set_state (mut self , state : String) -> Self { self . state = state ; self } pub fn set_city (mut self , city : String) -> Self { self . city = city ; self } pub fn set_street_line_1 (mut self , street_line_1 : String) -> Self { self . street_line_1 = street_line_1 ; self } pub fn set_street_line_2 (mut self , street_line_2 : String) -> Self { self . street_line_2 = street_line_2 ; self } pub fn set_post_code (mut self , post_code : String) -> Self { self . post_code = post_code ; self } pub fn build (self) -> ShippingAddress { ShippingAddress { country_code : self . country_code , state : self . state , city : self . city , street_line_1 : self . street_line_1 , street_line_2 : self . street_line_2 , post_code : self . post_code } } } # [doc = "Represents a link to a photo stored on the Telegram servers. By default, this photo will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the photo."] # [derive (Serialize , Deserialize , Debug)] pub struct InlineQueryResultCachedPhoto { # [doc = "Type of the result, must be photo"] # [serde (rename = "type")] tg_type : String , # [doc = "Unique identifier for this result, 1-64 bytes"] # [serde (rename = "id")] id : String , # [doc = "A valid file identifier of the photo"] # [serde (rename = "photo_file_id")] photo_file_id : String , # [doc = "Optional. Title for the result"] # [serde (skip_serializing_if = "Option::is_none" , rename = "title")] title : Option < String > , # [doc = "Optional. Short description of the result"] # [serde (skip_serializing_if = "Option::is_none" , rename = "description")] description : Option < String > , # [doc = "Optional. Caption of the photo to be sent, 0-1024 characters after entities parsing"] # [serde (skip_serializing_if = "Option::is_none" , rename = "caption")] caption : Option < String > , # [doc = "Optional. Mode for parsing entities in the photo caption. See formatting options for more details."] # [serde (skip_serializing_if = "Option::is_none" , rename = "parse_mode")] parse_mode : Option < String > , # [doc = "Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode"] # [serde (skip_serializing_if = "Option::is_none" , rename = "caption_entities")] caption_entities : Option < Vec < MessageEntity > > , # [doc = "Optional. Inline keyboard attached to the message"] # [serde (skip_serializing_if = "Option::is_none" , rename = "reply_markup")] reply_markup : Option < InlineKeyboardMarkup > , # [doc = "Optional. Content of the message to be sent instead of the photo"] # [serde (skip_serializing_if = "Option::is_none" , rename = "input_message_content")] input_message_content : Option < InputMessageContent > } # [doc = "Represents a link to a photo stored on the Telegram servers. By default, this photo will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the photo."] # [derive (Serialize , Deserialize , Debug)] pub struct InlineQueryResultCachedPhotoBuilder { # [doc = "Type of the result, must be photo"] # [serde (rename = "type")] tg_type : String , # [doc = "Unique identifier for this result, 1-64 bytes"] # [serde (rename = "id")] id : String , # [doc = "A valid file identifier of the photo"] # [serde (rename = "photo_file_id")] photo_file_id : String , # [doc = "Optional. Title for the result"] # [serde (skip_serializing_if = "Option::is_none" , rename = "title")] title : Option < String > , # [doc = "Optional. Short description of the result"] # [serde (skip_serializing_if = "Option::is_none" , rename = "description")] description : Option < String > , # [doc = "Optional. Caption of the photo to be sent, 0-1024 characters after entities parsing"] # [serde (skip_serializing_if = "Option::is_none" , rename = "caption")] caption : Option < String > , # [doc = "Optional. Mode for parsing entities in the photo caption. See formatting options for more details."] # [serde (skip_serializing_if = "Option::is_none" , rename = "parse_mode")] parse_mode : Option < String > , # [doc = "Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode"] # [serde (skip_serializing_if = "Option::is_none" , rename = "caption_entities")] caption_entities : Option < Vec < MessageEntity > > , # [doc = "Optional. Inline keyboard attached to the message"] # [serde (skip_serializing_if = "Option::is_none" , rename = "reply_markup")] reply_markup : Option < InlineKeyboardMarkup > , # [doc = "Optional. Content of the message to be sent instead of the photo"] # [serde (skip_serializing_if = "Option::is_none" , rename = "input_message_content")] input_message_content : Option < InputMessageContent > } impl InlineQueryResultCachedPhotoBuilder { pub fn new (id : String , photo_file_id : String) -> Self { Self { tg_type : "photo" . to_owned () , id , photo_file_id , title : None , description : None , caption : None , parse_mode : None , caption_entities : None , reply_markup : None , input_message_content : None } } pub fn set_type (mut self , tg_type : String) -> Self { self . tg_type = tg_type ; self } pub fn set_id (mut self , id : String) -> Self { self . id = id ; self } pub fn set_photo_file_id (mut self , photo_file_id : String) -> Self { self . photo_file_id = photo_file_id ; self } pub fn set_title (mut self , title : Option < String >) -> Self { self . title = title ; self } pub fn set_description (mut self , description : Option < String >) -> Self { self . description = description ; self } pub fn set_caption (mut self , caption : Option < String >) -> Self { self . caption = caption ; self } pub fn set_parse_mode (mut self , parse_mode : Option < String >) -> Self { self . parse_mode = parse_mode ; self } pub fn set_caption_entities (mut self , caption_entities : Option < Vec < MessageEntity > >) -> Self { self . caption_entities = caption_entities ; self } pub fn set_reply_markup (mut self , reply_markup : Option < InlineKeyboardMarkup >) -> Self { self . reply_markup = reply_markup ; self } pub fn set_input_message_content (mut self , input_message_content : Option < InputMessageContent >) -> Self { self . input_message_content = input_message_content ; self } pub fn build (self) -> InlineQueryResultCachedPhoto { InlineQueryResultCachedPhoto { tg_type : self . tg_type , id : self . id , photo_file_id : self . photo_file_id , title : self . title , description : self . description , caption : self . caption , parse_mode : self . parse_mode , caption_entities : self . caption_entities , reply_markup : self . reply_markup , input_message_content : self . input_message_content } } } # [doc = "This object represents a chat photo."] # [derive (Serialize , Deserialize , Debug)] pub struct ChatPhoto { # [doc = "File identifier of small (160x160) chat photo. This file_id can be used only for photo download and only for as long as the photo is not changed."] # [serde (rename = "small_file_id")] small_file_id : String , # [doc = "Unique file identifier of small (160x160) chat photo, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file."] # [serde (rename = "small_file_unique_id")] small_file_unique_id : String , # [doc = "File identifier of big (640x640) chat photo. This file_id can be used only for photo download and only for as long as the photo is not changed."] # [serde (rename = "big_file_id")] big_file_id : String , # [doc = "Unique file identifier of big (640x640) chat photo, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file."] # [serde (rename = "big_file_unique_id")] big_file_unique_id : String } # [doc = "This object represents a chat photo."] # [derive (Serialize , Deserialize , Debug)] pub struct ChatPhotoBuilder { # [doc = "File identifier of small (160x160) chat photo. This file_id can be used only for photo download and only for as long as the photo is not changed."] # [serde (rename = "small_file_id")] small_file_id : String , # [doc = "Unique file identifier of small (160x160) chat photo, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file."] # [serde (rename = "small_file_unique_id")] small_file_unique_id : String , # [doc = "File identifier of big (640x640) chat photo. This file_id can be used only for photo download and only for as long as the photo is not changed."] # [serde (rename = "big_file_id")] big_file_id : String , # [doc = "Unique file identifier of big (640x640) chat photo, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file."] # [serde (rename = "big_file_unique_id")] big_file_unique_id : String } impl ChatPhotoBuilder { pub fn new (small_file_id : String , small_file_unique_id : String , big_file_id : String , big_file_unique_id : String) -> Self { Self { small_file_id , small_file_unique_id , big_file_id , big_file_unique_id , } } pub fn set_small_file_id (mut self , small_file_id : String) -> Self { self . small_file_id = small_file_id ; self } pub fn set_small_file_unique_id (mut self , small_file_unique_id : String) -> Self { self . small_file_unique_id = small_file_unique_id ; self } pub fn set_big_file_id (mut self , big_file_id : String) -> Self { self . big_file_id = big_file_id ; self } pub fn set_big_file_unique_id (mut self , big_file_unique_id : String) -> Self { self . big_file_unique_id = big_file_unique_id ; self } pub fn build (self) -> ChatPhoto { ChatPhoto { small_file_id : self . small_file_id , small_file_unique_id : self . small_file_unique_id , big_file_id : self . big_file_id , big_file_unique_id : self . big_file_unique_id } } } # [doc = "Represents a general file to be sent."] # [derive (Serialize , Deserialize , Debug)] pub struct InputMediaDocument { # [doc = "Type of the result, must be document"] # [serde (rename = "type")] tg_type : String , # [doc = "File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass \"attach://<file_attach_name>\" to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files: https://core.telegram.org/bots/api#sending-files"] # [serde (rename = "media")] media : Option < InputFile > , # [doc = "Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass \"attach://<file_attach_name>\" if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files: https://core.telegram.org/bots/api#sending-files"] # [serde (skip_serializing_if = "Option::is_none" , rename = "thumb")] thumb : Option < InputFile > , # [doc = "Optional. Caption of the document to be sent, 0-1024 characters after entities parsing"] # [serde (skip_serializing_if = "Option::is_none" , rename = "caption")] caption : Option < String > , # [doc = "Optional. Mode for parsing entities in the document caption. See formatting options for more details."] # [serde (skip_serializing_if = "Option::is_none" , rename = "parse_mode")] parse_mode : Option < String > , # [doc = "Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode"] # [serde (skip_serializing_if = "Option::is_none" , rename = "caption_entities")] caption_entities : Option < Vec < MessageEntity > > , # [doc = "Optional. Disables automatic server-side content type detection for files uploaded using multipart/form-data. Always True, if the document is sent as part of an album."] # [serde (skip_serializing_if = "Option::is_none" , rename = "disable_content_type_detection")] disable_content_type_detection : Option < bool > } # [doc = "Represents a general file to be sent."] # [derive (Serialize , Deserialize , Debug)] pub struct InputMediaDocumentBuilder { # [doc = "Type of the result, must be document"] # [serde (rename = "type")] tg_type : String , # [doc = "File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass \"attach://<file_attach_name>\" to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files: https://core.telegram.org/bots/api#sending-files"] # [serde (rename = "media")] media : Option < InputFile > , # [doc = "Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass \"attach://<file_attach_name>\" if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files: https://core.telegram.org/bots/api#sending-files"] # [serde (skip_serializing_if = "Option::is_none" , rename = "thumb")] thumb : Option < InputFile > , # [doc = "Optional. Caption of the document to be sent, 0-1024 characters after entities parsing"] # [serde (skip_serializing_if = "Option::is_none" , rename = "caption")] caption : Option < String > , # [doc = "Optional. Mode for parsing entities in the document caption. See formatting options for more details."] # [serde (skip_serializing_if = "Option::is_none" , rename = "parse_mode")] parse_mode : Option < String > , # [doc = "Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode"] # [serde (skip_serializing_if = "Option::is_none" , rename = "caption_entities")] caption_entities : Option < Vec < MessageEntity > > , # [doc = "Optional. Disables automatic server-side content type detection for files uploaded using multipart/form-data. Always True, if the document is sent as part of an album."] # [serde (skip_serializing_if = "Option::is_none" , rename = "disable_content_type_detection")] disable_content_type_detection : Option < bool > } impl InputMediaDocumentBuilder { pub fn new (media : Option < InputFile >) -> Self { Self { tg_type : "document" . to_owned () , media , thumb : None , caption : None , parse_mode : None , caption_entities : None , disable_content_type_detection : None } } pub fn set_type (mut self , tg_type : String) -> Self { self . tg_type = tg_type ; self } pub fn set_media (mut self , media : Option < InputFile >) -> Self { self . media = media ; self } pub fn set_thumb (mut self , thumb : Option < InputFile >) -> Self { self . thumb = thumb ; self } pub fn set_caption (mut self , caption : Option < String >) -> Self { self . caption = caption ; self } pub fn set_parse_mode (mut self , parse_mode : Option < String >) -> Self { self . parse_mode = parse_mode ; self } pub fn set_caption_entities (mut self , caption_entities : Option < Vec < MessageEntity > >) -> Self { self . caption_entities = caption_entities ; self } pub fn set_disable_content_type_detection (mut self , disable_content_type_detection : Option < bool >) -> Self { self . disable_content_type_detection = disable_content_type_detection ; self } pub fn build (self) -> InputMediaDocument { InputMediaDocument { tg_type : self . tg_type , media : self . media , thumb : self . thumb , caption : self . caption , parse_mode : self . parse_mode , caption_entities : self . caption_entities , disable_content_type_detection : self . disable_content_type_detection } } } # [doc = "This object represents one size of a photo or a file / sticker thumbnail."] # [derive (Serialize , Deserialize , Debug)] pub struct PhotoSize { # [doc = "Identifier for this file, which can be used to download or reuse the file"] # [serde (rename = "file_id")] file_id : String , # [doc = "Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file."] # [serde (rename = "file_unique_id")] file_unique_id : String , # [doc = "Photo width"] # [serde (rename = "width")] width : i64 , # [doc = "Photo height"] # [serde (rename = "height")] height : i64 , # [doc = "Optional. File size in bytes"] # [serde (skip_serializing_if = "Option::is_none" , rename = "file_size")] file_size : Option < i64 > } # [doc = "This object represents one size of a photo or a file / sticker thumbnail."] # [derive (Serialize , Deserialize , Debug)] pub struct PhotoSizeBuilder { # [doc = "Identifier for this file, which can be used to download or reuse the file"] # [serde (rename = "file_id")] file_id : String , # [doc = "Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file."] # [serde (rename = "file_unique_id")] file_unique_id : String , # [doc = "Photo width"] # [serde (rename = "width")] width : i64 , # [doc = "Photo height"] # [serde (rename = "height")] height : i64 , # [doc = "Optional. File size in bytes"] # [serde (skip_serializing_if = "Option::is_none" , rename = "file_size")] file_size : Option < i64 > } impl PhotoSizeBuilder { pub fn new (file_id : String , file_unique_id : String , width : i64 , height : i64) -> Self { Self { file_id , file_unique_id , width , height , file_size : None } } pub fn set_file_id (mut self , file_id : String) -> Self { self . file_id = file_id ; self } pub fn set_file_unique_id (mut self , file_unique_id : String) -> Self { self . file_unique_id = file_unique_id ; self } pub fn set_width (mut self , width : i64) -> Self { self . width = width ; self } pub fn set_height (mut self , height : i64) -> Self { self . height = height ; self } pub fn set_file_size (mut self , file_size : Option < i64 >) -> Self { self . file_size = file_size ; self } pub fn build (self) -> PhotoSize { PhotoSize { file_id : self . file_id , file_unique_id : self . file_unique_id , width : self . width , height : self . height , file_size : self . file_size } } } # [doc = "This object represents a phone contact."] # [derive (Serialize , Deserialize , Debug)] pub struct Contact { # [doc = "Contact's phone number"] # [serde (rename = "phone_number")] phone_number : String , # [doc = "Contact's first name"] # [serde (rename = "first_name")] first_name : String , # [doc = "Optional. Contact's last name"] # [serde (skip_serializing_if = "Option::is_none" , rename = "last_name")] last_name : Option < String > , # [doc = "Optional. Contact's user identifier in Telegram. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier."] # [serde (skip_serializing_if = "Option::is_none" , rename = "user_id")] user_id : Option < i64 > , # [doc = "Optional. Additional data about the contact in the form of a vCard"] # [serde (skip_serializing_if = "Option::is_none" , rename = "vcard")] vcard : Option < String > } # [doc = "This object represents a phone contact."] # [derive (Serialize , Deserialize , Debug)] pub struct ContactBuilder { # [doc = "Contact's phone number"] # [serde (rename = "phone_number")] phone_number : String , # [doc = "Contact's first name"] # [serde (rename = "first_name")] first_name : String , # [doc = "Optional. Contact's last name"] # [serde (skip_serializing_if = "Option::is_none" , rename = "last_name")] last_name : Option < String > , # [doc = "Optional. Contact's user identifier in Telegram. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier."] # [serde (skip_serializing_if = "Option::is_none" , rename = "user_id")] user_id : Option < i64 > , # [doc = "Optional. Additional data about the contact in the form of a vCard"] # [serde (skip_serializing_if = "Option::is_none" , rename = "vcard")] vcard : Option < String > } impl ContactBuilder { pub fn new (phone_number : String , first_name : String) -> Self { Self { phone_number , first_name , last_name : None , user_id : None , vcard : None } } pub fn set_phone_number (mut self , phone_number : String) -> Self { self . phone_number = phone_number ; self } pub fn set_first_name (mut self , first_name : String) -> Self { self . first_name = first_name ; self } pub fn set_last_name (mut self , last_name : Option < String >) -> Self { self . last_name = last_name ; self } pub fn set_user_id (mut self , user_id : Option < i64 >) -> Self { self . user_id = user_id ; self } pub fn set_vcard (mut self , vcard : Option < String >) -> Self { self . vcard = vcard ; self } pub fn build (self) -> Contact { Contact { phone_number : self . phone_number , first_name : self . first_name , last_name : self . last_name , user_id : self . user_id , vcard : self . vcard } } } # [derive (Serialize , Deserialize , Debug)] # [serde (untagged)] pub enum InputMedia { InputMediaAnimation (InputMediaAnimation) , InputMediaDocument (InputMediaDocument) , InputMediaAudio (InputMediaAudio) , InputMediaPhoto (InputMediaPhoto) , InputMediaVideo (InputMediaVideo) } # [doc = "Represents a result of an inline query that was chosen by the user and sent to their chat partner.Note: It is necessary to enable inline feedback via @BotFather in order to receive these objects in updates."] # [derive (Serialize , Deserialize , Debug)] pub struct ChosenInlineResult { # [doc = "The unique identifier for the result that was chosen"] # [serde (rename = "result_id")] result_id : String , # [doc = "The user that chose the result"] # [serde (rename = "from")] from : User , # [doc = "Optional. Sender location, only for bots that require user location"] # [serde (skip_serializing_if = "Option::is_none" , rename = "location")] location : Option < Location > , # [doc = "Optional. Identifier of the sent inline message. Available only if there is an inline keyboard attached to the message. Will be also received in callback queries and can be used to edit the message."] # [serde (skip_serializing_if = "Option::is_none" , rename = "inline_message_id")] inline_message_id : Option < String > , # [doc = "The query that was used to obtain the result"] # [serde (rename = "query")] query : String } # [doc = "Represents a result of an inline query that was chosen by the user and sent to their chat partner.Note: It is necessary to enable inline feedback via @BotFather in order to receive these objects in updates."] # [derive (Serialize , Deserialize , Debug)] pub struct ChosenInlineResultBuilder { # [doc = "The unique identifier for the result that was chosen"] # [serde (rename = "result_id")] result_id : String , # [doc = "The user that chose the result"] # [serde (rename = "from")] from : User , # [doc = "Optional. Sender location, only for bots that require user location"] # [serde (skip_serializing_if = "Option::is_none" , rename = "location")] location : Option < Location > , # [doc = "Optional. Identifier of the sent inline message. Available only if there is an inline keyboard attached to the message. Will be also received in callback queries and can be used to edit the message."] # [serde (skip_serializing_if = "Option::is_none" , rename = "inline_message_id")] inline_message_id : Option < String > , # [doc = "The query that was used to obtain the result"] # [serde (rename = "query")] query : String } impl ChosenInlineResultBuilder { pub fn new (result_id : String , from : User , query : String) -> Self { Self { result_id , from , query , location : None , inline_message_id : None } } pub fn set_result_id (mut self , result_id : String) -> Self { self . result_id = result_id ; self } pub fn set_from (mut self , from : User) -> Self { self . from = from ; self } pub fn set_location (mut self , location : Option < Location >) -> Self { self . location = location ; self } pub fn set_inline_message_id (mut self , inline_message_id : Option < String >) -> Self { self . inline_message_id = inline_message_id ; self } pub fn set_query (mut self , query : String) -> Self { self . query = query ; self } pub fn build (self) -> ChosenInlineResult { ChosenInlineResult { result_id : self . result_id , from : self . from , location : self . location , inline_message_id : self . inline_message_id , query : self . query } } } # [doc = "Represents the content of a contact message to be sent as the result of an inline query."] # [derive (Serialize , Deserialize , Debug)] pub struct InputContactMessageContent { # [doc = "Contact's phone number"] # [serde (rename = "phone_number")] phone_number : String , # [doc = "Contact's first name"] # [serde (rename = "first_name")] first_name : String , # [doc = "Optional. Contact's last name"] # [serde (skip_serializing_if = "Option::is_none" , rename = "last_name")] last_name : Option < String > , # [doc = "Optional. Additional data about the contact in the form of a vCard, 0-2048 bytes"] # [serde (skip_serializing_if = "Option::is_none" , rename = "vcard")] vcard : Option < String > } # [doc = "Represents the content of a contact message to be sent as the result of an inline query."] # [derive (Serialize , Deserialize , Debug)] pub struct InputContactMessageContentBuilder { # [doc = "Contact's phone number"] # [serde (rename = "phone_number")] phone_number : String , # [doc = "Contact's first name"] # [serde (rename = "first_name")] first_name : String , # [doc = "Optional. Contact's last name"] # [serde (skip_serializing_if = "Option::is_none" , rename = "last_name")] last_name : Option < String > , # [doc = "Optional. Additional data about the contact in the form of a vCard, 0-2048 bytes"] # [serde (skip_serializing_if = "Option::is_none" , rename = "vcard")] vcard : Option < String > } impl InputContactMessageContentBuilder { pub fn new (phone_number : String , first_name : String) -> Self { Self { phone_number , first_name , last_name : None , vcard : None } } pub fn set_phone_number (mut self , phone_number : String) -> Self { self . phone_number = phone_number ; self } pub fn set_first_name (mut self , first_name : String) -> Self { self . first_name = first_name ; self } pub fn set_last_name (mut self , last_name : Option < String >) -> Self { self . last_name = last_name ; self } pub fn set_vcard (mut self , vcard : Option < String >) -> Self { self . vcard = vcard ; self } pub fn build (self) -> InputContactMessageContent { InputContactMessageContent { phone_number : self . phone_number , first_name : self . first_name , last_name : self . last_name , vcard : self . vcard } } } # [doc = "Represents a chat member that isn't currently a member of the chat, but may join it themselves."] # [derive (Serialize , Deserialize , Debug)] pub struct ChatMemberLeft { # [doc = "The member's status in the chat, always \"left\""] # [serde (rename = "status")] status : String , # [doc = "Information about the user"] # [serde (rename = "user")] user : User } # [doc = "Represents a chat member that isn't currently a member of the chat, but may join it themselves."] # [derive (Serialize , Deserialize , Debug)] pub struct ChatMemberLeftBuilder { # [doc = "The member's status in the chat, always \"left\""] # [serde (rename = "status")] status : String , # [doc = "Information about the user"] # [serde (rename = "user")] user : User } impl ChatMemberLeftBuilder { pub fn new (status : String , user : User) -> Self { Self { status , user , } } pub fn set_status (mut self , status : String) -> Self { self . status = status ; self } pub fn set_user (mut self , user : User) -> Self { self . user = user ; self } pub fn build (self) -> ChatMemberLeft { ChatMemberLeft { status : self . status , user : self . user } } } # [doc = "This object represents a sticker."] # [derive (Serialize , Deserialize , Debug)] pub struct Sticker { # [doc = "Identifier for this file, which can be used to download or reuse the file"] # [serde (rename = "file_id")] file_id : String , # [doc = "Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file."] # [serde (rename = "file_unique_id")] file_unique_id : String , # [doc = "Type of the sticker, currently one of \"regular\", \"mask\", \"custom_emoji\". The type of the sticker is independent from its format, which is determined by the fields is_animated and is_video."] # [serde (rename = "type")] tg_type : String , # [doc = "Sticker width"] # [serde (rename = "width")] width : i64 , # [doc = "Sticker height"] # [serde (rename = "height")] height : i64 , # [doc = "True, if the sticker is animated"] # [serde (rename = "is_animated")] is_animated : bool , # [doc = "True, if the sticker is a video sticker"] # [serde (rename = "is_video")] is_video : bool , # [doc = "Optional. Sticker thumbnail in the .WEBP or .JPG format"] # [serde (skip_serializing_if = "Option::is_none" , rename = "thumb")] thumb : Option < PhotoSize > , # [doc = "Optional. Emoji associated with the sticker"] # [serde (skip_serializing_if = "Option::is_none" , rename = "emoji")] emoji : Option < String > , # [doc = "Optional. Name of the sticker set to which the sticker belongs"] # [serde (skip_serializing_if = "Option::is_none" , rename = "set_name")] set_name : Option < String > , # [doc = "Optional. For premium regular stickers, premium animation for the sticker"] # [serde (skip_serializing_if = "Option::is_none" , rename = "premium_animation")] premium_animation : Option < File > , # [doc = "Optional. For mask stickers, the position where the mask should be placed"] # [serde (skip_serializing_if = "Option::is_none" , rename = "mask_position")] mask_position : Option < MaskPosition > , # [doc = "Optional. For custom emoji stickers, unique identifier of the custom emoji"] # [serde (skip_serializing_if = "Option::is_none" , rename = "custom_emoji_id")] custom_emoji_id : Option < String > , # [doc = "Optional. File size in bytes"] # [serde (skip_serializing_if = "Option::is_none" , rename = "file_size")] file_size : Option < i64 > } # [doc = "This object represents a sticker."] # [derive (Serialize , Deserialize , Debug)] pub struct StickerBuilder { # [doc = "Identifier for this file, which can be used to download or reuse the file"] # [serde (rename = "file_id")] file_id : String , # [doc = "Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file."] # [serde (rename = "file_unique_id")] file_unique_id : String , # [doc = "Type of the sticker, currently one of \"regular\", \"mask\", \"custom_emoji\". The type of the sticker is independent from its format, which is determined by the fields is_animated and is_video."] # [serde (rename = "type")] tg_type : String , # [doc = "Sticker width"] # [serde (rename = "width")] width : i64 , # [doc = "Sticker height"] # [serde (rename = "height")] height : i64 , # [doc = "True, if the sticker is animated"] # [serde (rename = "is_animated")] is_animated : bool , # [doc = "True, if the sticker is a video sticker"] # [serde (rename = "is_video")] is_video : bool , # [doc = "Optional. Sticker thumbnail in the .WEBP or .JPG format"] # [serde (skip_serializing_if = "Option::is_none" , rename = "thumb")] thumb : Option < PhotoSize > , # [doc = "Optional. Emoji associated with the sticker"] # [serde (skip_serializing_if = "Option::is_none" , rename = "emoji")] emoji : Option < String > , # [doc = "Optional. Name of the sticker set to which the sticker belongs"] # [serde (skip_serializing_if = "Option::is_none" , rename = "set_name")] set_name : Option < String > , # [doc = "Optional. For premium regular stickers, premium animation for the sticker"] # [serde (skip_serializing_if = "Option::is_none" , rename = "premium_animation")] premium_animation : Option < File > , # [doc = "Optional. For mask stickers, the position where the mask should be placed"] # [serde (skip_serializing_if = "Option::is_none" , rename = "mask_position")] mask_position : Option < MaskPosition > , # [doc = "Optional. For custom emoji stickers, unique identifier of the custom emoji"] # [serde (skip_serializing_if = "Option::is_none" , rename = "custom_emoji_id")] custom_emoji_id : Option < String > , # [doc = "Optional. File size in bytes"] # [serde (skip_serializing_if = "Option::is_none" , rename = "file_size")] file_size : Option < i64 > } impl StickerBuilder { pub fn new (file_id : String , file_unique_id : String , width : i64 , height : i64 , is_animated : bool , is_video : bool) -> Self { Self { tg_type : "Sticker" . to_owned () , file_id , file_unique_id , width , height , is_animated , is_video , thumb : None , emoji : None , set_name : None , premium_animation : None , mask_position : None , custom_emoji_id : None , file_size : None } } pub fn set_file_id (mut self , file_id : String) -> Self { self . file_id = file_id ; self } pub fn set_file_unique_id (mut self , file_unique_id : String) -> Self { self . file_unique_id = file_unique_id ; self } pub fn set_type (mut self , tg_type : String) -> Self { self . tg_type = tg_type ; self } pub fn set_width (mut self , width : i64) -> Self { self . width = width ; self } pub fn set_height (mut self , height : i64) -> Self { self . height = height ; self } pub fn set_is_animated (mut self , is_animated : bool) -> Self { self . is_animated = is_animated ; self } pub fn set_is_video (mut self , is_video : bool) -> Self { self . is_video = is_video ; self } pub fn set_thumb (mut self , thumb : Option < PhotoSize >) -> Self { self . thumb = thumb ; self } pub fn set_emoji (mut self , emoji : Option < String >) -> Self { self . emoji = emoji ; self } pub fn set_set_name (mut self , set_name : Option < String >) -> Self { self . set_name = set_name ; self } pub fn set_premium_animation (mut self , premium_animation : Option < File >) -> Self { self . premium_animation = premium_animation ; self } pub fn set_mask_position (mut self , mask_position : Option < MaskPosition >) -> Self { self . mask_position = mask_position ; self } pub fn set_custom_emoji_id (mut self , custom_emoji_id : Option < String >) -> Self { self . custom_emoji_id = custom_emoji_id ; self } pub fn set_file_size (mut self , file_size : Option < i64 >) -> Self { self . file_size = file_size ; self } pub fn build (self) -> Sticker { Sticker { file_id : self . file_id , file_unique_id : self . file_unique_id , tg_type : self . tg_type , width : self . width , height : self . height , is_animated : self . is_animated , is_video : self . is_video , thumb : self . thumb , emoji : self . emoji , set_name : self . set_name , premium_animation : self . premium_animation , mask_position : self . mask_position , custom_emoji_id : self . custom_emoji_id , file_size : self . file_size } } } # [doc = "Represents a link to an animated GIF file stored on the Telegram servers. By default, this animated GIF file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with specified content instead of the animation."] # [derive (Serialize , Deserialize , Debug)] pub struct InlineQueryResultCachedGif { # [doc = "Type of the result, must be gif"] # [serde (rename = "type")] tg_type : String , # [doc = "Unique identifier for this result, 1-64 bytes"] # [serde (rename = "id")] id : String , # [doc = "A valid file identifier for the GIF file"] # [serde (rename = "gif_file_id")] gif_file_id : String , # [doc = "Optional. Title for the result"] # [serde (skip_serializing_if = "Option::is_none" , rename = "title")] title : Option < String > , # [doc = "Optional. Caption of the GIF file to be sent, 0-1024 characters after entities parsing"] # [serde (skip_serializing_if = "Option::is_none" , rename = "caption")] caption : Option < String > , # [doc = "Optional. Mode for parsing entities in the caption. See formatting options for more details."] # [serde (skip_serializing_if = "Option::is_none" , rename = "parse_mode")] parse_mode : Option < String > , # [doc = "Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode"] # [serde (skip_serializing_if = "Option::is_none" , rename = "caption_entities")] caption_entities : Option < Vec < MessageEntity > > , # [doc = "Optional. Inline keyboard attached to the message"] # [serde (skip_serializing_if = "Option::is_none" , rename = "reply_markup")] reply_markup : Option < InlineKeyboardMarkup > , # [doc = "Optional. Content of the message to be sent instead of the GIF animation"] # [serde (skip_serializing_if = "Option::is_none" , rename = "input_message_content")] input_message_content : Option < InputMessageContent > } # [doc = "Represents a link to an animated GIF file stored on the Telegram servers. By default, this animated GIF file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with specified content instead of the animation."] # [derive (Serialize , Deserialize , Debug)] pub struct InlineQueryResultCachedGifBuilder { # [doc = "Type of the result, must be gif"] # [serde (rename = "type")] tg_type : String , # [doc = "Unique identifier for this result, 1-64 bytes"] # [serde (rename = "id")] id : String , # [doc = "A valid file identifier for the GIF file"] # [serde (rename = "gif_file_id")] gif_file_id : String , # [doc = "Optional. Title for the result"] # [serde (skip_serializing_if = "Option::is_none" , rename = "title")] title : Option < String > , # [doc = "Optional. Caption of the GIF file to be sent, 0-1024 characters after entities parsing"] # [serde (skip_serializing_if = "Option::is_none" , rename = "caption")] caption : Option < String > , # [doc = "Optional. Mode for parsing entities in the caption. See formatting options for more details."] # [serde (skip_serializing_if = "Option::is_none" , rename = "parse_mode")] parse_mode : Option < String > , # [doc = "Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode"] # [serde (skip_serializing_if = "Option::is_none" , rename = "caption_entities")] caption_entities : Option < Vec < MessageEntity > > , # [doc = "Optional. Inline keyboard attached to the message"] # [serde (skip_serializing_if = "Option::is_none" , rename = "reply_markup")] reply_markup : Option < InlineKeyboardMarkup > , # [doc = "Optional. Content of the message to be sent instead of the GIF animation"] # [serde (skip_serializing_if = "Option::is_none" , rename = "input_message_content")] input_message_content : Option < InputMessageContent > } impl InlineQueryResultCachedGifBuilder { pub fn new (id : String , gif_file_id : String) -> Self { Self { tg_type : "gif" . to_owned () , id , gif_file_id , title : None , caption : None , parse_mode : None , caption_entities : None , reply_markup : None , input_message_content : None } } pub fn set_type (mut self , tg_type : String) -> Self { self . tg_type = tg_type ; self } pub fn set_id (mut self , id : String) -> Self { self . id = id ; self } pub fn set_gif_file_id (mut self , gif_file_id : String) -> Self { self . gif_file_id = gif_file_id ; self } pub fn set_title (mut self , title : Option < String >) -> Self { self . title = title ; self } pub fn set_caption (mut self , caption : Option < String >) -> Self { self . caption = caption ; self } pub fn set_parse_mode (mut self , parse_mode : Option < String >) -> Self { self . parse_mode = parse_mode ; self } pub fn set_caption_entities (mut self , caption_entities : Option < Vec < MessageEntity > >) -> Self { self . caption_entities = caption_entities ; self } pub fn set_reply_markup (mut self , reply_markup : Option < InlineKeyboardMarkup >) -> Self { self . reply_markup = reply_markup ; self } pub fn set_input_message_content (mut self , input_message_content : Option < InputMessageContent >) -> Self { self . input_message_content = input_message_content ; self } pub fn build (self) -> InlineQueryResultCachedGif { InlineQueryResultCachedGif { tg_type : self . tg_type , id : self . id , gif_file_id : self . gif_file_id , title : self . title , caption : self . caption , parse_mode : self . parse_mode , caption_entities : self . caption_entities , reply_markup : self . reply_markup , input_message_content : self . input_message_content } } } # [doc = "This object represents one button of an inline keyboard. You must use exactly one of the optional fields."] # [derive (Serialize , Deserialize , Debug)] pub struct InlineKeyboardButton { # [doc = "Label text on the button"] # [serde (rename = "text")] text : String , # [doc = "Optional. HTTP or tg:// URL to be opened when the button is pressed. Links tg://user?id=<user_id> can be used to mention a user by their ID without using a username, if this is allowed by their privacy settings."] # [serde (skip_serializing_if = "Option::is_none" , rename = "url")] url : Option < String > , # [doc = "Optional. Data to be sent in a callback query to the bot when button is pressed, 1-64 bytes"] # [serde (skip_serializing_if = "Option::is_none" , rename = "callback_data")] callback_data : Option < String > , # [doc = "Optional. Description of the Web App that will be launched when the user presses the button. The Web App will be able to send an arbitrary message on behalf of the user using the method answerWebAppQuery. Available only in private chats between a user and the bot."] # [serde (skip_serializing_if = "Option::is_none" , rename = "web_app")] web_app : Option < WebAppInfo > , # [doc = "Optional. An HTTPS URL used to automatically authorize the user. Can be used as a replacement for the Telegram Login Widget."] # [serde (skip_serializing_if = "Option::is_none" , rename = "login_url")] login_url : Option < LoginUrl > , # [doc = "Optional. If set, pressing the button will prompt the user to select one of their chats, open that chat and insert the bot's username and the specified inline query in the input field. May be empty, in which case just the bot's username will be inserted. Note: This offers an easy way for users to start using your bot in inline mode when they are currently in a private chat with it. Especially useful when combined with switch_pm... actions - in this case the user will be automatically returned to the chat they switched from, skipping the chat selection screen."] # [serde (skip_serializing_if = "Option::is_none" , rename = "switch_inline_query")] switch_inline_query : Option < String > , # [doc = "Optional. If set, pressing the button will insert the bot's username and the specified inline query in the current chat's input field. May be empty, in which case only the bot's username will be inserted. This offers a quick way for the user to open your bot in inline mode in the same chat - good for selecting something from multiple options."] # [serde (skip_serializing_if = "Option::is_none" , rename = "switch_inline_query_current_chat")] switch_inline_query_current_chat : Option < String > , # [doc = "Optional. Description of the game that will be launched when the user presses the button. NOTE: This type of button must always be the first button in the first row."] # [serde (skip_serializing_if = "Option::is_none" , rename = "callback_game")] callback_game : Option < CallbackGame > , # [doc = "Optional. Specify True, to send a Pay button. NOTE: This type of button must always be the first button in the first row and can only be used in invoice messages."] # [serde (skip_serializing_if = "Option::is_none" , rename = "pay")] pay : Option < bool > } # [doc = "This object represents one button of an inline keyboard. You must use exactly one of the optional fields."] # [derive (Serialize , Deserialize , Debug)] pub struct InlineKeyboardButtonBuilder { # [doc = "Label text on the button"] # [serde (rename = "text")] text : String , # [doc = "Optional. HTTP or tg:// URL to be opened when the button is pressed. Links tg://user?id=<user_id> can be used to mention a user by their ID without using a username, if this is allowed by their privacy settings."] # [serde (skip_serializing_if = "Option::is_none" , rename = "url")] url : Option < String > , # [doc = "Optional. Data to be sent in a callback query to the bot when button is pressed, 1-64 bytes"] # [serde (skip_serializing_if = "Option::is_none" , rename = "callback_data")] callback_data : Option < String > , # [doc = "Optional. Description of the Web App that will be launched when the user presses the button. The Web App will be able to send an arbitrary message on behalf of the user using the method answerWebAppQuery. Available only in private chats between a user and the bot."] # [serde (skip_serializing_if = "Option::is_none" , rename = "web_app")] web_app : Option < WebAppInfo > , # [doc = "Optional. An HTTPS URL used to automatically authorize the user. Can be used as a replacement for the Telegram Login Widget."] # [serde (skip_serializing_if = "Option::is_none" , rename = "login_url")] login_url : Option < LoginUrl > , # [doc = "Optional. If set, pressing the button will prompt the user to select one of their chats, open that chat and insert the bot's username and the specified inline query in the input field. May be empty, in which case just the bot's username will be inserted. Note: This offers an easy way for users to start using your bot in inline mode when they are currently in a private chat with it. Especially useful when combined with switch_pm... actions - in this case the user will be automatically returned to the chat they switched from, skipping the chat selection screen."] # [serde (skip_serializing_if = "Option::is_none" , rename = "switch_inline_query")] switch_inline_query : Option < String > , # [doc = "Optional. If set, pressing the button will insert the bot's username and the specified inline query in the current chat's input field. May be empty, in which case only the bot's username will be inserted. This offers a quick way for the user to open your bot in inline mode in the same chat - good for selecting something from multiple options."] # [serde (skip_serializing_if = "Option::is_none" , rename = "switch_inline_query_current_chat")] switch_inline_query_current_chat : Option < String > , # [doc = "Optional. Description of the game that will be launched when the user presses the button. NOTE: This type of button must always be the first button in the first row."] # [serde (skip_serializing_if = "Option::is_none" , rename = "callback_game")] callback_game : Option < CallbackGame > , # [doc = "Optional. Specify True, to send a Pay button. NOTE: This type of button must always be the first button in the first row and can only be used in invoice messages."] # [serde (skip_serializing_if = "Option::is_none" , rename = "pay")] pay : Option < bool > } impl InlineKeyboardButtonBuilder { pub fn new (text : String) -> Self { Self { text , url : None , callback_data : None , web_app : None , login_url : None , switch_inline_query : None , switch_inline_query_current_chat : None , callback_game : None , pay : None } } pub fn set_text (mut self , text : String) -> Self { self . text = text ; self } pub fn set_url (mut self , url : Option < String >) -> Self { self . url = url ; self } pub fn set_callback_data (mut self , callback_data : Option < String >) -> Self { self . callback_data = callback_data ; self } pub fn set_web_app (mut self , web_app : Option < WebAppInfo >) -> Self { self . web_app = web_app ; self } pub fn set_login_url (mut self , login_url : Option < LoginUrl >) -> Self { self . login_url = login_url ; self } pub fn set_switch_inline_query (mut self , switch_inline_query : Option < String >) -> Self { self . switch_inline_query = switch_inline_query ; self } pub fn set_switch_inline_query_current_chat (mut self , switch_inline_query_current_chat : Option < String >) -> Self { self . switch_inline_query_current_chat = switch_inline_query_current_chat ; self } pub fn set_callback_game (mut self , callback_game : Option < CallbackGame >) -> Self { self . callback_game = callback_game ; self } pub fn set_pay (mut self , pay : Option < bool >) -> Self { self . pay = pay ; self } pub fn build (self) -> InlineKeyboardButton { InlineKeyboardButton { text : self . text , url : self . url , callback_data : self . callback_data , web_app : self . web_app , login_url : self . login_url , switch_inline_query : self . switch_inline_query , switch_inline_query_current_chat : self . switch_inline_query_current_chat , callback_game : self . callback_game , pay : self . pay } } } # [doc = "This object represents an incoming inline query. When the user sends an empty query, your bot could return some default or trending results."] # [derive (Serialize , Deserialize , Debug)] pub struct InlineQuery { # [doc = "Unique identifier for this query"] # [serde (rename = "id")] id : String , # [doc = "Sender"] # [serde (rename = "from")] from : User , # [doc = "Text of the query (up to 256 characters)"] # [serde (rename = "query")] query : String , # [doc = "Offset of the results to be returned, can be controlled by the bot"] # [serde (rename = "offset")] offset : String , # [doc = "Optional. Type of the chat from which the inline query was sent. Can be either \"sender\" for a private chat with the inline query sender, \"private\", \"group\", \"supergroup\", or \"channel\". The chat type should be always known for requests sent from official clients and most third-party clients, unless the request was sent from a secret chat"] # [serde (skip_serializing_if = "Option::is_none" , rename = "chat_type")] chat_type : Option < String > , # [doc = "Optional. Sender location, only for bots that request user location"] # [serde (skip_serializing_if = "Option::is_none" , rename = "location")] location : Option < Location > } # [doc = "This object represents an incoming inline query. When the user sends an empty query, your bot could return some default or trending results."] # [derive (Serialize , Deserialize , Debug)] pub struct InlineQueryBuilder { # [doc = "Unique identifier for this query"] # [serde (rename = "id")] id : String , # [doc = "Sender"] # [serde (rename = "from")] from : User , # [doc = "Text of the query (up to 256 characters)"] # [serde (rename = "query")] query : String , # [doc = "Offset of the results to be returned, can be controlled by the bot"] # [serde (rename = "offset")] offset : String , # [doc = "Optional. Type of the chat from which the inline query was sent. Can be either \"sender\" for a private chat with the inline query sender, \"private\", \"group\", \"supergroup\", or \"channel\". The chat type should be always known for requests sent from official clients and most third-party clients, unless the request was sent from a secret chat"] # [serde (skip_serializing_if = "Option::is_none" , rename = "chat_type")] chat_type : Option < String > , # [doc = "Optional. Sender location, only for bots that request user location"] # [serde (skip_serializing_if = "Option::is_none" , rename = "location")] location : Option < Location > } impl InlineQueryBuilder { pub fn new (id : String , from : User , query : String , offset : String) -> Self { Self { id , from , query , offset , chat_type : None , location : None } } pub fn set_id (mut self , id : String) -> Self { self . id = id ; self } pub fn set_from (mut self , from : User) -> Self { self . from = from ; self } pub fn set_query (mut self , query : String) -> Self { self . query = query ; self } pub fn set_offset (mut self , offset : String) -> Self { self . offset = offset ; self } pub fn set_chat_type (mut self , chat_type : Option < String >) -> Self { self . chat_type = chat_type ; self } pub fn set_location (mut self , location : Option < Location >) -> Self { self . location = location ; self } pub fn build (self) -> InlineQuery { InlineQuery { id : self . id , from : self . from , query : self . query , offset : self . offset , chat_type : self . chat_type , location : self . location } } } # [doc = "This object represents a unique message identifier."] # [derive (Serialize , Deserialize , Debug)] pub struct MessageId { # [doc = "Unique message identifier"] # [serde (rename = "message_id")] message_id : i64 } # [doc = "This object represents a unique message identifier."] # [derive (Serialize , Deserialize , Debug)] pub struct MessageIdBuilder { # [doc = "Unique message identifier"] # [serde (rename = "message_id")] message_id : i64 } impl MessageIdBuilder { pub fn new (message_id : i64) -> Self { Self { message_id , } } pub fn set_message_id (mut self , message_id : i64) -> Self { self . message_id = message_id ; self } pub fn build (self) -> MessageId { MessageId { message_id : self . message_id } } } # [doc = "Represents the scope of bot commands, covering a specific member of a group or supergroup chat."] # [derive (Serialize , Deserialize , Debug)] pub struct BotCommandScopeChatMember { # [doc = "Scope type, must be chat_member"] # [serde (rename = "type")] tg_type : String , # [doc = "Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)"] # [serde (rename = "chat_id")] chat_id : i64 , # [doc = "Unique identifier of the target user"] # [serde (rename = "user_id")] user_id : i64 } # [doc = "Represents the scope of bot commands, covering a specific member of a group or supergroup chat."] # [derive (Serialize , Deserialize , Debug)] pub struct BotCommandScopeChatMemberBuilder { # [doc = "Scope type, must be chat_member"] # [serde (rename = "type")] tg_type : String , # [doc = "Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)"] # [serde (rename = "chat_id")] chat_id : i64 , # [doc = "Unique identifier of the target user"] # [serde (rename = "user_id")] user_id : i64 } impl BotCommandScopeChatMemberBuilder { pub fn new (chat_id : i64 , user_id : i64) -> Self { Self { tg_type : "chat_member" . to_owned () , chat_id , user_id , } } pub fn set_type (mut self , tg_type : String) -> Self { self . tg_type = tg_type ; self } pub fn set_chat_id (mut self , chat_id : i64) -> Self { self . chat_id = chat_id ; self } pub fn set_user_id (mut self , user_id : i64) -> Self { self . user_id = user_id ; self } pub fn build (self) -> BotCommandScopeChatMember { BotCommandScopeChatMember { tg_type : self . tg_type , chat_id : self . chat_id , user_id : self . user_id } } } # [doc = "Represents an animation file (GIF or H.264/MPEG-4 AVC video without sound) to be sent."] # [derive (Serialize , Deserialize , Debug)] pub struct InputMediaAnimation { # [doc = "Type of the result, must be animation"] # [serde (rename = "type")] tg_type : String , # [doc = "File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass \"attach://<file_attach_name>\" to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files: https://core.telegram.org/bots/api#sending-files"] # [serde (rename = "media")] media : Option < InputFile > , # [doc = "Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass \"attach://<file_attach_name>\" if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files: https://core.telegram.org/bots/api#sending-files"] # [serde (skip_serializing_if = "Option::is_none" , rename = "thumb")] thumb : Option < InputFile > , # [doc = "Optional. Caption of the animation to be sent, 0-1024 characters after entities parsing"] # [serde (skip_serializing_if = "Option::is_none" , rename = "caption")] caption : Option < String > , # [doc = "Optional. Mode for parsing entities in the animation caption. See formatting options for more details."] # [serde (skip_serializing_if = "Option::is_none" , rename = "parse_mode")] parse_mode : Option < String > , # [doc = "Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode"] # [serde (skip_serializing_if = "Option::is_none" , rename = "caption_entities")] caption_entities : Option < Vec < MessageEntity > > , # [doc = "Optional. Animation width"] # [serde (skip_serializing_if = "Option::is_none" , rename = "width")] width : Option < i64 > , # [doc = "Optional. Animation height"] # [serde (skip_serializing_if = "Option::is_none" , rename = "height")] height : Option < i64 > , # [doc = "Optional. Animation duration in seconds"] # [serde (skip_serializing_if = "Option::is_none" , rename = "duration")] duration : Option < i64 > } # [doc = "Represents an animation file (GIF or H.264/MPEG-4 AVC video without sound) to be sent."] # [derive (Serialize , Deserialize , Debug)] pub struct InputMediaAnimationBuilder { # [doc = "Type of the result, must be animation"] # [serde (rename = "type")] tg_type : String , # [doc = "File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass \"attach://<file_attach_name>\" to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files: https://core.telegram.org/bots/api#sending-files"] # [serde (rename = "media")] media : Option < InputFile > , # [doc = "Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass \"attach://<file_attach_name>\" if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files: https://core.telegram.org/bots/api#sending-files"] # [serde (skip_serializing_if = "Option::is_none" , rename = "thumb")] thumb : Option < InputFile > , # [doc = "Optional. Caption of the animation to be sent, 0-1024 characters after entities parsing"] # [serde (skip_serializing_if = "Option::is_none" , rename = "caption")] caption : Option < String > , # [doc = "Optional. Mode for parsing entities in the animation caption. See formatting options for more details."] # [serde (skip_serializing_if = "Option::is_none" , rename = "parse_mode")] parse_mode : Option < String > , # [doc = "Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode"] # [serde (skip_serializing_if = "Option::is_none" , rename = "caption_entities")] caption_entities : Option < Vec < MessageEntity > > , # [doc = "Optional. Animation width"] # [serde (skip_serializing_if = "Option::is_none" , rename = "width")] width : Option < i64 > , # [doc = "Optional. Animation height"] # [serde (skip_serializing_if = "Option::is_none" , rename = "height")] height : Option < i64 > , # [doc = "Optional. Animation duration in seconds"] # [serde (skip_serializing_if = "Option::is_none" , rename = "duration")] duration : Option < i64 > } impl InputMediaAnimationBuilder { pub fn new (media : Option < InputFile >) -> Self { Self { tg_type : "animation" . to_owned () , media , thumb : None , caption : None , parse_mode : None , caption_entities : None , width : None , height : None , duration : None } } pub fn set_type (mut self , tg_type : String) -> Self { self . tg_type = tg_type ; self } pub fn set_media (mut self , media : Option < InputFile >) -> Self { self . media = media ; self } pub fn set_thumb (mut self , thumb : Option < InputFile >) -> Self { self . thumb = thumb ; self } pub fn set_caption (mut self , caption : Option < String >) -> Self { self . caption = caption ; self } pub fn set_parse_mode (mut self , parse_mode : Option < String >) -> Self { self . parse_mode = parse_mode ; self } pub fn set_caption_entities (mut self , caption_entities : Option < Vec < MessageEntity > >) -> Self { self . caption_entities = caption_entities ; self } pub fn set_width (mut self , width : Option < i64 >) -> Self { self . width = width ; self } pub fn set_height (mut self , height : Option < i64 >) -> Self { self . height = height ; self } pub fn set_duration (mut self , duration : Option < i64 >) -> Self { self . duration = duration ; self } pub fn build (self) -> InputMediaAnimation { InputMediaAnimation { tg_type : self . tg_type , media : self . media , thumb : self . thumb , caption : self . caption , parse_mode : self . parse_mode , caption_entities : self . caption_entities , width : self . width , height : self . height , duration : self . duration } } } # [doc = "Represents a link to a voice recording in an .OGG container encoded with OPUS. By default, this voice recording will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the the voice message.Note: This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them."] # [derive (Serialize , Deserialize , Debug)] pub struct InlineQueryResultVoice { # [doc = "Type of the result, must be voice"] # [serde (rename = "type")] tg_type : String , # [doc = "Unique identifier for this result, 1-64 bytes"] # [serde (rename = "id")] id : String , # [doc = "A valid URL for the voice recording"] # [serde (rename = "voice_url")] voice_url : String , # [doc = "Recording title"] # [serde (rename = "title")] title : String , # [doc = "Optional. Caption, 0-1024 characters after entities parsing"] # [serde (skip_serializing_if = "Option::is_none" , rename = "caption")] caption : Option < String > , # [doc = "Optional. Mode for parsing entities in the voice message caption. See formatting options for more details."] # [serde (skip_serializing_if = "Option::is_none" , rename = "parse_mode")] parse_mode : Option < String > , # [doc = "Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode"] # [serde (skip_serializing_if = "Option::is_none" , rename = "caption_entities")] caption_entities : Option < Vec < MessageEntity > > , # [doc = "Optional. Recording duration in seconds"] # [serde (skip_serializing_if = "Option::is_none" , rename = "voice_duration")] voice_duration : Option < i64 > , # [doc = "Optional. Inline keyboard attached to the message"] # [serde (skip_serializing_if = "Option::is_none" , rename = "reply_markup")] reply_markup : Option < InlineKeyboardMarkup > , # [doc = "Optional. Content of the message to be sent instead of the voice recording"] # [serde (skip_serializing_if = "Option::is_none" , rename = "input_message_content")] input_message_content : Option < InputMessageContent > } # [doc = "Represents a link to a voice recording in an .OGG container encoded with OPUS. By default, this voice recording will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the the voice message.Note: This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them."] # [derive (Serialize , Deserialize , Debug)] pub struct InlineQueryResultVoiceBuilder { # [doc = "Type of the result, must be voice"] # [serde (rename = "type")] tg_type : String , # [doc = "Unique identifier for this result, 1-64 bytes"] # [serde (rename = "id")] id : String , # [doc = "A valid URL for the voice recording"] # [serde (rename = "voice_url")] voice_url : String , # [doc = "Recording title"] # [serde (rename = "title")] title : String , # [doc = "Optional. Caption, 0-1024 characters after entities parsing"] # [serde (skip_serializing_if = "Option::is_none" , rename = "caption")] caption : Option < String > , # [doc = "Optional. Mode for parsing entities in the voice message caption. See formatting options for more details."] # [serde (skip_serializing_if = "Option::is_none" , rename = "parse_mode")] parse_mode : Option < String > , # [doc = "Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode"] # [serde (skip_serializing_if = "Option::is_none" , rename = "caption_entities")] caption_entities : Option < Vec < MessageEntity > > , # [doc = "Optional. Recording duration in seconds"] # [serde (skip_serializing_if = "Option::is_none" , rename = "voice_duration")] voice_duration : Option < i64 > , # [doc = "Optional. Inline keyboard attached to the message"] # [serde (skip_serializing_if = "Option::is_none" , rename = "reply_markup")] reply_markup : Option < InlineKeyboardMarkup > , # [doc = "Optional. Content of the message to be sent instead of the voice recording"] # [serde (skip_serializing_if = "Option::is_none" , rename = "input_message_content")] input_message_content : Option < InputMessageContent > } impl InlineQueryResultVoiceBuilder { pub fn new (id : String , voice_url : String , title : String) -> Self { Self { tg_type : "voice" . to_owned () , id , voice_url , title , caption : None , parse_mode : None , caption_entities : None , voice_duration : None , reply_markup : None , input_message_content : None } } pub fn set_type (mut self , tg_type : String) -> Self { self . tg_type = tg_type ; self } pub fn set_id (mut self , id : String) -> Self { self . id = id ; self } pub fn set_voice_url (mut self , voice_url : String) -> Self { self . voice_url = voice_url ; self } pub fn set_title (mut self , title : String) -> Self { self . title = title ; self } pub fn set_caption (mut self , caption : Option < String >) -> Self { self . caption = caption ; self } pub fn set_parse_mode (mut self , parse_mode : Option < String >) -> Self { self . parse_mode = parse_mode ; self } pub fn set_caption_entities (mut self , caption_entities : Option < Vec < MessageEntity > >) -> Self { self . caption_entities = caption_entities ; self } pub fn set_voice_duration (mut self , voice_duration : Option < i64 >) -> Self { self . voice_duration = voice_duration ; self } pub fn set_reply_markup (mut self , reply_markup : Option < InlineKeyboardMarkup >) -> Self { self . reply_markup = reply_markup ; self } pub fn set_input_message_content (mut self , input_message_content : Option < InputMessageContent >) -> Self { self . input_message_content = input_message_content ; self } pub fn build (self) -> InlineQueryResultVoice { InlineQueryResultVoice { tg_type : self . tg_type , id : self . id , voice_url : self . voice_url , title : self . title , caption : self . caption , parse_mode : self . parse_mode , caption_entities : self . caption_entities , voice_duration : self . voice_duration , reply_markup : self . reply_markup , input_message_content : self . input_message_content } } } # [doc = "Represents a contact with a phone number. By default, this contact will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the contact.Note: This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them."] # [derive (Serialize , Deserialize , Debug)] pub struct InlineQueryResultContact { # [doc = "Type of the result, must be contact"] # [serde (rename = "type")] tg_type : String , # [doc = "Unique identifier for this result, 1-64 Bytes"] # [serde (rename = "id")] id : String , # [doc = "Contact's phone number"] # [serde (rename = "phone_number")] phone_number : String , # [doc = "Contact's first name"] # [serde (rename = "first_name")] first_name : String , # [doc = "Optional. Contact's last name"] # [serde (skip_serializing_if = "Option::is_none" , rename = "last_name")] last_name : Option < String > , # [doc = "Optional. Additional data about the contact in the form of a vCard, 0-2048 bytes"] # [serde (skip_serializing_if = "Option::is_none" , rename = "vcard")] vcard : Option < String > , # [doc = "Optional. Inline keyboard attached to the message"] # [serde (skip_serializing_if = "Option::is_none" , rename = "reply_markup")] reply_markup : Option < InlineKeyboardMarkup > , # [doc = "Optional. Content of the message to be sent instead of the contact"] # [serde (skip_serializing_if = "Option::is_none" , rename = "input_message_content")] input_message_content : Option < InputMessageContent > , # [doc = "Optional. Url of the thumbnail for the result"] # [serde (skip_serializing_if = "Option::is_none" , rename = "thumb_url")] thumb_url : Option < String > , # [doc = "Optional. Thumbnail width"] # [serde (skip_serializing_if = "Option::is_none" , rename = "thumb_width")] thumb_width : Option < i64 > , # [doc = "Optional. Thumbnail height"] # [serde (skip_serializing_if = "Option::is_none" , rename = "thumb_height")] thumb_height : Option < i64 > } # [doc = "Represents a contact with a phone number. By default, this contact will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the contact.Note: This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them."] # [derive (Serialize , Deserialize , Debug)] pub struct InlineQueryResultContactBuilder { # [doc = "Type of the result, must be contact"] # [serde (rename = "type")] tg_type : String , # [doc = "Unique identifier for this result, 1-64 Bytes"] # [serde (rename = "id")] id : String , # [doc = "Contact's phone number"] # [serde (rename = "phone_number")] phone_number : String , # [doc = "Contact's first name"] # [serde (rename = "first_name")] first_name : String , # [doc = "Optional. Contact's last name"] # [serde (skip_serializing_if = "Option::is_none" , rename = "last_name")] last_name : Option < String > , # [doc = "Optional. Additional data about the contact in the form of a vCard, 0-2048 bytes"] # [serde (skip_serializing_if = "Option::is_none" , rename = "vcard")] vcard : Option < String > , # [doc = "Optional. Inline keyboard attached to the message"] # [serde (skip_serializing_if = "Option::is_none" , rename = "reply_markup")] reply_markup : Option < InlineKeyboardMarkup > , # [doc = "Optional. Content of the message to be sent instead of the contact"] # [serde (skip_serializing_if = "Option::is_none" , rename = "input_message_content")] input_message_content : Option < InputMessageContent > , # [doc = "Optional. Url of the thumbnail for the result"] # [serde (skip_serializing_if = "Option::is_none" , rename = "thumb_url")] thumb_url : Option < String > , # [doc = "Optional. Thumbnail width"] # [serde (skip_serializing_if = "Option::is_none" , rename = "thumb_width")] thumb_width : Option < i64 > , # [doc = "Optional. Thumbnail height"] # [serde (skip_serializing_if = "Option::is_none" , rename = "thumb_height")] thumb_height : Option < i64 > } impl InlineQueryResultContactBuilder { pub fn new (id : String , phone_number : String , first_name : String) -> Self { Self { tg_type : "contact" . to_owned () , id , phone_number , first_name , last_name : None , vcard : None , reply_markup : None , input_message_content : None , thumb_url : None , thumb_width : None , thumb_height : None } } pub fn set_type (mut self , tg_type : String) -> Self { self . tg_type = tg_type ; self } pub fn set_id (mut self , id : String) -> Self { self . id = id ; self } pub fn set_phone_number (mut self , phone_number : String) -> Self { self . phone_number = phone_number ; self } pub fn set_first_name (mut self , first_name : String) -> Self { self . first_name = first_name ; self } pub fn set_last_name (mut self , last_name : Option < String >) -> Self { self . last_name = last_name ; self } pub fn set_vcard (mut self , vcard : Option < String >) -> Self { self . vcard = vcard ; self } pub fn set_reply_markup (mut self , reply_markup : Option < InlineKeyboardMarkup >) -> Self { self . reply_markup = reply_markup ; self } pub fn set_input_message_content (mut self , input_message_content : Option < InputMessageContent >) -> Self { self . input_message_content = input_message_content ; self } pub fn set_thumb_url (mut self , thumb_url : Option < String >) -> Self { self . thumb_url = thumb_url ; self } pub fn set_thumb_width (mut self , thumb_width : Option < i64 >) -> Self { self . thumb_width = thumb_width ; self } pub fn set_thumb_height (mut self , thumb_height : Option < i64 >) -> Self { self . thumb_height = thumb_height ; self } pub fn build (self) -> InlineQueryResultContact { InlineQueryResultContact { tg_type : self . tg_type , id : self . id , phone_number : self . phone_number , first_name : self . first_name , last_name : self . last_name , vcard : self . vcard , reply_markup : self . reply_markup , input_message_content : self . input_message_content , thumb_url : self . thumb_url , thumb_width : self . thumb_width , thumb_height : self . thumb_height } } } # [doc = "This object describes the position on faces where a mask should be placed by default."] # [derive (Serialize , Deserialize , Debug)] pub struct MaskPosition { # [doc = "The part of the face relative to which the mask should be placed. One of \"forehead\", \"eyes\", \"mouth\", or \"chin\"."] # [serde (rename = "point")] point : String , # [doc = "Shift by X-axis measured in widths of the mask scaled to the face size, from left to right. For example, choosing -1.0 will place mask just to the left of the default mask position."] # [serde (rename = "x_shift")] 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."] # [serde (rename = "y_shift")] y_shift : f64 , # [doc = "Mask scaling coefficient. For example, 2.0 means double size."] # [serde (rename = "scale")] scale : f64 } # [doc = "This object describes the position on faces where a mask should be placed by default."] # [derive (Serialize , Deserialize , Debug)] pub struct MaskPositionBuilder { # [doc = "The part of the face relative to which the mask should be placed. One of \"forehead\", \"eyes\", \"mouth\", or \"chin\"."] # [serde (rename = "point")] point : String , # [doc = "Shift by X-axis measured in widths of the mask scaled to the face size, from left to right. For example, choosing -1.0 will place mask just to the left of the default mask position."] # [serde (rename = "x_shift")] 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."] # [serde (rename = "y_shift")] y_shift : f64 , # [doc = "Mask scaling coefficient. For example, 2.0 means double size."] # [serde (rename = "scale")] scale : f64 } impl MaskPositionBuilder { pub fn new (point : String , x_shift : f64 , y_shift : f64 , scale : f64) -> Self { Self { point , x_shift , y_shift , scale , } } pub fn set_point (mut self , point : String) -> Self { self . point = point ; self } pub fn set_x_shift (mut self , x_shift : f64) -> Self { self . x_shift = x_shift ; self } pub fn set_y_shift (mut self , y_shift : f64) -> Self { self . y_shift = y_shift ; self } pub fn set_scale (mut self , scale : f64) -> Self { self . scale = scale ; self } pub fn build (self) -> MaskPosition { MaskPosition { point : self . point , x_shift : self . x_shift , y_shift : self . y_shift , scale : self . scale } } } # [derive (Serialize , Deserialize , Debug)] # [serde (untagged)] pub enum PassportElementError { PassportElementErrorDataField (PassportElementErrorDataField) , PassportElementErrorFrontSide (PassportElementErrorFrontSide) , PassportElementErrorReverseSide (PassportElementErrorReverseSide) , PassportElementErrorSelfie (PassportElementErrorSelfie) , PassportElementErrorFile (PassportElementErrorFile) , PassportElementErrorFiles (PassportElementErrorFiles) , PassportElementErrorTranslationFile (PassportElementErrorTranslationFile) , PassportElementErrorTranslationFiles (PassportElementErrorTranslationFiles) , PassportElementErrorUnspecified (PassportElementErrorUnspecified) } # [doc = "This object represents one shipping option."] # [derive (Serialize , Deserialize , Debug)] pub struct ShippingOption { # [doc = "Shipping option identifier"] # [serde (rename = "id")] id : String , # [doc = "Option title"] # [serde (rename = "title")] title : String , # [doc = "List of price portions"] # [serde (rename = "prices")] prices : Vec < LabeledPrice > } # [doc = "This object represents one shipping option."] # [derive (Serialize , Deserialize , Debug)] pub struct ShippingOptionBuilder { # [doc = "Shipping option identifier"] # [serde (rename = "id")] id : String , # [doc = "Option title"] # [serde (rename = "title")] title : String , # [doc = "List of price portions"] # [serde (rename = "prices")] prices : Vec < LabeledPrice > } impl ShippingOptionBuilder { pub fn new (id : String , title : String , prices : Vec < LabeledPrice >) -> Self { Self { id , title , prices , } } pub fn set_id (mut self , id : String) -> Self { self . id = id ; self } pub fn set_title (mut self , title : String) -> Self { self . title = title ; self } pub fn set_prices (mut self , prices : Vec < LabeledPrice >) -> Self { self . prices = prices ; self } pub fn build (self) -> ShippingOption { ShippingOption { id : self . id , title : self . title , prices : self . prices } } } # [doc = "Represents an issue with the reverse side of a document. The error is considered resolved when the file with reverse side of the document changes."] # [derive (Serialize , Deserialize , Debug)] pub struct PassportElementErrorReverseSide { # [doc = "Error source, must be reverse_side"] # [serde (rename = "source")] source : String , # [doc = "The section of the user's Telegram Passport which has the issue, one of \"driver_license\", \"identity_card\""] # [serde (rename = "type")] tg_type : String , # [doc = "Base64-encoded hash of the file with the reverse side of the document"] # [serde (rename = "file_hash")] file_hash : String , # [doc = "Error message"] # [serde (rename = "message")] message : String } # [doc = "Represents an issue with the reverse side of a document. The error is considered resolved when the file with reverse side of the document changes."] # [derive (Serialize , Deserialize , Debug)] pub struct PassportElementErrorReverseSideBuilder { # [doc = "Error source, must be reverse_side"] # [serde (rename = "source")] source : String , # [doc = "The section of the user's Telegram Passport which has the issue, one of \"driver_license\", \"identity_card\""] # [serde (rename = "type")] tg_type : String , # [doc = "Base64-encoded hash of the file with the reverse side of the document"] # [serde (rename = "file_hash")] file_hash : String , # [doc = "Error message"] # [serde (rename = "message")] message : String } impl PassportElementErrorReverseSideBuilder { pub fn new (source : String , file_hash : String , message : String) -> Self { Self { tg_type : "PassportElementErrorReverseSide" . to_owned () , source , file_hash , message , } } pub fn set_source (mut self , source : String) -> Self { self . source = source ; self } pub fn set_type (mut self , tg_type : String) -> Self { self . tg_type = tg_type ; self } pub fn set_file_hash (mut self , file_hash : String) -> Self { self . file_hash = file_hash ; self } pub fn set_message (mut self , message : String) -> Self { self . message = message ; self } pub fn build (self) -> PassportElementErrorReverseSide { PassportElementErrorReverseSide { source : self . source , tg_type : self . tg_type , file_hash : self . file_hash , message : self . message } } } # [doc = "Represents a chat member that is under certain restrictions in the chat. Supergroups only."] # [derive (Serialize , Deserialize , Debug)] pub struct ChatMemberRestricted { # [doc = "The member's status in the chat, always \"restricted\""] # [serde (rename = "status")] status : String , # [doc = "Information about the user"] # [serde (rename = "user")] user : User , # [doc = "True, if the user is a member of the chat at the moment of the request"] # [serde (rename = "is_member")] is_member : bool , # [doc = "True, if the user is allowed to change the chat title, photo and other settings"] # [serde (rename = "can_change_info")] can_change_info : bool , # [doc = "True, if the user is allowed to invite new users to the chat"] # [serde (rename = "can_invite_users")] can_invite_users : bool , # [doc = "True, if the user is allowed to pin messages"] # [serde (rename = "can_pin_messages")] can_pin_messages : bool , # [doc = "True, if the user is allowed to send text messages, contacts, locations and venues"] # [serde (rename = "can_send_messages")] can_send_messages : bool , # [doc = "True, if the user is allowed to send audios, documents, photos, videos, video notes and voice notes"] # [serde (rename = "can_send_media_messages")] can_send_media_messages : bool , # [doc = "True, if the user is allowed to send polls"] # [serde (rename = "can_send_polls")] can_send_polls : bool , # [doc = "True, if the user is allowed to send animations, games, stickers and use inline bots"] # [serde (rename = "can_send_other_messages")] can_send_other_messages : bool , # [doc = "True, if the user is allowed to add web page previews to their messages"] # [serde (rename = "can_add_web_page_previews")] can_add_web_page_previews : bool , # [doc = "Date when restrictions will be lifted for this user; unix time. If 0, then the user is restricted forever"] # [serde (rename = "until_date")] until_date : i64 } # [doc = "Represents a chat member that is under certain restrictions in the chat. Supergroups only."] # [derive (Serialize , Deserialize , Debug)] pub struct ChatMemberRestrictedBuilder { # [doc = "The member's status in the chat, always \"restricted\""] # [serde (rename = "status")] status : String , # [doc = "Information about the user"] # [serde (rename = "user")] user : User , # [doc = "True, if the user is a member of the chat at the moment of the request"] # [serde (rename = "is_member")] is_member : bool , # [doc = "True, if the user is allowed to change the chat title, photo and other settings"] # [serde (rename = "can_change_info")] can_change_info : bool , # [doc = "True, if the user is allowed to invite new users to the chat"] # [serde (rename = "can_invite_users")] can_invite_users : bool , # [doc = "True, if the user is allowed to pin messages"] # [serde (rename = "can_pin_messages")] can_pin_messages : bool , # [doc = "True, if the user is allowed to send text messages, contacts, locations and venues"] # [serde (rename = "can_send_messages")] can_send_messages : bool , # [doc = "True, if the user is allowed to send audios, documents, photos, videos, video notes and voice notes"] # [serde (rename = "can_send_media_messages")] can_send_media_messages : bool , # [doc = "True, if the user is allowed to send polls"] # [serde (rename = "can_send_polls")] can_send_polls : bool , # [doc = "True, if the user is allowed to send animations, games, stickers and use inline bots"] # [serde (rename = "can_send_other_messages")] can_send_other_messages : bool , # [doc = "True, if the user is allowed to add web page previews to their messages"] # [serde (rename = "can_add_web_page_previews")] can_add_web_page_previews : bool , # [doc = "Date when restrictions will be lifted for this user; unix time. If 0, then the user is restricted forever"] # [serde (rename = "until_date")] until_date : i64 } impl ChatMemberRestrictedBuilder { pub fn new (status : String , user : User , is_member : bool , can_change_info : bool , can_invite_users : bool , can_pin_messages : bool , can_send_messages : bool , can_send_media_messages : bool , can_send_polls : bool , can_send_other_messages : bool , can_add_web_page_previews : bool , until_date : i64) -> Self { Self { status , user , is_member , can_change_info , can_invite_users , can_pin_messages , can_send_messages , can_send_media_messages , can_send_polls , can_send_other_messages , can_add_web_page_previews , until_date , } } pub fn set_status (mut self , status : String) -> Self { self . status = status ; self } pub fn set_user (mut self , user : User) -> Self { self . user = user ; self } pub fn set_is_member (mut self , is_member : bool) -> Self { self . is_member = is_member ; self } pub fn set_can_change_info (mut self , can_change_info : bool) -> Self { self . can_change_info = can_change_info ; self } pub fn set_can_invite_users (mut self , can_invite_users : bool) -> Self { self . can_invite_users = can_invite_users ; self } pub fn set_can_pin_messages (mut self , can_pin_messages : bool) -> Self { self . can_pin_messages = can_pin_messages ; self } pub fn set_can_send_messages (mut self , can_send_messages : bool) -> Self { self . can_send_messages = can_send_messages ; self } pub fn set_can_send_media_messages (mut self , can_send_media_messages : bool) -> Self { self . can_send_media_messages = can_send_media_messages ; self } pub fn set_can_send_polls (mut self , can_send_polls : bool) -> Self { self . can_send_polls = can_send_polls ; self } pub fn set_can_send_other_messages (mut self , can_send_other_messages : bool) -> Self { self . can_send_other_messages = can_send_other_messages ; self } pub fn set_can_add_web_page_previews (mut self , can_add_web_page_previews : bool) -> Self { self . can_add_web_page_previews = can_add_web_page_previews ; self } pub fn set_until_date (mut self , until_date : i64) -> Self { self . until_date = until_date ; self } pub fn build (self) -> ChatMemberRestricted { ChatMemberRestricted { status : self . status , user : self . user , is_member : self . is_member , can_change_info : self . can_change_info , can_invite_users : self . can_invite_users , can_pin_messages : self . can_pin_messages , can_send_messages : self . can_send_messages , can_send_media_messages : self . can_send_media_messages , can_send_polls : self . can_send_polls , can_send_other_messages : self . can_send_other_messages , can_add_web_page_previews : self . can_add_web_page_previews , until_date : self . until_date } } } # [doc = "Represents the scope of bot commands, covering a specific chat."] # [derive (Serialize , Deserialize , Debug)] pub struct BotCommandScopeChat { # [doc = "Scope type, must be chat"] # [serde (rename = "type")] tg_type : String , # [doc = "Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)"] # [serde (rename = "chat_id")] chat_id : i64 } # [doc = "Represents the scope of bot commands, covering a specific chat."] # [derive (Serialize , Deserialize , Debug)] pub struct BotCommandScopeChatBuilder { # [doc = "Scope type, must be chat"] # [serde (rename = "type")] tg_type : String , # [doc = "Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)"] # [serde (rename = "chat_id")] chat_id : i64 } impl BotCommandScopeChatBuilder { pub fn new (chat_id : i64) -> Self { Self { tg_type : "chat" . to_owned () , chat_id , } } pub fn set_type (mut self , tg_type : String) -> Self { self . tg_type = tg_type ; self } pub fn set_chat_id (mut self , chat_id : i64) -> Self { self . chat_id = chat_id ; self } pub fn build (self) -> BotCommandScopeChat { BotCommandScopeChat { tg_type : self . tg_type , chat_id : self . chat_id } } } # [doc = "This object contains information about an incoming pre-checkout query."] # [derive (Serialize , Deserialize , Debug)] pub struct PreCheckoutQuery { # [doc = "Unique query identifier"] # [serde (rename = "id")] id : String , # [doc = "User who sent the query"] # [serde (rename = "from")] from : User , # [doc = "Three-letter ISO 4217 currency code"] # [serde (rename = "currency")] currency : String , # [doc = "Total price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies)."] # [serde (rename = "total_amount")] total_amount : i64 , # [doc = "Bot specified invoice payload"] # [serde (rename = "invoice_payload")] invoice_payload : String , # [doc = "Optional. Identifier of the shipping option chosen by the user"] # [serde (skip_serializing_if = "Option::is_none" , rename = "shipping_option_id")] shipping_option_id : Option < String > , # [doc = "Optional. Order information provided by the user"] # [serde (skip_serializing_if = "Option::is_none" , rename = "order_info")] order_info : Option < OrderInfo > } # [doc = "This object contains information about an incoming pre-checkout query."] # [derive (Serialize , Deserialize , Debug)] pub struct PreCheckoutQueryBuilder { # [doc = "Unique query identifier"] # [serde (rename = "id")] id : String , # [doc = "User who sent the query"] # [serde (rename = "from")] from : User , # [doc = "Three-letter ISO 4217 currency code"] # [serde (rename = "currency")] currency : String , # [doc = "Total price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies)."] # [serde (rename = "total_amount")] total_amount : i64 , # [doc = "Bot specified invoice payload"] # [serde (rename = "invoice_payload")] invoice_payload : String , # [doc = "Optional. Identifier of the shipping option chosen by the user"] # [serde (skip_serializing_if = "Option::is_none" , rename = "shipping_option_id")] shipping_option_id : Option < String > , # [doc = "Optional. Order information provided by the user"] # [serde (skip_serializing_if = "Option::is_none" , rename = "order_info")] order_info : Option < OrderInfo > } impl PreCheckoutQueryBuilder { pub fn new (id : String , from : User , currency : String , total_amount : i64 , invoice_payload : String) -> Self { Self { id , from , currency , total_amount , invoice_payload , shipping_option_id : None , order_info : None } } pub fn set_id (mut self , id : String) -> Self { self . id = id ; self } pub fn set_from (mut self , from : User) -> Self { self . from = from ; self } pub fn set_currency (mut self , currency : String) -> Self { self . currency = currency ; self } pub fn set_total_amount (mut self , total_amount : i64) -> Self { self . total_amount = total_amount ; self } pub fn set_invoice_payload (mut self , invoice_payload : String) -> Self { self . invoice_payload = invoice_payload ; self } pub fn set_shipping_option_id (mut self , shipping_option_id : Option < String >) -> Self { self . shipping_option_id = shipping_option_id ; self } pub fn set_order_info (mut self , order_info : Option < OrderInfo >) -> Self { self . order_info = order_info ; self } pub fn build (self) -> PreCheckoutQuery { PreCheckoutQuery { id : self . id , from : self . from , currency : self . currency , total_amount : self . total_amount , invoice_payload : self . invoice_payload , shipping_option_id : self . shipping_option_id , order_info : self . order_info } } } # [doc = "Represents a link to a photo. By default, this photo will be sent by the user with optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the photo."] # [derive (Serialize , Deserialize , Debug)] pub struct InlineQueryResultPhoto { # [doc = "Type of the result, must be photo"] # [serde (rename = "type")] tg_type : String , # [doc = "Unique identifier for this result, 1-64 bytes"] # [serde (rename = "id")] id : String , # [doc = "A valid URL of the photo. Photo must be in JPEG format. Photo size must not exceed 5MB"] # [serde (rename = "photo_url")] photo_url : String , # [doc = "URL of the thumbnail for the photo"] # [serde (rename = "thumb_url")] thumb_url : String , # [doc = "Optional. Width of the photo"] # [serde (skip_serializing_if = "Option::is_none" , rename = "photo_width")] photo_width : Option < i64 > , # [doc = "Optional. Height of the photo"] # [serde (skip_serializing_if = "Option::is_none" , rename = "photo_height")] photo_height : Option < i64 > , # [doc = "Optional. Title for the result"] # [serde (skip_serializing_if = "Option::is_none" , rename = "title")] title : Option < String > , # [doc = "Optional. Short description of the result"] # [serde (skip_serializing_if = "Option::is_none" , rename = "description")] description : Option < String > , # [doc = "Optional. Caption of the photo to be sent, 0-1024 characters after entities parsing"] # [serde (skip_serializing_if = "Option::is_none" , rename = "caption")] caption : Option < String > , # [doc = "Optional. Mode for parsing entities in the photo caption. See formatting options for more details."] # [serde (skip_serializing_if = "Option::is_none" , rename = "parse_mode")] parse_mode : Option < String > , # [doc = "Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode"] # [serde (skip_serializing_if = "Option::is_none" , rename = "caption_entities")] caption_entities : Option < Vec < MessageEntity > > , # [doc = "Optional. Inline keyboard attached to the message"] # [serde (skip_serializing_if = "Option::is_none" , rename = "reply_markup")] reply_markup : Option < InlineKeyboardMarkup > , # [doc = "Optional. Content of the message to be sent instead of the photo"] # [serde (skip_serializing_if = "Option::is_none" , rename = "input_message_content")] input_message_content : Option < InputMessageContent > } # [doc = "Represents a link to a photo. By default, this photo will be sent by the user with optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the photo."] # [derive (Serialize , Deserialize , Debug)] pub struct InlineQueryResultPhotoBuilder { # [doc = "Type of the result, must be photo"] # [serde (rename = "type")] tg_type : String , # [doc = "Unique identifier for this result, 1-64 bytes"] # [serde (rename = "id")] id : String , # [doc = "A valid URL of the photo. Photo must be in JPEG format. Photo size must not exceed 5MB"] # [serde (rename = "photo_url")] photo_url : String , # [doc = "URL of the thumbnail for the photo"] # [serde (rename = "thumb_url")] thumb_url : String , # [doc = "Optional. Width of the photo"] # [serde (skip_serializing_if = "Option::is_none" , rename = "photo_width")] photo_width : Option < i64 > , # [doc = "Optional. Height of the photo"] # [serde (skip_serializing_if = "Option::is_none" , rename = "photo_height")] photo_height : Option < i64 > , # [doc = "Optional. Title for the result"] # [serde (skip_serializing_if = "Option::is_none" , rename = "title")] title : Option < String > , # [doc = "Optional. Short description of the result"] # [serde (skip_serializing_if = "Option::is_none" , rename = "description")] description : Option < String > , # [doc = "Optional. Caption of the photo to be sent, 0-1024 characters after entities parsing"] # [serde (skip_serializing_if = "Option::is_none" , rename = "caption")] caption : Option < String > , # [doc = "Optional. Mode for parsing entities in the photo caption. See formatting options for more details."] # [serde (skip_serializing_if = "Option::is_none" , rename = "parse_mode")] parse_mode : Option < String > , # [doc = "Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode"] # [serde (skip_serializing_if = "Option::is_none" , rename = "caption_entities")] caption_entities : Option < Vec < MessageEntity > > , # [doc = "Optional. Inline keyboard attached to the message"] # [serde (skip_serializing_if = "Option::is_none" , rename = "reply_markup")] reply_markup : Option < InlineKeyboardMarkup > , # [doc = "Optional. Content of the message to be sent instead of the photo"] # [serde (skip_serializing_if = "Option::is_none" , rename = "input_message_content")] input_message_content : Option < InputMessageContent > } impl InlineQueryResultPhotoBuilder { pub fn new (id : String , photo_url : String , thumb_url : String) -> Self { Self { tg_type : "photo" . to_owned () , id , photo_url , thumb_url , photo_width : None , photo_height : None , title : None , description : None , caption : None , parse_mode : None , caption_entities : None , reply_markup : None , input_message_content : None } } pub fn set_type (mut self , tg_type : String) -> Self { self . tg_type = tg_type ; self } pub fn set_id (mut self , id : String) -> Self { self . id = id ; self } pub fn set_photo_url (mut self , photo_url : String) -> Self { self . photo_url = photo_url ; self } pub fn set_thumb_url (mut self , thumb_url : String) -> Self { self . thumb_url = thumb_url ; self } pub fn set_photo_width (mut self , photo_width : Option < i64 >) -> Self { self . photo_width = photo_width ; self } pub fn set_photo_height (mut self , photo_height : Option < i64 >) -> Self { self . photo_height = photo_height ; self } pub fn set_title (mut self , title : Option < String >) -> Self { self . title = title ; self } pub fn set_description (mut self , description : Option < String >) -> Self { self . description = description ; self } pub fn set_caption (mut self , caption : Option < String >) -> Self { self . caption = caption ; self } pub fn set_parse_mode (mut self , parse_mode : Option < String >) -> Self { self . parse_mode = parse_mode ; self } pub fn set_caption_entities (mut self , caption_entities : Option < Vec < MessageEntity > >) -> Self { self . caption_entities = caption_entities ; self } pub fn set_reply_markup (mut self , reply_markup : Option < InlineKeyboardMarkup >) -> Self { self . reply_markup = reply_markup ; self } pub fn set_input_message_content (mut self , input_message_content : Option < InputMessageContent >) -> Self { self . input_message_content = input_message_content ; self } pub fn build (self) -> InlineQueryResultPhoto { InlineQueryResultPhoto { tg_type : self . tg_type , id : self . id , photo_url : self . photo_url , thumb_url : self . thumb_url , photo_width : self . photo_width , photo_height : self . photo_height , title : self . title , description : self . description , caption : self . caption , parse_mode : self . parse_mode , caption_entities : self . caption_entities , reply_markup : self . reply_markup , input_message_content : self . input_message_content } } } # [doc = "Represents a chat member that was banned in the chat and can't return to the chat or view chat messages."] # [derive (Serialize , Deserialize , Debug)] pub struct ChatMemberBanned { # [doc = "The member's status in the chat, always \"kicked\""] # [serde (rename = "status")] status : String , # [doc = "Information about the user"] # [serde (rename = "user")] user : User , # [doc = "Date when restrictions will be lifted for this user; unix time. If 0, then the user is banned forever"] # [serde (rename = "until_date")] until_date : i64 } # [doc = "Represents a chat member that was banned in the chat and can't return to the chat or view chat messages."] # [derive (Serialize , Deserialize , Debug)] pub struct ChatMemberBannedBuilder { # [doc = "The member's status in the chat, always \"kicked\""] # [serde (rename = "status")] status : String , # [doc = "Information about the user"] # [serde (rename = "user")] user : User , # [doc = "Date when restrictions will be lifted for this user; unix time. If 0, then the user is banned forever"] # [serde (rename = "until_date")] until_date : i64 } impl ChatMemberBannedBuilder { pub fn new (status : String , user : User , until_date : i64) -> Self { Self { status , user , until_date , } } pub fn set_status (mut self , status : String) -> Self { self . status = status ; self } pub fn set_user (mut self , user : User) -> Self { self . user = user ; self } pub fn set_until_date (mut self , until_date : i64) -> Self { self . until_date = until_date ; self } pub fn build (self) -> ChatMemberBanned { ChatMemberBanned { status : self . status , user : self . user , until_date : self . until_date } } } # [doc = "Represents an issue with the translated version of a document. The error is considered resolved when a file with the document translation change."] # [derive (Serialize , Deserialize , Debug)] pub struct PassportElementErrorTranslationFiles { # [doc = "Error source, must be translation_files"] # [serde (rename = "source")] source : String , # [doc = "Type of element of the user's Telegram Passport which has the issue, one of \"passport\", \"driver_license\", \"identity_card\", \"internal_passport\", \"utility_bill\", \"bank_statement\", \"rental_agreement\", \"passport_registration\", \"temporary_registration\""] # [serde (rename = "type")] tg_type : String , # [doc = "List of base64-encoded file hashes"] # [serde (rename = "file_hashes")] file_hashes : Vec < String > , # [doc = "Error message"] # [serde (rename = "message")] message : String } # [doc = "Represents an issue with the translated version of a document. The error is considered resolved when a file with the document translation change."] # [derive (Serialize , Deserialize , Debug)] pub struct PassportElementErrorTranslationFilesBuilder { # [doc = "Error source, must be translation_files"] # [serde (rename = "source")] source : String , # [doc = "Type of element of the user's Telegram Passport which has the issue, one of \"passport\", \"driver_license\", \"identity_card\", \"internal_passport\", \"utility_bill\", \"bank_statement\", \"rental_agreement\", \"passport_registration\", \"temporary_registration\""] # [serde (rename = "type")] tg_type : String , # [doc = "List of base64-encoded file hashes"] # [serde (rename = "file_hashes")] file_hashes : Vec < String > , # [doc = "Error message"] # [serde (rename = "message")] message : String } impl PassportElementErrorTranslationFilesBuilder { pub fn new (source : String , file_hashes : Vec < String > , message : String) -> Self { Self { tg_type : "PassportElementErrorTranslationFiles" . to_owned () , source , file_hashes , message , } } pub fn set_source (mut self , source : String) -> Self { self . source = source ; self } pub fn set_type (mut self , tg_type : String) -> Self { self . tg_type = tg_type ; self } pub fn set_file_hashes (mut self , file_hashes : Vec < String >) -> Self { self . file_hashes = file_hashes ; self } pub fn set_message (mut self , message : String) -> Self { self . message = message ; self } pub fn build (self) -> PassportElementErrorTranslationFiles { PassportElementErrorTranslationFiles { source : self . source , tg_type : self . tg_type , file_hashes : self . file_hashes , message : self . message } } } # [derive (Serialize , Deserialize , Debug)] # [serde (untagged)] pub enum CallbackGame { } # [doc = "This object represents an answer of a user in a non-anonymous poll."] # [derive (Serialize , Deserialize , Debug)] pub struct PollAnswer { # [doc = "Unique poll identifier"] # [serde (rename = "poll_id")] poll_id : String , # [doc = "The user, who changed the answer to the poll"] # [serde (rename = "user")] user : User , # [doc = "0-based identifiers of answer options, chosen by the user. May be empty if the user retracted their vote."] # [serde (rename = "option_ids")] option_ids : Vec < i64 > } # [doc = "This object represents an answer of a user in a non-anonymous poll."] # [derive (Serialize , Deserialize , Debug)] pub struct PollAnswerBuilder { # [doc = "Unique poll identifier"] # [serde (rename = "poll_id")] poll_id : String , # [doc = "The user, who changed the answer to the poll"] # [serde (rename = "user")] user : User , # [doc = "0-based identifiers of answer options, chosen by the user. May be empty if the user retracted their vote."] # [serde (rename = "option_ids")] option_ids : Vec < i64 > } impl PollAnswerBuilder { pub fn new (poll_id : String , user : User , option_ids : Vec < i64 >) -> Self { Self { poll_id , user , option_ids , } } pub fn set_poll_id (mut self , poll_id : String) -> Self { self . poll_id = poll_id ; self } pub fn set_user (mut self , user : User) -> Self { self . user = user ; self } pub fn set_option_ids (mut self , option_ids : Vec < i64 >) -> Self { self . option_ids = option_ids ; self } pub fn build (self) -> PollAnswer { PollAnswer { poll_id : self . poll_id , user : self . user , option_ids : self . option_ids } } } # [doc = "Represents a link to a video file stored on the Telegram servers. By default, this video file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the video."] # [derive (Serialize , Deserialize , Debug)] pub struct InlineQueryResultCachedVideo { # [doc = "Type of the result, must be video"] # [serde (rename = "type")] tg_type : String , # [doc = "Unique identifier for this result, 1-64 bytes"] # [serde (rename = "id")] id : String , # [doc = "A valid file identifier for the video file"] # [serde (rename = "video_file_id")] video_file_id : String , # [doc = "Title for the result"] # [serde (rename = "title")] title : String , # [doc = "Optional. Short description of the result"] # [serde (skip_serializing_if = "Option::is_none" , rename = "description")] description : Option < String > , # [doc = "Optional. Caption of the video to be sent, 0-1024 characters after entities parsing"] # [serde (skip_serializing_if = "Option::is_none" , rename = "caption")] caption : Option < String > , # [doc = "Optional. Mode for parsing entities in the video caption. See formatting options for more details."] # [serde (skip_serializing_if = "Option::is_none" , rename = "parse_mode")] parse_mode : Option < String > , # [doc = "Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode"] # [serde (skip_serializing_if = "Option::is_none" , rename = "caption_entities")] caption_entities : Option < Vec < MessageEntity > > , # [doc = "Optional. Inline keyboard attached to the message"] # [serde (skip_serializing_if = "Option::is_none" , rename = "reply_markup")] reply_markup : Option < InlineKeyboardMarkup > , # [doc = "Optional. Content of the message to be sent instead of the video"] # [serde (skip_serializing_if = "Option::is_none" , rename = "input_message_content")] input_message_content : Option < InputMessageContent > } # [doc = "Represents a link to a video file stored on the Telegram servers. By default, this video file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the video."] # [derive (Serialize , Deserialize , Debug)] pub struct InlineQueryResultCachedVideoBuilder { # [doc = "Type of the result, must be video"] # [serde (rename = "type")] tg_type : String , # [doc = "Unique identifier for this result, 1-64 bytes"] # [serde (rename = "id")] id : String , # [doc = "A valid file identifier for the video file"] # [serde (rename = "video_file_id")] video_file_id : String , # [doc = "Title for the result"] # [serde (rename = "title")] title : String , # [doc = "Optional. Short description of the result"] # [serde (skip_serializing_if = "Option::is_none" , rename = "description")] description : Option < String > , # [doc = "Optional. Caption of the video to be sent, 0-1024 characters after entities parsing"] # [serde (skip_serializing_if = "Option::is_none" , rename = "caption")] caption : Option < String > , # [doc = "Optional. Mode for parsing entities in the video caption. See formatting options for more details."] # [serde (skip_serializing_if = "Option::is_none" , rename = "parse_mode")] parse_mode : Option < String > , # [doc = "Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode"] # [serde (skip_serializing_if = "Option::is_none" , rename = "caption_entities")] caption_entities : Option < Vec < MessageEntity > > , # [doc = "Optional. Inline keyboard attached to the message"] # [serde (skip_serializing_if = "Option::is_none" , rename = "reply_markup")] reply_markup : Option < InlineKeyboardMarkup > , # [doc = "Optional. Content of the message to be sent instead of the video"] # [serde (skip_serializing_if = "Option::is_none" , rename = "input_message_content")] input_message_content : Option < InputMessageContent > } impl InlineQueryResultCachedVideoBuilder { pub fn new (id : String , video_file_id : String , title : String) -> Self { Self { tg_type : "video" . to_owned () , id , video_file_id , title , description : None , caption : None , parse_mode : None , caption_entities : None , reply_markup : None , input_message_content : None } } pub fn set_type (mut self , tg_type : String) -> Self { self . tg_type = tg_type ; self } pub fn set_id (mut self , id : String) -> Self { self . id = id ; self } pub fn set_video_file_id (mut self , video_file_id : String) -> Self { self . video_file_id = video_file_id ; self } pub fn set_title (mut self , title : String) -> Self { self . title = title ; self } pub fn set_description (mut self , description : Option < String >) -> Self { self . description = description ; self } pub fn set_caption (mut self , caption : Option < String >) -> Self { self . caption = caption ; self } pub fn set_parse_mode (mut self , parse_mode : Option < String >) -> Self { self . parse_mode = parse_mode ; self } pub fn set_caption_entities (mut self , caption_entities : Option < Vec < MessageEntity > >) -> Self { self . caption_entities = caption_entities ; self } pub fn set_reply_markup (mut self , reply_markup : Option < InlineKeyboardMarkup >) -> Self { self . reply_markup = reply_markup ; self } pub fn set_input_message_content (mut self , input_message_content : Option < InputMessageContent >) -> Self { self . input_message_content = input_message_content ; self } pub fn build (self) -> InlineQueryResultCachedVideo { InlineQueryResultCachedVideo { tg_type : self . tg_type , id : self . id , video_file_id : self . video_file_id , title : self . title , description : self . description , caption : self . caption , parse_mode : self . parse_mode , caption_entities : self . caption_entities , reply_markup : self . reply_markup , input_message_content : self . input_message_content } } } # [doc = "Describes data sent from a Web App to the bot."] # [derive (Serialize , Deserialize , Debug)] pub struct WebAppData { # [doc = "The data. Be aware that a bad client can send arbitrary data in this field."] # [serde (rename = "data")] data : String , # [doc = "Text of the web_app keyboard button from which the Web App was opened. Be aware that a bad client can send arbitrary data in this field."] # [serde (rename = "button_text")] button_text : String } # [doc = "Describes data sent from a Web App to the bot."] # [derive (Serialize , Deserialize , Debug)] pub struct WebAppDataBuilder { # [doc = "The data. Be aware that a bad client can send arbitrary data in this field."] # [serde (rename = "data")] data : String , # [doc = "Text of the web_app keyboard button from which the Web App was opened. Be aware that a bad client can send arbitrary data in this field."] # [serde (rename = "button_text")] button_text : String } impl WebAppDataBuilder { pub fn new (data : String , button_text : String) -> Self { Self { data , button_text , } } pub fn set_data (mut self , data : String) -> Self { self . data = data ; self } pub fn set_button_text (mut self , button_text : String) -> Self { self . button_text = button_text ; self } pub fn build (self) -> WebAppData { WebAppData { data : self . data , button_text : self . button_text } } } # [doc = "Represents a chat member that has some additional privileges."] # [derive (Serialize , Deserialize , Debug)] pub struct ChatMemberAdministrator { # [doc = "The member's status in the chat, always \"administrator\""] # [serde (rename = "status")] status : String , # [doc = "Information about the user"] # [serde (rename = "user")] user : User , # [doc = "True, if the bot is allowed to edit administrator privileges of that user"] # [serde (rename = "can_be_edited")] can_be_edited : bool , # [doc = "True, if the user's presence in the chat is hidden"] # [serde (rename = "is_anonymous")] is_anonymous : bool , # [doc = "True, if the administrator can access the chat event log, chat statistics, message statistics in channels, see channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other administrator privilege"] # [serde (rename = "can_manage_chat")] can_manage_chat : bool , # [doc = "True, if the administrator can delete messages of other users"] # [serde (rename = "can_delete_messages")] can_delete_messages : bool , # [doc = "True, if the administrator can manage video chats"] # [serde (rename = "can_manage_video_chats")] can_manage_video_chats : bool , # [doc = "True, if the administrator can restrict, ban or unban chat members"] # [serde (rename = "can_restrict_members")] can_restrict_members : bool , # [doc = "True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by the user)"] # [serde (rename = "can_promote_members")] can_promote_members : bool , # [doc = "True, if the user is allowed to change the chat title, photo and other settings"] # [serde (rename = "can_change_info")] can_change_info : bool , # [doc = "True, if the user is allowed to invite new users to the chat"] # [serde (rename = "can_invite_users")] can_invite_users : bool , # [doc = "Optional. True, if the administrator can post in the channel; channels only"] # [serde (skip_serializing_if = "Option::is_none" , rename = "can_post_messages")] can_post_messages : Option < bool > , # [doc = "Optional. True, if the administrator can edit messages of other users and can pin messages; channels only"] # [serde (skip_serializing_if = "Option::is_none" , rename = "can_edit_messages")] can_edit_messages : Option < bool > , # [doc = "Optional. True, if the user is allowed to pin messages; groups and supergroups only"] # [serde (skip_serializing_if = "Option::is_none" , rename = "can_pin_messages")] can_pin_messages : Option < bool > , # [doc = "Optional. Custom title for this user"] # [serde (skip_serializing_if = "Option::is_none" , rename = "custom_title")] custom_title : Option < String > } # [doc = "Represents a chat member that has some additional privileges."] # [derive (Serialize , Deserialize , Debug)] pub struct ChatMemberAdministratorBuilder { # [doc = "The member's status in the chat, always \"administrator\""] # [serde (rename = "status")] status : String , # [doc = "Information about the user"] # [serde (rename = "user")] user : User , # [doc = "True, if the bot is allowed to edit administrator privileges of that user"] # [serde (rename = "can_be_edited")] can_be_edited : bool , # [doc = "True, if the user's presence in the chat is hidden"] # [serde (rename = "is_anonymous")] is_anonymous : bool , # [doc = "True, if the administrator can access the chat event log, chat statistics, message statistics in channels, see channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other administrator privilege"] # [serde (rename = "can_manage_chat")] can_manage_chat : bool , # [doc = "True, if the administrator can delete messages of other users"] # [serde (rename = "can_delete_messages")] can_delete_messages : bool , # [doc = "True, if the administrator can manage video chats"] # [serde (rename = "can_manage_video_chats")] can_manage_video_chats : bool , # [doc = "True, if the administrator can restrict, ban or unban chat members"] # [serde (rename = "can_restrict_members")] can_restrict_members : bool , # [doc = "True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by the user)"] # [serde (rename = "can_promote_members")] can_promote_members : bool , # [doc = "True, if the user is allowed to change the chat title, photo and other settings"] # [serde (rename = "can_change_info")] can_change_info : bool , # [doc = "True, if the user is allowed to invite new users to the chat"] # [serde (rename = "can_invite_users")] can_invite_users : bool , # [doc = "Optional. True, if the administrator can post in the channel; channels only"] # [serde (skip_serializing_if = "Option::is_none" , rename = "can_post_messages")] can_post_messages : Option < bool > , # [doc = "Optional. True, if the administrator can edit messages of other users and can pin messages; channels only"] # [serde (skip_serializing_if = "Option::is_none" , rename = "can_edit_messages")] can_edit_messages : Option < bool > , # [doc = "Optional. True, if the user is allowed to pin messages; groups and supergroups only"] # [serde (skip_serializing_if = "Option::is_none" , rename = "can_pin_messages")] can_pin_messages : Option < bool > , # [doc = "Optional. Custom title for this user"] # [serde (skip_serializing_if = "Option::is_none" , rename = "custom_title")] custom_title : Option < String > } impl ChatMemberAdministratorBuilder { pub fn new (status : String , user : User , can_be_edited : bool , is_anonymous : bool , can_manage_chat : bool , can_delete_messages : bool , can_manage_video_chats : bool , can_restrict_members : bool , can_promote_members : bool , can_change_info : bool , can_invite_users : bool) -> Self { Self { status , user , can_be_edited , is_anonymous , can_manage_chat , can_delete_messages , can_manage_video_chats , can_restrict_members , can_promote_members , can_change_info , can_invite_users , can_post_messages : None , can_edit_messages : None , can_pin_messages : None , custom_title : None } } pub fn set_status (mut self , status : String) -> Self { self . status = status ; self } pub fn set_user (mut self , user : User) -> Self { self . user = user ; self } pub fn set_can_be_edited (mut self , can_be_edited : bool) -> Self { self . can_be_edited = can_be_edited ; self } pub fn set_is_anonymous (mut self , is_anonymous : bool) -> Self { self . is_anonymous = is_anonymous ; self } pub fn set_can_manage_chat (mut self , can_manage_chat : bool) -> Self { self . can_manage_chat = can_manage_chat ; self } pub fn set_can_delete_messages (mut self , can_delete_messages : bool) -> Self { self . can_delete_messages = can_delete_messages ; self } pub fn set_can_manage_video_chats (mut self , can_manage_video_chats : bool) -> Self { self . can_manage_video_chats = can_manage_video_chats ; self } pub fn set_can_restrict_members (mut self , can_restrict_members : bool) -> Self { self . can_restrict_members = can_restrict_members ; self } pub fn set_can_promote_members (mut self , can_promote_members : bool) -> Self { self . can_promote_members = can_promote_members ; self } pub fn set_can_change_info (mut self , can_change_info : bool) -> Self { self . can_change_info = can_change_info ; self } pub fn set_can_invite_users (mut self , can_invite_users : bool) -> Self { self . can_invite_users = can_invite_users ; self } pub fn set_can_post_messages (mut self , can_post_messages : Option < bool >) -> Self { self . can_post_messages = can_post_messages ; self } pub fn set_can_edit_messages (mut self , can_edit_messages : Option < bool >) -> Self { self . can_edit_messages = can_edit_messages ; self } pub fn set_can_pin_messages (mut self , can_pin_messages : Option < bool >) -> Self { self . can_pin_messages = can_pin_messages ; self } pub fn set_custom_title (mut self , custom_title : Option < String >) -> Self { self . custom_title = custom_title ; self } pub fn build (self) -> ChatMemberAdministrator { ChatMemberAdministrator { status : self . status , user : self . user , can_be_edited : self . can_be_edited , is_anonymous : self . is_anonymous , can_manage_chat : self . can_manage_chat , can_delete_messages : self . can_delete_messages , can_manage_video_chats : self . can_manage_video_chats , can_restrict_members : self . can_restrict_members , can_promote_members : self . can_promote_members , can_change_info : self . can_change_info , can_invite_users : self . can_invite_users , can_post_messages : self . can_post_messages , can_edit_messages : self . can_edit_messages , can_pin_messages : self . can_pin_messages , custom_title : self . custom_title } } } # [doc = "Represents an issue in an unspecified place. The error is considered resolved when new data is added."] # [derive (Serialize , Deserialize , Debug)] pub struct PassportElementErrorUnspecified { # [doc = "Error source, must be unspecified"] # [serde (rename = "source")] source : String , # [doc = "Type of element of the user's Telegram Passport which has the issue"] # [serde (rename = "type")] tg_type : String , # [doc = "Base64-encoded element hash"] # [serde (rename = "element_hash")] element_hash : String , # [doc = "Error message"] # [serde (rename = "message")] message : String } # [doc = "Represents an issue in an unspecified place. The error is considered resolved when new data is added."] # [derive (Serialize , Deserialize , Debug)] pub struct PassportElementErrorUnspecifiedBuilder { # [doc = "Error source, must be unspecified"] # [serde (rename = "source")] source : String , # [doc = "Type of element of the user's Telegram Passport which has the issue"] # [serde (rename = "type")] tg_type : String , # [doc = "Base64-encoded element hash"] # [serde (rename = "element_hash")] element_hash : String , # [doc = "Error message"] # [serde (rename = "message")] message : String } impl PassportElementErrorUnspecifiedBuilder { pub fn new (source : String , element_hash : String , message : String) -> Self { Self { tg_type : "PassportElementErrorUnspecified" . to_owned () , source , element_hash , message , } } pub fn set_source (mut self , source : String) -> Self { self . source = source ; self } pub fn set_type (mut self , tg_type : String) -> Self { self . tg_type = tg_type ; self } pub fn set_element_hash (mut self , element_hash : String) -> Self { self . element_hash = element_hash ; self } pub fn set_message (mut self , message : String) -> Self { self . message = message ; self } pub fn build (self) -> PassportElementErrorUnspecified { PassportElementErrorUnspecified { source : self . source , tg_type : self . tg_type , element_hash : self . element_hash , message : self . message } } } # [doc = "Represents the content of an invoice message to be sent as the result of an inline query."] # [derive (Serialize , Deserialize , Debug)] pub struct InputInvoiceMessageContent { # [doc = "Product name, 1-32 characters"] # [serde (rename = "title")] title : String , # [doc = "Product description, 1-255 characters"] # [serde (rename = "description")] description : String , # [doc = "Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes."] # [serde (rename = "payload")] payload : String , # [doc = "Payment provider token, obtained via @BotFather"] # [serde (rename = "provider_token")] provider_token : String , # [doc = "Three-letter ISO 4217 currency code, see more on currencies"] # [serde (rename = "currency")] currency : String , # [doc = "Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.)"] # [serde (rename = "prices")] prices : Vec < LabeledPrice > , # [doc = "Optional. The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass max_tip_amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0"] # [serde (skip_serializing_if = "Option::is_none" , rename = "max_tip_amount")] max_tip_amount : Option < i64 > , # [doc = "Optional. A JSON-serialized array of suggested amounts of tip in the smallest units of the currency (integer, not float/double). At most 4 suggested tip amounts can be specified. The suggested tip amounts must be positive, passed in a strictly increased order and must not exceed max_tip_amount."] # [serde (skip_serializing_if = "Option::is_none" , rename = "suggested_tip_amounts")] suggested_tip_amounts : Option < Vec < i64 > > , # [doc = "Optional. A JSON-serialized object for data about the invoice, which will be shared with the payment provider. A detailed description of the required fields should be provided by the payment provider."] # [serde (skip_serializing_if = "Option::is_none" , rename = "provider_data")] provider_data : Option < String > , # [doc = "Optional. URL of the product photo for the invoice. Can be a photo of the goods or a marketing image for a service."] # [serde (skip_serializing_if = "Option::is_none" , rename = "photo_url")] photo_url : Option < String > , # [doc = "Optional. Photo size in bytes"] # [serde (skip_serializing_if = "Option::is_none" , rename = "photo_size")] photo_size : Option < i64 > , # [doc = "Optional. Photo width"] # [serde (skip_serializing_if = "Option::is_none" , rename = "photo_width")] photo_width : Option < i64 > , # [doc = "Optional. Photo height"] # [serde (skip_serializing_if = "Option::is_none" , rename = "photo_height")] photo_height : Option < i64 > , # [doc = "Optional. Pass True if you require the user's full name to complete the order"] # [serde (skip_serializing_if = "Option::is_none" , rename = "need_name")] need_name : Option < bool > , # [doc = "Optional. Pass True if you require the user's phone number to complete the order"] # [serde (skip_serializing_if = "Option::is_none" , rename = "need_phone_number")] need_phone_number : Option < bool > , # [doc = "Optional. Pass True if you require the user's email address to complete the order"] # [serde (skip_serializing_if = "Option::is_none" , rename = "need_email")] need_email : Option < bool > , # [doc = "Optional. Pass True if you require the user's shipping address to complete the order"] # [serde (skip_serializing_if = "Option::is_none" , rename = "need_shipping_address")] need_shipping_address : Option < bool > , # [doc = "Optional. Pass True if the user's phone number should be sent to provider"] # [serde (skip_serializing_if = "Option::is_none" , rename = "send_phone_number_to_provider")] send_phone_number_to_provider : Option < bool > , # [doc = "Optional. Pass True if the user's email address should be sent to provider"] # [serde (skip_serializing_if = "Option::is_none" , rename = "send_email_to_provider")] send_email_to_provider : Option < bool > , # [doc = "Optional. Pass True if the final price depends on the shipping method"] # [serde (skip_serializing_if = "Option::is_none" , rename = "is_flexible")] is_flexible : Option < bool > } # [doc = "Represents the content of an invoice message to be sent as the result of an inline query."] # [derive (Serialize , Deserialize , Debug)] pub struct InputInvoiceMessageContentBuilder { # [doc = "Product name, 1-32 characters"] # [serde (rename = "title")] title : String , # [doc = "Product description, 1-255 characters"] # [serde (rename = "description")] description : String , # [doc = "Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes."] # [serde (rename = "payload")] payload : String , # [doc = "Payment provider token, obtained via @BotFather"] # [serde (rename = "provider_token")] provider_token : String , # [doc = "Three-letter ISO 4217 currency code, see more on currencies"] # [serde (rename = "currency")] currency : String , # [doc = "Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.)"] # [serde (rename = "prices")] prices : Vec < LabeledPrice > , # [doc = "Optional. The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass max_tip_amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0"] # [serde (skip_serializing_if = "Option::is_none" , rename = "max_tip_amount")] max_tip_amount : Option < i64 > , # [doc = "Optional. A JSON-serialized array of suggested amounts of tip in the smallest units of the currency (integer, not float/double). At most 4 suggested tip amounts can be specified. The suggested tip amounts must be positive, passed in a strictly increased order and must not exceed max_tip_amount."] # [serde (skip_serializing_if = "Option::is_none" , rename = "suggested_tip_amounts")] suggested_tip_amounts : Option < Vec < i64 > > , # [doc = "Optional. A JSON-serialized object for data about the invoice, which will be shared with the payment provider. A detailed description of the required fields should be provided by the payment provider."] # [serde (skip_serializing_if = "Option::is_none" , rename = "provider_data")] provider_data : Option < String > , # [doc = "Optional. URL of the product photo for the invoice. Can be a photo of the goods or a marketing image for a service."] # [serde (skip_serializing_if = "Option::is_none" , rename = "photo_url")] photo_url : Option < String > , # [doc = "Optional. Photo size in bytes"] # [serde (skip_serializing_if = "Option::is_none" , rename = "photo_size")] photo_size : Option < i64 > , # [doc = "Optional. Photo width"] # [serde (skip_serializing_if = "Option::is_none" , rename = "photo_width")] photo_width : Option < i64 > , # [doc = "Optional. Photo height"] # [serde (skip_serializing_if = "Option::is_none" , rename = "photo_height")] photo_height : Option < i64 > , # [doc = "Optional. Pass True if you require the user's full name to complete the order"] # [serde (skip_serializing_if = "Option::is_none" , rename = "need_name")] need_name : Option < bool > , # [doc = "Optional. Pass True if you require the user's phone number to complete the order"] # [serde (skip_serializing_if = "Option::is_none" , rename = "need_phone_number")] need_phone_number : Option < bool > , # [doc = "Optional. Pass True if you require the user's email address to complete the order"] # [serde (skip_serializing_if = "Option::is_none" , rename = "need_email")] need_email : Option < bool > , # [doc = "Optional. Pass True if you require the user's shipping address to complete the order"] # [serde (skip_serializing_if = "Option::is_none" , rename = "need_shipping_address")] need_shipping_address : Option < bool > , # [doc = "Optional. Pass True if the user's phone number should be sent to provider"] # [serde (skip_serializing_if = "Option::is_none" , rename = "send_phone_number_to_provider")] send_phone_number_to_provider : Option < bool > , # [doc = "Optional. Pass True if the user's email address should be sent to provider"] # [serde (skip_serializing_if = "Option::is_none" , rename = "send_email_to_provider")] send_email_to_provider : Option < bool > , # [doc = "Optional. Pass True if the final price depends on the shipping method"] # [serde (skip_serializing_if = "Option::is_none" , rename = "is_flexible")] is_flexible : Option < bool > } impl InputInvoiceMessageContentBuilder { pub fn new (title : String , description : String , payload : String , provider_token : String , currency : String , prices : Vec < LabeledPrice >) -> Self { Self { title , description , payload , provider_token , currency , prices , max_tip_amount : None , suggested_tip_amounts : None , provider_data : None , photo_url : None , photo_size : None , photo_width : None , photo_height : None , need_name : None , need_phone_number : None , need_email : None , need_shipping_address : None , send_phone_number_to_provider : None , send_email_to_provider : None , is_flexible : None } } pub fn set_title (mut self , title : String) -> Self { self . title = title ; self } pub fn set_description (mut self , description : String) -> Self { self . description = description ; self } pub fn set_payload (mut self , payload : String) -> Self { self . payload = payload ; self } pub fn set_provider_token (mut self , provider_token : String) -> Self { self . provider_token = provider_token ; self } pub fn set_currency (mut self , currency : String) -> Self { self . currency = currency ; self } pub fn set_prices (mut self , prices : Vec < LabeledPrice >) -> Self { self . prices = prices ; self } pub fn set_max_tip_amount (mut self , max_tip_amount : Option < i64 >) -> Self { self . max_tip_amount = max_tip_amount ; self } pub fn set_suggested_tip_amounts (mut self , suggested_tip_amounts : Option < Vec < i64 > >) -> Self { self . suggested_tip_amounts = suggested_tip_amounts ; self } pub fn set_provider_data (mut self , provider_data : Option < String >) -> Self { self . provider_data = provider_data ; self } pub fn set_photo_url (mut self , photo_url : Option < String >) -> Self { self . photo_url = photo_url ; self } pub fn set_photo_size (mut self , photo_size : Option < i64 >) -> Self { self . photo_size = photo_size ; self } pub fn set_photo_width (mut self , photo_width : Option < i64 >) -> Self { self . photo_width = photo_width ; self } pub fn set_photo_height (mut self , photo_height : Option < i64 >) -> Self { self . photo_height = photo_height ; self } pub fn set_need_name (mut self , need_name : Option < bool >) -> Self { self . need_name = need_name ; self } pub fn set_need_phone_number (mut self , need_phone_number : Option < bool >) -> Self { self . need_phone_number = need_phone_number ; self } pub fn set_need_email (mut self , need_email : Option < bool >) -> Self { self . need_email = need_email ; self } pub fn set_need_shipping_address (mut self , need_shipping_address : Option < bool >) -> Self { self . need_shipping_address = need_shipping_address ; self } pub fn set_send_phone_number_to_provider (mut self , send_phone_number_to_provider : Option < bool >) -> Self { self . send_phone_number_to_provider = send_phone_number_to_provider ; self } pub fn set_send_email_to_provider (mut self , send_email_to_provider : Option < bool >) -> Self { self . send_email_to_provider = send_email_to_provider ; self } pub fn set_is_flexible (mut self , is_flexible : Option < bool >) -> Self { self . is_flexible = is_flexible ; self } pub fn build (self) -> InputInvoiceMessageContent { InputInvoiceMessageContent { title : self . title , description : self . description , payload : self . payload , provider_token : self . provider_token , currency : self . currency , prices : self . prices , max_tip_amount : self . max_tip_amount , suggested_tip_amounts : self . suggested_tip_amounts , provider_data : self . provider_data , photo_url : self . photo_url , photo_size : self . photo_size , photo_width : self . photo_width , photo_height : self . photo_height , need_name : self . need_name , need_phone_number : self . need_phone_number , need_email : self . need_email , need_shipping_address : self . need_shipping_address , send_phone_number_to_provider : self . send_phone_number_to_provider , send_email_to_provider : self . send_email_to_provider , is_flexible : self . is_flexible } } } # [doc = "Represents a menu button, which launches a Web App."] # [derive (Serialize , Deserialize , Debug)] pub struct MenuButtonWebApp { # [doc = "Type of the button, must be web_app"] # [serde (rename = "type")] tg_type : String , # [doc = "Text on the button"] # [serde (rename = "text")] text : String , # [doc = "Description of the Web App that will be launched when the user presses the button. The Web App will be able to send an arbitrary message on behalf of the user using the method answerWebAppQuery."] # [serde (rename = "web_app")] web_app : WebAppInfo } # [doc = "Represents a menu button, which launches a Web App."] # [derive (Serialize , Deserialize , Debug)] pub struct MenuButtonWebAppBuilder { # [doc = "Type of the button, must be web_app"] # [serde (rename = "type")] tg_type : String , # [doc = "Text on the button"] # [serde (rename = "text")] text : String , # [doc = "Description of the Web App that will be launched when the user presses the button. The Web App will be able to send an arbitrary message on behalf of the user using the method answerWebAppQuery."] # [serde (rename = "web_app")] web_app : WebAppInfo } impl MenuButtonWebAppBuilder { pub fn new (text : String , web_app : WebAppInfo) -> Self { Self { tg_type : "web_app" . to_owned () , text , web_app , } } pub fn set_type (mut self , tg_type : String) -> Self { self . tg_type = tg_type ; self } pub fn set_text (mut self , text : String) -> Self { self . text = text ; self } pub fn set_web_app (mut self , web_app : WebAppInfo) -> Self { self . web_app = web_app ; self } pub fn build (self) -> MenuButtonWebApp { MenuButtonWebApp { tg_type : self . tg_type , text : self . text , web_app : self . web_app } } } # [doc = "This object represents an audio file to be treated as music by the Telegram clients."] # [derive (Serialize , Deserialize , Debug)] pub struct Audio { # [doc = "Identifier for this file, which can be used to download or reuse the file"] # [serde (rename = "file_id")] file_id : String , # [doc = "Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file."] # [serde (rename = "file_unique_id")] file_unique_id : String , # [doc = "Duration of the audio in seconds as defined by sender"] # [serde (rename = "duration")] duration : i64 , # [doc = "Optional. Performer of the audio as defined by sender or by audio tags"] # [serde (skip_serializing_if = "Option::is_none" , rename = "performer")] performer : Option < String > , # [doc = "Optional. Title of the audio as defined by sender or by audio tags"] # [serde (skip_serializing_if = "Option::is_none" , rename = "title")] title : Option < String > , # [doc = "Optional. Original filename as defined by sender"] # [serde (skip_serializing_if = "Option::is_none" , rename = "file_name")] file_name : Option < String > , # [doc = "Optional. MIME type of the file as defined by sender"] # [serde (skip_serializing_if = "Option::is_none" , rename = "mime_type")] mime_type : Option < String > , # [doc = "Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value."] # [serde (skip_serializing_if = "Option::is_none" , rename = "file_size")] file_size : Option < i64 > , # [doc = "Optional. Thumbnail of the album cover to which the music file belongs"] # [serde (skip_serializing_if = "Option::is_none" , rename = "thumb")] thumb : Option < PhotoSize > } # [doc = "This object represents an audio file to be treated as music by the Telegram clients."] # [derive (Serialize , Deserialize , Debug)] pub struct AudioBuilder { # [doc = "Identifier for this file, which can be used to download or reuse the file"] # [serde (rename = "file_id")] file_id : String , # [doc = "Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file."] # [serde (rename = "file_unique_id")] file_unique_id : String , # [doc = "Duration of the audio in seconds as defined by sender"] # [serde (rename = "duration")] duration : i64 , # [doc = "Optional. Performer of the audio as defined by sender or by audio tags"] # [serde (skip_serializing_if = "Option::is_none" , rename = "performer")] performer : Option < String > , # [doc = "Optional. Title of the audio as defined by sender or by audio tags"] # [serde (skip_serializing_if = "Option::is_none" , rename = "title")] title : Option < String > , # [doc = "Optional. Original filename as defined by sender"] # [serde (skip_serializing_if = "Option::is_none" , rename = "file_name")] file_name : Option < String > , # [doc = "Optional. MIME type of the file as defined by sender"] # [serde (skip_serializing_if = "Option::is_none" , rename = "mime_type")] mime_type : Option < String > , # [doc = "Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value."] # [serde (skip_serializing_if = "Option::is_none" , rename = "file_size")] file_size : Option < i64 > , # [doc = "Optional. Thumbnail of the album cover to which the music file belongs"] # [serde (skip_serializing_if = "Option::is_none" , rename = "thumb")] thumb : Option < PhotoSize > } impl AudioBuilder { pub fn new (file_id : String , file_unique_id : String , duration : i64) -> Self { Self { file_id , file_unique_id , duration , performer : None , title : None , file_name : None , mime_type : None , file_size : None , thumb : None } } pub fn set_file_id (mut self , file_id : String) -> Self { self . file_id = file_id ; self } pub fn set_file_unique_id (mut self , file_unique_id : String) -> Self { self . file_unique_id = file_unique_id ; self } pub fn set_duration (mut self , duration : i64) -> Self { self . duration = duration ; self } pub fn set_performer (mut self , performer : Option < String >) -> Self { self . performer = performer ; self } pub fn set_title (mut self , title : Option < String >) -> Self { self . title = title ; self } pub fn set_file_name (mut self , file_name : Option < String >) -> Self { self . file_name = file_name ; self } pub fn set_mime_type (mut self , mime_type : Option < String >) -> Self { self . mime_type = mime_type ; self } pub fn set_file_size (mut self , file_size : Option < i64 >) -> Self { self . file_size = file_size ; self } pub fn set_thumb (mut self , thumb : Option < PhotoSize >) -> Self { self . thumb = thumb ; self } pub fn build (self) -> Audio { Audio { file_id : self . file_id , file_unique_id : self . file_unique_id , duration : self . duration , performer : self . performer , title : self . title , file_name : self . file_name , mime_type : self . mime_type , file_size : self . file_size , thumb : self . thumb } } } # [doc = "This object represents a parameter of the inline keyboard button used to automatically authorize a user. Serves as a great replacement for the Telegram Login Widget when the user is coming from Telegram. All the user needs to do is tap/click a button and confirm that they want to log in:Telegram apps support these buttons as of version 5.7."] # [derive (Serialize , Deserialize , Debug)] pub struct LoginUrl { # [doc = "An HTTPS URL to be opened with user authorization data added to the query string when the button is pressed. If the user refuses to provide authorization data, the original URL without information about the user will be opened. The data added is the same as described in Receiving authorization data. NOTE: You must always check the hash of the received data to verify the authentication and the integrity of the data as described in Checking authorization."] # [serde (rename = "url")] url : String , # [doc = "Optional. New text of the button in forwarded messages."] # [serde (skip_serializing_if = "Option::is_none" , rename = "forward_text")] forward_text : Option < String > , # [doc = "Optional. Username of a bot, which will be used for user authorization. See Setting up a bot for more details. If not specified, the current bot's username will be assumed. The url's domain must be the same as the domain linked with the bot. See Linking your domain to the bot for more details."] # [serde (skip_serializing_if = "Option::is_none" , rename = "bot_username")] bot_username : Option < String > , # [doc = "Optional. Pass True to request the permission for your bot to send messages to the user."] # [serde (skip_serializing_if = "Option::is_none" , rename = "request_write_access")] request_write_access : Option < bool > } # [doc = "This object represents a parameter of the inline keyboard button used to automatically authorize a user. Serves as a great replacement for the Telegram Login Widget when the user is coming from Telegram. All the user needs to do is tap/click a button and confirm that they want to log in:Telegram apps support these buttons as of version 5.7."] # [derive (Serialize , Deserialize , Debug)] pub struct LoginUrlBuilder { # [doc = "An HTTPS URL to be opened with user authorization data added to the query string when the button is pressed. If the user refuses to provide authorization data, the original URL without information about the user will be opened. The data added is the same as described in Receiving authorization data. NOTE: You must always check the hash of the received data to verify the authentication and the integrity of the data as described in Checking authorization."] # [serde (rename = "url")] url : String , # [doc = "Optional. New text of the button in forwarded messages."] # [serde (skip_serializing_if = "Option::is_none" , rename = "forward_text")] forward_text : Option < String > , # [doc = "Optional. Username of a bot, which will be used for user authorization. See Setting up a bot for more details. If not specified, the current bot's username will be assumed. The url's domain must be the same as the domain linked with the bot. See Linking your domain to the bot for more details."] # [serde (skip_serializing_if = "Option::is_none" , rename = "bot_username")] bot_username : Option < String > , # [doc = "Optional. Pass True to request the permission for your bot to send messages to the user."] # [serde (skip_serializing_if = "Option::is_none" , rename = "request_write_access")] request_write_access : Option < bool > } impl LoginUrlBuilder { pub fn new (url : String) -> Self { Self { url , forward_text : None , bot_username : None , request_write_access : None } } pub fn set_url (mut self , url : String) -> Self { self . url = url ; self } pub fn set_forward_text (mut self , forward_text : Option < String >) -> Self { self . forward_text = forward_text ; self } pub fn set_bot_username (mut self , bot_username : Option < String >) -> Self { self . bot_username = bot_username ; self } pub fn set_request_write_access (mut self , request_write_access : Option < bool >) -> Self { self . request_write_access = request_write_access ; self } pub fn build (self) -> LoginUrl { LoginUrl { url : self . url , forward_text : self . forward_text , bot_username : self . bot_username , request_write_access : self . request_write_access } } } # [doc = "Represents a link to an animated GIF file. By default, this animated GIF file will be sent by the user with optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the animation."] # [derive (Serialize , Deserialize , Debug)] pub struct InlineQueryResultGif { # [doc = "Type of the result, must be gif"] # [serde (rename = "type")] tg_type : String , # [doc = "Unique identifier for this result, 1-64 bytes"] # [serde (rename = "id")] id : String , # [doc = "A valid URL for the GIF file. File size must not exceed 1MB"] # [serde (rename = "gif_url")] gif_url : String , # [doc = "Optional. Width of the GIF"] # [serde (skip_serializing_if = "Option::is_none" , rename = "gif_width")] gif_width : Option < i64 > , # [doc = "Optional. Height of the GIF"] # [serde (skip_serializing_if = "Option::is_none" , rename = "gif_height")] gif_height : Option < i64 > , # [doc = "Optional. Duration of the GIF in seconds"] # [serde (skip_serializing_if = "Option::is_none" , rename = "gif_duration")] gif_duration : Option < i64 > , # [doc = "URL of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the result"] # [serde (rename = "thumb_url")] thumb_url : String , # [doc = "Optional. MIME type of the thumbnail, must be one of \"image/jpeg\", \"image/gif\", or \"video/mp4\". Defaults to \"image/jpeg\""] # [serde (skip_serializing_if = "Option::is_none" , rename = "thumb_mime_type")] thumb_mime_type : Option < String > , # [doc = "Optional. Title for the result"] # [serde (skip_serializing_if = "Option::is_none" , rename = "title")] title : Option < String > , # [doc = "Optional. Caption of the GIF file to be sent, 0-1024 characters after entities parsing"] # [serde (skip_serializing_if = "Option::is_none" , rename = "caption")] caption : Option < String > , # [doc = "Optional. Mode for parsing entities in the caption. See formatting options for more details."] # [serde (skip_serializing_if = "Option::is_none" , rename = "parse_mode")] parse_mode : Option < String > , # [doc = "Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode"] # [serde (skip_serializing_if = "Option::is_none" , rename = "caption_entities")] caption_entities : Option < Vec < MessageEntity > > , # [doc = "Optional. Inline keyboard attached to the message"] # [serde (skip_serializing_if = "Option::is_none" , rename = "reply_markup")] reply_markup : Option < InlineKeyboardMarkup > , # [doc = "Optional. Content of the message to be sent instead of the GIF animation"] # [serde (skip_serializing_if = "Option::is_none" , rename = "input_message_content")] input_message_content : Option < InputMessageContent > } # [doc = "Represents a link to an animated GIF file. By default, this animated GIF file will be sent by the user with optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the animation."] # [derive (Serialize , Deserialize , Debug)] pub struct InlineQueryResultGifBuilder { # [doc = "Type of the result, must be gif"] # [serde (rename = "type")] tg_type : String , # [doc = "Unique identifier for this result, 1-64 bytes"] # [serde (rename = "id")] id : String , # [doc = "A valid URL for the GIF file. File size must not exceed 1MB"] # [serde (rename = "gif_url")] gif_url : String , # [doc = "Optional. Width of the GIF"] # [serde (skip_serializing_if = "Option::is_none" , rename = "gif_width")] gif_width : Option < i64 > , # [doc = "Optional. Height of the GIF"] # [serde (skip_serializing_if = "Option::is_none" , rename = "gif_height")] gif_height : Option < i64 > , # [doc = "Optional. Duration of the GIF in seconds"] # [serde (skip_serializing_if = "Option::is_none" , rename = "gif_duration")] gif_duration : Option < i64 > , # [doc = "URL of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the result"] # [serde (rename = "thumb_url")] thumb_url : String , # [doc = "Optional. MIME type of the thumbnail, must be one of \"image/jpeg\", \"image/gif\", or \"video/mp4\". Defaults to \"image/jpeg\""] # [serde (skip_serializing_if = "Option::is_none" , rename = "thumb_mime_type")] thumb_mime_type : Option < String > , # [doc = "Optional. Title for the result"] # [serde (skip_serializing_if = "Option::is_none" , rename = "title")] title : Option < String > , # [doc = "Optional. Caption of the GIF file to be sent, 0-1024 characters after entities parsing"] # [serde (skip_serializing_if = "Option::is_none" , rename = "caption")] caption : Option < String > , # [doc = "Optional. Mode for parsing entities in the caption. See formatting options for more details."] # [serde (skip_serializing_if = "Option::is_none" , rename = "parse_mode")] parse_mode : Option < String > , # [doc = "Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode"] # [serde (skip_serializing_if = "Option::is_none" , rename = "caption_entities")] caption_entities : Option < Vec < MessageEntity > > , # [doc = "Optional. Inline keyboard attached to the message"] # [serde (skip_serializing_if = "Option::is_none" , rename = "reply_markup")] reply_markup : Option < InlineKeyboardMarkup > , # [doc = "Optional. Content of the message to be sent instead of the GIF animation"] # [serde (skip_serializing_if = "Option::is_none" , rename = "input_message_content")] input_message_content : Option < InputMessageContent > } impl InlineQueryResultGifBuilder { pub fn new (id : String , gif_url : String , thumb_url : String) -> Self { Self { tg_type : "gif" . to_owned () , id , gif_url , thumb_url , gif_width : None , gif_height : None , gif_duration : None , thumb_mime_type : None , title : None , caption : None , parse_mode : None , caption_entities : None , reply_markup : None , input_message_content : None } } pub fn set_type (mut self , tg_type : String) -> Self { self . tg_type = tg_type ; self } pub fn set_id (mut self , id : String) -> Self { self . id = id ; self } pub fn set_gif_url (mut self , gif_url : String) -> Self { self . gif_url = gif_url ; self } pub fn set_gif_width (mut self , gif_width : Option < i64 >) -> Self { self . gif_width = gif_width ; self } pub fn set_gif_height (mut self , gif_height : Option < i64 >) -> Self { self . gif_height = gif_height ; self } pub fn set_gif_duration (mut self , gif_duration : Option < i64 >) -> Self { self . gif_duration = gif_duration ; self } pub fn set_thumb_url (mut self , thumb_url : String) -> Self { self . thumb_url = thumb_url ; self } pub fn set_thumb_mime_type (mut self , thumb_mime_type : Option < String >) -> Self { self . thumb_mime_type = thumb_mime_type ; self } pub fn set_title (mut self , title : Option < String >) -> Self { self . title = title ; self } pub fn set_caption (mut self , caption : Option < String >) -> Self { self . caption = caption ; self } pub fn set_parse_mode (mut self , parse_mode : Option < String >) -> Self { self . parse_mode = parse_mode ; self } pub fn set_caption_entities (mut self , caption_entities : Option < Vec < MessageEntity > >) -> Self { self . caption_entities = caption_entities ; self } pub fn set_reply_markup (mut self , reply_markup : Option < InlineKeyboardMarkup >) -> Self { self . reply_markup = reply_markup ; self } pub fn set_input_message_content (mut self , input_message_content : Option < InputMessageContent >) -> Self { self . input_message_content = input_message_content ; self } pub fn build (self) -> InlineQueryResultGif { InlineQueryResultGif { tg_type : self . tg_type , id : self . id , gif_url : self . gif_url , gif_width : self . gif_width , gif_height : self . gif_height , gif_duration : self . gif_duration , thumb_url : self . thumb_url , thumb_mime_type : self . thumb_mime_type , title : self . title , caption : self . caption , parse_mode : self . parse_mode , caption_entities : self . caption_entities , reply_markup : self . reply_markup , input_message_content : self . input_message_content } } } # [doc = "Describes the current status of a webhook."] # [derive (Serialize , Deserialize , Debug)] pub struct WebhookInfo { # [doc = "Webhook URL, may be empty if webhook is not set up"] # [serde (rename = "url")] url : String , # [doc = "True, if a custom certificate was provided for webhook certificate checks"] # [serde (rename = "has_custom_certificate")] has_custom_certificate : bool , # [doc = "Number of updates awaiting delivery"] # [serde (rename = "pending_update_count")] pending_update_count : i64 , # [doc = "Optional. Currently used webhook IP address"] # [serde (skip_serializing_if = "Option::is_none" , rename = "ip_address")] ip_address : Option < String > , # [doc = "Optional. Unix time for the most recent error that happened when trying to deliver an update via webhook"] # [serde (skip_serializing_if = "Option::is_none" , rename = "last_error_date")] last_error_date : Option < i64 > , # [doc = "Optional. Error message in human-readable format for the most recent error that happened when trying to deliver an update via webhook"] # [serde (skip_serializing_if = "Option::is_none" , rename = "last_error_message")] last_error_message : Option < String > , # [doc = "Optional. Unix time of the most recent error that happened when trying to synchronize available updates with Telegram datacenters"] # [serde (skip_serializing_if = "Option::is_none" , rename = "last_synchronization_error_date")] last_synchronization_error_date : Option < i64 > , # [doc = "Optional. The maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery"] # [serde (skip_serializing_if = "Option::is_none" , rename = "max_connections")] max_connections : Option < i64 > , # [doc = "Optional. A list of update types the bot is subscribed to. Defaults to all update types except chat_member"] # [serde (skip_serializing_if = "Option::is_none" , rename = "allowed_updates")] allowed_updates : Option < Vec < String > > } # [doc = "Describes the current status of a webhook."] # [derive (Serialize , Deserialize , Debug)] pub struct WebhookInfoBuilder { # [doc = "Webhook URL, may be empty if webhook is not set up"] # [serde (rename = "url")] url : String , # [doc = "True, if a custom certificate was provided for webhook certificate checks"] # [serde (rename = "has_custom_certificate")] has_custom_certificate : bool , # [doc = "Number of updates awaiting delivery"] # [serde (rename = "pending_update_count")] pending_update_count : i64 , # [doc = "Optional. Currently used webhook IP address"] # [serde (skip_serializing_if = "Option::is_none" , rename = "ip_address")] ip_address : Option < String > , # [doc = "Optional. Unix time for the most recent error that happened when trying to deliver an update via webhook"] # [serde (skip_serializing_if = "Option::is_none" , rename = "last_error_date")] last_error_date : Option < i64 > , # [doc = "Optional. Error message in human-readable format for the most recent error that happened when trying to deliver an update via webhook"] # [serde (skip_serializing_if = "Option::is_none" , rename = "last_error_message")] last_error_message : Option < String > , # [doc = "Optional. Unix time of the most recent error that happened when trying to synchronize available updates with Telegram datacenters"] # [serde (skip_serializing_if = "Option::is_none" , rename = "last_synchronization_error_date")] last_synchronization_error_date : Option < i64 > , # [doc = "Optional. The maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery"] # [serde (skip_serializing_if = "Option::is_none" , rename = "max_connections")] max_connections : Option < i64 > , # [doc = "Optional. A list of update types the bot is subscribed to. Defaults to all update types except chat_member"] # [serde (skip_serializing_if = "Option::is_none" , rename = "allowed_updates")] allowed_updates : Option < Vec < String > > } impl WebhookInfoBuilder { pub fn new (url : String , has_custom_certificate : bool , pending_update_count : i64) -> Self { Self { url , has_custom_certificate , pending_update_count , ip_address : None , last_error_date : None , last_error_message : None , last_synchronization_error_date : None , max_connections : None , allowed_updates : None } } pub fn set_url (mut self , url : String) -> Self { self . url = url ; self } pub fn set_has_custom_certificate (mut self , has_custom_certificate : bool) -> Self { self . has_custom_certificate = has_custom_certificate ; self } pub fn set_pending_update_count (mut self , pending_update_count : i64) -> Self { self . pending_update_count = pending_update_count ; self } pub fn set_ip_address (mut self , ip_address : Option < String >) -> Self { self . ip_address = ip_address ; self } pub fn set_last_error_date (mut self , last_error_date : Option < i64 >) -> Self { self . last_error_date = last_error_date ; self } pub fn set_last_error_message (mut self , last_error_message : Option < String >) -> Self { self . last_error_message = last_error_message ; self } pub fn set_last_synchronization_error_date (mut self , last_synchronization_error_date : Option < i64 >) -> Self { self . last_synchronization_error_date = last_synchronization_error_date ; self } pub fn set_max_connections (mut self , max_connections : Option < i64 >) -> Self { self . max_connections = max_connections ; self } pub fn set_allowed_updates (mut self , allowed_updates : Option < Vec < String > >) -> Self { self . allowed_updates = allowed_updates ; self } pub fn build (self) -> WebhookInfo { WebhookInfo { url : self . url , has_custom_certificate : self . has_custom_certificate , pending_update_count : self . pending_update_count , ip_address : self . ip_address , last_error_date : self . last_error_date , last_error_message : self . last_error_message , last_synchronization_error_date : self . last_synchronization_error_date , max_connections : self . max_connections , allowed_updates : self . allowed_updates } } } # [doc = "This object contains basic information about a successful payment."] # [derive (Serialize , Deserialize , Debug)] pub struct SuccessfulPayment { # [doc = "Three-letter ISO 4217 currency code"] # [serde (rename = "currency")] currency : String , # [doc = "Total price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies)."] # [serde (rename = "total_amount")] total_amount : i64 , # [doc = "Bot specified invoice payload"] # [serde (rename = "invoice_payload")] invoice_payload : String , # [doc = "Optional. Identifier of the shipping option chosen by the user"] # [serde (skip_serializing_if = "Option::is_none" , rename = "shipping_option_id")] shipping_option_id : Option < String > , # [doc = "Optional. Order information provided by the user"] # [serde (skip_serializing_if = "Option::is_none" , rename = "order_info")] order_info : Option < OrderInfo > , # [doc = "Telegram payment identifier"] # [serde (rename = "telegram_payment_charge_id")] telegram_payment_charge_id : String , # [doc = "Provider payment identifier"] # [serde (rename = "provider_payment_charge_id")] provider_payment_charge_id : String } # [doc = "This object contains basic information about a successful payment."] # [derive (Serialize , Deserialize , Debug)] pub struct SuccessfulPaymentBuilder { # [doc = "Three-letter ISO 4217 currency code"] # [serde (rename = "currency")] currency : String , # [doc = "Total price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies)."] # [serde (rename = "total_amount")] total_amount : i64 , # [doc = "Bot specified invoice payload"] # [serde (rename = "invoice_payload")] invoice_payload : String , # [doc = "Optional. Identifier of the shipping option chosen by the user"] # [serde (skip_serializing_if = "Option::is_none" , rename = "shipping_option_id")] shipping_option_id : Option < String > , # [doc = "Optional. Order information provided by the user"] # [serde (skip_serializing_if = "Option::is_none" , rename = "order_info")] order_info : Option < OrderInfo > , # [doc = "Telegram payment identifier"] # [serde (rename = "telegram_payment_charge_id")] telegram_payment_charge_id : String , # [doc = "Provider payment identifier"] # [serde (rename = "provider_payment_charge_id")] provider_payment_charge_id : String } impl SuccessfulPaymentBuilder { pub fn new (currency : String , total_amount : i64 , invoice_payload : String , telegram_payment_charge_id : String , provider_payment_charge_id : String) -> Self { Self { currency , total_amount , invoice_payload , telegram_payment_charge_id , provider_payment_charge_id , shipping_option_id : None , order_info : None } } pub fn set_currency (mut self , currency : String) -> Self { self . currency = currency ; self } pub fn set_total_amount (mut self , total_amount : i64) -> Self { self . total_amount = total_amount ; self } pub fn set_invoice_payload (mut self , invoice_payload : String) -> Self { self . invoice_payload = invoice_payload ; self } pub fn set_shipping_option_id (mut self , shipping_option_id : Option < String >) -> Self { self . shipping_option_id = shipping_option_id ; self } pub fn set_order_info (mut self , order_info : Option < OrderInfo >) -> Self { self . order_info = order_info ; self } pub fn set_telegram_payment_charge_id (mut self , telegram_payment_charge_id : String) -> Self { self . telegram_payment_charge_id = telegram_payment_charge_id ; self } pub fn set_provider_payment_charge_id (mut self , provider_payment_charge_id : String) -> Self { self . provider_payment_charge_id = provider_payment_charge_id ; self } pub fn build (self) -> SuccessfulPayment { SuccessfulPayment { currency : self . currency , total_amount : self . total_amount , invoice_payload : self . invoice_payload , shipping_option_id : self . shipping_option_id , order_info : self . order_info , telegram_payment_charge_id : self . telegram_payment_charge_id , provider_payment_charge_id : self . provider_payment_charge_id } } } # [doc = "This object represents an animation file (GIF or H.264/MPEG-4 AVC video without sound)."] # [derive (Serialize , Deserialize , Debug)] pub struct Animation { # [doc = "Identifier for this file, which can be used to download or reuse the file"] # [serde (rename = "file_id")] file_id : String , # [doc = "Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file."] # [serde (rename = "file_unique_id")] file_unique_id : String , # [doc = "Video width as defined by sender"] # [serde (rename = "width")] width : i64 , # [doc = "Video height as defined by sender"] # [serde (rename = "height")] height : i64 , # [doc = "Duration of the video in seconds as defined by sender"] # [serde (rename = "duration")] duration : i64 , # [doc = "Optional. Animation thumbnail as defined by sender"] # [serde (skip_serializing_if = "Option::is_none" , rename = "thumb")] thumb : Option < PhotoSize > , # [doc = "Optional. Original animation filename as defined by sender"] # [serde (skip_serializing_if = "Option::is_none" , rename = "file_name")] file_name : Option < String > , # [doc = "Optional. MIME type of the file as defined by sender"] # [serde (skip_serializing_if = "Option::is_none" , rename = "mime_type")] mime_type : Option < String > , # [doc = "Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value."] # [serde (skip_serializing_if = "Option::is_none" , rename = "file_size")] file_size : Option < i64 > } # [doc = "This object represents an animation file (GIF or H.264/MPEG-4 AVC video without sound)."] # [derive (Serialize , Deserialize , Debug)] pub struct AnimationBuilder { # [doc = "Identifier for this file, which can be used to download or reuse the file"] # [serde (rename = "file_id")] file_id : String , # [doc = "Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file."] # [serde (rename = "file_unique_id")] file_unique_id : String , # [doc = "Video width as defined by sender"] # [serde (rename = "width")] width : i64 , # [doc = "Video height as defined by sender"] # [serde (rename = "height")] height : i64 , # [doc = "Duration of the video in seconds as defined by sender"] # [serde (rename = "duration")] duration : i64 , # [doc = "Optional. Animation thumbnail as defined by sender"] # [serde (skip_serializing_if = "Option::is_none" , rename = "thumb")] thumb : Option < PhotoSize > , # [doc = "Optional. Original animation filename as defined by sender"] # [serde (skip_serializing_if = "Option::is_none" , rename = "file_name")] file_name : Option < String > , # [doc = "Optional. MIME type of the file as defined by sender"] # [serde (skip_serializing_if = "Option::is_none" , rename = "mime_type")] mime_type : Option < String > , # [doc = "Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value."] # [serde (skip_serializing_if = "Option::is_none" , rename = "file_size")] file_size : Option < i64 > } impl AnimationBuilder { pub fn new (file_id : String , file_unique_id : String , width : i64 , height : i64 , duration : i64) -> Self { Self { file_id , file_unique_id , width , height , duration , thumb : None , file_name : None , mime_type : None , file_size : None } } pub fn set_file_id (mut self , file_id : String) -> Self { self . file_id = file_id ; self } pub fn set_file_unique_id (mut self , file_unique_id : String) -> Self { self . file_unique_id = file_unique_id ; self } pub fn set_width (mut self , width : i64) -> Self { self . width = width ; self } pub fn set_height (mut self , height : i64) -> Self { self . height = height ; self } pub fn set_duration (mut self , duration : i64) -> Self { self . duration = duration ; self } pub fn set_thumb (mut self , thumb : Option < PhotoSize >) -> Self { self . thumb = thumb ; self } pub fn set_file_name (mut self , file_name : Option < String >) -> Self { self . file_name = file_name ; self } pub fn set_mime_type (mut self , mime_type : Option < String >) -> Self { self . mime_type = mime_type ; self } pub fn set_file_size (mut self , file_size : Option < i64 >) -> Self { self . file_size = file_size ; self } pub fn build (self) -> Animation { Animation { file_id : self . file_id , file_unique_id : self . file_unique_id , width : self . width , height : self . height , duration : self . duration , thumb : self . thumb , file_name : self . file_name , mime_type : self . mime_type , file_size : self . file_size } } } # [doc = "Represents a venue. By default, the venue will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the venue.Note: This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them."] # [derive (Serialize , Deserialize , Debug)] pub struct InlineQueryResultVenue { # [doc = "Type of the result, must be venue"] # [serde (rename = "type")] tg_type : String , # [doc = "Unique identifier for this result, 1-64 Bytes"] # [serde (rename = "id")] id : String , # [doc = "Latitude of the venue location in degrees"] # [serde (rename = "latitude")] latitude : f64 , # [doc = "Longitude of the venue location in degrees"] # [serde (rename = "longitude")] longitude : f64 , # [doc = "Title of the venue"] # [serde (rename = "title")] title : String , # [doc = "Address of the venue"] # [serde (rename = "address")] address : String , # [doc = "Optional. Foursquare identifier of the venue if known"] # [serde (skip_serializing_if = "Option::is_none" , rename = "foursquare_id")] foursquare_id : Option < String > , # [doc = "Optional. Foursquare type of the venue, if known. (For example, \"arts_entertainment/default\", \"arts_entertainment/aquarium\" or \"food/icecream\".)"] # [serde (skip_serializing_if = "Option::is_none" , rename = "foursquare_type")] foursquare_type : Option < String > , # [doc = "Optional. Google Places identifier of the venue"] # [serde (skip_serializing_if = "Option::is_none" , rename = "google_place_id")] google_place_id : Option < String > , # [doc = "Optional. Google Places type of the venue. (See supported types.)"] # [serde (skip_serializing_if = "Option::is_none" , rename = "google_place_type")] google_place_type : Option < String > , # [doc = "Optional. Inline keyboard attached to the message"] # [serde (skip_serializing_if = "Option::is_none" , rename = "reply_markup")] reply_markup : Option < InlineKeyboardMarkup > , # [doc = "Optional. Content of the message to be sent instead of the venue"] # [serde (skip_serializing_if = "Option::is_none" , rename = "input_message_content")] input_message_content : Option < InputMessageContent > , # [doc = "Optional. Url of the thumbnail for the result"] # [serde (skip_serializing_if = "Option::is_none" , rename = "thumb_url")] thumb_url : Option < String > , # [doc = "Optional. Thumbnail width"] # [serde (skip_serializing_if = "Option::is_none" , rename = "thumb_width")] thumb_width : Option < i64 > , # [doc = "Optional. Thumbnail height"] # [serde (skip_serializing_if = "Option::is_none" , rename = "thumb_height")] thumb_height : Option < i64 > } # [doc = "Represents a venue. By default, the venue will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the venue.Note: This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them."] # [derive (Serialize , Deserialize , Debug)] pub struct InlineQueryResultVenueBuilder { # [doc = "Type of the result, must be venue"] # [serde (rename = "type")] tg_type : String , # [doc = "Unique identifier for this result, 1-64 Bytes"] # [serde (rename = "id")] id : String , # [doc = "Latitude of the venue location in degrees"] # [serde (rename = "latitude")] latitude : f64 , # [doc = "Longitude of the venue location in degrees"] # [serde (rename = "longitude")] longitude : f64 , # [doc = "Title of the venue"] # [serde (rename = "title")] title : String , # [doc = "Address of the venue"] # [serde (rename = "address")] address : String , # [doc = "Optional. Foursquare identifier of the venue if known"] # [serde (skip_serializing_if = "Option::is_none" , rename = "foursquare_id")] foursquare_id : Option < String > , # [doc = "Optional. Foursquare type of the venue, if known. (For example, \"arts_entertainment/default\", \"arts_entertainment/aquarium\" or \"food/icecream\".)"] # [serde (skip_serializing_if = "Option::is_none" , rename = "foursquare_type")] foursquare_type : Option < String > , # [doc = "Optional. Google Places identifier of the venue"] # [serde (skip_serializing_if = "Option::is_none" , rename = "google_place_id")] google_place_id : Option < String > , # [doc = "Optional. Google Places type of the venue. (See supported types.)"] # [serde (skip_serializing_if = "Option::is_none" , rename = "google_place_type")] google_place_type : Option < String > , # [doc = "Optional. Inline keyboard attached to the message"] # [serde (skip_serializing_if = "Option::is_none" , rename = "reply_markup")] reply_markup : Option < InlineKeyboardMarkup > , # [doc = "Optional. Content of the message to be sent instead of the venue"] # [serde (skip_serializing_if = "Option::is_none" , rename = "input_message_content")] input_message_content : Option < InputMessageContent > , # [doc = "Optional. Url of the thumbnail for the result"] # [serde (skip_serializing_if = "Option::is_none" , rename = "thumb_url")] thumb_url : Option < String > , # [doc = "Optional. Thumbnail width"] # [serde (skip_serializing_if = "Option::is_none" , rename = "thumb_width")] thumb_width : Option < i64 > , # [doc = "Optional. Thumbnail height"] # [serde (skip_serializing_if = "Option::is_none" , rename = "thumb_height")] thumb_height : Option < i64 > } impl InlineQueryResultVenueBuilder { pub fn new (id : String , latitude : f64 , longitude : f64 , title : String , address : String) -> Self { Self { tg_type : "venue" . to_owned () , id , latitude , longitude , title , address , foursquare_id : None , foursquare_type : None , google_place_id : None , google_place_type : None , reply_markup : None , input_message_content : None , thumb_url : None , thumb_width : None , thumb_height : None } } pub fn set_type (mut self , tg_type : String) -> Self { self . tg_type = tg_type ; self } pub fn set_id (mut self , id : String) -> Self { self . id = id ; self } pub fn set_latitude (mut self , latitude : f64) -> Self { self . latitude = latitude ; self } pub fn set_longitude (mut self , longitude : f64) -> Self { self . longitude = longitude ; self } pub fn set_title (mut self , title : String) -> Self { self . title = title ; self } pub fn set_address (mut self , address : String) -> Self { self . address = address ; self } pub fn set_foursquare_id (mut self , foursquare_id : Option < String >) -> Self { self . foursquare_id = foursquare_id ; self } pub fn set_foursquare_type (mut self , foursquare_type : Option < String >) -> Self { self . foursquare_type = foursquare_type ; self } pub fn set_google_place_id (mut self , google_place_id : Option < String >) -> Self { self . google_place_id = google_place_id ; self } pub fn set_google_place_type (mut self , google_place_type : Option < String >) -> Self { self . google_place_type = google_place_type ; self } pub fn set_reply_markup (mut self , reply_markup : Option < InlineKeyboardMarkup >) -> Self { self . reply_markup = reply_markup ; self } pub fn set_input_message_content (mut self , input_message_content : Option < InputMessageContent >) -> Self { self . input_message_content = input_message_content ; self } pub fn set_thumb_url (mut self , thumb_url : Option < String >) -> Self { self . thumb_url = thumb_url ; self } pub fn set_thumb_width (mut self , thumb_width : Option < i64 >) -> Self { self . thumb_width = thumb_width ; self } pub fn set_thumb_height (mut self , thumb_height : Option < i64 >) -> Self { self . thumb_height = thumb_height ; self } pub fn build (self) -> InlineQueryResultVenue { InlineQueryResultVenue { tg_type : self . tg_type , id : self . id , latitude : self . latitude , longitude : self . longitude , title : self . title , address : self . address , foursquare_id : self . foursquare_id , foursquare_type : self . foursquare_type , google_place_id : self . google_place_id , google_place_type : self . google_place_type , reply_markup : self . reply_markup , input_message_content : self . input_message_content , thumb_url : self . thumb_url , thumb_width : self . thumb_width , thumb_height : self . thumb_height } } } # [doc = "Represents an issue in one of the data fields that was provided by the user. The error is considered resolved when the field's value changes."] # [derive (Serialize , Deserialize , Debug)] pub struct PassportElementErrorDataField { # [doc = "Error source, must be data"] # [serde (rename = "source")] source : String , # [doc = "The section of the user's Telegram Passport which has the error, one of \"personal_details\", \"passport\", \"driver_license\", \"identity_card\", \"internal_passport\", \"address\""] # [serde (rename = "type")] tg_type : String , # [doc = "Name of the data field which has the error"] # [serde (rename = "field_name")] field_name : String , # [doc = "Base64-encoded data hash"] # [serde (rename = "data_hash")] data_hash : String , # [doc = "Error message"] # [serde (rename = "message")] message : String } # [doc = "Represents an issue in one of the data fields that was provided by the user. The error is considered resolved when the field's value changes."] # [derive (Serialize , Deserialize , Debug)] pub struct PassportElementErrorDataFieldBuilder { # [doc = "Error source, must be data"] # [serde (rename = "source")] source : String , # [doc = "The section of the user's Telegram Passport which has the error, one of \"personal_details\", \"passport\", \"driver_license\", \"identity_card\", \"internal_passport\", \"address\""] # [serde (rename = "type")] tg_type : String , # [doc = "Name of the data field which has the error"] # [serde (rename = "field_name")] field_name : String , # [doc = "Base64-encoded data hash"] # [serde (rename = "data_hash")] data_hash : String , # [doc = "Error message"] # [serde (rename = "message")] message : String } impl PassportElementErrorDataFieldBuilder { pub fn new (source : String , field_name : String , data_hash : String , message : String) -> Self { Self { tg_type : "PassportElementErrorDataField" . to_owned () , source , field_name , data_hash , message , } } pub fn set_source (mut self , source : String) -> Self { self . source = source ; self } pub fn set_type (mut self , tg_type : String) -> Self { self . tg_type = tg_type ; self } pub fn set_field_name (mut self , field_name : String) -> Self { self . field_name = field_name ; self } pub fn set_data_hash (mut self , data_hash : String) -> Self { self . data_hash = data_hash ; self } pub fn set_message (mut self , message : String) -> Self { self . message = message ; self } pub fn build (self) -> PassportElementErrorDataField { PassportElementErrorDataField { source : self . source , tg_type : self . tg_type , field_name : self . field_name , data_hash : self . data_hash , message : self . message } } } # [doc = "Describes why a request was unsuccessful."] # [derive (Serialize , Deserialize , Debug)] pub struct ResponseParameters { # [doc = "Optional. The group has been migrated to a supergroup with the specified identifier. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier."] # [serde (skip_serializing_if = "Option::is_none" , rename = "migrate_to_chat_id")] migrate_to_chat_id : Option < i64 > , # [doc = "Optional. In case of exceeding flood control, the number of seconds left to wait before the request can be repeated"] # [serde (skip_serializing_if = "Option::is_none" , rename = "retry_after")] retry_after : Option < i64 > } # [doc = "Describes why a request was unsuccessful."] # [derive (Serialize , Deserialize , Debug)] pub struct ResponseParametersBuilder { # [doc = "Optional. The group has been migrated to a supergroup with the specified identifier. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier."] # [serde (skip_serializing_if = "Option::is_none" , rename = "migrate_to_chat_id")] migrate_to_chat_id : Option < i64 > , # [doc = "Optional. In case of exceeding flood control, the number of seconds left to wait before the request can be repeated"] # [serde (skip_serializing_if = "Option::is_none" , rename = "retry_after")] retry_after : Option < i64 > } impl ResponseParametersBuilder { pub fn new () -> Self { Self { migrate_to_chat_id : None , retry_after : None } } pub fn set_migrate_to_chat_id (mut self , migrate_to_chat_id : Option < i64 >) -> Self { self . migrate_to_chat_id = migrate_to_chat_id ; self } pub fn set_retry_after (mut self , retry_after : Option < i64 >) -> Self { self . retry_after = retry_after ; self } pub fn build (self) -> ResponseParameters { ResponseParameters { migrate_to_chat_id : self . migrate_to_chat_id , retry_after : self . retry_after } } } # [derive (Serialize , Deserialize , Debug)] # [serde (untagged)] pub enum VideoChatStarted { } # [doc = "This object represents a custom keyboard with reply options (see Introduction to bots for details and examples)."] # [derive (Serialize , Deserialize , Debug)] pub struct ReplyKeyboardMarkup { # [doc = "Array of button rows, each represented by an Array of KeyboardButton objects"] # [serde (rename = "keyboard")] keyboard : Vec < Vec < KeyboardButton > > , # [doc = "Optional. Requests clients to resize the keyboard vertically for optimal fit (e.g., make the keyboard smaller if there are just two rows of buttons). Defaults to false, in which case the custom keyboard is always of the same height as the app's standard keyboard."] # [serde (skip_serializing_if = "Option::is_none" , rename = "resize_keyboard")] resize_keyboard : Option < bool > , # [doc = "Optional. Requests clients to hide the keyboard as soon as it's been used. The keyboard will still be available, but clients will automatically display the usual letter-keyboard in the chat - the user can press a special button in the input field to see the custom keyboard again. Defaults to false."] # [serde (skip_serializing_if = "Option::is_none" , rename = "one_time_keyboard")] one_time_keyboard : Option < bool > , # [doc = "Optional. The placeholder to be shown in the input field when the keyboard is active; 1-64 characters"] # [serde (skip_serializing_if = "Option::is_none" , rename = "input_field_placeholder")] input_field_placeholder : Option < String > , # [doc = "Optional. Use this parameter if you want to show the keyboard to specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply (has reply_to_message_id), sender of the original message. Example: A user requests to change the bot's language, bot replies to the request with a keyboard to select the new language. Other users in the group don't see the keyboard."] # [serde (skip_serializing_if = "Option::is_none" , rename = "selective")] selective : Option < bool > } # [doc = "This object represents a custom keyboard with reply options (see Introduction to bots for details and examples)."] # [derive (Serialize , Deserialize , Debug)] pub struct ReplyKeyboardMarkupBuilder { # [doc = "Array of button rows, each represented by an Array of KeyboardButton objects"] # [serde (rename = "keyboard")] keyboard : Vec < Vec < KeyboardButton > > , # [doc = "Optional. Requests clients to resize the keyboard vertically for optimal fit (e.g., make the keyboard smaller if there are just two rows of buttons). Defaults to false, in which case the custom keyboard is always of the same height as the app's standard keyboard."] # [serde (skip_serializing_if = "Option::is_none" , rename = "resize_keyboard")] resize_keyboard : Option < bool > , # [doc = "Optional. Requests clients to hide the keyboard as soon as it's been used. The keyboard will still be available, but clients will automatically display the usual letter-keyboard in the chat - the user can press a special button in the input field to see the custom keyboard again. Defaults to false."] # [serde (skip_serializing_if = "Option::is_none" , rename = "one_time_keyboard")] one_time_keyboard : Option < bool > , # [doc = "Optional. The placeholder to be shown in the input field when the keyboard is active; 1-64 characters"] # [serde (skip_serializing_if = "Option::is_none" , rename = "input_field_placeholder")] input_field_placeholder : Option < String > , # [doc = "Optional. Use this parameter if you want to show the keyboard to specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply (has reply_to_message_id), sender of the original message. Example: A user requests to change the bot's language, bot replies to the request with a keyboard to select the new language. Other users in the group don't see the keyboard."] # [serde (skip_serializing_if = "Option::is_none" , rename = "selective")] selective : Option < bool > } impl ReplyKeyboardMarkupBuilder { pub fn new (keyboard : Vec < Vec < KeyboardButton > >) -> Self { Self { keyboard , resize_keyboard : None , one_time_keyboard : None , input_field_placeholder : None , selective : None } } pub fn set_keyboard (mut self , keyboard : Vec < Vec < KeyboardButton > >) -> Self { self . keyboard = keyboard ; self } pub fn set_resize_keyboard (mut self , resize_keyboard : Option < bool >) -> Self { self . resize_keyboard = resize_keyboard ; self } pub fn set_one_time_keyboard (mut self , one_time_keyboard : Option < bool >) -> Self { self . one_time_keyboard = one_time_keyboard ; self } pub fn set_input_field_placeholder (mut self , input_field_placeholder : Option < String >) -> Self { self . input_field_placeholder = input_field_placeholder ; self } pub fn set_selective (mut self , selective : Option < bool >) -> Self { self . selective = selective ; self } pub fn build (self) -> ReplyKeyboardMarkup { ReplyKeyboardMarkup { keyboard : self . keyboard , resize_keyboard : self . resize_keyboard , one_time_keyboard : self . one_time_keyboard , input_field_placeholder : self . input_field_placeholder , selective : self . selective } } } # [derive (Serialize , Deserialize , Debug)] # [serde (untagged)] pub enum InlineQueryResult { InlineQueryResultCachedAudio (InlineQueryResultCachedAudio) , InlineQueryResultCachedDocument (InlineQueryResultCachedDocument) , InlineQueryResultCachedGif (InlineQueryResultCachedGif) , InlineQueryResultCachedMpeg4Gif (InlineQueryResultCachedMpeg4Gif) , InlineQueryResultCachedPhoto (InlineQueryResultCachedPhoto) , InlineQueryResultCachedSticker (InlineQueryResultCachedSticker) , InlineQueryResultCachedVideo (InlineQueryResultCachedVideo) , InlineQueryResultCachedVoice (InlineQueryResultCachedVoice) , InlineQueryResultArticle (InlineQueryResultArticle) , InlineQueryResultAudio (InlineQueryResultAudio) , InlineQueryResultContact (InlineQueryResultContact) , InlineQueryResultGame (InlineQueryResultGame) , InlineQueryResultDocument (InlineQueryResultDocument) , InlineQueryResultGif (InlineQueryResultGif) , InlineQueryResultLocation (InlineQueryResultLocation) , InlineQueryResultMpeg4Gif (InlineQueryResultMpeg4Gif) , InlineQueryResultPhoto (InlineQueryResultPhoto) , InlineQueryResultVenue (InlineQueryResultVenue) , InlineQueryResultVideo (InlineQueryResultVideo) , InlineQueryResultVoice (InlineQueryResultVoice) } # [doc = "Represents the scope of bot commands, covering all group and supergroup chat administrators."] # [derive (Serialize , Deserialize , Debug)] pub struct BotCommandScopeAllChatAdministrators { # [doc = "Scope type, must be all_chat_administrators"] # [serde (rename = "type")] tg_type : String } # [doc = "Represents the scope of bot commands, covering all group and supergroup chat administrators."] # [derive (Serialize , Deserialize , Debug)] pub struct BotCommandScopeAllChatAdministratorsBuilder { # [doc = "Scope type, must be all_chat_administrators"] # [serde (rename = "type")] tg_type : String } impl BotCommandScopeAllChatAdministratorsBuilder { pub fn new () -> Self { Self { tg_type : "all_chat_administrators" . to_owned () , } } pub fn set_type (mut self , tg_type : String) -> Self { self . tg_type = tg_type ; self } pub fn build (self) -> BotCommandScopeAllChatAdministrators { BotCommandScopeAllChatAdministrators { tg_type : self . tg_type } } } # [doc = "This object contains information about a poll."] # [derive (Serialize , Deserialize , Debug)] pub struct Poll { # [doc = "Unique poll identifier"] # [serde (rename = "id")] id : String , # [doc = "Poll question, 1-300 characters"] # [serde (rename = "question")] question : String , # [doc = "List of poll options"] # [serde (rename = "options")] options : Vec < PollOption > , # [doc = "Total number of users that voted in the poll"] # [serde (rename = "total_voter_count")] total_voter_count : i64 , # [doc = "True, if the poll is closed"] # [serde (rename = "is_closed")] is_closed : bool , # [doc = "True, if the poll is anonymous"] # [serde (rename = "is_anonymous")] is_anonymous : bool , # [doc = "Poll type, currently can be \"regular\" or \"quiz\""] # [serde (rename = "type")] tg_type : String , # [doc = "True, if the poll allows multiple answers"] # [serde (rename = "allows_multiple_answers")] allows_multiple_answers : bool , # [doc = "Optional. 0-based identifier of the correct answer option. Available only for polls in the quiz mode, which are closed, or was sent (not forwarded) by the bot or to the private chat with the bot."] # [serde (skip_serializing_if = "Option::is_none" , rename = "correct_option_id")] correct_option_id : Option < i64 > , # [doc = "Optional. Text that is shown when a user chooses an incorrect answer or taps on the lamp icon in a quiz-style poll, 0-200 characters"] # [serde (skip_serializing_if = "Option::is_none" , rename = "explanation")] explanation : Option < String > , # [doc = "Optional. Special entities like usernames, URLs, bot commands, etc. that appear in the explanation"] # [serde (skip_serializing_if = "Option::is_none" , rename = "explanation_entities")] explanation_entities : Option < Vec < MessageEntity > > , # [doc = "Optional. Amount of time in seconds the poll will be active after creation"] # [serde (skip_serializing_if = "Option::is_none" , rename = "open_period")] open_period : Option < i64 > , # [doc = "Optional. Point in time (Unix timestamp) when the poll will be automatically closed"] # [serde (skip_serializing_if = "Option::is_none" , rename = "close_date")] close_date : Option < i64 > } # [doc = "This object contains information about a poll."] # [derive (Serialize , Deserialize , Debug)] pub struct PollBuilder { # [doc = "Unique poll identifier"] # [serde (rename = "id")] id : String , # [doc = "Poll question, 1-300 characters"] # [serde (rename = "question")] question : String , # [doc = "List of poll options"] # [serde (rename = "options")] options : Vec < PollOption > , # [doc = "Total number of users that voted in the poll"] # [serde (rename = "total_voter_count")] total_voter_count : i64 , # [doc = "True, if the poll is closed"] # [serde (rename = "is_closed")] is_closed : bool , # [doc = "True, if the poll is anonymous"] # [serde (rename = "is_anonymous")] is_anonymous : bool , # [doc = "Poll type, currently can be \"regular\" or \"quiz\""] # [serde (rename = "type")] tg_type : String , # [doc = "True, if the poll allows multiple answers"] # [serde (rename = "allows_multiple_answers")] allows_multiple_answers : bool , # [doc = "Optional. 0-based identifier of the correct answer option. Available only for polls in the quiz mode, which are closed, or was sent (not forwarded) by the bot or to the private chat with the bot."] # [serde (skip_serializing_if = "Option::is_none" , rename = "correct_option_id")] correct_option_id : Option < i64 > , # [doc = "Optional. Text that is shown when a user chooses an incorrect answer or taps on the lamp icon in a quiz-style poll, 0-200 characters"] # [serde (skip_serializing_if = "Option::is_none" , rename = "explanation")] explanation : Option < String > , # [doc = "Optional. Special entities like usernames, URLs, bot commands, etc. that appear in the explanation"] # [serde (skip_serializing_if = "Option::is_none" , rename = "explanation_entities")] explanation_entities : Option < Vec < MessageEntity > > , # [doc = "Optional. Amount of time in seconds the poll will be active after creation"] # [serde (skip_serializing_if = "Option::is_none" , rename = "open_period")] open_period : Option < i64 > , # [doc = "Optional. Point in time (Unix timestamp) when the poll will be automatically closed"] # [serde (skip_serializing_if = "Option::is_none" , rename = "close_date")] close_date : Option < i64 > } impl PollBuilder { pub fn new (id : String , question : String , options : Vec < PollOption > , total_voter_count : i64 , is_closed : bool , is_anonymous : bool , allows_multiple_answers : bool) -> Self { Self { tg_type : "Poll" . to_owned () , id , question , options , total_voter_count , is_closed , is_anonymous , allows_multiple_answers , correct_option_id : None , explanation : None , explanation_entities : None , open_period : None , close_date : None } } pub fn set_id (mut self , id : String) -> Self { self . id = id ; self } pub fn set_question (mut self , question : String) -> Self { self . question = question ; self } pub fn set_options (mut self , options : Vec < PollOption >) -> Self { self . options = options ; self } pub fn set_total_voter_count (mut self , total_voter_count : i64) -> Self { self . total_voter_count = total_voter_count ; self } pub fn set_is_closed (mut self , is_closed : bool) -> Self { self . is_closed = is_closed ; self } pub fn set_is_anonymous (mut self , is_anonymous : bool) -> Self { self . is_anonymous = is_anonymous ; self } pub fn set_type (mut self , tg_type : String) -> Self { self . tg_type = tg_type ; self } pub fn set_allows_multiple_answers (mut self , allows_multiple_answers : bool) -> Self { self . allows_multiple_answers = allows_multiple_answers ; self } pub fn set_correct_option_id (mut self , correct_option_id : Option < i64 >) -> Self { self . correct_option_id = correct_option_id ; self } pub fn set_explanation (mut self , explanation : Option < String >) -> Self { self . explanation = explanation ; self } pub fn set_explanation_entities (mut self , explanation_entities : Option < Vec < MessageEntity > >) -> Self { self . explanation_entities = explanation_entities ; self } pub fn set_open_period (mut self , open_period : Option < i64 >) -> Self { self . open_period = open_period ; self } pub fn set_close_date (mut self , close_date : Option < i64 >) -> Self { self . close_date = close_date ; self } pub fn build (self) -> Poll { Poll { id : self . id , question : self . question , options : self . options , total_voter_count : self . total_voter_count , is_closed : self . is_closed , is_anonymous : self . is_anonymous , tg_type : self . tg_type , allows_multiple_answers : self . allows_multiple_answers , correct_option_id : self . correct_option_id , explanation : self . explanation , explanation_entities : self . explanation_entities , open_period : self . open_period , close_date : self . close_date } } } # [doc = "Describes that no specific value for the menu button was set."] # [derive (Serialize , Deserialize , Debug)] pub struct MenuButtonDefault { # [doc = "Type of the button, must be default"] # [serde (rename = "type")] tg_type : String } # [doc = "Describes that no specific value for the menu button was set."] # [derive (Serialize , Deserialize , Debug)] pub struct MenuButtonDefaultBuilder { # [doc = "Type of the button, must be default"] # [serde (rename = "type")] tg_type : String } impl MenuButtonDefaultBuilder { pub fn new () -> Self { Self { tg_type : "default" . to_owned () , } } pub fn set_type (mut self , tg_type : String) -> Self { self . tg_type = tg_type ; self } pub fn build (self) -> MenuButtonDefault { MenuButtonDefault { tg_type : self . tg_type } } } # [doc = "This object represents type of a poll, which is allowed to be created and sent when the corresponding button is pressed."] # [derive (Serialize , Deserialize , Debug)] pub struct KeyboardButtonPollType { # [doc = "Optional. If quiz is passed, the user will be allowed to create only polls in the quiz mode. If regular is passed, only regular polls will be allowed. Otherwise, the user will be allowed to create a poll of any type."] # [serde (skip_serializing_if = "Option::is_none" , rename = "type")] tg_type : Option < String > } # [doc = "This object represents type of a poll, which is allowed to be created and sent when the corresponding button is pressed."] # [derive (Serialize , Deserialize , Debug)] pub struct KeyboardButtonPollTypeBuilder { # [doc = "Optional. If quiz is passed, the user will be allowed to create only polls in the quiz mode. If regular is passed, only regular polls will be allowed. Otherwise, the user will be allowed to create a poll of any type."] # [serde (skip_serializing_if = "Option::is_none" , rename = "type")] tg_type : Option < String > } impl KeyboardButtonPollTypeBuilder { pub fn new () -> Self { Self { tg_type : Some ("KeyboardButtonPollType" . to_owned ()) } } pub fn set_type (mut self , tg_type : Option < String >) -> Self { self . tg_type = tg_type ; self } pub fn build (self) -> KeyboardButtonPollType { KeyboardButtonPollType { tg_type : self . tg_type } } } # [doc = "Represents the rights of an administrator in a chat."] # [derive (Serialize , Deserialize , Debug)] pub struct ChatAdministratorRights { # [doc = "True, if the user's presence in the chat is hidden"] # [serde (rename = "is_anonymous")] is_anonymous : bool , # [doc = "True, if the administrator can access the chat event log, chat statistics, message statistics in channels, see channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other administrator privilege"] # [serde (rename = "can_manage_chat")] can_manage_chat : bool , # [doc = "True, if the administrator can delete messages of other users"] # [serde (rename = "can_delete_messages")] can_delete_messages : bool , # [doc = "True, if the administrator can manage video chats"] # [serde (rename = "can_manage_video_chats")] can_manage_video_chats : bool , # [doc = "True, if the administrator can restrict, ban or unban chat members"] # [serde (rename = "can_restrict_members")] can_restrict_members : bool , # [doc = "True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by the user)"] # [serde (rename = "can_promote_members")] can_promote_members : bool , # [doc = "True, if the user is allowed to change the chat title, photo and other settings"] # [serde (rename = "can_change_info")] can_change_info : bool , # [doc = "True, if the user is allowed to invite new users to the chat"] # [serde (rename = "can_invite_users")] can_invite_users : bool , # [doc = "Optional. True, if the administrator can post in the channel; channels only"] # [serde (skip_serializing_if = "Option::is_none" , rename = "can_post_messages")] can_post_messages : Option < bool > , # [doc = "Optional. True, if the administrator can edit messages of other users and can pin messages; channels only"] # [serde (skip_serializing_if = "Option::is_none" , rename = "can_edit_messages")] can_edit_messages : Option < bool > , # [doc = "Optional. True, if the user is allowed to pin messages; groups and supergroups only"] # [serde (skip_serializing_if = "Option::is_none" , rename = "can_pin_messages")] can_pin_messages : Option < bool > } # [doc = "Represents the rights of an administrator in a chat."] # [derive (Serialize , Deserialize , Debug)] pub struct ChatAdministratorRightsBuilder { # [doc = "True, if the user's presence in the chat is hidden"] # [serde (rename = "is_anonymous")] is_anonymous : bool , # [doc = "True, if the administrator can access the chat event log, chat statistics, message statistics in channels, see channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other administrator privilege"] # [serde (rename = "can_manage_chat")] can_manage_chat : bool , # [doc = "True, if the administrator can delete messages of other users"] # [serde (rename = "can_delete_messages")] can_delete_messages : bool , # [doc = "True, if the administrator can manage video chats"] # [serde (rename = "can_manage_video_chats")] can_manage_video_chats : bool , # [doc = "True, if the administrator can restrict, ban or unban chat members"] # [serde (rename = "can_restrict_members")] can_restrict_members : bool , # [doc = "True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by the user)"] # [serde (rename = "can_promote_members")] can_promote_members : bool , # [doc = "True, if the user is allowed to change the chat title, photo and other settings"] # [serde (rename = "can_change_info")] can_change_info : bool , # [doc = "True, if the user is allowed to invite new users to the chat"] # [serde (rename = "can_invite_users")] can_invite_users : bool , # [doc = "Optional. True, if the administrator can post in the channel; channels only"] # [serde (skip_serializing_if = "Option::is_none" , rename = "can_post_messages")] can_post_messages : Option < bool > , # [doc = "Optional. True, if the administrator can edit messages of other users and can pin messages; channels only"] # [serde (skip_serializing_if = "Option::is_none" , rename = "can_edit_messages")] can_edit_messages : Option < bool > , # [doc = "Optional. True, if the user is allowed to pin messages; groups and supergroups only"] # [serde (skip_serializing_if = "Option::is_none" , rename = "can_pin_messages")] can_pin_messages : Option < bool > } impl ChatAdministratorRightsBuilder { pub fn new (is_anonymous : bool , can_manage_chat : bool , can_delete_messages : bool , can_manage_video_chats : bool , can_restrict_members : bool , can_promote_members : bool , can_change_info : bool , can_invite_users : bool) -> Self { Self { is_anonymous , can_manage_chat , can_delete_messages , can_manage_video_chats , can_restrict_members , can_promote_members , can_change_info , can_invite_users , can_post_messages : None , can_edit_messages : None , can_pin_messages : None } } pub fn set_is_anonymous (mut self , is_anonymous : bool) -> Self { self . is_anonymous = is_anonymous ; self } pub fn set_can_manage_chat (mut self , can_manage_chat : bool) -> Self { self . can_manage_chat = can_manage_chat ; self } pub fn set_can_delete_messages (mut self , can_delete_messages : bool) -> Self { self . can_delete_messages = can_delete_messages ; self } pub fn set_can_manage_video_chats (mut self , can_manage_video_chats : bool) -> Self { self . can_manage_video_chats = can_manage_video_chats ; self } pub fn set_can_restrict_members (mut self , can_restrict_members : bool) -> Self { self . can_restrict_members = can_restrict_members ; self } pub fn set_can_promote_members (mut self , can_promote_members : bool) -> Self { self . can_promote_members = can_promote_members ; self } pub fn set_can_change_info (mut self , can_change_info : bool) -> Self { self . can_change_info = can_change_info ; self } pub fn set_can_invite_users (mut self , can_invite_users : bool) -> Self { self . can_invite_users = can_invite_users ; self } pub fn set_can_post_messages (mut self , can_post_messages : Option < bool >) -> Self { self . can_post_messages = can_post_messages ; self } pub fn set_can_edit_messages (mut self , can_edit_messages : Option < bool >) -> Self { self . can_edit_messages = can_edit_messages ; self } pub fn set_can_pin_messages (mut self , can_pin_messages : Option < bool >) -> Self { self . can_pin_messages = can_pin_messages ; self } pub fn build (self) -> ChatAdministratorRights { ChatAdministratorRights { is_anonymous : self . is_anonymous , can_manage_chat : self . can_manage_chat , can_delete_messages : self . can_delete_messages , can_manage_video_chats : self . can_manage_video_chats , can_restrict_members : self . can_restrict_members , can_promote_members : self . can_promote_members , can_change_info : self . can_change_info , can_invite_users : self . can_invite_users , can_post_messages : self . can_post_messages , can_edit_messages : self . can_edit_messages , can_pin_messages : self . can_pin_messages } } } # [doc = "This object represents the content of a service message, sent whenever a user in the chat triggers a proximity alert set by another user."] # [derive (Serialize , Deserialize , Debug)] pub struct ProximityAlertTriggered { # [doc = "User that triggered the alert"] # [serde (rename = "traveler")] traveler : User , # [doc = "User that set the alert"] # [serde (rename = "watcher")] watcher : User , # [doc = "The distance between the users"] # [serde (rename = "distance")] distance : i64 } # [doc = "This object represents the content of a service message, sent whenever a user in the chat triggers a proximity alert set by another user."] # [derive (Serialize , Deserialize , Debug)] pub struct ProximityAlertTriggeredBuilder { # [doc = "User that triggered the alert"] # [serde (rename = "traveler")] traveler : User , # [doc = "User that set the alert"] # [serde (rename = "watcher")] watcher : User , # [doc = "The distance between the users"] # [serde (rename = "distance")] distance : i64 } impl ProximityAlertTriggeredBuilder { pub fn new (traveler : User , watcher : User , distance : i64) -> Self { Self { traveler , watcher , distance , } } pub fn set_traveler (mut self , traveler : User) -> Self { self . traveler = traveler ; self } pub fn set_watcher (mut self , watcher : User) -> Self { self . watcher = watcher ; self } pub fn set_distance (mut self , distance : i64) -> Self { self . distance = distance ; self } pub fn build (self) -> ProximityAlertTriggered { ProximityAlertTriggered { traveler : self . traveler , watcher : self . watcher , distance : self . distance } } } # [doc = "Represents a chat member that has no additional privileges or restrictions."] # [derive (Serialize , Deserialize , Debug)] pub struct ChatMemberMember { # [doc = "The member's status in the chat, always \"member\""] # [serde (rename = "status")] status : String , # [doc = "Information about the user"] # [serde (rename = "user")] user : User } # [doc = "Represents a chat member that has no additional privileges or restrictions."] # [derive (Serialize , Deserialize , Debug)] pub struct ChatMemberMemberBuilder { # [doc = "The member's status in the chat, always \"member\""] # [serde (rename = "status")] status : String , # [doc = "Information about the user"] # [serde (rename = "user")] user : User } impl ChatMemberMemberBuilder { pub fn new (status : String , user : User) -> Self { Self { status , user , } } pub fn set_status (mut self , status : String) -> Self { self . status = status ; self } pub fn set_user (mut self , user : User) -> Self { self . user = user ; self } pub fn build (self) -> ChatMemberMember { ChatMemberMember { status : self . status , user : self . user } } } # [doc = "This object represents a voice note."] # [derive (Serialize , Deserialize , Debug)] pub struct Voice { # [doc = "Identifier for this file, which can be used to download or reuse the file"] # [serde (rename = "file_id")] file_id : String , # [doc = "Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file."] # [serde (rename = "file_unique_id")] file_unique_id : String , # [doc = "Duration of the audio in seconds as defined by sender"] # [serde (rename = "duration")] duration : i64 , # [doc = "Optional. MIME type of the file as defined by sender"] # [serde (skip_serializing_if = "Option::is_none" , rename = "mime_type")] mime_type : Option < String > , # [doc = "Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value."] # [serde (skip_serializing_if = "Option::is_none" , rename = "file_size")] file_size : Option < i64 > } # [doc = "This object represents a voice note."] # [derive (Serialize , Deserialize , Debug)] pub struct VoiceBuilder { # [doc = "Identifier for this file, which can be used to download or reuse the file"] # [serde (rename = "file_id")] file_id : String , # [doc = "Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file."] # [serde (rename = "file_unique_id")] file_unique_id : String , # [doc = "Duration of the audio in seconds as defined by sender"] # [serde (rename = "duration")] duration : i64 , # [doc = "Optional. MIME type of the file as defined by sender"] # [serde (skip_serializing_if = "Option::is_none" , rename = "mime_type")] mime_type : Option < String > , # [doc = "Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value."] # [serde (skip_serializing_if = "Option::is_none" , rename = "file_size")] file_size : Option < i64 > } impl VoiceBuilder { pub fn new (file_id : String , file_unique_id : String , duration : i64) -> Self { Self { file_id , file_unique_id , duration , mime_type : None , file_size : None } } pub fn set_file_id (mut self , file_id : String) -> Self { self . file_id = file_id ; self } pub fn set_file_unique_id (mut self , file_unique_id : String) -> Self { self . file_unique_id = file_unique_id ; self } pub fn set_duration (mut self , duration : i64) -> Self { self . duration = duration ; self } pub fn set_mime_type (mut self , mime_type : Option < String >) -> Self { self . mime_type = mime_type ; self } pub fn set_file_size (mut self , file_size : Option < i64 >) -> Self { self . file_size = file_size ; self } pub fn build (self) -> Voice { Voice { file_id : self . file_id , file_unique_id : self . file_unique_id , duration : self . duration , mime_type : self . mime_type , file_size : self . file_size } } } # [doc = "Describes documents or other Telegram Passport elements shared with the bot by the user."] # [derive (Serialize , Deserialize , Debug)] pub struct EncryptedPassportElement { # [doc = "Element type. One of \"personal_details\", \"passport\", \"driver_license\", \"identity_card\", \"internal_passport\", \"address\", \"utility_bill\", \"bank_statement\", \"rental_agreement\", \"passport_registration\", \"temporary_registration\", \"phone_number\", \"email\"."] # [serde (rename = "type")] tg_type : String , # [doc = "Optional. Base64-encoded encrypted Telegram Passport element data provided by the user, available for \"personal_details\", \"passport\", \"driver_license\", \"identity_card\", \"internal_passport\" and \"address\" types. Can be decrypted and verified using the accompanying EncryptedCredentials."] # [serde (skip_serializing_if = "Option::is_none" , rename = "data")] data : Option < String > , # [doc = "Optional. User's verified phone number, available only for \"phone_number\" type"] # [serde (skip_serializing_if = "Option::is_none" , rename = "phone_number")] phone_number : Option < String > , # [doc = "Optional. User's verified email address, available only for \"email\" type"] # [serde (skip_serializing_if = "Option::is_none" , rename = "email")] email : Option < String > , # [doc = "Optional. Array of encrypted files with documents provided by the user, available for \"utility_bill\", \"bank_statement\", \"rental_agreement\", \"passport_registration\" and \"temporary_registration\" types. Files can be decrypted and verified using the accompanying EncryptedCredentials."] # [serde (skip_serializing_if = "Option::is_none" , rename = "files")] files : Option < Vec < PassportFile > > , # [doc = "Optional. Encrypted file with the front side of the document, provided by the user. Available for \"passport\", \"driver_license\", \"identity_card\" and \"internal_passport\". The file can be decrypted and verified using the accompanying EncryptedCredentials."] # [serde (skip_serializing_if = "Option::is_none" , rename = "front_side")] front_side : Option < PassportFile > , # [doc = "Optional. Encrypted file with the reverse side of the document, provided by the user. Available for \"driver_license\" and \"identity_card\". The file can be decrypted and verified using the accompanying EncryptedCredentials."] # [serde (skip_serializing_if = "Option::is_none" , rename = "reverse_side")] reverse_side : Option < PassportFile > , # [doc = "Optional. Encrypted file with the selfie of the user holding a document, provided by the user; available for \"passport\", \"driver_license\", \"identity_card\" and \"internal_passport\". The file can be decrypted and verified using the accompanying EncryptedCredentials."] # [serde (skip_serializing_if = "Option::is_none" , rename = "selfie")] selfie : Option < PassportFile > , # [doc = "Optional. Array of encrypted files with translated versions of documents provided by the user. Available if requested for \"passport\", \"driver_license\", \"identity_card\", \"internal_passport\", \"utility_bill\", \"bank_statement\", \"rental_agreement\", \"passport_registration\" and \"temporary_registration\" types. Files can be decrypted and verified using the accompanying EncryptedCredentials."] # [serde (skip_serializing_if = "Option::is_none" , rename = "translation")] translation : Option < Vec < PassportFile > > , # [doc = "Base64-encoded element hash for using in PassportElementErrorUnspecified"] # [serde (rename = "hash")] hash : String } # [doc = "Describes documents or other Telegram Passport elements shared with the bot by the user."] # [derive (Serialize , Deserialize , Debug)] pub struct EncryptedPassportElementBuilder { # [doc = "Element type. One of \"personal_details\", \"passport\", \"driver_license\", \"identity_card\", \"internal_passport\", \"address\", \"utility_bill\", \"bank_statement\", \"rental_agreement\", \"passport_registration\", \"temporary_registration\", \"phone_number\", \"email\"."] # [serde (rename = "type")] tg_type : String , # [doc = "Optional. Base64-encoded encrypted Telegram Passport element data provided by the user, available for \"personal_details\", \"passport\", \"driver_license\", \"identity_card\", \"internal_passport\" and \"address\" types. Can be decrypted and verified using the accompanying EncryptedCredentials."] # [serde (skip_serializing_if = "Option::is_none" , rename = "data")] data : Option < String > , # [doc = "Optional. User's verified phone number, available only for \"phone_number\" type"] # [serde (skip_serializing_if = "Option::is_none" , rename = "phone_number")] phone_number : Option < String > , # [doc = "Optional. User's verified email address, available only for \"email\" type"] # [serde (skip_serializing_if = "Option::is_none" , rename = "email")] email : Option < String > , # [doc = "Optional. Array of encrypted files with documents provided by the user, available for \"utility_bill\", \"bank_statement\", \"rental_agreement\", \"passport_registration\" and \"temporary_registration\" types. Files can be decrypted and verified using the accompanying EncryptedCredentials."] # [serde (skip_serializing_if = "Option::is_none" , rename = "files")] files : Option < Vec < PassportFile > > , # [doc = "Optional. Encrypted file with the front side of the document, provided by the user. Available for \"passport\", \"driver_license\", \"identity_card\" and \"internal_passport\". The file can be decrypted and verified using the accompanying EncryptedCredentials."] # [serde (skip_serializing_if = "Option::is_none" , rename = "front_side")] front_side : Option < PassportFile > , # [doc = "Optional. Encrypted file with the reverse side of the document, provided by the user. Available for \"driver_license\" and \"identity_card\". The file can be decrypted and verified using the accompanying EncryptedCredentials."] # [serde (skip_serializing_if = "Option::is_none" , rename = "reverse_side")] reverse_side : Option < PassportFile > , # [doc = "Optional. Encrypted file with the selfie of the user holding a document, provided by the user; available for \"passport\", \"driver_license\", \"identity_card\" and \"internal_passport\". The file can be decrypted and verified using the accompanying EncryptedCredentials."] # [serde (skip_serializing_if = "Option::is_none" , rename = "selfie")] selfie : Option < PassportFile > , # [doc = "Optional. Array of encrypted files with translated versions of documents provided by the user. Available if requested for \"passport\", \"driver_license\", \"identity_card\", \"internal_passport\", \"utility_bill\", \"bank_statement\", \"rental_agreement\", \"passport_registration\" and \"temporary_registration\" types. Files can be decrypted and verified using the accompanying EncryptedCredentials."] # [serde (skip_serializing_if = "Option::is_none" , rename = "translation")] translation : Option < Vec < PassportFile > > , # [doc = "Base64-encoded element hash for using in PassportElementErrorUnspecified"] # [serde (rename = "hash")] hash : String } impl EncryptedPassportElementBuilder { pub fn new (hash : String) -> Self { Self { tg_type : "EncryptedPassportElement" . to_owned () , hash , data : None , phone_number : None , email : None , files : None , front_side : None , reverse_side : None , selfie : None , translation : None } } pub fn set_type (mut self , tg_type : String) -> Self { self . tg_type = tg_type ; self } pub fn set_data (mut self , data : Option < String >) -> Self { self . data = data ; self } pub fn set_phone_number (mut self , phone_number : Option < String >) -> Self { self . phone_number = phone_number ; self } pub fn set_email (mut self , email : Option < String >) -> Self { self . email = email ; self } pub fn set_files (mut self , files : Option < Vec < PassportFile > >) -> Self { self . files = files ; self } pub fn set_front_side (mut self , front_side : Option < PassportFile >) -> Self { self . front_side = front_side ; self } pub fn set_reverse_side (mut self , reverse_side : Option < PassportFile >) -> Self { self . reverse_side = reverse_side ; self } pub fn set_selfie (mut self , selfie : Option < PassportFile >) -> Self { self . selfie = selfie ; self } pub fn set_translation (mut self , translation : Option < Vec < PassportFile > >) -> Self { self . translation = translation ; self } pub fn set_hash (mut self , hash : String) -> Self { self . hash = hash ; self } pub fn build (self) -> EncryptedPassportElement { EncryptedPassportElement { tg_type : self . tg_type , data : self . data , phone_number : self . phone_number , email : self . email , files : self . files , front_side : self . front_side , reverse_side : self . reverse_side , selfie : self . selfie , translation : self . translation , hash : self . hash } } } # [doc = "This object represents a point on the map."] # [derive (Serialize , Deserialize , Debug)] pub struct Location { # [doc = "Longitude as defined by sender"] # [serde (rename = "longitude")] longitude : f64 , # [doc = "Latitude as defined by sender"] # [serde (rename = "latitude")] latitude : f64 , # [doc = "Optional. The radius of uncertainty for the location, measured in meters; 0-1500"] # [serde (skip_serializing_if = "Option::is_none" , rename = "horizontal_accuracy")] horizontal_accuracy : Option < f64 > , # [doc = "Optional. Time relative to the message sending date, during which the location can be updated; in seconds. For active live locations only."] # [serde (skip_serializing_if = "Option::is_none" , rename = "live_period")] live_period : Option < i64 > , # [doc = "Optional. The direction in which user is moving, in degrees; 1-360. For active live locations only."] # [serde (skip_serializing_if = "Option::is_none" , rename = "heading")] heading : Option < i64 > , # [doc = "Optional. The maximum distance for proximity alerts about approaching another chat member, in meters. For sent live locations only."] # [serde (skip_serializing_if = "Option::is_none" , rename = "proximity_alert_radius")] proximity_alert_radius : Option < i64 > } # [doc = "This object represents a point on the map."] # [derive (Serialize , Deserialize , Debug)] pub struct LocationBuilder { # [doc = "Longitude as defined by sender"] # [serde (rename = "longitude")] longitude : f64 , # [doc = "Latitude as defined by sender"] # [serde (rename = "latitude")] latitude : f64 , # [doc = "Optional. The radius of uncertainty for the location, measured in meters; 0-1500"] # [serde (skip_serializing_if = "Option::is_none" , rename = "horizontal_accuracy")] horizontal_accuracy : Option < f64 > , # [doc = "Optional. Time relative to the message sending date, during which the location can be updated; in seconds. For active live locations only."] # [serde (skip_serializing_if = "Option::is_none" , rename = "live_period")] live_period : Option < i64 > , # [doc = "Optional. The direction in which user is moving, in degrees; 1-360. For active live locations only."] # [serde (skip_serializing_if = "Option::is_none" , rename = "heading")] heading : Option < i64 > , # [doc = "Optional. The maximum distance for proximity alerts about approaching another chat member, in meters. For sent live locations only."] # [serde (skip_serializing_if = "Option::is_none" , rename = "proximity_alert_radius")] proximity_alert_radius : Option < i64 > } impl LocationBuilder { pub fn new (longitude : f64 , latitude : f64) -> Self { Self { longitude , latitude , horizontal_accuracy : None , live_period : None , heading : None , proximity_alert_radius : None } } pub fn set_longitude (mut self , longitude : f64) -> Self { self . longitude = longitude ; self } pub fn set_latitude (mut self , latitude : f64) -> Self { self . latitude = latitude ; self } pub fn set_horizontal_accuracy (mut self , horizontal_accuracy : Option < f64 >) -> Self { self . horizontal_accuracy = horizontal_accuracy ; self } pub fn set_live_period (mut self , live_period : Option < i64 >) -> Self { self . live_period = live_period ; self } pub fn set_heading (mut self , heading : Option < i64 >) -> Self { self . heading = heading ; self } pub fn set_proximity_alert_radius (mut self , proximity_alert_radius : Option < i64 >) -> Self { self . proximity_alert_radius = proximity_alert_radius ; self } pub fn build (self) -> Location { Location { longitude : self . longitude , latitude : self . latitude , horizontal_accuracy : self . horizontal_accuracy , live_period : self . live_period , heading : self . heading , proximity_alert_radius : self . proximity_alert_radius } } } # [doc = "Represents a link to a video animation (H.264/MPEG-4 AVC video without sound) stored on the Telegram servers. By default, this animated MPEG-4 file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the animation."] # [derive (Serialize , Deserialize , Debug)] pub struct InlineQueryResultCachedMpeg4Gif { # [doc = "Type of the result, must be mpeg4_gif"] # [serde (rename = "type")] tg_type : String , # [doc = "Unique identifier for this result, 1-64 bytes"] # [serde (rename = "id")] id : String , # [doc = "A valid file identifier for the MPEG4 file"] # [serde (rename = "mpeg4_file_id")] mpeg_4_file_id : String , # [doc = "Optional. Title for the result"] # [serde (skip_serializing_if = "Option::is_none" , rename = "title")] title : Option < String > , # [doc = "Optional. Caption of the MPEG-4 file to be sent, 0-1024 characters after entities parsing"] # [serde (skip_serializing_if = "Option::is_none" , rename = "caption")] caption : Option < String > , # [doc = "Optional. Mode for parsing entities in the caption. See formatting options for more details."] # [serde (skip_serializing_if = "Option::is_none" , rename = "parse_mode")] parse_mode : Option < String > , # [doc = "Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode"] # [serde (skip_serializing_if = "Option::is_none" , rename = "caption_entities")] caption_entities : Option < Vec < MessageEntity > > , # [doc = "Optional. Inline keyboard attached to the message"] # [serde (skip_serializing_if = "Option::is_none" , rename = "reply_markup")] reply_markup : Option < InlineKeyboardMarkup > , # [doc = "Optional. Content of the message to be sent instead of the video animation"] # [serde (skip_serializing_if = "Option::is_none" , rename = "input_message_content")] input_message_content : Option < InputMessageContent > } # [doc = "Represents a link to a video animation (H.264/MPEG-4 AVC video without sound) stored on the Telegram servers. By default, this animated MPEG-4 file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the animation."] # [derive (Serialize , Deserialize , Debug)] pub struct InlineQueryResultCachedMpeg4GifBuilder { # [doc = "Type of the result, must be mpeg4_gif"] # [serde (rename = "type")] tg_type : String , # [doc = "Unique identifier for this result, 1-64 bytes"] # [serde (rename = "id")] id : String , # [doc = "A valid file identifier for the MPEG4 file"] # [serde (rename = "mpeg4_file_id")] mpeg_4_file_id : String , # [doc = "Optional. Title for the result"] # [serde (skip_serializing_if = "Option::is_none" , rename = "title")] title : Option < String > , # [doc = "Optional. Caption of the MPEG-4 file to be sent, 0-1024 characters after entities parsing"] # [serde (skip_serializing_if = "Option::is_none" , rename = "caption")] caption : Option < String > , # [doc = "Optional. Mode for parsing entities in the caption. See formatting options for more details."] # [serde (skip_serializing_if = "Option::is_none" , rename = "parse_mode")] parse_mode : Option < String > , # [doc = "Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode"] # [serde (skip_serializing_if = "Option::is_none" , rename = "caption_entities")] caption_entities : Option < Vec < MessageEntity > > , # [doc = "Optional. Inline keyboard attached to the message"] # [serde (skip_serializing_if = "Option::is_none" , rename = "reply_markup")] reply_markup : Option < InlineKeyboardMarkup > , # [doc = "Optional. Content of the message to be sent instead of the video animation"] # [serde (skip_serializing_if = "Option::is_none" , rename = "input_message_content")] input_message_content : Option < InputMessageContent > } impl InlineQueryResultCachedMpeg4GifBuilder { pub fn new (id : String , mpeg_4_file_id : String) -> Self { Self { tg_type : "mpeg4_gif" . to_owned () , id , mpeg_4_file_id , title : None , caption : None , parse_mode : None , caption_entities : None , reply_markup : None , input_message_content : None } } pub fn set_type (mut self , tg_type : String) -> Self { self . tg_type = tg_type ; self } pub fn set_id (mut self , id : String) -> Self { self . id = id ; self } pub fn set_mpeg_4_file_id (mut self , mpeg_4_file_id : String) -> Self { self . mpeg_4_file_id = mpeg_4_file_id ; self } pub fn set_title (mut self , title : Option < String >) -> Self { self . title = title ; self } pub fn set_caption (mut self , caption : Option < String >) -> Self { self . caption = caption ; self } pub fn set_parse_mode (mut self , parse_mode : Option < String >) -> Self { self . parse_mode = parse_mode ; self } pub fn set_caption_entities (mut self , caption_entities : Option < Vec < MessageEntity > >) -> Self { self . caption_entities = caption_entities ; self } pub fn set_reply_markup (mut self , reply_markup : Option < InlineKeyboardMarkup >) -> Self { self . reply_markup = reply_markup ; self } pub fn set_input_message_content (mut self , input_message_content : Option < InputMessageContent >) -> Self { self . input_message_content = input_message_content ; self } pub fn build (self) -> InlineQueryResultCachedMpeg4Gif { InlineQueryResultCachedMpeg4Gif { tg_type : self . tg_type , id : self . id , mpeg_4_file_id : self . mpeg_4_file_id , title : self . title , caption : self . caption , parse_mode : self . parse_mode , caption_entities : self . caption_entities , reply_markup : self . reply_markup , input_message_content : self . input_message_content } } } # [doc = "This object represents a service message about a change in auto-delete timer settings."] # [derive (Serialize , Deserialize , Debug)] pub struct MessageAutoDeleteTimerChanged { # [doc = "New auto-delete time for messages in the chat; in seconds"] # [serde (rename = "message_auto_delete_time")] message_auto_delete_time : i64 } # [doc = "This object represents a service message about a change in auto-delete timer settings."] # [derive (Serialize , Deserialize , Debug)] pub struct MessageAutoDeleteTimerChangedBuilder { # [doc = "New auto-delete time for messages in the chat; in seconds"] # [serde (rename = "message_auto_delete_time")] message_auto_delete_time : i64 } impl MessageAutoDeleteTimerChangedBuilder { pub fn new (message_auto_delete_time : i64) -> Self { Self { message_auto_delete_time , } } pub fn set_message_auto_delete_time (mut self , message_auto_delete_time : i64) -> Self { self . message_auto_delete_time = message_auto_delete_time ; self } pub fn build (self) -> MessageAutoDeleteTimerChanged { MessageAutoDeleteTimerChanged { message_auto_delete_time : self . message_auto_delete_time } } } # [doc = "This object represents a game. Use BotFather to create and edit games, their short names will act as unique identifiers."] # [derive (Serialize , Deserialize , Debug)] pub struct Game { # [doc = "Title of the game"] # [serde (rename = "title")] title : String , # [doc = "Description of the game"] # [serde (rename = "description")] description : String , # [doc = "Photo that will be displayed in the game message in chats."] # [serde (rename = "photo")] photo : Vec < PhotoSize > , # [doc = "Optional. Brief description of the game or high scores included in the game message. Can be automatically edited to include current high scores for the game when the bot calls setGameScore, or manually edited using editMessageText. 0-4096 characters."] # [serde (skip_serializing_if = "Option::is_none" , rename = "text")] text : Option < String > , # [doc = "Optional. Special entities that appear in text, such as usernames, URLs, bot commands, etc."] # [serde (skip_serializing_if = "Option::is_none" , rename = "text_entities")] text_entities : Option < Vec < MessageEntity > > , # [doc = "Optional. Animation that will be displayed in the game message in chats. Upload via BotFather"] # [serde (skip_serializing_if = "Option::is_none" , rename = "animation")] animation : Option < Animation > } # [doc = "This object represents a game. Use BotFather to create and edit games, their short names will act as unique identifiers."] # [derive (Serialize , Deserialize , Debug)] pub struct GameBuilder { # [doc = "Title of the game"] # [serde (rename = "title")] title : String , # [doc = "Description of the game"] # [serde (rename = "description")] description : String , # [doc = "Photo that will be displayed in the game message in chats."] # [serde (rename = "photo")] photo : Vec < PhotoSize > , # [doc = "Optional. Brief description of the game or high scores included in the game message. Can be automatically edited to include current high scores for the game when the bot calls setGameScore, or manually edited using editMessageText. 0-4096 characters."] # [serde (skip_serializing_if = "Option::is_none" , rename = "text")] text : Option < String > , # [doc = "Optional. Special entities that appear in text, such as usernames, URLs, bot commands, etc."] # [serde (skip_serializing_if = "Option::is_none" , rename = "text_entities")] text_entities : Option < Vec < MessageEntity > > , # [doc = "Optional. Animation that will be displayed in the game message in chats. Upload via BotFather"] # [serde (skip_serializing_if = "Option::is_none" , rename = "animation")] animation : Option < Animation > } impl GameBuilder { pub fn new (title : String , description : String , photo : Vec < PhotoSize >) -> Self { Self { title , description , photo , text : None , text_entities : None , animation : None } } pub fn set_title (mut self , title : String) -> Self { self . title = title ; self } pub fn set_description (mut self , description : String) -> Self { self . description = description ; self } pub fn set_photo (mut self , photo : Vec < PhotoSize >) -> Self { self . photo = photo ; self } pub fn set_text (mut self , text : Option < String >) -> Self { self . text = text ; self } pub fn set_text_entities (mut self , text_entities : Option < Vec < MessageEntity > >) -> Self { self . text_entities = text_entities ; self } pub fn set_animation (mut self , animation : Option < Animation >) -> Self { self . animation = animation ; self } pub fn build (self) -> Game { Game { title : self . title , description : self . description , photo : self . photo , text : self . text , text_entities : self . text_entities , animation : self . animation } } } # [doc = "This object represents one row of the high scores table for a game."] # [derive (Serialize , Deserialize , Debug)] pub struct GameHighScore { # [doc = "Position in high score table for the game"] # [serde (rename = "position")] position : i64 , # [doc = "User"] # [serde (rename = "user")] user : User , # [doc = "Score"] # [serde (rename = "score")] score : i64 } # [doc = "This object represents one row of the high scores table for a game."] # [derive (Serialize , Deserialize , Debug)] pub struct GameHighScoreBuilder { # [doc = "Position in high score table for the game"] # [serde (rename = "position")] position : i64 , # [doc = "User"] # [serde (rename = "user")] user : User , # [doc = "Score"] # [serde (rename = "score")] score : i64 } impl GameHighScoreBuilder { pub fn new (position : i64 , user : User , score : i64) -> Self { Self { position , user , score , } } pub fn set_position (mut self , position : i64) -> Self { self . position = position ; self } pub fn set_user (mut self , user : User) -> Self { self . user = user ; self } pub fn set_score (mut self , score : i64) -> Self { self . score = score ; self } pub fn build (self) -> GameHighScore { GameHighScore { position : self . position , user : self . user , score : self . score } } } # [doc = "Describes actions that a non-administrator user is allowed to take in a chat."] # [derive (Serialize , Deserialize , Debug)] pub struct ChatPermissions { # [doc = "Optional. True, if the user is allowed to send text messages, contacts, locations and venues"] # [serde (skip_serializing_if = "Option::is_none" , rename = "can_send_messages")] can_send_messages : Option < bool > , # [doc = "Optional. True, if the user is allowed to send audios, documents, photos, videos, video notes and voice notes, implies can_send_messages"] # [serde (skip_serializing_if = "Option::is_none" , rename = "can_send_media_messages")] can_send_media_messages : Option < bool > , # [doc = "Optional. True, if the user is allowed to send polls, implies can_send_messages"] # [serde (skip_serializing_if = "Option::is_none" , rename = "can_send_polls")] can_send_polls : Option < bool > , # [doc = "Optional. True, if the user is allowed to send animations, games, stickers and use inline bots, implies can_send_media_messages"] # [serde (skip_serializing_if = "Option::is_none" , rename = "can_send_other_messages")] can_send_other_messages : Option < bool > , # [doc = "Optional. True, if the user is allowed to add web page previews to their messages, implies can_send_media_messages"] # [serde (skip_serializing_if = "Option::is_none" , rename = "can_add_web_page_previews")] can_add_web_page_previews : Option < bool > , # [doc = "Optional. True, if the user is allowed to change the chat title, photo and other settings. Ignored in public supergroups"] # [serde (skip_serializing_if = "Option::is_none" , rename = "can_change_info")] can_change_info : Option < bool > , # [doc = "Optional. True, if the user is allowed to invite new users to the chat"] # [serde (skip_serializing_if = "Option::is_none" , rename = "can_invite_users")] can_invite_users : Option < bool > , # [doc = "Optional. True, if the user is allowed to pin messages. Ignored in public supergroups"] # [serde (skip_serializing_if = "Option::is_none" , rename = "can_pin_messages")] can_pin_messages : Option < bool > } # [doc = "Describes actions that a non-administrator user is allowed to take in a chat."] # [derive (Serialize , Deserialize , Debug)] pub struct ChatPermissionsBuilder { # [doc = "Optional. True, if the user is allowed to send text messages, contacts, locations and venues"] # [serde (skip_serializing_if = "Option::is_none" , rename = "can_send_messages")] can_send_messages : Option < bool > , # [doc = "Optional. True, if the user is allowed to send audios, documents, photos, videos, video notes and voice notes, implies can_send_messages"] # [serde (skip_serializing_if = "Option::is_none" , rename = "can_send_media_messages")] can_send_media_messages : Option < bool > , # [doc = "Optional. True, if the user is allowed to send polls, implies can_send_messages"] # [serde (skip_serializing_if = "Option::is_none" , rename = "can_send_polls")] can_send_polls : Option < bool > , # [doc = "Optional. True, if the user is allowed to send animations, games, stickers and use inline bots, implies can_send_media_messages"] # [serde (skip_serializing_if = "Option::is_none" , rename = "can_send_other_messages")] can_send_other_messages : Option < bool > , # [doc = "Optional. True, if the user is allowed to add web page previews to their messages, implies can_send_media_messages"] # [serde (skip_serializing_if = "Option::is_none" , rename = "can_add_web_page_previews")] can_add_web_page_previews : Option < bool > , # [doc = "Optional. True, if the user is allowed to change the chat title, photo and other settings. Ignored in public supergroups"] # [serde (skip_serializing_if = "Option::is_none" , rename = "can_change_info")] can_change_info : Option < bool > , # [doc = "Optional. True, if the user is allowed to invite new users to the chat"] # [serde (skip_serializing_if = "Option::is_none" , rename = "can_invite_users")] can_invite_users : Option < bool > , # [doc = "Optional. True, if the user is allowed to pin messages. Ignored in public supergroups"] # [serde (skip_serializing_if = "Option::is_none" , rename = "can_pin_messages")] can_pin_messages : Option < bool > } impl ChatPermissionsBuilder { pub fn new () -> Self { Self { can_send_messages : None , can_send_media_messages : None , can_send_polls : None , can_send_other_messages : None , can_add_web_page_previews : None , can_change_info : None , can_invite_users : None , can_pin_messages : None } } pub fn set_can_send_messages (mut self , can_send_messages : Option < bool >) -> Self { self . can_send_messages = can_send_messages ; self } pub fn set_can_send_media_messages (mut self , can_send_media_messages : Option < bool >) -> Self { self . can_send_media_messages = can_send_media_messages ; self } pub fn set_can_send_polls (mut self , can_send_polls : Option < bool >) -> Self { self . can_send_polls = can_send_polls ; self } pub fn set_can_send_other_messages (mut self , can_send_other_messages : Option < bool >) -> Self { self . can_send_other_messages = can_send_other_messages ; self } pub fn set_can_add_web_page_previews (mut self , can_add_web_page_previews : Option < bool >) -> Self { self . can_add_web_page_previews = can_add_web_page_previews ; self } pub fn set_can_change_info (mut self , can_change_info : Option < bool >) -> Self { self . can_change_info = can_change_info ; self } pub fn set_can_invite_users (mut self , can_invite_users : Option < bool >) -> Self { self . can_invite_users = can_invite_users ; self } pub fn set_can_pin_messages (mut self , can_pin_messages : Option < bool >) -> Self { self . can_pin_messages = can_pin_messages ; self } pub fn build (self) -> ChatPermissions { ChatPermissions { can_send_messages : self . can_send_messages , can_send_media_messages : self . can_send_media_messages , can_send_polls : self . can_send_polls , can_send_other_messages : self . can_send_other_messages , can_add_web_page_previews : self . can_add_web_page_previews , can_change_info : self . can_change_info , can_invite_users : self . can_invite_users , can_pin_messages : self . can_pin_messages } } } # [doc = "Represents a link to a sticker stored on the Telegram servers. By default, this sticker will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the sticker.Note: This will only work in Telegram versions released after 9 April, 2016 for static stickers and after 06 July, 2019 for animated stickers. Older clients will ignore them."] # [derive (Serialize , Deserialize , Debug)] pub struct InlineQueryResultCachedSticker { # [doc = "Type of the result, must be sticker"] # [serde (rename = "type")] tg_type : String , # [doc = "Unique identifier for this result, 1-64 bytes"] # [serde (rename = "id")] id : String , # [doc = "A valid file identifier of the sticker"] # [serde (rename = "sticker_file_id")] sticker_file_id : String , # [doc = "Optional. Inline keyboard attached to the message"] # [serde (skip_serializing_if = "Option::is_none" , rename = "reply_markup")] reply_markup : Option < InlineKeyboardMarkup > , # [doc = "Optional. Content of the message to be sent instead of the sticker"] # [serde (skip_serializing_if = "Option::is_none" , rename = "input_message_content")] input_message_content : Option < InputMessageContent > } # [doc = "Represents a link to a sticker stored on the Telegram servers. By default, this sticker will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the sticker.Note: This will only work in Telegram versions released after 9 April, 2016 for static stickers and after 06 July, 2019 for animated stickers. Older clients will ignore them."] # [derive (Serialize , Deserialize , Debug)] pub struct InlineQueryResultCachedStickerBuilder { # [doc = "Type of the result, must be sticker"] # [serde (rename = "type")] tg_type : String , # [doc = "Unique identifier for this result, 1-64 bytes"] # [serde (rename = "id")] id : String , # [doc = "A valid file identifier of the sticker"] # [serde (rename = "sticker_file_id")] sticker_file_id : String , # [doc = "Optional. Inline keyboard attached to the message"] # [serde (skip_serializing_if = "Option::is_none" , rename = "reply_markup")] reply_markup : Option < InlineKeyboardMarkup > , # [doc = "Optional. Content of the message to be sent instead of the sticker"] # [serde (skip_serializing_if = "Option::is_none" , rename = "input_message_content")] input_message_content : Option < InputMessageContent > } impl InlineQueryResultCachedStickerBuilder { pub fn new (id : String , sticker_file_id : String) -> Self { Self { tg_type : "sticker" . to_owned () , id , sticker_file_id , reply_markup : None , input_message_content : None } } pub fn set_type (mut self , tg_type : String) -> Self { self . tg_type = tg_type ; self } pub fn set_id (mut self , id : String) -> Self { self . id = id ; self } pub fn set_sticker_file_id (mut self , sticker_file_id : String) -> Self { self . sticker_file_id = sticker_file_id ; self } pub fn set_reply_markup (mut self , reply_markup : Option < InlineKeyboardMarkup >) -> Self { self . reply_markup = reply_markup ; self } pub fn set_input_message_content (mut self , input_message_content : Option < InputMessageContent >) -> Self { self . input_message_content = input_message_content ; self } pub fn build (self) -> InlineQueryResultCachedSticker { InlineQueryResultCachedSticker { tg_type : self . tg_type , id : self . id , sticker_file_id : self . sticker_file_id , reply_markup : self . reply_markup , input_message_content : self . input_message_content } } } # [doc = "Represents the scope of bot commands, covering all private chats."] # [derive (Serialize , Deserialize , Debug)] pub struct BotCommandScopeAllPrivateChats { # [doc = "Scope type, must be all_private_chats"] # [serde (rename = "type")] tg_type : String } # [doc = "Represents the scope of bot commands, covering all private chats."] # [derive (Serialize , Deserialize , Debug)] pub struct BotCommandScopeAllPrivateChatsBuilder { # [doc = "Scope type, must be all_private_chats"] # [serde (rename = "type")] tg_type : String } impl BotCommandScopeAllPrivateChatsBuilder { pub fn new () -> Self { Self { tg_type : "all_private_chats" . to_owned () , } } pub fn set_type (mut self , tg_type : String) -> Self { self . tg_type = tg_type ; self } pub fn build (self) -> BotCommandScopeAllPrivateChats { BotCommandScopeAllPrivateChats { tg_type : self . tg_type } } } # [derive (Serialize , Deserialize , Debug)] # [serde (untagged)] pub enum MenuButton { MenuButtonCommands (MenuButtonCommands) , MenuButtonWebApp (MenuButtonWebApp) , MenuButtonDefault (MenuButtonDefault) } # [doc = "Represents a link to an MP3 audio file. By default, this audio file will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the audio.Note: This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them."] # [derive (Serialize , Deserialize , Debug)] pub struct InlineQueryResultAudio { # [doc = "Type of the result, must be audio"] # [serde (rename = "type")] tg_type : String , # [doc = "Unique identifier for this result, 1-64 bytes"] # [serde (rename = "id")] id : String , # [doc = "A valid URL for the audio file"] # [serde (rename = "audio_url")] audio_url : String , # [doc = "Title"] # [serde (rename = "title")] title : String , # [doc = "Optional. Caption, 0-1024 characters after entities parsing"] # [serde (skip_serializing_if = "Option::is_none" , rename = "caption")] caption : Option < String > , # [doc = "Optional. Mode for parsing entities in the audio caption. See formatting options for more details."] # [serde (skip_serializing_if = "Option::is_none" , rename = "parse_mode")] parse_mode : Option < String > , # [doc = "Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode"] # [serde (skip_serializing_if = "Option::is_none" , rename = "caption_entities")] caption_entities : Option < Vec < MessageEntity > > , # [doc = "Optional. Performer"] # [serde (skip_serializing_if = "Option::is_none" , rename = "performer")] performer : Option < String > , # [doc = "Optional. Audio duration in seconds"] # [serde (skip_serializing_if = "Option::is_none" , rename = "audio_duration")] audio_duration : Option < i64 > , # [doc = "Optional. Inline keyboard attached to the message"] # [serde (skip_serializing_if = "Option::is_none" , rename = "reply_markup")] reply_markup : Option < InlineKeyboardMarkup > , # [doc = "Optional. Content of the message to be sent instead of the audio"] # [serde (skip_serializing_if = "Option::is_none" , rename = "input_message_content")] input_message_content : Option < InputMessageContent > } # [doc = "Represents a link to an MP3 audio file. By default, this audio file will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the audio.Note: This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them."] # [derive (Serialize , Deserialize , Debug)] pub struct InlineQueryResultAudioBuilder { # [doc = "Type of the result, must be audio"] # [serde (rename = "type")] tg_type : String , # [doc = "Unique identifier for this result, 1-64 bytes"] # [serde (rename = "id")] id : String , # [doc = "A valid URL for the audio file"] # [serde (rename = "audio_url")] audio_url : String , # [doc = "Title"] # [serde (rename = "title")] title : String , # [doc = "Optional. Caption, 0-1024 characters after entities parsing"] # [serde (skip_serializing_if = "Option::is_none" , rename = "caption")] caption : Option < String > , # [doc = "Optional. Mode for parsing entities in the audio caption. See formatting options for more details."] # [serde (skip_serializing_if = "Option::is_none" , rename = "parse_mode")] parse_mode : Option < String > , # [doc = "Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode"] # [serde (skip_serializing_if = "Option::is_none" , rename = "caption_entities")] caption_entities : Option < Vec < MessageEntity > > , # [doc = "Optional. Performer"] # [serde (skip_serializing_if = "Option::is_none" , rename = "performer")] performer : Option < String > , # [doc = "Optional. Audio duration in seconds"] # [serde (skip_serializing_if = "Option::is_none" , rename = "audio_duration")] audio_duration : Option < i64 > , # [doc = "Optional. Inline keyboard attached to the message"] # [serde (skip_serializing_if = "Option::is_none" , rename = "reply_markup")] reply_markup : Option < InlineKeyboardMarkup > , # [doc = "Optional. Content of the message to be sent instead of the audio"] # [serde (skip_serializing_if = "Option::is_none" , rename = "input_message_content")] input_message_content : Option < InputMessageContent > } impl InlineQueryResultAudioBuilder { pub fn new (id : String , audio_url : String , title : String) -> Self { Self { tg_type : "audio" . to_owned () , id , audio_url , title , caption : None , parse_mode : None , caption_entities : None , performer : None , audio_duration : None , reply_markup : None , input_message_content : None } } pub fn set_type (mut self , tg_type : String) -> Self { self . tg_type = tg_type ; self } pub fn set_id (mut self , id : String) -> Self { self . id = id ; self } pub fn set_audio_url (mut self , audio_url : String) -> Self { self . audio_url = audio_url ; self } pub fn set_title (mut self , title : String) -> Self { self . title = title ; self } pub fn set_caption (mut self , caption : Option < String >) -> Self { self . caption = caption ; self } pub fn set_parse_mode (mut self , parse_mode : Option < String >) -> Self { self . parse_mode = parse_mode ; self } pub fn set_caption_entities (mut self , caption_entities : Option < Vec < MessageEntity > >) -> Self { self . caption_entities = caption_entities ; self } pub fn set_performer (mut self , performer : Option < String >) -> Self { self . performer = performer ; self } pub fn set_audio_duration (mut self , audio_duration : Option < i64 >) -> Self { self . audio_duration = audio_duration ; self } pub fn set_reply_markup (mut self , reply_markup : Option < InlineKeyboardMarkup >) -> Self { self . reply_markup = reply_markup ; self } pub fn set_input_message_content (mut self , input_message_content : Option < InputMessageContent >) -> Self { self . input_message_content = input_message_content ; self } pub fn build (self) -> InlineQueryResultAudio { InlineQueryResultAudio { tg_type : self . tg_type , id : self . id , audio_url : self . audio_url , title : self . title , caption : self . caption , parse_mode : self . parse_mode , caption_entities : self . caption_entities , performer : self . performer , audio_duration : self . audio_duration , reply_markup : self . reply_markup , input_message_content : self . input_message_content } } } # [doc = "Represents the scope of bot commands, covering all group and supergroup chats."] # [derive (Serialize , Deserialize , Debug)] pub struct BotCommandScopeAllGroupChats { # [doc = "Scope type, must be all_group_chats"] # [serde (rename = "type")] tg_type : String } # [doc = "Represents the scope of bot commands, covering all group and supergroup chats."] # [derive (Serialize , Deserialize , Debug)] pub struct BotCommandScopeAllGroupChatsBuilder { # [doc = "Scope type, must be all_group_chats"] # [serde (rename = "type")] tg_type : String } impl BotCommandScopeAllGroupChatsBuilder { pub fn new () -> Self { Self { tg_type : "all_group_chats" . to_owned () , } } pub fn set_type (mut self , tg_type : String) -> Self { self . tg_type = tg_type ; self } pub fn build (self) -> BotCommandScopeAllGroupChats { BotCommandScopeAllGroupChats { tg_type : self . tg_type } } } # [doc = "Represents the scope of bot commands, covering all administrators of a specific group or supergroup chat."] # [derive (Serialize , Deserialize , Debug)] pub struct BotCommandScopeChatAdministrators { # [doc = "Scope type, must be chat_administrators"] # [serde (rename = "type")] tg_type : String , # [doc = "Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)"] # [serde (rename = "chat_id")] chat_id : i64 } # [doc = "Represents the scope of bot commands, covering all administrators of a specific group or supergroup chat."] # [derive (Serialize , Deserialize , Debug)] pub struct BotCommandScopeChatAdministratorsBuilder { # [doc = "Scope type, must be chat_administrators"] # [serde (rename = "type")] tg_type : String , # [doc = "Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)"] # [serde (rename = "chat_id")] chat_id : i64 } impl BotCommandScopeChatAdministratorsBuilder { pub fn new (chat_id : i64) -> Self { Self { tg_type : "chat_administrators" . to_owned () , chat_id , } } pub fn set_type (mut self , tg_type : String) -> Self { self . tg_type = tg_type ; self } pub fn set_chat_id (mut self , chat_id : i64) -> Self { self . chat_id = chat_id ; self } pub fn build (self) -> BotCommandScopeChatAdministrators { BotCommandScopeChatAdministrators { tg_type : self . tg_type , chat_id : self . chat_id } } } # [doc = "Describes data required for decrypting and authenticating EncryptedPassportElement. See the Telegram Passport Documentation for a complete description of the data decryption and authentication processes."] # [derive (Serialize , Deserialize , Debug)] pub struct EncryptedCredentials { # [doc = "Base64-encoded encrypted JSON-serialized data with unique user's payload, data hashes and secrets required for EncryptedPassportElement decryption and authentication"] # [serde (rename = "data")] data : String , # [doc = "Base64-encoded data hash for data authentication"] # [serde (rename = "hash")] hash : String , # [doc = "Base64-encoded secret, encrypted with the bot's public RSA key, required for data decryption"] # [serde (rename = "secret")] secret : String } # [doc = "Describes data required for decrypting and authenticating EncryptedPassportElement. See the Telegram Passport Documentation for a complete description of the data decryption and authentication processes."] # [derive (Serialize , Deserialize , Debug)] pub struct EncryptedCredentialsBuilder { # [doc = "Base64-encoded encrypted JSON-serialized data with unique user's payload, data hashes and secrets required for EncryptedPassportElement decryption and authentication"] # [serde (rename = "data")] data : String , # [doc = "Base64-encoded data hash for data authentication"] # [serde (rename = "hash")] hash : String , # [doc = "Base64-encoded secret, encrypted with the bot's public RSA key, required for data decryption"] # [serde (rename = "secret")] secret : String } impl EncryptedCredentialsBuilder { pub fn new (data : String , hash : String , secret : String) -> Self { Self { data , hash , secret , } } pub fn set_data (mut self , data : String) -> Self { self . data = data ; self } pub fn set_hash (mut self , hash : String) -> Self { self . hash = hash ; self } pub fn set_secret (mut self , secret : String) -> Self { self . secret = secret ; self } pub fn build (self) -> EncryptedCredentials { EncryptedCredentials { data : self . data , hash : self . hash , secret : self . secret } } } # [doc = "This object represents a service message about new members invited to a video chat."] # [derive (Serialize , Deserialize , Debug)] pub struct VideoChatParticipantsInvited { # [doc = "New members that were invited to the video chat"] # [serde (rename = "users")] users : Vec < User > } # [doc = "This object represents a service message about new members invited to a video chat."] # [derive (Serialize , Deserialize , Debug)] pub struct VideoChatParticipantsInvitedBuilder { # [doc = "New members that were invited to the video chat"] # [serde (rename = "users")] users : Vec < User > } impl VideoChatParticipantsInvitedBuilder { pub fn new (users : Vec < User >) -> Self { Self { users , } } pub fn set_users (mut self , users : Vec < User >) -> Self { self . users = users ; self } pub fn build (self) -> VideoChatParticipantsInvited { VideoChatParticipantsInvited { users : self . users } } } # [doc = "This object represents a service message about a video chat ended in the chat."] # [derive (Serialize , Deserialize , Debug)] pub struct VideoChatEnded { # [doc = "Video chat duration in seconds"] # [serde (rename = "duration")] duration : i64 } # [doc = "This object represents a service message about a video chat ended in the chat."] # [derive (Serialize , Deserialize , Debug)] pub struct VideoChatEndedBuilder { # [doc = "Video chat duration in seconds"] # [serde (rename = "duration")] duration : i64 } impl VideoChatEndedBuilder { pub fn new (duration : i64) -> Self { Self { duration , } } pub fn set_duration (mut self , duration : i64) -> Self { self . duration = duration ; self } pub fn build (self) -> VideoChatEnded { VideoChatEnded { duration : self . duration } } } # [doc = "Represents the content of a venue message to be sent as the result of an inline query."] # [derive (Serialize , Deserialize , Debug)] pub struct InputVenueMessageContent { # [doc = "Latitude of the venue in degrees"] # [serde (rename = "latitude")] latitude : f64 , # [doc = "Longitude of the venue in degrees"] # [serde (rename = "longitude")] longitude : f64 , # [doc = "Name of the venue"] # [serde (rename = "title")] title : String , # [doc = "Address of the venue"] # [serde (rename = "address")] address : String , # [doc = "Optional. Foursquare identifier of the venue, if known"] # [serde (skip_serializing_if = "Option::is_none" , rename = "foursquare_id")] foursquare_id : Option < String > , # [doc = "Optional. Foursquare type of the venue, if known. (For example, \"arts_entertainment/default\", \"arts_entertainment/aquarium\" or \"food/icecream\".)"] # [serde (skip_serializing_if = "Option::is_none" , rename = "foursquare_type")] foursquare_type : Option < String > , # [doc = "Optional. Google Places identifier of the venue"] # [serde (skip_serializing_if = "Option::is_none" , rename = "google_place_id")] google_place_id : Option < String > , # [doc = "Optional. Google Places type of the venue. (See supported types.)"] # [serde (skip_serializing_if = "Option::is_none" , rename = "google_place_type")] google_place_type : Option < String > } # [doc = "Represents the content of a venue message to be sent as the result of an inline query."] # [derive (Serialize , Deserialize , Debug)] pub struct InputVenueMessageContentBuilder { # [doc = "Latitude of the venue in degrees"] # [serde (rename = "latitude")] latitude : f64 , # [doc = "Longitude of the venue in degrees"] # [serde (rename = "longitude")] longitude : f64 , # [doc = "Name of the venue"] # [serde (rename = "title")] title : String , # [doc = "Address of the venue"] # [serde (rename = "address")] address : String , # [doc = "Optional. Foursquare identifier of the venue, if known"] # [serde (skip_serializing_if = "Option::is_none" , rename = "foursquare_id")] foursquare_id : Option < String > , # [doc = "Optional. Foursquare type of the venue, if known. (For example, \"arts_entertainment/default\", \"arts_entertainment/aquarium\" or \"food/icecream\".)"] # [serde (skip_serializing_if = "Option::is_none" , rename = "foursquare_type")] foursquare_type : Option < String > , # [doc = "Optional. Google Places identifier of the venue"] # [serde (skip_serializing_if = "Option::is_none" , rename = "google_place_id")] google_place_id : Option < String > , # [doc = "Optional. Google Places type of the venue. (See supported types.)"] # [serde (skip_serializing_if = "Option::is_none" , rename = "google_place_type")] google_place_type : Option < String > } impl InputVenueMessageContentBuilder { pub fn new (latitude : f64 , longitude : f64 , title : String , address : String) -> Self { Self { latitude , longitude , title , address , foursquare_id : None , foursquare_type : None , google_place_id : None , google_place_type : None } } pub fn set_latitude (mut self , latitude : f64) -> Self { self . latitude = latitude ; self } pub fn set_longitude (mut self , longitude : f64) -> Self { self . longitude = longitude ; self } pub fn set_title (mut self , title : String) -> Self { self . title = title ; self } pub fn set_address (mut self , address : String) -> Self { self . address = address ; self } pub fn set_foursquare_id (mut self , foursquare_id : Option < String >) -> Self { self . foursquare_id = foursquare_id ; self } pub fn set_foursquare_type (mut self , foursquare_type : Option < String >) -> Self { self . foursquare_type = foursquare_type ; self } pub fn set_google_place_id (mut self , google_place_id : Option < String >) -> Self { self . google_place_id = google_place_id ; self } pub fn set_google_place_type (mut self , google_place_type : Option < String >) -> Self { self . google_place_type = google_place_type ; self } pub fn build (self) -> InputVenueMessageContent { InputVenueMessageContent { latitude : self . latitude , longitude : self . longitude , title : self . title , address : self . address , foursquare_id : self . foursquare_id , foursquare_type : self . foursquare_type , google_place_id : self . google_place_id , google_place_type : self . google_place_type } } } # [doc = "Represents a join request sent to a chat."] # [derive (Serialize , Deserialize , Debug)] pub struct ChatJoinRequest { # [doc = "Chat to which the request was sent"] # [serde (rename = "chat")] chat : Box < Chat > , # [doc = "User that sent the join request"] # [serde (rename = "from")] from : User , # [doc = "Date the request was sent in Unix time"] # [serde (rename = "date")] date : i64 , # [doc = "Optional. Bio of the user."] # [serde (skip_serializing_if = "Option::is_none" , rename = "bio")] bio : Option < String > , # [doc = "Optional. Chat invite link that was used by the user to send the join request"] # [serde (skip_serializing_if = "Option::is_none" , rename = "invite_link")] invite_link : Option < ChatInviteLink > } # [doc = "Represents a join request sent to a chat."] # [derive (Serialize , Deserialize , Debug)] pub struct ChatJoinRequestBuilder { # [doc = "Chat to which the request was sent"] # [serde (rename = "chat")] chat : Box < Chat > , # [doc = "User that sent the join request"] # [serde (rename = "from")] from : User , # [doc = "Date the request was sent in Unix time"] # [serde (rename = "date")] date : i64 , # [doc = "Optional. Bio of the user."] # [serde (skip_serializing_if = "Option::is_none" , rename = "bio")] bio : Option < String > , # [doc = "Optional. Chat invite link that was used by the user to send the join request"] # [serde (skip_serializing_if = "Option::is_none" , rename = "invite_link")] invite_link : Option < ChatInviteLink > } impl ChatJoinRequestBuilder { pub fn new (chat : Box < Chat > , from : User , date : i64) -> Self { Self { chat , from , date , bio : None , invite_link : None } } pub fn set_chat (mut self , chat : Box < Chat >) -> Self { self . chat = chat ; self } pub fn set_from (mut self , from : User) -> Self { self . from = from ; self } pub fn set_date (mut self , date : i64) -> Self { self . date = date ; self } pub fn set_bio (mut self , bio : Option < String >) -> Self { self . bio = bio ; self } pub fn set_invite_link (mut self , invite_link : Option < ChatInviteLink >) -> Self { self . invite_link = invite_link ; self } pub fn build (self) -> ChatJoinRequest { ChatJoinRequest { chat : self . chat , from : self . from , date : self . date , bio : self . bio , invite_link : self . invite_link } } } # [doc = "Represents an issue with a list of scans. The error is considered resolved when the list of files containing the scans changes."] # [derive (Serialize , Deserialize , Debug)] pub struct PassportElementErrorFiles { # [doc = "Error source, must be files"] # [serde (rename = "source")] source : String , # [doc = "The section of the user's Telegram Passport which has the issue, one of \"utility_bill\", \"bank_statement\", \"rental_agreement\", \"passport_registration\", \"temporary_registration\""] # [serde (rename = "type")] tg_type : String , # [doc = "List of base64-encoded file hashes"] # [serde (rename = "file_hashes")] file_hashes : Vec < String > , # [doc = "Error message"] # [serde (rename = "message")] message : String } # [doc = "Represents an issue with a list of scans. The error is considered resolved when the list of files containing the scans changes."] # [derive (Serialize , Deserialize , Debug)] pub struct PassportElementErrorFilesBuilder { # [doc = "Error source, must be files"] # [serde (rename = "source")] source : String , # [doc = "The section of the user's Telegram Passport which has the issue, one of \"utility_bill\", \"bank_statement\", \"rental_agreement\", \"passport_registration\", \"temporary_registration\""] # [serde (rename = "type")] tg_type : String , # [doc = "List of base64-encoded file hashes"] # [serde (rename = "file_hashes")] file_hashes : Vec < String > , # [doc = "Error message"] # [serde (rename = "message")] message : String } impl PassportElementErrorFilesBuilder { pub fn new (source : String , file_hashes : Vec < String > , message : String) -> Self { Self { tg_type : "PassportElementErrorFiles" . to_owned () , source , file_hashes , message , } } pub fn set_source (mut self , source : String) -> Self { self . source = source ; self } pub fn set_type (mut self , tg_type : String) -> Self { self . tg_type = tg_type ; self } pub fn set_file_hashes (mut self , file_hashes : Vec < String >) -> Self { self . file_hashes = file_hashes ; self } pub fn set_message (mut self , message : String) -> Self { self . message = message ; self } pub fn build (self) -> PassportElementErrorFiles { PassportElementErrorFiles { source : self . source , tg_type : self . tg_type , file_hashes : self . file_hashes , message : self . message } } } # [doc = "Represents a link to a file stored on the Telegram servers. By default, this file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the file.Note: This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them."] # [derive (Serialize , Deserialize , Debug)] pub struct InlineQueryResultCachedDocument { # [doc = "Type of the result, must be document"] # [serde (rename = "type")] tg_type : String , # [doc = "Unique identifier for this result, 1-64 bytes"] # [serde (rename = "id")] id : String , # [doc = "Title for the result"] # [serde (rename = "title")] title : String , # [doc = "A valid file identifier for the file"] # [serde (rename = "document_file_id")] document_file_id : String , # [doc = "Optional. Short description of the result"] # [serde (skip_serializing_if = "Option::is_none" , rename = "description")] description : Option < String > , # [doc = "Optional. Caption of the document to be sent, 0-1024 characters after entities parsing"] # [serde (skip_serializing_if = "Option::is_none" , rename = "caption")] caption : Option < String > , # [doc = "Optional. Mode for parsing entities in the document caption. See formatting options for more details."] # [serde (skip_serializing_if = "Option::is_none" , rename = "parse_mode")] parse_mode : Option < String > , # [doc = "Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode"] # [serde (skip_serializing_if = "Option::is_none" , rename = "caption_entities")] caption_entities : Option < Vec < MessageEntity > > , # [doc = "Optional. Inline keyboard attached to the message"] # [serde (skip_serializing_if = "Option::is_none" , rename = "reply_markup")] reply_markup : Option < InlineKeyboardMarkup > , # [doc = "Optional. Content of the message to be sent instead of the file"] # [serde (skip_serializing_if = "Option::is_none" , rename = "input_message_content")] input_message_content : Option < InputMessageContent > } # [doc = "Represents a link to a file stored on the Telegram servers. By default, this file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the file.Note: This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them."] # [derive (Serialize , Deserialize , Debug)] pub struct InlineQueryResultCachedDocumentBuilder { # [doc = "Type of the result, must be document"] # [serde (rename = "type")] tg_type : String , # [doc = "Unique identifier for this result, 1-64 bytes"] # [serde (rename = "id")] id : String , # [doc = "Title for the result"] # [serde (rename = "title")] title : String , # [doc = "A valid file identifier for the file"] # [serde (rename = "document_file_id")] document_file_id : String , # [doc = "Optional. Short description of the result"] # [serde (skip_serializing_if = "Option::is_none" , rename = "description")] description : Option < String > , # [doc = "Optional. Caption of the document to be sent, 0-1024 characters after entities parsing"] # [serde (skip_serializing_if = "Option::is_none" , rename = "caption")] caption : Option < String > , # [doc = "Optional. Mode for parsing entities in the document caption. See formatting options for more details."] # [serde (skip_serializing_if = "Option::is_none" , rename = "parse_mode")] parse_mode : Option < String > , # [doc = "Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode"] # [serde (skip_serializing_if = "Option::is_none" , rename = "caption_entities")] caption_entities : Option < Vec < MessageEntity > > , # [doc = "Optional. Inline keyboard attached to the message"] # [serde (skip_serializing_if = "Option::is_none" , rename = "reply_markup")] reply_markup : Option < InlineKeyboardMarkup > , # [doc = "Optional. Content of the message to be sent instead of the file"] # [serde (skip_serializing_if = "Option::is_none" , rename = "input_message_content")] input_message_content : Option < InputMessageContent > } impl InlineQueryResultCachedDocumentBuilder { pub fn new (id : String , title : String , document_file_id : String) -> Self { Self { tg_type : "document" . to_owned () , id , title , document_file_id , description : None , caption : None , parse_mode : None , caption_entities : None , reply_markup : None , input_message_content : None } } pub fn set_type (mut self , tg_type : String) -> Self { self . tg_type = tg_type ; self } pub fn set_id (mut self , id : String) -> Self { self . id = id ; self } pub fn set_title (mut self , title : String) -> Self { self . title = title ; self } pub fn set_document_file_id (mut self , document_file_id : String) -> Self { self . document_file_id = document_file_id ; self } pub fn set_description (mut self , description : Option < String >) -> Self { self . description = description ; self } pub fn set_caption (mut self , caption : Option < String >) -> Self { self . caption = caption ; self } pub fn set_parse_mode (mut self , parse_mode : Option < String >) -> Self { self . parse_mode = parse_mode ; self } pub fn set_caption_entities (mut self , caption_entities : Option < Vec < MessageEntity > >) -> Self { self . caption_entities = caption_entities ; self } pub fn set_reply_markup (mut self , reply_markup : Option < InlineKeyboardMarkup >) -> Self { self . reply_markup = reply_markup ; self } pub fn set_input_message_content (mut self , input_message_content : Option < InputMessageContent >) -> Self { self . input_message_content = input_message_content ; self } pub fn build (self) -> InlineQueryResultCachedDocument { InlineQueryResultCachedDocument { tg_type : self . tg_type , id : self . id , title : self . title , document_file_id : self . document_file_id , description : self . description , caption : self . caption , parse_mode : self . parse_mode , caption_entities : self . caption_entities , reply_markup : self . reply_markup , input_message_content : self . input_message_content } } } # [doc = "Represents a link to an MP3 audio file stored on the Telegram servers. By default, this audio file will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the audio.Note: This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them."] # [derive (Serialize , Deserialize , Debug)] pub struct InlineQueryResultCachedAudio { # [doc = "Type of the result, must be audio"] # [serde (rename = "type")] tg_type : String , # [doc = "Unique identifier for this result, 1-64 bytes"] # [serde (rename = "id")] id : String , # [doc = "A valid file identifier for the audio file"] # [serde (rename = "audio_file_id")] audio_file_id : String , # [doc = "Optional. Caption, 0-1024 characters after entities parsing"] # [serde (skip_serializing_if = "Option::is_none" , rename = "caption")] caption : Option < String > , # [doc = "Optional. Mode for parsing entities in the audio caption. See formatting options for more details."] # [serde (skip_serializing_if = "Option::is_none" , rename = "parse_mode")] parse_mode : Option < String > , # [doc = "Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode"] # [serde (skip_serializing_if = "Option::is_none" , rename = "caption_entities")] caption_entities : Option < Vec < MessageEntity > > , # [doc = "Optional. Inline keyboard attached to the message"] # [serde (skip_serializing_if = "Option::is_none" , rename = "reply_markup")] reply_markup : Option < InlineKeyboardMarkup > , # [doc = "Optional. Content of the message to be sent instead of the audio"] # [serde (skip_serializing_if = "Option::is_none" , rename = "input_message_content")] input_message_content : Option < InputMessageContent > } # [doc = "Represents a link to an MP3 audio file stored on the Telegram servers. By default, this audio file will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the audio.Note: This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them."] # [derive (Serialize , Deserialize , Debug)] pub struct InlineQueryResultCachedAudioBuilder { # [doc = "Type of the result, must be audio"] # [serde (rename = "type")] tg_type : String , # [doc = "Unique identifier for this result, 1-64 bytes"] # [serde (rename = "id")] id : String , # [doc = "A valid file identifier for the audio file"] # [serde (rename = "audio_file_id")] audio_file_id : String , # [doc = "Optional. Caption, 0-1024 characters after entities parsing"] # [serde (skip_serializing_if = "Option::is_none" , rename = "caption")] caption : Option < String > , # [doc = "Optional. Mode for parsing entities in the audio caption. See formatting options for more details."] # [serde (skip_serializing_if = "Option::is_none" , rename = "parse_mode")] parse_mode : Option < String > , # [doc = "Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode"] # [serde (skip_serializing_if = "Option::is_none" , rename = "caption_entities")] caption_entities : Option < Vec < MessageEntity > > , # [doc = "Optional. Inline keyboard attached to the message"] # [serde (skip_serializing_if = "Option::is_none" , rename = "reply_markup")] reply_markup : Option < InlineKeyboardMarkup > , # [doc = "Optional. Content of the message to be sent instead of the audio"] # [serde (skip_serializing_if = "Option::is_none" , rename = "input_message_content")] input_message_content : Option < InputMessageContent > } impl InlineQueryResultCachedAudioBuilder { pub fn new (id : String , audio_file_id : String) -> Self { Self { tg_type : "audio" . to_owned () , id , audio_file_id , caption : None , parse_mode : None , caption_entities : None , reply_markup : None , input_message_content : None } } pub fn set_type (mut self , tg_type : String) -> Self { self . tg_type = tg_type ; self } pub fn set_id (mut self , id : String) -> Self { self . id = id ; self } pub fn set_audio_file_id (mut self , audio_file_id : String) -> Self { self . audio_file_id = audio_file_id ; self } pub fn set_caption (mut self , caption : Option < String >) -> Self { self . caption = caption ; self } pub fn set_parse_mode (mut self , parse_mode : Option < String >) -> Self { self . parse_mode = parse_mode ; self } pub fn set_caption_entities (mut self , caption_entities : Option < Vec < MessageEntity > >) -> Self { self . caption_entities = caption_entities ; self } pub fn set_reply_markup (mut self , reply_markup : Option < InlineKeyboardMarkup >) -> Self { self . reply_markup = reply_markup ; self } pub fn set_input_message_content (mut self , input_message_content : Option < InputMessageContent >) -> Self { self . input_message_content = input_message_content ; self } pub fn build (self) -> InlineQueryResultCachedAudio { InlineQueryResultCachedAudio { tg_type : self . tg_type , id : self . id , audio_file_id : self . audio_file_id , caption : self . caption , parse_mode : self . parse_mode , caption_entities : self . caption_entities , reply_markup : self . reply_markup , input_message_content : self . input_message_content } } } # [doc = "Represents an invite link for a chat."] # [derive (Serialize , Deserialize , Debug)] pub struct ChatInviteLink { # [doc = "The invite link. If the link was created by another chat administrator, then the second part of the link will be replaced with \"...\"."] # [serde (rename = "invite_link")] invite_link : String , # [doc = "Creator of the link"] # [serde (rename = "creator")] creator : User , # [doc = "True, if users joining the chat via the link need to be approved by chat administrators"] # [serde (rename = "creates_join_request")] creates_join_request : bool , # [doc = "True, if the link is primary"] # [serde (rename = "is_primary")] is_primary : bool , # [doc = "True, if the link is revoked"] # [serde (rename = "is_revoked")] is_revoked : bool , # [doc = "Optional. Invite link name"] # [serde (skip_serializing_if = "Option::is_none" , rename = "name")] name : Option < String > , # [doc = "Optional. Point in time (Unix timestamp) when the link will expire or has been expired"] # [serde (skip_serializing_if = "Option::is_none" , rename = "expire_date")] expire_date : Option < i64 > , # [doc = "Optional. The maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999"] # [serde (skip_serializing_if = "Option::is_none" , rename = "member_limit")] member_limit : Option < i64 > , # [doc = "Optional. Number of pending join requests created using this link"] # [serde (skip_serializing_if = "Option::is_none" , rename = "pending_join_request_count")] pending_join_request_count : Option < i64 > } # [doc = "Represents an invite link for a chat."] # [derive (Serialize , Deserialize , Debug)] pub struct ChatInviteLinkBuilder { # [doc = "The invite link. If the link was created by another chat administrator, then the second part of the link will be replaced with \"...\"."] # [serde (rename = "invite_link")] invite_link : String , # [doc = "Creator of the link"] # [serde (rename = "creator")] creator : User , # [doc = "True, if users joining the chat via the link need to be approved by chat administrators"] # [serde (rename = "creates_join_request")] creates_join_request : bool , # [doc = "True, if the link is primary"] # [serde (rename = "is_primary")] is_primary : bool , # [doc = "True, if the link is revoked"] # [serde (rename = "is_revoked")] is_revoked : bool , # [doc = "Optional. Invite link name"] # [serde (skip_serializing_if = "Option::is_none" , rename = "name")] name : Option < String > , # [doc = "Optional. Point in time (Unix timestamp) when the link will expire or has been expired"] # [serde (skip_serializing_if = "Option::is_none" , rename = "expire_date")] expire_date : Option < i64 > , # [doc = "Optional. The maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999"] # [serde (skip_serializing_if = "Option::is_none" , rename = "member_limit")] member_limit : Option < i64 > , # [doc = "Optional. Number of pending join requests created using this link"] # [serde (skip_serializing_if = "Option::is_none" , rename = "pending_join_request_count")] pending_join_request_count : Option < i64 > } impl ChatInviteLinkBuilder { pub fn new (invite_link : String , creator : User , creates_join_request : bool , is_primary : bool , is_revoked : bool) -> Self { Self { invite_link , creator , creates_join_request , is_primary , is_revoked , name : None , expire_date : None , member_limit : None , pending_join_request_count : None } } pub fn set_invite_link (mut self , invite_link : String) -> Self { self . invite_link = invite_link ; self } pub fn set_creator (mut self , creator : User) -> Self { self . creator = creator ; self } pub fn set_creates_join_request (mut self , creates_join_request : bool) -> Self { self . creates_join_request = creates_join_request ; self } pub fn set_is_primary (mut self , is_primary : bool) -> Self { self . is_primary = is_primary ; self } pub fn set_is_revoked (mut self , is_revoked : bool) -> Self { self . is_revoked = is_revoked ; self } pub fn set_name (mut self , name : Option < String >) -> Self { self . name = name ; self } pub fn set_expire_date (mut self , expire_date : Option < i64 >) -> Self { self . expire_date = expire_date ; self } pub fn set_member_limit (mut self , member_limit : Option < i64 >) -> Self { self . member_limit = member_limit ; self } pub fn set_pending_join_request_count (mut self , pending_join_request_count : Option < i64 >) -> Self { self . pending_join_request_count = pending_join_request_count ; self } pub fn build (self) -> ChatInviteLink { ChatInviteLink { invite_link : self . invite_link , creator : self . creator , creates_join_request : self . creates_join_request , is_primary : self . is_primary , is_revoked : self . is_revoked , name : self . name , expire_date : self . expire_date , member_limit : self . member_limit , pending_join_request_count : self . pending_join_request_count } } } # [doc = "Represents an audio file to be treated as music to be sent."] # [derive (Serialize , Deserialize , Debug)] pub struct InputMediaAudio { # [doc = "Type of the result, must be audio"] # [serde (rename = "type")] tg_type : String , # [doc = "File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass \"attach://<file_attach_name>\" to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files: https://core.telegram.org/bots/api#sending-files"] # [serde (rename = "media")] media : Option < InputFile > , # [doc = "Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass \"attach://<file_attach_name>\" if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files: https://core.telegram.org/bots/api#sending-files"] # [serde (skip_serializing_if = "Option::is_none" , rename = "thumb")] thumb : Option < InputFile > , # [doc = "Optional. Caption of the audio to be sent, 0-1024 characters after entities parsing"] # [serde (skip_serializing_if = "Option::is_none" , rename = "caption")] caption : Option < String > , # [doc = "Optional. Mode for parsing entities in the audio caption. See formatting options for more details."] # [serde (skip_serializing_if = "Option::is_none" , rename = "parse_mode")] parse_mode : Option < String > , # [doc = "Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode"] # [serde (skip_serializing_if = "Option::is_none" , rename = "caption_entities")] caption_entities : Option < Vec < MessageEntity > > , # [doc = "Optional. Duration of the audio in seconds"] # [serde (skip_serializing_if = "Option::is_none" , rename = "duration")] duration : Option < i64 > , # [doc = "Optional. Performer of the audio"] # [serde (skip_serializing_if = "Option::is_none" , rename = "performer")] performer : Option < String > , # [doc = "Optional. Title of the audio"] # [serde (skip_serializing_if = "Option::is_none" , rename = "title")] title : Option < String > } # [doc = "Represents an audio file to be treated as music to be sent."] # [derive (Serialize , Deserialize , Debug)] pub struct InputMediaAudioBuilder { # [doc = "Type of the result, must be audio"] # [serde (rename = "type")] tg_type : String , # [doc = "File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass \"attach://<file_attach_name>\" to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files: https://core.telegram.org/bots/api#sending-files"] # [serde (rename = "media")] media : Option < InputFile > , # [doc = "Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass \"attach://<file_attach_name>\" if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files: https://core.telegram.org/bots/api#sending-files"] # [serde (skip_serializing_if = "Option::is_none" , rename = "thumb")] thumb : Option < InputFile > , # [doc = "Optional. Caption of the audio to be sent, 0-1024 characters after entities parsing"] # [serde (skip_serializing_if = "Option::is_none" , rename = "caption")] caption : Option < String > , # [doc = "Optional. Mode for parsing entities in the audio caption. See formatting options for more details."] # [serde (skip_serializing_if = "Option::is_none" , rename = "parse_mode")] parse_mode : Option < String > , # [doc = "Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode"] # [serde (skip_serializing_if = "Option::is_none" , rename = "caption_entities")] caption_entities : Option < Vec < MessageEntity > > , # [doc = "Optional. Duration of the audio in seconds"] # [serde (skip_serializing_if = "Option::is_none" , rename = "duration")] duration : Option < i64 > , # [doc = "Optional. Performer of the audio"] # [serde (skip_serializing_if = "Option::is_none" , rename = "performer")] performer : Option < String > , # [doc = "Optional. Title of the audio"] # [serde (skip_serializing_if = "Option::is_none" , rename = "title")] title : Option < String > } impl InputMediaAudioBuilder { pub fn new (media : Option < InputFile >) -> Self { Self { tg_type : "audio" . to_owned () , media , thumb : None , caption : None , parse_mode : None , caption_entities : None , duration : None , performer : None , title : None } } pub fn set_type (mut self , tg_type : String) -> Self { self . tg_type = tg_type ; self } pub fn set_media (mut self , media : Option < InputFile >) -> Self { self . media = media ; self } pub fn set_thumb (mut self , thumb : Option < InputFile >) -> Self { self . thumb = thumb ; self } pub fn set_caption (mut self , caption : Option < String >) -> Self { self . caption = caption ; self } pub fn set_parse_mode (mut self , parse_mode : Option < String >) -> Self { self . parse_mode = parse_mode ; self } pub fn set_caption_entities (mut self , caption_entities : Option < Vec < MessageEntity > >) -> Self { self . caption_entities = caption_entities ; self } pub fn set_duration (mut self , duration : Option < i64 >) -> Self { self . duration = duration ; self } pub fn set_performer (mut self , performer : Option < String >) -> Self { self . performer = performer ; self } pub fn set_title (mut self , title : Option < String >) -> Self { self . title = title ; self } pub fn build (self) -> InputMediaAudio { InputMediaAudio { tg_type : self . tg_type , media : self . media , thumb : self . thumb , caption : self . caption , parse_mode : self . parse_mode , caption_entities : self . caption_entities , duration : self . duration , performer : self . performer , title : self . title } } } # [doc = "Represents a menu button, which opens the bot's list of commands."] # [derive (Serialize , Deserialize , Debug)] pub struct MenuButtonCommands { # [doc = "Type of the button, must be commands"] # [serde (rename = "type")] tg_type : String } # [doc = "Represents a menu button, which opens the bot's list of commands."] # [derive (Serialize , Deserialize , Debug)] pub struct MenuButtonCommandsBuilder { # [doc = "Type of the button, must be commands"] # [serde (rename = "type")] tg_type : String } impl MenuButtonCommandsBuilder { pub fn new () -> Self { Self { tg_type : "commands" . to_owned () , } } pub fn set_type (mut self , tg_type : String) -> Self { self . tg_type = tg_type ; self } pub fn build (self) -> MenuButtonCommands { MenuButtonCommands { tg_type : self . tg_type } } } # [derive (Serialize , Deserialize , Debug)] pub struct FileBytes { pub (crate) name : String , # [serde (skip , default)] pub (crate) bytes : Option < Vec < u8 >> } pub enum FileData { Bytes (Vec < u8 >) , String (String) } # [derive (Serialize , Deserialize , Debug)] pub enum InputFile { Bytes (FileBytes) , String (String) } impl FileData { pub fn to_inputfile (self , name : String) -> InputFile { match self { FileData :: Bytes (bytes) => InputFile :: Bytes (FileBytes { name : name , bytes : Some (bytes) , }) , FileData :: String (name) => InputFile :: String (name) , } } } # [doc = "This object represents a message."] # [derive (Serialize , Deserialize , Debug)] pub struct Message { # [doc = "Unique message identifier inside this chat"] # [serde (rename = "message_id")] message_id : i64 , # [doc = "Optional. Sender of the message; empty for messages sent to channels. For backward compatibility, the field contains a fake sender user in non-channel chats, if the message was sent on behalf of a chat."] # [serde (skip_serializing_if = "Option::is_none" , rename = "from")] from : Option < User > , # [doc = "Optional. Sender of the message, sent on behalf of a chat. For example, the channel itself for channel posts, the supergroup itself for messages from anonymous group administrators, the linked channel for messages automatically forwarded to the discussion group. For backward compatibility, the field from contains a fake sender user in non-channel chats, if the message was sent on behalf of a chat."] # [serde (skip_serializing_if = "Option::is_none" , rename = "sender_chat")] sender_chat : Option < Box < Chat > > , # [doc = "Date the message was sent in Unix time"] # [serde (rename = "date")] date : i64 , # [doc = "Conversation the message belongs to"] # [serde (rename = "chat")] chat : Box < Chat > , # [doc = "Optional. For forwarded messages, sender of the original message"] # [serde (skip_serializing_if = "Option::is_none" , rename = "forward_from")] forward_from : Option < User > , # [doc = "Optional. For messages forwarded from channels or from anonymous administrators, information about the original sender chat"] # [serde (skip_serializing_if = "Option::is_none" , rename = "forward_from_chat")] forward_from_chat : Option < Box < Chat > > , # [doc = "Optional. For messages forwarded from channels, identifier of the original message in the channel"] # [serde (skip_serializing_if = "Option::is_none" , rename = "forward_from_message_id")] forward_from_message_id : Option < i64 > , # [doc = "Optional. For forwarded messages that were originally sent in channels or by an anonymous chat administrator, signature of the message sender if present"] # [serde (skip_serializing_if = "Option::is_none" , rename = "forward_signature")] forward_signature : Option < String > , # [doc = "Optional. Sender's name for messages forwarded from users who disallow adding a link to their account in forwarded messages"] # [serde (skip_serializing_if = "Option::is_none" , rename = "forward_sender_name")] forward_sender_name : Option < String > , # [doc = "Optional. For forwarded messages, date the original message was sent in Unix time"] # [serde (skip_serializing_if = "Option::is_none" , rename = "forward_date")] forward_date : Option < i64 > , # [doc = "Optional. True, if the message is a channel post that was automatically forwarded to the connected discussion group"] # [serde (skip_serializing_if = "Option::is_none" , rename = "is_automatic_forward")] is_automatic_forward : Option < bool > , # [doc = "Optional. For replies, the original message. Note that the Message object in this field will not contain further reply_to_message fields even if it itself is a reply."] # [serde (skip_serializing_if = "Option::is_none" , rename = "reply_to_message")] reply_to_message : Option < Box < Message > > , # [doc = "Optional. Bot through which the message was sent"] # [serde (skip_serializing_if = "Option::is_none" , rename = "via_bot")] via_bot : Option < User > , # [doc = "Optional. Date the message was last edited in Unix time"] # [serde (skip_serializing_if = "Option::is_none" , rename = "edit_date")] edit_date : Option < i64 > , # [doc = "Optional. True, if the message can't be forwarded"] # [serde (skip_serializing_if = "Option::is_none" , rename = "has_protected_content")] has_protected_content : Option < bool > , # [doc = "Optional. The unique identifier of a media message group this message belongs to"] # [serde (skip_serializing_if = "Option::is_none" , rename = "media_group_id")] media_group_id : Option < String > , # [doc = "Optional. Signature of the post author for messages in channels, or the custom title of an anonymous group administrator"] # [serde (skip_serializing_if = "Option::is_none" , rename = "author_signature")] author_signature : Option < String > , # [doc = "Optional. For text messages, the actual UTF-8 text of the message"] # [serde (skip_serializing_if = "Option::is_none" , rename = "text")] text : Option < String > , # [doc = "Optional. For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text"] # [serde (skip_serializing_if = "Option::is_none" , rename = "entities")] entities : Option < Vec < MessageEntity > > , # [doc = "Optional. Message is an animation, information about the animation. For backward compatibility, when this field is set, the document field will also be set"] # [serde (skip_serializing_if = "Option::is_none" , rename = "animation")] animation : Option < Animation > , # [doc = "Optional. Message is an audio file, information about the file"] # [serde (skip_serializing_if = "Option::is_none" , rename = "audio")] audio : Option < Audio > , # [doc = "Optional. Message is a general file, information about the file"] # [serde (skip_serializing_if = "Option::is_none" , rename = "document")] document : Option < Document > , # [doc = "Optional. Message is a photo, available sizes of the photo"] # [serde (skip_serializing_if = "Option::is_none" , rename = "photo")] photo : Option < Vec < PhotoSize > > , # [doc = "Optional. Message is a sticker, information about the sticker"] # [serde (skip_serializing_if = "Option::is_none" , rename = "sticker")] sticker : Option < Sticker > , # [doc = "Optional. Message is a video, information about the video"] # [serde (skip_serializing_if = "Option::is_none" , rename = "video")] video : Option < Video > , # [doc = "Optional. Message is a video note, information about the video message"] # [serde (skip_serializing_if = "Option::is_none" , rename = "video_note")] video_note : Option < VideoNote > , # [doc = "Optional. Message is a voice message, information about the file"] # [serde (skip_serializing_if = "Option::is_none" , rename = "voice")] voice : Option < Voice > , # [doc = "Optional. Caption for the animation, audio, document, photo, video or voice"] # [serde (skip_serializing_if = "Option::is_none" , rename = "caption")] caption : Option < String > , # [doc = "Optional. For messages with a caption, special entities like usernames, URLs, bot commands, etc. that appear in the caption"] # [serde (skip_serializing_if = "Option::is_none" , rename = "caption_entities")] caption_entities : Option < Vec < MessageEntity > > , # [doc = "Optional. Message is a shared contact, information about the contact"] # [serde (skip_serializing_if = "Option::is_none" , rename = "contact")] contact : Option < Contact > , # [doc = "Optional. Message is a dice with random value"] # [serde (skip_serializing_if = "Option::is_none" , rename = "dice")] dice : Option < Dice > , # [doc = "Optional. Message is a game, information about the game. More about games: https://core.telegram.org/bots/api#games"] # [serde (skip_serializing_if = "Option::is_none" , rename = "game")] game : Option < Game > , # [doc = "Optional. Message is a native poll, information about the poll"] # [serde (skip_serializing_if = "Option::is_none" , rename = "poll")] poll : Option < Poll > , # [doc = "Optional. Message is a venue, information about the venue. For backward compatibility, when this field is set, the location field will also be set"] # [serde (skip_serializing_if = "Option::is_none" , rename = "venue")] venue : Option < Venue > , # [doc = "Optional. Message is a shared location, information about the location"] # [serde (skip_serializing_if = "Option::is_none" , rename = "location")] location : Option < Location > , # [doc = "Optional. New members that were added to the group or supergroup and information about them (the bot itself may be one of these members)"] # [serde (skip_serializing_if = "Option::is_none" , rename = "new_chat_members")] new_chat_members : Option < Vec < User > > , # [doc = "Optional. A member was removed from the group, information about them (this member may be the bot itself)"] # [serde (skip_serializing_if = "Option::is_none" , rename = "left_chat_member")] left_chat_member : Option < User > , # [doc = "Optional. A chat title was changed to this value"] # [serde (skip_serializing_if = "Option::is_none" , rename = "new_chat_title")] new_chat_title : Option < String > , # [doc = "Optional. A chat photo was change to this value"] # [serde (skip_serializing_if = "Option::is_none" , rename = "new_chat_photo")] new_chat_photo : Option < Vec < PhotoSize > > , # [doc = "Optional. Service message: the chat photo was deleted"] # [serde (skip_serializing_if = "Option::is_none" , rename = "delete_chat_photo")] delete_chat_photo : Option < bool > , # [doc = "Optional. Service message: the group has been created"] # [serde (skip_serializing_if = "Option::is_none" , rename = "group_chat_created")] group_chat_created : Option < bool > , # [doc = "Optional. Service message: the supergroup has been created. This field can't be received in a message coming through updates, because bot can't be a member of a supergroup when it is created. It can only be found in reply_to_message if someone replies to a very first message in a directly created supergroup."] # [serde (skip_serializing_if = "Option::is_none" , rename = "supergroup_chat_created")] supergroup_chat_created : Option < bool > , # [doc = "Optional. Service message: the channel has been created. This field can't be received in a message coming through updates, because bot can't be a member of a channel when it is created. It can only be found in reply_to_message if someone replies to a very first message in a channel."] # [serde (skip_serializing_if = "Option::is_none" , rename = "channel_chat_created")] channel_chat_created : Option < bool > , # [doc = "Optional. Service message: auto-delete timer settings changed in the chat"] # [serde (skip_serializing_if = "Option::is_none" , rename = "message_auto_delete_timer_changed")] message_auto_delete_timer_changed : Option < MessageAutoDeleteTimerChanged > , # [doc = "Optional. The group has been migrated to a supergroup with the specified identifier. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier."] # [serde (skip_serializing_if = "Option::is_none" , rename = "migrate_to_chat_id")] migrate_to_chat_id : Option < i64 > , # [doc = "Optional. The supergroup has been migrated from a group with the specified identifier. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier."] # [serde (skip_serializing_if = "Option::is_none" , rename = "migrate_from_chat_id")] migrate_from_chat_id : Option < i64 > , # [doc = "Optional. Specified message was pinned. Note that the Message object in this field will not contain further reply_to_message fields even if it is itself a reply."] # [serde (skip_serializing_if = "Option::is_none" , rename = "pinned_message")] pinned_message : Option < Box < Message > > , # [doc = "Optional. Message is an invoice for a payment, information about the invoice. More about payments: https://core.telegram.org/bots/api#payments"] # [serde (skip_serializing_if = "Option::is_none" , rename = "invoice")] invoice : Option < Invoice > , # [doc = "Optional. Message is a service message about a successful payment, information about the payment. More about payments: https://core.telegram.org/bots/api#payments"] # [serde (skip_serializing_if = "Option::is_none" , rename = "successful_payment")] successful_payment : Option < SuccessfulPayment > , # [doc = "Optional. The domain name of the website on which the user has logged in. More about Telegram Login: https://core.telegram.org/widgets/login"] # [serde (skip_serializing_if = "Option::is_none" , rename = "connected_website")] connected_website : Option < String > , # [doc = "Optional. Telegram Passport data"] # [serde (skip_serializing_if = "Option::is_none" , rename = "passport_data")] passport_data : Option < PassportData > , # [doc = "Optional. Service message. A user in the chat triggered another user's proximity alert while sharing Live Location."] # [serde (skip_serializing_if = "Option::is_none" , rename = "proximity_alert_triggered")] proximity_alert_triggered : Option < ProximityAlertTriggered > , # [doc = "Optional. Service message: video chat scheduled"] # [serde (skip_serializing_if = "Option::is_none" , rename = "video_chat_scheduled")] video_chat_scheduled : Option < VideoChatScheduled > , # [doc = "Optional. Service message: video chat started"] # [serde (skip_serializing_if = "Option::is_none" , rename = "video_chat_started")] video_chat_started : Option < VideoChatStarted > , # [doc = "Optional. Service message: video chat ended"] # [serde (skip_serializing_if = "Option::is_none" , rename = "video_chat_ended")] video_chat_ended : Option < VideoChatEnded > , # [doc = "Optional. Service message: new participants invited to a video chat"] # [serde (skip_serializing_if = "Option::is_none" , rename = "video_chat_participants_invited")] video_chat_participants_invited : Option < VideoChatParticipantsInvited > , # [doc = "Optional. Service message: data sent by a Web App"] # [serde (skip_serializing_if = "Option::is_none" , rename = "web_app_data")] web_app_data : Option < WebAppData > , # [doc = "Optional. Inline keyboard attached to the message. login_url buttons are represented as ordinary url buttons."] # [serde (skip_serializing_if = "Option::is_none" , rename = "reply_markup")] reply_markup : Option < InlineKeyboardMarkup > } # [doc = "This object represents a message."] # [derive (Serialize , Deserialize , Debug)] pub struct MessageBuilder { # [doc = "Unique message identifier inside this chat"] # [serde (rename = "message_id")] message_id : i64 , # [doc = "Optional. Sender of the message; empty for messages sent to channels. For backward compatibility, the field contains a fake sender user in non-channel chats, if the message was sent on behalf of a chat."] # [serde (skip_serializing_if = "Option::is_none" , rename = "from")] from : Option < User > , # [doc = "Optional. Sender of the message, sent on behalf of a chat. For example, the channel itself for channel posts, the supergroup itself for messages from anonymous group administrators, the linked channel for messages automatically forwarded to the discussion group. For backward compatibility, the field from contains a fake sender user in non-channel chats, if the message was sent on behalf of a chat."] # [serde (skip_serializing_if = "Option::is_none" , rename = "sender_chat")] sender_chat : Option < Box < Chat > > , # [doc = "Date the message was sent in Unix time"] # [serde (rename = "date")] date : i64 , # [doc = "Conversation the message belongs to"] # [serde (rename = "chat")] chat : Box < Chat > , # [doc = "Optional. For forwarded messages, sender of the original message"] # [serde (skip_serializing_if = "Option::is_none" , rename = "forward_from")] forward_from : Option < User > , # [doc = "Optional. For messages forwarded from channels or from anonymous administrators, information about the original sender chat"] # [serde (skip_serializing_if = "Option::is_none" , rename = "forward_from_chat")] forward_from_chat : Option < Box < Chat > > , # [doc = "Optional. For messages forwarded from channels, identifier of the original message in the channel"] # [serde (skip_serializing_if = "Option::is_none" , rename = "forward_from_message_id")] forward_from_message_id : Option < i64 > , # [doc = "Optional. For forwarded messages that were originally sent in channels or by an anonymous chat administrator, signature of the message sender if present"] # [serde (skip_serializing_if = "Option::is_none" , rename = "forward_signature")] forward_signature : Option < String > , # [doc = "Optional. Sender's name for messages forwarded from users who disallow adding a link to their account in forwarded messages"] # [serde (skip_serializing_if = "Option::is_none" , rename = "forward_sender_name")] forward_sender_name : Option < String > , # [doc = "Optional. For forwarded messages, date the original message was sent in Unix time"] # [serde (skip_serializing_if = "Option::is_none" , rename = "forward_date")] forward_date : Option < i64 > , # [doc = "Optional. True, if the message is a channel post that was automatically forwarded to the connected discussion group"] # [serde (skip_serializing_if = "Option::is_none" , rename = "is_automatic_forward")] is_automatic_forward : Option < bool > , # [doc = "Optional. For replies, the original message. Note that the Message object in this field will not contain further reply_to_message fields even if it itself is a reply."] # [serde (skip_serializing_if = "Option::is_none" , rename = "reply_to_message")] reply_to_message : Option < Box < Message > > , # [doc = "Optional. Bot through which the message was sent"] # [serde (skip_serializing_if = "Option::is_none" , rename = "via_bot")] via_bot : Option < User > , # [doc = "Optional. Date the message was last edited in Unix time"] # [serde (skip_serializing_if = "Option::is_none" , rename = "edit_date")] edit_date : Option < i64 > , # [doc = "Optional. True, if the message can't be forwarded"] # [serde (skip_serializing_if = "Option::is_none" , rename = "has_protected_content")] has_protected_content : Option < bool > , # [doc = "Optional. The unique identifier of a media message group this message belongs to"] # [serde (skip_serializing_if = "Option::is_none" , rename = "media_group_id")] media_group_id : Option < String > , # [doc = "Optional. Signature of the post author for messages in channels, or the custom title of an anonymous group administrator"] # [serde (skip_serializing_if = "Option::is_none" , rename = "author_signature")] author_signature : Option < String > , # [doc = "Optional. For text messages, the actual UTF-8 text of the message"] # [serde (skip_serializing_if = "Option::is_none" , rename = "text")] text : Option < String > , # [doc = "Optional. For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text"] # [serde (skip_serializing_if = "Option::is_none" , rename = "entities")] entities : Option < Vec < MessageEntity > > , # [doc = "Optional. Message is an animation, information about the animation. For backward compatibility, when this field is set, the document field will also be set"] # [serde (skip_serializing_if = "Option::is_none" , rename = "animation")] animation : Option < Animation > , # [doc = "Optional. Message is an audio file, information about the file"] # [serde (skip_serializing_if = "Option::is_none" , rename = "audio")] audio : Option < Audio > , # [doc = "Optional. Message is a general file, information about the file"] # [serde (skip_serializing_if = "Option::is_none" , rename = "document")] document : Option < Document > , # [doc = "Optional. Message is a photo, available sizes of the photo"] # [serde (skip_serializing_if = "Option::is_none" , rename = "photo")] photo : Option < Vec < PhotoSize > > , # [doc = "Optional. Message is a sticker, information about the sticker"] # [serde (skip_serializing_if = "Option::is_none" , rename = "sticker")] sticker : Option < Sticker > , # [doc = "Optional. Message is a video, information about the video"] # [serde (skip_serializing_if = "Option::is_none" , rename = "video")] video : Option < Video > , # [doc = "Optional. Message is a video note, information about the video message"] # [serde (skip_serializing_if = "Option::is_none" , rename = "video_note")] video_note : Option < VideoNote > , # [doc = "Optional. Message is a voice message, information about the file"] # [serde (skip_serializing_if = "Option::is_none" , rename = "voice")] voice : Option < Voice > , # [doc = "Optional. Caption for the animation, audio, document, photo, video or voice"] # [serde (skip_serializing_if = "Option::is_none" , rename = "caption")] caption : Option < String > , # [doc = "Optional. For messages with a caption, special entities like usernames, URLs, bot commands, etc. that appear in the caption"] # [serde (skip_serializing_if = "Option::is_none" , rename = "caption_entities")] caption_entities : Option < Vec < MessageEntity > > , # [doc = "Optional. Message is a shared contact, information about the contact"] # [serde (skip_serializing_if = "Option::is_none" , rename = "contact")] contact : Option < Contact > , # [doc = "Optional. Message is a dice with random value"] # [serde (skip_serializing_if = "Option::is_none" , rename = "dice")] dice : Option < Dice > , # [doc = "Optional. Message is a game, information about the game. More about games: https://core.telegram.org/bots/api#games"] # [serde (skip_serializing_if = "Option::is_none" , rename = "game")] game : Option < Game > , # [doc = "Optional. Message is a native poll, information about the poll"] # [serde (skip_serializing_if = "Option::is_none" , rename = "poll")] poll : Option < Poll > , # [doc = "Optional. Message is a venue, information about the venue. For backward compatibility, when this field is set, the location field will also be set"] # [serde (skip_serializing_if = "Option::is_none" , rename = "venue")] venue : Option < Venue > , # [doc = "Optional. Message is a shared location, information about the location"] # [serde (skip_serializing_if = "Option::is_none" , rename = "location")] location : Option < Location > , # [doc = "Optional. New members that were added to the group or supergroup and information about them (the bot itself may be one of these members)"] # [serde (skip_serializing_if = "Option::is_none" , rename = "new_chat_members")] new_chat_members : Option < Vec < User > > , # [doc = "Optional. A member was removed from the group, information about them (this member may be the bot itself)"] # [serde (skip_serializing_if = "Option::is_none" , rename = "left_chat_member")] left_chat_member : Option < User > , # [doc = "Optional. A chat title was changed to this value"] # [serde (skip_serializing_if = "Option::is_none" , rename = "new_chat_title")] new_chat_title : Option < String > , # [doc = "Optional. A chat photo was change to this value"] # [serde (skip_serializing_if = "Option::is_none" , rename = "new_chat_photo")] new_chat_photo : Option < Vec < PhotoSize > > , # [doc = "Optional. Service message: the chat photo was deleted"] # [serde (skip_serializing_if = "Option::is_none" , rename = "delete_chat_photo")] delete_chat_photo : Option < bool > , # [doc = "Optional. Service message: the group has been created"] # [serde (skip_serializing_if = "Option::is_none" , rename = "group_chat_created")] group_chat_created : Option < bool > , # [doc = "Optional. Service message: the supergroup has been created. This field can't be received in a message coming through updates, because bot can't be a member of a supergroup when it is created. It can only be found in reply_to_message if someone replies to a very first message in a directly created supergroup."] # [serde (skip_serializing_if = "Option::is_none" , rename = "supergroup_chat_created")] supergroup_chat_created : Option < bool > , # [doc = "Optional. Service message: the channel has been created. This field can't be received in a message coming through updates, because bot can't be a member of a channel when it is created. It can only be found in reply_to_message if someone replies to a very first message in a channel."] # [serde (skip_serializing_if = "Option::is_none" , rename = "channel_chat_created")] channel_chat_created : Option < bool > , # [doc = "Optional. Service message: auto-delete timer settings changed in the chat"] # [serde (skip_serializing_if = "Option::is_none" , rename = "message_auto_delete_timer_changed")] message_auto_delete_timer_changed : Option < MessageAutoDeleteTimerChanged > , # [doc = "Optional. The group has been migrated to a supergroup with the specified identifier. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier."] # [serde (skip_serializing_if = "Option::is_none" , rename = "migrate_to_chat_id")] migrate_to_chat_id : Option < i64 > , # [doc = "Optional. The supergroup has been migrated from a group with the specified identifier. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier."] # [serde (skip_serializing_if = "Option::is_none" , rename = "migrate_from_chat_id")] migrate_from_chat_id : Option < i64 > , # [doc = "Optional. Specified message was pinned. Note that the Message object in this field will not contain further reply_to_message fields even if it is itself a reply."] # [serde (skip_serializing_if = "Option::is_none" , rename = "pinned_message")] pinned_message : Option < Box < Message > > , # [doc = "Optional. Message is an invoice for a payment, information about the invoice. More about payments: https://core.telegram.org/bots/api#payments"] # [serde (skip_serializing_if = "Option::is_none" , rename = "invoice")] invoice : Option < Invoice > , # [doc = "Optional. Message is a service message about a successful payment, information about the payment. More about payments: https://core.telegram.org/bots/api#payments"] # [serde (skip_serializing_if = "Option::is_none" , rename = "successful_payment")] successful_payment : Option < SuccessfulPayment > , # [doc = "Optional. The domain name of the website on which the user has logged in. More about Telegram Login: https://core.telegram.org/widgets/login"] # [serde (skip_serializing_if = "Option::is_none" , rename = "connected_website")] connected_website : Option < String > , # [doc = "Optional. Telegram Passport data"] # [serde (skip_serializing_if = "Option::is_none" , rename = "passport_data")] passport_data : Option < PassportData > , # [doc = "Optional. Service message. A user in the chat triggered another user's proximity alert while sharing Live Location."] # [serde (skip_serializing_if = "Option::is_none" , rename = "proximity_alert_triggered")] proximity_alert_triggered : Option < ProximityAlertTriggered > , # [doc = "Optional. Service message: video chat scheduled"] # [serde (skip_serializing_if = "Option::is_none" , rename = "video_chat_scheduled")] video_chat_scheduled : Option < VideoChatScheduled > , # [doc = "Optional. Service message: video chat started"] # [serde (skip_serializing_if = "Option::is_none" , rename = "video_chat_started")] video_chat_started : Option < VideoChatStarted > , # [doc = "Optional. Service message: video chat ended"] # [serde (skip_serializing_if = "Option::is_none" , rename = "video_chat_ended")] video_chat_ended : Option < VideoChatEnded > , # [doc = "Optional. Service message: new participants invited to a video chat"] # [serde (skip_serializing_if = "Option::is_none" , rename = "video_chat_participants_invited")] video_chat_participants_invited : Option < VideoChatParticipantsInvited > , # [doc = "Optional. Service message: data sent by a Web App"] # [serde (skip_serializing_if = "Option::is_none" , rename = "web_app_data")] web_app_data : Option < WebAppData > , # [doc = "Optional. Inline keyboard attached to the message. login_url buttons are represented as ordinary url buttons."] # [serde (skip_serializing_if = "Option::is_none" , rename = "reply_markup")] reply_markup : Option < InlineKeyboardMarkup > } impl MessageBuilder { pub fn new (message_id : i64 , date : i64 , chat : Box < Chat >) -> Self { Self { message_id , date , chat , from : None , sender_chat : None , forward_from : None , forward_from_chat : None , forward_from_message_id : None , forward_signature : None , forward_sender_name : None , forward_date : None , is_automatic_forward : None , reply_to_message : None , via_bot : None , edit_date : None , has_protected_content : None , media_group_id : None , author_signature : None , text : None , entities : None , animation : None , audio : None , document : None , photo : None , sticker : None , video : None , video_note : None , voice : None , caption : None , caption_entities : None , contact : None , dice : None , game : None , poll : None , venue : None , location : None , new_chat_members : None , left_chat_member : None , new_chat_title : None , new_chat_photo : None , delete_chat_photo : None , group_chat_created : None , supergroup_chat_created : None , channel_chat_created : None , message_auto_delete_timer_changed : None , migrate_to_chat_id : None , migrate_from_chat_id : None , pinned_message : None , invoice : None , successful_payment : None , connected_website : None , passport_data : None , proximity_alert_triggered : None , video_chat_scheduled : None , video_chat_started : None , video_chat_ended : None , video_chat_participants_invited : None , web_app_data : None , reply_markup : None } } pub fn set_message_id (mut self , message_id : i64) -> Self { self . message_id = message_id ; self } pub fn set_from (mut self , from : Option < User >) -> Self { self . from = from ; self } pub fn set_sender_chat (mut self , sender_chat : Option < Box < Chat > >) -> Self { self . sender_chat = sender_chat ; self } pub fn set_date (mut self , date : i64) -> Self { self . date = date ; self } pub fn set_chat (mut self , chat : Box < Chat >) -> Self { self . chat = chat ; self } pub fn set_forward_from (mut self , forward_from : Option < User >) -> Self { self . forward_from = forward_from ; self } pub fn set_forward_from_chat (mut self , forward_from_chat : Option < Box < Chat > >) -> Self { self . forward_from_chat = forward_from_chat ; self } pub fn set_forward_from_message_id (mut self , forward_from_message_id : Option < i64 >) -> Self { self . forward_from_message_id = forward_from_message_id ; self } pub fn set_forward_signature (mut self , forward_signature : Option < String >) -> Self { self . forward_signature = forward_signature ; self } pub fn set_forward_sender_name (mut self , forward_sender_name : Option < String >) -> Self { self . forward_sender_name = forward_sender_name ; self } pub fn set_forward_date (mut self , forward_date : Option < i64 >) -> Self { self . forward_date = forward_date ; self } pub fn set_is_automatic_forward (mut self , is_automatic_forward : Option < bool >) -> Self { self . is_automatic_forward = is_automatic_forward ; self } pub fn set_reply_to_message (mut self , reply_to_message : Option < Box < Message > >) -> Self { self . reply_to_message = reply_to_message ; self } pub fn set_via_bot (mut self , via_bot : Option < User >) -> Self { self . via_bot = via_bot ; self } pub fn set_edit_date (mut self , edit_date : Option < i64 >) -> Self { self . edit_date = edit_date ; self } pub fn set_has_protected_content (mut self , has_protected_content : Option < bool >) -> Self { self . has_protected_content = has_protected_content ; self } pub fn set_media_group_id (mut self , media_group_id : Option < String >) -> Self { self . media_group_id = media_group_id ; self } pub fn set_author_signature (mut self , author_signature : Option < String >) -> Self { self . author_signature = author_signature ; self } pub fn set_text (mut self , text : Option < String >) -> Self { self . text = text ; self } pub fn set_entities (mut self , entities : Option < Vec < MessageEntity > >) -> Self { self . entities = entities ; self } pub fn set_animation (mut self , animation : Option < Animation >) -> Self { self . animation = animation ; self } pub fn set_audio (mut self , audio : Option < Audio >) -> Self { self . audio = audio ; self } pub fn set_document (mut self , document : Option < Document >) -> Self { self . document = document ; self } pub fn set_photo (mut self , photo : Option < Vec < PhotoSize > >) -> Self { self . photo = photo ; self } pub fn set_sticker (mut self , sticker : Option < Sticker >) -> Self { self . sticker = sticker ; self } pub fn set_video (mut self , video : Option < Video >) -> Self { self . video = video ; self } pub fn set_video_note (mut self , video_note : Option < VideoNote >) -> Self { self . video_note = video_note ; self } pub fn set_voice (mut self , voice : Option < Voice >) -> Self { self . voice = voice ; self } pub fn set_caption (mut self , caption : Option < String >) -> Self { self . caption = caption ; self } pub fn set_caption_entities (mut self , caption_entities : Option < Vec < MessageEntity > >) -> Self { self . caption_entities = caption_entities ; self } pub fn set_contact (mut self , contact : Option < Contact >) -> Self { self . contact = contact ; self } pub fn set_dice (mut self , dice : Option < Dice >) -> Self { self . dice = dice ; self } pub fn set_game (mut self , game : Option < Game >) -> Self { self . game = game ; self } pub fn set_poll (mut self , poll : Option < Poll >) -> Self { self . poll = poll ; self } pub fn set_venue (mut self , venue : Option < Venue >) -> Self { self . venue = venue ; self } pub fn set_location (mut self , location : Option < Location >) -> Self { self . location = location ; self } pub fn set_new_chat_members (mut self , new_chat_members : Option < Vec < User > >) -> Self { self . new_chat_members = new_chat_members ; self } pub fn set_left_chat_member (mut self , left_chat_member : Option < User >) -> Self { self . left_chat_member = left_chat_member ; self } pub fn set_new_chat_title (mut self , new_chat_title : Option < String >) -> Self { self . new_chat_title = new_chat_title ; self } pub fn set_new_chat_photo (mut self , new_chat_photo : Option < Vec < PhotoSize > >) -> Self { self . new_chat_photo = new_chat_photo ; self } pub fn set_delete_chat_photo (mut self , delete_chat_photo : Option < bool >) -> Self { self . delete_chat_photo = delete_chat_photo ; self } pub fn set_group_chat_created (mut self , group_chat_created : Option < bool >) -> Self { self . group_chat_created = group_chat_created ; self } pub fn set_supergroup_chat_created (mut self , supergroup_chat_created : Option < bool >) -> Self { self . supergroup_chat_created = supergroup_chat_created ; self } pub fn set_channel_chat_created (mut self , channel_chat_created : Option < bool >) -> Self { self . channel_chat_created = channel_chat_created ; self } pub fn set_message_auto_delete_timer_changed (mut self , message_auto_delete_timer_changed : Option < MessageAutoDeleteTimerChanged >) -> Self { self . message_auto_delete_timer_changed = message_auto_delete_timer_changed ; self } pub fn set_migrate_to_chat_id (mut self , migrate_to_chat_id : Option < i64 >) -> Self { self . migrate_to_chat_id = migrate_to_chat_id ; self } pub fn set_migrate_from_chat_id (mut self , migrate_from_chat_id : Option < i64 >) -> Self { self . migrate_from_chat_id = migrate_from_chat_id ; self } pub fn set_pinned_message (mut self , pinned_message : Option < Box < Message > >) -> Self { self . pinned_message = pinned_message ; self } pub fn set_invoice (mut self , invoice : Option < Invoice >) -> Self { self . invoice = invoice ; self } pub fn set_successful_payment (mut self , successful_payment : Option < SuccessfulPayment >) -> Self { self . successful_payment = successful_payment ; self } pub fn set_connected_website (mut self , connected_website : Option < String >) -> Self { self . connected_website = connected_website ; self } pub fn set_passport_data (mut self , passport_data : Option < PassportData >) -> Self { self . passport_data = passport_data ; self } pub fn set_proximity_alert_triggered (mut self , proximity_alert_triggered : Option < ProximityAlertTriggered >) -> Self { self . proximity_alert_triggered = proximity_alert_triggered ; self } pub fn set_video_chat_scheduled (mut self , video_chat_scheduled : Option < VideoChatScheduled >) -> Self { self . video_chat_scheduled = video_chat_scheduled ; self } pub fn set_video_chat_started (mut self , video_chat_started : Option < VideoChatStarted >) -> Self { self . video_chat_started = video_chat_started ; self } pub fn set_video_chat_ended (mut self , video_chat_ended : Option < VideoChatEnded >) -> Self { self . video_chat_ended = video_chat_ended ; self } pub fn set_video_chat_participants_invited (mut self , video_chat_participants_invited : Option < VideoChatParticipantsInvited >) -> Self { self . video_chat_participants_invited = video_chat_participants_invited ; self } pub fn set_web_app_data (mut self , web_app_data : Option < WebAppData >) -> Self { self . web_app_data = web_app_data ; self } pub fn set_reply_markup (mut self , reply_markup : Option < InlineKeyboardMarkup >) -> Self { self . reply_markup = reply_markup ; self } pub fn build (self) -> Message { Message { message_id : self . message_id , from : self . from , sender_chat : self . sender_chat , date : self . date , chat : self . chat , forward_from : self . forward_from , forward_from_chat : self . forward_from_chat , forward_from_message_id : self . forward_from_message_id , forward_signature : self . forward_signature , forward_sender_name : self . forward_sender_name , forward_date : self . forward_date , is_automatic_forward : self . is_automatic_forward , reply_to_message : self . reply_to_message , via_bot : self . via_bot , edit_date : self . edit_date , has_protected_content : self . has_protected_content , media_group_id : self . media_group_id , author_signature : self . author_signature , text : self . text , entities : self . entities , animation : self . animation , audio : self . audio , document : self . document , photo : self . photo , sticker : self . sticker , video : self . video , video_note : self . video_note , voice : self . voice , caption : self . caption , caption_entities : self . caption_entities , contact : self . contact , dice : self . dice , game : self . game , poll : self . poll , venue : self . venue , location : self . location , new_chat_members : self . new_chat_members , left_chat_member : self . left_chat_member , new_chat_title : self . new_chat_title , new_chat_photo : self . new_chat_photo , delete_chat_photo : self . delete_chat_photo , group_chat_created : self . group_chat_created , supergroup_chat_created : self . supergroup_chat_created , channel_chat_created : self . channel_chat_created , message_auto_delete_timer_changed : self . message_auto_delete_timer_changed , migrate_to_chat_id : self . migrate_to_chat_id , migrate_from_chat_id : self . migrate_from_chat_id , pinned_message : self . pinned_message , invoice : self . invoice , successful_payment : self . successful_payment , connected_website : self . connected_website , passport_data : self . passport_data , proximity_alert_triggered : self . proximity_alert_triggered , video_chat_scheduled : self . video_chat_scheduled , video_chat_started : self . video_chat_started , video_chat_ended : self . video_chat_ended , video_chat_participants_invited : self . video_chat_participants_invited , web_app_data : self . web_app_data , reply_markup : self . reply_markup } } } # [doc = "Represents a link to a file. By default, this file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the file. Currently, only .PDF and .ZIP files can be sent using this method.Note: This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them."] # [derive (Serialize , Deserialize , Debug)] pub struct InlineQueryResultDocument { # [doc = "Type of the result, must be document"] # [serde (rename = "type")] tg_type : String , # [doc = "Unique identifier for this result, 1-64 bytes"] # [serde (rename = "id")] id : String , # [doc = "Title for the result"] # [serde (rename = "title")] title : String , # [doc = "Optional. Caption of the document to be sent, 0-1024 characters after entities parsing"] # [serde (skip_serializing_if = "Option::is_none" , rename = "caption")] caption : Option < String > , # [doc = "Optional. Mode for parsing entities in the document caption. See formatting options for more details."] # [serde (skip_serializing_if = "Option::is_none" , rename = "parse_mode")] parse_mode : Option < String > , # [doc = "Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode"] # [serde (skip_serializing_if = "Option::is_none" , rename = "caption_entities")] caption_entities : Option < Vec < MessageEntity > > , # [doc = "A valid URL for the file"] # [serde (rename = "document_url")] document_url : String , # [doc = "MIME type of the content of the file, either \"application/pdf\" or \"application/zip\""] # [serde (rename = "mime_type")] mime_type : String , # [doc = "Optional. Short description of the result"] # [serde (skip_serializing_if = "Option::is_none" , rename = "description")] description : Option < String > , # [doc = "Optional. Inline keyboard attached to the message"] # [serde (skip_serializing_if = "Option::is_none" , rename = "reply_markup")] reply_markup : Option < InlineKeyboardMarkup > , # [doc = "Optional. Content of the message to be sent instead of the file"] # [serde (skip_serializing_if = "Option::is_none" , rename = "input_message_content")] input_message_content : Option < InputMessageContent > , # [doc = "Optional. URL of the thumbnail (JPEG only) for the file"] # [serde (skip_serializing_if = "Option::is_none" , rename = "thumb_url")] thumb_url : Option < String > , # [doc = "Optional. Thumbnail width"] # [serde (skip_serializing_if = "Option::is_none" , rename = "thumb_width")] thumb_width : Option < i64 > , # [doc = "Optional. Thumbnail height"] # [serde (skip_serializing_if = "Option::is_none" , rename = "thumb_height")] thumb_height : Option < i64 > } # [doc = "Represents a link to a file. By default, this file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the file. Currently, only .PDF and .ZIP files can be sent using this method.Note: This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them."] # [derive (Serialize , Deserialize , Debug)] pub struct InlineQueryResultDocumentBuilder { # [doc = "Type of the result, must be document"] # [serde (rename = "type")] tg_type : String , # [doc = "Unique identifier for this result, 1-64 bytes"] # [serde (rename = "id")] id : String , # [doc = "Title for the result"] # [serde (rename = "title")] title : String , # [doc = "Optional. Caption of the document to be sent, 0-1024 characters after entities parsing"] # [serde (skip_serializing_if = "Option::is_none" , rename = "caption")] caption : Option < String > , # [doc = "Optional. Mode for parsing entities in the document caption. See formatting options for more details."] # [serde (skip_serializing_if = "Option::is_none" , rename = "parse_mode")] parse_mode : Option < String > , # [doc = "Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode"] # [serde (skip_serializing_if = "Option::is_none" , rename = "caption_entities")] caption_entities : Option < Vec < MessageEntity > > , # [doc = "A valid URL for the file"] # [serde (rename = "document_url")] document_url : String , # [doc = "MIME type of the content of the file, either \"application/pdf\" or \"application/zip\""] # [serde (rename = "mime_type")] mime_type : String , # [doc = "Optional. Short description of the result"] # [serde (skip_serializing_if = "Option::is_none" , rename = "description")] description : Option < String > , # [doc = "Optional. Inline keyboard attached to the message"] # [serde (skip_serializing_if = "Option::is_none" , rename = "reply_markup")] reply_markup : Option < InlineKeyboardMarkup > , # [doc = "Optional. Content of the message to be sent instead of the file"] # [serde (skip_serializing_if = "Option::is_none" , rename = "input_message_content")] input_message_content : Option < InputMessageContent > , # [doc = "Optional. URL of the thumbnail (JPEG only) for the file"] # [serde (skip_serializing_if = "Option::is_none" , rename = "thumb_url")] thumb_url : Option < String > , # [doc = "Optional. Thumbnail width"] # [serde (skip_serializing_if = "Option::is_none" , rename = "thumb_width")] thumb_width : Option < i64 > , # [doc = "Optional. Thumbnail height"] # [serde (skip_serializing_if = "Option::is_none" , rename = "thumb_height")] thumb_height : Option < i64 > } impl InlineQueryResultDocumentBuilder { pub fn new (id : String , title : String , document_url : String , mime_type : String) -> Self { Self { tg_type : "document" . to_owned () , id , title , document_url , mime_type , caption : None , parse_mode : None , caption_entities : None , description : None , reply_markup : None , input_message_content : None , thumb_url : None , thumb_width : None , thumb_height : None } } pub fn set_type (mut self , tg_type : String) -> Self { self . tg_type = tg_type ; self } pub fn set_id (mut self , id : String) -> Self { self . id = id ; self } pub fn set_title (mut self , title : String) -> Self { self . title = title ; self } pub fn set_caption (mut self , caption : Option < String >) -> Self { self . caption = caption ; self } pub fn set_parse_mode (mut self , parse_mode : Option < String >) -> Self { self . parse_mode = parse_mode ; self } pub fn set_caption_entities (mut self , caption_entities : Option < Vec < MessageEntity > >) -> Self { self . caption_entities = caption_entities ; self } pub fn set_document_url (mut self , document_url : String) -> Self { self . document_url = document_url ; self } pub fn set_mime_type (mut self , mime_type : String) -> Self { self . mime_type = mime_type ; self } pub fn set_description (mut self , description : Option < String >) -> Self { self . description = description ; self } pub fn set_reply_markup (mut self , reply_markup : Option < InlineKeyboardMarkup >) -> Self { self . reply_markup = reply_markup ; self } pub fn set_input_message_content (mut self , input_message_content : Option < InputMessageContent >) -> Self { self . input_message_content = input_message_content ; self } pub fn set_thumb_url (mut self , thumb_url : Option < String >) -> Self { self . thumb_url = thumb_url ; self } pub fn set_thumb_width (mut self , thumb_width : Option < i64 >) -> Self { self . thumb_width = thumb_width ; self } pub fn set_thumb_height (mut self , thumb_height : Option < i64 >) -> Self { self . thumb_height = thumb_height ; self } pub fn build (self) -> InlineQueryResultDocument { InlineQueryResultDocument { tg_type : self . tg_type , id : self . id , title : self . title , caption : self . caption , parse_mode : self . parse_mode , caption_entities : self . caption_entities , document_url : self . document_url , mime_type : self . mime_type , description : self . description , reply_markup : self . reply_markup , input_message_content : self . input_message_content , thumb_url : self . thumb_url , thumb_width : self . thumb_width , thumb_height : self . thumb_height } } } # [derive (Serialize , Deserialize , Debug)] # [serde (untagged)] pub enum ChatMember { ChatMemberOwner (ChatMemberOwner) , ChatMemberAdministrator (ChatMemberAdministrator) , ChatMemberMember (ChatMemberMember) , ChatMemberRestricted (ChatMemberRestricted) , ChatMemberLeft (ChatMemberLeft) , ChatMemberBanned (ChatMemberBanned) } # [doc = "This object represents a video file."] # [derive (Serialize , Deserialize , Debug)] pub struct Video { # [doc = "Identifier for this file, which can be used to download or reuse the file"] # [serde (rename = "file_id")] file_id : String , # [doc = "Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file."] # [serde (rename = "file_unique_id")] file_unique_id : String , # [doc = "Video width as defined by sender"] # [serde (rename = "width")] width : i64 , # [doc = "Video height as defined by sender"] # [serde (rename = "height")] height : i64 , # [doc = "Duration of the video in seconds as defined by sender"] # [serde (rename = "duration")] duration : i64 , # [doc = "Optional. Video thumbnail"] # [serde (skip_serializing_if = "Option::is_none" , rename = "thumb")] thumb : Option < PhotoSize > , # [doc = "Optional. Original filename as defined by sender"] # [serde (skip_serializing_if = "Option::is_none" , rename = "file_name")] file_name : Option < String > , # [doc = "Optional. MIME type of the file as defined by sender"] # [serde (skip_serializing_if = "Option::is_none" , rename = "mime_type")] mime_type : Option < String > , # [doc = "Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value."] # [serde (skip_serializing_if = "Option::is_none" , rename = "file_size")] file_size : Option < i64 > } # [doc = "This object represents a video file."] # [derive (Serialize , Deserialize , Debug)] pub struct VideoBuilder { # [doc = "Identifier for this file, which can be used to download or reuse the file"] # [serde (rename = "file_id")] file_id : String , # [doc = "Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file."] # [serde (rename = "file_unique_id")] file_unique_id : String , # [doc = "Video width as defined by sender"] # [serde (rename = "width")] width : i64 , # [doc = "Video height as defined by sender"] # [serde (rename = "height")] height : i64 , # [doc = "Duration of the video in seconds as defined by sender"] # [serde (rename = "duration")] duration : i64 , # [doc = "Optional. Video thumbnail"] # [serde (skip_serializing_if = "Option::is_none" , rename = "thumb")] thumb : Option < PhotoSize > , # [doc = "Optional. Original filename as defined by sender"] # [serde (skip_serializing_if = "Option::is_none" , rename = "file_name")] file_name : Option < String > , # [doc = "Optional. MIME type of the file as defined by sender"] # [serde (skip_serializing_if = "Option::is_none" , rename = "mime_type")] mime_type : Option < String > , # [doc = "Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value."] # [serde (skip_serializing_if = "Option::is_none" , rename = "file_size")] file_size : Option < i64 > } impl VideoBuilder { pub fn new (file_id : String , file_unique_id : String , width : i64 , height : i64 , duration : i64) -> Self { Self { file_id , file_unique_id , width , height , duration , thumb : None , file_name : None , mime_type : None , file_size : None } } pub fn set_file_id (mut self , file_id : String) -> Self { self . file_id = file_id ; self } pub fn set_file_unique_id (mut self , file_unique_id : String) -> Self { self . file_unique_id = file_unique_id ; self } pub fn set_width (mut self , width : i64) -> Self { self . width = width ; self } pub fn set_height (mut self , height : i64) -> Self { self . height = height ; self } pub fn set_duration (mut self , duration : i64) -> Self { self . duration = duration ; self } pub fn set_thumb (mut self , thumb : Option < PhotoSize >) -> Self { self . thumb = thumb ; self } pub fn set_file_name (mut self , file_name : Option < String >) -> Self { self . file_name = file_name ; self } pub fn set_mime_type (mut self , mime_type : Option < String >) -> Self { self . mime_type = mime_type ; self } pub fn set_file_size (mut self , file_size : Option < i64 >) -> Self { self . file_size = file_size ; self } pub fn build (self) -> Video { Video { file_id : self . file_id , file_unique_id : self . file_unique_id , width : self . width , height : self . height , duration : self . duration , thumb : self . thumb , file_name : self . file_name , mime_type : self . mime_type , file_size : self . file_size } } } # [doc = "Represents a link to an article or web page."] # [derive (Serialize , Deserialize , Debug)] pub struct InlineQueryResultArticle { # [doc = "Type of the result, must be article"] # [serde (rename = "type")] tg_type : String , # [doc = "Unique identifier for this result, 1-64 Bytes"] # [serde (rename = "id")] id : String , # [doc = "Title of the result"] # [serde (rename = "title")] title : String , # [doc = "Content of the message to be sent"] # [serde (rename = "input_message_content")] input_message_content : InputMessageContent , # [doc = "Optional. Inline keyboard attached to the message"] # [serde (skip_serializing_if = "Option::is_none" , rename = "reply_markup")] reply_markup : Option < InlineKeyboardMarkup > , # [doc = "Optional. URL of the result"] # [serde (skip_serializing_if = "Option::is_none" , rename = "url")] url : Option < String > , # [doc = "Optional. Pass True if you don't want the URL to be shown in the message"] # [serde (skip_serializing_if = "Option::is_none" , rename = "hide_url")] hide_url : Option < bool > , # [doc = "Optional. Short description of the result"] # [serde (skip_serializing_if = "Option::is_none" , rename = "description")] description : Option < String > , # [doc = "Optional. Url of the thumbnail for the result"] # [serde (skip_serializing_if = "Option::is_none" , rename = "thumb_url")] thumb_url : Option < String > , # [doc = "Optional. Thumbnail width"] # [serde (skip_serializing_if = "Option::is_none" , rename = "thumb_width")] thumb_width : Option < i64 > , # [doc = "Optional. Thumbnail height"] # [serde (skip_serializing_if = "Option::is_none" , rename = "thumb_height")] thumb_height : Option < i64 > } # [doc = "Represents a link to an article or web page."] # [derive (Serialize , Deserialize , Debug)] pub struct InlineQueryResultArticleBuilder { # [doc = "Type of the result, must be article"] # [serde (rename = "type")] tg_type : String , # [doc = "Unique identifier for this result, 1-64 Bytes"] # [serde (rename = "id")] id : String , # [doc = "Title of the result"] # [serde (rename = "title")] title : String , # [doc = "Content of the message to be sent"] # [serde (rename = "input_message_content")] input_message_content : InputMessageContent , # [doc = "Optional. Inline keyboard attached to the message"] # [serde (skip_serializing_if = "Option::is_none" , rename = "reply_markup")] reply_markup : Option < InlineKeyboardMarkup > , # [doc = "Optional. URL of the result"] # [serde (skip_serializing_if = "Option::is_none" , rename = "url")] url : Option < String > , # [doc = "Optional. Pass True if you don't want the URL to be shown in the message"] # [serde (skip_serializing_if = "Option::is_none" , rename = "hide_url")] hide_url : Option < bool > , # [doc = "Optional. Short description of the result"] # [serde (skip_serializing_if = "Option::is_none" , rename = "description")] description : Option < String > , # [doc = "Optional. Url of the thumbnail for the result"] # [serde (skip_serializing_if = "Option::is_none" , rename = "thumb_url")] thumb_url : Option < String > , # [doc = "Optional. Thumbnail width"] # [serde (skip_serializing_if = "Option::is_none" , rename = "thumb_width")] thumb_width : Option < i64 > , # [doc = "Optional. Thumbnail height"] # [serde (skip_serializing_if = "Option::is_none" , rename = "thumb_height")] thumb_height : Option < i64 > } impl InlineQueryResultArticleBuilder { pub fn new (id : String , title : String , input_message_content : InputMessageContent) -> Self { Self { tg_type : "article" . to_owned () , id , title , input_message_content , reply_markup : None , url : None , hide_url : None , description : None , thumb_url : None , thumb_width : None , thumb_height : None } } pub fn set_type (mut self , tg_type : String) -> Self { self . tg_type = tg_type ; self } pub fn set_id (mut self , id : String) -> Self { self . id = id ; self } pub fn set_title (mut self , title : String) -> Self { self . title = title ; self } pub fn set_input_message_content (mut self , input_message_content : InputMessageContent) -> Self { self . input_message_content = input_message_content ; self } pub fn set_reply_markup (mut self , reply_markup : Option < InlineKeyboardMarkup >) -> Self { self . reply_markup = reply_markup ; self } pub fn set_url (mut self , url : Option < String >) -> Self { self . url = url ; self } pub fn set_hide_url (mut self , hide_url : Option < bool >) -> Self { self . hide_url = hide_url ; self } pub fn set_description (mut self , description : Option < String >) -> Self { self . description = description ; self } pub fn set_thumb_url (mut self , thumb_url : Option < String >) -> Self { self . thumb_url = thumb_url ; self } pub fn set_thumb_width (mut self , thumb_width : Option < i64 >) -> Self { self . thumb_width = thumb_width ; self } pub fn set_thumb_height (mut self , thumb_height : Option < i64 >) -> Self { self . thumb_height = thumb_height ; self } pub fn build (self) -> InlineQueryResultArticle { InlineQueryResultArticle { tg_type : self . tg_type , id : self . id , title : self . title , input_message_content : self . input_message_content , reply_markup : self . reply_markup , url : self . url , hide_url : self . hide_url , description : self . description , thumb_url : self . thumb_url , thumb_width : self . thumb_width , thumb_height : self . thumb_height } } } # [doc = "Represents an issue with the selfie with a document. The error is considered resolved when the file with the selfie changes."] # [derive (Serialize , Deserialize , Debug)] pub struct PassportElementErrorSelfie { # [doc = "Error source, must be selfie"] # [serde (rename = "source")] source : String , # [doc = "The section of the user's Telegram Passport which has the issue, one of \"passport\", \"driver_license\", \"identity_card\", \"internal_passport\""] # [serde (rename = "type")] tg_type : String , # [doc = "Base64-encoded hash of the file with the selfie"] # [serde (rename = "file_hash")] file_hash : String , # [doc = "Error message"] # [serde (rename = "message")] message : String } # [doc = "Represents an issue with the selfie with a document. The error is considered resolved when the file with the selfie changes."] # [derive (Serialize , Deserialize , Debug)] pub struct PassportElementErrorSelfieBuilder { # [doc = "Error source, must be selfie"] # [serde (rename = "source")] source : String , # [doc = "The section of the user's Telegram Passport which has the issue, one of \"passport\", \"driver_license\", \"identity_card\", \"internal_passport\""] # [serde (rename = "type")] tg_type : String , # [doc = "Base64-encoded hash of the file with the selfie"] # [serde (rename = "file_hash")] file_hash : String , # [doc = "Error message"] # [serde (rename = "message")] message : String } impl PassportElementErrorSelfieBuilder { pub fn new (source : String , file_hash : String , message : String) -> Self { Self { tg_type : "PassportElementErrorSelfie" . to_owned () , source , file_hash , message , } } pub fn set_source (mut self , source : String) -> Self { self . source = source ; self } pub fn set_type (mut self , tg_type : String) -> Self { self . tg_type = tg_type ; self } pub fn set_file_hash (mut self , file_hash : String) -> Self { self . file_hash = file_hash ; self } pub fn set_message (mut self , message : String) -> Self { self . message = message ; self } pub fn build (self) -> PassportElementErrorSelfie { PassportElementErrorSelfie { source : self . source , tg_type : self . tg_type , file_hash : self . file_hash , message : self . message } } } # [doc = "This object represents one special entity in a text message. For example, hashtags, usernames, URLs, etc."] # [derive (Serialize , Deserialize , Debug)] pub struct MessageEntity { # [doc = "Type of the entity. Currently, can be \"mention\" (@username), \"hashtag\" (#hashtag), \"cashtag\" ($USD), \"bot_command\" (/start@jobs_bot), \"url\" (https://telegram.org), \"email\" (do-not-reply@telegram.org), \"phone_number\" (+1-212-555-0123), \"bold\" (bold text), \"italic\" (italic text), \"underline\" (underlined text), \"strikethrough\" (strikethrough text), \"spoiler\" (spoiler message), \"code\" (monowidth string), \"pre\" (monowidth block), \"text_link\" (for clickable text URLs), \"text_mention\" (for users without usernames), \"custom_emoji\" (for inline custom emoji stickers)"] # [serde (rename = "type")] tg_type : String , # [doc = "Offset in UTF-16 code units to the start of the entity"] # [serde (rename = "offset")] offset : i64 , # [doc = "Length of the entity in UTF-16 code units"] # [serde (rename = "length")] length : i64 , # [doc = "Optional. For \"text_link\" only, URL that will be opened after user taps on the text"] # [serde (skip_serializing_if = "Option::is_none" , rename = "url")] url : Option < String > , # [doc = "Optional. For \"text_mention\" only, the mentioned user"] # [serde (skip_serializing_if = "Option::is_none" , rename = "user")] user : Option < User > , # [doc = "Optional. For \"pre\" only, the programming language of the entity text"] # [serde (skip_serializing_if = "Option::is_none" , rename = "language")] language : Option < String > , # [doc = "Optional. For \"custom_emoji\" only, unique identifier of the custom emoji. Use getCustomEmojiStickers to get full information about the sticker"] # [serde (skip_serializing_if = "Option::is_none" , rename = "custom_emoji_id")] custom_emoji_id : Option < String > } # [doc = "This object represents one special entity in a text message. For example, hashtags, usernames, URLs, etc."] # [derive (Serialize , Deserialize , Debug)] pub struct MessageEntityBuilder { # [doc = "Type of the entity. Currently, can be \"mention\" (@username), \"hashtag\" (#hashtag), \"cashtag\" ($USD), \"bot_command\" (/start@jobs_bot), \"url\" (https://telegram.org), \"email\" (do-not-reply@telegram.org), \"phone_number\" (+1-212-555-0123), \"bold\" (bold text), \"italic\" (italic text), \"underline\" (underlined text), \"strikethrough\" (strikethrough text), \"spoiler\" (spoiler message), \"code\" (monowidth string), \"pre\" (monowidth block), \"text_link\" (for clickable text URLs), \"text_mention\" (for users without usernames), \"custom_emoji\" (for inline custom emoji stickers)"] # [serde (rename = "type")] tg_type : String , # [doc = "Offset in UTF-16 code units to the start of the entity"] # [serde (rename = "offset")] offset : i64 , # [doc = "Length of the entity in UTF-16 code units"] # [serde (rename = "length")] length : i64 , # [doc = "Optional. For \"text_link\" only, URL that will be opened after user taps on the text"] # [serde (skip_serializing_if = "Option::is_none" , rename = "url")] url : Option < String > , # [doc = "Optional. For \"text_mention\" only, the mentioned user"] # [serde (skip_serializing_if = "Option::is_none" , rename = "user")] user : Option < User > , # [doc = "Optional. For \"pre\" only, the programming language of the entity text"] # [serde (skip_serializing_if = "Option::is_none" , rename = "language")] language : Option < String > , # [doc = "Optional. For \"custom_emoji\" only, unique identifier of the custom emoji. Use getCustomEmojiStickers to get full information about the sticker"] # [serde (skip_serializing_if = "Option::is_none" , rename = "custom_emoji_id")] custom_emoji_id : Option < String > } impl MessageEntityBuilder { pub fn new (offset : i64 , length : i64) -> Self { Self { tg_type : "MessageEntity" . to_owned () , offset , length , url : None , user : None , language : None , custom_emoji_id : None } } pub fn set_type (mut self , tg_type : String) -> Self { self . tg_type = tg_type ; self } pub fn set_offset (mut self , offset : i64) -> Self { self . offset = offset ; self } pub fn set_length (mut self , length : i64) -> Self { self . length = length ; self } pub fn set_url (mut self , url : Option < String >) -> Self { self . url = url ; self } pub fn set_user (mut self , user : Option < User >) -> Self { self . user = user ; self } pub fn set_language (mut self , language : Option < String >) -> Self { self . language = language ; self } pub fn set_custom_emoji_id (mut self , custom_emoji_id : Option < String >) -> Self { self . custom_emoji_id = custom_emoji_id ; self } pub fn build (self) -> MessageEntity { MessageEntity { tg_type : self . tg_type , offset : self . offset , length : self . length , url : self . url , user : self . user , language : self . language , custom_emoji_id : self . custom_emoji_id } } } # [doc = "This object represents a bot command."] # [derive (Serialize , Deserialize , Debug)] pub struct BotCommand { # [doc = "Text of the command; 1-32 characters. Can contain only lowercase English letters, digits and underscores."] # [serde (rename = "command")] command : String , # [doc = "Description of the command; 1-256 characters."] # [serde (rename = "description")] description : String } # [doc = "This object represents a bot command."] # [derive (Serialize , Deserialize , Debug)] pub struct BotCommandBuilder { # [doc = "Text of the command; 1-32 characters. Can contain only lowercase English letters, digits and underscores."] # [serde (rename = "command")] command : String , # [doc = "Description of the command; 1-256 characters."] # [serde (rename = "description")] description : String } impl BotCommandBuilder { pub fn new (command : String , description : String) -> Self { Self { command , description , } } pub fn set_command (mut self , command : String) -> Self { self . command = command ; self } pub fn set_description (mut self , description : String) -> Self { self . description = description ; self } pub fn build (self) -> BotCommand { BotCommand { command : self . command , description : self . description } } } # [doc = "This object contains basic information about an invoice."] # [derive (Serialize , Deserialize , Debug)] pub struct Invoice { # [doc = "Product name"] # [serde (rename = "title")] title : String , # [doc = "Product description"] # [serde (rename = "description")] description : String , # [doc = "Unique bot deep-linking parameter that can be used to generate this invoice"] # [serde (rename = "start_parameter")] start_parameter : String , # [doc = "Three-letter ISO 4217 currency code"] # [serde (rename = "currency")] currency : String , # [doc = "Total price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies)."] # [serde (rename = "total_amount")] total_amount : i64 } # [doc = "This object contains basic information about an invoice."] # [derive (Serialize , Deserialize , Debug)] pub struct InvoiceBuilder { # [doc = "Product name"] # [serde (rename = "title")] title : String , # [doc = "Product description"] # [serde (rename = "description")] description : String , # [doc = "Unique bot deep-linking parameter that can be used to generate this invoice"] # [serde (rename = "start_parameter")] start_parameter : String , # [doc = "Three-letter ISO 4217 currency code"] # [serde (rename = "currency")] currency : String , # [doc = "Total price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies)."] # [serde (rename = "total_amount")] total_amount : i64 } impl InvoiceBuilder { pub fn new (title : String , description : String , start_parameter : String , currency : String , total_amount : i64) -> Self { Self { title , description , start_parameter , currency , total_amount , } } pub fn set_title (mut self , title : String) -> Self { self . title = title ; self } pub fn set_description (mut self , description : String) -> Self { self . description = description ; self } pub fn set_start_parameter (mut self , start_parameter : String) -> Self { self . start_parameter = start_parameter ; self } pub fn set_currency (mut self , currency : String) -> Self { self . currency = currency ; self } pub fn set_total_amount (mut self , total_amount : i64) -> Self { self . total_amount = total_amount ; self } pub fn build (self) -> Invoice { Invoice { title : self . title , description : self . description , start_parameter : self . start_parameter , currency : self . currency , total_amount : self . total_amount } } } # [doc = "This object represents changes in the status of a chat member."] # [derive (Serialize , Deserialize , Debug)] pub struct ChatMemberUpdated { # [doc = "Chat the user belongs to"] # [serde (rename = "chat")] chat : Box < Chat > , # [doc = "Performer of the action, which resulted in the change"] # [serde (rename = "from")] from : User , # [doc = "Date the change was done in Unix time"] # [serde (rename = "date")] date : i64 , # [doc = "Previous information about the chat member"] # [serde (rename = "old_chat_member")] old_chat_member : ChatMember , # [doc = "New information about the chat member"] # [serde (rename = "new_chat_member")] new_chat_member : ChatMember , # [doc = "Optional. Chat invite link, which was used by the user to join the chat; for joining by invite link events only."] # [serde (skip_serializing_if = "Option::is_none" , rename = "invite_link")] invite_link : Option < ChatInviteLink > } # [doc = "This object represents changes in the status of a chat member."] # [derive (Serialize , Deserialize , Debug)] pub struct ChatMemberUpdatedBuilder { # [doc = "Chat the user belongs to"] # [serde (rename = "chat")] chat : Box < Chat > , # [doc = "Performer of the action, which resulted in the change"] # [serde (rename = "from")] from : User , # [doc = "Date the change was done in Unix time"] # [serde (rename = "date")] date : i64 , # [doc = "Previous information about the chat member"] # [serde (rename = "old_chat_member")] old_chat_member : ChatMember , # [doc = "New information about the chat member"] # [serde (rename = "new_chat_member")] new_chat_member : ChatMember , # [doc = "Optional. Chat invite link, which was used by the user to join the chat; for joining by invite link events only."] # [serde (skip_serializing_if = "Option::is_none" , rename = "invite_link")] invite_link : Option < ChatInviteLink > } impl ChatMemberUpdatedBuilder { pub fn new (chat : Box < Chat > , from : User , date : i64 , old_chat_member : ChatMember , new_chat_member : ChatMember) -> Self { Self { chat , from , date , old_chat_member , new_chat_member , invite_link : None } } pub fn set_chat (mut self , chat : Box < Chat >) -> Self { self . chat = chat ; self } pub fn set_from (mut self , from : User) -> Self { self . from = from ; self } pub fn set_date (mut self , date : i64) -> Self { self . date = date ; self } pub fn set_old_chat_member (mut self , old_chat_member : ChatMember) -> Self { self . old_chat_member = old_chat_member ; self } pub fn set_new_chat_member (mut self , new_chat_member : ChatMember) -> Self { self . new_chat_member = new_chat_member ; self } pub fn set_invite_link (mut self , invite_link : Option < ChatInviteLink >) -> Self { self . invite_link = invite_link ; self } pub fn build (self) -> ChatMemberUpdated { ChatMemberUpdated { chat : self . chat , from : self . from , date : self . date , old_chat_member : self . old_chat_member , new_chat_member : self . new_chat_member , invite_link : self . invite_link } } } # [doc = "Represents the default scope of bot commands. Default commands are used if no commands with a narrower scope are specified for the user."] # [derive (Serialize , Deserialize , Debug)] pub struct BotCommandScopeDefault { # [doc = "Scope type, must be default"] # [serde (rename = "type")] tg_type : String } # [doc = "Represents the default scope of bot commands. Default commands are used if no commands with a narrower scope are specified for the user."] # [derive (Serialize , Deserialize , Debug)] pub struct BotCommandScopeDefaultBuilder { # [doc = "Scope type, must be default"] # [serde (rename = "type")] tg_type : String } impl BotCommandScopeDefaultBuilder { pub fn new () -> Self { Self { tg_type : "default" . to_owned () , } } pub fn set_type (mut self , tg_type : String) -> Self { self . tg_type = tg_type ; self } pub fn build (self) -> BotCommandScopeDefault { BotCommandScopeDefault { tg_type : self . tg_type } } } # [doc = "Represents a link to a video animation (H.264/MPEG-4 AVC video without sound). By default, this animated MPEG-4 file will be sent by the user with optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the animation."] # [derive (Serialize , Deserialize , Debug)] pub struct InlineQueryResultMpeg4Gif { # [doc = "Type of the result, must be mpeg4_gif"] # [serde (rename = "type")] tg_type : String , # [doc = "Unique identifier for this result, 1-64 bytes"] # [serde (rename = "id")] id : String , # [doc = "A valid URL for the MPEG4 file. File size must not exceed 1MB"] # [serde (rename = "mpeg4_url")] mpeg_4_url : String , # [doc = "Optional. Video width"] # [serde (skip_serializing_if = "Option::is_none" , rename = "mpeg4_width")] mpeg_4_width : Option < i64 > , # [doc = "Optional. Video height"] # [serde (skip_serializing_if = "Option::is_none" , rename = "mpeg4_height")] mpeg_4_height : Option < i64 > , # [doc = "Optional. Video duration in seconds"] # [serde (skip_serializing_if = "Option::is_none" , rename = "mpeg4_duration")] mpeg_4_duration : Option < i64 > , # [doc = "URL of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the result"] # [serde (rename = "thumb_url")] thumb_url : String , # [doc = "Optional. MIME type of the thumbnail, must be one of \"image/jpeg\", \"image/gif\", or \"video/mp4\". Defaults to \"image/jpeg\""] # [serde (skip_serializing_if = "Option::is_none" , rename = "thumb_mime_type")] thumb_mime_type : Option < String > , # [doc = "Optional. Title for the result"] # [serde (skip_serializing_if = "Option::is_none" , rename = "title")] title : Option < String > , # [doc = "Optional. Caption of the MPEG-4 file to be sent, 0-1024 characters after entities parsing"] # [serde (skip_serializing_if = "Option::is_none" , rename = "caption")] caption : Option < String > , # [doc = "Optional. Mode for parsing entities in the caption. See formatting options for more details."] # [serde (skip_serializing_if = "Option::is_none" , rename = "parse_mode")] parse_mode : Option < String > , # [doc = "Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode"] # [serde (skip_serializing_if = "Option::is_none" , rename = "caption_entities")] caption_entities : Option < Vec < MessageEntity > > , # [doc = "Optional. Inline keyboard attached to the message"] # [serde (skip_serializing_if = "Option::is_none" , rename = "reply_markup")] reply_markup : Option < InlineKeyboardMarkup > , # [doc = "Optional. Content of the message to be sent instead of the video animation"] # [serde (skip_serializing_if = "Option::is_none" , rename = "input_message_content")] input_message_content : Option < InputMessageContent > } # [doc = "Represents a link to a video animation (H.264/MPEG-4 AVC video without sound). By default, this animated MPEG-4 file will be sent by the user with optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the animation."] # [derive (Serialize , Deserialize , Debug)] pub struct InlineQueryResultMpeg4GifBuilder { # [doc = "Type of the result, must be mpeg4_gif"] # [serde (rename = "type")] tg_type : String , # [doc = "Unique identifier for this result, 1-64 bytes"] # [serde (rename = "id")] id : String , # [doc = "A valid URL for the MPEG4 file. File size must not exceed 1MB"] # [serde (rename = "mpeg4_url")] mpeg_4_url : String , # [doc = "Optional. Video width"] # [serde (skip_serializing_if = "Option::is_none" , rename = "mpeg4_width")] mpeg_4_width : Option < i64 > , # [doc = "Optional. Video height"] # [serde (skip_serializing_if = "Option::is_none" , rename = "mpeg4_height")] mpeg_4_height : Option < i64 > , # [doc = "Optional. Video duration in seconds"] # [serde (skip_serializing_if = "Option::is_none" , rename = "mpeg4_duration")] mpeg_4_duration : Option < i64 > , # [doc = "URL of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the result"] # [serde (rename = "thumb_url")] thumb_url : String , # [doc = "Optional. MIME type of the thumbnail, must be one of \"image/jpeg\", \"image/gif\", or \"video/mp4\". Defaults to \"image/jpeg\""] # [serde (skip_serializing_if = "Option::is_none" , rename = "thumb_mime_type")] thumb_mime_type : Option < String > , # [doc = "Optional. Title for the result"] # [serde (skip_serializing_if = "Option::is_none" , rename = "title")] title : Option < String > , # [doc = "Optional. Caption of the MPEG-4 file to be sent, 0-1024 characters after entities parsing"] # [serde (skip_serializing_if = "Option::is_none" , rename = "caption")] caption : Option < String > , # [doc = "Optional. Mode for parsing entities in the caption. See formatting options for more details."] # [serde (skip_serializing_if = "Option::is_none" , rename = "parse_mode")] parse_mode : Option < String > , # [doc = "Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode"] # [serde (skip_serializing_if = "Option::is_none" , rename = "caption_entities")] caption_entities : Option < Vec < MessageEntity > > , # [doc = "Optional. Inline keyboard attached to the message"] # [serde (skip_serializing_if = "Option::is_none" , rename = "reply_markup")] reply_markup : Option < InlineKeyboardMarkup > , # [doc = "Optional. Content of the message to be sent instead of the video animation"] # [serde (skip_serializing_if = "Option::is_none" , rename = "input_message_content")] input_message_content : Option < InputMessageContent > } impl InlineQueryResultMpeg4GifBuilder { pub fn new (id : String , mpeg_4_url : String , thumb_url : String) -> Self { Self { tg_type : "mpeg4_gif" . to_owned () , id , mpeg_4_url , thumb_url , mpeg_4_width : None , mpeg_4_height : None , mpeg_4_duration : None , thumb_mime_type : None , title : None , caption : None , parse_mode : None , caption_entities : None , reply_markup : None , input_message_content : None } } pub fn set_type (mut self , tg_type : String) -> Self { self . tg_type = tg_type ; self } pub fn set_id (mut self , id : String) -> Self { self . id = id ; self } pub fn set_mpeg_4_url (mut self , mpeg_4_url : String) -> Self { self . mpeg_4_url = mpeg_4_url ; self } pub fn set_mpeg_4_width (mut self , mpeg_4_width : Option < i64 >) -> Self { self . mpeg_4_width = mpeg_4_width ; self } pub fn set_mpeg_4_height (mut self , mpeg_4_height : Option < i64 >) -> Self { self . mpeg_4_height = mpeg_4_height ; self } pub fn set_mpeg_4_duration (mut self , mpeg_4_duration : Option < i64 >) -> Self { self . mpeg_4_duration = mpeg_4_duration ; self } pub fn set_thumb_url (mut self , thumb_url : String) -> Self { self . thumb_url = thumb_url ; self } pub fn set_thumb_mime_type (mut self , thumb_mime_type : Option < String >) -> Self { self . thumb_mime_type = thumb_mime_type ; self } pub fn set_title (mut self , title : Option < String >) -> Self { self . title = title ; self } pub fn set_caption (mut self , caption : Option < String >) -> Self { self . caption = caption ; self } pub fn set_parse_mode (mut self , parse_mode : Option < String >) -> Self { self . parse_mode = parse_mode ; self } pub fn set_caption_entities (mut self , caption_entities : Option < Vec < MessageEntity > >) -> Self { self . caption_entities = caption_entities ; self } pub fn set_reply_markup (mut self , reply_markup : Option < InlineKeyboardMarkup >) -> Self { self . reply_markup = reply_markup ; self } pub fn set_input_message_content (mut self , input_message_content : Option < InputMessageContent >) -> Self { self . input_message_content = input_message_content ; self } pub fn build (self) -> InlineQueryResultMpeg4Gif { InlineQueryResultMpeg4Gif { tg_type : self . tg_type , id : self . id , mpeg_4_url : self . mpeg_4_url , mpeg_4_width : self . mpeg_4_width , mpeg_4_height : self . mpeg_4_height , mpeg_4_duration : self . mpeg_4_duration , thumb_url : self . thumb_url , thumb_mime_type : self . thumb_mime_type , title : self . title , caption : self . caption , parse_mode : self . parse_mode , caption_entities : self . caption_entities , reply_markup : self . reply_markup , input_message_content : self . input_message_content } } } # [doc = "This object contains information about an incoming shipping query."] # [derive (Serialize , Deserialize , Debug)] pub struct ShippingQuery { # [doc = "Unique query identifier"] # [serde (rename = "id")] id : String , # [doc = "User who sent the query"] # [serde (rename = "from")] from : User , # [doc = "Bot specified invoice payload"] # [serde (rename = "invoice_payload")] invoice_payload : String , # [doc = "User specified shipping address"] # [serde (rename = "shipping_address")] shipping_address : ShippingAddress } # [doc = "This object contains information about an incoming shipping query."] # [derive (Serialize , Deserialize , Debug)] pub struct ShippingQueryBuilder { # [doc = "Unique query identifier"] # [serde (rename = "id")] id : String , # [doc = "User who sent the query"] # [serde (rename = "from")] from : User , # [doc = "Bot specified invoice payload"] # [serde (rename = "invoice_payload")] invoice_payload : String , # [doc = "User specified shipping address"] # [serde (rename = "shipping_address")] shipping_address : ShippingAddress } impl ShippingQueryBuilder { pub fn new (id : String , from : User , invoice_payload : String , shipping_address : ShippingAddress) -> Self { Self { id , from , invoice_payload , shipping_address , } } pub fn set_id (mut self , id : String) -> Self { self . id = id ; self } pub fn set_from (mut self , from : User) -> Self { self . from = from ; self } pub fn set_invoice_payload (mut self , invoice_payload : String) -> Self { self . invoice_payload = invoice_payload ; self } pub fn set_shipping_address (mut self , shipping_address : ShippingAddress) -> Self { self . shipping_address = shipping_address ; self } pub fn build (self) -> ShippingQuery { ShippingQuery { id : self . id , from : self . from , invoice_payload : self . invoice_payload , shipping_address : self . shipping_address } } } # [doc = "Represents the content of a text message to be sent as the result of an inline query."] # [derive (Serialize , Deserialize , Debug)] pub struct InputTextMessageContent { # [doc = "Text of the message to be sent, 1-4096 characters"] # [serde (rename = "message_text")] message_text : String , # [doc = "Optional. Mode for parsing entities in the message text. See formatting options for more details."] # [serde (skip_serializing_if = "Option::is_none" , rename = "parse_mode")] parse_mode : Option < String > , # [doc = "Optional. List of special entities that appear in message text, which can be specified instead of parse_mode"] # [serde (skip_serializing_if = "Option::is_none" , rename = "entities")] entities : Option < Vec < MessageEntity > > , # [doc = "Optional. Disables link previews for links in the sent message"] # [serde (skip_serializing_if = "Option::is_none" , rename = "disable_web_page_preview")] disable_web_page_preview : Option < bool > } # [doc = "Represents the content of a text message to be sent as the result of an inline query."] # [derive (Serialize , Deserialize , Debug)] pub struct InputTextMessageContentBuilder { # [doc = "Text of the message to be sent, 1-4096 characters"] # [serde (rename = "message_text")] message_text : String , # [doc = "Optional. Mode for parsing entities in the message text. See formatting options for more details."] # [serde (skip_serializing_if = "Option::is_none" , rename = "parse_mode")] parse_mode : Option < String > , # [doc = "Optional. List of special entities that appear in message text, which can be specified instead of parse_mode"] # [serde (skip_serializing_if = "Option::is_none" , rename = "entities")] entities : Option < Vec < MessageEntity > > , # [doc = "Optional. Disables link previews for links in the sent message"] # [serde (skip_serializing_if = "Option::is_none" , rename = "disable_web_page_preview")] disable_web_page_preview : Option < bool > } impl InputTextMessageContentBuilder { pub fn new (message_text : String) -> Self { Self { message_text , parse_mode : None , entities : None , disable_web_page_preview : None } } pub fn set_message_text (mut self , message_text : String) -> Self { self . message_text = message_text ; self } pub fn set_parse_mode (mut self , parse_mode : Option < String >) -> Self { self . parse_mode = parse_mode ; self } pub fn set_entities (mut self , entities : Option < Vec < MessageEntity > >) -> Self { self . entities = entities ; self } pub fn set_disable_web_page_preview (mut self , disable_web_page_preview : Option < bool >) -> Self { self . disable_web_page_preview = disable_web_page_preview ; self } pub fn build (self) -> InputTextMessageContent { InputTextMessageContent { message_text : self . message_text , parse_mode : self . parse_mode , entities : self . entities , disable_web_page_preview : self . disable_web_page_preview } } } # [doc = "Represents the content of a location message to be sent as the result of an inline query."] # [derive (Serialize , Deserialize , Debug)] pub struct InputLocationMessageContent { # [doc = "Latitude of the location in degrees"] # [serde (rename = "latitude")] latitude : f64 , # [doc = "Longitude of the location in degrees"] # [serde (rename = "longitude")] longitude : f64 , # [doc = "Optional. The radius of uncertainty for the location, measured in meters; 0-1500"] # [serde (skip_serializing_if = "Option::is_none" , rename = "horizontal_accuracy")] horizontal_accuracy : Option < f64 > , # [doc = "Optional. Period in seconds for which the location can be updated, should be between 60 and 86400."] # [serde (skip_serializing_if = "Option::is_none" , rename = "live_period")] live_period : Option < i64 > , # [doc = "Optional. For live locations, a direction in which the user is moving, in degrees. Must be between 1 and 360 if specified."] # [serde (skip_serializing_if = "Option::is_none" , rename = "heading")] heading : Option < i64 > , # [doc = "Optional. For live locations, a maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified."] # [serde (skip_serializing_if = "Option::is_none" , rename = "proximity_alert_radius")] proximity_alert_radius : Option < i64 > } # [doc = "Represents the content of a location message to be sent as the result of an inline query."] # [derive (Serialize , Deserialize , Debug)] pub struct InputLocationMessageContentBuilder { # [doc = "Latitude of the location in degrees"] # [serde (rename = "latitude")] latitude : f64 , # [doc = "Longitude of the location in degrees"] # [serde (rename = "longitude")] longitude : f64 , # [doc = "Optional. The radius of uncertainty for the location, measured in meters; 0-1500"] # [serde (skip_serializing_if = "Option::is_none" , rename = "horizontal_accuracy")] horizontal_accuracy : Option < f64 > , # [doc = "Optional. Period in seconds for which the location can be updated, should be between 60 and 86400."] # [serde (skip_serializing_if = "Option::is_none" , rename = "live_period")] live_period : Option < i64 > , # [doc = "Optional. For live locations, a direction in which the user is moving, in degrees. Must be between 1 and 360 if specified."] # [serde (skip_serializing_if = "Option::is_none" , rename = "heading")] heading : Option < i64 > , # [doc = "Optional. For live locations, a maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified."] # [serde (skip_serializing_if = "Option::is_none" , rename = "proximity_alert_radius")] proximity_alert_radius : Option < i64 > } impl InputLocationMessageContentBuilder { pub fn new (latitude : f64 , longitude : f64) -> Self { Self { latitude , longitude , horizontal_accuracy : None , live_period : None , heading : None , proximity_alert_radius : None } } pub fn set_latitude (mut self , latitude : f64) -> Self { self . latitude = latitude ; self } pub fn set_longitude (mut self , longitude : f64) -> Self { self . longitude = longitude ; self } pub fn set_horizontal_accuracy (mut self , horizontal_accuracy : Option < f64 >) -> Self { self . horizontal_accuracy = horizontal_accuracy ; self } pub fn set_live_period (mut self , live_period : Option < i64 >) -> Self { self . live_period = live_period ; self } pub fn set_heading (mut self , heading : Option < i64 >) -> Self { self . heading = heading ; self } pub fn set_proximity_alert_radius (mut self , proximity_alert_radius : Option < i64 >) -> Self { self . proximity_alert_radius = proximity_alert_radius ; self } pub fn build (self) -> InputLocationMessageContent { InputLocationMessageContent { latitude : self . latitude , longitude : self . longitude , horizontal_accuracy : self . horizontal_accuracy , live_period : self . live_period , heading : self . heading , proximity_alert_radius : self . proximity_alert_radius } } } # [doc = "Represents a Game.Note: This will only work in Telegram versions released after October 1, 2016. Older clients will not display any inline results if a game result is among them."] # [derive (Serialize , Deserialize , Debug)] pub struct InlineQueryResultGame { # [doc = "Type of the result, must be game"] # [serde (rename = "type")] tg_type : String , # [doc = "Unique identifier for this result, 1-64 bytes"] # [serde (rename = "id")] id : String , # [doc = "Short name of the game"] # [serde (rename = "game_short_name")] game_short_name : String , # [doc = "Optional. Inline keyboard attached to the message"] # [serde (skip_serializing_if = "Option::is_none" , rename = "reply_markup")] reply_markup : Option < InlineKeyboardMarkup > } # [doc = "Represents a Game.Note: This will only work in Telegram versions released after October 1, 2016. Older clients will not display any inline results if a game result is among them."] # [derive (Serialize , Deserialize , Debug)] pub struct InlineQueryResultGameBuilder { # [doc = "Type of the result, must be game"] # [serde (rename = "type")] tg_type : String , # [doc = "Unique identifier for this result, 1-64 bytes"] # [serde (rename = "id")] id : String , # [doc = "Short name of the game"] # [serde (rename = "game_short_name")] game_short_name : String , # [doc = "Optional. Inline keyboard attached to the message"] # [serde (skip_serializing_if = "Option::is_none" , rename = "reply_markup")] reply_markup : Option < InlineKeyboardMarkup > } impl InlineQueryResultGameBuilder { pub fn new (id : String , game_short_name : String) -> Self { Self { tg_type : "game" . to_owned () , id , game_short_name , reply_markup : None } } pub fn set_type (mut self , tg_type : String) -> Self { self . tg_type = tg_type ; self } pub fn set_id (mut self , id : String) -> Self { self . id = id ; self } pub fn set_game_short_name (mut self , game_short_name : String) -> Self { self . game_short_name = game_short_name ; self } pub fn set_reply_markup (mut self , reply_markup : Option < InlineKeyboardMarkup >) -> Self { self . reply_markup = reply_markup ; self } pub fn build (self) -> InlineQueryResultGame { InlineQueryResultGame { tg_type : self . tg_type , id : self . id , game_short_name : self . game_short_name , reply_markup : self . reply_markup } } } # [doc = "This object represents a video message (available in Telegram apps as of v.4.0)."] # [derive (Serialize , Deserialize , Debug)] pub struct VideoNote { # [doc = "Identifier for this file, which can be used to download or reuse the file"] # [serde (rename = "file_id")] file_id : String , # [doc = "Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file."] # [serde (rename = "file_unique_id")] file_unique_id : String , # [doc = "Video width and height (diameter of the video message) as defined by sender"] # [serde (rename = "length")] length : i64 , # [doc = "Duration of the video in seconds as defined by sender"] # [serde (rename = "duration")] duration : i64 , # [doc = "Optional. Video thumbnail"] # [serde (skip_serializing_if = "Option::is_none" , rename = "thumb")] thumb : Option < PhotoSize > , # [doc = "Optional. File size in bytes"] # [serde (skip_serializing_if = "Option::is_none" , rename = "file_size")] file_size : Option < i64 > } # [doc = "This object represents a video message (available in Telegram apps as of v.4.0)."] # [derive (Serialize , Deserialize , Debug)] pub struct VideoNoteBuilder { # [doc = "Identifier for this file, which can be used to download or reuse the file"] # [serde (rename = "file_id")] file_id : String , # [doc = "Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file."] # [serde (rename = "file_unique_id")] file_unique_id : String , # [doc = "Video width and height (diameter of the video message) as defined by sender"] # [serde (rename = "length")] length : i64 , # [doc = "Duration of the video in seconds as defined by sender"] # [serde (rename = "duration")] duration : i64 , # [doc = "Optional. Video thumbnail"] # [serde (skip_serializing_if = "Option::is_none" , rename = "thumb")] thumb : Option < PhotoSize > , # [doc = "Optional. File size in bytes"] # [serde (skip_serializing_if = "Option::is_none" , rename = "file_size")] file_size : Option < i64 > } impl VideoNoteBuilder { pub fn new (file_id : String , file_unique_id : String , length : i64 , duration : i64) -> Self { Self { file_id , file_unique_id , length , duration , thumb : None , file_size : None } } pub fn set_file_id (mut self , file_id : String) -> Self { self . file_id = file_id ; self } pub fn set_file_unique_id (mut self , file_unique_id : String) -> Self { self . file_unique_id = file_unique_id ; self } pub fn set_length (mut self , length : i64) -> Self { self . length = length ; self } pub fn set_duration (mut self , duration : i64) -> Self { self . duration = duration ; self } pub fn set_thumb (mut self , thumb : Option < PhotoSize >) -> Self { self . thumb = thumb ; self } pub fn set_file_size (mut self , file_size : Option < i64 >) -> Self { self . file_size = file_size ; self } pub fn build (self) -> VideoNote { VideoNote { file_id : self . file_id , file_unique_id : self . file_unique_id , length : self . length , duration : self . duration , thumb : self . thumb , file_size : self . file_size } } } # [doc = "This object represents a file uploaded to Telegram Passport. Currently all Telegram Passport files are in JPEG format when decrypted and don't exceed 10MB."] # [derive (Serialize , Deserialize , Debug)] pub struct PassportFile { # [doc = "Identifier for this file, which can be used to download or reuse the file"] # [serde (rename = "file_id")] file_id : String , # [doc = "Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file."] # [serde (rename = "file_unique_id")] file_unique_id : String , # [doc = "File size in bytes"] # [serde (rename = "file_size")] file_size : i64 , # [doc = "Unix time when the file was uploaded"] # [serde (rename = "file_date")] file_date : i64 } # [doc = "This object represents a file uploaded to Telegram Passport. Currently all Telegram Passport files are in JPEG format when decrypted and don't exceed 10MB."] # [derive (Serialize , Deserialize , Debug)] pub struct PassportFileBuilder { # [doc = "Identifier for this file, which can be used to download or reuse the file"] # [serde (rename = "file_id")] file_id : String , # [doc = "Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file."] # [serde (rename = "file_unique_id")] file_unique_id : String , # [doc = "File size in bytes"] # [serde (rename = "file_size")] file_size : i64 , # [doc = "Unix time when the file was uploaded"] # [serde (rename = "file_date")] file_date : i64 } impl PassportFileBuilder { pub fn new (file_id : String , file_unique_id : String , file_size : i64 , file_date : i64) -> Self { Self { file_id , file_unique_id , file_size , file_date , } } pub fn set_file_id (mut self , file_id : String) -> Self { self . file_id = file_id ; self } pub fn set_file_unique_id (mut self , file_unique_id : String) -> Self { self . file_unique_id = file_unique_id ; self } pub fn set_file_size (mut self , file_size : i64) -> Self { self . file_size = file_size ; self } pub fn set_file_date (mut self , file_date : i64) -> Self { self . file_date = file_date ; self } pub fn build (self) -> PassportFile { PassportFile { file_id : self . file_id , file_unique_id : self . file_unique_id , file_size : self . file_size , file_date : self . file_date } } } # [doc = "Represents an issue with the front side of a document. The error is considered resolved when the file with the front side of the document changes."] # [derive (Serialize , Deserialize , Debug)] pub struct PassportElementErrorFrontSide { # [doc = "Error source, must be front_side"] # [serde (rename = "source")] source : String , # [doc = "The section of the user's Telegram Passport which has the issue, one of \"passport\", \"driver_license\", \"identity_card\", \"internal_passport\""] # [serde (rename = "type")] tg_type : String , # [doc = "Base64-encoded hash of the file with the front side of the document"] # [serde (rename = "file_hash")] file_hash : String , # [doc = "Error message"] # [serde (rename = "message")] message : String } # [doc = "Represents an issue with the front side of a document. The error is considered resolved when the file with the front side of the document changes."] # [derive (Serialize , Deserialize , Debug)] pub struct PassportElementErrorFrontSideBuilder { # [doc = "Error source, must be front_side"] # [serde (rename = "source")] source : String , # [doc = "The section of the user's Telegram Passport which has the issue, one of \"passport\", \"driver_license\", \"identity_card\", \"internal_passport\""] # [serde (rename = "type")] tg_type : String , # [doc = "Base64-encoded hash of the file with the front side of the document"] # [serde (rename = "file_hash")] file_hash : String , # [doc = "Error message"] # [serde (rename = "message")] message : String } impl PassportElementErrorFrontSideBuilder { pub fn new (source : String , file_hash : String , message : String) -> Self { Self { tg_type : "PassportElementErrorFrontSide" . to_owned () , source , file_hash , message , } } pub fn set_source (mut self , source : String) -> Self { self . source = source ; self } pub fn set_type (mut self , tg_type : String) -> Self { self . tg_type = tg_type ; self } pub fn set_file_hash (mut self , file_hash : String) -> Self { self . file_hash = file_hash ; self } pub fn set_message (mut self , message : String) -> Self { self . message = message ; self } pub fn build (self) -> PassportElementErrorFrontSide { PassportElementErrorFrontSide { source : self . source , tg_type : self . tg_type , file_hash : self . file_hash , message : self . message } } } # [doc = "Represents an issue with a document scan. The error is considered resolved when the file with the document scan changes."] # [derive (Serialize , Deserialize , Debug)] pub struct PassportElementErrorFile { # [doc = "Error source, must be file"] # [serde (rename = "source")] source : String , # [doc = "The section of the user's Telegram Passport which has the issue, one of \"utility_bill\", \"bank_statement\", \"rental_agreement\", \"passport_registration\", \"temporary_registration\""] # [serde (rename = "type")] tg_type : String , # [doc = "Base64-encoded file hash"] # [serde (rename = "file_hash")] file_hash : String , # [doc = "Error message"] # [serde (rename = "message")] message : String } # [doc = "Represents an issue with a document scan. The error is considered resolved when the file with the document scan changes."] # [derive (Serialize , Deserialize , Debug)] pub struct PassportElementErrorFileBuilder { # [doc = "Error source, must be file"] # [serde (rename = "source")] source : String , # [doc = "The section of the user's Telegram Passport which has the issue, one of \"utility_bill\", \"bank_statement\", \"rental_agreement\", \"passport_registration\", \"temporary_registration\""] # [serde (rename = "type")] tg_type : String , # [doc = "Base64-encoded file hash"] # [serde (rename = "file_hash")] file_hash : String , # [doc = "Error message"] # [serde (rename = "message")] message : String } impl PassportElementErrorFileBuilder { pub fn new (source : String , file_hash : String , message : String) -> Self { Self { tg_type : "PassportElementErrorFile" . to_owned () , source , file_hash , message , } } pub fn set_source (mut self , source : String) -> Self { self . source = source ; self } pub fn set_type (mut self , tg_type : String) -> Self { self . tg_type = tg_type ; self } pub fn set_file_hash (mut self , file_hash : String) -> Self { self . file_hash = file_hash ; self } pub fn set_message (mut self , message : String) -> Self { self . message = message ; self } pub fn build (self) -> PassportElementErrorFile { PassportElementErrorFile { source : self . source , tg_type : self . tg_type , file_hash : self . file_hash , message : self . message } } } # [doc = "Represents a link to a page containing an embedded video player or a video file. By default, this video file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the video."] # [derive (Serialize , Deserialize , Debug)] pub struct InlineQueryResultVideo { # [doc = "Type of the result, must be video"] # [serde (rename = "type")] tg_type : String , # [doc = "Unique identifier for this result, 1-64 bytes"] # [serde (rename = "id")] id : String , # [doc = "A valid URL for the embedded video player or video file"] # [serde (rename = "video_url")] video_url : String , # [doc = "MIME type of the content of the video URL, \"text/html\" or \"video/mp4\""] # [serde (rename = "mime_type")] mime_type : String , # [doc = "URL of the thumbnail (JPEG only) for the video"] # [serde (rename = "thumb_url")] thumb_url : String , # [doc = "Title for the result"] # [serde (rename = "title")] title : String , # [doc = "Optional. Caption of the video to be sent, 0-1024 characters after entities parsing"] # [serde (skip_serializing_if = "Option::is_none" , rename = "caption")] caption : Option < String > , # [doc = "Optional. Mode for parsing entities in the video caption. See formatting options for more details."] # [serde (skip_serializing_if = "Option::is_none" , rename = "parse_mode")] parse_mode : Option < String > , # [doc = "Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode"] # [serde (skip_serializing_if = "Option::is_none" , rename = "caption_entities")] caption_entities : Option < Vec < MessageEntity > > , # [doc = "Optional. Video width"] # [serde (skip_serializing_if = "Option::is_none" , rename = "video_width")] video_width : Option < i64 > , # [doc = "Optional. Video height"] # [serde (skip_serializing_if = "Option::is_none" , rename = "video_height")] video_height : Option < i64 > , # [doc = "Optional. Video duration in seconds"] # [serde (skip_serializing_if = "Option::is_none" , rename = "video_duration")] video_duration : Option < i64 > , # [doc = "Optional. Short description of the result"] # [serde (skip_serializing_if = "Option::is_none" , rename = "description")] description : Option < String > , # [doc = "Optional. Inline keyboard attached to the message"] # [serde (skip_serializing_if = "Option::is_none" , rename = "reply_markup")] reply_markup : Option < InlineKeyboardMarkup > , # [doc = "Optional. Content of the message to be sent instead of the video. This field is required if InlineQueryResultVideo is used to send an HTML-page as a result (e.g., a YouTube video)."] # [serde (skip_serializing_if = "Option::is_none" , rename = "input_message_content")] input_message_content : Option < InputMessageContent > } # [doc = "Represents a link to a page containing an embedded video player or a video file. By default, this video file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the video."] # [derive (Serialize , Deserialize , Debug)] pub struct InlineQueryResultVideoBuilder { # [doc = "Type of the result, must be video"] # [serde (rename = "type")] tg_type : String , # [doc = "Unique identifier for this result, 1-64 bytes"] # [serde (rename = "id")] id : String , # [doc = "A valid URL for the embedded video player or video file"] # [serde (rename = "video_url")] video_url : String , # [doc = "MIME type of the content of the video URL, \"text/html\" or \"video/mp4\""] # [serde (rename = "mime_type")] mime_type : String , # [doc = "URL of the thumbnail (JPEG only) for the video"] # [serde (rename = "thumb_url")] thumb_url : String , # [doc = "Title for the result"] # [serde (rename = "title")] title : String , # [doc = "Optional. Caption of the video to be sent, 0-1024 characters after entities parsing"] # [serde (skip_serializing_if = "Option::is_none" , rename = "caption")] caption : Option < String > , # [doc = "Optional. Mode for parsing entities in the video caption. See formatting options for more details."] # [serde (skip_serializing_if = "Option::is_none" , rename = "parse_mode")] parse_mode : Option < String > , # [doc = "Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode"] # [serde (skip_serializing_if = "Option::is_none" , rename = "caption_entities")] caption_entities : Option < Vec < MessageEntity > > , # [doc = "Optional. Video width"] # [serde (skip_serializing_if = "Option::is_none" , rename = "video_width")] video_width : Option < i64 > , # [doc = "Optional. Video height"] # [serde (skip_serializing_if = "Option::is_none" , rename = "video_height")] video_height : Option < i64 > , # [doc = "Optional. Video duration in seconds"] # [serde (skip_serializing_if = "Option::is_none" , rename = "video_duration")] video_duration : Option < i64 > , # [doc = "Optional. Short description of the result"] # [serde (skip_serializing_if = "Option::is_none" , rename = "description")] description : Option < String > , # [doc = "Optional. Inline keyboard attached to the message"] # [serde (skip_serializing_if = "Option::is_none" , rename = "reply_markup")] reply_markup : Option < InlineKeyboardMarkup > , # [doc = "Optional. Content of the message to be sent instead of the video. This field is required if InlineQueryResultVideo is used to send an HTML-page as a result (e.g., a YouTube video)."] # [serde (skip_serializing_if = "Option::is_none" , rename = "input_message_content")] input_message_content : Option < InputMessageContent > } impl InlineQueryResultVideoBuilder { pub fn new (id : String , video_url : String , mime_type : String , thumb_url : String , title : String) -> Self { Self { tg_type : "video" . to_owned () , id , video_url , mime_type , thumb_url , title , caption : None , parse_mode : None , caption_entities : None , video_width : None , video_height : None , video_duration : None , description : None , reply_markup : None , input_message_content : None } } pub fn set_type (mut self , tg_type : String) -> Self { self . tg_type = tg_type ; self } pub fn set_id (mut self , id : String) -> Self { self . id = id ; self } pub fn set_video_url (mut self , video_url : String) -> Self { self . video_url = video_url ; self } pub fn set_mime_type (mut self , mime_type : String) -> Self { self . mime_type = mime_type ; self } pub fn set_thumb_url (mut self , thumb_url : String) -> Self { self . thumb_url = thumb_url ; self } pub fn set_title (mut self , title : String) -> Self { self . title = title ; self } pub fn set_caption (mut self , caption : Option < String >) -> Self { self . caption = caption ; self } pub fn set_parse_mode (mut self , parse_mode : Option < String >) -> Self { self . parse_mode = parse_mode ; self } pub fn set_caption_entities (mut self , caption_entities : Option < Vec < MessageEntity > >) -> Self { self . caption_entities = caption_entities ; self } pub fn set_video_width (mut self , video_width : Option < i64 >) -> Self { self . video_width = video_width ; self } pub fn set_video_height (mut self , video_height : Option < i64 >) -> Self { self . video_height = video_height ; self } pub fn set_video_duration (mut self , video_duration : Option < i64 >) -> Self { self . video_duration = video_duration ; self } pub fn set_description (mut self , description : Option < String >) -> Self { self . description = description ; self } pub fn set_reply_markup (mut self , reply_markup : Option < InlineKeyboardMarkup >) -> Self { self . reply_markup = reply_markup ; self } pub fn set_input_message_content (mut self , input_message_content : Option < InputMessageContent >) -> Self { self . input_message_content = input_message_content ; self } pub fn build (self) -> InlineQueryResultVideo { InlineQueryResultVideo { tg_type : self . tg_type , id : self . id , video_url : self . video_url , mime_type : self . mime_type , thumb_url : self . thumb_url , title : self . title , caption : self . caption , parse_mode : self . parse_mode , caption_entities : self . caption_entities , video_width : self . video_width , video_height : self . video_height , video_duration : self . video_duration , description : self . description , reply_markup : self . reply_markup , input_message_content : self . input_message_content } } } # [doc = "This object represents a general file (as opposed to photos, voice messages and audio files)."] # [derive (Serialize , Deserialize , Debug)] pub struct Document { # [doc = "Identifier for this file, which can be used to download or reuse the file"] # [serde (rename = "file_id")] file_id : String , # [doc = "Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file."] # [serde (rename = "file_unique_id")] file_unique_id : String , # [doc = "Optional. Document thumbnail as defined by sender"] # [serde (skip_serializing_if = "Option::is_none" , rename = "thumb")] thumb : Option < PhotoSize > , # [doc = "Optional. Original filename as defined by sender"] # [serde (skip_serializing_if = "Option::is_none" , rename = "file_name")] file_name : Option < String > , # [doc = "Optional. MIME type of the file as defined by sender"] # [serde (skip_serializing_if = "Option::is_none" , rename = "mime_type")] mime_type : Option < String > , # [doc = "Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value."] # [serde (skip_serializing_if = "Option::is_none" , rename = "file_size")] file_size : Option < i64 > } # [doc = "This object represents a general file (as opposed to photos, voice messages and audio files)."] # [derive (Serialize , Deserialize , Debug)] pub struct DocumentBuilder { # [doc = "Identifier for this file, which can be used to download or reuse the file"] # [serde (rename = "file_id")] file_id : String , # [doc = "Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file."] # [serde (rename = "file_unique_id")] file_unique_id : String , # [doc = "Optional. Document thumbnail as defined by sender"] # [serde (skip_serializing_if = "Option::is_none" , rename = "thumb")] thumb : Option < PhotoSize > , # [doc = "Optional. Original filename as defined by sender"] # [serde (skip_serializing_if = "Option::is_none" , rename = "file_name")] file_name : Option < String > , # [doc = "Optional. MIME type of the file as defined by sender"] # [serde (skip_serializing_if = "Option::is_none" , rename = "mime_type")] mime_type : Option < String > , # [doc = "Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value."] # [serde (skip_serializing_if = "Option::is_none" , rename = "file_size")] file_size : Option < i64 > } impl DocumentBuilder { pub fn new (file_id : String , file_unique_id : String) -> Self { Self { file_id , file_unique_id , thumb : None , file_name : None , mime_type : None , file_size : None } } pub fn set_file_id (mut self , file_id : String) -> Self { self . file_id = file_id ; self } pub fn set_file_unique_id (mut self , file_unique_id : String) -> Self { self . file_unique_id = file_unique_id ; self } pub fn set_thumb (mut self , thumb : Option < PhotoSize >) -> Self { self . thumb = thumb ; self } pub fn set_file_name (mut self , file_name : Option < String >) -> Self { self . file_name = file_name ; self } pub fn set_mime_type (mut self , mime_type : Option < String >) -> Self { self . mime_type = mime_type ; self } pub fn set_file_size (mut self , file_size : Option < i64 >) -> Self { self . file_size = file_size ; self } pub fn build (self) -> Document { Document { file_id : self . file_id , file_unique_id : self . file_unique_id , thumb : self . thumb , file_name : self . file_name , mime_type : self . mime_type , file_size : self . file_size } } } # [doc = "Describes a Web App."] # [derive (Serialize , Deserialize , Debug)] pub struct WebAppInfo { # [doc = "An HTTPS URL of a Web App to be opened with additional data as specified in Initializing Web Apps"] # [serde (rename = "url")] url : String } # [doc = "Describes a Web App."] # [derive (Serialize , Deserialize , Debug)] pub struct WebAppInfoBuilder { # [doc = "An HTTPS URL of a Web App to be opened with additional data as specified in Initializing Web Apps"] # [serde (rename = "url")] url : String } impl WebAppInfoBuilder { pub fn new (url : String) -> Self { Self { url , } } pub fn set_url (mut self , url : String) -> Self { self . url = url ; self } pub fn build (self) -> WebAppInfo { WebAppInfo { url : self . url } } } # [doc = "Describes Telegram Passport data shared with the bot by the user."] # [derive (Serialize , Deserialize , Debug)] pub struct PassportData { # [doc = "Array with information about documents and other Telegram Passport elements that was shared with the bot"] # [serde (rename = "data")] data : Vec < EncryptedPassportElement > , # [doc = "Encrypted credentials required to decrypt the data"] # [serde (rename = "credentials")] credentials : EncryptedCredentials } # [doc = "Describes Telegram Passport data shared with the bot by the user."] # [derive (Serialize , Deserialize , Debug)] pub struct PassportDataBuilder { # [doc = "Array with information about documents and other Telegram Passport elements that was shared with the bot"] # [serde (rename = "data")] data : Vec < EncryptedPassportElement > , # [doc = "Encrypted credentials required to decrypt the data"] # [serde (rename = "credentials")] credentials : EncryptedCredentials } impl PassportDataBuilder { pub fn new (data : Vec < EncryptedPassportElement > , credentials : EncryptedCredentials) -> Self { Self { data , credentials , } } pub fn set_data (mut self , data : Vec < EncryptedPassportElement >) -> Self { self . data = data ; self } pub fn set_credentials (mut self , credentials : EncryptedCredentials) -> Self { self . credentials = credentials ; self } pub fn build (self) -> PassportData { PassportData { data : self . data , credentials : self . credentials } } } # [doc = "This object represents a chat."] # [derive (Serialize , Deserialize , Debug)] pub struct Chat { # [doc = "Unique identifier for this chat. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier."] # [serde (rename = "id")] id : i64 , # [doc = "Type of chat, can be either \"private\", \"group\", \"supergroup\" or \"channel\""] # [serde (rename = "type")] tg_type : String , # [doc = "Optional. Title, for supergroups, channels and group chats"] # [serde (skip_serializing_if = "Option::is_none" , rename = "title")] title : Option < String > , # [doc = "Optional. Username, for private chats, supergroups and channels if available"] # [serde (skip_serializing_if = "Option::is_none" , rename = "username")] username : Option < String > , # [doc = "Optional. First name of the other party in a private chat"] # [serde (skip_serializing_if = "Option::is_none" , rename = "first_name")] first_name : Option < String > , # [doc = "Optional. Last name of the other party in a private chat"] # [serde (skip_serializing_if = "Option::is_none" , rename = "last_name")] last_name : Option < String > , # [doc = "Optional. Chat photo. Returned only in getChat."] # [serde (skip_serializing_if = "Option::is_none" , rename = "photo")] photo : Option < ChatPhoto > , # [doc = "Optional. Bio of the other party in a private chat. Returned only in getChat."] # [serde (skip_serializing_if = "Option::is_none" , rename = "bio")] bio : Option < String > , # [doc = "Optional. True, if privacy settings of the other party in the private chat allows to use tg://user?id=<user_id> links only in chats with the user. Returned only in getChat."] # [serde (skip_serializing_if = "Option::is_none" , rename = "has_private_forwards")] has_private_forwards : Option < bool > , # [doc = "Optional. True, if the privacy settings of the other party restrict sending voice and video note messages in the private chat. Returned only in getChat."] # [serde (skip_serializing_if = "Option::is_none" , rename = "has_restricted_voice_and_video_messages")] has_restricted_voice_and_video_messages : Option < bool > , # [doc = "Optional. True, if users need to join the supergroup before they can send messages. Returned only in getChat."] # [serde (skip_serializing_if = "Option::is_none" , rename = "join_to_send_messages")] join_to_send_messages : Option < bool > , # [doc = "Optional. True, if all users directly joining the supergroup need to be approved by supergroup administrators. Returned only in getChat."] # [serde (skip_serializing_if = "Option::is_none" , rename = "join_by_request")] join_by_request : Option < bool > , # [doc = "Optional. Description, for groups, supergroups and channel chats. Returned only in getChat."] # [serde (skip_serializing_if = "Option::is_none" , rename = "description")] description : Option < String > , # [doc = "Optional. Primary invite link, for groups, supergroups and channel chats. Returned only in getChat."] # [serde (skip_serializing_if = "Option::is_none" , rename = "invite_link")] invite_link : Option < String > , # [doc = "Optional. The most recent pinned message (by sending date). Returned only in getChat."] # [serde (skip_serializing_if = "Option::is_none" , rename = "pinned_message")] pinned_message : Option < Message > , # [doc = "Optional. Default chat member permissions, for groups and supergroups. Returned only in getChat."] # [serde (skip_serializing_if = "Option::is_none" , rename = "permissions")] permissions : Option < ChatPermissions > , # [doc = "Optional. For supergroups, the minimum allowed delay between consecutive messages sent by each unpriviledged user; in seconds. Returned only in getChat."] # [serde (skip_serializing_if = "Option::is_none" , rename = "slow_mode_delay")] slow_mode_delay : Option < i64 > , # [doc = "Optional. The time after which all messages sent to the chat will be automatically deleted; in seconds. Returned only in getChat."] # [serde (skip_serializing_if = "Option::is_none" , rename = "message_auto_delete_time")] message_auto_delete_time : Option < i64 > , # [doc = "Optional. True, if messages from the chat can't be forwarded to other chats. Returned only in getChat."] # [serde (skip_serializing_if = "Option::is_none" , rename = "has_protected_content")] has_protected_content : Option < bool > , # [doc = "Optional. For supergroups, name of group sticker set. Returned only in getChat."] # [serde (skip_serializing_if = "Option::is_none" , rename = "sticker_set_name")] sticker_set_name : Option < String > , # [doc = "Optional. True, if the bot can change the group sticker set. Returned only in getChat."] # [serde (skip_serializing_if = "Option::is_none" , rename = "can_set_sticker_set")] can_set_sticker_set : Option < bool > , # [doc = "Optional. Unique identifier for the linked chat, i.e. the discussion group identifier for a channel and vice versa; for supergroups and channel chats. This identifier may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier. Returned only in getChat."] # [serde (skip_serializing_if = "Option::is_none" , rename = "linked_chat_id")] linked_chat_id : Option < i64 > , # [doc = "Optional. For supergroups, the location to which the supergroup is connected. Returned only in getChat."] # [serde (skip_serializing_if = "Option::is_none" , rename = "location")] location : Option < ChatLocation > } # [doc = "This object represents a chat."] # [derive (Serialize , Deserialize , Debug)] pub struct ChatBuilder { # [doc = "Unique identifier for this chat. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier."] # [serde (rename = "id")] id : i64 , # [doc = "Type of chat, can be either \"private\", \"group\", \"supergroup\" or \"channel\""] # [serde (rename = "type")] tg_type : String , # [doc = "Optional. Title, for supergroups, channels and group chats"] # [serde (skip_serializing_if = "Option::is_none" , rename = "title")] title : Option < String > , # [doc = "Optional. Username, for private chats, supergroups and channels if available"] # [serde (skip_serializing_if = "Option::is_none" , rename = "username")] username : Option < String > , # [doc = "Optional. First name of the other party in a private chat"] # [serde (skip_serializing_if = "Option::is_none" , rename = "first_name")] first_name : Option < String > , # [doc = "Optional. Last name of the other party in a private chat"] # [serde (skip_serializing_if = "Option::is_none" , rename = "last_name")] last_name : Option < String > , # [doc = "Optional. Chat photo. Returned only in getChat."] # [serde (skip_serializing_if = "Option::is_none" , rename = "photo")] photo : Option < ChatPhoto > , # [doc = "Optional. Bio of the other party in a private chat. Returned only in getChat."] # [serde (skip_serializing_if = "Option::is_none" , rename = "bio")] bio : Option < String > , # [doc = "Optional. True, if privacy settings of the other party in the private chat allows to use tg://user?id=<user_id> links only in chats with the user. Returned only in getChat."] # [serde (skip_serializing_if = "Option::is_none" , rename = "has_private_forwards")] has_private_forwards : Option < bool > , # [doc = "Optional. True, if the privacy settings of the other party restrict sending voice and video note messages in the private chat. Returned only in getChat."] # [serde (skip_serializing_if = "Option::is_none" , rename = "has_restricted_voice_and_video_messages")] has_restricted_voice_and_video_messages : Option < bool > , # [doc = "Optional. True, if users need to join the supergroup before they can send messages. Returned only in getChat."] # [serde (skip_serializing_if = "Option::is_none" , rename = "join_to_send_messages")] join_to_send_messages : Option < bool > , # [doc = "Optional. True, if all users directly joining the supergroup need to be approved by supergroup administrators. Returned only in getChat."] # [serde (skip_serializing_if = "Option::is_none" , rename = "join_by_request")] join_by_request : Option < bool > , # [doc = "Optional. Description, for groups, supergroups and channel chats. Returned only in getChat."] # [serde (skip_serializing_if = "Option::is_none" , rename = "description")] description : Option < String > , # [doc = "Optional. Primary invite link, for groups, supergroups and channel chats. Returned only in getChat."] # [serde (skip_serializing_if = "Option::is_none" , rename = "invite_link")] invite_link : Option < String > , # [doc = "Optional. The most recent pinned message (by sending date). Returned only in getChat."] # [serde (skip_serializing_if = "Option::is_none" , rename = "pinned_message")] pinned_message : Option < Message > , # [doc = "Optional. Default chat member permissions, for groups and supergroups. Returned only in getChat."] # [serde (skip_serializing_if = "Option::is_none" , rename = "permissions")] permissions : Option < ChatPermissions > , # [doc = "Optional. For supergroups, the minimum allowed delay between consecutive messages sent by each unpriviledged user; in seconds. Returned only in getChat."] # [serde (skip_serializing_if = "Option::is_none" , rename = "slow_mode_delay")] slow_mode_delay : Option < i64 > , # [doc = "Optional. The time after which all messages sent to the chat will be automatically deleted; in seconds. Returned only in getChat."] # [serde (skip_serializing_if = "Option::is_none" , rename = "message_auto_delete_time")] message_auto_delete_time : Option < i64 > , # [doc = "Optional. True, if messages from the chat can't be forwarded to other chats. Returned only in getChat."] # [serde (skip_serializing_if = "Option::is_none" , rename = "has_protected_content")] has_protected_content : Option < bool > , # [doc = "Optional. For supergroups, name of group sticker set. Returned only in getChat."] # [serde (skip_serializing_if = "Option::is_none" , rename = "sticker_set_name")] sticker_set_name : Option < String > , # [doc = "Optional. True, if the bot can change the group sticker set. Returned only in getChat."] # [serde (skip_serializing_if = "Option::is_none" , rename = "can_set_sticker_set")] can_set_sticker_set : Option < bool > , # [doc = "Optional. Unique identifier for the linked chat, i.e. the discussion group identifier for a channel and vice versa; for supergroups and channel chats. This identifier may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier. Returned only in getChat."] # [serde (skip_serializing_if = "Option::is_none" , rename = "linked_chat_id")] linked_chat_id : Option < i64 > , # [doc = "Optional. For supergroups, the location to which the supergroup is connected. Returned only in getChat."] # [serde (skip_serializing_if = "Option::is_none" , rename = "location")] location : Option < ChatLocation > } impl ChatBuilder { pub fn new (id : i64) -> Self { Self { tg_type : "Chat" . to_owned () , id , title : None , username : None , first_name : None , last_name : None , photo : None , bio : None , has_private_forwards : None , has_restricted_voice_and_video_messages : None , join_to_send_messages : None , join_by_request : None , description : None , invite_link : None , pinned_message : None , permissions : None , slow_mode_delay : None , message_auto_delete_time : None , has_protected_content : None , sticker_set_name : None , can_set_sticker_set : None , linked_chat_id : None , location : None } } pub fn set_id (mut self , id : i64) -> Self { self . id = id ; self } pub fn set_type (mut self , tg_type : String) -> Self { self . tg_type = tg_type ; self } pub fn set_title (mut self , title : Option < String >) -> Self { self . title = title ; self } pub fn set_username (mut self , username : Option < String >) -> Self { self . username = username ; self } pub fn set_first_name (mut self , first_name : Option < String >) -> Self { self . first_name = first_name ; self } pub fn set_last_name (mut self , last_name : Option < String >) -> Self { self . last_name = last_name ; self } pub fn set_photo (mut self , photo : Option < ChatPhoto >) -> Self { self . photo = photo ; self } pub fn set_bio (mut self , bio : Option < String >) -> Self { self . bio = bio ; self } pub fn set_has_private_forwards (mut self , has_private_forwards : Option < bool >) -> Self { self . has_private_forwards = has_private_forwards ; self } pub fn set_has_restricted_voice_and_video_messages (mut self , has_restricted_voice_and_video_messages : Option < bool >) -> Self { self . has_restricted_voice_and_video_messages = has_restricted_voice_and_video_messages ; self } pub fn set_join_to_send_messages (mut self , join_to_send_messages : Option < bool >) -> Self { self . join_to_send_messages = join_to_send_messages ; self } pub fn set_join_by_request (mut self , join_by_request : Option < bool >) -> Self { self . join_by_request = join_by_request ; self } pub fn set_description (mut self , description : Option < String >) -> Self { self . description = description ; self } pub fn set_invite_link (mut self , invite_link : Option < String >) -> Self { self . invite_link = invite_link ; self } pub fn set_pinned_message (mut self , pinned_message : Option < Message >) -> Self { self . pinned_message = pinned_message ; self } pub fn set_permissions (mut self , permissions : Option < ChatPermissions >) -> Self { self . permissions = permissions ; self } pub fn set_slow_mode_delay (mut self , slow_mode_delay : Option < i64 >) -> Self { self . slow_mode_delay = slow_mode_delay ; self } pub fn set_message_auto_delete_time (mut self , message_auto_delete_time : Option < i64 >) -> Self { self . message_auto_delete_time = message_auto_delete_time ; self } pub fn set_has_protected_content (mut self , has_protected_content : Option < bool >) -> Self { self . has_protected_content = has_protected_content ; self } pub fn set_sticker_set_name (mut self , sticker_set_name : Option < String >) -> Self { self . sticker_set_name = sticker_set_name ; self } pub fn set_can_set_sticker_set (mut self , can_set_sticker_set : Option < bool >) -> Self { self . can_set_sticker_set = can_set_sticker_set ; self } pub fn set_linked_chat_id (mut self , linked_chat_id : Option < i64 >) -> Self { self . linked_chat_id = linked_chat_id ; self } pub fn set_location (mut self , location : Option < ChatLocation >) -> Self { self . location = location ; self } pub fn build (self) -> Chat { Chat { id : self . id , tg_type : self . tg_type , title : self . title , username : self . username , first_name : self . first_name , last_name : self . last_name , photo : self . photo , bio : self . bio , has_private_forwards : self . has_private_forwards , has_restricted_voice_and_video_messages : self . has_restricted_voice_and_video_messages , join_to_send_messages : self . join_to_send_messages , join_by_request : self . join_by_request , description : self . description , invite_link : self . invite_link , pinned_message : self . pinned_message , permissions : self . permissions , slow_mode_delay : self . slow_mode_delay , message_auto_delete_time : self . message_auto_delete_time , has_protected_content : self . has_protected_content , sticker_set_name : self . sticker_set_name , can_set_sticker_set : self . can_set_sticker_set , linked_chat_id : self . linked_chat_id , location : self . location } } } # [doc = "This object represents an incoming callback query from a callback button in an inline keyboard. If the button that originated the query was attached to a message sent by the bot, the field message will be present. If the button was attached to a message sent via the bot (in inline mode), the field inline_message_id will be present. Exactly one of the fields data or game_short_name will be present."] # [derive (Serialize , Deserialize , Debug)] pub struct CallbackQuery { # [doc = "Unique identifier for this query"] # [serde (rename = "id")] id : String , # [doc = "Sender"] # [serde (rename = "from")] from : User , # [doc = "Optional. Message with the callback button that originated the query. Note that message content and message date will not be available if the message is too old"] # [serde (skip_serializing_if = "Option::is_none" , rename = "message")] message : Option < Message > , # [doc = "Optional. Identifier of the message sent via the bot in inline mode, that originated the query."] # [serde (skip_serializing_if = "Option::is_none" , rename = "inline_message_id")] inline_message_id : Option < String > , # [doc = "Global identifier, uniquely corresponding to the chat to which the message with the callback button was sent. Useful for high scores in games."] # [serde (rename = "chat_instance")] chat_instance : String , # [doc = "Optional. Data associated with the callback button. Be aware that the message originated the query can contain no callback buttons with this data."] # [serde (skip_serializing_if = "Option::is_none" , rename = "data")] data : Option < String > , # [doc = "Optional. Short name of a Game to be returned, serves as the unique identifier for the game"] # [serde (skip_serializing_if = "Option::is_none" , rename = "game_short_name")] game_short_name : Option < String > } # [doc = "This object represents an incoming callback query from a callback button in an inline keyboard. If the button that originated the query was attached to a message sent by the bot, the field message will be present. If the button was attached to a message sent via the bot (in inline mode), the field inline_message_id will be present. Exactly one of the fields data or game_short_name will be present."] # [derive (Serialize , Deserialize , Debug)] pub struct CallbackQueryBuilder { # [doc = "Unique identifier for this query"] # [serde (rename = "id")] id : String , # [doc = "Sender"] # [serde (rename = "from")] from : User , # [doc = "Optional. Message with the callback button that originated the query. Note that message content and message date will not be available if the message is too old"] # [serde (skip_serializing_if = "Option::is_none" , rename = "message")] message : Option < Message > , # [doc = "Optional. Identifier of the message sent via the bot in inline mode, that originated the query."] # [serde (skip_serializing_if = "Option::is_none" , rename = "inline_message_id")] inline_message_id : Option < String > , # [doc = "Global identifier, uniquely corresponding to the chat to which the message with the callback button was sent. Useful for high scores in games."] # [serde (rename = "chat_instance")] chat_instance : String , # [doc = "Optional. Data associated with the callback button. Be aware that the message originated the query can contain no callback buttons with this data."] # [serde (skip_serializing_if = "Option::is_none" , rename = "data")] data : Option < String > , # [doc = "Optional. Short name of a Game to be returned, serves as the unique identifier for the game"] # [serde (skip_serializing_if = "Option::is_none" , rename = "game_short_name")] game_short_name : Option < String > } impl CallbackQueryBuilder { pub fn new (id : String , from : User , chat_instance : String) -> Self { Self { id , from , chat_instance , message : None , inline_message_id : None , data : None , game_short_name : None } } pub fn set_id (mut self , id : String) -> Self { self . id = id ; self } pub fn set_from (mut self , from : User) -> Self { self . from = from ; self } pub fn set_message (mut self , message : Option < Message >) -> Self { self . message = message ; self } pub fn set_inline_message_id (mut self , inline_message_id : Option < String >) -> Self { self . inline_message_id = inline_message_id ; self } pub fn set_chat_instance (mut self , chat_instance : String) -> Self { self . chat_instance = chat_instance ; self } pub fn set_data (mut self , data : Option < String >) -> Self { self . data = data ; self } pub fn set_game_short_name (mut self , game_short_name : Option < String >) -> Self { self . game_short_name = game_short_name ; self } pub fn build (self) -> CallbackQuery { CallbackQuery { id : self . id , from : self . from , message : self . message , inline_message_id : self . inline_message_id , chat_instance : self . chat_instance , data : self . data , game_short_name : self . game_short_name } } } # [derive (Serialize , Deserialize , Debug)] # [serde (untagged)] pub enum InputMessageContent { InputTextMessageContent (InputTextMessageContent) , InputLocationMessageContent (InputLocationMessageContent) , InputVenueMessageContent (InputVenueMessageContent) , InputContactMessageContent (InputContactMessageContent) , InputInvoiceMessageContent (InputInvoiceMessageContent) } # [doc = "Upon receiving a message with this object, Telegram clients will remove the current custom keyboard and display the default letter-keyboard. By default, custom keyboards are displayed until a new keyboard is sent by a bot. An exception is made for one-time keyboards that are hidden immediately after the user presses a button (see ReplyKeyboardMarkup)."] # [derive (Serialize , Deserialize , Debug)] pub struct ReplyKeyboardRemove { # [doc = "Requests clients to remove the custom keyboard (user will not be able to summon this keyboard; if you want to hide the keyboard from sight but keep it accessible, use one_time_keyboard in ReplyKeyboardMarkup)"] # [serde (rename = "remove_keyboard")] remove_keyboard : bool , # [doc = "Optional. Use this parameter if you want to remove the keyboard for specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply (has reply_to_message_id), sender of the original message. Example: A user votes in a poll, bot returns confirmation message in reply to the vote and removes the keyboard for that user, while still showing the keyboard with poll options to users who haven't voted yet."] # [serde (skip_serializing_if = "Option::is_none" , rename = "selective")] selective : Option < bool > } # [doc = "Upon receiving a message with this object, Telegram clients will remove the current custom keyboard and display the default letter-keyboard. By default, custom keyboards are displayed until a new keyboard is sent by a bot. An exception is made for one-time keyboards that are hidden immediately after the user presses a button (see ReplyKeyboardMarkup)."] # [derive (Serialize , Deserialize , Debug)] pub struct ReplyKeyboardRemoveBuilder { # [doc = "Requests clients to remove the custom keyboard (user will not be able to summon this keyboard; if you want to hide the keyboard from sight but keep it accessible, use one_time_keyboard in ReplyKeyboardMarkup)"] # [serde (rename = "remove_keyboard")] remove_keyboard : bool , # [doc = "Optional. Use this parameter if you want to remove the keyboard for specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply (has reply_to_message_id), sender of the original message. Example: A user votes in a poll, bot returns confirmation message in reply to the vote and removes the keyboard for that user, while still showing the keyboard with poll options to users who haven't voted yet."] # [serde (skip_serializing_if = "Option::is_none" , rename = "selective")] selective : Option < bool > } impl ReplyKeyboardRemoveBuilder { pub fn new (remove_keyboard : bool) -> Self { Self { remove_keyboard , selective : None } } pub fn set_remove_keyboard (mut self , remove_keyboard : bool) -> Self { self . remove_keyboard = remove_keyboard ; self } pub fn set_selective (mut self , selective : Option < bool >) -> Self { self . selective = selective ; self } pub fn build (self) -> ReplyKeyboardRemove { ReplyKeyboardRemove { remove_keyboard : self . remove_keyboard , selective : self . selective } } } # [doc = "This object represent a user's profile pictures."] # [derive (Serialize , Deserialize , Debug)] pub struct UserProfilePhotos { # [doc = "Total number of profile pictures the target user has"] # [serde (rename = "total_count")] total_count : i64 , # [doc = "Requested profile pictures (in up to 4 sizes each)"] # [serde (rename = "photos")] photos : Vec < Vec < PhotoSize > > } # [doc = "This object represent a user's profile pictures."] # [derive (Serialize , Deserialize , Debug)] pub struct UserProfilePhotosBuilder { # [doc = "Total number of profile pictures the target user has"] # [serde (rename = "total_count")] total_count : i64 , # [doc = "Requested profile pictures (in up to 4 sizes each)"] # [serde (rename = "photos")] photos : Vec < Vec < PhotoSize > > } impl UserProfilePhotosBuilder { pub fn new (total_count : i64 , photos : Vec < Vec < PhotoSize > >) -> Self { Self { total_count , photos , } } pub fn set_total_count (mut self , total_count : i64) -> Self { self . total_count = total_count ; self } pub fn set_photos (mut self , photos : Vec < Vec < PhotoSize > >) -> Self { self . photos = photos ; self } pub fn build (self) -> UserProfilePhotos { UserProfilePhotos { total_count : self . total_count , photos : self . photos } } } # [doc = "Represents a location on a map. By default, the location will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the location.Note: This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them."] # [derive (Serialize , Deserialize , Debug)] pub struct InlineQueryResultLocation { # [doc = "Type of the result, must be location"] # [serde (rename = "type")] tg_type : String , # [doc = "Unique identifier for this result, 1-64 Bytes"] # [serde (rename = "id")] id : String , # [doc = "Location latitude in degrees"] # [serde (rename = "latitude")] latitude : f64 , # [doc = "Location longitude in degrees"] # [serde (rename = "longitude")] longitude : f64 , # [doc = "Location title"] # [serde (rename = "title")] title : String , # [doc = "Optional. The radius of uncertainty for the location, measured in meters; 0-1500"] # [serde (skip_serializing_if = "Option::is_none" , rename = "horizontal_accuracy")] horizontal_accuracy : Option < f64 > , # [doc = "Optional. Period in seconds for which the location can be updated, should be between 60 and 86400."] # [serde (skip_serializing_if = "Option::is_none" , rename = "live_period")] live_period : Option < i64 > , # [doc = "Optional. For live locations, a direction in which the user is moving, in degrees. Must be between 1 and 360 if specified."] # [serde (skip_serializing_if = "Option::is_none" , rename = "heading")] heading : Option < i64 > , # [doc = "Optional. For live locations, a maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified."] # [serde (skip_serializing_if = "Option::is_none" , rename = "proximity_alert_radius")] proximity_alert_radius : Option < i64 > , # [doc = "Optional. Inline keyboard attached to the message"] # [serde (skip_serializing_if = "Option::is_none" , rename = "reply_markup")] reply_markup : Option < InlineKeyboardMarkup > , # [doc = "Optional. Content of the message to be sent instead of the location"] # [serde (skip_serializing_if = "Option::is_none" , rename = "input_message_content")] input_message_content : Option < InputMessageContent > , # [doc = "Optional. Url of the thumbnail for the result"] # [serde (skip_serializing_if = "Option::is_none" , rename = "thumb_url")] thumb_url : Option < String > , # [doc = "Optional. Thumbnail width"] # [serde (skip_serializing_if = "Option::is_none" , rename = "thumb_width")] thumb_width : Option < i64 > , # [doc = "Optional. Thumbnail height"] # [serde (skip_serializing_if = "Option::is_none" , rename = "thumb_height")] thumb_height : Option < i64 > } # [doc = "Represents a location on a map. By default, the location will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the location.Note: This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them."] # [derive (Serialize , Deserialize , Debug)] pub struct InlineQueryResultLocationBuilder { # [doc = "Type of the result, must be location"] # [serde (rename = "type")] tg_type : String , # [doc = "Unique identifier for this result, 1-64 Bytes"] # [serde (rename = "id")] id : String , # [doc = "Location latitude in degrees"] # [serde (rename = "latitude")] latitude : f64 , # [doc = "Location longitude in degrees"] # [serde (rename = "longitude")] longitude : f64 , # [doc = "Location title"] # [serde (rename = "title")] title : String , # [doc = "Optional. The radius of uncertainty for the location, measured in meters; 0-1500"] # [serde (skip_serializing_if = "Option::is_none" , rename = "horizontal_accuracy")] horizontal_accuracy : Option < f64 > , # [doc = "Optional. Period in seconds for which the location can be updated, should be between 60 and 86400."] # [serde (skip_serializing_if = "Option::is_none" , rename = "live_period")] live_period : Option < i64 > , # [doc = "Optional. For live locations, a direction in which the user is moving, in degrees. Must be between 1 and 360 if specified."] # [serde (skip_serializing_if = "Option::is_none" , rename = "heading")] heading : Option < i64 > , # [doc = "Optional. For live locations, a maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified."] # [serde (skip_serializing_if = "Option::is_none" , rename = "proximity_alert_radius")] proximity_alert_radius : Option < i64 > , # [doc = "Optional. Inline keyboard attached to the message"] # [serde (skip_serializing_if = "Option::is_none" , rename = "reply_markup")] reply_markup : Option < InlineKeyboardMarkup > , # [doc = "Optional. Content of the message to be sent instead of the location"] # [serde (skip_serializing_if = "Option::is_none" , rename = "input_message_content")] input_message_content : Option < InputMessageContent > , # [doc = "Optional. Url of the thumbnail for the result"] # [serde (skip_serializing_if = "Option::is_none" , rename = "thumb_url")] thumb_url : Option < String > , # [doc = "Optional. Thumbnail width"] # [serde (skip_serializing_if = "Option::is_none" , rename = "thumb_width")] thumb_width : Option < i64 > , # [doc = "Optional. Thumbnail height"] # [serde (skip_serializing_if = "Option::is_none" , rename = "thumb_height")] thumb_height : Option < i64 > } impl InlineQueryResultLocationBuilder { pub fn new (id : String , latitude : f64 , longitude : f64 , title : String) -> Self { Self { tg_type : "location" . to_owned () , id , latitude , longitude , title , horizontal_accuracy : None , live_period : None , heading : None , proximity_alert_radius : None , reply_markup : None , input_message_content : None , thumb_url : None , thumb_width : None , thumb_height : None } } pub fn set_type (mut self , tg_type : String) -> Self { self . tg_type = tg_type ; self } pub fn set_id (mut self , id : String) -> Self { self . id = id ; self } pub fn set_latitude (mut self , latitude : f64) -> Self { self . latitude = latitude ; self } pub fn set_longitude (mut self , longitude : f64) -> Self { self . longitude = longitude ; self } pub fn set_title (mut self , title : String) -> Self { self . title = title ; self } pub fn set_horizontal_accuracy (mut self , horizontal_accuracy : Option < f64 >) -> Self { self . horizontal_accuracy = horizontal_accuracy ; self } pub fn set_live_period (mut self , live_period : Option < i64 >) -> Self { self . live_period = live_period ; self } pub fn set_heading (mut self , heading : Option < i64 >) -> Self { self . heading = heading ; self } pub fn set_proximity_alert_radius (mut self , proximity_alert_radius : Option < i64 >) -> Self { self . proximity_alert_radius = proximity_alert_radius ; self } pub fn set_reply_markup (mut self , reply_markup : Option < InlineKeyboardMarkup >) -> Self { self . reply_markup = reply_markup ; self } pub fn set_input_message_content (mut self , input_message_content : Option < InputMessageContent >) -> Self { self . input_message_content = input_message_content ; self } pub fn set_thumb_url (mut self , thumb_url : Option < String >) -> Self { self . thumb_url = thumb_url ; self } pub fn set_thumb_width (mut self , thumb_width : Option < i64 >) -> Self { self . thumb_width = thumb_width ; self } pub fn set_thumb_height (mut self , thumb_height : Option < i64 >) -> Self { self . thumb_height = thumb_height ; self } pub fn build (self) -> InlineQueryResultLocation { InlineQueryResultLocation { tg_type : self . tg_type , id : self . id , latitude : self . latitude , longitude : self . longitude , title : self . title , horizontal_accuracy : self . horizontal_accuracy , live_period : self . live_period , heading : self . heading , proximity_alert_radius : self . proximity_alert_radius , reply_markup : self . reply_markup , input_message_content : self . input_message_content , thumb_url : self . thumb_url , thumb_width : self . thumb_width , thumb_height : self . thumb_height } } } # [doc = "This object contains information about one answer option in a poll."] # [derive (Serialize , Deserialize , Debug)] pub struct PollOption { # [doc = "Option text, 1-100 characters"] # [serde (rename = "text")] text : String , # [doc = "Number of users that voted for this option"] # [serde (rename = "voter_count")] voter_count : i64 } # [doc = "This object contains information about one answer option in a poll."] # [derive (Serialize , Deserialize , Debug)] pub struct PollOptionBuilder { # [doc = "Option text, 1-100 characters"] # [serde (rename = "text")] text : String , # [doc = "Number of users that voted for this option"] # [serde (rename = "voter_count")] voter_count : i64 } impl PollOptionBuilder { pub fn new (text : String , voter_count : i64) -> Self { Self { text , voter_count , } } pub fn set_text (mut self , text : String) -> Self { self . text = text ; self } pub fn set_voter_count (mut self , voter_count : i64) -> Self { self . voter_count = voter_count ; self } pub fn build (self) -> PollOption { PollOption { text : self . text , voter_count : self . voter_count } } } # [doc = "This object represents an inline keyboard that appears right next to the message it belongs to.Note: This will only work in Telegram versions released after 9 April, 2016. Older clients will display unsupported message."] # [derive (Serialize , Deserialize , Debug)] pub struct InlineKeyboardMarkup { # [doc = "Array of button rows, each represented by an Array of InlineKeyboardButton objects"] # [serde (rename = "inline_keyboard")] inline_keyboard : Vec < Vec < InlineKeyboardButton > > } # [doc = "This object represents an inline keyboard that appears right next to the message it belongs to.Note: This will only work in Telegram versions released after 9 April, 2016. Older clients will display unsupported message."] # [derive (Serialize , Deserialize , Debug)] pub struct InlineKeyboardMarkupBuilder { # [doc = "Array of button rows, each represented by an Array of InlineKeyboardButton objects"] # [serde (rename = "inline_keyboard")] inline_keyboard : Vec < Vec < InlineKeyboardButton > > } impl InlineKeyboardMarkupBuilder { pub fn new (inline_keyboard : Vec < Vec < InlineKeyboardButton > >) -> Self { Self { inline_keyboard , } } pub fn set_inline_keyboard (mut self , inline_keyboard : Vec < Vec < InlineKeyboardButton > >) -> Self { self . inline_keyboard = inline_keyboard ; self } pub fn build (self) -> InlineKeyboardMarkup { InlineKeyboardMarkup { inline_keyboard : self . inline_keyboard } } } # [doc = "Represents a chat member that owns the chat and has all administrator privileges."] # [derive (Serialize , Deserialize , Debug)] pub struct ChatMemberOwner { # [doc = "The member's status in the chat, always \"creator\""] # [serde (rename = "status")] status : String , # [doc = "Information about the user"] # [serde (rename = "user")] user : User , # [doc = "True, if the user's presence in the chat is hidden"] # [serde (rename = "is_anonymous")] is_anonymous : bool , # [doc = "Optional. Custom title for this user"] # [serde (skip_serializing_if = "Option::is_none" , rename = "custom_title")] custom_title : Option < String > } # [doc = "Represents a chat member that owns the chat and has all administrator privileges."] # [derive (Serialize , Deserialize , Debug)] pub struct ChatMemberOwnerBuilder { # [doc = "The member's status in the chat, always \"creator\""] # [serde (rename = "status")] status : String , # [doc = "Information about the user"] # [serde (rename = "user")] user : User , # [doc = "True, if the user's presence in the chat is hidden"] # [serde (rename = "is_anonymous")] is_anonymous : bool , # [doc = "Optional. Custom title for this user"] # [serde (skip_serializing_if = "Option::is_none" , rename = "custom_title")] custom_title : Option < String > } impl ChatMemberOwnerBuilder { pub fn new (status : String , user : User , is_anonymous : bool) -> Self { Self { status , user , is_anonymous , custom_title : None } } pub fn set_status (mut self , status : String) -> Self { self . status = status ; self } pub fn set_user (mut self , user : User) -> Self { self . user = user ; self } pub fn set_is_anonymous (mut self , is_anonymous : bool) -> Self { self . is_anonymous = is_anonymous ; self } pub fn set_custom_title (mut self , custom_title : Option < String >) -> Self { self . custom_title = custom_title ; self } pub fn build (self) -> ChatMemberOwner { ChatMemberOwner { status : self . status , user : self . user , is_anonymous : self . is_anonymous , custom_title : self . custom_title } } } # [doc = "Describes an inline message sent by a Web App on behalf of a user."] # [derive (Serialize , Deserialize , Debug)] pub struct SentWebAppMessage { # [doc = "Optional. Identifier of the sent inline message. Available only if there is an inline keyboard attached to the message."] # [serde (skip_serializing_if = "Option::is_none" , rename = "inline_message_id")] inline_message_id : Option < String > } # [doc = "Describes an inline message sent by a Web App on behalf of a user."] # [derive (Serialize , Deserialize , Debug)] pub struct SentWebAppMessageBuilder { # [doc = "Optional. Identifier of the sent inline message. Available only if there is an inline keyboard attached to the message."] # [serde (skip_serializing_if = "Option::is_none" , rename = "inline_message_id")] inline_message_id : Option < String > } impl SentWebAppMessageBuilder { pub fn new () -> Self { Self { inline_message_id : None } } pub fn set_inline_message_id (mut self , inline_message_id : Option < String >) -> Self { self . inline_message_id = inline_message_id ; self } pub fn build (self) -> SentWebAppMessage { SentWebAppMessage { inline_message_id : self . inline_message_id } } } # [doc = "This object represents a portion of the price for goods or services."] # [derive (Serialize , Deserialize , Debug)] pub struct LabeledPrice { # [doc = "Portion label"] # [serde (rename = "label")] label : String , # [doc = "Price of the product in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies)."] # [serde (rename = "amount")] amount : i64 } # [doc = "This object represents a portion of the price for goods or services."] # [derive (Serialize , Deserialize , Debug)] pub struct LabeledPriceBuilder { # [doc = "Portion label"] # [serde (rename = "label")] label : String , # [doc = "Price of the product in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies)."] # [serde (rename = "amount")] amount : i64 } impl LabeledPriceBuilder { pub fn new (label : String , amount : i64) -> Self { Self { label , amount , } } pub fn set_label (mut self , label : String) -> Self { self . label = label ; self } pub fn set_amount (mut self , amount : i64) -> Self { self . amount = amount ; self } pub fn build (self) -> LabeledPrice { LabeledPrice { label : self . label , amount : self . amount } } } # [doc = "Represents a photo to be sent."] # [derive (Serialize , Deserialize , Debug)] pub struct InputMediaPhoto { # [doc = "Type of the result, must be photo"] # [serde (rename = "type")] tg_type : String , # [doc = "File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass \"attach://<file_attach_name>\" to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files: https://core.telegram.org/bots/api#sending-files"] # [serde (rename = "media")] media : Option < InputFile > , # [doc = "Optional. Caption of the photo to be sent, 0-1024 characters after entities parsing"] # [serde (skip_serializing_if = "Option::is_none" , rename = "caption")] caption : Option < String > , # [doc = "Optional. Mode for parsing entities in the photo caption. See formatting options for more details."] # [serde (skip_serializing_if = "Option::is_none" , rename = "parse_mode")] parse_mode : Option < String > , # [doc = "Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode"] # [serde (skip_serializing_if = "Option::is_none" , rename = "caption_entities")] caption_entities : Option < Vec < MessageEntity > > } # [doc = "Represents a photo to be sent."] # [derive (Serialize , Deserialize , Debug)] pub struct InputMediaPhotoBuilder { # [doc = "Type of the result, must be photo"] # [serde (rename = "type")] tg_type : String , # [doc = "File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass \"attach://<file_attach_name>\" to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files: https://core.telegram.org/bots/api#sending-files"] # [serde (rename = "media")] media : Option < InputFile > , # [doc = "Optional. Caption of the photo to be sent, 0-1024 characters after entities parsing"] # [serde (skip_serializing_if = "Option::is_none" , rename = "caption")] caption : Option < String > , # [doc = "Optional. Mode for parsing entities in the photo caption. See formatting options for more details."] # [serde (skip_serializing_if = "Option::is_none" , rename = "parse_mode")] parse_mode : Option < String > , # [doc = "Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode"] # [serde (skip_serializing_if = "Option::is_none" , rename = "caption_entities")] caption_entities : Option < Vec < MessageEntity > > } impl InputMediaPhotoBuilder { pub fn new (media : Option < InputFile >) -> Self { Self { tg_type : "photo" . to_owned () , media , caption : None , parse_mode : None , caption_entities : None } } pub fn set_type (mut self , tg_type : String) -> Self { self . tg_type = tg_type ; self } pub fn set_media (mut self , media : Option < InputFile >) -> Self { self . media = media ; self } pub fn set_caption (mut self , caption : Option < String >) -> Self { self . caption = caption ; self } pub fn set_parse_mode (mut self , parse_mode : Option < String >) -> Self { self . parse_mode = parse_mode ; self } pub fn set_caption_entities (mut self , caption_entities : Option < Vec < MessageEntity > >) -> Self { self . caption_entities = caption_entities ; self } pub fn build (self) -> InputMediaPhoto { InputMediaPhoto { tg_type : self . tg_type , media : self . media , caption : self . caption , parse_mode : self . parse_mode , caption_entities : self . caption_entities } } } # [doc = "Represents a link to a voice message stored on the Telegram servers. By default, this voice message will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the voice message.Note: This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them."] # [derive (Serialize , Deserialize , Debug)] pub struct InlineQueryResultCachedVoice { # [doc = "Type of the result, must be voice"] # [serde (rename = "type")] tg_type : String , # [doc = "Unique identifier for this result, 1-64 bytes"] # [serde (rename = "id")] id : String , # [doc = "A valid file identifier for the voice message"] # [serde (rename = "voice_file_id")] voice_file_id : String , # [doc = "Voice message title"] # [serde (rename = "title")] title : String , # [doc = "Optional. Caption, 0-1024 characters after entities parsing"] # [serde (skip_serializing_if = "Option::is_none" , rename = "caption")] caption : Option < String > , # [doc = "Optional. Mode for parsing entities in the voice message caption. See formatting options for more details."] # [serde (skip_serializing_if = "Option::is_none" , rename = "parse_mode")] parse_mode : Option < String > , # [doc = "Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode"] # [serde (skip_serializing_if = "Option::is_none" , rename = "caption_entities")] caption_entities : Option < Vec < MessageEntity > > , # [doc = "Optional. Inline keyboard attached to the message"] # [serde (skip_serializing_if = "Option::is_none" , rename = "reply_markup")] reply_markup : Option < InlineKeyboardMarkup > , # [doc = "Optional. Content of the message to be sent instead of the voice message"] # [serde (skip_serializing_if = "Option::is_none" , rename = "input_message_content")] input_message_content : Option < InputMessageContent > } # [doc = "Represents a link to a voice message stored on the Telegram servers. By default, this voice message will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the voice message.Note: This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them."] # [derive (Serialize , Deserialize , Debug)] pub struct InlineQueryResultCachedVoiceBuilder { # [doc = "Type of the result, must be voice"] # [serde (rename = "type")] tg_type : String , # [doc = "Unique identifier for this result, 1-64 bytes"] # [serde (rename = "id")] id : String , # [doc = "A valid file identifier for the voice message"] # [serde (rename = "voice_file_id")] voice_file_id : String , # [doc = "Voice message title"] # [serde (rename = "title")] title : String , # [doc = "Optional. Caption, 0-1024 characters after entities parsing"] # [serde (skip_serializing_if = "Option::is_none" , rename = "caption")] caption : Option < String > , # [doc = "Optional. Mode for parsing entities in the voice message caption. See formatting options for more details."] # [serde (skip_serializing_if = "Option::is_none" , rename = "parse_mode")] parse_mode : Option < String > , # [doc = "Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode"] # [serde (skip_serializing_if = "Option::is_none" , rename = "caption_entities")] caption_entities : Option < Vec < MessageEntity > > , # [doc = "Optional. Inline keyboard attached to the message"] # [serde (skip_serializing_if = "Option::is_none" , rename = "reply_markup")] reply_markup : Option < InlineKeyboardMarkup > , # [doc = "Optional. Content of the message to be sent instead of the voice message"] # [serde (skip_serializing_if = "Option::is_none" , rename = "input_message_content")] input_message_content : Option < InputMessageContent > } impl InlineQueryResultCachedVoiceBuilder { pub fn new (id : String , voice_file_id : String , title : String) -> Self { Self { tg_type : "voice" . to_owned () , id , voice_file_id , title , caption : None , parse_mode : None , caption_entities : None , reply_markup : None , input_message_content : None } } pub fn set_type (mut self , tg_type : String) -> Self { self . tg_type = tg_type ; self } pub fn set_id (mut self , id : String) -> Self { self . id = id ; self } pub fn set_voice_file_id (mut self , voice_file_id : String) -> Self { self . voice_file_id = voice_file_id ; self } pub fn set_title (mut self , title : String) -> Self { self . title = title ; self } pub fn set_caption (mut self , caption : Option < String >) -> Self { self . caption = caption ; self } pub fn set_parse_mode (mut self , parse_mode : Option < String >) -> Self { self . parse_mode = parse_mode ; self } pub fn set_caption_entities (mut self , caption_entities : Option < Vec < MessageEntity > >) -> Self { self . caption_entities = caption_entities ; self } pub fn set_reply_markup (mut self , reply_markup : Option < InlineKeyboardMarkup >) -> Self { self . reply_markup = reply_markup ; self } pub fn set_input_message_content (mut self , input_message_content : Option < InputMessageContent >) -> Self { self . input_message_content = input_message_content ; self } pub fn build (self) -> InlineQueryResultCachedVoice { InlineQueryResultCachedVoice { tg_type : self . tg_type , id : self . id , voice_file_id : self . voice_file_id , title : self . title , caption : self . caption , parse_mode : self . parse_mode , caption_entities : self . caption_entities , reply_markup : self . reply_markup , input_message_content : self . input_message_content } } } # [doc = "This object represents a venue."] # [derive (Serialize , Deserialize , Debug)] pub struct Venue { # [doc = "Venue location. Can't be a live location"] # [serde (rename = "location")] location : Location , # [doc = "Name of the venue"] # [serde (rename = "title")] title : String , # [doc = "Address of the venue"] # [serde (rename = "address")] address : String , # [doc = "Optional. Foursquare identifier of the venue"] # [serde (skip_serializing_if = "Option::is_none" , rename = "foursquare_id")] foursquare_id : Option < String > , # [doc = "Optional. Foursquare type of the venue. (For example, \"arts_entertainment/default\", \"arts_entertainment/aquarium\" or \"food/icecream\".)"] # [serde (skip_serializing_if = "Option::is_none" , rename = "foursquare_type")] foursquare_type : Option < String > , # [doc = "Optional. Google Places identifier of the venue"] # [serde (skip_serializing_if = "Option::is_none" , rename = "google_place_id")] google_place_id : Option < String > , # [doc = "Optional. Google Places type of the venue. (See supported types.)"] # [serde (skip_serializing_if = "Option::is_none" , rename = "google_place_type")] google_place_type : Option < String > } # [doc = "This object represents a venue."] # [derive (Serialize , Deserialize , Debug)] pub struct VenueBuilder { # [doc = "Venue location. Can't be a live location"] # [serde (rename = "location")] location : Location , # [doc = "Name of the venue"] # [serde (rename = "title")] title : String , # [doc = "Address of the venue"] # [serde (rename = "address")] address : String , # [doc = "Optional. Foursquare identifier of the venue"] # [serde (skip_serializing_if = "Option::is_none" , rename = "foursquare_id")] foursquare_id : Option < String > , # [doc = "Optional. Foursquare type of the venue. (For example, \"arts_entertainment/default\", \"arts_entertainment/aquarium\" or \"food/icecream\".)"] # [serde (skip_serializing_if = "Option::is_none" , rename = "foursquare_type")] foursquare_type : Option < String > , # [doc = "Optional. Google Places identifier of the venue"] # [serde (skip_serializing_if = "Option::is_none" , rename = "google_place_id")] google_place_id : Option < String > , # [doc = "Optional. Google Places type of the venue. (See supported types.)"] # [serde (skip_serializing_if = "Option::is_none" , rename = "google_place_type")] google_place_type : Option < String > } impl VenueBuilder { pub fn new (location : Location , title : String , address : String) -> Self { Self { location , title , address , foursquare_id : None , foursquare_type : None , google_place_id : None , google_place_type : None } } pub fn set_location (mut self , location : Location) -> Self { self . location = location ; self } pub fn set_title (mut self , title : String) -> Self { self . title = title ; self } pub fn set_address (mut self , address : String) -> Self { self . address = address ; self } pub fn set_foursquare_id (mut self , foursquare_id : Option < String >) -> Self { self . foursquare_id = foursquare_id ; self } pub fn set_foursquare_type (mut self , foursquare_type : Option < String >) -> Self { self . foursquare_type = foursquare_type ; self } pub fn set_google_place_id (mut self , google_place_id : Option < String >) -> Self { self . google_place_id = google_place_id ; self } pub fn set_google_place_type (mut self , google_place_type : Option < String >) -> Self { self . google_place_type = google_place_type ; self } pub fn build (self) -> Venue { Venue { location : self . location , title : self . title , address : self . address , foursquare_id : self . foursquare_id , foursquare_type : self . foursquare_type , google_place_id : self . google_place_id , google_place_type : self . google_place_type } } } # [doc = "This object represents one button of the reply keyboard. For simple text buttons String can be used instead of this object to specify text of the button. Optional fields web_app, request_contact, request_location, and request_poll are mutually exclusive.Note: request_contact and request_location options will only work in Telegram versions released after 9 April, 2016. Older clients will display unsupported message.Note: request_poll option will only work in Telegram versions released after 23 January, 2020. Older clients will display unsupported message.Note: web_app option will only work in Telegram versions released after 16 April, 2022. Older clients will display unsupported message."] # [derive (Serialize , Deserialize , Debug)] pub struct KeyboardButton { # [doc = "Text of the button. If none of the optional fields are used, it will be sent as a message when the button is pressed"] # [serde (rename = "text")] text : String , # [doc = "Optional. If True, the user's phone number will be sent as a contact when the button is pressed. Available in private chats only."] # [serde (skip_serializing_if = "Option::is_none" , rename = "request_contact")] request_contact : Option < bool > , # [doc = "Optional. If True, the user's current location will be sent when the button is pressed. Available in private chats only."] # [serde (skip_serializing_if = "Option::is_none" , rename = "request_location")] request_location : Option < bool > , # [doc = "Optional. If specified, the user will be asked to create a poll and send it to the bot when the button is pressed. Available in private chats only."] # [serde (skip_serializing_if = "Option::is_none" , rename = "request_poll")] request_poll : Option < KeyboardButtonPollType > , # [doc = "Optional. If specified, the described Web App will be launched when the button is pressed. The Web App will be able to send a \"web_app_data\" service message. Available in private chats only."] # [serde (skip_serializing_if = "Option::is_none" , rename = "web_app")] web_app : Option < WebAppInfo > } # [doc = "This object represents one button of the reply keyboard. For simple text buttons String can be used instead of this object to specify text of the button. Optional fields web_app, request_contact, request_location, and request_poll are mutually exclusive.Note: request_contact and request_location options will only work in Telegram versions released after 9 April, 2016. Older clients will display unsupported message.Note: request_poll option will only work in Telegram versions released after 23 January, 2020. Older clients will display unsupported message.Note: web_app option will only work in Telegram versions released after 16 April, 2022. Older clients will display unsupported message."] # [derive (Serialize , Deserialize , Debug)] pub struct KeyboardButtonBuilder { # [doc = "Text of the button. If none of the optional fields are used, it will be sent as a message when the button is pressed"] # [serde (rename = "text")] text : String , # [doc = "Optional. If True, the user's phone number will be sent as a contact when the button is pressed. Available in private chats only."] # [serde (skip_serializing_if = "Option::is_none" , rename = "request_contact")] request_contact : Option < bool > , # [doc = "Optional. If True, the user's current location will be sent when the button is pressed. Available in private chats only."] # [serde (skip_serializing_if = "Option::is_none" , rename = "request_location")] request_location : Option < bool > , # [doc = "Optional. If specified, the user will be asked to create a poll and send it to the bot when the button is pressed. Available in private chats only."] # [serde (skip_serializing_if = "Option::is_none" , rename = "request_poll")] request_poll : Option < KeyboardButtonPollType > , # [doc = "Optional. If specified, the described Web App will be launched when the button is pressed. The Web App will be able to send a \"web_app_data\" service message. Available in private chats only."] # [serde (skip_serializing_if = "Option::is_none" , rename = "web_app")] web_app : Option < WebAppInfo > } impl KeyboardButtonBuilder { pub fn new (text : String) -> Self { Self { text , request_contact : None , request_location : None , request_poll : None , web_app : None } } pub fn set_text (mut self , text : String) -> Self { self . text = text ; self } pub fn set_request_contact (mut self , request_contact : Option < bool >) -> Self { self . request_contact = request_contact ; self } pub fn set_request_location (mut self , request_location : Option < bool >) -> Self { self . request_location = request_location ; self } pub fn set_request_poll (mut self , request_poll : Option < KeyboardButtonPollType >) -> Self { self . request_poll = request_poll ; self } pub fn set_web_app (mut self , web_app : Option < WebAppInfo >) -> Self { self . web_app = web_app ; self } pub fn build (self) -> KeyboardButton { KeyboardButton { text : self . text , request_contact : self . request_contact , request_location : self . request_location , request_poll : self . request_poll , web_app : self . web_app } } } # [doc = "Represents a video to be sent."] # [derive (Serialize , Deserialize , Debug)] pub struct InputMediaVideo { # [doc = "Type of the result, must be video"] # [serde (rename = "type")] tg_type : String , # [doc = "File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass \"attach://<file_attach_name>\" to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files: https://core.telegram.org/bots/api#sending-files"] # [serde (rename = "media")] media : Option < InputFile > , # [doc = "Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass \"attach://<file_attach_name>\" if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files: https://core.telegram.org/bots/api#sending-files"] # [serde (skip_serializing_if = "Option::is_none" , rename = "thumb")] thumb : Option < InputFile > , # [doc = "Optional. Caption of the video to be sent, 0-1024 characters after entities parsing"] # [serde (skip_serializing_if = "Option::is_none" , rename = "caption")] caption : Option < String > , # [doc = "Optional. Mode for parsing entities in the video caption. See formatting options for more details."] # [serde (skip_serializing_if = "Option::is_none" , rename = "parse_mode")] parse_mode : Option < String > , # [doc = "Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode"] # [serde (skip_serializing_if = "Option::is_none" , rename = "caption_entities")] caption_entities : Option < Vec < MessageEntity > > , # [doc = "Optional. Video width"] # [serde (skip_serializing_if = "Option::is_none" , rename = "width")] width : Option < i64 > , # [doc = "Optional. Video height"] # [serde (skip_serializing_if = "Option::is_none" , rename = "height")] height : Option < i64 > , # [doc = "Optional. Video duration in seconds"] # [serde (skip_serializing_if = "Option::is_none" , rename = "duration")] duration : Option < i64 > , # [doc = "Optional. Pass True if the uploaded video is suitable for streaming"] # [serde (skip_serializing_if = "Option::is_none" , rename = "supports_streaming")] supports_streaming : Option < bool > } # [doc = "Represents a video to be sent."] # [derive (Serialize , Deserialize , Debug)] pub struct InputMediaVideoBuilder { # [doc = "Type of the result, must be video"] # [serde (rename = "type")] tg_type : String , # [doc = "File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass \"attach://<file_attach_name>\" to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files: https://core.telegram.org/bots/api#sending-files"] # [serde (rename = "media")] media : Option < InputFile > , # [doc = "Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass \"attach://<file_attach_name>\" if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files: https://core.telegram.org/bots/api#sending-files"] # [serde (skip_serializing_if = "Option::is_none" , rename = "thumb")] thumb : Option < InputFile > , # [doc = "Optional. Caption of the video to be sent, 0-1024 characters after entities parsing"] # [serde (skip_serializing_if = "Option::is_none" , rename = "caption")] caption : Option < String > , # [doc = "Optional. Mode for parsing entities in the video caption. See formatting options for more details."] # [serde (skip_serializing_if = "Option::is_none" , rename = "parse_mode")] parse_mode : Option < String > , # [doc = "Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode"] # [serde (skip_serializing_if = "Option::is_none" , rename = "caption_entities")] caption_entities : Option < Vec < MessageEntity > > , # [doc = "Optional. Video width"] # [serde (skip_serializing_if = "Option::is_none" , rename = "width")] width : Option < i64 > , # [doc = "Optional. Video height"] # [serde (skip_serializing_if = "Option::is_none" , rename = "height")] height : Option < i64 > , # [doc = "Optional. Video duration in seconds"] # [serde (skip_serializing_if = "Option::is_none" , rename = "duration")] duration : Option < i64 > , # [doc = "Optional. Pass True if the uploaded video is suitable for streaming"] # [serde (skip_serializing_if = "Option::is_none" , rename = "supports_streaming")] supports_streaming : Option < bool > } impl InputMediaVideoBuilder { pub fn new (media : Option < InputFile >) -> Self { Self { tg_type : "video" . to_owned () , media , thumb : None , caption : None , parse_mode : None , caption_entities : None , width : None , height : None , duration : None , supports_streaming : None } } pub fn set_type (mut self , tg_type : String) -> Self { self . tg_type = tg_type ; self } pub fn set_media (mut self , media : Option < InputFile >) -> Self { self . media = media ; self } pub fn set_thumb (mut self , thumb : Option < InputFile >) -> Self { self . thumb = thumb ; self } pub fn set_caption (mut self , caption : Option < String >) -> Self { self . caption = caption ; self } pub fn set_parse_mode (mut self , parse_mode : Option < String >) -> Self { self . parse_mode = parse_mode ; self } pub fn set_caption_entities (mut self , caption_entities : Option < Vec < MessageEntity > >) -> Self { self . caption_entities = caption_entities ; self } pub fn set_width (mut self , width : Option < i64 >) -> Self { self . width = width ; self } pub fn set_height (mut self , height : Option < i64 >) -> Self { self . height = height ; self } pub fn set_duration (mut self , duration : Option < i64 >) -> Self { self . duration = duration ; self } pub fn set_supports_streaming (mut self , supports_streaming : Option < bool >) -> Self { self . supports_streaming = supports_streaming ; self } pub fn build (self) -> InputMediaVideo { InputMediaVideo { tg_type : self . tg_type , media : self . media , thumb : self . thumb , caption : self . caption , parse_mode : self . parse_mode , caption_entities : self . caption_entities , width : self . width , height : self . height , duration : self . duration , supports_streaming : self . supports_streaming } } } # [allow (dead_code)] impl File { pub fn new (file_id : String , file_unique_id : String) -> Self { Self { file_id , file_unique_id , file_size : None , file_path : None } } # [doc = "Identifier for this file, which can be used to download or reuse the file"] pub fn get_file_id < 'a > (& 'a self) -> & 'a str { self . file_id . as_str () } # [doc = "Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file."] pub fn get_file_unique_id < 'a > (& 'a self) -> & 'a str { self . file_unique_id . as_str () } # [doc = "Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value."] pub fn get_file_size < 'a > (& 'a self) -> Option < i64 > { self . file_size . as_ref () . map (| v | { * v }) } # [doc = "Optional. File path. Use https://api.telegram.org/file/bot<token>/<file_path> to get the file."] pub fn get_file_path < 'a > (& 'a self) -> Option < & 'a str > { self . file_path . as_ref () . map (| v | { v . as_str () }) } } # [allow (dead_code)] impl ForceReply { pub fn new (force_reply : bool) -> Self { Self { force_reply , input_field_placeholder : None , selective : None } } # [doc = "Shows reply interface to the user, as if they manually selected the bot's message and tapped 'Reply'"] pub fn get_force_reply < 'a > (& 'a self) -> bool { self . force_reply } # [doc = "Optional. The placeholder to be shown in the input field when the reply is active; 1-64 characters"] pub fn get_input_field_placeholder < 'a > (& 'a self) -> Option < & 'a str > { self . input_field_placeholder . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Use this parameter if you want to force reply from specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply (has reply_to_message_id), sender of the original message."] pub fn get_selective < 'a > (& 'a self) -> Option < bool > { self . selective . as_ref () . map (| v | { * v }) } } # [allow (dead_code)] impl PassportElementErrorTranslationFile { pub fn new (source : String , file_hash : String , message : String) -> Self { Self { tg_type : "PassportElementErrorTranslationFile" . to_owned () , source , file_hash , message , } } # [doc = "Error source, must be translation_file"] pub fn get_source < 'a > (& 'a self) -> & 'a str { self . source . as_str () } # [doc = "Type of element of the user's Telegram Passport which has the issue, one of \"passport\", \"driver_license\", \"identity_card\", \"internal_passport\", \"utility_bill\", \"bank_statement\", \"rental_agreement\", \"passport_registration\", \"temporary_registration\""] pub fn get_tg_type < 'a > (& 'a self) -> & 'a str { self . tg_type . as_str () } # [doc = "Base64-encoded file hash"] pub fn get_file_hash < 'a > (& 'a self) -> & 'a str { self . file_hash . as_str () } # [doc = "Error message"] pub fn get_message < 'a > (& 'a self) -> & 'a str { self . message . as_str () } } # [allow (dead_code)] impl VideoChatScheduled { pub fn new (start_date : i64) -> Self { Self { start_date , } } # [doc = "Point in time (Unix timestamp) when the video chat is supposed to be started by a chat administrator"] pub fn get_start_date < 'a > (& 'a self) -> i64 { self . start_date } } impl TraitBotCommandScopeDefault for BotCommandScopeDefault { # [doc = "Scope type, must be default"] fn get_tg_type < 'a > (& 'a self) -> & 'a str { self . tg_type . as_str () } } impl TraitBotCommandScopeAllPrivateChats for BotCommandScopeAllPrivateChats { # [doc = "Scope type, must be all_private_chats"] fn get_tg_type < 'a > (& 'a self) -> & 'a str { self . tg_type . as_str () } } impl TraitBotCommandScopeAllGroupChats for BotCommandScopeAllGroupChats { # [doc = "Scope type, must be all_group_chats"] fn get_tg_type < 'a > (& 'a self) -> & 'a str { self . tg_type . as_str () } } impl TraitBotCommandScopeAllChatAdministrators for BotCommandScopeAllChatAdministrators { # [doc = "Scope type, must be all_chat_administrators"] fn get_tg_type < 'a > (& 'a self) -> & 'a str { self . tg_type . as_str () } } impl TraitBotCommandScopeChat for BotCommandScopeChat { # [doc = "Scope type, must be chat"] fn get_tg_type < 'a > (& 'a self) -> & 'a str { self . tg_type . as_str () } # [doc = "Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)"] fn get_chat_id < 'a > (& 'a self) -> i64 { self . chat_id } } impl TraitBotCommandScopeChatAdministrators for BotCommandScopeChatAdministrators { # [doc = "Scope type, must be chat_administrators"] fn get_tg_type < 'a > (& 'a self) -> & 'a str { self . tg_type . as_str () } # [doc = "Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)"] fn get_chat_id < 'a > (& 'a self) -> i64 { self . chat_id } } impl TraitBotCommandScopeChatMember for BotCommandScopeChatMember { # [doc = "Scope type, must be chat_member"] fn get_tg_type < 'a > (& 'a self) -> & 'a str { self . tg_type . as_str () } # [doc = "Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)"] fn get_chat_id < 'a > (& 'a self) -> i64 { self . chat_id } # [doc = "Unique identifier of the target user"] fn get_user_id < 'a > (& 'a self) -> i64 { self . user_id } } # [allow (dead_code)] impl StickerSet { pub fn new (name : String , title : String , sticker_type : String , is_animated : bool , is_video : bool , stickers : Vec < Sticker >) -> Self { Self { name , title , sticker_type , is_animated , is_video , stickers , thumb : None } } # [doc = "Sticker set name"] pub fn get_name < 'a > (& 'a self) -> & 'a str { self . name . as_str () } # [doc = "Sticker set title"] pub fn get_title < 'a > (& 'a self) -> & 'a str { self . title . as_str () } # [doc = "Type of stickers in the set, currently one of \"regular\", \"mask\", \"custom_emoji\""] pub fn get_sticker_type < 'a > (& 'a self) -> & 'a str { self . sticker_type . as_str () } # [doc = "True, if the sticker set contains animated stickers"] pub fn get_is_animated < 'a > (& 'a self) -> bool { self . is_animated } # [doc = "True, if the sticker set contains video stickers"] pub fn get_is_video < 'a > (& 'a self) -> bool { self . is_video } # [doc = "List of all set stickers"] pub fn get_stickers < 'a > (& 'a self) -> & 'a Vec < Sticker > { & self . stickers } # [doc = "Optional. Sticker set thumbnail in the .WEBP, .TGS, or .WEBM format"] pub fn get_thumb < 'a > (& 'a self) -> Option < & 'a PhotoSize > { self . thumb . as_ref () . map (| v | { v }) } } # [allow (dead_code)] impl OrderInfo { pub fn new () -> Self { Self { name : None , phone_number : None , email : None , shipping_address : None } } # [doc = "Optional. User name"] pub fn get_name < 'a > (& 'a self) -> Option < & 'a str > { self . name . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. User's phone number"] pub fn get_phone_number < 'a > (& 'a self) -> Option < & 'a str > { self . phone_number . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. User email"] pub fn get_email < 'a > (& 'a self) -> Option < & 'a str > { self . email . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. User shipping address"] pub fn get_shipping_address < 'a > (& 'a self) -> Option < & 'a ShippingAddress > { self . shipping_address . as_ref () . map (| v | { v }) } } # [allow (dead_code)] impl Dice { pub fn new (emoji : String , value : i64) -> Self { Self { emoji , value , } } # [doc = "Emoji on which the dice throw animation is based"] pub fn get_emoji < 'a > (& 'a self) -> & 'a str { self . emoji . as_str () } # [doc = "Value of the dice, 1-6 for \"🎲\", \"🎯\" and \"🎳\" base emoji, 1-5 for \"🏀\" and \"⚽\" base emoji, 1-64 for \"🎰\" base emoji"] pub fn get_value < 'a > (& 'a self) -> i64 { self . value } } # [allow (dead_code)] impl ChatLocation { pub fn new (location : Location , address : String) -> Self { Self { location , address , } } # [doc = "The location to which the supergroup is connected. Can't be a live location."] pub fn get_location < 'a > (& 'a self) -> & 'a Location { & self . location } # [doc = "Location address; 1-64 characters, as defined by the chat owner"] pub fn get_address < 'a > (& 'a self) -> & 'a str { self . address . as_str () } } # [allow (dead_code)] impl User { pub fn new (id : i64 , is_bot : bool , first_name : String) -> Self { Self { id , is_bot , first_name , last_name : None , username : None , language_code : None , is_premium : None , added_to_attachment_menu : None , can_join_groups : None , can_read_all_group_messages : None , supports_inline_queries : None } } # [doc = "Unique identifier for this user or bot. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier."] pub fn get_id < 'a > (& 'a self) -> i64 { self . id } # [doc = "True, if this user is a bot"] pub fn get_is_bot < 'a > (& 'a self) -> bool { self . is_bot } # [doc = "User's or bot's first name"] pub fn get_first_name < 'a > (& 'a self) -> & 'a str { self . first_name . as_str () } # [doc = "Optional. User's or bot's last name"] pub fn get_last_name < 'a > (& 'a self) -> Option < & 'a str > { self . last_name . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. User's or bot's username"] pub fn get_username < 'a > (& 'a self) -> Option < & 'a str > { self . username . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. IETF language tag of the user's language"] pub fn get_language_code < 'a > (& 'a self) -> Option < & 'a str > { self . language_code . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. True, if this user is a Telegram Premium user"] pub fn get_is_premium < 'a > (& 'a self) -> Option < bool > { self . is_premium . as_ref () . map (| v | { * v }) } # [doc = "Optional. True, if this user added the bot to the attachment menu"] pub fn get_added_to_attachment_menu < 'a > (& 'a self) -> Option < bool > { self . added_to_attachment_menu . as_ref () . map (| v | { * v }) } # [doc = "Optional. True, if the bot can be invited to groups. Returned only in getMe."] pub fn get_can_join_groups < 'a > (& 'a self) -> Option < bool > { self . can_join_groups . as_ref () . map (| v | { * v }) } # [doc = "Optional. True, if privacy mode is disabled for the bot. Returned only in getMe."] pub fn get_can_read_all_group_messages < 'a > (& 'a self) -> Option < bool > { self . can_read_all_group_messages . as_ref () . map (| v | { * v }) } # [doc = "Optional. True, if the bot supports inline queries. Returned only in getMe."] pub fn get_supports_inline_queries < 'a > (& 'a self) -> Option < bool > { self . supports_inline_queries . as_ref () . map (| v | { * v }) } } # [allow (dead_code)] impl Update { pub fn new (update_id : i64) -> Self { Self { update_id , message : None , edited_message : None , channel_post : None , edited_channel_post : None , inline_query : None , chosen_inline_result : None , callback_query : None , shipping_query : None , pre_checkout_query : None , poll : None , poll_answer : None , my_chat_member : None , chat_member : None , chat_join_request : None } } # [doc = "The update's unique identifier. Update identifiers start from a certain positive number and increase sequentially. This ID becomes especially handy if you're using webhooks, since it allows you to ignore repeated updates or to restore the correct update sequence, should they get out of order. If there are no new updates for at least a week, then identifier of the next update will be chosen randomly instead of sequentially."] pub fn get_update_id < 'a > (& 'a self) -> i64 { self . update_id } # [doc = "Optional. New incoming message of any kind - text, photo, sticker, etc."] pub fn get_message < 'a > (& 'a self) -> Option < & 'a Message > { self . message . as_ref () . map (| v | { v . as_ref () }) } # [doc = "Optional. New version of a message that is known to the bot and was edited"] pub fn get_edited_message < 'a > (& 'a self) -> Option < & 'a Message > { self . edited_message . as_ref () . map (| v | { v . as_ref () }) } # [doc = "Optional. New incoming channel post of any kind - text, photo, sticker, etc."] pub fn get_channel_post < 'a > (& 'a self) -> Option < & 'a Message > { self . channel_post . as_ref () . map (| v | { v . as_ref () }) } # [doc = "Optional. New version of a channel post that is known to the bot and was edited"] pub fn get_edited_channel_post < 'a > (& 'a self) -> Option < & 'a Message > { self . edited_channel_post . as_ref () . map (| v | { v . as_ref () }) } # [doc = "Optional. New incoming inline query"] pub fn get_inline_query < 'a > (& 'a self) -> Option < & 'a InlineQuery > { self . inline_query . as_ref () . map (| v | { v }) } # [doc = "Optional. The result of an inline query that was chosen by a user and sent to their chat partner. Please see our documentation on the feedback collecting for details on how to enable these updates for your bot."] pub fn get_chosen_inline_result < 'a > (& 'a self) -> Option < & 'a ChosenInlineResult > { self . chosen_inline_result . as_ref () . map (| v | { v }) } # [doc = "Optional. New incoming callback query"] pub fn get_callback_query < 'a > (& 'a self) -> Option < & 'a CallbackQuery > { self . callback_query . as_ref () . map (| v | { v . as_ref () }) } # [doc = "Optional. New incoming shipping query. Only for invoices with flexible price"] pub fn get_shipping_query < 'a > (& 'a self) -> Option < & 'a ShippingQuery > { self . shipping_query . as_ref () . map (| v | { v }) } # [doc = "Optional. New incoming pre-checkout query. Contains full information about checkout"] pub fn get_pre_checkout_query < 'a > (& 'a self) -> Option < & 'a PreCheckoutQuery > { self . pre_checkout_query . as_ref () . map (| v | { v }) } # [doc = "Optional. New poll state. Bots receive only updates about stopped polls and polls, which are sent by the bot"] pub fn get_poll < 'a > (& 'a self) -> Option < & 'a Poll > { self . poll . as_ref () . map (| v | { v }) } # [doc = "Optional. A user changed their answer in a non-anonymous poll. Bots receive new votes only in polls that were sent by the bot itself."] pub fn get_poll_answer < 'a > (& 'a self) -> Option < & 'a PollAnswer > { self . poll_answer . as_ref () . map (| v | { v }) } # [doc = "Optional. The bot's chat member status was updated in a chat. For private chats, this update is received only when the bot is blocked or unblocked by the user."] pub fn get_my_chat_member < 'a > (& 'a self) -> Option < & 'a ChatMemberUpdated > { self . my_chat_member . as_ref () . map (| v | { v }) } # [doc = "Optional. A chat member's status was updated in a chat. The bot must be an administrator in the chat and must explicitly specify \"chat_member\" in the list of allowed_updates to receive these updates."] pub fn get_chat_member < 'a > (& 'a self) -> Option < & 'a ChatMemberUpdated > { self . chat_member . as_ref () . map (| v | { v }) } # [doc = "Optional. A request to join the chat has been sent. The bot must have the can_invite_users administrator right in the chat to receive these updates."] pub fn get_chat_join_request < 'a > (& 'a self) -> Option < & 'a ChatJoinRequest > { self . chat_join_request . as_ref () . map (| v | { v }) } } # [allow (dead_code)] impl ShippingAddress { pub fn new (country_code : String , state : String , city : String , street_line_1 : String , street_line_2 : String , post_code : String) -> Self { Self { country_code , state , city , street_line_1 , street_line_2 , post_code , } } # [doc = "Two-letter ISO 3166-1 alpha-2 country code"] pub fn get_country_code < 'a > (& 'a self) -> & 'a str { self . country_code . as_str () } # [doc = "State, if applicable"] pub fn get_state < 'a > (& 'a self) -> & 'a str { self . state . as_str () } # [doc = "City"] pub fn get_city < 'a > (& 'a self) -> & 'a str { self . city . as_str () } # [doc = "First line for the address"] pub fn get_street_line_1 < 'a > (& 'a self) -> & 'a str { self . street_line_1 . as_str () } # [doc = "Second line for the address"] pub fn get_street_line_2 < 'a > (& 'a self) -> & 'a str { self . street_line_2 . as_str () } # [doc = "Address post code"] pub fn get_post_code < 'a > (& 'a self) -> & 'a str { self . post_code . as_str () } } # [allow (dead_code)] impl InlineQueryResultCachedPhoto { pub fn new (id : String , photo_file_id : String) -> Self { Self { tg_type : "photo" . to_owned () , id , photo_file_id , title : None , description : None , caption : None , parse_mode : None , caption_entities : None , reply_markup : None , input_message_content : None } } # [doc = "Type of the result, must be photo"] pub fn get_tg_type < 'a > (& 'a self) -> & 'a str { self . tg_type . as_str () } # [doc = "Unique identifier for this result, 1-64 bytes"] pub fn get_id < 'a > (& 'a self) -> & 'a str { self . id . as_str () } # [doc = "A valid file identifier of the photo"] pub fn get_photo_file_id < 'a > (& 'a self) -> & 'a str { self . photo_file_id . as_str () } # [doc = "Optional. Title for the result"] pub fn get_title < 'a > (& 'a self) -> Option < & 'a str > { self . title . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Short description of the result"] pub fn get_description < 'a > (& 'a self) -> Option < & 'a str > { self . description . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Caption of the photo to be sent, 0-1024 characters after entities parsing"] pub fn get_caption < 'a > (& 'a self) -> Option < & 'a str > { self . caption . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Mode for parsing entities in the photo caption. See formatting options for more details."] pub fn get_parse_mode < 'a > (& 'a self) -> Option < & 'a str > { self . parse_mode . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode"] pub fn get_caption_entities < 'a > (& 'a self) -> Option < & 'a Vec < MessageEntity > > { self . caption_entities . as_ref () . map (| v | { v }) } # [doc = "Optional. Inline keyboard attached to the message"] pub fn get_reply_markup < 'a > (& 'a self) -> Option < & 'a InlineKeyboardMarkup > { self . reply_markup . as_ref () . map (| v | { v }) } # [doc = "Optional. Content of the message to be sent instead of the photo"] pub fn get_input_message_content < 'a > (& 'a self) -> Option < & 'a InputMessageContent > { self . input_message_content . as_ref () . map (| v | { v }) } } # [allow (dead_code)] impl ChatPhoto { pub fn new (small_file_id : String , small_file_unique_id : String , big_file_id : String , big_file_unique_id : String) -> Self { Self { small_file_id , small_file_unique_id , big_file_id , big_file_unique_id , } } # [doc = "File identifier of small (160x160) chat photo. This file_id can be used only for photo download and only for as long as the photo is not changed."] pub fn get_small_file_id < 'a > (& 'a self) -> & 'a str { self . small_file_id . as_str () } # [doc = "Unique file identifier of small (160x160) chat photo, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file."] pub fn get_small_file_unique_id < 'a > (& 'a self) -> & 'a str { self . small_file_unique_id . as_str () } # [doc = "File identifier of big (640x640) chat photo. This file_id can be used only for photo download and only for as long as the photo is not changed."] pub fn get_big_file_id < 'a > (& 'a self) -> & 'a str { self . big_file_id . as_str () } # [doc = "Unique file identifier of big (640x640) chat photo, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file."] pub fn get_big_file_unique_id < 'a > (& 'a self) -> & 'a str { self . big_file_unique_id . as_str () } } # [allow (dead_code)] impl InputMediaDocument { pub fn new (media : Option < InputFile >) -> Self { Self { tg_type : "document" . to_owned () , media , thumb : None , caption : None , parse_mode : None , caption_entities : None , disable_content_type_detection : None } } # [doc = "Type of the result, must be document"] pub fn get_tg_type < 'a > (& 'a self) -> & 'a str { self . tg_type . as_str () } # [doc = "File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass \"attach://<file_attach_name>\" to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files: https://core.telegram.org/bots/api#sending-files"] pub fn get_media < 'a > (& 'a self) -> & 'a Option < InputFile > { & self . media } # [doc = "Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass \"attach://<file_attach_name>\" if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files: https://core.telegram.org/bots/api#sending-files"] pub fn get_thumb < 'a > (& 'a self) -> Option < & 'a InputFile > { self . thumb . as_ref () . map (| v | { v }) } # [doc = "Optional. Caption of the document to be sent, 0-1024 characters after entities parsing"] pub fn get_caption < 'a > (& 'a self) -> Option < & 'a str > { self . caption . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Mode for parsing entities in the document caption. See formatting options for more details."] pub fn get_parse_mode < 'a > (& 'a self) -> Option < & 'a str > { self . parse_mode . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode"] pub fn get_caption_entities < 'a > (& 'a self) -> Option < & 'a Vec < MessageEntity > > { self . caption_entities . as_ref () . map (| v | { v }) } # [doc = "Optional. Disables automatic server-side content type detection for files uploaded using multipart/form-data. Always True, if the document is sent as part of an album."] pub fn get_disable_content_type_detection < 'a > (& 'a self) -> Option < bool > { self . disable_content_type_detection . as_ref () . map (| v | { * v }) } fn to_form (self , data : Form) -> Result < (Form , String) > { match self . media { Some (InputFile :: Bytes (FileBytes { name , bytes : Some (bytes) })) => { let attach = format ! ("attach://{}" , name) ; let form = data . part (name , Part :: bytes (bytes)) ; Ok ((form , attach)) } Some (InputFile :: String (name)) => Ok ((data , name)) , _ => Err (anyhow ! ("cry")) , } } } # [allow (dead_code)] impl PhotoSize { pub fn new (file_id : String , file_unique_id : String , width : i64 , height : i64) -> Self { Self { file_id , file_unique_id , width , height , file_size : None } } # [doc = "Identifier for this file, which can be used to download or reuse the file"] pub fn get_file_id < 'a > (& 'a self) -> & 'a str { self . file_id . as_str () } # [doc = "Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file."] pub fn get_file_unique_id < 'a > (& 'a self) -> & 'a str { self . file_unique_id . as_str () } # [doc = "Photo width"] pub fn get_width < 'a > (& 'a self) -> i64 { self . width } # [doc = "Photo height"] pub fn get_height < 'a > (& 'a self) -> i64 { self . height } # [doc = "Optional. File size in bytes"] pub fn get_file_size < 'a > (& 'a self) -> Option < i64 > { self . file_size . as_ref () . map (| v | { * v }) } } # [allow (dead_code)] impl Contact { pub fn new (phone_number : String , first_name : String) -> Self { Self { phone_number , first_name , last_name : None , user_id : None , vcard : None } } # [doc = "Contact's phone number"] pub fn get_phone_number < 'a > (& 'a self) -> & 'a str { self . phone_number . as_str () } # [doc = "Contact's first name"] pub fn get_first_name < 'a > (& 'a self) -> & 'a str { self . first_name . as_str () } # [doc = "Optional. Contact's last name"] pub fn get_last_name < 'a > (& 'a self) -> Option < & 'a str > { self . last_name . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Contact's user identifier in Telegram. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier."] pub fn get_user_id < 'a > (& 'a self) -> Option < i64 > { self . user_id . as_ref () . map (| v | { * v }) } # [doc = "Optional. Additional data about the contact in the form of a vCard"] pub fn get_vcard < 'a > (& 'a self) -> Option < & 'a str > { self . vcard . as_ref () . map (| v | { v . as_str () }) } } impl TraitInputMediaAnimation for InputMediaAnimation { # [doc = "Type of the result, must be animation"] fn get_tg_type < 'a > (& 'a self) -> & 'a str { self . tg_type . as_str () } # [doc = "File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass \"attach://<file_attach_name>\" to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files: https://core.telegram.org/bots/api#sending-files"] fn get_media < 'a > (& 'a self) -> & 'a Option < InputFile > { & self . media } # [doc = "Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass \"attach://<file_attach_name>\" if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files: https://core.telegram.org/bots/api#sending-files"] fn get_thumb < 'a > (& 'a self) -> Option < & 'a InputFile > { self . thumb . as_ref () . map (| v | { v }) } # [doc = "Optional. Caption of the animation to be sent, 0-1024 characters after entities parsing"] fn get_caption < 'a > (& 'a self) -> Option < & 'a str > { self . caption . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Mode for parsing entities in the animation caption. See formatting options for more details."] fn get_parse_mode < 'a > (& 'a self) -> Option < & 'a str > { self . parse_mode . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode"] fn get_caption_entities < 'a > (& 'a self) -> Option < & 'a Vec < MessageEntity > > { self . caption_entities . as_ref () . map (| v | { v }) } # [doc = "Optional. Animation width"] fn get_width < 'a > (& 'a self) -> Option < i64 > { self . width . as_ref () . map (| v | { * v }) } # [doc = "Optional. Animation height"] fn get_height < 'a > (& 'a self) -> Option < i64 > { self . height . as_ref () . map (| v | { * v }) } # [doc = "Optional. Animation duration in seconds"] fn get_duration < 'a > (& 'a self) -> Option < i64 > { self . duration . as_ref () . map (| v | { * v }) } } impl TraitInputMediaDocument for InputMediaDocument { # [doc = "Type of the result, must be document"] fn get_tg_type < 'a > (& 'a self) -> & 'a str { self . tg_type . as_str () } # [doc = "File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass \"attach://<file_attach_name>\" to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files: https://core.telegram.org/bots/api#sending-files"] fn get_media < 'a > (& 'a self) -> & 'a Option < InputFile > { & self . media } # [doc = "Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass \"attach://<file_attach_name>\" if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files: https://core.telegram.org/bots/api#sending-files"] fn get_thumb < 'a > (& 'a self) -> Option < & 'a InputFile > { self . thumb . as_ref () . map (| v | { v }) } # [doc = "Optional. Caption of the document to be sent, 0-1024 characters after entities parsing"] fn get_caption < 'a > (& 'a self) -> Option < & 'a str > { self . caption . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Mode for parsing entities in the document caption. See formatting options for more details."] fn get_parse_mode < 'a > (& 'a self) -> Option < & 'a str > { self . parse_mode . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode"] fn get_caption_entities < 'a > (& 'a self) -> Option < & 'a Vec < MessageEntity > > { self . caption_entities . as_ref () . map (| v | { v }) } # [doc = "Optional. Disables automatic server-side content type detection for files uploaded using multipart/form-data. Always True, if the document is sent as part of an album."] fn get_disable_content_type_detection < 'a > (& 'a self) -> Option < bool > { self . disable_content_type_detection . as_ref () . map (| v | { * v }) } } impl TraitInputMediaAudio for InputMediaAudio { # [doc = "Type of the result, must be audio"] fn get_tg_type < 'a > (& 'a self) -> & 'a str { self . tg_type . as_str () } # [doc = "File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass \"attach://<file_attach_name>\" to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files: https://core.telegram.org/bots/api#sending-files"] fn get_media < 'a > (& 'a self) -> & 'a Option < InputFile > { & self . media } # [doc = "Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass \"attach://<file_attach_name>\" if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files: https://core.telegram.org/bots/api#sending-files"] fn get_thumb < 'a > (& 'a self) -> Option < & 'a InputFile > { self . thumb . as_ref () . map (| v | { v }) } # [doc = "Optional. Caption of the audio to be sent, 0-1024 characters after entities parsing"] fn get_caption < 'a > (& 'a self) -> Option < & 'a str > { self . caption . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Mode for parsing entities in the audio caption. See formatting options for more details."] fn get_parse_mode < 'a > (& 'a self) -> Option < & 'a str > { self . parse_mode . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode"] fn get_caption_entities < 'a > (& 'a self) -> Option < & 'a Vec < MessageEntity > > { self . caption_entities . as_ref () . map (| v | { v }) } # [doc = "Optional. Duration of the audio in seconds"] fn get_duration < 'a > (& 'a self) -> Option < i64 > { self . duration . as_ref () . map (| v | { * v }) } # [doc = "Optional. Performer of the audio"] fn get_performer < 'a > (& 'a self) -> Option < & 'a str > { self . performer . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Title of the audio"] fn get_title < 'a > (& 'a self) -> Option < & 'a str > { self . title . as_ref () . map (| v | { v . as_str () }) } } impl TraitInputMediaPhoto for InputMediaPhoto { # [doc = "Type of the result, must be photo"] fn get_tg_type < 'a > (& 'a self) -> & 'a str { self . tg_type . as_str () } # [doc = "File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass \"attach://<file_attach_name>\" to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files: https://core.telegram.org/bots/api#sending-files"] fn get_media < 'a > (& 'a self) -> & 'a Option < InputFile > { & self . media } # [doc = "Optional. Caption of the photo to be sent, 0-1024 characters after entities parsing"] fn get_caption < 'a > (& 'a self) -> Option < & 'a str > { self . caption . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Mode for parsing entities in the photo caption. See formatting options for more details."] fn get_parse_mode < 'a > (& 'a self) -> Option < & 'a str > { self . parse_mode . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode"] fn get_caption_entities < 'a > (& 'a self) -> Option < & 'a Vec < MessageEntity > > { self . caption_entities . as_ref () . map (| v | { v }) } } impl TraitInputMediaVideo for InputMediaVideo { # [doc = "Type of the result, must be video"] fn get_tg_type < 'a > (& 'a self) -> & 'a str { self . tg_type . as_str () } # [doc = "File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass \"attach://<file_attach_name>\" to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files: https://core.telegram.org/bots/api#sending-files"] fn get_media < 'a > (& 'a self) -> & 'a Option < InputFile > { & self . media } # [doc = "Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass \"attach://<file_attach_name>\" if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files: https://core.telegram.org/bots/api#sending-files"] fn get_thumb < 'a > (& 'a self) -> Option < & 'a InputFile > { self . thumb . as_ref () . map (| v | { v }) } # [doc = "Optional. Caption of the video to be sent, 0-1024 characters after entities parsing"] fn get_caption < 'a > (& 'a self) -> Option < & 'a str > { self . caption . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Mode for parsing entities in the video caption. See formatting options for more details."] fn get_parse_mode < 'a > (& 'a self) -> Option < & 'a str > { self . parse_mode . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode"] fn get_caption_entities < 'a > (& 'a self) -> Option < & 'a Vec < MessageEntity > > { self . caption_entities . as_ref () . map (| v | { v }) } # [doc = "Optional. Video width"] fn get_width < 'a > (& 'a self) -> Option < i64 > { self . width . as_ref () . map (| v | { * v }) } # [doc = "Optional. Video height"] fn get_height < 'a > (& 'a self) -> Option < i64 > { self . height . as_ref () . map (| v | { * v }) } # [doc = "Optional. Video duration in seconds"] fn get_duration < 'a > (& 'a self) -> Option < i64 > { self . duration . as_ref () . map (| v | { * v }) } # [doc = "Optional. Pass True if the uploaded video is suitable for streaming"] fn get_supports_streaming < 'a > (& 'a self) -> Option < bool > { self . supports_streaming . as_ref () . map (| v | { * v }) } } # [allow (dead_code)] impl ChosenInlineResult { pub fn new (result_id : String , from : User , query : String) -> Self { Self { result_id , from , query , location : None , inline_message_id : None } } # [doc = "The unique identifier for the result that was chosen"] pub fn get_result_id < 'a > (& 'a self) -> & 'a str { self . result_id . as_str () } # [doc = "The user that chose the result"] pub fn get_from < 'a > (& 'a self) -> & 'a User { & self . from } # [doc = "Optional. Sender location, only for bots that require user location"] pub fn get_location < 'a > (& 'a self) -> Option < & 'a Location > { self . location . as_ref () . map (| v | { v }) } # [doc = "Optional. Identifier of the sent inline message. Available only if there is an inline keyboard attached to the message. Will be also received in callback queries and can be used to edit the message."] pub fn get_inline_message_id < 'a > (& 'a self) -> Option < & 'a str > { self . inline_message_id . as_ref () . map (| v | { v . as_str () }) } # [doc = "The query that was used to obtain the result"] pub fn get_query < 'a > (& 'a self) -> & 'a str { self . query . as_str () } } # [allow (dead_code)] impl InputContactMessageContent { pub fn new (phone_number : String , first_name : String) -> Self { Self { phone_number , first_name , last_name : None , vcard : None } } # [doc = "Contact's phone number"] pub fn get_phone_number < 'a > (& 'a self) -> & 'a str { self . phone_number . as_str () } # [doc = "Contact's first name"] pub fn get_first_name < 'a > (& 'a self) -> & 'a str { self . first_name . as_str () } # [doc = "Optional. Contact's last name"] pub fn get_last_name < 'a > (& 'a self) -> Option < & 'a str > { self . last_name . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Additional data about the contact in the form of a vCard, 0-2048 bytes"] pub fn get_vcard < 'a > (& 'a self) -> Option < & 'a str > { self . vcard . as_ref () . map (| v | { v . as_str () }) } } # [allow (dead_code)] impl ChatMemberLeft { pub fn new (status : String , user : User) -> Self { Self { status , user , } } # [doc = "The member's status in the chat, always \"left\""] pub fn get_status < 'a > (& 'a self) -> & 'a str { self . status . as_str () } # [doc = "Information about the user"] pub fn get_user < 'a > (& 'a self) -> & 'a User { & self . user } } # [allow (dead_code)] impl Sticker { pub fn new (file_id : String , file_unique_id : String , width : i64 , height : i64 , is_animated : bool , is_video : bool) -> Self { Self { tg_type : "Sticker" . to_owned () , file_id , file_unique_id , width , height , is_animated , is_video , thumb : None , emoji : None , set_name : None , premium_animation : None , mask_position : None , custom_emoji_id : None , file_size : None } } # [doc = "Identifier for this file, which can be used to download or reuse the file"] pub fn get_file_id < 'a > (& 'a self) -> & 'a str { self . file_id . as_str () } # [doc = "Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file."] pub fn get_file_unique_id < 'a > (& 'a self) -> & 'a str { self . file_unique_id . as_str () } # [doc = "Type of the sticker, currently one of \"regular\", \"mask\", \"custom_emoji\". The type of the sticker is independent from its format, which is determined by the fields is_animated and is_video."] pub fn get_tg_type < 'a > (& 'a self) -> & 'a str { self . tg_type . as_str () } # [doc = "Sticker width"] pub fn get_width < 'a > (& 'a self) -> i64 { self . width } # [doc = "Sticker height"] pub fn get_height < 'a > (& 'a self) -> i64 { self . height } # [doc = "True, if the sticker is animated"] pub fn get_is_animated < 'a > (& 'a self) -> bool { self . is_animated } # [doc = "True, if the sticker is a video sticker"] pub fn get_is_video < 'a > (& 'a self) -> bool { self . is_video } # [doc = "Optional. Sticker thumbnail in the .WEBP or .JPG format"] pub fn get_thumb < 'a > (& 'a self) -> Option < & 'a PhotoSize > { self . thumb . as_ref () . map (| v | { v }) } # [doc = "Optional. Emoji associated with the sticker"] pub fn get_emoji < 'a > (& 'a self) -> Option < & 'a str > { self . emoji . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Name of the sticker set to which the sticker belongs"] pub fn get_set_name < 'a > (& 'a self) -> Option < & 'a str > { self . set_name . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. For premium regular stickers, premium animation for the sticker"] pub fn get_premium_animation < 'a > (& 'a self) -> Option < & 'a File > { self . premium_animation . as_ref () . map (| v | { v }) } # [doc = "Optional. For mask stickers, the position where the mask should be placed"] pub fn get_mask_position < 'a > (& 'a self) -> Option < & 'a MaskPosition > { self . mask_position . as_ref () . map (| v | { v }) } # [doc = "Optional. For custom emoji stickers, unique identifier of the custom emoji"] pub fn get_custom_emoji_id < 'a > (& 'a self) -> Option < & 'a str > { self . custom_emoji_id . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. File size in bytes"] pub fn get_file_size < 'a > (& 'a self) -> Option < i64 > { self . file_size . as_ref () . map (| v | { * v }) } } # [allow (dead_code)] impl InlineQueryResultCachedGif { pub fn new (id : String , gif_file_id : String) -> Self { Self { tg_type : "gif" . to_owned () , id , gif_file_id , title : None , caption : None , parse_mode : None , caption_entities : None , reply_markup : None , input_message_content : None } } # [doc = "Type of the result, must be gif"] pub fn get_tg_type < 'a > (& 'a self) -> & 'a str { self . tg_type . as_str () } # [doc = "Unique identifier for this result, 1-64 bytes"] pub fn get_id < 'a > (& 'a self) -> & 'a str { self . id . as_str () } # [doc = "A valid file identifier for the GIF file"] pub fn get_gif_file_id < 'a > (& 'a self) -> & 'a str { self . gif_file_id . as_str () } # [doc = "Optional. Title for the result"] pub fn get_title < 'a > (& 'a self) -> Option < & 'a str > { self . title . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Caption of the GIF file to be sent, 0-1024 characters after entities parsing"] pub fn get_caption < 'a > (& 'a self) -> Option < & 'a str > { self . caption . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Mode for parsing entities in the caption. See formatting options for more details."] pub fn get_parse_mode < 'a > (& 'a self) -> Option < & 'a str > { self . parse_mode . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode"] pub fn get_caption_entities < 'a > (& 'a self) -> Option < & 'a Vec < MessageEntity > > { self . caption_entities . as_ref () . map (| v | { v }) } # [doc = "Optional. Inline keyboard attached to the message"] pub fn get_reply_markup < 'a > (& 'a self) -> Option < & 'a InlineKeyboardMarkup > { self . reply_markup . as_ref () . map (| v | { v }) } # [doc = "Optional. Content of the message to be sent instead of the GIF animation"] pub fn get_input_message_content < 'a > (& 'a self) -> Option < & 'a InputMessageContent > { self . input_message_content . as_ref () . map (| v | { v }) } } # [allow (dead_code)] impl InlineKeyboardButton { pub fn new (text : String) -> Self { Self { text , url : None , callback_data : None , web_app : None , login_url : None , switch_inline_query : None , switch_inline_query_current_chat : None , callback_game : None , pay : None } } # [doc = "Label text on the button"] pub fn get_text < 'a > (& 'a self) -> & 'a str { self . text . as_str () } # [doc = "Optional. HTTP or tg:// URL to be opened when the button is pressed. Links tg://user?id=<user_id> can be used to mention a user by their ID without using a username, if this is allowed by their privacy settings."] pub fn get_url < 'a > (& 'a self) -> Option < & 'a str > { self . url . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Data to be sent in a callback query to the bot when button is pressed, 1-64 bytes"] pub fn get_callback_data < 'a > (& 'a self) -> Option < & 'a str > { self . callback_data . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Description of the Web App that will be launched when the user presses the button. The Web App will be able to send an arbitrary message on behalf of the user using the method answerWebAppQuery. Available only in private chats between a user and the bot."] pub fn get_web_app < 'a > (& 'a self) -> Option < & 'a WebAppInfo > { self . web_app . as_ref () . map (| v | { v }) } # [doc = "Optional. An HTTPS URL used to automatically authorize the user. Can be used as a replacement for the Telegram Login Widget."] pub fn get_login_url < 'a > (& 'a self) -> Option < & 'a LoginUrl > { self . login_url . as_ref () . map (| v | { v }) } # [doc = "Optional. If set, pressing the button will prompt the user to select one of their chats, open that chat and insert the bot's username and the specified inline query in the input field. May be empty, in which case just the bot's username will be inserted. Note: This offers an easy way for users to start using your bot in inline mode when they are currently in a private chat with it. Especially useful when combined with switch_pm... actions - in this case the user will be automatically returned to the chat they switched from, skipping the chat selection screen."] pub fn get_switch_inline_query < 'a > (& 'a self) -> Option < & 'a str > { self . switch_inline_query . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. If set, pressing the button will insert the bot's username and the specified inline query in the current chat's input field. May be empty, in which case only the bot's username will be inserted. This offers a quick way for the user to open your bot in inline mode in the same chat - good for selecting something from multiple options."] pub fn get_switch_inline_query_current_chat < 'a > (& 'a self) -> Option < & 'a str > { self . switch_inline_query_current_chat . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Description of the game that will be launched when the user presses the button. NOTE: This type of button must always be the first button in the first row."] pub fn get_callback_game < 'a > (& 'a self) -> Option < & 'a CallbackGame > { self . callback_game . as_ref () . map (| v | { v }) } # [doc = "Optional. Specify True, to send a Pay button. NOTE: This type of button must always be the first button in the first row and can only be used in invoice messages."] pub fn get_pay < 'a > (& 'a self) -> Option < bool > { self . pay . as_ref () . map (| v | { * v }) } } # [allow (dead_code)] impl InlineQuery { pub fn new (id : String , from : User , query : String , offset : String) -> Self { Self { id , from , query , offset , chat_type : None , location : None } } # [doc = "Unique identifier for this query"] pub fn get_id < 'a > (& 'a self) -> & 'a str { self . id . as_str () } # [doc = "Sender"] pub fn get_from < 'a > (& 'a self) -> & 'a User { & self . from } # [doc = "Text of the query (up to 256 characters)"] pub fn get_query < 'a > (& 'a self) -> & 'a str { self . query . as_str () } # [doc = "Offset of the results to be returned, can be controlled by the bot"] pub fn get_offset < 'a > (& 'a self) -> & 'a str { self . offset . as_str () } # [doc = "Optional. Type of the chat from which the inline query was sent. Can be either \"sender\" for a private chat with the inline query sender, \"private\", \"group\", \"supergroup\", or \"channel\". The chat type should be always known for requests sent from official clients and most third-party clients, unless the request was sent from a secret chat"] pub fn get_chat_type < 'a > (& 'a self) -> Option < & 'a str > { self . chat_type . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Sender location, only for bots that request user location"] pub fn get_location < 'a > (& 'a self) -> Option < & 'a Location > { self . location . as_ref () . map (| v | { v }) } } # [allow (dead_code)] impl MessageId { pub fn new (message_id : i64) -> Self { Self { message_id , } } # [doc = "Unique message identifier"] pub fn get_message_id < 'a > (& 'a self) -> i64 { self . message_id } } # [allow (dead_code)] impl BotCommandScopeChatMember { pub fn new (chat_id : i64 , user_id : i64) -> Self { Self { tg_type : "chat_member" . to_owned () , chat_id , user_id , } } # [doc = "Scope type, must be chat_member"] pub fn get_tg_type < 'a > (& 'a self) -> & 'a str { self . tg_type . as_str () } # [doc = "Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)"] pub fn get_chat_id < 'a > (& 'a self) -> i64 { self . chat_id } # [doc = "Unique identifier of the target user"] pub fn get_user_id < 'a > (& 'a self) -> i64 { self . user_id } } # [allow (dead_code)] impl InputMediaAnimation { pub fn new (media : Option < InputFile >) -> Self { Self { tg_type : "animation" . to_owned () , media , thumb : None , caption : None , parse_mode : None , caption_entities : None , width : None , height : None , duration : None } } # [doc = "Type of the result, must be animation"] pub fn get_tg_type < 'a > (& 'a self) -> & 'a str { self . tg_type . as_str () } # [doc = "File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass \"attach://<file_attach_name>\" to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files: https://core.telegram.org/bots/api#sending-files"] pub fn get_media < 'a > (& 'a self) -> & 'a Option < InputFile > { & self . media } # [doc = "Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass \"attach://<file_attach_name>\" if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files: https://core.telegram.org/bots/api#sending-files"] pub fn get_thumb < 'a > (& 'a self) -> Option < & 'a InputFile > { self . thumb . as_ref () . map (| v | { v }) } # [doc = "Optional. Caption of the animation to be sent, 0-1024 characters after entities parsing"] pub fn get_caption < 'a > (& 'a self) -> Option < & 'a str > { self . caption . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Mode for parsing entities in the animation caption. See formatting options for more details."] pub fn get_parse_mode < 'a > (& 'a self) -> Option < & 'a str > { self . parse_mode . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode"] pub fn get_caption_entities < 'a > (& 'a self) -> Option < & 'a Vec < MessageEntity > > { self . caption_entities . as_ref () . map (| v | { v }) } # [doc = "Optional. Animation width"] pub fn get_width < 'a > (& 'a self) -> Option < i64 > { self . width . as_ref () . map (| v | { * v }) } # [doc = "Optional. Animation height"] pub fn get_height < 'a > (& 'a self) -> Option < i64 > { self . height . as_ref () . map (| v | { * v }) } # [doc = "Optional. Animation duration in seconds"] pub fn get_duration < 'a > (& 'a self) -> Option < i64 > { self . duration . as_ref () . map (| v | { * v }) } fn to_form (self , data : Form) -> Result < (Form , String) > { match self . media { Some (InputFile :: Bytes (FileBytes { name , bytes : Some (bytes) })) => { let attach = format ! ("attach://{}" , name) ; let form = data . part (name , Part :: bytes (bytes)) ; Ok ((form , attach)) } Some (InputFile :: String (name)) => Ok ((data , name)) , _ => Err (anyhow ! ("cry")) , } } } # [allow (dead_code)] impl InlineQueryResultVoice { pub fn new (id : String , voice_url : String , title : String) -> Self { Self { tg_type : "voice" . to_owned () , id , voice_url , title , caption : None , parse_mode : None , caption_entities : None , voice_duration : None , reply_markup : None , input_message_content : None } } # [doc = "Type of the result, must be voice"] pub fn get_tg_type < 'a > (& 'a self) -> & 'a str { self . tg_type . as_str () } # [doc = "Unique identifier for this result, 1-64 bytes"] pub fn get_id < 'a > (& 'a self) -> & 'a str { self . id . as_str () } # [doc = "A valid URL for the voice recording"] pub fn get_voice_url < 'a > (& 'a self) -> & 'a str { self . voice_url . as_str () } # [doc = "Recording title"] pub fn get_title < 'a > (& 'a self) -> & 'a str { self . title . as_str () } # [doc = "Optional. Caption, 0-1024 characters after entities parsing"] pub fn get_caption < 'a > (& 'a self) -> Option < & 'a str > { self . caption . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Mode for parsing entities in the voice message caption. See formatting options for more details."] pub fn get_parse_mode < 'a > (& 'a self) -> Option < & 'a str > { self . parse_mode . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode"] pub fn get_caption_entities < 'a > (& 'a self) -> Option < & 'a Vec < MessageEntity > > { self . caption_entities . as_ref () . map (| v | { v }) } # [doc = "Optional. Recording duration in seconds"] pub fn get_voice_duration < 'a > (& 'a self) -> Option < i64 > { self . voice_duration . as_ref () . map (| v | { * v }) } # [doc = "Optional. Inline keyboard attached to the message"] pub fn get_reply_markup < 'a > (& 'a self) -> Option < & 'a InlineKeyboardMarkup > { self . reply_markup . as_ref () . map (| v | { v }) } # [doc = "Optional. Content of the message to be sent instead of the voice recording"] pub fn get_input_message_content < 'a > (& 'a self) -> Option < & 'a InputMessageContent > { self . input_message_content . as_ref () . map (| v | { v }) } } # [allow (dead_code)] impl InlineQueryResultContact { pub fn new (id : String , phone_number : String , first_name : String) -> Self { Self { tg_type : "contact" . to_owned () , id , phone_number , first_name , last_name : None , vcard : None , reply_markup : None , input_message_content : None , thumb_url : None , thumb_width : None , thumb_height : None } } # [doc = "Type of the result, must be contact"] pub fn get_tg_type < 'a > (& 'a self) -> & 'a str { self . tg_type . as_str () } # [doc = "Unique identifier for this result, 1-64 Bytes"] pub fn get_id < 'a > (& 'a self) -> & 'a str { self . id . as_str () } # [doc = "Contact's phone number"] pub fn get_phone_number < 'a > (& 'a self) -> & 'a str { self . phone_number . as_str () } # [doc = "Contact's first name"] pub fn get_first_name < 'a > (& 'a self) -> & 'a str { self . first_name . as_str () } # [doc = "Optional. Contact's last name"] pub fn get_last_name < 'a > (& 'a self) -> Option < & 'a str > { self . last_name . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Additional data about the contact in the form of a vCard, 0-2048 bytes"] pub fn get_vcard < 'a > (& 'a self) -> Option < & 'a str > { self . vcard . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Inline keyboard attached to the message"] pub fn get_reply_markup < 'a > (& 'a self) -> Option < & 'a InlineKeyboardMarkup > { self . reply_markup . as_ref () . map (| v | { v }) } # [doc = "Optional. Content of the message to be sent instead of the contact"] pub fn get_input_message_content < 'a > (& 'a self) -> Option < & 'a InputMessageContent > { self . input_message_content . as_ref () . map (| v | { v }) } # [doc = "Optional. Url of the thumbnail for the result"] pub fn get_thumb_url < 'a > (& 'a self) -> Option < & 'a str > { self . thumb_url . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Thumbnail width"] pub fn get_thumb_width < 'a > (& 'a self) -> Option < i64 > { self . thumb_width . as_ref () . map (| v | { * v }) } # [doc = "Optional. Thumbnail height"] pub fn get_thumb_height < 'a > (& 'a self) -> Option < i64 > { self . thumb_height . as_ref () . map (| v | { * v }) } } # [allow (dead_code)] impl MaskPosition { pub fn new (point : String , x_shift : f64 , y_shift : f64 , scale : f64) -> Self { Self { point , x_shift , y_shift , scale , } } # [doc = "The part of the face relative to which the mask should be placed. One of \"forehead\", \"eyes\", \"mouth\", or \"chin\"."] pub fn get_point < 'a > (& 'a self) -> & 'a str { self . point . as_str () } # [doc = "Shift by X-axis measured in widths of the mask scaled to the face size, from left to right. For example, choosing -1.0 will place mask just to the left of the default mask position."] pub fn get_x_shift < 'a > (& 'a self) -> f64 { self . x_shift } # [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 fn get_y_shift < 'a > (& 'a self) -> f64 { self . y_shift } # [doc = "Mask scaling coefficient. For example, 2.0 means double size."] pub fn get_scale < 'a > (& 'a self) -> f64 { self . scale } } impl TraitPassportElementErrorDataField for PassportElementErrorDataField { # [doc = "Error source, must be data"] fn get_source < 'a > (& 'a self) -> & 'a str { self . source . as_str () } # [doc = "The section of the user's Telegram Passport which has the error, one of \"personal_details\", \"passport\", \"driver_license\", \"identity_card\", \"internal_passport\", \"address\""] fn get_tg_type < 'a > (& 'a self) -> & 'a str { self . tg_type . as_str () } # [doc = "Name of the data field which has the error"] fn get_field_name < 'a > (& 'a self) -> & 'a str { self . field_name . as_str () } # [doc = "Base64-encoded data hash"] fn get_data_hash < 'a > (& 'a self) -> & 'a str { self . data_hash . as_str () } # [doc = "Error message"] fn get_message < 'a > (& 'a self) -> & 'a str { self . message . as_str () } } impl TraitPassportElementErrorFrontSide for PassportElementErrorFrontSide { # [doc = "Error source, must be front_side"] fn get_source < 'a > (& 'a self) -> & 'a str { self . source . as_str () } # [doc = "The section of the user's Telegram Passport which has the issue, one of \"passport\", \"driver_license\", \"identity_card\", \"internal_passport\""] fn get_tg_type < 'a > (& 'a self) -> & 'a str { self . tg_type . as_str () } # [doc = "Base64-encoded hash of the file with the front side of the document"] fn get_file_hash < 'a > (& 'a self) -> & 'a str { self . file_hash . as_str () } # [doc = "Error message"] fn get_message < 'a > (& 'a self) -> & 'a str { self . message . as_str () } } impl TraitPassportElementErrorReverseSide for PassportElementErrorReverseSide { # [doc = "Error source, must be reverse_side"] fn get_source < 'a > (& 'a self) -> & 'a str { self . source . as_str () } # [doc = "The section of the user's Telegram Passport which has the issue, one of \"driver_license\", \"identity_card\""] fn get_tg_type < 'a > (& 'a self) -> & 'a str { self . tg_type . as_str () } # [doc = "Base64-encoded hash of the file with the reverse side of the document"] fn get_file_hash < 'a > (& 'a self) -> & 'a str { self . file_hash . as_str () } # [doc = "Error message"] fn get_message < 'a > (& 'a self) -> & 'a str { self . message . as_str () } } impl TraitPassportElementErrorSelfie for PassportElementErrorSelfie { # [doc = "Error source, must be selfie"] fn get_source < 'a > (& 'a self) -> & 'a str { self . source . as_str () } # [doc = "The section of the user's Telegram Passport which has the issue, one of \"passport\", \"driver_license\", \"identity_card\", \"internal_passport\""] fn get_tg_type < 'a > (& 'a self) -> & 'a str { self . tg_type . as_str () } # [doc = "Base64-encoded hash of the file with the selfie"] fn get_file_hash < 'a > (& 'a self) -> & 'a str { self . file_hash . as_str () } # [doc = "Error message"] fn get_message < 'a > (& 'a self) -> & 'a str { self . message . as_str () } } impl TraitPassportElementErrorFile for PassportElementErrorFile { # [doc = "Error source, must be file"] fn get_source < 'a > (& 'a self) -> & 'a str { self . source . as_str () } # [doc = "The section of the user's Telegram Passport which has the issue, one of \"utility_bill\", \"bank_statement\", \"rental_agreement\", \"passport_registration\", \"temporary_registration\""] fn get_tg_type < 'a > (& 'a self) -> & 'a str { self . tg_type . as_str () } # [doc = "Base64-encoded file hash"] fn get_file_hash < 'a > (& 'a self) -> & 'a str { self . file_hash . as_str () } # [doc = "Error message"] fn get_message < 'a > (& 'a self) -> & 'a str { self . message . as_str () } } impl TraitPassportElementErrorFiles for PassportElementErrorFiles { # [doc = "Error source, must be files"] fn get_source < 'a > (& 'a self) -> & 'a str { self . source . as_str () } # [doc = "The section of the user's Telegram Passport which has the issue, one of \"utility_bill\", \"bank_statement\", \"rental_agreement\", \"passport_registration\", \"temporary_registration\""] fn get_tg_type < 'a > (& 'a self) -> & 'a str { self . tg_type . as_str () } # [doc = "List of base64-encoded file hashes"] fn get_file_hashes < 'a > (& 'a self) -> & 'a Vec < String > { & self . file_hashes } # [doc = "Error message"] fn get_message < 'a > (& 'a self) -> & 'a str { self . message . as_str () } } impl TraitPassportElementErrorTranslationFile for PassportElementErrorTranslationFile { # [doc = "Error source, must be translation_file"] fn get_source < 'a > (& 'a self) -> & 'a str { self . source . as_str () } # [doc = "Type of element of the user's Telegram Passport which has the issue, one of \"passport\", \"driver_license\", \"identity_card\", \"internal_passport\", \"utility_bill\", \"bank_statement\", \"rental_agreement\", \"passport_registration\", \"temporary_registration\""] fn get_tg_type < 'a > (& 'a self) -> & 'a str { self . tg_type . as_str () } # [doc = "Base64-encoded file hash"] fn get_file_hash < 'a > (& 'a self) -> & 'a str { self . file_hash . as_str () } # [doc = "Error message"] fn get_message < 'a > (& 'a self) -> & 'a str { self . message . as_str () } } impl TraitPassportElementErrorTranslationFiles for PassportElementErrorTranslationFiles { # [doc = "Error source, must be translation_files"] fn get_source < 'a > (& 'a self) -> & 'a str { self . source . as_str () } # [doc = "Type of element of the user's Telegram Passport which has the issue, one of \"passport\", \"driver_license\", \"identity_card\", \"internal_passport\", \"utility_bill\", \"bank_statement\", \"rental_agreement\", \"passport_registration\", \"temporary_registration\""] fn get_tg_type < 'a > (& 'a self) -> & 'a str { self . tg_type . as_str () } # [doc = "List of base64-encoded file hashes"] fn get_file_hashes < 'a > (& 'a self) -> & 'a Vec < String > { & self . file_hashes } # [doc = "Error message"] fn get_message < 'a > (& 'a self) -> & 'a str { self . message . as_str () } } impl TraitPassportElementErrorUnspecified for PassportElementErrorUnspecified { # [doc = "Error source, must be unspecified"] fn get_source < 'a > (& 'a self) -> & 'a str { self . source . as_str () } # [doc = "Type of element of the user's Telegram Passport which has the issue"] fn get_tg_type < 'a > (& 'a self) -> & 'a str { self . tg_type . as_str () } # [doc = "Base64-encoded element hash"] fn get_element_hash < 'a > (& 'a self) -> & 'a str { self . element_hash . as_str () } # [doc = "Error message"] fn get_message < 'a > (& 'a self) -> & 'a str { self . message . as_str () } } # [allow (dead_code)] impl ShippingOption { pub fn new (id : String , title : String , prices : Vec < LabeledPrice >) -> Self { Self { id , title , prices , } } # [doc = "Shipping option identifier"] pub fn get_id < 'a > (& 'a self) -> & 'a str { self . id . as_str () } # [doc = "Option title"] pub fn get_title < 'a > (& 'a self) -> & 'a str { self . title . as_str () } # [doc = "List of price portions"] pub fn get_prices < 'a > (& 'a self) -> & 'a Vec < LabeledPrice > { & self . prices } } # [allow (dead_code)] impl PassportElementErrorReverseSide { pub fn new (source : String , file_hash : String , message : String) -> Self { Self { tg_type : "PassportElementErrorReverseSide" . to_owned () , source , file_hash , message , } } # [doc = "Error source, must be reverse_side"] pub fn get_source < 'a > (& 'a self) -> & 'a str { self . source . as_str () } # [doc = "The section of the user's Telegram Passport which has the issue, one of \"driver_license\", \"identity_card\""] pub fn get_tg_type < 'a > (& 'a self) -> & 'a str { self . tg_type . as_str () } # [doc = "Base64-encoded hash of the file with the reverse side of the document"] pub fn get_file_hash < 'a > (& 'a self) -> & 'a str { self . file_hash . as_str () } # [doc = "Error message"] pub fn get_message < 'a > (& 'a self) -> & 'a str { self . message . as_str () } } # [allow (dead_code)] impl ChatMemberRestricted { pub fn new (status : String , user : User , is_member : bool , can_change_info : bool , can_invite_users : bool , can_pin_messages : bool , can_send_messages : bool , can_send_media_messages : bool , can_send_polls : bool , can_send_other_messages : bool , can_add_web_page_previews : bool , until_date : i64) -> Self { Self { status , user , is_member , can_change_info , can_invite_users , can_pin_messages , can_send_messages , can_send_media_messages , can_send_polls , can_send_other_messages , can_add_web_page_previews , until_date , } } # [doc = "The member's status in the chat, always \"restricted\""] pub fn get_status < 'a > (& 'a self) -> & 'a str { self . status . as_str () } # [doc = "Information about the user"] pub fn get_user < 'a > (& 'a self) -> & 'a User { & self . user } # [doc = "True, if the user is a member of the chat at the moment of the request"] pub fn get_is_member < 'a > (& 'a self) -> bool { self . is_member } # [doc = "True, if the user is allowed to change the chat title, photo and other settings"] pub fn get_can_change_info < 'a > (& 'a self) -> bool { self . can_change_info } # [doc = "True, if the user is allowed to invite new users to the chat"] pub fn get_can_invite_users < 'a > (& 'a self) -> bool { self . can_invite_users } # [doc = "True, if the user is allowed to pin messages"] pub fn get_can_pin_messages < 'a > (& 'a self) -> bool { self . can_pin_messages } # [doc = "True, if the user is allowed to send text messages, contacts, locations and venues"] pub fn get_can_send_messages < 'a > (& 'a self) -> bool { self . can_send_messages } # [doc = "True, if the user is allowed to send audios, documents, photos, videos, video notes and voice notes"] pub fn get_can_send_media_messages < 'a > (& 'a self) -> bool { self . can_send_media_messages } # [doc = "True, if the user is allowed to send polls"] pub fn get_can_send_polls < 'a > (& 'a self) -> bool { self . can_send_polls } # [doc = "True, if the user is allowed to send animations, games, stickers and use inline bots"] pub fn get_can_send_other_messages < 'a > (& 'a self) -> bool { self . can_send_other_messages } # [doc = "True, if the user is allowed to add web page previews to their messages"] pub fn get_can_add_web_page_previews < 'a > (& 'a self) -> bool { self . can_add_web_page_previews } # [doc = "Date when restrictions will be lifted for this user; unix time. If 0, then the user is restricted forever"] pub fn get_until_date < 'a > (& 'a self) -> i64 { self . until_date } } # [allow (dead_code)] impl BotCommandScopeChat { pub fn new (chat_id : i64) -> Self { Self { tg_type : "chat" . to_owned () , chat_id , } } # [doc = "Scope type, must be chat"] pub fn get_tg_type < 'a > (& 'a self) -> & 'a str { self . tg_type . as_str () } # [doc = "Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)"] pub fn get_chat_id < 'a > (& 'a self) -> i64 { self . chat_id } } # [allow (dead_code)] impl PreCheckoutQuery { pub fn new (id : String , from : User , currency : String , total_amount : i64 , invoice_payload : String) -> Self { Self { id , from , currency , total_amount , invoice_payload , shipping_option_id : None , order_info : None } } # [doc = "Unique query identifier"] pub fn get_id < 'a > (& 'a self) -> & 'a str { self . id . as_str () } # [doc = "User who sent the query"] pub fn get_from < 'a > (& 'a self) -> & 'a User { & self . from } # [doc = "Three-letter ISO 4217 currency code"] pub fn get_currency < 'a > (& 'a self) -> & 'a str { self . currency . as_str () } # [doc = "Total price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies)."] pub fn get_total_amount < 'a > (& 'a self) -> i64 { self . total_amount } # [doc = "Bot specified invoice payload"] pub fn get_invoice_payload < 'a > (& 'a self) -> & 'a str { self . invoice_payload . as_str () } # [doc = "Optional. Identifier of the shipping option chosen by the user"] pub fn get_shipping_option_id < 'a > (& 'a self) -> Option < & 'a str > { self . shipping_option_id . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Order information provided by the user"] pub fn get_order_info < 'a > (& 'a self) -> Option < & 'a OrderInfo > { self . order_info . as_ref () . map (| v | { v }) } } # [allow (dead_code)] impl InlineQueryResultPhoto { pub fn new (id : String , photo_url : String , thumb_url : String) -> Self { Self { tg_type : "photo" . to_owned () , id , photo_url , thumb_url , photo_width : None , photo_height : None , title : None , description : None , caption : None , parse_mode : None , caption_entities : None , reply_markup : None , input_message_content : None } } # [doc = "Type of the result, must be photo"] pub fn get_tg_type < 'a > (& 'a self) -> & 'a str { self . tg_type . as_str () } # [doc = "Unique identifier for this result, 1-64 bytes"] pub fn get_id < 'a > (& 'a self) -> & 'a str { self . id . as_str () } # [doc = "A valid URL of the photo. Photo must be in JPEG format. Photo size must not exceed 5MB"] pub fn get_photo_url < 'a > (& 'a self) -> & 'a str { self . photo_url . as_str () } # [doc = "URL of the thumbnail for the photo"] pub fn get_thumb_url < 'a > (& 'a self) -> & 'a str { self . thumb_url . as_str () } # [doc = "Optional. Width of the photo"] pub fn get_photo_width < 'a > (& 'a self) -> Option < i64 > { self . photo_width . as_ref () . map (| v | { * v }) } # [doc = "Optional. Height of the photo"] pub fn get_photo_height < 'a > (& 'a self) -> Option < i64 > { self . photo_height . as_ref () . map (| v | { * v }) } # [doc = "Optional. Title for the result"] pub fn get_title < 'a > (& 'a self) -> Option < & 'a str > { self . title . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Short description of the result"] pub fn get_description < 'a > (& 'a self) -> Option < & 'a str > { self . description . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Caption of the photo to be sent, 0-1024 characters after entities parsing"] pub fn get_caption < 'a > (& 'a self) -> Option < & 'a str > { self . caption . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Mode for parsing entities in the photo caption. See formatting options for more details."] pub fn get_parse_mode < 'a > (& 'a self) -> Option < & 'a str > { self . parse_mode . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode"] pub fn get_caption_entities < 'a > (& 'a self) -> Option < & 'a Vec < MessageEntity > > { self . caption_entities . as_ref () . map (| v | { v }) } # [doc = "Optional. Inline keyboard attached to the message"] pub fn get_reply_markup < 'a > (& 'a self) -> Option < & 'a InlineKeyboardMarkup > { self . reply_markup . as_ref () . map (| v | { v }) } # [doc = "Optional. Content of the message to be sent instead of the photo"] pub fn get_input_message_content < 'a > (& 'a self) -> Option < & 'a InputMessageContent > { self . input_message_content . as_ref () . map (| v | { v }) } } # [allow (dead_code)] impl ChatMemberBanned { pub fn new (status : String , user : User , until_date : i64) -> Self { Self { status , user , until_date , } } # [doc = "The member's status in the chat, always \"kicked\""] pub fn get_status < 'a > (& 'a self) -> & 'a str { self . status . as_str () } # [doc = "Information about the user"] pub fn get_user < 'a > (& 'a self) -> & 'a User { & self . user } # [doc = "Date when restrictions will be lifted for this user; unix time. If 0, then the user is banned forever"] pub fn get_until_date < 'a > (& 'a self) -> i64 { self . until_date } } # [allow (dead_code)] impl PassportElementErrorTranslationFiles { pub fn new (source : String , file_hashes : Vec < String > , message : String) -> Self { Self { tg_type : "PassportElementErrorTranslationFiles" . to_owned () , source , file_hashes , message , } } # [doc = "Error source, must be translation_files"] pub fn get_source < 'a > (& 'a self) -> & 'a str { self . source . as_str () } # [doc = "Type of element of the user's Telegram Passport which has the issue, one of \"passport\", \"driver_license\", \"identity_card\", \"internal_passport\", \"utility_bill\", \"bank_statement\", \"rental_agreement\", \"passport_registration\", \"temporary_registration\""] pub fn get_tg_type < 'a > (& 'a self) -> & 'a str { self . tg_type . as_str () } # [doc = "List of base64-encoded file hashes"] pub fn get_file_hashes < 'a > (& 'a self) -> & 'a Vec < String > { & self . file_hashes } # [doc = "Error message"] pub fn get_message < 'a > (& 'a self) -> & 'a str { self . message . as_str () } } # [allow (dead_code)] impl CallbackGame { } # [allow (dead_code)] impl PollAnswer { pub fn new (poll_id : String , user : User , option_ids : Vec < i64 >) -> Self { Self { poll_id , user , option_ids , } } # [doc = "Unique poll identifier"] pub fn get_poll_id < 'a > (& 'a self) -> & 'a str { self . poll_id . as_str () } # [doc = "The user, who changed the answer to the poll"] pub fn get_user < 'a > (& 'a self) -> & 'a User { & self . user } # [doc = "0-based identifiers of answer options, chosen by the user. May be empty if the user retracted their vote."] pub fn get_option_ids < 'a > (& 'a self) -> & 'a Vec < i64 > { & self . option_ids } } # [allow (dead_code)] impl InlineQueryResultCachedVideo { pub fn new (id : String , video_file_id : String , title : String) -> Self { Self { tg_type : "video" . to_owned () , id , video_file_id , title , description : None , caption : None , parse_mode : None , caption_entities : None , reply_markup : None , input_message_content : None } } # [doc = "Type of the result, must be video"] pub fn get_tg_type < 'a > (& 'a self) -> & 'a str { self . tg_type . as_str () } # [doc = "Unique identifier for this result, 1-64 bytes"] pub fn get_id < 'a > (& 'a self) -> & 'a str { self . id . as_str () } # [doc = "A valid file identifier for the video file"] pub fn get_video_file_id < 'a > (& 'a self) -> & 'a str { self . video_file_id . as_str () } # [doc = "Title for the result"] pub fn get_title < 'a > (& 'a self) -> & 'a str { self . title . as_str () } # [doc = "Optional. Short description of the result"] pub fn get_description < 'a > (& 'a self) -> Option < & 'a str > { self . description . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Caption of the video to be sent, 0-1024 characters after entities parsing"] pub fn get_caption < 'a > (& 'a self) -> Option < & 'a str > { self . caption . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Mode for parsing entities in the video caption. See formatting options for more details."] pub fn get_parse_mode < 'a > (& 'a self) -> Option < & 'a str > { self . parse_mode . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode"] pub fn get_caption_entities < 'a > (& 'a self) -> Option < & 'a Vec < MessageEntity > > { self . caption_entities . as_ref () . map (| v | { v }) } # [doc = "Optional. Inline keyboard attached to the message"] pub fn get_reply_markup < 'a > (& 'a self) -> Option < & 'a InlineKeyboardMarkup > { self . reply_markup . as_ref () . map (| v | { v }) } # [doc = "Optional. Content of the message to be sent instead of the video"] pub fn get_input_message_content < 'a > (& 'a self) -> Option < & 'a InputMessageContent > { self . input_message_content . as_ref () . map (| v | { v }) } } # [allow (dead_code)] impl WebAppData { pub fn new (data : String , button_text : String) -> Self { Self { data , button_text , } } # [doc = "The data. Be aware that a bad client can send arbitrary data in this field."] pub fn get_data < 'a > (& 'a self) -> & 'a str { self . data . as_str () } # [doc = "Text of the web_app keyboard button from which the Web App was opened. Be aware that a bad client can send arbitrary data in this field."] pub fn get_button_text < 'a > (& 'a self) -> & 'a str { self . button_text . as_str () } } # [allow (dead_code)] impl ChatMemberAdministrator { pub fn new (status : String , user : User , can_be_edited : bool , is_anonymous : bool , can_manage_chat : bool , can_delete_messages : bool , can_manage_video_chats : bool , can_restrict_members : bool , can_promote_members : bool , can_change_info : bool , can_invite_users : bool) -> Self { Self { status , user , can_be_edited , is_anonymous , can_manage_chat , can_delete_messages , can_manage_video_chats , can_restrict_members , can_promote_members , can_change_info , can_invite_users , can_post_messages : None , can_edit_messages : None , can_pin_messages : None , custom_title : None } } # [doc = "The member's status in the chat, always \"administrator\""] pub fn get_status < 'a > (& 'a self) -> & 'a str { self . status . as_str () } # [doc = "Information about the user"] pub fn get_user < 'a > (& 'a self) -> & 'a User { & self . user } # [doc = "True, if the bot is allowed to edit administrator privileges of that user"] pub fn get_can_be_edited < 'a > (& 'a self) -> bool { self . can_be_edited } # [doc = "True, if the user's presence in the chat is hidden"] pub fn get_is_anonymous < 'a > (& 'a self) -> bool { self . is_anonymous } # [doc = "True, if the administrator can access the chat event log, chat statistics, message statistics in channels, see channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other administrator privilege"] pub fn get_can_manage_chat < 'a > (& 'a self) -> bool { self . can_manage_chat } # [doc = "True, if the administrator can delete messages of other users"] pub fn get_can_delete_messages < 'a > (& 'a self) -> bool { self . can_delete_messages } # [doc = "True, if the administrator can manage video chats"] pub fn get_can_manage_video_chats < 'a > (& 'a self) -> bool { self . can_manage_video_chats } # [doc = "True, if the administrator can restrict, ban or unban chat members"] pub fn get_can_restrict_members < 'a > (& 'a self) -> bool { self . can_restrict_members } # [doc = "True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by the user)"] pub fn get_can_promote_members < 'a > (& 'a self) -> bool { self . can_promote_members } # [doc = "True, if the user is allowed to change the chat title, photo and other settings"] pub fn get_can_change_info < 'a > (& 'a self) -> bool { self . can_change_info } # [doc = "True, if the user is allowed to invite new users to the chat"] pub fn get_can_invite_users < 'a > (& 'a self) -> bool { self . can_invite_users } # [doc = "Optional. True, if the administrator can post in the channel; channels only"] pub fn get_can_post_messages < 'a > (& 'a self) -> Option < bool > { self . can_post_messages . as_ref () . map (| v | { * v }) } # [doc = "Optional. True, if the administrator can edit messages of other users and can pin messages; channels only"] pub fn get_can_edit_messages < 'a > (& 'a self) -> Option < bool > { self . can_edit_messages . as_ref () . map (| v | { * v }) } # [doc = "Optional. True, if the user is allowed to pin messages; groups and supergroups only"] pub fn get_can_pin_messages < 'a > (& 'a self) -> Option < bool > { self . can_pin_messages . as_ref () . map (| v | { * v }) } # [doc = "Optional. Custom title for this user"] pub fn get_custom_title < 'a > (& 'a self) -> Option < & 'a str > { self . custom_title . as_ref () . map (| v | { v . as_str () }) } } # [allow (dead_code)] impl PassportElementErrorUnspecified { pub fn new (source : String , element_hash : String , message : String) -> Self { Self { tg_type : "PassportElementErrorUnspecified" . to_owned () , source , element_hash , message , } } # [doc = "Error source, must be unspecified"] pub fn get_source < 'a > (& 'a self) -> & 'a str { self . source . as_str () } # [doc = "Type of element of the user's Telegram Passport which has the issue"] pub fn get_tg_type < 'a > (& 'a self) -> & 'a str { self . tg_type . as_str () } # [doc = "Base64-encoded element hash"] pub fn get_element_hash < 'a > (& 'a self) -> & 'a str { self . element_hash . as_str () } # [doc = "Error message"] pub fn get_message < 'a > (& 'a self) -> & 'a str { self . message . as_str () } } # [allow (dead_code)] impl InputInvoiceMessageContent { pub fn new (title : String , description : String , payload : String , provider_token : String , currency : String , prices : Vec < LabeledPrice >) -> Self { Self { title , description , payload , provider_token , currency , prices , max_tip_amount : None , suggested_tip_amounts : None , provider_data : None , photo_url : None , photo_size : None , photo_width : None , photo_height : None , need_name : None , need_phone_number : None , need_email : None , need_shipping_address : None , send_phone_number_to_provider : None , send_email_to_provider : None , is_flexible : None } } # [doc = "Product name, 1-32 characters"] pub fn get_title < 'a > (& 'a self) -> & 'a str { self . title . as_str () } # [doc = "Product description, 1-255 characters"] pub fn get_description < 'a > (& 'a self) -> & 'a str { self . description . as_str () } # [doc = "Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes."] pub fn get_payload < 'a > (& 'a self) -> & 'a str { self . payload . as_str () } # [doc = "Payment provider token, obtained via @BotFather"] pub fn get_provider_token < 'a > (& 'a self) -> & 'a str { self . provider_token . as_str () } # [doc = "Three-letter ISO 4217 currency code, see more on currencies"] pub fn get_currency < 'a > (& 'a self) -> & 'a str { self . currency . as_str () } # [doc = "Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.)"] pub fn get_prices < 'a > (& 'a self) -> & 'a Vec < LabeledPrice > { & self . prices } # [doc = "Optional. The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass max_tip_amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0"] pub fn get_max_tip_amount < 'a > (& 'a self) -> Option < i64 > { self . max_tip_amount . as_ref () . map (| v | { * v }) } # [doc = "Optional. A JSON-serialized array of suggested amounts of tip in the smallest units of the currency (integer, not float/double). At most 4 suggested tip amounts can be specified. The suggested tip amounts must be positive, passed in a strictly increased order and must not exceed max_tip_amount."] pub fn get_suggested_tip_amounts < 'a > (& 'a self) -> Option < & 'a Vec < i64 > > { self . suggested_tip_amounts . as_ref () . map (| v | { v }) } # [doc = "Optional. A JSON-serialized object for data about the invoice, which will be shared with the payment provider. A detailed description of the required fields should be provided by the payment provider."] pub fn get_provider_data < 'a > (& 'a self) -> Option < & 'a str > { self . provider_data . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. URL of the product photo for the invoice. Can be a photo of the goods or a marketing image for a service."] pub fn get_photo_url < 'a > (& 'a self) -> Option < & 'a str > { self . photo_url . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Photo size in bytes"] pub fn get_photo_size < 'a > (& 'a self) -> Option < i64 > { self . photo_size . as_ref () . map (| v | { * v }) } # [doc = "Optional. Photo width"] pub fn get_photo_width < 'a > (& 'a self) -> Option < i64 > { self . photo_width . as_ref () . map (| v | { * v }) } # [doc = "Optional. Photo height"] pub fn get_photo_height < 'a > (& 'a self) -> Option < i64 > { self . photo_height . as_ref () . map (| v | { * v }) } # [doc = "Optional. Pass True if you require the user's full name to complete the order"] pub fn get_need_name < 'a > (& 'a self) -> Option < bool > { self . need_name . as_ref () . map (| v | { * v }) } # [doc = "Optional. Pass True if you require the user's phone number to complete the order"] pub fn get_need_phone_number < 'a > (& 'a self) -> Option < bool > { self . need_phone_number . as_ref () . map (| v | { * v }) } # [doc = "Optional. Pass True if you require the user's email address to complete the order"] pub fn get_need_email < 'a > (& 'a self) -> Option < bool > { self . need_email . as_ref () . map (| v | { * v }) } # [doc = "Optional. Pass True if you require the user's shipping address to complete the order"] pub fn get_need_shipping_address < 'a > (& 'a self) -> Option < bool > { self . need_shipping_address . as_ref () . map (| v | { * v }) } # [doc = "Optional. Pass True if the user's phone number should be sent to provider"] pub fn get_send_phone_number_to_provider < 'a > (& 'a self) -> Option < bool > { self . send_phone_number_to_provider . as_ref () . map (| v | { * v }) } # [doc = "Optional. Pass True if the user's email address should be sent to provider"] pub fn get_send_email_to_provider < 'a > (& 'a self) -> Option < bool > { self . send_email_to_provider . as_ref () . map (| v | { * v }) } # [doc = "Optional. Pass True if the final price depends on the shipping method"] pub fn get_is_flexible < 'a > (& 'a self) -> Option < bool > { self . is_flexible . as_ref () . map (| v | { * v }) } } # [allow (dead_code)] impl MenuButtonWebApp { pub fn new (text : String , web_app : WebAppInfo) -> Self { Self { tg_type : "web_app" . to_owned () , text , web_app , } } # [doc = "Type of the button, must be web_app"] pub fn get_tg_type < 'a > (& 'a self) -> & 'a str { self . tg_type . as_str () } # [doc = "Text on the button"] pub fn get_text < 'a > (& 'a self) -> & 'a str { self . text . as_str () } # [doc = "Description of the Web App that will be launched when the user presses the button. The Web App will be able to send an arbitrary message on behalf of the user using the method answerWebAppQuery."] pub fn get_web_app < 'a > (& 'a self) -> & 'a WebAppInfo { & self . web_app } } # [allow (dead_code)] impl Audio { pub fn new (file_id : String , file_unique_id : String , duration : i64) -> Self { Self { file_id , file_unique_id , duration , performer : None , title : None , file_name : None , mime_type : None , file_size : None , thumb : None } } # [doc = "Identifier for this file, which can be used to download or reuse the file"] pub fn get_file_id < 'a > (& 'a self) -> & 'a str { self . file_id . as_str () } # [doc = "Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file."] pub fn get_file_unique_id < 'a > (& 'a self) -> & 'a str { self . file_unique_id . as_str () } # [doc = "Duration of the audio in seconds as defined by sender"] pub fn get_duration < 'a > (& 'a self) -> i64 { self . duration } # [doc = "Optional. Performer of the audio as defined by sender or by audio tags"] pub fn get_performer < 'a > (& 'a self) -> Option < & 'a str > { self . performer . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Title of the audio as defined by sender or by audio tags"] pub fn get_title < 'a > (& 'a self) -> Option < & 'a str > { self . title . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Original filename as defined by sender"] pub fn get_file_name < 'a > (& 'a self) -> Option < & 'a str > { self . file_name . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. MIME type of the file as defined by sender"] pub fn get_mime_type < 'a > (& 'a self) -> Option < & 'a str > { self . mime_type . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value."] pub fn get_file_size < 'a > (& 'a self) -> Option < i64 > { self . file_size . as_ref () . map (| v | { * v }) } # [doc = "Optional. Thumbnail of the album cover to which the music file belongs"] pub fn get_thumb < 'a > (& 'a self) -> Option < & 'a PhotoSize > { self . thumb . as_ref () . map (| v | { v }) } } # [allow (dead_code)] impl LoginUrl { pub fn new (url : String) -> Self { Self { url , forward_text : None , bot_username : None , request_write_access : None } } # [doc = "An HTTPS URL to be opened with user authorization data added to the query string when the button is pressed. If the user refuses to provide authorization data, the original URL without information about the user will be opened. The data added is the same as described in Receiving authorization data. NOTE: You must always check the hash of the received data to verify the authentication and the integrity of the data as described in Checking authorization."] pub fn get_url < 'a > (& 'a self) -> & 'a str { self . url . as_str () } # [doc = "Optional. New text of the button in forwarded messages."] pub fn get_forward_text < 'a > (& 'a self) -> Option < & 'a str > { self . forward_text . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Username of a bot, which will be used for user authorization. See Setting up a bot for more details. If not specified, the current bot's username will be assumed. The url's domain must be the same as the domain linked with the bot. See Linking your domain to the bot for more details."] pub fn get_bot_username < 'a > (& 'a self) -> Option < & 'a str > { self . bot_username . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Pass True to request the permission for your bot to send messages to the user."] pub fn get_request_write_access < 'a > (& 'a self) -> Option < bool > { self . request_write_access . as_ref () . map (| v | { * v }) } } # [allow (dead_code)] impl InlineQueryResultGif { pub fn new (id : String , gif_url : String , thumb_url : String) -> Self { Self { tg_type : "gif" . to_owned () , id , gif_url , thumb_url , gif_width : None , gif_height : None , gif_duration : None , thumb_mime_type : None , title : None , caption : None , parse_mode : None , caption_entities : None , reply_markup : None , input_message_content : None } } # [doc = "Type of the result, must be gif"] pub fn get_tg_type < 'a > (& 'a self) -> & 'a str { self . tg_type . as_str () } # [doc = "Unique identifier for this result, 1-64 bytes"] pub fn get_id < 'a > (& 'a self) -> & 'a str { self . id . as_str () } # [doc = "A valid URL for the GIF file. File size must not exceed 1MB"] pub fn get_gif_url < 'a > (& 'a self) -> & 'a str { self . gif_url . as_str () } # [doc = "Optional. Width of the GIF"] pub fn get_gif_width < 'a > (& 'a self) -> Option < i64 > { self . gif_width . as_ref () . map (| v | { * v }) } # [doc = "Optional. Height of the GIF"] pub fn get_gif_height < 'a > (& 'a self) -> Option < i64 > { self . gif_height . as_ref () . map (| v | { * v }) } # [doc = "Optional. Duration of the GIF in seconds"] pub fn get_gif_duration < 'a > (& 'a self) -> Option < i64 > { self . gif_duration . as_ref () . map (| v | { * v }) } # [doc = "URL of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the result"] pub fn get_thumb_url < 'a > (& 'a self) -> & 'a str { self . thumb_url . as_str () } # [doc = "Optional. MIME type of the thumbnail, must be one of \"image/jpeg\", \"image/gif\", or \"video/mp4\". Defaults to \"image/jpeg\""] pub fn get_thumb_mime_type < 'a > (& 'a self) -> Option < & 'a str > { self . thumb_mime_type . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Title for the result"] pub fn get_title < 'a > (& 'a self) -> Option < & 'a str > { self . title . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Caption of the GIF file to be sent, 0-1024 characters after entities parsing"] pub fn get_caption < 'a > (& 'a self) -> Option < & 'a str > { self . caption . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Mode for parsing entities in the caption. See formatting options for more details."] pub fn get_parse_mode < 'a > (& 'a self) -> Option < & 'a str > { self . parse_mode . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode"] pub fn get_caption_entities < 'a > (& 'a self) -> Option < & 'a Vec < MessageEntity > > { self . caption_entities . as_ref () . map (| v | { v }) } # [doc = "Optional. Inline keyboard attached to the message"] pub fn get_reply_markup < 'a > (& 'a self) -> Option < & 'a InlineKeyboardMarkup > { self . reply_markup . as_ref () . map (| v | { v }) } # [doc = "Optional. Content of the message to be sent instead of the GIF animation"] pub fn get_input_message_content < 'a > (& 'a self) -> Option < & 'a InputMessageContent > { self . input_message_content . as_ref () . map (| v | { v }) } } # [allow (dead_code)] impl WebhookInfo { pub fn new (url : String , has_custom_certificate : bool , pending_update_count : i64) -> Self { Self { url , has_custom_certificate , pending_update_count , ip_address : None , last_error_date : None , last_error_message : None , last_synchronization_error_date : None , max_connections : None , allowed_updates : None } } # [doc = "Webhook URL, may be empty if webhook is not set up"] pub fn get_url < 'a > (& 'a self) -> & 'a str { self . url . as_str () } # [doc = "True, if a custom certificate was provided for webhook certificate checks"] pub fn get_has_custom_certificate < 'a > (& 'a self) -> bool { self . has_custom_certificate } # [doc = "Number of updates awaiting delivery"] pub fn get_pending_update_count < 'a > (& 'a self) -> i64 { self . pending_update_count } # [doc = "Optional. Currently used webhook IP address"] pub fn get_ip_address < 'a > (& 'a self) -> Option < & 'a str > { self . ip_address . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Unix time for the most recent error that happened when trying to deliver an update via webhook"] pub fn get_last_error_date < 'a > (& 'a self) -> Option < i64 > { self . last_error_date . as_ref () . map (| v | { * v }) } # [doc = "Optional. Error message in human-readable format for the most recent error that happened when trying to deliver an update via webhook"] pub fn get_last_error_message < 'a > (& 'a self) -> Option < & 'a str > { self . last_error_message . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Unix time of the most recent error that happened when trying to synchronize available updates with Telegram datacenters"] pub fn get_last_synchronization_error_date < 'a > (& 'a self) -> Option < i64 > { self . last_synchronization_error_date . as_ref () . map (| v | { * v }) } # [doc = "Optional. The maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery"] pub fn get_max_connections < 'a > (& 'a self) -> Option < i64 > { self . max_connections . as_ref () . map (| v | { * v }) } # [doc = "Optional. A list of update types the bot is subscribed to. Defaults to all update types except chat_member"] pub fn get_allowed_updates < 'a > (& 'a self) -> Option < & 'a Vec < String > > { self . allowed_updates . as_ref () . map (| v | { v }) } } # [allow (dead_code)] impl SuccessfulPayment { pub fn new (currency : String , total_amount : i64 , invoice_payload : String , telegram_payment_charge_id : String , provider_payment_charge_id : String) -> Self { Self { currency , total_amount , invoice_payload , telegram_payment_charge_id , provider_payment_charge_id , shipping_option_id : None , order_info : None } } # [doc = "Three-letter ISO 4217 currency code"] pub fn get_currency < 'a > (& 'a self) -> & 'a str { self . currency . as_str () } # [doc = "Total price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies)."] pub fn get_total_amount < 'a > (& 'a self) -> i64 { self . total_amount } # [doc = "Bot specified invoice payload"] pub fn get_invoice_payload < 'a > (& 'a self) -> & 'a str { self . invoice_payload . as_str () } # [doc = "Optional. Identifier of the shipping option chosen by the user"] pub fn get_shipping_option_id < 'a > (& 'a self) -> Option < & 'a str > { self . shipping_option_id . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Order information provided by the user"] pub fn get_order_info < 'a > (& 'a self) -> Option < & 'a OrderInfo > { self . order_info . as_ref () . map (| v | { v }) } # [doc = "Telegram payment identifier"] pub fn get_telegram_payment_charge_id < 'a > (& 'a self) -> & 'a str { self . telegram_payment_charge_id . as_str () } # [doc = "Provider payment identifier"] pub fn get_provider_payment_charge_id < 'a > (& 'a self) -> & 'a str { self . provider_payment_charge_id . as_str () } } # [allow (dead_code)] impl Animation { pub fn new (file_id : String , file_unique_id : String , width : i64 , height : i64 , duration : i64) -> Self { Self { file_id , file_unique_id , width , height , duration , thumb : None , file_name : None , mime_type : None , file_size : None } } # [doc = "Identifier for this file, which can be used to download or reuse the file"] pub fn get_file_id < 'a > (& 'a self) -> & 'a str { self . file_id . as_str () } # [doc = "Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file."] pub fn get_file_unique_id < 'a > (& 'a self) -> & 'a str { self . file_unique_id . as_str () } # [doc = "Video width as defined by sender"] pub fn get_width < 'a > (& 'a self) -> i64 { self . width } # [doc = "Video height as defined by sender"] pub fn get_height < 'a > (& 'a self) -> i64 { self . height } # [doc = "Duration of the video in seconds as defined by sender"] pub fn get_duration < 'a > (& 'a self) -> i64 { self . duration } # [doc = "Optional. Animation thumbnail as defined by sender"] pub fn get_thumb < 'a > (& 'a self) -> Option < & 'a PhotoSize > { self . thumb . as_ref () . map (| v | { v }) } # [doc = "Optional. Original animation filename as defined by sender"] pub fn get_file_name < 'a > (& 'a self) -> Option < & 'a str > { self . file_name . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. MIME type of the file as defined by sender"] pub fn get_mime_type < 'a > (& 'a self) -> Option < & 'a str > { self . mime_type . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value."] pub fn get_file_size < 'a > (& 'a self) -> Option < i64 > { self . file_size . as_ref () . map (| v | { * v }) } } # [allow (dead_code)] impl InlineQueryResultVenue { pub fn new (id : String , latitude : f64 , longitude : f64 , title : String , address : String) -> Self { Self { tg_type : "venue" . to_owned () , id , latitude , longitude , title , address , foursquare_id : None , foursquare_type : None , google_place_id : None , google_place_type : None , reply_markup : None , input_message_content : None , thumb_url : None , thumb_width : None , thumb_height : None } } # [doc = "Type of the result, must be venue"] pub fn get_tg_type < 'a > (& 'a self) -> & 'a str { self . tg_type . as_str () } # [doc = "Unique identifier for this result, 1-64 Bytes"] pub fn get_id < 'a > (& 'a self) -> & 'a str { self . id . as_str () } # [doc = "Latitude of the venue location in degrees"] pub fn get_latitude < 'a > (& 'a self) -> f64 { self . latitude } # [doc = "Longitude of the venue location in degrees"] pub fn get_longitude < 'a > (& 'a self) -> f64 { self . longitude } # [doc = "Title of the venue"] pub fn get_title < 'a > (& 'a self) -> & 'a str { self . title . as_str () } # [doc = "Address of the venue"] pub fn get_address < 'a > (& 'a self) -> & 'a str { self . address . as_str () } # [doc = "Optional. Foursquare identifier of the venue if known"] pub fn get_foursquare_id < 'a > (& 'a self) -> Option < & 'a str > { self . foursquare_id . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Foursquare type of the venue, if known. (For example, \"arts_entertainment/default\", \"arts_entertainment/aquarium\" or \"food/icecream\".)"] pub fn get_foursquare_type < 'a > (& 'a self) -> Option < & 'a str > { self . foursquare_type . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Google Places identifier of the venue"] pub fn get_google_place_id < 'a > (& 'a self) -> Option < & 'a str > { self . google_place_id . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Google Places type of the venue. (See supported types.)"] pub fn get_google_place_type < 'a > (& 'a self) -> Option < & 'a str > { self . google_place_type . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Inline keyboard attached to the message"] pub fn get_reply_markup < 'a > (& 'a self) -> Option < & 'a InlineKeyboardMarkup > { self . reply_markup . as_ref () . map (| v | { v }) } # [doc = "Optional. Content of the message to be sent instead of the venue"] pub fn get_input_message_content < 'a > (& 'a self) -> Option < & 'a InputMessageContent > { self . input_message_content . as_ref () . map (| v | { v }) } # [doc = "Optional. Url of the thumbnail for the result"] pub fn get_thumb_url < 'a > (& 'a self) -> Option < & 'a str > { self . thumb_url . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Thumbnail width"] pub fn get_thumb_width < 'a > (& 'a self) -> Option < i64 > { self . thumb_width . as_ref () . map (| v | { * v }) } # [doc = "Optional. Thumbnail height"] pub fn get_thumb_height < 'a > (& 'a self) -> Option < i64 > { self . thumb_height . as_ref () . map (| v | { * v }) } } # [allow (dead_code)] impl PassportElementErrorDataField { pub fn new (source : String , field_name : String , data_hash : String , message : String) -> Self { Self { tg_type : "PassportElementErrorDataField" . to_owned () , source , field_name , data_hash , message , } } # [doc = "Error source, must be data"] pub fn get_source < 'a > (& 'a self) -> & 'a str { self . source . as_str () } # [doc = "The section of the user's Telegram Passport which has the error, one of \"personal_details\", \"passport\", \"driver_license\", \"identity_card\", \"internal_passport\", \"address\""] pub fn get_tg_type < 'a > (& 'a self) -> & 'a str { self . tg_type . as_str () } # [doc = "Name of the data field which has the error"] pub fn get_field_name < 'a > (& 'a self) -> & 'a str { self . field_name . as_str () } # [doc = "Base64-encoded data hash"] pub fn get_data_hash < 'a > (& 'a self) -> & 'a str { self . data_hash . as_str () } # [doc = "Error message"] pub fn get_message < 'a > (& 'a self) -> & 'a str { self . message . as_str () } } # [allow (dead_code)] impl ResponseParameters { pub fn new () -> Self { Self { migrate_to_chat_id : None , retry_after : None } } # [doc = "Optional. The group has been migrated to a supergroup with the specified identifier. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier."] pub fn get_migrate_to_chat_id < 'a > (& 'a self) -> Option < i64 > { self . migrate_to_chat_id . as_ref () . map (| v | { * v }) } # [doc = "Optional. In case of exceeding flood control, the number of seconds left to wait before the request can be repeated"] pub fn get_retry_after < 'a > (& 'a self) -> Option < i64 > { self . retry_after . as_ref () . map (| v | { * v }) } } # [allow (dead_code)] impl VideoChatStarted { } # [allow (dead_code)] impl ReplyKeyboardMarkup { pub fn new (keyboard : Vec < Vec < KeyboardButton > >) -> Self { Self { keyboard , resize_keyboard : None , one_time_keyboard : None , input_field_placeholder : None , selective : None } } # [doc = "Array of button rows, each represented by an Array of KeyboardButton objects"] pub fn get_keyboard < 'a > (& 'a self) -> & 'a Vec < Vec < KeyboardButton > > { & self . keyboard } # [doc = "Optional. Requests clients to resize the keyboard vertically for optimal fit (e.g., make the keyboard smaller if there are just two rows of buttons). Defaults to false, in which case the custom keyboard is always of the same height as the app's standard keyboard."] pub fn get_resize_keyboard < 'a > (& 'a self) -> Option < bool > { self . resize_keyboard . as_ref () . map (| v | { * v }) } # [doc = "Optional. Requests clients to hide the keyboard as soon as it's been used. The keyboard will still be available, but clients will automatically display the usual letter-keyboard in the chat - the user can press a special button in the input field to see the custom keyboard again. Defaults to false."] pub fn get_one_time_keyboard < 'a > (& 'a self) -> Option < bool > { self . one_time_keyboard . as_ref () . map (| v | { * v }) } # [doc = "Optional. The placeholder to be shown in the input field when the keyboard is active; 1-64 characters"] pub fn get_input_field_placeholder < 'a > (& 'a self) -> Option < & 'a str > { self . input_field_placeholder . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Use this parameter if you want to show the keyboard to specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply (has reply_to_message_id), sender of the original message. Example: A user requests to change the bot's language, bot replies to the request with a keyboard to select the new language. Other users in the group don't see the keyboard."] pub fn get_selective < 'a > (& 'a self) -> Option < bool > { self . selective . as_ref () . map (| v | { * v }) } } impl TraitInlineQueryResultCachedAudio for InlineQueryResultCachedAudio { # [doc = "Type of the result, must be audio"] fn get_tg_type < 'a > (& 'a self) -> & 'a str { self . tg_type . as_str () } # [doc = "Unique identifier for this result, 1-64 bytes"] fn get_id < 'a > (& 'a self) -> & 'a str { self . id . as_str () } # [doc = "A valid file identifier for the audio file"] fn get_audio_file_id < 'a > (& 'a self) -> & 'a str { self . audio_file_id . as_str () } # [doc = "Optional. Caption, 0-1024 characters after entities parsing"] fn get_caption < 'a > (& 'a self) -> Option < & 'a str > { self . caption . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Mode for parsing entities in the audio caption. See formatting options for more details."] fn get_parse_mode < 'a > (& 'a self) -> Option < & 'a str > { self . parse_mode . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode"] fn get_caption_entities < 'a > (& 'a self) -> Option < & 'a Vec < MessageEntity > > { self . caption_entities . as_ref () . map (| v | { v }) } # [doc = "Optional. Inline keyboard attached to the message"] fn get_reply_markup < 'a > (& 'a self) -> Option < & 'a InlineKeyboardMarkup > { self . reply_markup . as_ref () . map (| v | { v }) } # [doc = "Optional. Content of the message to be sent instead of the audio"] fn get_input_message_content < 'a > (& 'a self) -> Option < & 'a InputMessageContent > { self . input_message_content . as_ref () . map (| v | { v }) } } impl TraitInlineQueryResultCachedDocument for InlineQueryResultCachedDocument { # [doc = "Type of the result, must be document"] fn get_tg_type < 'a > (& 'a self) -> & 'a str { self . tg_type . as_str () } # [doc = "Unique identifier for this result, 1-64 bytes"] fn get_id < 'a > (& 'a self) -> & 'a str { self . id . as_str () } # [doc = "Title for the result"] fn get_title < 'a > (& 'a self) -> & 'a str { self . title . as_str () } # [doc = "A valid file identifier for the file"] fn get_document_file_id < 'a > (& 'a self) -> & 'a str { self . document_file_id . as_str () } # [doc = "Optional. Short description of the result"] fn get_description < 'a > (& 'a self) -> Option < & 'a str > { self . description . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Caption of the document to be sent, 0-1024 characters after entities parsing"] fn get_caption < 'a > (& 'a self) -> Option < & 'a str > { self . caption . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Mode for parsing entities in the document caption. See formatting options for more details."] fn get_parse_mode < 'a > (& 'a self) -> Option < & 'a str > { self . parse_mode . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode"] fn get_caption_entities < 'a > (& 'a self) -> Option < & 'a Vec < MessageEntity > > { self . caption_entities . as_ref () . map (| v | { v }) } # [doc = "Optional. Inline keyboard attached to the message"] fn get_reply_markup < 'a > (& 'a self) -> Option < & 'a InlineKeyboardMarkup > { self . reply_markup . as_ref () . map (| v | { v }) } # [doc = "Optional. Content of the message to be sent instead of the file"] fn get_input_message_content < 'a > (& 'a self) -> Option < & 'a InputMessageContent > { self . input_message_content . as_ref () . map (| v | { v }) } } impl TraitInlineQueryResultCachedGif for InlineQueryResultCachedGif { # [doc = "Type of the result, must be gif"] fn get_tg_type < 'a > (& 'a self) -> & 'a str { self . tg_type . as_str () } # [doc = "Unique identifier for this result, 1-64 bytes"] fn get_id < 'a > (& 'a self) -> & 'a str { self . id . as_str () } # [doc = "A valid file identifier for the GIF file"] fn get_gif_file_id < 'a > (& 'a self) -> & 'a str { self . gif_file_id . as_str () } # [doc = "Optional. Title for the result"] fn get_title < 'a > (& 'a self) -> Option < & 'a str > { self . title . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Caption of the GIF file to be sent, 0-1024 characters after entities parsing"] fn get_caption < 'a > (& 'a self) -> Option < & 'a str > { self . caption . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Mode for parsing entities in the caption. See formatting options for more details."] fn get_parse_mode < 'a > (& 'a self) -> Option < & 'a str > { self . parse_mode . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode"] fn get_caption_entities < 'a > (& 'a self) -> Option < & 'a Vec < MessageEntity > > { self . caption_entities . as_ref () . map (| v | { v }) } # [doc = "Optional. Inline keyboard attached to the message"] fn get_reply_markup < 'a > (& 'a self) -> Option < & 'a InlineKeyboardMarkup > { self . reply_markup . as_ref () . map (| v | { v }) } # [doc = "Optional. Content of the message to be sent instead of the GIF animation"] fn get_input_message_content < 'a > (& 'a self) -> Option < & 'a InputMessageContent > { self . input_message_content . as_ref () . map (| v | { v }) } } impl TraitInlineQueryResultCachedMpeg4Gif for InlineQueryResultCachedMpeg4Gif { # [doc = "Type of the result, must be mpeg4_gif"] fn get_tg_type < 'a > (& 'a self) -> & 'a str { self . tg_type . as_str () } # [doc = "Unique identifier for this result, 1-64 bytes"] fn get_id < 'a > (& 'a self) -> & 'a str { self . id . as_str () } # [doc = "A valid file identifier for the MPEG4 file"] fn get_mpeg_4_file_id < 'a > (& 'a self) -> & 'a str { self . mpeg_4_file_id . as_str () } # [doc = "Optional. Title for the result"] fn get_title < 'a > (& 'a self) -> Option < & 'a str > { self . title . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Caption of the MPEG-4 file to be sent, 0-1024 characters after entities parsing"] fn get_caption < 'a > (& 'a self) -> Option < & 'a str > { self . caption . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Mode for parsing entities in the caption. See formatting options for more details."] fn get_parse_mode < 'a > (& 'a self) -> Option < & 'a str > { self . parse_mode . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode"] fn get_caption_entities < 'a > (& 'a self) -> Option < & 'a Vec < MessageEntity > > { self . caption_entities . as_ref () . map (| v | { v }) } # [doc = "Optional. Inline keyboard attached to the message"] fn get_reply_markup < 'a > (& 'a self) -> Option < & 'a InlineKeyboardMarkup > { self . reply_markup . as_ref () . map (| v | { v }) } # [doc = "Optional. Content of the message to be sent instead of the video animation"] fn get_input_message_content < 'a > (& 'a self) -> Option < & 'a InputMessageContent > { self . input_message_content . as_ref () . map (| v | { v }) } } impl TraitInlineQueryResultCachedPhoto for InlineQueryResultCachedPhoto { # [doc = "Type of the result, must be photo"] fn get_tg_type < 'a > (& 'a self) -> & 'a str { self . tg_type . as_str () } # [doc = "Unique identifier for this result, 1-64 bytes"] fn get_id < 'a > (& 'a self) -> & 'a str { self . id . as_str () } # [doc = "A valid file identifier of the photo"] fn get_photo_file_id < 'a > (& 'a self) -> & 'a str { self . photo_file_id . as_str () } # [doc = "Optional. Title for the result"] fn get_title < 'a > (& 'a self) -> Option < & 'a str > { self . title . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Short description of the result"] fn get_description < 'a > (& 'a self) -> Option < & 'a str > { self . description . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Caption of the photo to be sent, 0-1024 characters after entities parsing"] fn get_caption < 'a > (& 'a self) -> Option < & 'a str > { self . caption . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Mode for parsing entities in the photo caption. See formatting options for more details."] fn get_parse_mode < 'a > (& 'a self) -> Option < & 'a str > { self . parse_mode . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode"] fn get_caption_entities < 'a > (& 'a self) -> Option < & 'a Vec < MessageEntity > > { self . caption_entities . as_ref () . map (| v | { v }) } # [doc = "Optional. Inline keyboard attached to the message"] fn get_reply_markup < 'a > (& 'a self) -> Option < & 'a InlineKeyboardMarkup > { self . reply_markup . as_ref () . map (| v | { v }) } # [doc = "Optional. Content of the message to be sent instead of the photo"] fn get_input_message_content < 'a > (& 'a self) -> Option < & 'a InputMessageContent > { self . input_message_content . as_ref () . map (| v | { v }) } } impl TraitInlineQueryResultCachedSticker for InlineQueryResultCachedSticker { # [doc = "Type of the result, must be sticker"] fn get_tg_type < 'a > (& 'a self) -> & 'a str { self . tg_type . as_str () } # [doc = "Unique identifier for this result, 1-64 bytes"] fn get_id < 'a > (& 'a self) -> & 'a str { self . id . as_str () } # [doc = "A valid file identifier of the sticker"] fn get_sticker_file_id < 'a > (& 'a self) -> & 'a str { self . sticker_file_id . as_str () } # [doc = "Optional. Inline keyboard attached to the message"] fn get_reply_markup < 'a > (& 'a self) -> Option < & 'a InlineKeyboardMarkup > { self . reply_markup . as_ref () . map (| v | { v }) } # [doc = "Optional. Content of the message to be sent instead of the sticker"] fn get_input_message_content < 'a > (& 'a self) -> Option < & 'a InputMessageContent > { self . input_message_content . as_ref () . map (| v | { v }) } } impl TraitInlineQueryResultCachedVideo for InlineQueryResultCachedVideo { # [doc = "Type of the result, must be video"] fn get_tg_type < 'a > (& 'a self) -> & 'a str { self . tg_type . as_str () } # [doc = "Unique identifier for this result, 1-64 bytes"] fn get_id < 'a > (& 'a self) -> & 'a str { self . id . as_str () } # [doc = "A valid file identifier for the video file"] fn get_video_file_id < 'a > (& 'a self) -> & 'a str { self . video_file_id . as_str () } # [doc = "Title for the result"] fn get_title < 'a > (& 'a self) -> & 'a str { self . title . as_str () } # [doc = "Optional. Short description of the result"] fn get_description < 'a > (& 'a self) -> Option < & 'a str > { self . description . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Caption of the video to be sent, 0-1024 characters after entities parsing"] fn get_caption < 'a > (& 'a self) -> Option < & 'a str > { self . caption . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Mode for parsing entities in the video caption. See formatting options for more details."] fn get_parse_mode < 'a > (& 'a self) -> Option < & 'a str > { self . parse_mode . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode"] fn get_caption_entities < 'a > (& 'a self) -> Option < & 'a Vec < MessageEntity > > { self . caption_entities . as_ref () . map (| v | { v }) } # [doc = "Optional. Inline keyboard attached to the message"] fn get_reply_markup < 'a > (& 'a self) -> Option < & 'a InlineKeyboardMarkup > { self . reply_markup . as_ref () . map (| v | { v }) } # [doc = "Optional. Content of the message to be sent instead of the video"] fn get_input_message_content < 'a > (& 'a self) -> Option < & 'a InputMessageContent > { self . input_message_content . as_ref () . map (| v | { v }) } } impl TraitInlineQueryResultCachedVoice for InlineQueryResultCachedVoice { # [doc = "Type of the result, must be voice"] fn get_tg_type < 'a > (& 'a self) -> & 'a str { self . tg_type . as_str () } # [doc = "Unique identifier for this result, 1-64 bytes"] fn get_id < 'a > (& 'a self) -> & 'a str { self . id . as_str () } # [doc = "A valid file identifier for the voice message"] fn get_voice_file_id < 'a > (& 'a self) -> & 'a str { self . voice_file_id . as_str () } # [doc = "Voice message title"] fn get_title < 'a > (& 'a self) -> & 'a str { self . title . as_str () } # [doc = "Optional. Caption, 0-1024 characters after entities parsing"] fn get_caption < 'a > (& 'a self) -> Option < & 'a str > { self . caption . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Mode for parsing entities in the voice message caption. See formatting options for more details."] fn get_parse_mode < 'a > (& 'a self) -> Option < & 'a str > { self . parse_mode . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode"] fn get_caption_entities < 'a > (& 'a self) -> Option < & 'a Vec < MessageEntity > > { self . caption_entities . as_ref () . map (| v | { v }) } # [doc = "Optional. Inline keyboard attached to the message"] fn get_reply_markup < 'a > (& 'a self) -> Option < & 'a InlineKeyboardMarkup > { self . reply_markup . as_ref () . map (| v | { v }) } # [doc = "Optional. Content of the message to be sent instead of the voice message"] fn get_input_message_content < 'a > (& 'a self) -> Option < & 'a InputMessageContent > { self . input_message_content . as_ref () . map (| v | { v }) } } impl TraitInlineQueryResultArticle for InlineQueryResultArticle { # [doc = "Type of the result, must be article"] fn get_tg_type < 'a > (& 'a self) -> & 'a str { self . tg_type . as_str () } # [doc = "Unique identifier for this result, 1-64 Bytes"] fn get_id < 'a > (& 'a self) -> & 'a str { self . id . as_str () } # [doc = "Title of the result"] fn get_title < 'a > (& 'a self) -> & 'a str { self . title . as_str () } # [doc = "Content of the message to be sent"] fn get_input_message_content < 'a > (& 'a self) -> & 'a InputMessageContent { & self . input_message_content } # [doc = "Optional. Inline keyboard attached to the message"] fn get_reply_markup < 'a > (& 'a self) -> Option < & 'a InlineKeyboardMarkup > { self . reply_markup . as_ref () . map (| v | { v }) } # [doc = "Optional. URL of the result"] fn get_url < 'a > (& 'a self) -> Option < & 'a str > { self . url . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Pass True if you don't want the URL to be shown in the message"] fn get_hide_url < 'a > (& 'a self) -> Option < bool > { self . hide_url . as_ref () . map (| v | { * v }) } # [doc = "Optional. Short description of the result"] fn get_description < 'a > (& 'a self) -> Option < & 'a str > { self . description . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Url of the thumbnail for the result"] fn get_thumb_url < 'a > (& 'a self) -> Option < & 'a str > { self . thumb_url . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Thumbnail width"] fn get_thumb_width < 'a > (& 'a self) -> Option < i64 > { self . thumb_width . as_ref () . map (| v | { * v }) } # [doc = "Optional. Thumbnail height"] fn get_thumb_height < 'a > (& 'a self) -> Option < i64 > { self . thumb_height . as_ref () . map (| v | { * v }) } } impl TraitInlineQueryResultAudio for InlineQueryResultAudio { # [doc = "Type of the result, must be audio"] fn get_tg_type < 'a > (& 'a self) -> & 'a str { self . tg_type . as_str () } # [doc = "Unique identifier for this result, 1-64 bytes"] fn get_id < 'a > (& 'a self) -> & 'a str { self . id . as_str () } # [doc = "A valid URL for the audio file"] fn get_audio_url < 'a > (& 'a self) -> & 'a str { self . audio_url . as_str () } # [doc = "Title"] fn get_title < 'a > (& 'a self) -> & 'a str { self . title . as_str () } # [doc = "Optional. Caption, 0-1024 characters after entities parsing"] fn get_caption < 'a > (& 'a self) -> Option < & 'a str > { self . caption . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Mode for parsing entities in the audio caption. See formatting options for more details."] fn get_parse_mode < 'a > (& 'a self) -> Option < & 'a str > { self . parse_mode . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode"] fn get_caption_entities < 'a > (& 'a self) -> Option < & 'a Vec < MessageEntity > > { self . caption_entities . as_ref () . map (| v | { v }) } # [doc = "Optional. Performer"] fn get_performer < 'a > (& 'a self) -> Option < & 'a str > { self . performer . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Audio duration in seconds"] fn get_audio_duration < 'a > (& 'a self) -> Option < i64 > { self . audio_duration . as_ref () . map (| v | { * v }) } # [doc = "Optional. Inline keyboard attached to the message"] fn get_reply_markup < 'a > (& 'a self) -> Option < & 'a InlineKeyboardMarkup > { self . reply_markup . as_ref () . map (| v | { v }) } # [doc = "Optional. Content of the message to be sent instead of the audio"] fn get_input_message_content < 'a > (& 'a self) -> Option < & 'a InputMessageContent > { self . input_message_content . as_ref () . map (| v | { v }) } } impl TraitInlineQueryResultContact for InlineQueryResultContact { # [doc = "Type of the result, must be contact"] fn get_tg_type < 'a > (& 'a self) -> & 'a str { self . tg_type . as_str () } # [doc = "Unique identifier for this result, 1-64 Bytes"] fn get_id < 'a > (& 'a self) -> & 'a str { self . id . as_str () } # [doc = "Contact's phone number"] fn get_phone_number < 'a > (& 'a self) -> & 'a str { self . phone_number . as_str () } # [doc = "Contact's first name"] fn get_first_name < 'a > (& 'a self) -> & 'a str { self . first_name . as_str () } # [doc = "Optional. Contact's last name"] fn get_last_name < 'a > (& 'a self) -> Option < & 'a str > { self . last_name . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Additional data about the contact in the form of a vCard, 0-2048 bytes"] fn get_vcard < 'a > (& 'a self) -> Option < & 'a str > { self . vcard . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Inline keyboard attached to the message"] fn get_reply_markup < 'a > (& 'a self) -> Option < & 'a InlineKeyboardMarkup > { self . reply_markup . as_ref () . map (| v | { v }) } # [doc = "Optional. Content of the message to be sent instead of the contact"] fn get_input_message_content < 'a > (& 'a self) -> Option < & 'a InputMessageContent > { self . input_message_content . as_ref () . map (| v | { v }) } # [doc = "Optional. Url of the thumbnail for the result"] fn get_thumb_url < 'a > (& 'a self) -> Option < & 'a str > { self . thumb_url . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Thumbnail width"] fn get_thumb_width < 'a > (& 'a self) -> Option < i64 > { self . thumb_width . as_ref () . map (| v | { * v }) } # [doc = "Optional. Thumbnail height"] fn get_thumb_height < 'a > (& 'a self) -> Option < i64 > { self . thumb_height . as_ref () . map (| v | { * v }) } } impl TraitInlineQueryResultGame for InlineQueryResultGame { # [doc = "Type of the result, must be game"] fn get_tg_type < 'a > (& 'a self) -> & 'a str { self . tg_type . as_str () } # [doc = "Unique identifier for this result, 1-64 bytes"] fn get_id < 'a > (& 'a self) -> & 'a str { self . id . as_str () } # [doc = "Short name of the game"] fn get_game_short_name < 'a > (& 'a self) -> & 'a str { self . game_short_name . as_str () } # [doc = "Optional. Inline keyboard attached to the message"] fn get_reply_markup < 'a > (& 'a self) -> Option < & 'a InlineKeyboardMarkup > { self . reply_markup . as_ref () . map (| v | { v }) } } impl TraitInlineQueryResultDocument for InlineQueryResultDocument { # [doc = "Type of the result, must be document"] fn get_tg_type < 'a > (& 'a self) -> & 'a str { self . tg_type . as_str () } # [doc = "Unique identifier for this result, 1-64 bytes"] fn get_id < 'a > (& 'a self) -> & 'a str { self . id . as_str () } # [doc = "Title for the result"] fn get_title < 'a > (& 'a self) -> & 'a str { self . title . as_str () } # [doc = "Optional. Caption of the document to be sent, 0-1024 characters after entities parsing"] fn get_caption < 'a > (& 'a self) -> Option < & 'a str > { self . caption . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Mode for parsing entities in the document caption. See formatting options for more details."] fn get_parse_mode < 'a > (& 'a self) -> Option < & 'a str > { self . parse_mode . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode"] fn get_caption_entities < 'a > (& 'a self) -> Option < & 'a Vec < MessageEntity > > { self . caption_entities . as_ref () . map (| v | { v }) } # [doc = "A valid URL for the file"] fn get_document_url < 'a > (& 'a self) -> & 'a str { self . document_url . as_str () } # [doc = "MIME type of the content of the file, either \"application/pdf\" or \"application/zip\""] fn get_mime_type < 'a > (& 'a self) -> & 'a str { self . mime_type . as_str () } # [doc = "Optional. Short description of the result"] fn get_description < 'a > (& 'a self) -> Option < & 'a str > { self . description . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Inline keyboard attached to the message"] fn get_reply_markup < 'a > (& 'a self) -> Option < & 'a InlineKeyboardMarkup > { self . reply_markup . as_ref () . map (| v | { v }) } # [doc = "Optional. Content of the message to be sent instead of the file"] fn get_input_message_content < 'a > (& 'a self) -> Option < & 'a InputMessageContent > { self . input_message_content . as_ref () . map (| v | { v }) } # [doc = "Optional. URL of the thumbnail (JPEG only) for the file"] fn get_thumb_url < 'a > (& 'a self) -> Option < & 'a str > { self . thumb_url . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Thumbnail width"] fn get_thumb_width < 'a > (& 'a self) -> Option < i64 > { self . thumb_width . as_ref () . map (| v | { * v }) } # [doc = "Optional. Thumbnail height"] fn get_thumb_height < 'a > (& 'a self) -> Option < i64 > { self . thumb_height . as_ref () . map (| v | { * v }) } } impl TraitInlineQueryResultGif for InlineQueryResultGif { # [doc = "Type of the result, must be gif"] fn get_tg_type < 'a > (& 'a self) -> & 'a str { self . tg_type . as_str () } # [doc = "Unique identifier for this result, 1-64 bytes"] fn get_id < 'a > (& 'a self) -> & 'a str { self . id . as_str () } # [doc = "A valid URL for the GIF file. File size must not exceed 1MB"] fn get_gif_url < 'a > (& 'a self) -> & 'a str { self . gif_url . as_str () } # [doc = "Optional. Width of the GIF"] fn get_gif_width < 'a > (& 'a self) -> Option < i64 > { self . gif_width . as_ref () . map (| v | { * v }) } # [doc = "Optional. Height of the GIF"] fn get_gif_height < 'a > (& 'a self) -> Option < i64 > { self . gif_height . as_ref () . map (| v | { * v }) } # [doc = "Optional. Duration of the GIF in seconds"] fn get_gif_duration < 'a > (& 'a self) -> Option < i64 > { self . gif_duration . as_ref () . map (| v | { * v }) } # [doc = "URL of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the result"] fn get_thumb_url < 'a > (& 'a self) -> & 'a str { self . thumb_url . as_str () } # [doc = "Optional. MIME type of the thumbnail, must be one of \"image/jpeg\", \"image/gif\", or \"video/mp4\". Defaults to \"image/jpeg\""] fn get_thumb_mime_type < 'a > (& 'a self) -> Option < & 'a str > { self . thumb_mime_type . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Title for the result"] fn get_title < 'a > (& 'a self) -> Option < & 'a str > { self . title . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Caption of the GIF file to be sent, 0-1024 characters after entities parsing"] fn get_caption < 'a > (& 'a self) -> Option < & 'a str > { self . caption . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Mode for parsing entities in the caption. See formatting options for more details."] fn get_parse_mode < 'a > (& 'a self) -> Option < & 'a str > { self . parse_mode . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode"] fn get_caption_entities < 'a > (& 'a self) -> Option < & 'a Vec < MessageEntity > > { self . caption_entities . as_ref () . map (| v | { v }) } # [doc = "Optional. Inline keyboard attached to the message"] fn get_reply_markup < 'a > (& 'a self) -> Option < & 'a InlineKeyboardMarkup > { self . reply_markup . as_ref () . map (| v | { v }) } # [doc = "Optional. Content of the message to be sent instead of the GIF animation"] fn get_input_message_content < 'a > (& 'a self) -> Option < & 'a InputMessageContent > { self . input_message_content . as_ref () . map (| v | { v }) } } impl TraitInlineQueryResultLocation for InlineQueryResultLocation { # [doc = "Type of the result, must be location"] fn get_tg_type < 'a > (& 'a self) -> & 'a str { self . tg_type . as_str () } # [doc = "Unique identifier for this result, 1-64 Bytes"] fn get_id < 'a > (& 'a self) -> & 'a str { self . id . as_str () } # [doc = "Location latitude in degrees"] fn get_latitude < 'a > (& 'a self) -> f64 { self . latitude } # [doc = "Location longitude in degrees"] fn get_longitude < 'a > (& 'a self) -> f64 { self . longitude } # [doc = "Location title"] fn get_title < 'a > (& 'a self) -> & 'a str { self . title . as_str () } # [doc = "Optional. The radius of uncertainty for the location, measured in meters; 0-1500"] fn get_horizontal_accuracy < 'a > (& 'a self) -> Option < f64 > { self . horizontal_accuracy . as_ref () . map (| v | { * v }) } # [doc = "Optional. Period in seconds for which the location can be updated, should be between 60 and 86400."] fn get_live_period < 'a > (& 'a self) -> Option < i64 > { self . live_period . as_ref () . map (| v | { * v }) } # [doc = "Optional. For live locations, a direction in which the user is moving, in degrees. Must be between 1 and 360 if specified."] fn get_heading < 'a > (& 'a self) -> Option < i64 > { self . heading . as_ref () . map (| v | { * v }) } # [doc = "Optional. For live locations, a maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified."] fn get_proximity_alert_radius < 'a > (& 'a self) -> Option < i64 > { self . proximity_alert_radius . as_ref () . map (| v | { * v }) } # [doc = "Optional. Inline keyboard attached to the message"] fn get_reply_markup < 'a > (& 'a self) -> Option < & 'a InlineKeyboardMarkup > { self . reply_markup . as_ref () . map (| v | { v }) } # [doc = "Optional. Content of the message to be sent instead of the location"] fn get_input_message_content < 'a > (& 'a self) -> Option < & 'a InputMessageContent > { self . input_message_content . as_ref () . map (| v | { v }) } # [doc = "Optional. Url of the thumbnail for the result"] fn get_thumb_url < 'a > (& 'a self) -> Option < & 'a str > { self . thumb_url . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Thumbnail width"] fn get_thumb_width < 'a > (& 'a self) -> Option < i64 > { self . thumb_width . as_ref () . map (| v | { * v }) } # [doc = "Optional. Thumbnail height"] fn get_thumb_height < 'a > (& 'a self) -> Option < i64 > { self . thumb_height . as_ref () . map (| v | { * v }) } } impl TraitInlineQueryResultMpeg4Gif for InlineQueryResultMpeg4Gif { # [doc = "Type of the result, must be mpeg4_gif"] fn get_tg_type < 'a > (& 'a self) -> & 'a str { self . tg_type . as_str () } # [doc = "Unique identifier for this result, 1-64 bytes"] fn get_id < 'a > (& 'a self) -> & 'a str { self . id . as_str () } # [doc = "A valid URL for the MPEG4 file. File size must not exceed 1MB"] fn get_mpeg_4_url < 'a > (& 'a self) -> & 'a str { self . mpeg_4_url . as_str () } # [doc = "Optional. Video width"] fn get_mpeg_4_width < 'a > (& 'a self) -> Option < i64 > { self . mpeg_4_width . as_ref () . map (| v | { * v }) } # [doc = "Optional. Video height"] fn get_mpeg_4_height < 'a > (& 'a self) -> Option < i64 > { self . mpeg_4_height . as_ref () . map (| v | { * v }) } # [doc = "Optional. Video duration in seconds"] fn get_mpeg_4_duration < 'a > (& 'a self) -> Option < i64 > { self . mpeg_4_duration . as_ref () . map (| v | { * v }) } # [doc = "URL of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the result"] fn get_thumb_url < 'a > (& 'a self) -> & 'a str { self . thumb_url . as_str () } # [doc = "Optional. MIME type of the thumbnail, must be one of \"image/jpeg\", \"image/gif\", or \"video/mp4\". Defaults to \"image/jpeg\""] fn get_thumb_mime_type < 'a > (& 'a self) -> Option < & 'a str > { self . thumb_mime_type . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Title for the result"] fn get_title < 'a > (& 'a self) -> Option < & 'a str > { self . title . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Caption of the MPEG-4 file to be sent, 0-1024 characters after entities parsing"] fn get_caption < 'a > (& 'a self) -> Option < & 'a str > { self . caption . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Mode for parsing entities in the caption. See formatting options for more details."] fn get_parse_mode < 'a > (& 'a self) -> Option < & 'a str > { self . parse_mode . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode"] fn get_caption_entities < 'a > (& 'a self) -> Option < & 'a Vec < MessageEntity > > { self . caption_entities . as_ref () . map (| v | { v }) } # [doc = "Optional. Inline keyboard attached to the message"] fn get_reply_markup < 'a > (& 'a self) -> Option < & 'a InlineKeyboardMarkup > { self . reply_markup . as_ref () . map (| v | { v }) } # [doc = "Optional. Content of the message to be sent instead of the video animation"] fn get_input_message_content < 'a > (& 'a self) -> Option < & 'a InputMessageContent > { self . input_message_content . as_ref () . map (| v | { v }) } } impl TraitInlineQueryResultPhoto for InlineQueryResultPhoto { # [doc = "Type of the result, must be photo"] fn get_tg_type < 'a > (& 'a self) -> & 'a str { self . tg_type . as_str () } # [doc = "Unique identifier for this result, 1-64 bytes"] fn get_id < 'a > (& 'a self) -> & 'a str { self . id . as_str () } # [doc = "A valid URL of the photo. Photo must be in JPEG format. Photo size must not exceed 5MB"] fn get_photo_url < 'a > (& 'a self) -> & 'a str { self . photo_url . as_str () } # [doc = "URL of the thumbnail for the photo"] fn get_thumb_url < 'a > (& 'a self) -> & 'a str { self . thumb_url . as_str () } # [doc = "Optional. Width of the photo"] fn get_photo_width < 'a > (& 'a self) -> Option < i64 > { self . photo_width . as_ref () . map (| v | { * v }) } # [doc = "Optional. Height of the photo"] fn get_photo_height < 'a > (& 'a self) -> Option < i64 > { self . photo_height . as_ref () . map (| v | { * v }) } # [doc = "Optional. Title for the result"] fn get_title < 'a > (& 'a self) -> Option < & 'a str > { self . title . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Short description of the result"] fn get_description < 'a > (& 'a self) -> Option < & 'a str > { self . description . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Caption of the photo to be sent, 0-1024 characters after entities parsing"] fn get_caption < 'a > (& 'a self) -> Option < & 'a str > { self . caption . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Mode for parsing entities in the photo caption. See formatting options for more details."] fn get_parse_mode < 'a > (& 'a self) -> Option < & 'a str > { self . parse_mode . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode"] fn get_caption_entities < 'a > (& 'a self) -> Option < & 'a Vec < MessageEntity > > { self . caption_entities . as_ref () . map (| v | { v }) } # [doc = "Optional. Inline keyboard attached to the message"] fn get_reply_markup < 'a > (& 'a self) -> Option < & 'a InlineKeyboardMarkup > { self . reply_markup . as_ref () . map (| v | { v }) } # [doc = "Optional. Content of the message to be sent instead of the photo"] fn get_input_message_content < 'a > (& 'a self) -> Option < & 'a InputMessageContent > { self . input_message_content . as_ref () . map (| v | { v }) } } impl TraitInlineQueryResultVenue for InlineQueryResultVenue { # [doc = "Type of the result, must be venue"] fn get_tg_type < 'a > (& 'a self) -> & 'a str { self . tg_type . as_str () } # [doc = "Unique identifier for this result, 1-64 Bytes"] fn get_id < 'a > (& 'a self) -> & 'a str { self . id . as_str () } # [doc = "Latitude of the venue location in degrees"] fn get_latitude < 'a > (& 'a self) -> f64 { self . latitude } # [doc = "Longitude of the venue location in degrees"] fn get_longitude < 'a > (& 'a self) -> f64 { self . longitude } # [doc = "Title of the venue"] fn get_title < 'a > (& 'a self) -> & 'a str { self . title . as_str () } # [doc = "Address of the venue"] fn get_address < 'a > (& 'a self) -> & 'a str { self . address . as_str () } # [doc = "Optional. Foursquare identifier of the venue if known"] fn get_foursquare_id < 'a > (& 'a self) -> Option < & 'a str > { self . foursquare_id . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Foursquare type of the venue, if known. (For example, \"arts_entertainment/default\", \"arts_entertainment/aquarium\" or \"food/icecream\".)"] fn get_foursquare_type < 'a > (& 'a self) -> Option < & 'a str > { self . foursquare_type . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Google Places identifier of the venue"] fn get_google_place_id < 'a > (& 'a self) -> Option < & 'a str > { self . google_place_id . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Google Places type of the venue. (See supported types.)"] fn get_google_place_type < 'a > (& 'a self) -> Option < & 'a str > { self . google_place_type . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Inline keyboard attached to the message"] fn get_reply_markup < 'a > (& 'a self) -> Option < & 'a InlineKeyboardMarkup > { self . reply_markup . as_ref () . map (| v | { v }) } # [doc = "Optional. Content of the message to be sent instead of the venue"] fn get_input_message_content < 'a > (& 'a self) -> Option < & 'a InputMessageContent > { self . input_message_content . as_ref () . map (| v | { v }) } # [doc = "Optional. Url of the thumbnail for the result"] fn get_thumb_url < 'a > (& 'a self) -> Option < & 'a str > { self . thumb_url . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Thumbnail width"] fn get_thumb_width < 'a > (& 'a self) -> Option < i64 > { self . thumb_width . as_ref () . map (| v | { * v }) } # [doc = "Optional. Thumbnail height"] fn get_thumb_height < 'a > (& 'a self) -> Option < i64 > { self . thumb_height . as_ref () . map (| v | { * v }) } } impl TraitInlineQueryResultVideo for InlineQueryResultVideo { # [doc = "Type of the result, must be video"] fn get_tg_type < 'a > (& 'a self) -> & 'a str { self . tg_type . as_str () } # [doc = "Unique identifier for this result, 1-64 bytes"] fn get_id < 'a > (& 'a self) -> & 'a str { self . id . as_str () } # [doc = "A valid URL for the embedded video player or video file"] fn get_video_url < 'a > (& 'a self) -> & 'a str { self . video_url . as_str () } # [doc = "MIME type of the content of the video URL, \"text/html\" or \"video/mp4\""] fn get_mime_type < 'a > (& 'a self) -> & 'a str { self . mime_type . as_str () } # [doc = "URL of the thumbnail (JPEG only) for the video"] fn get_thumb_url < 'a > (& 'a self) -> & 'a str { self . thumb_url . as_str () } # [doc = "Title for the result"] fn get_title < 'a > (& 'a self) -> & 'a str { self . title . as_str () } # [doc = "Optional. Caption of the video to be sent, 0-1024 characters after entities parsing"] fn get_caption < 'a > (& 'a self) -> Option < & 'a str > { self . caption . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Mode for parsing entities in the video caption. See formatting options for more details."] fn get_parse_mode < 'a > (& 'a self) -> Option < & 'a str > { self . parse_mode . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode"] fn get_caption_entities < 'a > (& 'a self) -> Option < & 'a Vec < MessageEntity > > { self . caption_entities . as_ref () . map (| v | { v }) } # [doc = "Optional. Video width"] fn get_video_width < 'a > (& 'a self) -> Option < i64 > { self . video_width . as_ref () . map (| v | { * v }) } # [doc = "Optional. Video height"] fn get_video_height < 'a > (& 'a self) -> Option < i64 > { self . video_height . as_ref () . map (| v | { * v }) } # [doc = "Optional. Video duration in seconds"] fn get_video_duration < 'a > (& 'a self) -> Option < i64 > { self . video_duration . as_ref () . map (| v | { * v }) } # [doc = "Optional. Short description of the result"] fn get_description < 'a > (& 'a self) -> Option < & 'a str > { self . description . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Inline keyboard attached to the message"] fn get_reply_markup < 'a > (& 'a self) -> Option < & 'a InlineKeyboardMarkup > { self . reply_markup . as_ref () . map (| v | { v }) } # [doc = "Optional. Content of the message to be sent instead of the video. This field is required if InlineQueryResultVideo is used to send an HTML-page as a result (e.g., a YouTube video)."] fn get_input_message_content < 'a > (& 'a self) -> Option < & 'a InputMessageContent > { self . input_message_content . as_ref () . map (| v | { v }) } } impl TraitInlineQueryResultVoice for InlineQueryResultVoice { # [doc = "Type of the result, must be voice"] fn get_tg_type < 'a > (& 'a self) -> & 'a str { self . tg_type . as_str () } # [doc = "Unique identifier for this result, 1-64 bytes"] fn get_id < 'a > (& 'a self) -> & 'a str { self . id . as_str () } # [doc = "A valid URL for the voice recording"] fn get_voice_url < 'a > (& 'a self) -> & 'a str { self . voice_url . as_str () } # [doc = "Recording title"] fn get_title < 'a > (& 'a self) -> & 'a str { self . title . as_str () } # [doc = "Optional. Caption, 0-1024 characters after entities parsing"] fn get_caption < 'a > (& 'a self) -> Option < & 'a str > { self . caption . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Mode for parsing entities in the voice message caption. See formatting options for more details."] fn get_parse_mode < 'a > (& 'a self) -> Option < & 'a str > { self . parse_mode . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode"] fn get_caption_entities < 'a > (& 'a self) -> Option < & 'a Vec < MessageEntity > > { self . caption_entities . as_ref () . map (| v | { v }) } # [doc = "Optional. Recording duration in seconds"] fn get_voice_duration < 'a > (& 'a self) -> Option < i64 > { self . voice_duration . as_ref () . map (| v | { * v }) } # [doc = "Optional. Inline keyboard attached to the message"] fn get_reply_markup < 'a > (& 'a self) -> Option < & 'a InlineKeyboardMarkup > { self . reply_markup . as_ref () . map (| v | { v }) } # [doc = "Optional. Content of the message to be sent instead of the voice recording"] fn get_input_message_content < 'a > (& 'a self) -> Option < & 'a InputMessageContent > { self . input_message_content . as_ref () . map (| v | { v }) } } # [allow (dead_code)] impl BotCommandScopeAllChatAdministrators { pub fn new () -> Self { Self { tg_type : "all_chat_administrators" . to_owned () , } } # [doc = "Scope type, must be all_chat_administrators"] pub fn get_tg_type < 'a > (& 'a self) -> & 'a str { self . tg_type . as_str () } } # [allow (dead_code)] impl Poll { pub fn new (id : String , question : String , options : Vec < PollOption > , total_voter_count : i64 , is_closed : bool , is_anonymous : bool , allows_multiple_answers : bool) -> Self { Self { tg_type : "Poll" . to_owned () , id , question , options , total_voter_count , is_closed , is_anonymous , allows_multiple_answers , correct_option_id : None , explanation : None , explanation_entities : None , open_period : None , close_date : None } } # [doc = "Unique poll identifier"] pub fn get_id < 'a > (& 'a self) -> & 'a str { self . id . as_str () } # [doc = "Poll question, 1-300 characters"] pub fn get_question < 'a > (& 'a self) -> & 'a str { self . question . as_str () } # [doc = "List of poll options"] pub fn get_options < 'a > (& 'a self) -> & 'a Vec < PollOption > { & self . options } # [doc = "Total number of users that voted in the poll"] pub fn get_total_voter_count < 'a > (& 'a self) -> i64 { self . total_voter_count } # [doc = "True, if the poll is closed"] pub fn get_is_closed < 'a > (& 'a self) -> bool { self . is_closed } # [doc = "True, if the poll is anonymous"] pub fn get_is_anonymous < 'a > (& 'a self) -> bool { self . is_anonymous } # [doc = "Poll type, currently can be \"regular\" or \"quiz\""] pub fn get_tg_type < 'a > (& 'a self) -> & 'a str { self . tg_type . as_str () } # [doc = "True, if the poll allows multiple answers"] pub fn get_allows_multiple_answers < 'a > (& 'a self) -> bool { self . allows_multiple_answers } # [doc = "Optional. 0-based identifier of the correct answer option. Available only for polls in the quiz mode, which are closed, or was sent (not forwarded) by the bot or to the private chat with the bot."] pub fn get_correct_option_id < 'a > (& 'a self) -> Option < i64 > { self . correct_option_id . as_ref () . map (| v | { * v }) } # [doc = "Optional. Text that is shown when a user chooses an incorrect answer or taps on the lamp icon in a quiz-style poll, 0-200 characters"] pub fn get_explanation < 'a > (& 'a self) -> Option < & 'a str > { self . explanation . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Special entities like usernames, URLs, bot commands, etc. that appear in the explanation"] pub fn get_explanation_entities < 'a > (& 'a self) -> Option < & 'a Vec < MessageEntity > > { self . explanation_entities . as_ref () . map (| v | { v }) } # [doc = "Optional. Amount of time in seconds the poll will be active after creation"] pub fn get_open_period < 'a > (& 'a self) -> Option < i64 > { self . open_period . as_ref () . map (| v | { * v }) } # [doc = "Optional. Point in time (Unix timestamp) when the poll will be automatically closed"] pub fn get_close_date < 'a > (& 'a self) -> Option < i64 > { self . close_date . as_ref () . map (| v | { * v }) } } # [allow (dead_code)] impl MenuButtonDefault { pub fn new () -> Self { Self { tg_type : "default" . to_owned () , } } # [doc = "Type of the button, must be default"] pub fn get_tg_type < 'a > (& 'a self) -> & 'a str { self . tg_type . as_str () } } # [allow (dead_code)] impl KeyboardButtonPollType { pub fn new () -> Self { Self { tg_type : Some ("KeyboardButtonPollType" . to_owned ()) } } # [doc = "Optional. If quiz is passed, the user will be allowed to create only polls in the quiz mode. If regular is passed, only regular polls will be allowed. Otherwise, the user will be allowed to create a poll of any type."] pub fn get_tg_type < 'a > (& 'a self) -> Option < & 'a str > { self . tg_type . as_ref () . map (| v | { v . as_str () }) } } # [allow (dead_code)] impl ChatAdministratorRights { pub fn new (is_anonymous : bool , can_manage_chat : bool , can_delete_messages : bool , can_manage_video_chats : bool , can_restrict_members : bool , can_promote_members : bool , can_change_info : bool , can_invite_users : bool) -> Self { Self { is_anonymous , can_manage_chat , can_delete_messages , can_manage_video_chats , can_restrict_members , can_promote_members , can_change_info , can_invite_users , can_post_messages : None , can_edit_messages : None , can_pin_messages : None } } # [doc = "True, if the user's presence in the chat is hidden"] pub fn get_is_anonymous < 'a > (& 'a self) -> bool { self . is_anonymous } # [doc = "True, if the administrator can access the chat event log, chat statistics, message statistics in channels, see channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other administrator privilege"] pub fn get_can_manage_chat < 'a > (& 'a self) -> bool { self . can_manage_chat } # [doc = "True, if the administrator can delete messages of other users"] pub fn get_can_delete_messages < 'a > (& 'a self) -> bool { self . can_delete_messages } # [doc = "True, if the administrator can manage video chats"] pub fn get_can_manage_video_chats < 'a > (& 'a self) -> bool { self . can_manage_video_chats } # [doc = "True, if the administrator can restrict, ban or unban chat members"] pub fn get_can_restrict_members < 'a > (& 'a self) -> bool { self . can_restrict_members } # [doc = "True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by the user)"] pub fn get_can_promote_members < 'a > (& 'a self) -> bool { self . can_promote_members } # [doc = "True, if the user is allowed to change the chat title, photo and other settings"] pub fn get_can_change_info < 'a > (& 'a self) -> bool { self . can_change_info } # [doc = "True, if the user is allowed to invite new users to the chat"] pub fn get_can_invite_users < 'a > (& 'a self) -> bool { self . can_invite_users } # [doc = "Optional. True, if the administrator can post in the channel; channels only"] pub fn get_can_post_messages < 'a > (& 'a self) -> Option < bool > { self . can_post_messages . as_ref () . map (| v | { * v }) } # [doc = "Optional. True, if the administrator can edit messages of other users and can pin messages; channels only"] pub fn get_can_edit_messages < 'a > (& 'a self) -> Option < bool > { self . can_edit_messages . as_ref () . map (| v | { * v }) } # [doc = "Optional. True, if the user is allowed to pin messages; groups and supergroups only"] pub fn get_can_pin_messages < 'a > (& 'a self) -> Option < bool > { self . can_pin_messages . as_ref () . map (| v | { * v }) } } # [allow (dead_code)] impl ProximityAlertTriggered { pub fn new (traveler : User , watcher : User , distance : i64) -> Self { Self { traveler , watcher , distance , } } # [doc = "User that triggered the alert"] pub fn get_traveler < 'a > (& 'a self) -> & 'a User { & self . traveler } # [doc = "User that set the alert"] pub fn get_watcher < 'a > (& 'a self) -> & 'a User { & self . watcher } # [doc = "The distance between the users"] pub fn get_distance < 'a > (& 'a self) -> i64 { self . distance } } # [allow (dead_code)] impl ChatMemberMember { pub fn new (status : String , user : User) -> Self { Self { status , user , } } # [doc = "The member's status in the chat, always \"member\""] pub fn get_status < 'a > (& 'a self) -> & 'a str { self . status . as_str () } # [doc = "Information about the user"] pub fn get_user < 'a > (& 'a self) -> & 'a User { & self . user } } # [allow (dead_code)] impl Voice { pub fn new (file_id : String , file_unique_id : String , duration : i64) -> Self { Self { file_id , file_unique_id , duration , mime_type : None , file_size : None } } # [doc = "Identifier for this file, which can be used to download or reuse the file"] pub fn get_file_id < 'a > (& 'a self) -> & 'a str { self . file_id . as_str () } # [doc = "Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file."] pub fn get_file_unique_id < 'a > (& 'a self) -> & 'a str { self . file_unique_id . as_str () } # [doc = "Duration of the audio in seconds as defined by sender"] pub fn get_duration < 'a > (& 'a self) -> i64 { self . duration } # [doc = "Optional. MIME type of the file as defined by sender"] pub fn get_mime_type < 'a > (& 'a self) -> Option < & 'a str > { self . mime_type . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value."] pub fn get_file_size < 'a > (& 'a self) -> Option < i64 > { self . file_size . as_ref () . map (| v | { * v }) } } # [allow (dead_code)] impl EncryptedPassportElement { pub fn new (hash : String) -> Self { Self { tg_type : "EncryptedPassportElement" . to_owned () , hash , data : None , phone_number : None , email : None , files : None , front_side : None , reverse_side : None , selfie : None , translation : None } } # [doc = "Element type. One of \"personal_details\", \"passport\", \"driver_license\", \"identity_card\", \"internal_passport\", \"address\", \"utility_bill\", \"bank_statement\", \"rental_agreement\", \"passport_registration\", \"temporary_registration\", \"phone_number\", \"email\"."] pub fn get_tg_type < 'a > (& 'a self) -> & 'a str { self . tg_type . as_str () } # [doc = "Optional. Base64-encoded encrypted Telegram Passport element data provided by the user, available for \"personal_details\", \"passport\", \"driver_license\", \"identity_card\", \"internal_passport\" and \"address\" types. Can be decrypted and verified using the accompanying EncryptedCredentials."] pub fn get_data < 'a > (& 'a self) -> Option < & 'a str > { self . data . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. User's verified phone number, available only for \"phone_number\" type"] pub fn get_phone_number < 'a > (& 'a self) -> Option < & 'a str > { self . phone_number . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. User's verified email address, available only for \"email\" type"] pub fn get_email < 'a > (& 'a self) -> Option < & 'a str > { self . email . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Array of encrypted files with documents provided by the user, available for \"utility_bill\", \"bank_statement\", \"rental_agreement\", \"passport_registration\" and \"temporary_registration\" types. Files can be decrypted and verified using the accompanying EncryptedCredentials."] pub fn get_files < 'a > (& 'a self) -> Option < & 'a Vec < PassportFile > > { self . files . as_ref () . map (| v | { v }) } # [doc = "Optional. Encrypted file with the front side of the document, provided by the user. Available for \"passport\", \"driver_license\", \"identity_card\" and \"internal_passport\". The file can be decrypted and verified using the accompanying EncryptedCredentials."] pub fn get_front_side < 'a > (& 'a self) -> Option < & 'a PassportFile > { self . front_side . as_ref () . map (| v | { v }) } # [doc = "Optional. Encrypted file with the reverse side of the document, provided by the user. Available for \"driver_license\" and \"identity_card\". The file can be decrypted and verified using the accompanying EncryptedCredentials."] pub fn get_reverse_side < 'a > (& 'a self) -> Option < & 'a PassportFile > { self . reverse_side . as_ref () . map (| v | { v }) } # [doc = "Optional. Encrypted file with the selfie of the user holding a document, provided by the user; available for \"passport\", \"driver_license\", \"identity_card\" and \"internal_passport\". The file can be decrypted and verified using the accompanying EncryptedCredentials."] pub fn get_selfie < 'a > (& 'a self) -> Option < & 'a PassportFile > { self . selfie . as_ref () . map (| v | { v }) } # [doc = "Optional. Array of encrypted files with translated versions of documents provided by the user. Available if requested for \"passport\", \"driver_license\", \"identity_card\", \"internal_passport\", \"utility_bill\", \"bank_statement\", \"rental_agreement\", \"passport_registration\" and \"temporary_registration\" types. Files can be decrypted and verified using the accompanying EncryptedCredentials."] pub fn get_translation < 'a > (& 'a self) -> Option < & 'a Vec < PassportFile > > { self . translation . as_ref () . map (| v | { v }) } # [doc = "Base64-encoded element hash for using in PassportElementErrorUnspecified"] pub fn get_hash < 'a > (& 'a self) -> & 'a str { self . hash . as_str () } } # [allow (dead_code)] impl Location { pub fn new (longitude : f64 , latitude : f64) -> Self { Self { longitude , latitude , horizontal_accuracy : None , live_period : None , heading : None , proximity_alert_radius : None } } # [doc = "Longitude as defined by sender"] pub fn get_longitude < 'a > (& 'a self) -> f64 { self . longitude } # [doc = "Latitude as defined by sender"] pub fn get_latitude < 'a > (& 'a self) -> f64 { self . latitude } # [doc = "Optional. The radius of uncertainty for the location, measured in meters; 0-1500"] pub fn get_horizontal_accuracy < 'a > (& 'a self) -> Option < f64 > { self . horizontal_accuracy . as_ref () . map (| v | { * v }) } # [doc = "Optional. Time relative to the message sending date, during which the location can be updated; in seconds. For active live locations only."] pub fn get_live_period < 'a > (& 'a self) -> Option < i64 > { self . live_period . as_ref () . map (| v | { * v }) } # [doc = "Optional. The direction in which user is moving, in degrees; 1-360. For active live locations only."] pub fn get_heading < 'a > (& 'a self) -> Option < i64 > { self . heading . as_ref () . map (| v | { * v }) } # [doc = "Optional. The maximum distance for proximity alerts about approaching another chat member, in meters. For sent live locations only."] pub fn get_proximity_alert_radius < 'a > (& 'a self) -> Option < i64 > { self . proximity_alert_radius . as_ref () . map (| v | { * v }) } } # [allow (dead_code)] impl InlineQueryResultCachedMpeg4Gif { pub fn new (id : String , mpeg_4_file_id : String) -> Self { Self { tg_type : "mpeg4_gif" . to_owned () , id , mpeg_4_file_id , title : None , caption : None , parse_mode : None , caption_entities : None , reply_markup : None , input_message_content : None } } # [doc = "Type of the result, must be mpeg4_gif"] pub fn get_tg_type < 'a > (& 'a self) -> & 'a str { self . tg_type . as_str () } # [doc = "Unique identifier for this result, 1-64 bytes"] pub fn get_id < 'a > (& 'a self) -> & 'a str { self . id . as_str () } # [doc = "A valid file identifier for the MPEG4 file"] pub fn get_mpeg_4_file_id < 'a > (& 'a self) -> & 'a str { self . mpeg_4_file_id . as_str () } # [doc = "Optional. Title for the result"] pub fn get_title < 'a > (& 'a self) -> Option < & 'a str > { self . title . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Caption of the MPEG-4 file to be sent, 0-1024 characters after entities parsing"] pub fn get_caption < 'a > (& 'a self) -> Option < & 'a str > { self . caption . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Mode for parsing entities in the caption. See formatting options for more details."] pub fn get_parse_mode < 'a > (& 'a self) -> Option < & 'a str > { self . parse_mode . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode"] pub fn get_caption_entities < 'a > (& 'a self) -> Option < & 'a Vec < MessageEntity > > { self . caption_entities . as_ref () . map (| v | { v }) } # [doc = "Optional. Inline keyboard attached to the message"] pub fn get_reply_markup < 'a > (& 'a self) -> Option < & 'a InlineKeyboardMarkup > { self . reply_markup . as_ref () . map (| v | { v }) } # [doc = "Optional. Content of the message to be sent instead of the video animation"] pub fn get_input_message_content < 'a > (& 'a self) -> Option < & 'a InputMessageContent > { self . input_message_content . as_ref () . map (| v | { v }) } } # [allow (dead_code)] impl MessageAutoDeleteTimerChanged { pub fn new (message_auto_delete_time : i64) -> Self { Self { message_auto_delete_time , } } # [doc = "New auto-delete time for messages in the chat; in seconds"] pub fn get_message_auto_delete_time < 'a > (& 'a self) -> i64 { self . message_auto_delete_time } } # [allow (dead_code)] impl Game { pub fn new (title : String , description : String , photo : Vec < PhotoSize >) -> Self { Self { title , description , photo , text : None , text_entities : None , animation : None } } # [doc = "Title of the game"] pub fn get_title < 'a > (& 'a self) -> & 'a str { self . title . as_str () } # [doc = "Description of the game"] pub fn get_description < 'a > (& 'a self) -> & 'a str { self . description . as_str () } # [doc = "Photo that will be displayed in the game message in chats."] pub fn get_photo < 'a > (& 'a self) -> & 'a Vec < PhotoSize > { & self . photo } # [doc = "Optional. Brief description of the game or high scores included in the game message. Can be automatically edited to include current high scores for the game when the bot calls setGameScore, or manually edited using editMessageText. 0-4096 characters."] pub fn get_text < 'a > (& 'a self) -> Option < & 'a str > { self . text . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Special entities that appear in text, such as usernames, URLs, bot commands, etc."] pub fn get_text_entities < 'a > (& 'a self) -> Option < & 'a Vec < MessageEntity > > { self . text_entities . as_ref () . map (| v | { v }) } # [doc = "Optional. Animation that will be displayed in the game message in chats. Upload via BotFather"] pub fn get_animation < 'a > (& 'a self) -> Option < & 'a Animation > { self . animation . as_ref () . map (| v | { v }) } } # [allow (dead_code)] impl GameHighScore { pub fn new (position : i64 , user : User , score : i64) -> Self { Self { position , user , score , } } # [doc = "Position in high score table for the game"] pub fn get_position < 'a > (& 'a self) -> i64 { self . position } # [doc = "User"] pub fn get_user < 'a > (& 'a self) -> & 'a User { & self . user } # [doc = "Score"] pub fn get_score < 'a > (& 'a self) -> i64 { self . score } } # [allow (dead_code)] impl ChatPermissions { pub fn new () -> Self { Self { can_send_messages : None , can_send_media_messages : None , can_send_polls : None , can_send_other_messages : None , can_add_web_page_previews : None , can_change_info : None , can_invite_users : None , can_pin_messages : None } } # [doc = "Optional. True, if the user is allowed to send text messages, contacts, locations and venues"] pub fn get_can_send_messages < 'a > (& 'a self) -> Option < bool > { self . can_send_messages . as_ref () . map (| v | { * v }) } # [doc = "Optional. True, if the user is allowed to send audios, documents, photos, videos, video notes and voice notes, implies can_send_messages"] pub fn get_can_send_media_messages < 'a > (& 'a self) -> Option < bool > { self . can_send_media_messages . as_ref () . map (| v | { * v }) } # [doc = "Optional. True, if the user is allowed to send polls, implies can_send_messages"] pub fn get_can_send_polls < 'a > (& 'a self) -> Option < bool > { self . can_send_polls . as_ref () . map (| v | { * v }) } # [doc = "Optional. True, if the user is allowed to send animations, games, stickers and use inline bots, implies can_send_media_messages"] pub fn get_can_send_other_messages < 'a > (& 'a self) -> Option < bool > { self . can_send_other_messages . as_ref () . map (| v | { * v }) } # [doc = "Optional. True, if the user is allowed to add web page previews to their messages, implies can_send_media_messages"] pub fn get_can_add_web_page_previews < 'a > (& 'a self) -> Option < bool > { self . can_add_web_page_previews . as_ref () . map (| v | { * v }) } # [doc = "Optional. True, if the user is allowed to change the chat title, photo and other settings. Ignored in public supergroups"] pub fn get_can_change_info < 'a > (& 'a self) -> Option < bool > { self . can_change_info . as_ref () . map (| v | { * v }) } # [doc = "Optional. True, if the user is allowed to invite new users to the chat"] pub fn get_can_invite_users < 'a > (& 'a self) -> Option < bool > { self . can_invite_users . as_ref () . map (| v | { * v }) } # [doc = "Optional. True, if the user is allowed to pin messages. Ignored in public supergroups"] pub fn get_can_pin_messages < 'a > (& 'a self) -> Option < bool > { self . can_pin_messages . as_ref () . map (| v | { * v }) } } # [allow (dead_code)] impl InlineQueryResultCachedSticker { pub fn new (id : String , sticker_file_id : String) -> Self { Self { tg_type : "sticker" . to_owned () , id , sticker_file_id , reply_markup : None , input_message_content : None } } # [doc = "Type of the result, must be sticker"] pub fn get_tg_type < 'a > (& 'a self) -> & 'a str { self . tg_type . as_str () } # [doc = "Unique identifier for this result, 1-64 bytes"] pub fn get_id < 'a > (& 'a self) -> & 'a str { self . id . as_str () } # [doc = "A valid file identifier of the sticker"] pub fn get_sticker_file_id < 'a > (& 'a self) -> & 'a str { self . sticker_file_id . as_str () } # [doc = "Optional. Inline keyboard attached to the message"] pub fn get_reply_markup < 'a > (& 'a self) -> Option < & 'a InlineKeyboardMarkup > { self . reply_markup . as_ref () . map (| v | { v }) } # [doc = "Optional. Content of the message to be sent instead of the sticker"] pub fn get_input_message_content < 'a > (& 'a self) -> Option < & 'a InputMessageContent > { self . input_message_content . as_ref () . map (| v | { v }) } } # [allow (dead_code)] impl BotCommandScopeAllPrivateChats { pub fn new () -> Self { Self { tg_type : "all_private_chats" . to_owned () , } } # [doc = "Scope type, must be all_private_chats"] pub fn get_tg_type < 'a > (& 'a self) -> & 'a str { self . tg_type . as_str () } } impl TraitMenuButtonCommands for MenuButtonCommands { # [doc = "Type of the button, must be commands"] fn get_tg_type < 'a > (& 'a self) -> & 'a str { self . tg_type . as_str () } } impl TraitMenuButtonWebApp for MenuButtonWebApp { # [doc = "Type of the button, must be web_app"] fn get_tg_type < 'a > (& 'a self) -> & 'a str { self . tg_type . as_str () } # [doc = "Text on the button"] fn get_text < 'a > (& 'a self) -> & 'a str { self . text . as_str () } # [doc = "Description of the Web App that will be launched when the user presses the button. The Web App will be able to send an arbitrary message on behalf of the user using the method answerWebAppQuery."] fn get_web_app < 'a > (& 'a self) -> & 'a WebAppInfo { & self . web_app } } impl TraitMenuButtonDefault for MenuButtonDefault { # [doc = "Type of the button, must be default"] fn get_tg_type < 'a > (& 'a self) -> & 'a str { self . tg_type . as_str () } } # [allow (dead_code)] impl InlineQueryResultAudio { pub fn new (id : String , audio_url : String , title : String) -> Self { Self { tg_type : "audio" . to_owned () , id , audio_url , title , caption : None , parse_mode : None , caption_entities : None , performer : None , audio_duration : None , reply_markup : None , input_message_content : None } } # [doc = "Type of the result, must be audio"] pub fn get_tg_type < 'a > (& 'a self) -> & 'a str { self . tg_type . as_str () } # [doc = "Unique identifier for this result, 1-64 bytes"] pub fn get_id < 'a > (& 'a self) -> & 'a str { self . id . as_str () } # [doc = "A valid URL for the audio file"] pub fn get_audio_url < 'a > (& 'a self) -> & 'a str { self . audio_url . as_str () } # [doc = "Title"] pub fn get_title < 'a > (& 'a self) -> & 'a str { self . title . as_str () } # [doc = "Optional. Caption, 0-1024 characters after entities parsing"] pub fn get_caption < 'a > (& 'a self) -> Option < & 'a str > { self . caption . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Mode for parsing entities in the audio caption. See formatting options for more details."] pub fn get_parse_mode < 'a > (& 'a self) -> Option < & 'a str > { self . parse_mode . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode"] pub fn get_caption_entities < 'a > (& 'a self) -> Option < & 'a Vec < MessageEntity > > { self . caption_entities . as_ref () . map (| v | { v }) } # [doc = "Optional. Performer"] pub fn get_performer < 'a > (& 'a self) -> Option < & 'a str > { self . performer . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Audio duration in seconds"] pub fn get_audio_duration < 'a > (& 'a self) -> Option < i64 > { self . audio_duration . as_ref () . map (| v | { * v }) } # [doc = "Optional. Inline keyboard attached to the message"] pub fn get_reply_markup < 'a > (& 'a self) -> Option < & 'a InlineKeyboardMarkup > { self . reply_markup . as_ref () . map (| v | { v }) } # [doc = "Optional. Content of the message to be sent instead of the audio"] pub fn get_input_message_content < 'a > (& 'a self) -> Option < & 'a InputMessageContent > { self . input_message_content . as_ref () . map (| v | { v }) } } # [allow (dead_code)] impl BotCommandScopeAllGroupChats { pub fn new () -> Self { Self { tg_type : "all_group_chats" . to_owned () , } } # [doc = "Scope type, must be all_group_chats"] pub fn get_tg_type < 'a > (& 'a self) -> & 'a str { self . tg_type . as_str () } } # [allow (dead_code)] impl BotCommandScopeChatAdministrators { pub fn new (chat_id : i64) -> Self { Self { tg_type : "chat_administrators" . to_owned () , chat_id , } } # [doc = "Scope type, must be chat_administrators"] pub fn get_tg_type < 'a > (& 'a self) -> & 'a str { self . tg_type . as_str () } # [doc = "Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)"] pub fn get_chat_id < 'a > (& 'a self) -> i64 { self . chat_id } } # [allow (dead_code)] impl EncryptedCredentials { pub fn new (data : String , hash : String , secret : String) -> Self { Self { data , hash , secret , } } # [doc = "Base64-encoded encrypted JSON-serialized data with unique user's payload, data hashes and secrets required for EncryptedPassportElement decryption and authentication"] pub fn get_data < 'a > (& 'a self) -> & 'a str { self . data . as_str () } # [doc = "Base64-encoded data hash for data authentication"] pub fn get_hash < 'a > (& 'a self) -> & 'a str { self . hash . as_str () } # [doc = "Base64-encoded secret, encrypted with the bot's public RSA key, required for data decryption"] pub fn get_secret < 'a > (& 'a self) -> & 'a str { self . secret . as_str () } } # [allow (dead_code)] impl VideoChatParticipantsInvited { pub fn new (users : Vec < User >) -> Self { Self { users , } } # [doc = "New members that were invited to the video chat"] pub fn get_users < 'a > (& 'a self) -> & 'a Vec < User > { & self . users } } # [allow (dead_code)] impl VideoChatEnded { pub fn new (duration : i64) -> Self { Self { duration , } } # [doc = "Video chat duration in seconds"] pub fn get_duration < 'a > (& 'a self) -> i64 { self . duration } } # [allow (dead_code)] impl InputVenueMessageContent { pub fn new (latitude : f64 , longitude : f64 , title : String , address : String) -> Self { Self { latitude , longitude , title , address , foursquare_id : None , foursquare_type : None , google_place_id : None , google_place_type : None } } # [doc = "Latitude of the venue in degrees"] pub fn get_latitude < 'a > (& 'a self) -> f64 { self . latitude } # [doc = "Longitude of the venue in degrees"] pub fn get_longitude < 'a > (& 'a self) -> f64 { self . longitude } # [doc = "Name of the venue"] pub fn get_title < 'a > (& 'a self) -> & 'a str { self . title . as_str () } # [doc = "Address of the venue"] pub fn get_address < 'a > (& 'a self) -> & 'a str { self . address . as_str () } # [doc = "Optional. Foursquare identifier of the venue, if known"] pub fn get_foursquare_id < 'a > (& 'a self) -> Option < & 'a str > { self . foursquare_id . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Foursquare type of the venue, if known. (For example, \"arts_entertainment/default\", \"arts_entertainment/aquarium\" or \"food/icecream\".)"] pub fn get_foursquare_type < 'a > (& 'a self) -> Option < & 'a str > { self . foursquare_type . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Google Places identifier of the venue"] pub fn get_google_place_id < 'a > (& 'a self) -> Option < & 'a str > { self . google_place_id . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Google Places type of the venue. (See supported types.)"] pub fn get_google_place_type < 'a > (& 'a self) -> Option < & 'a str > { self . google_place_type . as_ref () . map (| v | { v . as_str () }) } } # [allow (dead_code)] impl ChatJoinRequest { pub fn new (chat : Box < Chat > , from : User , date : i64) -> Self { Self { chat , from , date , bio : None , invite_link : None } } # [doc = "Chat to which the request was sent"] pub fn get_chat < 'a > (& 'a self) -> & 'a Chat { self . chat . as_ref () } # [doc = "User that sent the join request"] pub fn get_from < 'a > (& 'a self) -> & 'a User { & self . from } # [doc = "Date the request was sent in Unix time"] pub fn get_date < 'a > (& 'a self) -> i64 { self . date } # [doc = "Optional. Bio of the user."] pub fn get_bio < 'a > (& 'a self) -> Option < & 'a str > { self . bio . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Chat invite link that was used by the user to send the join request"] pub fn get_invite_link < 'a > (& 'a self) -> Option < & 'a ChatInviteLink > { self . invite_link . as_ref () . map (| v | { v }) } } # [allow (dead_code)] impl PassportElementErrorFiles { pub fn new (source : String , file_hashes : Vec < String > , message : String) -> Self { Self { tg_type : "PassportElementErrorFiles" . to_owned () , source , file_hashes , message , } } # [doc = "Error source, must be files"] pub fn get_source < 'a > (& 'a self) -> & 'a str { self . source . as_str () } # [doc = "The section of the user's Telegram Passport which has the issue, one of \"utility_bill\", \"bank_statement\", \"rental_agreement\", \"passport_registration\", \"temporary_registration\""] pub fn get_tg_type < 'a > (& 'a self) -> & 'a str { self . tg_type . as_str () } # [doc = "List of base64-encoded file hashes"] pub fn get_file_hashes < 'a > (& 'a self) -> & 'a Vec < String > { & self . file_hashes } # [doc = "Error message"] pub fn get_message < 'a > (& 'a self) -> & 'a str { self . message . as_str () } } # [allow (dead_code)] impl InlineQueryResultCachedDocument { pub fn new (id : String , title : String , document_file_id : String) -> Self { Self { tg_type : "document" . to_owned () , id , title , document_file_id , description : None , caption : None , parse_mode : None , caption_entities : None , reply_markup : None , input_message_content : None } } # [doc = "Type of the result, must be document"] pub fn get_tg_type < 'a > (& 'a self) -> & 'a str { self . tg_type . as_str () } # [doc = "Unique identifier for this result, 1-64 bytes"] pub fn get_id < 'a > (& 'a self) -> & 'a str { self . id . as_str () } # [doc = "Title for the result"] pub fn get_title < 'a > (& 'a self) -> & 'a str { self . title . as_str () } # [doc = "A valid file identifier for the file"] pub fn get_document_file_id < 'a > (& 'a self) -> & 'a str { self . document_file_id . as_str () } # [doc = "Optional. Short description of the result"] pub fn get_description < 'a > (& 'a self) -> Option < & 'a str > { self . description . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Caption of the document to be sent, 0-1024 characters after entities parsing"] pub fn get_caption < 'a > (& 'a self) -> Option < & 'a str > { self . caption . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Mode for parsing entities in the document caption. See formatting options for more details."] pub fn get_parse_mode < 'a > (& 'a self) -> Option < & 'a str > { self . parse_mode . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode"] pub fn get_caption_entities < 'a > (& 'a self) -> Option < & 'a Vec < MessageEntity > > { self . caption_entities . as_ref () . map (| v | { v }) } # [doc = "Optional. Inline keyboard attached to the message"] pub fn get_reply_markup < 'a > (& 'a self) -> Option < & 'a InlineKeyboardMarkup > { self . reply_markup . as_ref () . map (| v | { v }) } # [doc = "Optional. Content of the message to be sent instead of the file"] pub fn get_input_message_content < 'a > (& 'a self) -> Option < & 'a InputMessageContent > { self . input_message_content . as_ref () . map (| v | { v }) } } # [allow (dead_code)] impl InlineQueryResultCachedAudio { pub fn new (id : String , audio_file_id : String) -> Self { Self { tg_type : "audio" . to_owned () , id , audio_file_id , caption : None , parse_mode : None , caption_entities : None , reply_markup : None , input_message_content : None } } # [doc = "Type of the result, must be audio"] pub fn get_tg_type < 'a > (& 'a self) -> & 'a str { self . tg_type . as_str () } # [doc = "Unique identifier for this result, 1-64 bytes"] pub fn get_id < 'a > (& 'a self) -> & 'a str { self . id . as_str () } # [doc = "A valid file identifier for the audio file"] pub fn get_audio_file_id < 'a > (& 'a self) -> & 'a str { self . audio_file_id . as_str () } # [doc = "Optional. Caption, 0-1024 characters after entities parsing"] pub fn get_caption < 'a > (& 'a self) -> Option < & 'a str > { self . caption . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Mode for parsing entities in the audio caption. See formatting options for more details."] pub fn get_parse_mode < 'a > (& 'a self) -> Option < & 'a str > { self . parse_mode . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode"] pub fn get_caption_entities < 'a > (& 'a self) -> Option < & 'a Vec < MessageEntity > > { self . caption_entities . as_ref () . map (| v | { v }) } # [doc = "Optional. Inline keyboard attached to the message"] pub fn get_reply_markup < 'a > (& 'a self) -> Option < & 'a InlineKeyboardMarkup > { self . reply_markup . as_ref () . map (| v | { v }) } # [doc = "Optional. Content of the message to be sent instead of the audio"] pub fn get_input_message_content < 'a > (& 'a self) -> Option < & 'a InputMessageContent > { self . input_message_content . as_ref () . map (| v | { v }) } } # [allow (dead_code)] impl ChatInviteLink { pub fn new (invite_link : String , creator : User , creates_join_request : bool , is_primary : bool , is_revoked : bool) -> Self { Self { invite_link , creator , creates_join_request , is_primary , is_revoked , name : None , expire_date : None , member_limit : None , pending_join_request_count : None } } # [doc = "The invite link. If the link was created by another chat administrator, then the second part of the link will be replaced with \"...\"."] pub fn get_invite_link < 'a > (& 'a self) -> & 'a str { self . invite_link . as_str () } # [doc = "Creator of the link"] pub fn get_creator < 'a > (& 'a self) -> & 'a User { & self . creator } # [doc = "True, if users joining the chat via the link need to be approved by chat administrators"] pub fn get_creates_join_request < 'a > (& 'a self) -> bool { self . creates_join_request } # [doc = "True, if the link is primary"] pub fn get_is_primary < 'a > (& 'a self) -> bool { self . is_primary } # [doc = "True, if the link is revoked"] pub fn get_is_revoked < 'a > (& 'a self) -> bool { self . is_revoked } # [doc = "Optional. Invite link name"] pub fn get_name < 'a > (& 'a self) -> Option < & 'a str > { self . name . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Point in time (Unix timestamp) when the link will expire or has been expired"] pub fn get_expire_date < 'a > (& 'a self) -> Option < i64 > { self . expire_date . as_ref () . map (| v | { * v }) } # [doc = "Optional. The maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999"] pub fn get_member_limit < 'a > (& 'a self) -> Option < i64 > { self . member_limit . as_ref () . map (| v | { * v }) } # [doc = "Optional. Number of pending join requests created using this link"] pub fn get_pending_join_request_count < 'a > (& 'a self) -> Option < i64 > { self . pending_join_request_count . as_ref () . map (| v | { * v }) } } # [allow (dead_code)] impl InputMediaAudio { pub fn new (media : Option < InputFile >) -> Self { Self { tg_type : "audio" . to_owned () , media , thumb : None , caption : None , parse_mode : None , caption_entities : None , duration : None , performer : None , title : None } } # [doc = "Type of the result, must be audio"] pub fn get_tg_type < 'a > (& 'a self) -> & 'a str { self . tg_type . as_str () } # [doc = "File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass \"attach://<file_attach_name>\" to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files: https://core.telegram.org/bots/api#sending-files"] pub fn get_media < 'a > (& 'a self) -> & 'a Option < InputFile > { & self . media } # [doc = "Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass \"attach://<file_attach_name>\" if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files: https://core.telegram.org/bots/api#sending-files"] pub fn get_thumb < 'a > (& 'a self) -> Option < & 'a InputFile > { self . thumb . as_ref () . map (| v | { v }) } # [doc = "Optional. Caption of the audio to be sent, 0-1024 characters after entities parsing"] pub fn get_caption < 'a > (& 'a self) -> Option < & 'a str > { self . caption . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Mode for parsing entities in the audio caption. See formatting options for more details."] pub fn get_parse_mode < 'a > (& 'a self) -> Option < & 'a str > { self . parse_mode . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode"] pub fn get_caption_entities < 'a > (& 'a self) -> Option < & 'a Vec < MessageEntity > > { self . caption_entities . as_ref () . map (| v | { v }) } # [doc = "Optional. Duration of the audio in seconds"] pub fn get_duration < 'a > (& 'a self) -> Option < i64 > { self . duration . as_ref () . map (| v | { * v }) } # [doc = "Optional. Performer of the audio"] pub fn get_performer < 'a > (& 'a self) -> Option < & 'a str > { self . performer . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Title of the audio"] pub fn get_title < 'a > (& 'a self) -> Option < & 'a str > { self . title . as_ref () . map (| v | { v . as_str () }) } fn to_form (self , data : Form) -> Result < (Form , String) > { match self . media { Some (InputFile :: Bytes (FileBytes { name , bytes : Some (bytes) })) => { let attach = format ! ("attach://{}" , name) ; let form = data . part (name , Part :: bytes (bytes)) ; Ok ((form , attach)) } Some (InputFile :: String (name)) => Ok ((data , name)) , _ => Err (anyhow ! ("cry")) , } } } # [allow (dead_code)] impl MenuButtonCommands { pub fn new () -> Self { Self { tg_type : "commands" . to_owned () , } } # [doc = "Type of the button, must be commands"] pub fn get_tg_type < 'a > (& 'a self) -> & 'a str { self . tg_type . as_str () } } # [allow (dead_code)] impl InputFile { pub fn to_form (self , data : Form) -> Result < (Form , String) > { match self { InputFile :: Bytes (FileBytes { name , bytes : Some (bytes) }) => { let attach = format ! ("attach://{}" , name) ; let form = data . part (name , Part :: bytes (bytes) . file_name ("")) ; Ok ((form , attach)) } InputFile :: String (name) => Ok ((data , name)) , _ => Err (anyhow ! ("cry")) , } } } # [allow (dead_code)] impl Message { pub fn new (message_id : i64 , date : i64 , chat : Box < Chat >) -> Self { Self { message_id , date , chat , from : None , sender_chat : None , forward_from : None , forward_from_chat : None , forward_from_message_id : None , forward_signature : None , forward_sender_name : None , forward_date : None , is_automatic_forward : None , reply_to_message : None , via_bot : None , edit_date : None , has_protected_content : None , media_group_id : None , author_signature : None , text : None , entities : None , animation : None , audio : None , document : None , photo : None , sticker : None , video : None , video_note : None , voice : None , caption : None , caption_entities : None , contact : None , dice : None , game : None , poll : None , venue : None , location : None , new_chat_members : None , left_chat_member : None , new_chat_title : None , new_chat_photo : None , delete_chat_photo : None , group_chat_created : None , supergroup_chat_created : None , channel_chat_created : None , message_auto_delete_timer_changed : None , migrate_to_chat_id : None , migrate_from_chat_id : None , pinned_message : None , invoice : None , successful_payment : None , connected_website : None , passport_data : None , proximity_alert_triggered : None , video_chat_scheduled : None , video_chat_started : None , video_chat_ended : None , video_chat_participants_invited : None , web_app_data : None , reply_markup : None } } # [doc = "Unique message identifier inside this chat"] pub fn get_message_id < 'a > (& 'a self) -> i64 { self . message_id } # [doc = "Optional. Sender of the message; empty for messages sent to channels. For backward compatibility, the field contains a fake sender user in non-channel chats, if the message was sent on behalf of a chat."] pub fn get_from < 'a > (& 'a self) -> Option < & 'a User > { self . from . as_ref () . map (| v | { v }) } # [doc = "Optional. Sender of the message, sent on behalf of a chat. For example, the channel itself for channel posts, the supergroup itself for messages from anonymous group administrators, the linked channel for messages automatically forwarded to the discussion group. For backward compatibility, the field from contains a fake sender user in non-channel chats, if the message was sent on behalf of a chat."] pub fn get_sender_chat < 'a > (& 'a self) -> Option < & 'a Chat > { self . sender_chat . as_ref () . map (| v | { v . as_ref () }) } # [doc = "Date the message was sent in Unix time"] pub fn get_date < 'a > (& 'a self) -> i64 { self . date } # [doc = "Conversation the message belongs to"] pub fn get_chat < 'a > (& 'a self) -> & 'a Chat { self . chat . as_ref () } # [doc = "Optional. For forwarded messages, sender of the original message"] pub fn get_forward_from < 'a > (& 'a self) -> Option < & 'a User > { self . forward_from . as_ref () . map (| v | { v }) } # [doc = "Optional. For messages forwarded from channels or from anonymous administrators, information about the original sender chat"] pub fn get_forward_from_chat < 'a > (& 'a self) -> Option < & 'a Chat > { self . forward_from_chat . as_ref () . map (| v | { v . as_ref () }) } # [doc = "Optional. For messages forwarded from channels, identifier of the original message in the channel"] pub fn get_forward_from_message_id < 'a > (& 'a self) -> Option < i64 > { self . forward_from_message_id . as_ref () . map (| v | { * v }) } # [doc = "Optional. For forwarded messages that were originally sent in channels or by an anonymous chat administrator, signature of the message sender if present"] pub fn get_forward_signature < 'a > (& 'a self) -> Option < & 'a str > { self . forward_signature . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Sender's name for messages forwarded from users who disallow adding a link to their account in forwarded messages"] pub fn get_forward_sender_name < 'a > (& 'a self) -> Option < & 'a str > { self . forward_sender_name . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. For forwarded messages, date the original message was sent in Unix time"] pub fn get_forward_date < 'a > (& 'a self) -> Option < i64 > { self . forward_date . as_ref () . map (| v | { * v }) } # [doc = "Optional. True, if the message is a channel post that was automatically forwarded to the connected discussion group"] pub fn get_is_automatic_forward < 'a > (& 'a self) -> Option < bool > { self . is_automatic_forward . as_ref () . map (| v | { * v }) } # [doc = "Optional. For replies, the original message. Note that the Message object in this field will not contain further reply_to_message fields even if it itself is a reply."] pub fn get_reply_to_message < 'a > (& 'a self) -> Option < & 'a Message > { self . reply_to_message . as_ref () . map (| v | { v . as_ref () }) } # [doc = "Optional. Bot through which the message was sent"] pub fn get_via_bot < 'a > (& 'a self) -> Option < & 'a User > { self . via_bot . as_ref () . map (| v | { v }) } # [doc = "Optional. Date the message was last edited in Unix time"] pub fn get_edit_date < 'a > (& 'a self) -> Option < i64 > { self . edit_date . as_ref () . map (| v | { * v }) } # [doc = "Optional. True, if the message can't be forwarded"] pub fn get_has_protected_content < 'a > (& 'a self) -> Option < bool > { self . has_protected_content . as_ref () . map (| v | { * v }) } # [doc = "Optional. The unique identifier of a media message group this message belongs to"] pub fn get_media_group_id < 'a > (& 'a self) -> Option < & 'a str > { self . media_group_id . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Signature of the post author for messages in channels, or the custom title of an anonymous group administrator"] pub fn get_author_signature < 'a > (& 'a self) -> Option < & 'a str > { self . author_signature . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. For text messages, the actual UTF-8 text of the message"] pub fn get_text < 'a > (& 'a self) -> Option < & 'a str > { self . text . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text"] pub fn get_entities < 'a > (& 'a self) -> Option < & 'a Vec < MessageEntity > > { self . entities . as_ref () . map (| v | { v }) } # [doc = "Optional. Message is an animation, information about the animation. For backward compatibility, when this field is set, the document field will also be set"] pub fn get_animation < 'a > (& 'a self) -> Option < & 'a Animation > { self . animation . as_ref () . map (| v | { v }) } # [doc = "Optional. Message is an audio file, information about the file"] pub fn get_audio < 'a > (& 'a self) -> Option < & 'a Audio > { self . audio . as_ref () . map (| v | { v }) } # [doc = "Optional. Message is a general file, information about the file"] pub fn get_document < 'a > (& 'a self) -> Option < & 'a Document > { self . document . as_ref () . map (| v | { v }) } # [doc = "Optional. Message is a photo, available sizes of the photo"] pub fn get_photo < 'a > (& 'a self) -> Option < & 'a Vec < PhotoSize > > { self . photo . as_ref () . map (| v | { v }) } # [doc = "Optional. Message is a sticker, information about the sticker"] pub fn get_sticker < 'a > (& 'a self) -> Option < & 'a Sticker > { self . sticker . as_ref () . map (| v | { v }) } # [doc = "Optional. Message is a video, information about the video"] pub fn get_video < 'a > (& 'a self) -> Option < & 'a Video > { self . video . as_ref () . map (| v | { v }) } # [doc = "Optional. Message is a video note, information about the video message"] pub fn get_video_note < 'a > (& 'a self) -> Option < & 'a VideoNote > { self . video_note . as_ref () . map (| v | { v }) } # [doc = "Optional. Message is a voice message, information about the file"] pub fn get_voice < 'a > (& 'a self) -> Option < & 'a Voice > { self . voice . as_ref () . map (| v | { v }) } # [doc = "Optional. Caption for the animation, audio, document, photo, video or voice"] pub fn get_caption < 'a > (& 'a self) -> Option < & 'a str > { self . caption . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. For messages with a caption, special entities like usernames, URLs, bot commands, etc. that appear in the caption"] pub fn get_caption_entities < 'a > (& 'a self) -> Option < & 'a Vec < MessageEntity > > { self . caption_entities . as_ref () . map (| v | { v }) } # [doc = "Optional. Message is a shared contact, information about the contact"] pub fn get_contact < 'a > (& 'a self) -> Option < & 'a Contact > { self . contact . as_ref () . map (| v | { v }) } # [doc = "Optional. Message is a dice with random value"] pub fn get_dice < 'a > (& 'a self) -> Option < & 'a Dice > { self . dice . as_ref () . map (| v | { v }) } # [doc = "Optional. Message is a game, information about the game. More about games: https://core.telegram.org/bots/api#games"] pub fn get_game < 'a > (& 'a self) -> Option < & 'a Game > { self . game . as_ref () . map (| v | { v }) } # [doc = "Optional. Message is a native poll, information about the poll"] pub fn get_poll < 'a > (& 'a self) -> Option < & 'a Poll > { self . poll . as_ref () . map (| v | { v }) } # [doc = "Optional. Message is a venue, information about the venue. For backward compatibility, when this field is set, the location field will also be set"] pub fn get_venue < 'a > (& 'a self) -> Option < & 'a Venue > { self . venue . as_ref () . map (| v | { v }) } # [doc = "Optional. Message is a shared location, information about the location"] pub fn get_location < 'a > (& 'a self) -> Option < & 'a Location > { self . location . as_ref () . map (| v | { v }) } # [doc = "Optional. New members that were added to the group or supergroup and information about them (the bot itself may be one of these members)"] pub fn get_new_chat_members < 'a > (& 'a self) -> Option < & 'a Vec < User > > { self . new_chat_members . as_ref () . map (| v | { v }) } # [doc = "Optional. A member was removed from the group, information about them (this member may be the bot itself)"] pub fn get_left_chat_member < 'a > (& 'a self) -> Option < & 'a User > { self . left_chat_member . as_ref () . map (| v | { v }) } # [doc = "Optional. A chat title was changed to this value"] pub fn get_new_chat_title < 'a > (& 'a self) -> Option < & 'a str > { self . new_chat_title . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. A chat photo was change to this value"] pub fn get_new_chat_photo < 'a > (& 'a self) -> Option < & 'a Vec < PhotoSize > > { self . new_chat_photo . as_ref () . map (| v | { v }) } # [doc = "Optional. Service message: the chat photo was deleted"] pub fn get_delete_chat_photo < 'a > (& 'a self) -> Option < bool > { self . delete_chat_photo . as_ref () . map (| v | { * v }) } # [doc = "Optional. Service message: the group has been created"] pub fn get_group_chat_created < 'a > (& 'a self) -> Option < bool > { self . group_chat_created . as_ref () . map (| v | { * v }) } # [doc = "Optional. Service message: the supergroup has been created. This field can't be received in a message coming through updates, because bot can't be a member of a supergroup when it is created. It can only be found in reply_to_message if someone replies to a very first message in a directly created supergroup."] pub fn get_supergroup_chat_created < 'a > (& 'a self) -> Option < bool > { self . supergroup_chat_created . as_ref () . map (| v | { * v }) } # [doc = "Optional. Service message: the channel has been created. This field can't be received in a message coming through updates, because bot can't be a member of a channel when it is created. It can only be found in reply_to_message if someone replies to a very first message in a channel."] pub fn get_channel_chat_created < 'a > (& 'a self) -> Option < bool > { self . channel_chat_created . as_ref () . map (| v | { * v }) } # [doc = "Optional. Service message: auto-delete timer settings changed in the chat"] pub fn get_message_auto_delete_timer_changed < 'a > (& 'a self) -> Option < & 'a MessageAutoDeleteTimerChanged > { self . message_auto_delete_timer_changed . as_ref () . map (| v | { v }) } # [doc = "Optional. The group has been migrated to a supergroup with the specified identifier. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier."] pub fn get_migrate_to_chat_id < 'a > (& 'a self) -> Option < i64 > { self . migrate_to_chat_id . as_ref () . map (| v | { * v }) } # [doc = "Optional. The supergroup has been migrated from a group with the specified identifier. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier."] pub fn get_migrate_from_chat_id < 'a > (& 'a self) -> Option < i64 > { self . migrate_from_chat_id . as_ref () . map (| v | { * v }) } # [doc = "Optional. Specified message was pinned. Note that the Message object in this field will not contain further reply_to_message fields even if it is itself a reply."] pub fn get_pinned_message < 'a > (& 'a self) -> Option < & 'a Message > { self . pinned_message . as_ref () . map (| v | { v . as_ref () }) } # [doc = "Optional. Message is an invoice for a payment, information about the invoice. More about payments: https://core.telegram.org/bots/api#payments"] pub fn get_invoice < 'a > (& 'a self) -> Option < & 'a Invoice > { self . invoice . as_ref () . map (| v | { v }) } # [doc = "Optional. Message is a service message about a successful payment, information about the payment. More about payments: https://core.telegram.org/bots/api#payments"] pub fn get_successful_payment < 'a > (& 'a self) -> Option < & 'a SuccessfulPayment > { self . successful_payment . as_ref () . map (| v | { v }) } # [doc = "Optional. The domain name of the website on which the user has logged in. More about Telegram Login: https://core.telegram.org/widgets/login"] pub fn get_connected_website < 'a > (& 'a self) -> Option < & 'a str > { self . connected_website . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Telegram Passport data"] pub fn get_passport_data < 'a > (& 'a self) -> Option < & 'a PassportData > { self . passport_data . as_ref () . map (| v | { v }) } # [doc = "Optional. Service message. A user in the chat triggered another user's proximity alert while sharing Live Location."] pub fn get_proximity_alert_triggered < 'a > (& 'a self) -> Option < & 'a ProximityAlertTriggered > { self . proximity_alert_triggered . as_ref () . map (| v | { v }) } # [doc = "Optional. Service message: video chat scheduled"] pub fn get_video_chat_scheduled < 'a > (& 'a self) -> Option < & 'a VideoChatScheduled > { self . video_chat_scheduled . as_ref () . map (| v | { v }) } # [doc = "Optional. Service message: video chat started"] pub fn get_video_chat_started < 'a > (& 'a self) -> Option < & 'a VideoChatStarted > { self . video_chat_started . as_ref () . map (| v | { v }) } # [doc = "Optional. Service message: video chat ended"] pub fn get_video_chat_ended < 'a > (& 'a self) -> Option < & 'a VideoChatEnded > { self . video_chat_ended . as_ref () . map (| v | { v }) } # [doc = "Optional. Service message: new participants invited to a video chat"] pub fn get_video_chat_participants_invited < 'a > (& 'a self) -> Option < & 'a VideoChatParticipantsInvited > { self . video_chat_participants_invited . as_ref () . map (| v | { v }) } # [doc = "Optional. Service message: data sent by a Web App"] pub fn get_web_app_data < 'a > (& 'a self) -> Option < & 'a WebAppData > { self . web_app_data . as_ref () . map (| v | { v }) } # [doc = "Optional. Inline keyboard attached to the message. login_url buttons are represented as ordinary url buttons."] pub fn get_reply_markup < 'a > (& 'a self) -> Option < & 'a InlineKeyboardMarkup > { self . reply_markup . as_ref () . map (| v | { v }) } } # [allow (dead_code)] impl InlineQueryResultDocument { pub fn new (id : String , title : String , document_url : String , mime_type : String) -> Self { Self { tg_type : "document" . to_owned () , id , title , document_url , mime_type , caption : None , parse_mode : None , caption_entities : None , description : None , reply_markup : None , input_message_content : None , thumb_url : None , thumb_width : None , thumb_height : None } } # [doc = "Type of the result, must be document"] pub fn get_tg_type < 'a > (& 'a self) -> & 'a str { self . tg_type . as_str () } # [doc = "Unique identifier for this result, 1-64 bytes"] pub fn get_id < 'a > (& 'a self) -> & 'a str { self . id . as_str () } # [doc = "Title for the result"] pub fn get_title < 'a > (& 'a self) -> & 'a str { self . title . as_str () } # [doc = "Optional. Caption of the document to be sent, 0-1024 characters after entities parsing"] pub fn get_caption < 'a > (& 'a self) -> Option < & 'a str > { self . caption . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Mode for parsing entities in the document caption. See formatting options for more details."] pub fn get_parse_mode < 'a > (& 'a self) -> Option < & 'a str > { self . parse_mode . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode"] pub fn get_caption_entities < 'a > (& 'a self) -> Option < & 'a Vec < MessageEntity > > { self . caption_entities . as_ref () . map (| v | { v }) } # [doc = "A valid URL for the file"] pub fn get_document_url < 'a > (& 'a self) -> & 'a str { self . document_url . as_str () } # [doc = "MIME type of the content of the file, either \"application/pdf\" or \"application/zip\""] pub fn get_mime_type < 'a > (& 'a self) -> & 'a str { self . mime_type . as_str () } # [doc = "Optional. Short description of the result"] pub fn get_description < 'a > (& 'a self) -> Option < & 'a str > { self . description . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Inline keyboard attached to the message"] pub fn get_reply_markup < 'a > (& 'a self) -> Option < & 'a InlineKeyboardMarkup > { self . reply_markup . as_ref () . map (| v | { v }) } # [doc = "Optional. Content of the message to be sent instead of the file"] pub fn get_input_message_content < 'a > (& 'a self) -> Option < & 'a InputMessageContent > { self . input_message_content . as_ref () . map (| v | { v }) } # [doc = "Optional. URL of the thumbnail (JPEG only) for the file"] pub fn get_thumb_url < 'a > (& 'a self) -> Option < & 'a str > { self . thumb_url . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Thumbnail width"] pub fn get_thumb_width < 'a > (& 'a self) -> Option < i64 > { self . thumb_width . as_ref () . map (| v | { * v }) } # [doc = "Optional. Thumbnail height"] pub fn get_thumb_height < 'a > (& 'a self) -> Option < i64 > { self . thumb_height . as_ref () . map (| v | { * v }) } } impl TraitChatMemberOwner for ChatMemberOwner { # [doc = "The member's status in the chat, always \"creator\""] fn get_status < 'a > (& 'a self) -> & 'a str { self . status . as_str () } # [doc = "Information about the user"] fn get_user < 'a > (& 'a self) -> & 'a User { & self . user } # [doc = "True, if the user's presence in the chat is hidden"] fn get_is_anonymous < 'a > (& 'a self) -> bool { self . is_anonymous } # [doc = "Optional. Custom title for this user"] fn get_custom_title < 'a > (& 'a self) -> Option < & 'a str > { self . custom_title . as_ref () . map (| v | { v . as_str () }) } } impl TraitChatMemberAdministrator for ChatMemberAdministrator { # [doc = "The member's status in the chat, always \"administrator\""] fn get_status < 'a > (& 'a self) -> & 'a str { self . status . as_str () } # [doc = "Information about the user"] fn get_user < 'a > (& 'a self) -> & 'a User { & self . user } # [doc = "True, if the bot is allowed to edit administrator privileges of that user"] fn get_can_be_edited < 'a > (& 'a self) -> bool { self . can_be_edited } # [doc = "True, if the user's presence in the chat is hidden"] fn get_is_anonymous < 'a > (& 'a self) -> bool { self . is_anonymous } # [doc = "True, if the administrator can access the chat event log, chat statistics, message statistics in channels, see channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other administrator privilege"] fn get_can_manage_chat < 'a > (& 'a self) -> bool { self . can_manage_chat } # [doc = "True, if the administrator can delete messages of other users"] fn get_can_delete_messages < 'a > (& 'a self) -> bool { self . can_delete_messages } # [doc = "True, if the administrator can manage video chats"] fn get_can_manage_video_chats < 'a > (& 'a self) -> bool { self . can_manage_video_chats } # [doc = "True, if the administrator can restrict, ban or unban chat members"] fn get_can_restrict_members < 'a > (& 'a self) -> bool { self . can_restrict_members } # [doc = "True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by the user)"] fn get_can_promote_members < 'a > (& 'a self) -> bool { self . can_promote_members } # [doc = "True, if the user is allowed to change the chat title, photo and other settings"] fn get_can_change_info < 'a > (& 'a self) -> bool { self . can_change_info } # [doc = "True, if the user is allowed to invite new users to the chat"] fn get_can_invite_users < 'a > (& 'a self) -> bool { self . can_invite_users } # [doc = "Optional. True, if the administrator can post in the channel; channels only"] fn get_can_post_messages < 'a > (& 'a self) -> Option < bool > { self . can_post_messages . as_ref () . map (| v | { * v }) } # [doc = "Optional. True, if the administrator can edit messages of other users and can pin messages; channels only"] fn get_can_edit_messages < 'a > (& 'a self) -> Option < bool > { self . can_edit_messages . as_ref () . map (| v | { * v }) } # [doc = "Optional. True, if the user is allowed to pin messages; groups and supergroups only"] fn get_can_pin_messages < 'a > (& 'a self) -> Option < bool > { self . can_pin_messages . as_ref () . map (| v | { * v }) } # [doc = "Optional. Custom title for this user"] fn get_custom_title < 'a > (& 'a self) -> Option < & 'a str > { self . custom_title . as_ref () . map (| v | { v . as_str () }) } } impl TraitChatMemberMember for ChatMemberMember { # [doc = "The member's status in the chat, always \"member\""] fn get_status < 'a > (& 'a self) -> & 'a str { self . status . as_str () } # [doc = "Information about the user"] fn get_user < 'a > (& 'a self) -> & 'a User { & self . user } } impl TraitChatMemberRestricted for ChatMemberRestricted { # [doc = "The member's status in the chat, always \"restricted\""] fn get_status < 'a > (& 'a self) -> & 'a str { self . status . as_str () } # [doc = "Information about the user"] fn get_user < 'a > (& 'a self) -> & 'a User { & self . user } # [doc = "True, if the user is a member of the chat at the moment of the request"] fn get_is_member < 'a > (& 'a self) -> bool { self . is_member } # [doc = "True, if the user is allowed to change the chat title, photo and other settings"] fn get_can_change_info < 'a > (& 'a self) -> bool { self . can_change_info } # [doc = "True, if the user is allowed to invite new users to the chat"] fn get_can_invite_users < 'a > (& 'a self) -> bool { self . can_invite_users } # [doc = "True, if the user is allowed to pin messages"] fn get_can_pin_messages < 'a > (& 'a self) -> bool { self . can_pin_messages } # [doc = "True, if the user is allowed to send text messages, contacts, locations and venues"] fn get_can_send_messages < 'a > (& 'a self) -> bool { self . can_send_messages } # [doc = "True, if the user is allowed to send audios, documents, photos, videos, video notes and voice notes"] fn get_can_send_media_messages < 'a > (& 'a self) -> bool { self . can_send_media_messages } # [doc = "True, if the user is allowed to send polls"] fn get_can_send_polls < 'a > (& 'a self) -> bool { self . can_send_polls } # [doc = "True, if the user is allowed to send animations, games, stickers and use inline bots"] fn get_can_send_other_messages < 'a > (& 'a self) -> bool { self . can_send_other_messages } # [doc = "True, if the user is allowed to add web page previews to their messages"] fn get_can_add_web_page_previews < 'a > (& 'a self) -> bool { self . can_add_web_page_previews } # [doc = "Date when restrictions will be lifted for this user; unix time. If 0, then the user is restricted forever"] fn get_until_date < 'a > (& 'a self) -> i64 { self . until_date } } impl TraitChatMemberLeft for ChatMemberLeft { # [doc = "The member's status in the chat, always \"left\""] fn get_status < 'a > (& 'a self) -> & 'a str { self . status . as_str () } # [doc = "Information about the user"] fn get_user < 'a > (& 'a self) -> & 'a User { & self . user } } impl TraitChatMemberBanned for ChatMemberBanned { # [doc = "The member's status in the chat, always \"kicked\""] fn get_status < 'a > (& 'a self) -> & 'a str { self . status . as_str () } # [doc = "Information about the user"] fn get_user < 'a > (& 'a self) -> & 'a User { & self . user } # [doc = "Date when restrictions will be lifted for this user; unix time. If 0, then the user is banned forever"] fn get_until_date < 'a > (& 'a self) -> i64 { self . until_date } } # [allow (dead_code)] impl Video { pub fn new (file_id : String , file_unique_id : String , width : i64 , height : i64 , duration : i64) -> Self { Self { file_id , file_unique_id , width , height , duration , thumb : None , file_name : None , mime_type : None , file_size : None } } # [doc = "Identifier for this file, which can be used to download or reuse the file"] pub fn get_file_id < 'a > (& 'a self) -> & 'a str { self . file_id . as_str () } # [doc = "Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file."] pub fn get_file_unique_id < 'a > (& 'a self) -> & 'a str { self . file_unique_id . as_str () } # [doc = "Video width as defined by sender"] pub fn get_width < 'a > (& 'a self) -> i64 { self . width } # [doc = "Video height as defined by sender"] pub fn get_height < 'a > (& 'a self) -> i64 { self . height } # [doc = "Duration of the video in seconds as defined by sender"] pub fn get_duration < 'a > (& 'a self) -> i64 { self . duration } # [doc = "Optional. Video thumbnail"] pub fn get_thumb < 'a > (& 'a self) -> Option < & 'a PhotoSize > { self . thumb . as_ref () . map (| v | { v }) } # [doc = "Optional. Original filename as defined by sender"] pub fn get_file_name < 'a > (& 'a self) -> Option < & 'a str > { self . file_name . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. MIME type of the file as defined by sender"] pub fn get_mime_type < 'a > (& 'a self) -> Option < & 'a str > { self . mime_type . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value."] pub fn get_file_size < 'a > (& 'a self) -> Option < i64 > { self . file_size . as_ref () . map (| v | { * v }) } } # [allow (dead_code)] impl InlineQueryResultArticle { pub fn new (id : String , title : String , input_message_content : InputMessageContent) -> Self { Self { tg_type : "article" . to_owned () , id , title , input_message_content , reply_markup : None , url : None , hide_url : None , description : None , thumb_url : None , thumb_width : None , thumb_height : None } } # [doc = "Type of the result, must be article"] pub fn get_tg_type < 'a > (& 'a self) -> & 'a str { self . tg_type . as_str () } # [doc = "Unique identifier for this result, 1-64 Bytes"] pub fn get_id < 'a > (& 'a self) -> & 'a str { self . id . as_str () } # [doc = "Title of the result"] pub fn get_title < 'a > (& 'a self) -> & 'a str { self . title . as_str () } # [doc = "Content of the message to be sent"] pub fn get_input_message_content < 'a > (& 'a self) -> & 'a InputMessageContent { & self . input_message_content } # [doc = "Optional. Inline keyboard attached to the message"] pub fn get_reply_markup < 'a > (& 'a self) -> Option < & 'a InlineKeyboardMarkup > { self . reply_markup . as_ref () . map (| v | { v }) } # [doc = "Optional. URL of the result"] pub fn get_url < 'a > (& 'a self) -> Option < & 'a str > { self . url . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Pass True if you don't want the URL to be shown in the message"] pub fn get_hide_url < 'a > (& 'a self) -> Option < bool > { self . hide_url . as_ref () . map (| v | { * v }) } # [doc = "Optional. Short description of the result"] pub fn get_description < 'a > (& 'a self) -> Option < & 'a str > { self . description . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Url of the thumbnail for the result"] pub fn get_thumb_url < 'a > (& 'a self) -> Option < & 'a str > { self . thumb_url . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Thumbnail width"] pub fn get_thumb_width < 'a > (& 'a self) -> Option < i64 > { self . thumb_width . as_ref () . map (| v | { * v }) } # [doc = "Optional. Thumbnail height"] pub fn get_thumb_height < 'a > (& 'a self) -> Option < i64 > { self . thumb_height . as_ref () . map (| v | { * v }) } } # [allow (dead_code)] impl PassportElementErrorSelfie { pub fn new (source : String , file_hash : String , message : String) -> Self { Self { tg_type : "PassportElementErrorSelfie" . to_owned () , source , file_hash , message , } } # [doc = "Error source, must be selfie"] pub fn get_source < 'a > (& 'a self) -> & 'a str { self . source . as_str () } # [doc = "The section of the user's Telegram Passport which has the issue, one of \"passport\", \"driver_license\", \"identity_card\", \"internal_passport\""] pub fn get_tg_type < 'a > (& 'a self) -> & 'a str { self . tg_type . as_str () } # [doc = "Base64-encoded hash of the file with the selfie"] pub fn get_file_hash < 'a > (& 'a self) -> & 'a str { self . file_hash . as_str () } # [doc = "Error message"] pub fn get_message < 'a > (& 'a self) -> & 'a str { self . message . as_str () } } # [allow (dead_code)] impl MessageEntity { pub fn new (offset : i64 , length : i64) -> Self { Self { tg_type : "MessageEntity" . to_owned () , offset , length , url : None , user : None , language : None , custom_emoji_id : None } } # [doc = "Type of the entity. Currently, can be \"mention\" (@username), \"hashtag\" (#hashtag), \"cashtag\" ($USD), \"bot_command\" (/start@jobs_bot), \"url\" (https://telegram.org), \"email\" (do-not-reply@telegram.org), \"phone_number\" (+1-212-555-0123), \"bold\" (bold text), \"italic\" (italic text), \"underline\" (underlined text), \"strikethrough\" (strikethrough text), \"spoiler\" (spoiler message), \"code\" (monowidth string), \"pre\" (monowidth block), \"text_link\" (for clickable text URLs), \"text_mention\" (for users without usernames), \"custom_emoji\" (for inline custom emoji stickers)"] pub fn get_tg_type < 'a > (& 'a self) -> & 'a str { self . tg_type . as_str () } # [doc = "Offset in UTF-16 code units to the start of the entity"] pub fn get_offset < 'a > (& 'a self) -> i64 { self . offset } # [doc = "Length of the entity in UTF-16 code units"] pub fn get_length < 'a > (& 'a self) -> i64 { self . length } # [doc = "Optional. For \"text_link\" only, URL that will be opened after user taps on the text"] pub fn get_url < 'a > (& 'a self) -> Option < & 'a str > { self . url . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. For \"text_mention\" only, the mentioned user"] pub fn get_user < 'a > (& 'a self) -> Option < & 'a User > { self . user . as_ref () . map (| v | { v }) } # [doc = "Optional. For \"pre\" only, the programming language of the entity text"] pub fn get_language < 'a > (& 'a self) -> Option < & 'a str > { self . language . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. For \"custom_emoji\" only, unique identifier of the custom emoji. Use getCustomEmojiStickers to get full information about the sticker"] pub fn get_custom_emoji_id < 'a > (& 'a self) -> Option < & 'a str > { self . custom_emoji_id . as_ref () . map (| v | { v . as_str () }) } } # [allow (dead_code)] impl BotCommand { pub fn new (command : String , description : String) -> Self { Self { command , description , } } # [doc = "Text of the command; 1-32 characters. Can contain only lowercase English letters, digits and underscores."] pub fn get_command < 'a > (& 'a self) -> & 'a str { self . command . as_str () } # [doc = "Description of the command; 1-256 characters."] pub fn get_description < 'a > (& 'a self) -> & 'a str { self . description . as_str () } } # [allow (dead_code)] impl Invoice { pub fn new (title : String , description : String , start_parameter : String , currency : String , total_amount : i64) -> Self { Self { title , description , start_parameter , currency , total_amount , } } # [doc = "Product name"] pub fn get_title < 'a > (& 'a self) -> & 'a str { self . title . as_str () } # [doc = "Product description"] pub fn get_description < 'a > (& 'a self) -> & 'a str { self . description . as_str () } # [doc = "Unique bot deep-linking parameter that can be used to generate this invoice"] pub fn get_start_parameter < 'a > (& 'a self) -> & 'a str { self . start_parameter . as_str () } # [doc = "Three-letter ISO 4217 currency code"] pub fn get_currency < 'a > (& 'a self) -> & 'a str { self . currency . as_str () } # [doc = "Total price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies)."] pub fn get_total_amount < 'a > (& 'a self) -> i64 { self . total_amount } } # [allow (dead_code)] impl ChatMemberUpdated { pub fn new (chat : Box < Chat > , from : User , date : i64 , old_chat_member : ChatMember , new_chat_member : ChatMember) -> Self { Self { chat , from , date , old_chat_member , new_chat_member , invite_link : None } } # [doc = "Chat the user belongs to"] pub fn get_chat < 'a > (& 'a self) -> & 'a Chat { self . chat . as_ref () } # [doc = "Performer of the action, which resulted in the change"] pub fn get_from < 'a > (& 'a self) -> & 'a User { & self . from } # [doc = "Date the change was done in Unix time"] pub fn get_date < 'a > (& 'a self) -> i64 { self . date } # [doc = "Previous information about the chat member"] pub fn get_old_chat_member < 'a > (& 'a self) -> & 'a ChatMember { & self . old_chat_member } # [doc = "New information about the chat member"] pub fn get_new_chat_member < 'a > (& 'a self) -> & 'a ChatMember { & self . new_chat_member } # [doc = "Optional. Chat invite link, which was used by the user to join the chat; for joining by invite link events only."] pub fn get_invite_link < 'a > (& 'a self) -> Option < & 'a ChatInviteLink > { self . invite_link . as_ref () . map (| v | { v }) } } # [allow (dead_code)] impl BotCommandScopeDefault { pub fn new () -> Self { Self { tg_type : "default" . to_owned () , } } # [doc = "Scope type, must be default"] pub fn get_tg_type < 'a > (& 'a self) -> & 'a str { self . tg_type . as_str () } } # [allow (dead_code)] impl InlineQueryResultMpeg4Gif { pub fn new (id : String , mpeg_4_url : String , thumb_url : String) -> Self { Self { tg_type : "mpeg4_gif" . to_owned () , id , mpeg_4_url , thumb_url , mpeg_4_width : None , mpeg_4_height : None , mpeg_4_duration : None , thumb_mime_type : None , title : None , caption : None , parse_mode : None , caption_entities : None , reply_markup : None , input_message_content : None } } # [doc = "Type of the result, must be mpeg4_gif"] pub fn get_tg_type < 'a > (& 'a self) -> & 'a str { self . tg_type . as_str () } # [doc = "Unique identifier for this result, 1-64 bytes"] pub fn get_id < 'a > (& 'a self) -> & 'a str { self . id . as_str () } # [doc = "A valid URL for the MPEG4 file. File size must not exceed 1MB"] pub fn get_mpeg_4_url < 'a > (& 'a self) -> & 'a str { self . mpeg_4_url . as_str () } # [doc = "Optional. Video width"] pub fn get_mpeg_4_width < 'a > (& 'a self) -> Option < i64 > { self . mpeg_4_width . as_ref () . map (| v | { * v }) } # [doc = "Optional. Video height"] pub fn get_mpeg_4_height < 'a > (& 'a self) -> Option < i64 > { self . mpeg_4_height . as_ref () . map (| v | { * v }) } # [doc = "Optional. Video duration in seconds"] pub fn get_mpeg_4_duration < 'a > (& 'a self) -> Option < i64 > { self . mpeg_4_duration . as_ref () . map (| v | { * v }) } # [doc = "URL of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the result"] pub fn get_thumb_url < 'a > (& 'a self) -> & 'a str { self . thumb_url . as_str () } # [doc = "Optional. MIME type of the thumbnail, must be one of \"image/jpeg\", \"image/gif\", or \"video/mp4\". Defaults to \"image/jpeg\""] pub fn get_thumb_mime_type < 'a > (& 'a self) -> Option < & 'a str > { self . thumb_mime_type . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Title for the result"] pub fn get_title < 'a > (& 'a self) -> Option < & 'a str > { self . title . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Caption of the MPEG-4 file to be sent, 0-1024 characters after entities parsing"] pub fn get_caption < 'a > (& 'a self) -> Option < & 'a str > { self . caption . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Mode for parsing entities in the caption. See formatting options for more details."] pub fn get_parse_mode < 'a > (& 'a self) -> Option < & 'a str > { self . parse_mode . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode"] pub fn get_caption_entities < 'a > (& 'a self) -> Option < & 'a Vec < MessageEntity > > { self . caption_entities . as_ref () . map (| v | { v }) } # [doc = "Optional. Inline keyboard attached to the message"] pub fn get_reply_markup < 'a > (& 'a self) -> Option < & 'a InlineKeyboardMarkup > { self . reply_markup . as_ref () . map (| v | { v }) } # [doc = "Optional. Content of the message to be sent instead of the video animation"] pub fn get_input_message_content < 'a > (& 'a self) -> Option < & 'a InputMessageContent > { self . input_message_content . as_ref () . map (| v | { v }) } } # [allow (dead_code)] impl ShippingQuery { pub fn new (id : String , from : User , invoice_payload : String , shipping_address : ShippingAddress) -> Self { Self { id , from , invoice_payload , shipping_address , } } # [doc = "Unique query identifier"] pub fn get_id < 'a > (& 'a self) -> & 'a str { self . id . as_str () } # [doc = "User who sent the query"] pub fn get_from < 'a > (& 'a self) -> & 'a User { & self . from } # [doc = "Bot specified invoice payload"] pub fn get_invoice_payload < 'a > (& 'a self) -> & 'a str { self . invoice_payload . as_str () } # [doc = "User specified shipping address"] pub fn get_shipping_address < 'a > (& 'a self) -> & 'a ShippingAddress { & self . shipping_address } } # [allow (dead_code)] impl InputTextMessageContent { pub fn new (message_text : String) -> Self { Self { message_text , parse_mode : None , entities : None , disable_web_page_preview : None } } # [doc = "Text of the message to be sent, 1-4096 characters"] pub fn get_message_text < 'a > (& 'a self) -> & 'a str { self . message_text . as_str () } # [doc = "Optional. Mode for parsing entities in the message text. See formatting options for more details."] pub fn get_parse_mode < 'a > (& 'a self) -> Option < & 'a str > { self . parse_mode . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. List of special entities that appear in message text, which can be specified instead of parse_mode"] pub fn get_entities < 'a > (& 'a self) -> Option < & 'a Vec < MessageEntity > > { self . entities . as_ref () . map (| v | { v }) } # [doc = "Optional. Disables link previews for links in the sent message"] pub fn get_disable_web_page_preview < 'a > (& 'a self) -> Option < bool > { self . disable_web_page_preview . as_ref () . map (| v | { * v }) } } # [allow (dead_code)] impl InputLocationMessageContent { pub fn new (latitude : f64 , longitude : f64) -> Self { Self { latitude , longitude , horizontal_accuracy : None , live_period : None , heading : None , proximity_alert_radius : None } } # [doc = "Latitude of the location in degrees"] pub fn get_latitude < 'a > (& 'a self) -> f64 { self . latitude } # [doc = "Longitude of the location in degrees"] pub fn get_longitude < 'a > (& 'a self) -> f64 { self . longitude } # [doc = "Optional. The radius of uncertainty for the location, measured in meters; 0-1500"] pub fn get_horizontal_accuracy < 'a > (& 'a self) -> Option < f64 > { self . horizontal_accuracy . as_ref () . map (| v | { * v }) } # [doc = "Optional. Period in seconds for which the location can be updated, should be between 60 and 86400."] pub fn get_live_period < 'a > (& 'a self) -> Option < i64 > { self . live_period . as_ref () . map (| v | { * v }) } # [doc = "Optional. For live locations, a direction in which the user is moving, in degrees. Must be between 1 and 360 if specified."] pub fn get_heading < 'a > (& 'a self) -> Option < i64 > { self . heading . as_ref () . map (| v | { * v }) } # [doc = "Optional. For live locations, a maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified."] pub fn get_proximity_alert_radius < 'a > (& 'a self) -> Option < i64 > { self . proximity_alert_radius . as_ref () . map (| v | { * v }) } } # [allow (dead_code)] impl InlineQueryResultGame { pub fn new (id : String , game_short_name : String) -> Self { Self { tg_type : "game" . to_owned () , id , game_short_name , reply_markup : None } } # [doc = "Type of the result, must be game"] pub fn get_tg_type < 'a > (& 'a self) -> & 'a str { self . tg_type . as_str () } # [doc = "Unique identifier for this result, 1-64 bytes"] pub fn get_id < 'a > (& 'a self) -> & 'a str { self . id . as_str () } # [doc = "Short name of the game"] pub fn get_game_short_name < 'a > (& 'a self) -> & 'a str { self . game_short_name . as_str () } # [doc = "Optional. Inline keyboard attached to the message"] pub fn get_reply_markup < 'a > (& 'a self) -> Option < & 'a InlineKeyboardMarkup > { self . reply_markup . as_ref () . map (| v | { v }) } } # [allow (dead_code)] impl VideoNote { pub fn new (file_id : String , file_unique_id : String , length : i64 , duration : i64) -> Self { Self { file_id , file_unique_id , length , duration , thumb : None , file_size : None } } # [doc = "Identifier for this file, which can be used to download or reuse the file"] pub fn get_file_id < 'a > (& 'a self) -> & 'a str { self . file_id . as_str () } # [doc = "Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file."] pub fn get_file_unique_id < 'a > (& 'a self) -> & 'a str { self . file_unique_id . as_str () } # [doc = "Video width and height (diameter of the video message) as defined by sender"] pub fn get_length < 'a > (& 'a self) -> i64 { self . length } # [doc = "Duration of the video in seconds as defined by sender"] pub fn get_duration < 'a > (& 'a self) -> i64 { self . duration } # [doc = "Optional. Video thumbnail"] pub fn get_thumb < 'a > (& 'a self) -> Option < & 'a PhotoSize > { self . thumb . as_ref () . map (| v | { v }) } # [doc = "Optional. File size in bytes"] pub fn get_file_size < 'a > (& 'a self) -> Option < i64 > { self . file_size . as_ref () . map (| v | { * v }) } } # [allow (dead_code)] impl PassportFile { pub fn new (file_id : String , file_unique_id : String , file_size : i64 , file_date : i64) -> Self { Self { file_id , file_unique_id , file_size , file_date , } } # [doc = "Identifier for this file, which can be used to download or reuse the file"] pub fn get_file_id < 'a > (& 'a self) -> & 'a str { self . file_id . as_str () } # [doc = "Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file."] pub fn get_file_unique_id < 'a > (& 'a self) -> & 'a str { self . file_unique_id . as_str () } # [doc = "File size in bytes"] pub fn get_file_size < 'a > (& 'a self) -> i64 { self . file_size } # [doc = "Unix time when the file was uploaded"] pub fn get_file_date < 'a > (& 'a self) -> i64 { self . file_date } } # [allow (dead_code)] impl PassportElementErrorFrontSide { pub fn new (source : String , file_hash : String , message : String) -> Self { Self { tg_type : "PassportElementErrorFrontSide" . to_owned () , source , file_hash , message , } } # [doc = "Error source, must be front_side"] pub fn get_source < 'a > (& 'a self) -> & 'a str { self . source . as_str () } # [doc = "The section of the user's Telegram Passport which has the issue, one of \"passport\", \"driver_license\", \"identity_card\", \"internal_passport\""] pub fn get_tg_type < 'a > (& 'a self) -> & 'a str { self . tg_type . as_str () } # [doc = "Base64-encoded hash of the file with the front side of the document"] pub fn get_file_hash < 'a > (& 'a self) -> & 'a str { self . file_hash . as_str () } # [doc = "Error message"] pub fn get_message < 'a > (& 'a self) -> & 'a str { self . message . as_str () } } # [allow (dead_code)] impl PassportElementErrorFile { pub fn new (source : String , file_hash : String , message : String) -> Self { Self { tg_type : "PassportElementErrorFile" . to_owned () , source , file_hash , message , } } # [doc = "Error source, must be file"] pub fn get_source < 'a > (& 'a self) -> & 'a str { self . source . as_str () } # [doc = "The section of the user's Telegram Passport which has the issue, one of \"utility_bill\", \"bank_statement\", \"rental_agreement\", \"passport_registration\", \"temporary_registration\""] pub fn get_tg_type < 'a > (& 'a self) -> & 'a str { self . tg_type . as_str () } # [doc = "Base64-encoded file hash"] pub fn get_file_hash < 'a > (& 'a self) -> & 'a str { self . file_hash . as_str () } # [doc = "Error message"] pub fn get_message < 'a > (& 'a self) -> & 'a str { self . message . as_str () } } # [allow (dead_code)] impl InlineQueryResultVideo { pub fn new (id : String , video_url : String , mime_type : String , thumb_url : String , title : String) -> Self { Self { tg_type : "video" . to_owned () , id , video_url , mime_type , thumb_url , title , caption : None , parse_mode : None , caption_entities : None , video_width : None , video_height : None , video_duration : None , description : None , reply_markup : None , input_message_content : None } } # [doc = "Type of the result, must be video"] pub fn get_tg_type < 'a > (& 'a self) -> & 'a str { self . tg_type . as_str () } # [doc = "Unique identifier for this result, 1-64 bytes"] pub fn get_id < 'a > (& 'a self) -> & 'a str { self . id . as_str () } # [doc = "A valid URL for the embedded video player or video file"] pub fn get_video_url < 'a > (& 'a self) -> & 'a str { self . video_url . as_str () } # [doc = "MIME type of the content of the video URL, \"text/html\" or \"video/mp4\""] pub fn get_mime_type < 'a > (& 'a self) -> & 'a str { self . mime_type . as_str () } # [doc = "URL of the thumbnail (JPEG only) for the video"] pub fn get_thumb_url < 'a > (& 'a self) -> & 'a str { self . thumb_url . as_str () } # [doc = "Title for the result"] pub fn get_title < 'a > (& 'a self) -> & 'a str { self . title . as_str () } # [doc = "Optional. Caption of the video to be sent, 0-1024 characters after entities parsing"] pub fn get_caption < 'a > (& 'a self) -> Option < & 'a str > { self . caption . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Mode for parsing entities in the video caption. See formatting options for more details."] pub fn get_parse_mode < 'a > (& 'a self) -> Option < & 'a str > { self . parse_mode . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode"] pub fn get_caption_entities < 'a > (& 'a self) -> Option < & 'a Vec < MessageEntity > > { self . caption_entities . as_ref () . map (| v | { v }) } # [doc = "Optional. Video width"] pub fn get_video_width < 'a > (& 'a self) -> Option < i64 > { self . video_width . as_ref () . map (| v | { * v }) } # [doc = "Optional. Video height"] pub fn get_video_height < 'a > (& 'a self) -> Option < i64 > { self . video_height . as_ref () . map (| v | { * v }) } # [doc = "Optional. Video duration in seconds"] pub fn get_video_duration < 'a > (& 'a self) -> Option < i64 > { self . video_duration . as_ref () . map (| v | { * v }) } # [doc = "Optional. Short description of the result"] pub fn get_description < 'a > (& 'a self) -> Option < & 'a str > { self . description . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Inline keyboard attached to the message"] pub fn get_reply_markup < 'a > (& 'a self) -> Option < & 'a InlineKeyboardMarkup > { self . reply_markup . as_ref () . map (| v | { v }) } # [doc = "Optional. Content of the message to be sent instead of the video. This field is required if InlineQueryResultVideo is used to send an HTML-page as a result (e.g., a YouTube video)."] pub fn get_input_message_content < 'a > (& 'a self) -> Option < & 'a InputMessageContent > { self . input_message_content . as_ref () . map (| v | { v }) } } # [allow (dead_code)] impl Document { pub fn new (file_id : String , file_unique_id : String) -> Self { Self { file_id , file_unique_id , thumb : None , file_name : None , mime_type : None , file_size : None } } # [doc = "Identifier for this file, which can be used to download or reuse the file"] pub fn get_file_id < 'a > (& 'a self) -> & 'a str { self . file_id . as_str () } # [doc = "Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file."] pub fn get_file_unique_id < 'a > (& 'a self) -> & 'a str { self . file_unique_id . as_str () } # [doc = "Optional. Document thumbnail as defined by sender"] pub fn get_thumb < 'a > (& 'a self) -> Option < & 'a PhotoSize > { self . thumb . as_ref () . map (| v | { v }) } # [doc = "Optional. Original filename as defined by sender"] pub fn get_file_name < 'a > (& 'a self) -> Option < & 'a str > { self . file_name . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. MIME type of the file as defined by sender"] pub fn get_mime_type < 'a > (& 'a self) -> Option < & 'a str > { self . mime_type . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value."] pub fn get_file_size < 'a > (& 'a self) -> Option < i64 > { self . file_size . as_ref () . map (| v | { * v }) } } # [allow (dead_code)] impl WebAppInfo { pub fn new (url : String) -> Self { Self { url , } } # [doc = "An HTTPS URL of a Web App to be opened with additional data as specified in Initializing Web Apps"] pub fn get_url < 'a > (& 'a self) -> & 'a str { self . url . as_str () } } # [allow (dead_code)] impl PassportData { pub fn new (data : Vec < EncryptedPassportElement > , credentials : EncryptedCredentials) -> Self { Self { data , credentials , } } # [doc = "Array with information about documents and other Telegram Passport elements that was shared with the bot"] pub fn get_data < 'a > (& 'a self) -> & 'a Vec < EncryptedPassportElement > { & self . data } # [doc = "Encrypted credentials required to decrypt the data"] pub fn get_credentials < 'a > (& 'a self) -> & 'a EncryptedCredentials { & self . credentials } } # [allow (dead_code)] impl Chat { pub fn new (id : i64) -> Self { Self { tg_type : "Chat" . to_owned () , id , title : None , username : None , first_name : None , last_name : None , photo : None , bio : None , has_private_forwards : None , has_restricted_voice_and_video_messages : None , join_to_send_messages : None , join_by_request : None , description : None , invite_link : None , pinned_message : None , permissions : None , slow_mode_delay : None , message_auto_delete_time : None , has_protected_content : None , sticker_set_name : None , can_set_sticker_set : None , linked_chat_id : None , location : None } } # [doc = "Unique identifier for this chat. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier."] pub fn get_id < 'a > (& 'a self) -> i64 { self . id } # [doc = "Type of chat, can be either \"private\", \"group\", \"supergroup\" or \"channel\""] pub fn get_tg_type < 'a > (& 'a self) -> & 'a str { self . tg_type . as_str () } # [doc = "Optional. Title, for supergroups, channels and group chats"] pub fn get_title < 'a > (& 'a self) -> Option < & 'a str > { self . title . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Username, for private chats, supergroups and channels if available"] pub fn get_username < 'a > (& 'a self) -> Option < & 'a str > { self . username . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. First name of the other party in a private chat"] pub fn get_first_name < 'a > (& 'a self) -> Option < & 'a str > { self . first_name . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Last name of the other party in a private chat"] pub fn get_last_name < 'a > (& 'a self) -> Option < & 'a str > { self . last_name . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Chat photo. Returned only in getChat."] pub fn get_photo < 'a > (& 'a self) -> Option < & 'a ChatPhoto > { self . photo . as_ref () . map (| v | { v }) } # [doc = "Optional. Bio of the other party in a private chat. Returned only in getChat."] pub fn get_bio < 'a > (& 'a self) -> Option < & 'a str > { self . bio . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. True, if privacy settings of the other party in the private chat allows to use tg://user?id=<user_id> links only in chats with the user. Returned only in getChat."] pub fn get_has_private_forwards < 'a > (& 'a self) -> Option < bool > { self . has_private_forwards . as_ref () . map (| v | { * v }) } # [doc = "Optional. True, if the privacy settings of the other party restrict sending voice and video note messages in the private chat. Returned only in getChat."] pub fn get_has_restricted_voice_and_video_messages < 'a > (& 'a self) -> Option < bool > { self . has_restricted_voice_and_video_messages . as_ref () . map (| v | { * v }) } # [doc = "Optional. True, if users need to join the supergroup before they can send messages. Returned only in getChat."] pub fn get_join_to_send_messages < 'a > (& 'a self) -> Option < bool > { self . join_to_send_messages . as_ref () . map (| v | { * v }) } # [doc = "Optional. True, if all users directly joining the supergroup need to be approved by supergroup administrators. Returned only in getChat."] pub fn get_join_by_request < 'a > (& 'a self) -> Option < bool > { self . join_by_request . as_ref () . map (| v | { * v }) } # [doc = "Optional. Description, for groups, supergroups and channel chats. Returned only in getChat."] pub fn get_description < 'a > (& 'a self) -> Option < & 'a str > { self . description . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Primary invite link, for groups, supergroups and channel chats. Returned only in getChat."] pub fn get_invite_link < 'a > (& 'a self) -> Option < & 'a str > { self . invite_link . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. The most recent pinned message (by sending date). Returned only in getChat."] pub fn get_pinned_message < 'a > (& 'a self) -> Option < & 'a Message > { self . pinned_message . as_ref () . map (| v | { v }) } # [doc = "Optional. Default chat member permissions, for groups and supergroups. Returned only in getChat."] pub fn get_permissions < 'a > (& 'a self) -> Option < & 'a ChatPermissions > { self . permissions . as_ref () . map (| v | { v }) } # [doc = "Optional. For supergroups, the minimum allowed delay between consecutive messages sent by each unpriviledged user; in seconds. Returned only in getChat."] pub fn get_slow_mode_delay < 'a > (& 'a self) -> Option < i64 > { self . slow_mode_delay . as_ref () . map (| v | { * v }) } # [doc = "Optional. The time after which all messages sent to the chat will be automatically deleted; in seconds. Returned only in getChat."] pub fn get_message_auto_delete_time < 'a > (& 'a self) -> Option < i64 > { self . message_auto_delete_time . as_ref () . map (| v | { * v }) } # [doc = "Optional. True, if messages from the chat can't be forwarded to other chats. Returned only in getChat."] pub fn get_has_protected_content < 'a > (& 'a self) -> Option < bool > { self . has_protected_content . as_ref () . map (| v | { * v }) } # [doc = "Optional. For supergroups, name of group sticker set. Returned only in getChat."] pub fn get_sticker_set_name < 'a > (& 'a self) -> Option < & 'a str > { self . sticker_set_name . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. True, if the bot can change the group sticker set. Returned only in getChat."] pub fn get_can_set_sticker_set < 'a > (& 'a self) -> Option < bool > { self . can_set_sticker_set . as_ref () . map (| v | { * v }) } # [doc = "Optional. Unique identifier for the linked chat, i.e. the discussion group identifier for a channel and vice versa; for supergroups and channel chats. This identifier may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier. Returned only in getChat."] pub fn get_linked_chat_id < 'a > (& 'a self) -> Option < i64 > { self . linked_chat_id . as_ref () . map (| v | { * v }) } # [doc = "Optional. For supergroups, the location to which the supergroup is connected. Returned only in getChat."] pub fn get_location < 'a > (& 'a self) -> Option < & 'a ChatLocation > { self . location . as_ref () . map (| v | { v }) } } # [allow (dead_code)] impl CallbackQuery { pub fn new (id : String , from : User , chat_instance : String) -> Self { Self { id , from , chat_instance , message : None , inline_message_id : None , data : None , game_short_name : None } } # [doc = "Unique identifier for this query"] pub fn get_id < 'a > (& 'a self) -> & 'a str { self . id . as_str () } # [doc = "Sender"] pub fn get_from < 'a > (& 'a self) -> & 'a User { & self . from } # [doc = "Optional. Message with the callback button that originated the query. Note that message content and message date will not be available if the message is too old"] pub fn get_message < 'a > (& 'a self) -> Option < & 'a Message > { self . message . as_ref () . map (| v | { v }) } # [doc = "Optional. Identifier of the message sent via the bot in inline mode, that originated the query."] pub fn get_inline_message_id < 'a > (& 'a self) -> Option < & 'a str > { self . inline_message_id . as_ref () . map (| v | { v . as_str () }) } # [doc = "Global identifier, uniquely corresponding to the chat to which the message with the callback button was sent. Useful for high scores in games."] pub fn get_chat_instance < 'a > (& 'a self) -> & 'a str { self . chat_instance . as_str () } # [doc = "Optional. Data associated with the callback button. Be aware that the message originated the query can contain no callback buttons with this data."] pub fn get_data < 'a > (& 'a self) -> Option < & 'a str > { self . data . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Short name of a Game to be returned, serves as the unique identifier for the game"] pub fn get_game_short_name < 'a > (& 'a self) -> Option < & 'a str > { self . game_short_name . as_ref () . map (| v | { v . as_str () }) } } impl TraitInputTextMessageContent for InputTextMessageContent { # [doc = "Text of the message to be sent, 1-4096 characters"] fn get_message_text < 'a > (& 'a self) -> & 'a str { self . message_text . as_str () } # [doc = "Optional. Mode for parsing entities in the message text. See formatting options for more details."] fn get_parse_mode < 'a > (& 'a self) -> Option < & 'a str > { self . parse_mode . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. List of special entities that appear in message text, which can be specified instead of parse_mode"] fn get_entities < 'a > (& 'a self) -> Option < & 'a Vec < MessageEntity > > { self . entities . as_ref () . map (| v | { v }) } # [doc = "Optional. Disables link previews for links in the sent message"] fn get_disable_web_page_preview < 'a > (& 'a self) -> Option < bool > { self . disable_web_page_preview . as_ref () . map (| v | { * v }) } } impl TraitInputLocationMessageContent for InputLocationMessageContent { # [doc = "Latitude of the location in degrees"] fn get_latitude < 'a > (& 'a self) -> f64 { self . latitude } # [doc = "Longitude of the location in degrees"] fn get_longitude < 'a > (& 'a self) -> f64 { self . longitude } # [doc = "Optional. The radius of uncertainty for the location, measured in meters; 0-1500"] fn get_horizontal_accuracy < 'a > (& 'a self) -> Option < f64 > { self . horizontal_accuracy . as_ref () . map (| v | { * v }) } # [doc = "Optional. Period in seconds for which the location can be updated, should be between 60 and 86400."] fn get_live_period < 'a > (& 'a self) -> Option < i64 > { self . live_period . as_ref () . map (| v | { * v }) } # [doc = "Optional. For live locations, a direction in which the user is moving, in degrees. Must be between 1 and 360 if specified."] fn get_heading < 'a > (& 'a self) -> Option < i64 > { self . heading . as_ref () . map (| v | { * v }) } # [doc = "Optional. For live locations, a maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified."] fn get_proximity_alert_radius < 'a > (& 'a self) -> Option < i64 > { self . proximity_alert_radius . as_ref () . map (| v | { * v }) } } impl TraitInputVenueMessageContent for InputVenueMessageContent { # [doc = "Latitude of the venue in degrees"] fn get_latitude < 'a > (& 'a self) -> f64 { self . latitude } # [doc = "Longitude of the venue in degrees"] fn get_longitude < 'a > (& 'a self) -> f64 { self . longitude } # [doc = "Name of the venue"] fn get_title < 'a > (& 'a self) -> & 'a str { self . title . as_str () } # [doc = "Address of the venue"] fn get_address < 'a > (& 'a self) -> & 'a str { self . address . as_str () } # [doc = "Optional. Foursquare identifier of the venue, if known"] fn get_foursquare_id < 'a > (& 'a self) -> Option < & 'a str > { self . foursquare_id . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Foursquare type of the venue, if known. (For example, \"arts_entertainment/default\", \"arts_entertainment/aquarium\" or \"food/icecream\".)"] fn get_foursquare_type < 'a > (& 'a self) -> Option < & 'a str > { self . foursquare_type . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Google Places identifier of the venue"] fn get_google_place_id < 'a > (& 'a self) -> Option < & 'a str > { self . google_place_id . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Google Places type of the venue. (See supported types.)"] fn get_google_place_type < 'a > (& 'a self) -> Option < & 'a str > { self . google_place_type . as_ref () . map (| v | { v . as_str () }) } } impl TraitInputContactMessageContent for InputContactMessageContent { # [doc = "Contact's phone number"] fn get_phone_number < 'a > (& 'a self) -> & 'a str { self . phone_number . as_str () } # [doc = "Contact's first name"] fn get_first_name < 'a > (& 'a self) -> & 'a str { self . first_name . as_str () } # [doc = "Optional. Contact's last name"] fn get_last_name < 'a > (& 'a self) -> Option < & 'a str > { self . last_name . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Additional data about the contact in the form of a vCard, 0-2048 bytes"] fn get_vcard < 'a > (& 'a self) -> Option < & 'a str > { self . vcard . as_ref () . map (| v | { v . as_str () }) } } impl TraitInputInvoiceMessageContent for InputInvoiceMessageContent { # [doc = "Product name, 1-32 characters"] fn get_title < 'a > (& 'a self) -> & 'a str { self . title . as_str () } # [doc = "Product description, 1-255 characters"] fn get_description < 'a > (& 'a self) -> & 'a str { self . description . as_str () } # [doc = "Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes."] fn get_payload < 'a > (& 'a self) -> & 'a str { self . payload . as_str () } # [doc = "Payment provider token, obtained via @BotFather"] fn get_provider_token < 'a > (& 'a self) -> & 'a str { self . provider_token . as_str () } # [doc = "Three-letter ISO 4217 currency code, see more on currencies"] fn get_currency < 'a > (& 'a self) -> & 'a str { self . currency . as_str () } # [doc = "Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.)"] fn get_prices < 'a > (& 'a self) -> & 'a Vec < LabeledPrice > { & self . prices } # [doc = "Optional. The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass max_tip_amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0"] fn get_max_tip_amount < 'a > (& 'a self) -> Option < i64 > { self . max_tip_amount . as_ref () . map (| v | { * v }) } # [doc = "Optional. A JSON-serialized array of suggested amounts of tip in the smallest units of the currency (integer, not float/double). At most 4 suggested tip amounts can be specified. The suggested tip amounts must be positive, passed in a strictly increased order and must not exceed max_tip_amount."] fn get_suggested_tip_amounts < 'a > (& 'a self) -> Option < & 'a Vec < i64 > > { self . suggested_tip_amounts . as_ref () . map (| v | { v }) } # [doc = "Optional. A JSON-serialized object for data about the invoice, which will be shared with the payment provider. A detailed description of the required fields should be provided by the payment provider."] fn get_provider_data < 'a > (& 'a self) -> Option < & 'a str > { self . provider_data . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. URL of the product photo for the invoice. Can be a photo of the goods or a marketing image for a service."] fn get_photo_url < 'a > (& 'a self) -> Option < & 'a str > { self . photo_url . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Photo size in bytes"] fn get_photo_size < 'a > (& 'a self) -> Option < i64 > { self . photo_size . as_ref () . map (| v | { * v }) } # [doc = "Optional. Photo width"] fn get_photo_width < 'a > (& 'a self) -> Option < i64 > { self . photo_width . as_ref () . map (| v | { * v }) } # [doc = "Optional. Photo height"] fn get_photo_height < 'a > (& 'a self) -> Option < i64 > { self . photo_height . as_ref () . map (| v | { * v }) } # [doc = "Optional. Pass True if you require the user's full name to complete the order"] fn get_need_name < 'a > (& 'a self) -> Option < bool > { self . need_name . as_ref () . map (| v | { * v }) } # [doc = "Optional. Pass True if you require the user's phone number to complete the order"] fn get_need_phone_number < 'a > (& 'a self) -> Option < bool > { self . need_phone_number . as_ref () . map (| v | { * v }) } # [doc = "Optional. Pass True if you require the user's email address to complete the order"] fn get_need_email < 'a > (& 'a self) -> Option < bool > { self . need_email . as_ref () . map (| v | { * v }) } # [doc = "Optional. Pass True if you require the user's shipping address to complete the order"] fn get_need_shipping_address < 'a > (& 'a self) -> Option < bool > { self . need_shipping_address . as_ref () . map (| v | { * v }) } # [doc = "Optional. Pass True if the user's phone number should be sent to provider"] fn get_send_phone_number_to_provider < 'a > (& 'a self) -> Option < bool > { self . send_phone_number_to_provider . as_ref () . map (| v | { * v }) } # [doc = "Optional. Pass True if the user's email address should be sent to provider"] fn get_send_email_to_provider < 'a > (& 'a self) -> Option < bool > { self . send_email_to_provider . as_ref () . map (| v | { * v }) } # [doc = "Optional. Pass True if the final price depends on the shipping method"] fn get_is_flexible < 'a > (& 'a self) -> Option < bool > { self . is_flexible . as_ref () . map (| v | { * v }) } } # [allow (dead_code)] impl ReplyKeyboardRemove { pub fn new (remove_keyboard : bool) -> Self { Self { remove_keyboard , selective : None } } # [doc = "Requests clients to remove the custom keyboard (user will not be able to summon this keyboard; if you want to hide the keyboard from sight but keep it accessible, use one_time_keyboard in ReplyKeyboardMarkup)"] pub fn get_remove_keyboard < 'a > (& 'a self) -> bool { self . remove_keyboard } # [doc = "Optional. Use this parameter if you want to remove the keyboard for specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply (has reply_to_message_id), sender of the original message. Example: A user votes in a poll, bot returns confirmation message in reply to the vote and removes the keyboard for that user, while still showing the keyboard with poll options to users who haven't voted yet."] pub fn get_selective < 'a > (& 'a self) -> Option < bool > { self . selective . as_ref () . map (| v | { * v }) } } # [allow (dead_code)] impl UserProfilePhotos { pub fn new (total_count : i64 , photos : Vec < Vec < PhotoSize > >) -> Self { Self { total_count , photos , } } # [doc = "Total number of profile pictures the target user has"] pub fn get_total_count < 'a > (& 'a self) -> i64 { self . total_count } # [doc = "Requested profile pictures (in up to 4 sizes each)"] pub fn get_photos < 'a > (& 'a self) -> & 'a Vec < Vec < PhotoSize > > { & self . photos } } # [allow (dead_code)] impl InlineQueryResultLocation { pub fn new (id : String , latitude : f64 , longitude : f64 , title : String) -> Self { Self { tg_type : "location" . to_owned () , id , latitude , longitude , title , horizontal_accuracy : None , live_period : None , heading : None , proximity_alert_radius : None , reply_markup : None , input_message_content : None , thumb_url : None , thumb_width : None , thumb_height : None } } # [doc = "Type of the result, must be location"] pub fn get_tg_type < 'a > (& 'a self) -> & 'a str { self . tg_type . as_str () } # [doc = "Unique identifier for this result, 1-64 Bytes"] pub fn get_id < 'a > (& 'a self) -> & 'a str { self . id . as_str () } # [doc = "Location latitude in degrees"] pub fn get_latitude < 'a > (& 'a self) -> f64 { self . latitude } # [doc = "Location longitude in degrees"] pub fn get_longitude < 'a > (& 'a self) -> f64 { self . longitude } # [doc = "Location title"] pub fn get_title < 'a > (& 'a self) -> & 'a str { self . title . as_str () } # [doc = "Optional. The radius of uncertainty for the location, measured in meters; 0-1500"] pub fn get_horizontal_accuracy < 'a > (& 'a self) -> Option < f64 > { self . horizontal_accuracy . as_ref () . map (| v | { * v }) } # [doc = "Optional. Period in seconds for which the location can be updated, should be between 60 and 86400."] pub fn get_live_period < 'a > (& 'a self) -> Option < i64 > { self . live_period . as_ref () . map (| v | { * v }) } # [doc = "Optional. For live locations, a direction in which the user is moving, in degrees. Must be between 1 and 360 if specified."] pub fn get_heading < 'a > (& 'a self) -> Option < i64 > { self . heading . as_ref () . map (| v | { * v }) } # [doc = "Optional. For live locations, a maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified."] pub fn get_proximity_alert_radius < 'a > (& 'a self) -> Option < i64 > { self . proximity_alert_radius . as_ref () . map (| v | { * v }) } # [doc = "Optional. Inline keyboard attached to the message"] pub fn get_reply_markup < 'a > (& 'a self) -> Option < & 'a InlineKeyboardMarkup > { self . reply_markup . as_ref () . map (| v | { v }) } # [doc = "Optional. Content of the message to be sent instead of the location"] pub fn get_input_message_content < 'a > (& 'a self) -> Option < & 'a InputMessageContent > { self . input_message_content . as_ref () . map (| v | { v }) } # [doc = "Optional. Url of the thumbnail for the result"] pub fn get_thumb_url < 'a > (& 'a self) -> Option < & 'a str > { self . thumb_url . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Thumbnail width"] pub fn get_thumb_width < 'a > (& 'a self) -> Option < i64 > { self . thumb_width . as_ref () . map (| v | { * v }) } # [doc = "Optional. Thumbnail height"] pub fn get_thumb_height < 'a > (& 'a self) -> Option < i64 > { self . thumb_height . as_ref () . map (| v | { * v }) } } # [allow (dead_code)] impl PollOption { pub fn new (text : String , voter_count : i64) -> Self { Self { text , voter_count , } } # [doc = "Option text, 1-100 characters"] pub fn get_text < 'a > (& 'a self) -> & 'a str { self . text . as_str () } # [doc = "Number of users that voted for this option"] pub fn get_voter_count < 'a > (& 'a self) -> i64 { self . voter_count } } # [allow (dead_code)] impl InlineKeyboardMarkup { pub fn new (inline_keyboard : Vec < Vec < InlineKeyboardButton > >) -> Self { Self { inline_keyboard , } } # [doc = "Array of button rows, each represented by an Array of InlineKeyboardButton objects"] pub fn get_inline_keyboard < 'a > (& 'a self) -> & 'a Vec < Vec < InlineKeyboardButton > > { & self . inline_keyboard } } # [allow (dead_code)] impl ChatMemberOwner { pub fn new (status : String , user : User , is_anonymous : bool) -> Self { Self { status , user , is_anonymous , custom_title : None } } # [doc = "The member's status in the chat, always \"creator\""] pub fn get_status < 'a > (& 'a self) -> & 'a str { self . status . as_str () } # [doc = "Information about the user"] pub fn get_user < 'a > (& 'a self) -> & 'a User { & self . user } # [doc = "True, if the user's presence in the chat is hidden"] pub fn get_is_anonymous < 'a > (& 'a self) -> bool { self . is_anonymous } # [doc = "Optional. Custom title for this user"] pub fn get_custom_title < 'a > (& 'a self) -> Option < & 'a str > { self . custom_title . as_ref () . map (| v | { v . as_str () }) } } # [allow (dead_code)] impl SentWebAppMessage { pub fn new () -> Self { Self { inline_message_id : None } } # [doc = "Optional. Identifier of the sent inline message. Available only if there is an inline keyboard attached to the message."] pub fn get_inline_message_id < 'a > (& 'a self) -> Option < & 'a str > { self . inline_message_id . as_ref () . map (| v | { v . as_str () }) } } # [allow (dead_code)] impl LabeledPrice { pub fn new (label : String , amount : i64) -> Self { Self { label , amount , } } # [doc = "Portion label"] pub fn get_label < 'a > (& 'a self) -> & 'a str { self . label . as_str () } # [doc = "Price of the product in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies)."] pub fn get_amount < 'a > (& 'a self) -> i64 { self . amount } } # [allow (dead_code)] impl InputMediaPhoto { pub fn new (media : Option < InputFile >) -> Self { Self { tg_type : "photo" . to_owned () , media , caption : None , parse_mode : None , caption_entities : None } } # [doc = "Type of the result, must be photo"] pub fn get_tg_type < 'a > (& 'a self) -> & 'a str { self . tg_type . as_str () } # [doc = "File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass \"attach://<file_attach_name>\" to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files: https://core.telegram.org/bots/api#sending-files"] pub fn get_media < 'a > (& 'a self) -> & 'a Option < InputFile > { & self . media } # [doc = "Optional. Caption of the photo to be sent, 0-1024 characters after entities parsing"] pub fn get_caption < 'a > (& 'a self) -> Option < & 'a str > { self . caption . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Mode for parsing entities in the photo caption. See formatting options for more details."] pub fn get_parse_mode < 'a > (& 'a self) -> Option < & 'a str > { self . parse_mode . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode"] pub fn get_caption_entities < 'a > (& 'a self) -> Option < & 'a Vec < MessageEntity > > { self . caption_entities . as_ref () . map (| v | { v }) } fn to_form (self , data : Form) -> Result < (Form , String) > { match self . media { Some (InputFile :: Bytes (FileBytes { name , bytes : Some (bytes) })) => { let attach = format ! ("attach://{}" , name) ; let form = data . part (name , Part :: bytes (bytes)) ; Ok ((form , attach)) } Some (InputFile :: String (name)) => Ok ((data , name)) , _ => Err (anyhow ! ("cry")) , } } } # [allow (dead_code)] impl InlineQueryResultCachedVoice { pub fn new (id : String , voice_file_id : String , title : String) -> Self { Self { tg_type : "voice" . to_owned () , id , voice_file_id , title , caption : None , parse_mode : None , caption_entities : None , reply_markup : None , input_message_content : None } } # [doc = "Type of the result, must be voice"] pub fn get_tg_type < 'a > (& 'a self) -> & 'a str { self . tg_type . as_str () } # [doc = "Unique identifier for this result, 1-64 bytes"] pub fn get_id < 'a > (& 'a self) -> & 'a str { self . id . as_str () } # [doc = "A valid file identifier for the voice message"] pub fn get_voice_file_id < 'a > (& 'a self) -> & 'a str { self . voice_file_id . as_str () } # [doc = "Voice message title"] pub fn get_title < 'a > (& 'a self) -> & 'a str { self . title . as_str () } # [doc = "Optional. Caption, 0-1024 characters after entities parsing"] pub fn get_caption < 'a > (& 'a self) -> Option < & 'a str > { self . caption . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Mode for parsing entities in the voice message caption. See formatting options for more details."] pub fn get_parse_mode < 'a > (& 'a self) -> Option < & 'a str > { self . parse_mode . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode"] pub fn get_caption_entities < 'a > (& 'a self) -> Option < & 'a Vec < MessageEntity > > { self . caption_entities . as_ref () . map (| v | { v }) } # [doc = "Optional. Inline keyboard attached to the message"] pub fn get_reply_markup < 'a > (& 'a self) -> Option < & 'a InlineKeyboardMarkup > { self . reply_markup . as_ref () . map (| v | { v }) } # [doc = "Optional. Content of the message to be sent instead of the voice message"] pub fn get_input_message_content < 'a > (& 'a self) -> Option < & 'a InputMessageContent > { self . input_message_content . as_ref () . map (| v | { v }) } } # [allow (dead_code)] impl Venue { pub fn new (location : Location , title : String , address : String) -> Self { Self { location , title , address , foursquare_id : None , foursquare_type : None , google_place_id : None , google_place_type : None } } # [doc = "Venue location. Can't be a live location"] pub fn get_location < 'a > (& 'a self) -> & 'a Location { & self . location } # [doc = "Name of the venue"] pub fn get_title < 'a > (& 'a self) -> & 'a str { self . title . as_str () } # [doc = "Address of the venue"] pub fn get_address < 'a > (& 'a self) -> & 'a str { self . address . as_str () } # [doc = "Optional. Foursquare identifier of the venue"] pub fn get_foursquare_id < 'a > (& 'a self) -> Option < & 'a str > { self . foursquare_id . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Foursquare type of the venue. (For example, \"arts_entertainment/default\", \"arts_entertainment/aquarium\" or \"food/icecream\".)"] pub fn get_foursquare_type < 'a > (& 'a self) -> Option < & 'a str > { self . foursquare_type . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Google Places identifier of the venue"] pub fn get_google_place_id < 'a > (& 'a self) -> Option < & 'a str > { self . google_place_id . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Google Places type of the venue. (See supported types.)"] pub fn get_google_place_type < 'a > (& 'a self) -> Option < & 'a str > { self . google_place_type . as_ref () . map (| v | { v . as_str () }) } } # [allow (dead_code)] impl KeyboardButton { pub fn new (text : String) -> Self { Self { text , request_contact : None , request_location : None , request_poll : None , web_app : None } } # [doc = "Text of the button. If none of the optional fields are used, it will be sent as a message when the button is pressed"] pub fn get_text < 'a > (& 'a self) -> & 'a str { self . text . as_str () } # [doc = "Optional. If True, the user's phone number will be sent as a contact when the button is pressed. Available in private chats only."] pub fn get_request_contact < 'a > (& 'a self) -> Option < bool > { self . request_contact . as_ref () . map (| v | { * v }) } # [doc = "Optional. If True, the user's current location will be sent when the button is pressed. Available in private chats only."] pub fn get_request_location < 'a > (& 'a self) -> Option < bool > { self . request_location . as_ref () . map (| v | { * v }) } # [doc = "Optional. If specified, the user will be asked to create a poll and send it to the bot when the button is pressed. Available in private chats only."] pub fn get_request_poll < 'a > (& 'a self) -> Option < & 'a KeyboardButtonPollType > { self . request_poll . as_ref () . map (| v | { v }) } # [doc = "Optional. If specified, the described Web App will be launched when the button is pressed. The Web App will be able to send a \"web_app_data\" service message. Available in private chats only."] pub fn get_web_app < 'a > (& 'a self) -> Option < & 'a WebAppInfo > { self . web_app . as_ref () . map (| v | { v }) } } # [allow (dead_code)] impl InputMediaVideo { pub fn new (media : Option < InputFile >) -> Self { Self { tg_type : "video" . to_owned () , media , thumb : None , caption : None , parse_mode : None , caption_entities : None , width : None , height : None , duration : None , supports_streaming : None } } # [doc = "Type of the result, must be video"] pub fn get_tg_type < 'a > (& 'a self) -> & 'a str { self . tg_type . as_str () } # [doc = "File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass \"attach://<file_attach_name>\" to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files: https://core.telegram.org/bots/api#sending-files"] pub fn get_media < 'a > (& 'a self) -> & 'a Option < InputFile > { & self . media } # [doc = "Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass \"attach://<file_attach_name>\" if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files: https://core.telegram.org/bots/api#sending-files"] pub fn get_thumb < 'a > (& 'a self) -> Option < & 'a InputFile > { self . thumb . as_ref () . map (| v | { v }) } # [doc = "Optional. Caption of the video to be sent, 0-1024 characters after entities parsing"] pub fn get_caption < 'a > (& 'a self) -> Option < & 'a str > { self . caption . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. Mode for parsing entities in the video caption. See formatting options for more details."] pub fn get_parse_mode < 'a > (& 'a self) -> Option < & 'a str > { self . parse_mode . as_ref () . map (| v | { v . as_str () }) } # [doc = "Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode"] pub fn get_caption_entities < 'a > (& 'a self) -> Option < & 'a Vec < MessageEntity > > { self . caption_entities . as_ref () . map (| v | { v }) } # [doc = "Optional. Video width"] pub fn get_width < 'a > (& 'a self) -> Option < i64 > { self . width . as_ref () . map (| v | { * v }) } # [doc = "Optional. Video height"] pub fn get_height < 'a > (& 'a self) -> Option < i64 > { self . height . as_ref () . map (| v | { * v }) } # [doc = "Optional. Video duration in seconds"] pub fn get_duration < 'a > (& 'a self) -> Option < i64 > { self . duration . as_ref () . map (| v | { * v }) } # [doc = "Optional. Pass True if the uploaded video is suitable for streaming"] pub fn get_supports_streaming < 'a > (& 'a self) -> Option < bool > { self . supports_streaming . as_ref () . map (| v | { * v }) } fn to_form (self , data : Form) -> Result < (Form , String) > { match self . media { Some (InputFile :: Bytes (FileBytes { name , bytes : Some (bytes) })) => { let attach = format ! ("attach://{}" , name) ; let form = data . part (name , Part :: bytes (bytes)) ; Ok ((form , attach)) } Some (InputFile :: String (name)) => Ok ((data , name)) , _ => Err (anyhow ! ("cry")) , } } } # [derive (Serialize , Deserialize , Debug)] # [serde (untagged)] pub enum GlobalTypes { File (File) , ForceReply (ForceReply) , PassportElementErrorTranslationFile (PassportElementErrorTranslationFile) , VideoChatScheduled (VideoChatScheduled) , BotCommandScope (BotCommandScope) , StickerSet (StickerSet) , OrderInfo (OrderInfo) , Dice (Dice) , ChatLocation (ChatLocation) , User (User) , Update (Update) , ShippingAddress (ShippingAddress) , InlineQueryResultCachedPhoto (InlineQueryResultCachedPhoto) , ChatPhoto (ChatPhoto) , InputMediaDocument (InputMediaDocument) , PhotoSize (PhotoSize) , Contact (Contact) , InputMedia (InputMedia) , ChosenInlineResult (ChosenInlineResult) , InputContactMessageContent (InputContactMessageContent) , ChatMemberLeft (ChatMemberLeft) , Sticker (Sticker) , InlineQueryResultCachedGif (InlineQueryResultCachedGif) , InlineKeyboardButton (InlineKeyboardButton) , InlineQuery (InlineQuery) , MessageId (MessageId) , BotCommandScopeChatMember (BotCommandScopeChatMember) , InputMediaAnimation (InputMediaAnimation) , InlineQueryResultVoice (InlineQueryResultVoice) , InlineQueryResultContact (InlineQueryResultContact) , MaskPosition (MaskPosition) , PassportElementError (PassportElementError) , ShippingOption (ShippingOption) , PassportElementErrorReverseSide (PassportElementErrorReverseSide) , ChatMemberRestricted (ChatMemberRestricted) , BotCommandScopeChat (BotCommandScopeChat) , PreCheckoutQuery (PreCheckoutQuery) , InlineQueryResultPhoto (InlineQueryResultPhoto) , ChatMemberBanned (ChatMemberBanned) , PassportElementErrorTranslationFiles (PassportElementErrorTranslationFiles) , CallbackGame (CallbackGame) , PollAnswer (PollAnswer) , InlineQueryResultCachedVideo (InlineQueryResultCachedVideo) , WebAppData (WebAppData) , ChatMemberAdministrator (ChatMemberAdministrator) , PassportElementErrorUnspecified (PassportElementErrorUnspecified) , InputInvoiceMessageContent (InputInvoiceMessageContent) , MenuButtonWebApp (MenuButtonWebApp) , Audio (Audio) , LoginUrl (LoginUrl) , InlineQueryResultGif (InlineQueryResultGif) , WebhookInfo (WebhookInfo) , SuccessfulPayment (SuccessfulPayment) , Animation (Animation) , InlineQueryResultVenue (InlineQueryResultVenue) , PassportElementErrorDataField (PassportElementErrorDataField) , ResponseParameters (ResponseParameters) , VideoChatStarted (VideoChatStarted) , ReplyKeyboardMarkup (ReplyKeyboardMarkup) , InlineQueryResult (InlineQueryResult) , BotCommandScopeAllChatAdministrators (BotCommandScopeAllChatAdministrators) , Poll (Poll) , MenuButtonDefault (MenuButtonDefault) , KeyboardButtonPollType (KeyboardButtonPollType) , ChatAdministratorRights (ChatAdministratorRights) , ProximityAlertTriggered (ProximityAlertTriggered) , ChatMemberMember (ChatMemberMember) , Voice (Voice) , EncryptedPassportElement (EncryptedPassportElement) , Location (Location) , InlineQueryResultCachedMpeg4Gif (InlineQueryResultCachedMpeg4Gif) , MessageAutoDeleteTimerChanged (MessageAutoDeleteTimerChanged) , Game (Game) , GameHighScore (GameHighScore) , ChatPermissions (ChatPermissions) , InlineQueryResultCachedSticker (InlineQueryResultCachedSticker) , BotCommandScopeAllPrivateChats (BotCommandScopeAllPrivateChats) , MenuButton (MenuButton) , InlineQueryResultAudio (InlineQueryResultAudio) , BotCommandScopeAllGroupChats (BotCommandScopeAllGroupChats) , BotCommandScopeChatAdministrators (BotCommandScopeChatAdministrators) , EncryptedCredentials (EncryptedCredentials) , VideoChatParticipantsInvited (VideoChatParticipantsInvited) , VideoChatEnded (VideoChatEnded) , InputVenueMessageContent (InputVenueMessageContent) , ChatJoinRequest (ChatJoinRequest) , PassportElementErrorFiles (PassportElementErrorFiles) , InlineQueryResultCachedDocument (InlineQueryResultCachedDocument) , InlineQueryResultCachedAudio (InlineQueryResultCachedAudio) , ChatInviteLink (ChatInviteLink) , InputMediaAudio (InputMediaAudio) , MenuButtonCommands (MenuButtonCommands) , InputFile (InputFile) , Message (Message) , InlineQueryResultDocument (InlineQueryResultDocument) , ChatMember (ChatMember) , Video (Video) , InlineQueryResultArticle (InlineQueryResultArticle) , PassportElementErrorSelfie (PassportElementErrorSelfie) , MessageEntity (MessageEntity) , BotCommand (BotCommand) , Invoice (Invoice) , ChatMemberUpdated (ChatMemberUpdated) , BotCommandScopeDefault (BotCommandScopeDefault) , InlineQueryResultMpeg4Gif (InlineQueryResultMpeg4Gif) , ShippingQuery (ShippingQuery) , InputTextMessageContent (InputTextMessageContent) , InputLocationMessageContent (InputLocationMessageContent) , InlineQueryResultGame (InlineQueryResultGame) , VideoNote (VideoNote) , PassportFile (PassportFile) , PassportElementErrorFrontSide (PassportElementErrorFrontSide) , PassportElementErrorFile (PassportElementErrorFile) , InlineQueryResultVideo (InlineQueryResultVideo) , Document (Document) , WebAppInfo (WebAppInfo) , PassportData (PassportData) , Chat (Chat) , CallbackQuery (CallbackQuery) , InputMessageContent (InputMessageContent) , ReplyKeyboardRemove (ReplyKeyboardRemove) , UserProfilePhotos (UserProfilePhotos) , InlineQueryResultLocation (InlineQueryResultLocation) , PollOption (PollOption) , InlineKeyboardMarkup (InlineKeyboardMarkup) , ChatMemberOwner (ChatMemberOwner) , SentWebAppMessage (SentWebAppMessage) , LabeledPrice (LabeledPrice) , InputMediaPhoto (InputMediaPhoto) , InlineQueryResultCachedVoice (InlineQueryResultCachedVoice) , Venue (Venue) , KeyboardButton (KeyboardButton) , InputMediaVideo (InputMediaVideo) } # [derive (Serialize , Deserialize , Debug)] # [serde (untagged)] pub enum EChatId { I64 (i64) , String (String) } impl fmt :: Display for EChatId { fn fmt (& self , f : & mut fmt :: Formatter) -> fmt :: Result { let v = match self { EChatId :: I64 (thing) => serde_json :: to_string (thing) . unwrap_or_else (| err | format ! ("invalid: {err}")) , EChatId :: String (thing) => serde_json :: to_string (thing) . unwrap_or_else (| err | format ! ("invalid: {err}")) } ; write ! (f , "{}" , v) ? ; Ok (()) } } # [derive (Serialize , Deserialize , Debug)] # [serde (untagged)] pub enum EReplyMarkup { InlineKeyboardMarkup (InlineKeyboardMarkup) , ReplyKeyboardMarkup (ReplyKeyboardMarkup) , ReplyKeyboardRemove (ReplyKeyboardRemove) , ForceReply (ForceReply) } # [derive (Serialize , Deserialize , Debug)] # [serde (untagged)] pub enum EMedia { InputMediaAudio (InputMediaAudio) , InputMediaDocument (InputMediaDocument) , InputMediaPhoto (InputMediaPhoto) , InputMediaVideo (InputMediaVideo) } # [derive (Serialize , Deserialize , Debug)] # [serde (untagged)] pub enum MessageBool { Message (Message) , Bool (bool) } impl fmt :: Display for MessageBool { fn fmt (& self , f : & mut fmt :: Formatter) -> fmt :: Result { let v = match self { MessageBool :: Message (thing) => serde_json :: to_string (thing) . unwrap_or_else (| err | format ! ("invalid: {err}")) , MessageBool :: Bool (thing) => serde_json :: to_string (thing) . unwrap_or_else (| err | format ! ("invalid: {err}")) } ; write ! (f , "{}" , v) ? ; Ok (()) } }