tdlib/opt/rustwide/target/x86_64-unknown-linux-gnu/debug/build/tdlib-8c71c3ed0f95d72c/out/
generated.rs

1// Copyright 2020 - developers of the `grammers` project.
2// Copyright 2021 - developers of the `tdlib-rs` project.
3//
4// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
5// https://www.apache.org/licenses/LICENSE-2.0> or the MIT license
6// <LICENSE-MIT or https://opensource.org/licenses/MIT>, at your
7// option. This file may not be copied, modified, or distributed
8// except according to those terms.
9pub mod types {
10    use serde::{Deserialize, Serialize};
11    use serde_with::{serde_as, DisplayFromStr};
12    /// An object of this type can be returned on every function call, in case of an error
13    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
14    pub struct Error {
15        /// Error code; subject to future changes. If the error code is 406, the error message must not be processed in any way and must not be displayed to the user
16        pub code: i32,
17        /// Error message; subject to future changes
18        pub message: String,
19    }
20    /// An authentication code is delivered via a private Telegram message, which can be viewed from another active session
21    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
22    pub struct AuthenticationCodeTypeTelegramMessage {
23        /// Length of the code
24        pub length: i32,
25    }
26    /// An authentication code is delivered via an SMS message to the specified phone number; applications may not receive this type of code
27    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
28    pub struct AuthenticationCodeTypeSms {
29        /// Length of the code
30        pub length: i32,
31    }
32    /// An authentication code is delivered via a phone call to the specified phone number
33    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
34    pub struct AuthenticationCodeTypeCall {
35        /// Length of the code
36        pub length: i32,
37    }
38    /// An authentication code is delivered by an immediately canceled call to the specified phone number. The phone number that calls is the code that must be entered automatically
39    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
40    pub struct AuthenticationCodeTypeFlashCall {
41        /// Pattern of the phone number from which the call will be made
42        pub pattern: String,
43    }
44    /// An authentication code is delivered by an immediately canceled call to the specified phone number. The last digits of the phone number that calls are the code that must be entered manually by the user
45    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
46    pub struct AuthenticationCodeTypeMissedCall {
47        /// Prefix of the phone number from which the call will be made
48        pub phone_number_prefix: String,
49        /// Number of digits in the code, excluding the prefix
50        pub length: i32,
51    }
52    /// An authentication code is delivered to https:fragment.com. The user must be logged in there via a wallet owning the phone number's NFT
53    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
54    pub struct AuthenticationCodeTypeFragment {
55        /// URL to open to receive the code
56        pub url: String,
57        /// Length of the code
58        pub length: i32,
59    }
60    /// An authentication code is delivered via Firebase Authentication to the official Android application
61    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
62    pub struct AuthenticationCodeTypeFirebaseAndroid {
63        /// Nonce to pass to the SafetyNet Attestation API
64        pub nonce: String,
65        /// Length of the code
66        pub length: i32,
67    }
68    /// An authentication code is delivered via Firebase Authentication to the official iOS application
69    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
70    pub struct AuthenticationCodeTypeFirebaseIos {
71        /// Receipt of successful application token validation to compare with receipt from push notification
72        pub receipt: String,
73        /// Time after the next authentication method is supposed to be used if verification push notification isn't received, in seconds
74        pub push_timeout: i32,
75        /// Length of the code
76        pub length: i32,
77    }
78    /// Information about the authentication code that was sent
79    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
80    pub struct AuthenticationCodeInfo {
81        /// A phone number that is being authenticated
82        pub phone_number: String,
83        /// The way the code was sent to the user
84        pub r#type: crate::enums::AuthenticationCodeType,
85        /// The way the next code will be sent to the user; may be null
86        pub next_type: Option<crate::enums::AuthenticationCodeType>,
87        /// Timeout before the code can be re-sent, in seconds
88        pub timeout: i32,
89    }
90    /// Information about the email address authentication code that was sent
91    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
92    pub struct EmailAddressAuthenticationCodeInfo {
93        /// Pattern of the email address to which an authentication code was sent
94        pub email_address_pattern: String,
95        /// Length of the code; 0 if unknown
96        pub length: i32,
97    }
98    /// An authentication code delivered to a user's email address
99    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
100    pub struct EmailAddressAuthenticationCode {
101        /// The code
102        pub code: String,
103    }
104    /// An authentication token received through Apple ID
105    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
106    pub struct EmailAddressAuthenticationAppleId {
107        /// The token
108        pub token: String,
109    }
110    /// An authentication token received through Google ID
111    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
112    pub struct EmailAddressAuthenticationGoogleId {
113        /// The token
114        pub token: String,
115    }
116    /// Email address can be reset after the given period. Call resetAuthenticationEmailAddress to reset it and allow the user to authorize with a code sent to the user's phone number
117    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
118    pub struct EmailAddressResetStateAvailable {
119        /// Time required to wait before the email address can be reset; 0 if the user is subscribed to Telegram Premium
120        pub wait_period: i32,
121    }
122    /// Email address reset has already been requested. Call resetAuthenticationEmailAddress to check whether immediate reset is possible
123    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
124    pub struct EmailAddressResetStatePending {
125        /// Left time before the email address will be reset, in seconds. updateAuthorizationState is not sent when this field changes
126        pub reset_in: i32,
127    }
128    /// Represents a part of the text that needs to be formatted in some unusual way
129    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
130    pub struct TextEntity {
131        /// Offset of the entity, in UTF-16 code units
132        pub offset: i32,
133        /// Length of the entity, in UTF-16 code units
134        pub length: i32,
135        /// Type of the entity
136        pub r#type: crate::enums::TextEntityType,
137    }
138    /// Contains a list of text entities
139    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
140    pub struct TextEntities {
141        /// List of text entities
142        pub entities: Vec<crate::types::TextEntity>,
143    }
144    /// A text with some entities
145    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
146    pub struct FormattedText {
147        /// The text
148        pub text: String,
149        /// Entities contained in the text. Entities can be nested, but must not mutually intersect with each other.
150        /// Pre, Code and PreCode entities can't contain other entities. Bold, Italic, Underline, Strikethrough, and Spoiler entities can contain and can be part of any other entities. All other entities can't contain each other
151        pub entities: Vec<crate::types::TextEntity>,
152    }
153    /// Contains Telegram terms of service
154    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
155    pub struct TermsOfService {
156        /// Text of the terms of service
157        pub text: crate::types::FormattedText,
158        /// The minimum age of a user to be able to accept the terms; 0 if age isn't restricted
159        pub min_user_age: i32,
160        /// True, if a blocking popup with terms of service must be shown to the user
161        pub show_popup: bool,
162    }
163    /// TDLib needs the user's email address to authorize. Call setAuthenticationEmailAddress to provide the email address, or directly call checkAuthenticationEmailCode with Apple ID/Google ID token if allowed
164    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
165    pub struct AuthorizationStateWaitEmailAddress {
166        /// True, if authorization through Apple ID is allowed
167        pub allow_apple_id: bool,
168        /// True, if authorization through Google ID is allowed
169        pub allow_google_id: bool,
170    }
171    /// TDLib needs the user's authentication code sent to an email address to authorize. Call checkAuthenticationEmailCode to provide the code
172    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
173    pub struct AuthorizationStateWaitEmailCode {
174        /// True, if authorization through Apple ID is allowed
175        pub allow_apple_id: bool,
176        /// True, if authorization through Google ID is allowed
177        pub allow_google_id: bool,
178        /// Information about the sent authentication code
179        pub code_info: crate::types::EmailAddressAuthenticationCodeInfo,
180        /// Reset state of the email address; may be null if the email address can't be reset
181        pub email_address_reset_state: Option<crate::enums::EmailAddressResetState>,
182    }
183    /// TDLib needs the user's authentication code to authorize. Call checkAuthenticationCode to check the code
184    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
185    pub struct AuthorizationStateWaitCode {
186        /// Information about the authorization code that was sent
187        pub code_info: crate::types::AuthenticationCodeInfo,
188    }
189    /// The user needs to confirm authorization on another logged in device by scanning a QR code with the provided link
190    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
191    pub struct AuthorizationStateWaitOtherDeviceConfirmation {
192        /// A tg: URL for the QR code. The link will be updated frequently
193        pub link: String,
194    }
195    /// The user is unregistered and need to accept terms of service and enter their first name and last name to finish registration. Call registerUser to accept the terms of service and provide the data
196    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
197    pub struct AuthorizationStateWaitRegistration {
198        /// Telegram terms of service
199        pub terms_of_service: crate::types::TermsOfService,
200    }
201    /// The user has been authorized, but needs to enter a 2-step verification password to start using the application.
202    /// Call checkAuthenticationPassword to provide the password, or requestAuthenticationPasswordRecovery to recover the password, or deleteAccount to delete the account after a week
203    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
204    pub struct AuthorizationStateWaitPassword {
205        /// Hint for the password; may be empty
206        pub password_hint: String,
207        /// True, if a recovery email address has been set up
208        pub has_recovery_email_address: bool,
209        /// True, if some Telegram Passport elements were saved
210        pub has_passport_data: bool,
211        /// Pattern of the email address to which the recovery email was sent; empty until a recovery email has been sent
212        pub recovery_email_address_pattern: String,
213    }
214    /// Represents the current state of 2-step verification
215    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
216    pub struct PasswordState {
217        /// True, if a 2-step verification password is set
218        pub has_password: bool,
219        /// Hint for the password; may be empty
220        pub password_hint: String,
221        /// True, if a recovery email is set
222        pub has_recovery_email_address: bool,
223        /// True, if some Telegram Passport elements were saved
224        pub has_passport_data: bool,
225        /// Information about the recovery email address to which the confirmation email was sent; may be null
226        pub recovery_email_address_code_info: Option<crate::types::EmailAddressAuthenticationCodeInfo>,
227        /// Pattern of the email address set up for logging in
228        pub login_email_address_pattern: String,
229        /// If not 0, point in time (Unix timestamp) after which the 2-step verification password can be reset immediately using resetPassword
230        pub pending_reset_date: i32,
231    }
232    /// Contains information about the current recovery email address
233    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
234    pub struct RecoveryEmailAddress {
235        /// Recovery email address
236        pub recovery_email_address: String,
237    }
238    /// Returns information about the availability of a temporary password, which can be used for payments
239    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
240    pub struct TemporaryPasswordState {
241        /// True, if a temporary password is available
242        pub has_password: bool,
243        /// Time left before the temporary password expires, in seconds
244        pub valid_for: i32,
245    }
246    /// Represents a local file
247    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
248    pub struct LocalFile {
249        /// Local path to the locally available file part; may be empty
250        pub path: String,
251        /// True, if it is possible to download or generate the file
252        pub can_be_downloaded: bool,
253        /// True, if the file can be deleted
254        pub can_be_deleted: bool,
255        /// True, if the file is currently being downloaded (or a local copy is being generated by some other means)
256        pub is_downloading_active: bool,
257        /// True, if the local copy is fully available
258        pub is_downloading_completed: bool,
259        /// Download will be started from this offset. downloaded_prefix_size is calculated from this offset
260        pub download_offset: i64,
261        /// If is_downloading_completed is false, then only some prefix of the file starting from download_offset is ready to be read. downloaded_prefix_size is the size of that prefix in bytes
262        pub downloaded_prefix_size: i64,
263        /// Total downloaded file size, in bytes. Can be used only for calculating download progress. The actual file size may be bigger, and some parts of it may contain garbage
264        pub downloaded_size: i64,
265    }
266    /// Represents a remote file
267    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
268    pub struct RemoteFile {
269        /// Remote file identifier; may be empty. Can be used by the current user across application restarts or even from other devices. Uniquely identifies a file, but a file can have a lot of different valid identifiers.
270        /// If the identifier starts with "http:" or "https:", it represents the HTTP URL of the file. TDLib is currently unable to download files if only their URL is known.
271        /// If downloadFile/addFileToDownloads is called on such a file or if it is sent to a secret chat, TDLib starts a file generation process by sending updateFileGenerationStart to the application with the HTTP URL in the original_path and "#url#" as the conversion string.
272        /// Application must generate the file by downloading it to the specified location
273        pub id: String,
274        /// Unique file identifier; may be empty if unknown. The unique file identifier which is the same for the same file even for different users and is persistent over time
275        pub unique_id: String,
276        /// True, if the file is currently being uploaded (or a remote copy is being generated by some other means)
277        pub is_uploading_active: bool,
278        /// True, if a remote copy is fully available
279        pub is_uploading_completed: bool,
280        /// Size of the remote available part of the file, in bytes; 0 if unknown
281        pub uploaded_size: i64,
282    }
283    /// Represents a file
284    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
285    pub struct File {
286        /// Unique file identifier
287        pub id: i32,
288        /// File size, in bytes; 0 if unknown
289        pub size: i64,
290        /// Approximate file size in bytes in case the exact file size is unknown. Can be used to show download/upload progress
291        pub expected_size: i64,
292        /// Information about the local copy of the file
293        pub local: crate::types::LocalFile,
294        /// Information about the remote copy of the file
295        pub remote: crate::types::RemoteFile,
296    }
297    /// A file defined by its unique identifier
298    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
299    pub struct InputFileId {
300        /// Unique file identifier
301        pub id: i32,
302    }
303    /// A file defined by its remote identifier. The remote identifier is guaranteed to be usable only if the corresponding file is still accessible to the user and known to TDLib.
304    /// For example, if the file is from a message, then the message must be not deleted and accessible to the user. If the file database is disabled, then the corresponding object with the file must be preloaded by the application
305    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
306    pub struct InputFileRemote {
307        /// Remote file identifier
308        pub id: String,
309    }
310    /// A file defined by a local path
311    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
312    pub struct InputFileLocal {
313        /// Local path to the file
314        pub path: String,
315    }
316    /// A file generated by the application
317    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
318    pub struct InputFileGenerated {
319        /// Local path to a file from which the file is generated; may be empty if there is no such file
320        pub original_path: String,
321        /// String specifying the conversion applied to the original file; must be persistent across application restarts. Conversions beginning with '#' are reserved for internal TDLib usage
322        pub conversion: String,
323        /// Expected size of the generated file, in bytes; 0 if unknown
324        pub expected_size: i64,
325    }
326    /// Describes an image in JPEG format
327    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
328    pub struct PhotoSize {
329        /// Image type (see https:core.telegram.org/constructor/photoSize)
330        pub r#type: String,
331        /// Information about the image file
332        pub photo: crate::types::File,
333        /// Image width
334        pub width: i32,
335        /// Image height
336        pub height: i32,
337        /// Sizes of progressive JPEG file prefixes, which can be used to preliminarily show the image; in bytes
338        pub progressive_sizes: Vec<i32>,
339    }
340    /// Thumbnail image of a very poor quality and low resolution
341    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
342    pub struct Minithumbnail {
343        /// Thumbnail width, usually doesn't exceed 40
344        pub width: i32,
345        /// Thumbnail height, usually doesn't exceed 40
346        pub height: i32,
347        /// The thumbnail in JPEG format
348        pub data: String,
349    }
350    /// Represents a thumbnail
351    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
352    pub struct Thumbnail {
353        /// Thumbnail format
354        pub format: crate::enums::ThumbnailFormat,
355        /// Thumbnail width
356        pub width: i32,
357        /// Thumbnail height
358        pub height: i32,
359        /// The thumbnail
360        pub file: crate::types::File,
361    }
362    /// Position on a photo where a mask is placed
363    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
364    pub struct MaskPosition {
365        /// Part of the face, relative to which the mask is placed
366        pub point: crate::enums::MaskPoint,
367        /// Shift by X-axis measured in widths of the mask scaled to the face size, from left to right. (For example, -1.0 will place the mask just to the left of the default mask position)
368        pub x_shift: f64,
369        /// 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)
370        pub y_shift: f64,
371        /// Mask scaling coefficient. (For example, 2.0 means a doubled size)
372        pub scale: f64,
373    }
374    /// The sticker is a regular sticker
375    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
376    pub struct StickerFullTypeRegular {
377        /// Premium animation of the sticker; may be null. If present, only Telegram Premium users can use the sticker
378        pub premium_animation: Option<crate::types::File>,
379    }
380    /// The sticker is a mask in WEBP format to be placed on photos or videos
381    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
382    pub struct StickerFullTypeMask {
383        /// Position where the mask is placed; may be null
384        pub mask_position: Option<crate::types::MaskPosition>,
385    }
386    /// The sticker is a custom emoji to be used inside message text and caption. Currently, only Telegram Premium users can use custom emoji
387    #[serde_as]
388    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
389    pub struct StickerFullTypeCustomEmoji {
390        /// Identifier of the custom emoji
391        #[serde_as(as = "DisplayFromStr")]
392        pub custom_emoji_id: i64,
393        /// True, if the sticker must be repainted to a text color in messages, the color of the Telegram Premium badge in emoji status, white color on chat photos, or another appropriate color in other places
394        pub needs_repainting: bool,
395    }
396    /// Represents a closed vector path. The path begins at the end point of the last command
397    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
398    pub struct ClosedVectorPath {
399        /// List of vector path commands
400        pub commands: Vec<crate::enums::VectorPathCommand>,
401    }
402    /// Describes one answer option of a poll
403    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
404    pub struct PollOption {
405        /// Option text; 1-100 characters
406        pub text: String,
407        /// Number of voters for this option, available only for closed or voted polls
408        pub voter_count: i32,
409        /// The percentage of votes for this option; 0-100
410        pub vote_percentage: i32,
411        /// True, if the option was chosen by the user
412        pub is_chosen: bool,
413        /// True, if the option is being chosen by a pending setPollAnswer request
414        pub is_being_chosen: bool,
415    }
416    /// A regular poll
417    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
418    pub struct PollTypeRegular {
419        /// True, if multiple answer options can be chosen simultaneously
420        pub allow_multiple_answers: bool,
421    }
422    /// A poll in quiz mode, which has exactly one correct answer option and can be answered only once
423    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
424    pub struct PollTypeQuiz {
425        /// 0-based identifier of the correct answer option; -1 for a yet unanswered poll
426        pub correct_option_id: i32,
427        /// Text that is shown when the user chooses an incorrect answer or taps on the lamp icon; 0-200 characters with at most 2 line feeds; empty for a yet unanswered poll
428        pub explanation: crate::types::FormattedText,
429    }
430    /// Describes an animation file. The animation must be encoded in GIF or MPEG4 format
431    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
432    pub struct Animation {
433        /// Duration of the animation, in seconds; as defined by the sender
434        pub duration: i32,
435        /// Width of the animation
436        pub width: i32,
437        /// Height of the animation
438        pub height: i32,
439        /// Original name of the file; as defined by the sender
440        pub file_name: String,
441        /// MIME type of the file, usually "image/gif" or "video/mp4"
442        pub mime_type: String,
443        /// True, if stickers were added to the animation. The list of corresponding sticker set can be received using getAttachedStickerSets
444        pub has_stickers: bool,
445        /// Animation minithumbnail; may be null
446        pub minithumbnail: Option<crate::types::Minithumbnail>,
447        /// Animation thumbnail in JPEG or MPEG4 format; may be null
448        pub thumbnail: Option<crate::types::Thumbnail>,
449        /// File containing the animation
450        pub animation: crate::types::File,
451    }
452    /// Describes an audio file. Audio is usually in MP3 or M4A format
453    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
454    pub struct Audio {
455        /// Duration of the audio, in seconds; as defined by the sender
456        pub duration: i32,
457        /// Title of the audio; as defined by the sender
458        pub title: String,
459        /// Performer of the audio; as defined by the sender
460        pub performer: String,
461        /// Original name of the file; as defined by the sender
462        pub file_name: String,
463        /// The MIME type of the file; as defined by the sender
464        pub mime_type: String,
465        /// The minithumbnail of the album cover; may be null
466        pub album_cover_minithumbnail: Option<crate::types::Minithumbnail>,
467        /// The thumbnail of the album cover in JPEG format; as defined by the sender. The full size thumbnail is supposed to be extracted from the downloaded audio file; may be null
468        pub album_cover_thumbnail: Option<crate::types::Thumbnail>,
469        /// Album cover variants to use if the downloaded audio file contains no album cover. Provided thumbnail dimensions are approximate
470        pub external_album_covers: Vec<crate::types::Thumbnail>,
471        /// File containing the audio
472        pub audio: crate::types::File,
473    }
474    /// Describes a document of any type
475    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
476    pub struct Document {
477        /// Original name of the file; as defined by the sender
478        pub file_name: String,
479        /// MIME type of the file; as defined by the sender
480        pub mime_type: String,
481        /// Document minithumbnail; may be null
482        pub minithumbnail: Option<crate::types::Minithumbnail>,
483        /// Document thumbnail in JPEG or PNG format (PNG will be used only for background patterns); as defined by the sender; may be null
484        pub thumbnail: Option<crate::types::Thumbnail>,
485        /// File containing the document
486        pub document: crate::types::File,
487    }
488    /// Describes a photo
489    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
490    pub struct Photo {
491        /// True, if stickers were added to the photo. The list of corresponding sticker sets can be received using getAttachedStickerSets
492        pub has_stickers: bool,
493        /// Photo minithumbnail; may be null
494        pub minithumbnail: Option<crate::types::Minithumbnail>,
495        /// Available variants of the photo, in different sizes
496        pub sizes: Vec<crate::types::PhotoSize>,
497    }
498    /// Describes a sticker
499    #[serde_as]
500    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
501    pub struct Sticker {
502        /// Unique sticker identifier within the set; 0 if none
503        #[serde_as(as = "DisplayFromStr")]
504        pub id: i64,
505        /// Identifier of the sticker set to which the sticker belongs; 0 if none
506        #[serde_as(as = "DisplayFromStr")]
507        pub set_id: i64,
508        /// Sticker width; as defined by the sender
509        pub width: i32,
510        /// Sticker height; as defined by the sender
511        pub height: i32,
512        /// Emoji corresponding to the sticker
513        pub emoji: String,
514        /// Sticker format
515        pub format: crate::enums::StickerFormat,
516        /// Sticker's full type
517        pub full_type: crate::enums::StickerFullType,
518        /// Sticker's outline represented as a list of closed vector paths; may be empty. The coordinate system origin is in the upper-left corner
519        pub outline: Vec<crate::types::ClosedVectorPath>,
520        /// Sticker thumbnail in WEBP or JPEG format; may be null
521        pub thumbnail: Option<crate::types::Thumbnail>,
522        /// File containing the sticker
523        pub sticker: crate::types::File,
524    }
525    /// Describes a video file
526    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
527    pub struct Video {
528        /// Duration of the video, in seconds; as defined by the sender
529        pub duration: i32,
530        /// Video width; as defined by the sender
531        pub width: i32,
532        /// Video height; as defined by the sender
533        pub height: i32,
534        /// Original name of the file; as defined by the sender
535        pub file_name: String,
536        /// MIME type of the file; as defined by the sender
537        pub mime_type: String,
538        /// True, if stickers were added to the video. The list of corresponding sticker sets can be received using getAttachedStickerSets
539        pub has_stickers: bool,
540        /// True, if the video is supposed to be streamed
541        pub supports_streaming: bool,
542        /// Video minithumbnail; may be null
543        pub minithumbnail: Option<crate::types::Minithumbnail>,
544        /// Video thumbnail in JPEG or MPEG4 format; as defined by the sender; may be null
545        pub thumbnail: Option<crate::types::Thumbnail>,
546        /// File containing the video
547        pub video: crate::types::File,
548    }
549    /// Describes a video note. The video must be equal in width and height, cropped to a circle, and stored in MPEG4 format
550    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
551    pub struct VideoNote {
552        /// Duration of the video, in seconds; as defined by the sender
553        pub duration: i32,
554        /// A waveform representation of the video note's audio in 5-bit format; may be empty if unknown
555        pub waveform: String,
556        /// Video width and height; as defined by the sender
557        pub length: i32,
558        /// Video minithumbnail; may be null
559        pub minithumbnail: Option<crate::types::Minithumbnail>,
560        /// Video thumbnail in JPEG format; as defined by the sender; may be null
561        pub thumbnail: Option<crate::types::Thumbnail>,
562        /// Result of speech recognition in the video note; may be null
563        pub speech_recognition_result: Option<crate::enums::SpeechRecognitionResult>,
564        /// File containing the video
565        pub video: crate::types::File,
566    }
567    /// Describes a voice note. The voice note must be encoded with the Opus codec, and stored inside an OGG container. Voice notes can have only a single audio channel
568    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
569    pub struct VoiceNote {
570        /// Duration of the voice note, in seconds; as defined by the sender
571        pub duration: i32,
572        /// A waveform representation of the voice note in 5-bit format
573        pub waveform: String,
574        /// MIME type of the file; as defined by the sender
575        pub mime_type: String,
576        /// Result of speech recognition in the voice note; may be null
577        pub speech_recognition_result: Option<crate::enums::SpeechRecognitionResult>,
578        /// File containing the voice note
579        pub voice: crate::types::File,
580    }
581    /// Describes an animated or custom representation of an emoji
582    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
583    pub struct AnimatedEmoji {
584        /// Sticker for the emoji; may be null if yet unknown for a custom emoji. If the sticker is a custom emoji, it can have arbitrary format different from stickerFormatTgs
585        pub sticker: Option<crate::types::Sticker>,
586        /// Expected width of the sticker, which can be used if the sticker is null
587        pub sticker_width: i32,
588        /// Expected height of the sticker, which can be used if the sticker is null
589        pub sticker_height: i32,
590        /// Emoji modifier fitzpatrick type; 0-6; 0 if none
591        pub fitzpatrick_type: i32,
592        /// File containing the sound to be played when the sticker is clicked; may be null. The sound is encoded with the Opus codec, and stored inside an OGG container
593        pub sound: Option<crate::types::File>,
594    }
595    /// Describes a user contact
596    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
597    pub struct Contact {
598        /// Phone number of the user
599        pub phone_number: String,
600        /// First name of the user; 1-255 characters in length
601        pub first_name: String,
602        /// Last name of the user
603        pub last_name: String,
604        /// Additional data about the user in a form of vCard; 0-2048 bytes in length
605        pub vcard: String,
606        /// Identifier of the user, if known; 0 otherwise
607        pub user_id: i64,
608    }
609    /// Describes a location on planet Earth
610    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
611    pub struct Location {
612        /// Latitude of the location in degrees; as defined by the sender
613        pub latitude: f64,
614        /// Longitude of the location, in degrees; as defined by the sender
615        pub longitude: f64,
616        /// The estimated horizontal accuracy of the location, in meters; as defined by the sender. 0 if unknown
617        pub horizontal_accuracy: f64,
618    }
619    /// Describes a venue
620    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
621    pub struct Venue {
622        /// Venue location; as defined by the sender
623        pub location: crate::types::Location,
624        /// Venue name; as defined by the sender
625        pub title: String,
626        /// Venue address; as defined by the sender
627        pub address: String,
628        /// Provider of the venue database; as defined by the sender. Currently, only "foursquare" and "gplaces" (Google Places) need to be supported
629        pub provider: String,
630        /// Identifier of the venue in the provider database; as defined by the sender
631        pub id: String,
632        /// Type of the venue in the provider database; as defined by the sender
633        pub r#type: String,
634    }
635    /// Describes a game. Use getInternalLink with internalLinkTypeGame to share the game
636    #[serde_as]
637    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
638    pub struct Game {
639        /// Unique game identifier
640        #[serde_as(as = "DisplayFromStr")]
641        pub id: i64,
642        /// Game short name
643        pub short_name: String,
644        /// Game title
645        pub title: String,
646        /// Game text, usually containing scoreboards for a game
647        pub text: crate::types::FormattedText,
648        /// Game description
649        pub description: String,
650        /// Game photo
651        pub photo: crate::types::Photo,
652        /// Game animation; may be null
653        pub animation: Option<crate::types::Animation>,
654    }
655    /// Describes a Web App. Use getInternalLink with internalLinkTypeWebApp to share the Web App
656    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
657    pub struct WebApp {
658        /// Web App short name
659        pub short_name: String,
660        /// Web App title
661        pub title: String,
662        /// Web App description
663        pub description: String,
664        /// Web App photo
665        pub photo: crate::types::Photo,
666        /// Web App animation; may be null
667        pub animation: Option<crate::types::Animation>,
668    }
669    /// Describes a poll
670    #[serde_as]
671    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
672    pub struct Poll {
673        /// Unique poll identifier
674        #[serde_as(as = "DisplayFromStr")]
675        pub id: i64,
676        /// Poll question; 1-300 characters
677        pub question: String,
678        /// List of poll answer options
679        pub options: Vec<crate::types::PollOption>,
680        /// Total number of voters, participating in the poll
681        pub total_voter_count: i32,
682        /// Identifiers of recent voters, if the poll is non-anonymous
683        pub recent_voter_ids: Vec<crate::enums::MessageSender>,
684        /// True, if the poll is anonymous
685        pub is_anonymous: bool,
686        /// Type of the poll
687        pub r#type: crate::enums::PollType,
688        /// Amount of time the poll will be active after creation, in seconds
689        pub open_period: i32,
690        /// Point in time (Unix timestamp) when the poll will automatically be closed
691        pub close_date: i32,
692        /// True, if the poll is closed
693        pub is_closed: bool,
694    }
695    /// Describes a chat background
696    #[serde_as]
697    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
698    pub struct Background {
699        /// Unique background identifier
700        #[serde_as(as = "DisplayFromStr")]
701        pub id: i64,
702        /// True, if this is one of default backgrounds
703        pub is_default: bool,
704        /// True, if the background is dark and is recommended to be used with dark theme
705        pub is_dark: bool,
706        /// Unique background name
707        pub name: String,
708        /// Document with the background; may be null. Null only for filled backgrounds
709        pub document: Option<crate::types::Document>,
710        /// Type of the background
711        pub r#type: crate::enums::BackgroundType,
712    }
713    /// Contains a list of backgrounds
714    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
715    pub struct Backgrounds {
716        /// A list of backgrounds
717        pub backgrounds: Vec<crate::types::Background>,
718    }
719    /// Describes a background set for a specific chat
720    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
721    pub struct ChatBackground {
722        /// The background
723        pub background: crate::types::Background,
724        /// Dimming of the background in dark themes, as a percentage; 0-100
725        pub dark_theme_dimming: i32,
726    }
727    /// Describes a user profile photo
728    #[serde_as]
729    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
730    pub struct ProfilePhoto {
731        /// Photo identifier; 0 for an empty photo. Can be used to find a photo in a list of user profile photos
732        #[serde_as(as = "DisplayFromStr")]
733        pub id: i64,
734        /// A small (160x160) user profile photo. The file can be downloaded only before the photo is changed
735        pub small: crate::types::File,
736        /// A big (640x640) user profile photo. The file can be downloaded only before the photo is changed
737        pub big: crate::types::File,
738        /// User profile photo minithumbnail; may be null
739        pub minithumbnail: Option<crate::types::Minithumbnail>,
740        /// True, if the photo has animated variant
741        pub has_animation: bool,
742        /// True, if the photo is visible only for the current user
743        pub is_personal: bool,
744    }
745    /// Contains basic information about the photo of a chat
746    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
747    pub struct ChatPhotoInfo {
748        /// A small (160x160) chat photo variant in JPEG format. The file can be downloaded only before the photo is changed
749        pub small: crate::types::File,
750        /// A big (640x640) chat photo variant in JPEG format. The file can be downloaded only before the photo is changed
751        pub big: crate::types::File,
752        /// Chat photo minithumbnail; may be null
753        pub minithumbnail: Option<crate::types::Minithumbnail>,
754        /// True, if the photo has animated variant
755        pub has_animation: bool,
756        /// True, if the photo is visible only for the current user
757        pub is_personal: bool,
758    }
759    /// A bot (see https:core.telegram.org/bots)
760    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
761    pub struct UserTypeBot {
762        /// True, if the bot is owned by the current user and can be edited using the methods toggleBotUsernameIsActive, reorderBotActiveUsernames, setBotProfilePhoto, setBotName, setBotInfoDescription, and setBotInfoShortDescription
763        pub can_be_edited: bool,
764        /// True, if the bot can be invited to basic group and supergroup chats
765        pub can_join_groups: bool,
766        /// True, if the bot can read all messages in basic group or supergroup chats and not just those addressed to the bot. In private and channel chats a bot can always read all messages
767        pub can_read_all_group_messages: bool,
768        /// True, if the bot supports inline queries
769        pub is_inline: bool,
770        /// Placeholder for inline queries (displayed on the application input field)
771        pub inline_query_placeholder: String,
772        /// True, if the location of the user is expected to be sent with every inline query to this bot
773        pub need_location: bool,
774        /// True, if the bot can be added to attachment or side menu
775        pub can_be_added_to_attachment_menu: bool,
776    }
777    /// Represents a command supported by a bot
778    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
779    pub struct BotCommand {
780        /// Text of the bot command
781        pub command: String,
782        /// Description of the bot command
783        pub description: String,
784    }
785    /// Contains a list of bot commands
786    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
787    pub struct BotCommands {
788        /// Bot's user identifier
789        pub bot_user_id: i64,
790        /// List of bot commands
791        pub commands: Vec<crate::types::BotCommand>,
792    }
793    /// Describes a button to be shown instead of bot commands menu button
794    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
795    pub struct BotMenuButton {
796        /// Text of the button
797        pub text: String,
798        /// URL to be passed to openWebApp
799        pub url: String,
800    }
801    /// Represents a location to which a chat is connected
802    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
803    pub struct ChatLocation {
804        /// The location
805        pub location: crate::types::Location,
806        /// Location address; 1-64 characters, as defined by the chat owner
807        pub address: String,
808    }
809    /// Information about the sticker, which was used to create the chat photo
810    #[serde_as]
811    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
812    pub struct ChatPhotoStickerTypeRegularOrMask {
813        /// Sticker set identifier
814        #[serde_as(as = "DisplayFromStr")]
815        pub sticker_set_id: i64,
816        /// Identifier of the sticker in the set
817        #[serde_as(as = "DisplayFromStr")]
818        pub sticker_id: i64,
819    }
820    /// Information about the custom emoji, which was used to create the chat photo
821    #[serde_as]
822    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
823    pub struct ChatPhotoStickerTypeCustomEmoji {
824        /// Identifier of the custom emoji
825        #[serde_as(as = "DisplayFromStr")]
826        pub custom_emoji_id: i64,
827    }
828    /// Information about the sticker, which was used to create the chat photo. The sticker is shown at the center of the photo and occupies at most 67% of it
829    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
830    pub struct ChatPhotoSticker {
831        /// Type of the sticker
832        pub r#type: crate::enums::ChatPhotoStickerType,
833        /// The fill to be used as background for the sticker; rotation angle in backgroundFillGradient isn't supported
834        pub background_fill: crate::enums::BackgroundFill,
835    }
836    /// Animated variant of a chat photo in MPEG4 format
837    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
838    pub struct AnimatedChatPhoto {
839        /// Animation width and height
840        pub length: i32,
841        /// Information about the animation file
842        pub file: crate::types::File,
843        /// Timestamp of the frame, used as a static chat photo
844        pub main_frame_timestamp: f64,
845    }
846    /// Describes a chat or user profile photo
847    #[serde_as]
848    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
849    pub struct ChatPhoto {
850        /// Unique photo identifier
851        #[serde_as(as = "DisplayFromStr")]
852        pub id: i64,
853        /// Point in time (Unix timestamp) when the photo has been added
854        pub added_date: i32,
855        /// Photo minithumbnail; may be null
856        pub minithumbnail: Option<crate::types::Minithumbnail>,
857        /// Available variants of the photo in JPEG format, in different size
858        pub sizes: Vec<crate::types::PhotoSize>,
859        /// A big (up to 1280x1280) animated variant of the photo in MPEG4 format; may be null
860        pub animation: Option<crate::types::AnimatedChatPhoto>,
861        /// A small (160x160) animated variant of the photo in MPEG4 format; may be null even the big animation is available
862        pub small_animation: Option<crate::types::AnimatedChatPhoto>,
863        /// Sticker-based version of the chat photo; may be null
864        pub sticker: Option<crate::types::ChatPhotoSticker>,
865    }
866    /// Contains a list of chat or user profile photos
867    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
868    pub struct ChatPhotos {
869        /// Total number of photos
870        pub total_count: i32,
871        /// List of photos
872        pub photos: Vec<crate::types::ChatPhoto>,
873    }
874    /// A previously used profile photo of the current user
875    #[serde_as]
876    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
877    pub struct InputChatPhotoPrevious {
878        /// Identifier of the current user's profile photo to reuse
879        #[serde_as(as = "DisplayFromStr")]
880        pub chat_photo_id: i64,
881    }
882    /// A static photo in JPEG format
883    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
884    pub struct InputChatPhotoStatic {
885        /// Photo to be set as profile photo. Only inputFileLocal and inputFileGenerated are allowed
886        pub photo: crate::enums::InputFile,
887    }
888    /// An animation in MPEG4 format; must be square, at most 10 seconds long, have width between 160 and 1280 and be at most 2MB in size
889    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
890    pub struct InputChatPhotoAnimation {
891        /// Animation to be set as profile photo. Only inputFileLocal and inputFileGenerated are allowed
892        pub animation: crate::enums::InputFile,
893        /// Timestamp of the frame, which will be used as static chat photo
894        pub main_frame_timestamp: f64,
895    }
896    /// A sticker on a custom background
897    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
898    pub struct InputChatPhotoSticker {
899        /// Information about the sticker
900        pub sticker: crate::types::ChatPhotoSticker,
901    }
902    /// Describes actions that a user is allowed to take in a chat
903    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
904    pub struct ChatPermissions {
905        /// True, if the user can send text messages, contacts, invoices, locations, and venues
906        pub can_send_basic_messages: bool,
907        /// True, if the user can send music files
908        pub can_send_audios: bool,
909        /// True, if the user can send documents
910        pub can_send_documents: bool,
911        /// True, if the user can send audio photos
912        pub can_send_photos: bool,
913        /// True, if the user can send audio videos
914        pub can_send_videos: bool,
915        /// True, if the user can send video notes
916        pub can_send_video_notes: bool,
917        /// True, if the user can send voice notes
918        pub can_send_voice_notes: bool,
919        /// True, if the user can send polls
920        pub can_send_polls: bool,
921        /// True, if the user can send animations, games, stickers, and dice and use inline bots
922        pub can_send_other_messages: bool,
923        /// True, if the user may add a web page preview to their messages
924        pub can_add_web_page_previews: bool,
925        /// True, if the user can change the chat title, photo, and other settings
926        pub can_change_info: bool,
927        /// True, if the user can invite new users to the chat
928        pub can_invite_users: bool,
929        /// True, if the user can pin messages
930        pub can_pin_messages: bool,
931        /// True, if the user can manage topics
932        pub can_manage_topics: bool,
933    }
934    /// Describes rights of the administrator
935    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
936    pub struct ChatAdministratorRights {
937        /// True, if the administrator can get chat event log, get chat statistics, get chat boosts in channels, get message statistics in channels, get channel members,
938        /// see anonymous administrators in supergroups and ignore slow mode. Implied by any other privilege; applicable to supergroups and channels only
939        pub can_manage_chat: bool,
940        /// True, if the administrator can change the chat title, photo, and other settings
941        pub can_change_info: bool,
942        /// True, if the administrator can create channel posts; applicable to channels only
943        pub can_post_messages: bool,
944        /// True, if the administrator can edit messages of other users and pin messages; applicable to channels only
945        pub can_edit_messages: bool,
946        /// True, if the administrator can delete messages of other users
947        pub can_delete_messages: bool,
948        /// True, if the administrator can invite new users to the chat
949        pub can_invite_users: bool,
950        /// True, if the administrator can restrict, ban, or unban chat members; always true for channels
951        pub can_restrict_members: bool,
952        /// True, if the administrator can pin messages; applicable to basic groups and supergroups only
953        pub can_pin_messages: bool,
954        /// True, if the administrator can manage topics; applicable to forum supergroups only
955        pub can_manage_topics: bool,
956        /// True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that were directly or indirectly promoted by them
957        pub can_promote_members: bool,
958        /// True, if the administrator can manage video chats
959        pub can_manage_video_chats: bool,
960        /// True, if the administrator can create new channel stories, or edit and delete posted stories; applicable to channels only
961        pub can_post_stories: bool,
962        /// True, if the administrator can edit stories posted by other users, pin stories and access story archive; applicable to channels only
963        pub can_edit_stories: bool,
964        /// True, if the administrator can delete stories posted by other users; applicable to channels only
965        pub can_delete_stories: bool,
966        /// True, if the administrator isn't shown in the chat member list and sends messages anonymously; applicable to supergroups only
967        pub is_anonymous: bool,
968    }
969    /// Describes an option for buying Telegram Premium to a user
970    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
971    pub struct PremiumPaymentOption {
972        /// ISO 4217 currency code for Telegram Premium subscription payment
973        pub currency: String,
974        /// The amount to pay, in the smallest units of the currency
975        pub amount: i64,
976        /// The discount associated with this option, as a percentage
977        pub discount_percentage: i32,
978        /// Number of month the Telegram Premium subscription will be active
979        pub month_count: i32,
980        /// Identifier of the store product associated with the option
981        pub store_product_id: String,
982        /// An internal link to be opened for buying Telegram Premium to the user if store payment isn't possible; may be null if direct payment isn't available
983        pub payment_link: Option<crate::enums::InternalLinkType>,
984    }
985    /// Describes an option for buying or upgrading Telegram Premium for self
986    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
987    pub struct PremiumStatePaymentOption {
988        /// Information about the payment option
989        pub payment_option: crate::types::PremiumPaymentOption,
990        /// True, if this is the currently used Telegram Premium subscription option
991        pub is_current: bool,
992        /// True, if the payment option can be used to upgrade the existing Telegram Premium subscription
993        pub is_upgrade: bool,
994        /// Identifier of the last in-store transaction for the currently used option
995        pub last_transaction_id: String,
996    }
997    /// Describes a custom emoji to be shown instead of the Telegram Premium badge
998    #[serde_as]
999    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
1000    pub struct EmojiStatus {
1001        /// Identifier of the custom emoji in stickerFormatTgs format
1002        #[serde_as(as = "DisplayFromStr")]
1003        pub custom_emoji_id: i64,
1004        /// Point in time (Unix timestamp) when the status will expire; 0 if never
1005        pub expiration_date: i32,
1006    }
1007    /// Contains a list of custom emoji identifiers, which can be set as emoji statuses
1008    #[serde_as]
1009    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
1010    pub struct EmojiStatuses {
1011        /// The list of custom emoji identifiers
1012        #[serde_as(as = "Vec<DisplayFromStr>")]
1013        pub custom_emoji_ids: Vec<i64>,
1014    }
1015    /// Describes usernames assigned to a user, a supergroup, or a channel
1016    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
1017    pub struct Usernames {
1018        /// List of active usernames; the first one must be shown as the primary username. The order of active usernames can be changed with reorderActiveUsernames, reorderBotActiveUsernames or reorderSupergroupActiveUsernames
1019        pub active_usernames: Vec<String>,
1020        /// List of currently disabled usernames; the username can be activated with toggleUsernameIsActive, toggleBotUsernameIsActive, or toggleSupergroupUsernameIsActive
1021        pub disabled_usernames: Vec<String>,
1022        /// The active username, which can be changed with setUsername or setSupergroupUsername
1023        pub editable_username: String,
1024    }
1025    /// Represents a user
1026    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
1027    pub struct User {
1028        /// User identifier
1029        pub id: i64,
1030        /// First name of the user
1031        pub first_name: String,
1032        /// Last name of the user
1033        pub last_name: String,
1034        /// Usernames of the user; may be null
1035        pub usernames: Option<crate::types::Usernames>,
1036        /// Phone number of the user
1037        pub phone_number: String,
1038        /// Current online status of the user
1039        pub status: crate::enums::UserStatus,
1040        /// Profile photo of the user; may be null
1041        pub profile_photo: Option<crate::types::ProfilePhoto>,
1042        /// Emoji status to be shown instead of the default Telegram Premium badge; may be null. For Telegram Premium users only
1043        pub emoji_status: Option<crate::types::EmojiStatus>,
1044        /// The user is a contact of the current user
1045        pub is_contact: bool,
1046        /// The user is a contact of the current user and the current user is a contact of the user
1047        pub is_mutual_contact: bool,
1048        /// The user is a close friend of the current user; implies that the user is a contact
1049        pub is_close_friend: bool,
1050        /// True, if the user is verified
1051        pub is_verified: bool,
1052        /// True, if the user is a Telegram Premium user
1053        pub is_premium: bool,
1054        /// True, if the user is Telegram support account
1055        pub is_support: bool,
1056        /// If non-empty, it contains a human-readable description of the reason why access to this user must be restricted
1057        pub restriction_reason: String,
1058        /// True, if many users reported this user as a scam
1059        pub is_scam: bool,
1060        /// True, if many users reported this user as a fake account
1061        pub is_fake: bool,
1062        /// True, if the user has non-expired stories available to the current user
1063        pub has_active_stories: bool,
1064        /// True, if the user has unread non-expired stories available to the current user
1065        pub has_unread_active_stories: bool,
1066        /// If false, the user is inaccessible, and the only information known about the user is inside this class. Identifier of the user can't be passed to any method
1067        pub have_access: bool,
1068        /// Type of the user
1069        pub r#type: crate::enums::UserType,
1070        /// IETF language tag of the user's language; only available to bots
1071        pub language_code: String,
1072        /// True, if the user added the current bot to attachment menu; only available to bots
1073        pub added_to_attachment_menu: bool,
1074    }
1075    /// Contains information about a bot
1076    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
1077    pub struct BotInfo {
1078        /// The text that is shown on the bot's profile page and is sent together with the link when users share the bot
1079        pub short_description: String,
1080        /// The text shown in the chat with the bot if the chat is empty
1081        pub description: String,
1082        /// Photo shown in the chat with the bot if the chat is empty; may be null
1083        pub photo: Option<crate::types::Photo>,
1084        /// Animation shown in the chat with the bot if the chat is empty; may be null
1085        pub animation: Option<crate::types::Animation>,
1086        /// Information about a button to show instead of the bot commands menu button; may be null if ordinary bot commands menu must be shown
1087        pub menu_button: Option<crate::types::BotMenuButton>,
1088        /// List of the bot commands
1089        pub commands: Vec<crate::types::BotCommand>,
1090        /// Default administrator rights for adding the bot to basic group and supergroup chats; may be null
1091        pub default_group_administrator_rights: Option<crate::types::ChatAdministratorRights>,
1092        /// Default administrator rights for adding the bot to channels; may be null
1093        pub default_channel_administrator_rights: Option<crate::types::ChatAdministratorRights>,
1094        /// The internal link, which can be used to edit bot commands; may be null
1095        pub edit_commands_link: Option<crate::enums::InternalLinkType>,
1096        /// The internal link, which can be used to edit bot description; may be null
1097        pub edit_description_link: Option<crate::enums::InternalLinkType>,
1098        /// The internal link, which can be used to edit the photo or animation shown in the chat with the bot if the chat is empty; may be null
1099        pub edit_description_media_link: Option<crate::enums::InternalLinkType>,
1100        /// The internal link, which can be used to edit bot settings; may be null
1101        pub edit_settings_link: Option<crate::enums::InternalLinkType>,
1102    }
1103    /// Contains full information about a user
1104    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
1105    pub struct UserFullInfo {
1106        /// User profile photo set by the current user for the contact; may be null. If null and user.profile_photo is null, then the photo is empty; otherwise, it is unknown.
1107        /// If non-null, then it is the same photo as in user.profile_photo and chat.photo. This photo isn't returned in the list of user photos
1108        pub personal_photo: Option<crate::types::ChatPhoto>,
1109        /// User profile photo; may be null. If null and user.profile_photo is null, then the photo is empty; otherwise, it is unknown.
1110        /// If non-null and personal_photo is null, then it is the same photo as in user.profile_photo and chat.photo
1111        pub photo: Option<crate::types::ChatPhoto>,
1112        /// User profile photo visible if the main photo is hidden by privacy settings; may be null. If null and user.profile_photo is null, then the photo is empty; otherwise, it is unknown.
1113        /// If non-null and both photo and personal_photo are null, then it is the same photo as in user.profile_photo and chat.photo. This photo isn't returned in the list of user photos
1114        pub public_photo: Option<crate::types::ChatPhoto>,
1115        /// Block list to which the user is added; may be null if none
1116        pub block_list: Option<crate::enums::BlockList>,
1117        /// True, if the user can be called
1118        pub can_be_called: bool,
1119        /// True, if a video call can be created with the user
1120        pub supports_video_calls: bool,
1121        /// True, if the user can't be called due to their privacy settings
1122        pub has_private_calls: bool,
1123        /// True, if the user can't be linked in forwarded messages due to their privacy settings
1124        pub has_private_forwards: bool,
1125        /// True, if voice and video notes can't be sent or forwarded to the user
1126        pub has_restricted_voice_and_video_note_messages: bool,
1127        /// True, if the user has pinned stories
1128        pub has_pinned_stories: bool,
1129        /// True, if the current user needs to explicitly allow to share their phone number with the user when the method addContact is used
1130        pub need_phone_number_privacy_exception: bool,
1131        /// A short user bio; may be null for bots
1132        pub bio: Option<crate::types::FormattedText>,
1133        /// The list of available options for gifting Telegram Premium to the user
1134        pub premium_gift_options: Vec<crate::types::PremiumPaymentOption>,
1135        /// Number of group chats where both the other user and the current user are a member; 0 for the current user
1136        pub group_in_common_count: i32,
1137        /// For bots, information about the bot; may be null if the user isn't a bot
1138        pub bot_info: Option<crate::types::BotInfo>,
1139    }
1140    /// Represents a list of users
1141    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
1142    pub struct Users {
1143        /// Approximate total number of users found
1144        pub total_count: i32,
1145        /// A list of user identifiers
1146        pub user_ids: Vec<i64>,
1147    }
1148    /// Contains information about a chat administrator
1149    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
1150    pub struct ChatAdministrator {
1151        /// User identifier of the administrator
1152        pub user_id: i64,
1153        /// Custom title of the administrator
1154        pub custom_title: String,
1155        /// True, if the user is the owner of the chat
1156        pub is_owner: bool,
1157    }
1158    /// Represents a list of chat administrators
1159    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
1160    pub struct ChatAdministrators {
1161        /// A list of chat administrators
1162        pub administrators: Vec<crate::types::ChatAdministrator>,
1163    }
1164    /// The user is the owner of the chat and has all the administrator privileges
1165    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
1166    pub struct ChatMemberStatusCreator {
1167        /// A custom title of the owner; 0-16 characters without emojis; applicable to supergroups only
1168        pub custom_title: String,
1169        /// True, if the creator isn't shown in the chat member list and sends messages anonymously; applicable to supergroups only
1170        pub is_anonymous: bool,
1171        /// True, if the user is a member of the chat
1172        pub is_member: bool,
1173    }
1174    /// The user is a member of the chat and has some additional privileges. In basic groups, administrators can edit and delete messages sent by others, add new members, ban unprivileged members, and manage video chats.
1175    /// In supergroups and channels, there are more detailed options for administrator privileges
1176    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
1177    pub struct ChatMemberStatusAdministrator {
1178        /// A custom title of the administrator; 0-16 characters without emojis; applicable to supergroups only
1179        pub custom_title: String,
1180        /// True, if the current user can edit the administrator privileges for the called user
1181        pub can_be_edited: bool,
1182        /// Rights of the administrator
1183        pub rights: crate::types::ChatAdministratorRights,
1184    }
1185    /// The user is under certain restrictions in the chat. Not supported in basic groups and channels
1186    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
1187    pub struct ChatMemberStatusRestricted {
1188        /// True, if the user is a member of the chat
1189        pub is_member: bool,
1190        /// Point in time (Unix timestamp) when restrictions will be lifted from the user; 0 if never. If the user is restricted for more than 366 days or for less than 30 seconds from the current time, the user is considered to be restricted forever
1191        pub restricted_until_date: i32,
1192        /// User permissions in the chat
1193        pub permissions: crate::types::ChatPermissions,
1194    }
1195    /// The user or the chat was banned (and hence is not a member of the chat). Implies the user can't return to the chat, view messages, or be used as a participant identifier to join a video chat of the chat
1196    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
1197    pub struct ChatMemberStatusBanned {
1198        /// Point in time (Unix timestamp) when the user will be unbanned; 0 if never. If the user is banned for more than 366 days or for less than 30 seconds from the current time, the user is considered to be banned forever. Always 0 in basic groups
1199        pub banned_until_date: i32,
1200    }
1201    /// Describes a user or a chat as a member of another chat
1202    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
1203    pub struct ChatMember {
1204        /// Identifier of the chat member. Currently, other chats can be only Left or Banned. Only supergroups and channels can have other chats as Left or Banned members and these chats must be supergroups or channels
1205        pub member_id: crate::enums::MessageSender,
1206        /// Identifier of a user that invited/promoted/banned this member in the chat; 0 if unknown
1207        pub inviter_user_id: i64,
1208        /// Point in time (Unix timestamp) when the user joined/was promoted/was banned in the chat
1209        pub joined_chat_date: i32,
1210        /// Status of the member in the chat
1211        pub status: crate::enums::ChatMemberStatus,
1212    }
1213    /// Contains a list of chat members
1214    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
1215    pub struct ChatMembers {
1216        /// Approximate total number of chat members found
1217        pub total_count: i32,
1218        /// A list of chat members
1219        pub members: Vec<crate::types::ChatMember>,
1220    }
1221    /// Returns users which can be mentioned in the chat
1222    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
1223    pub struct ChatMembersFilterMention {
1224        /// If non-zero, the identifier of the current message thread
1225        pub message_thread_id: i64,
1226    }
1227    /// Returns contacts of the user, which are members of the supergroup or channel
1228    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
1229    pub struct SupergroupMembersFilterContacts {
1230        /// Query to search for
1231        pub query: String,
1232    }
1233    /// Used to search for supergroup or channel members via a (string) query
1234    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
1235    pub struct SupergroupMembersFilterSearch {
1236        /// Query to search for
1237        pub query: String,
1238    }
1239    /// Returns restricted supergroup members; can be used only by administrators
1240    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
1241    pub struct SupergroupMembersFilterRestricted {
1242        /// Query to search for
1243        pub query: String,
1244    }
1245    /// Returns users banned from the supergroup or channel; can be used only by administrators
1246    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
1247    pub struct SupergroupMembersFilterBanned {
1248        /// Query to search for
1249        pub query: String,
1250    }
1251    /// Returns users which can be mentioned in the supergroup
1252    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
1253    pub struct SupergroupMembersFilterMention {
1254        /// Query to search for
1255        pub query: String,
1256        /// If non-zero, the identifier of the current message thread
1257        pub message_thread_id: i64,
1258    }
1259    /// Contains a chat invite link
1260    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
1261    pub struct ChatInviteLink {
1262        /// Chat invite link
1263        pub invite_link: String,
1264        /// Name of the link
1265        pub name: String,
1266        /// User identifier of an administrator created the link
1267        pub creator_user_id: i64,
1268        /// Point in time (Unix timestamp) when the link was created
1269        pub date: i32,
1270        /// Point in time (Unix timestamp) when the link was last edited; 0 if never or unknown
1271        pub edit_date: i32,
1272        /// Point in time (Unix timestamp) when the link will expire; 0 if never
1273        pub expiration_date: i32,
1274        /// The maximum number of members, which can join the chat using the link simultaneously; 0 if not limited. Always 0 if the link requires approval
1275        pub member_limit: i32,
1276        /// Number of chat members, which joined the chat using the link
1277        pub member_count: i32,
1278        /// Number of pending join requests created using this link
1279        pub pending_join_request_count: i32,
1280        /// True, if the link only creates join request. If true, total number of joining members will be unlimited
1281        pub creates_join_request: bool,
1282        /// True, if the link is primary. Primary invite link can't have name, expiration date, or usage limit. There is exactly one primary invite link for each administrator with can_invite_users right at a given time
1283        pub is_primary: bool,
1284        /// True, if the link was revoked
1285        pub is_revoked: bool,
1286    }
1287    /// Contains a list of chat invite links
1288    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
1289    pub struct ChatInviteLinks {
1290        /// Approximate total number of chat invite links found
1291        pub total_count: i32,
1292        /// List of invite links
1293        pub invite_links: Vec<crate::types::ChatInviteLink>,
1294    }
1295    /// Describes a chat administrator with a number of active and revoked chat invite links
1296    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
1297    pub struct ChatInviteLinkCount {
1298        /// Administrator's user identifier
1299        pub user_id: i64,
1300        /// Number of active invite links
1301        pub invite_link_count: i32,
1302        /// Number of revoked invite links
1303        pub revoked_invite_link_count: i32,
1304    }
1305    /// Contains a list of chat invite link counts
1306    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
1307    pub struct ChatInviteLinkCounts {
1308        /// List of invite link counts
1309        pub invite_link_counts: Vec<crate::types::ChatInviteLinkCount>,
1310    }
1311    /// Describes a chat member joined a chat via an invite link
1312    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
1313    pub struct ChatInviteLinkMember {
1314        /// User identifier
1315        pub user_id: i64,
1316        /// Point in time (Unix timestamp) when the user joined the chat
1317        pub joined_chat_date: i32,
1318        /// True, if the user has joined the chat using an invite link for a chat folder
1319        pub via_chat_folder_invite_link: bool,
1320        /// User identifier of the chat administrator, approved user join request
1321        pub approver_user_id: i64,
1322    }
1323    /// Contains a list of chat members joined a chat via an invite link
1324    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
1325    pub struct ChatInviteLinkMembers {
1326        /// Approximate total number of chat members found
1327        pub total_count: i32,
1328        /// List of chat members, joined a chat via an invite link
1329        pub members: Vec<crate::types::ChatInviteLinkMember>,
1330    }
1331    /// Contains information about a chat invite link
1332    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
1333    pub struct ChatInviteLinkInfo {
1334        /// Chat identifier of the invite link; 0 if the user has no access to the chat before joining
1335        pub chat_id: i64,
1336        /// If non-zero, the amount of time for which read access to the chat will remain available, in seconds
1337        pub accessible_for: i32,
1338        /// Type of the chat
1339        pub r#type: crate::enums::InviteLinkChatType,
1340        /// Title of the chat
1341        pub title: String,
1342        /// Chat photo; may be null
1343        pub photo: Option<crate::types::ChatPhotoInfo>,
1344        /// Chat description
1345        pub description: String,
1346        /// Number of members in the chat
1347        pub member_count: i32,
1348        /// User identifiers of some chat members that may be known to the current user
1349        pub member_user_ids: Vec<i64>,
1350        /// True, if the link only creates join request
1351        pub creates_join_request: bool,
1352        /// True, if the chat is a public supergroup or channel, i.e. it has a username or it is a location-based supergroup
1353        pub is_public: bool,
1354        /// True, if the chat is verified
1355        pub is_verified: bool,
1356        /// True, if many users reported this chat as a scam
1357        pub is_scam: bool,
1358        /// True, if many users reported this chat as a fake account
1359        pub is_fake: bool,
1360    }
1361    /// Describes a user that sent a join request and waits for administrator approval
1362    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
1363    pub struct ChatJoinRequest {
1364        /// User identifier
1365        pub user_id: i64,
1366        /// Point in time (Unix timestamp) when the user sent the join request
1367        pub date: i32,
1368        /// A short bio of the user
1369        pub bio: String,
1370    }
1371    /// Contains a list of requests to join a chat
1372    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
1373    pub struct ChatJoinRequests {
1374        /// Approximate total number of requests found
1375        pub total_count: i32,
1376        /// List of the requests
1377        pub requests: Vec<crate::types::ChatJoinRequest>,
1378    }
1379    /// Contains information about pending join requests for a chat
1380    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
1381    pub struct ChatJoinRequestsInfo {
1382        /// Total number of pending join requests
1383        pub total_count: i32,
1384        /// Identifiers of at most 3 users sent the newest pending join requests
1385        pub user_ids: Vec<i64>,
1386    }
1387    /// Represents a basic group of 0-200 users (must be upgraded to a supergroup to accommodate more than 200 users)
1388    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
1389    pub struct BasicGroup {
1390        /// Group identifier
1391        pub id: i64,
1392        /// Number of members in the group
1393        pub member_count: i32,
1394        /// Status of the current user in the group
1395        pub status: crate::enums::ChatMemberStatus,
1396        /// True, if the group is active
1397        pub is_active: bool,
1398        /// Identifier of the supergroup to which this group was upgraded; 0 if none
1399        pub upgraded_to_supergroup_id: i64,
1400    }
1401    /// Contains full information about a basic group
1402    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
1403    pub struct BasicGroupFullInfo {
1404        /// Chat photo; may be null if empty or unknown. If non-null, then it is the same photo as in chat.photo
1405        pub photo: Option<crate::types::ChatPhoto>,
1406        /// Group description. Updated only after the basic group is opened
1407        pub description: String,
1408        /// User identifier of the creator of the group; 0 if unknown
1409        pub creator_user_id: i64,
1410        /// Group members
1411        pub members: Vec<crate::types::ChatMember>,
1412        /// True, if non-administrators and non-bots can be hidden in responses to getSupergroupMembers and searchChatMembers for non-administrators after upgrading the basic group to a supergroup
1413        pub can_hide_members: bool,
1414        /// True, if aggressive anti-spam checks can be enabled or disabled in the supergroup after upgrading the basic group to a supergroup
1415        pub can_toggle_aggressive_anti_spam: bool,
1416        /// Primary invite link for this group; may be null. For chat administrators with can_invite_users right only. Updated only after the basic group is opened
1417        pub invite_link: Option<crate::types::ChatInviteLink>,
1418        /// List of commands of bots in the group
1419        pub bot_commands: Vec<crate::types::BotCommands>,
1420    }
1421    /// Represents a supergroup or channel with zero or more members (subscribers in the case of channels). From the point of view of the system, a channel is a special kind of a supergroup:
1422    /// only administrators can post and see the list of members, and posts from all administrators use the name and photo of the channel instead of individual names and profile photos.
1423    /// Unlike supergroups, channels can have an unlimited number of subscribers
1424    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
1425    pub struct Supergroup {
1426        /// Supergroup or channel identifier
1427        pub id: i64,
1428        /// Usernames of the supergroup or channel; may be null
1429        pub usernames: Option<crate::types::Usernames>,
1430        /// Point in time (Unix timestamp) when the current user joined, or the point in time when the supergroup or channel was created, in case the user is not a member
1431        pub date: i32,
1432        /// Status of the current user in the supergroup or channel; custom title will always be empty
1433        pub status: crate::enums::ChatMemberStatus,
1434        /// Number of members in the supergroup or channel; 0 if unknown. Currently, it is guaranteed to be known only if the supergroup or channel was received
1435        /// through searchPublicChats, searchChatsNearby, getInactiveSupergroupChats, getSuitableDiscussionChats, getGroupsInCommon, getUserPrivacySettingRules, or in chatFolderInviteLinkInfo.missing_chat_ids
1436        pub member_count: i32,
1437        /// True, if the channel has a discussion group, or the supergroup is the designated discussion group for a channel
1438        pub has_linked_chat: bool,
1439        /// True, if the supergroup is connected to a location, i.e. the supergroup is a location-based supergroup
1440        pub has_location: bool,
1441        /// True, if messages sent to the channel need to contain information about the sender. This field is only applicable to channels
1442        pub sign_messages: bool,
1443        /// True, if users need to join the supergroup before they can send messages. Always true for channels and non-discussion supergroups
1444        pub join_to_send_messages: bool,
1445        /// True, if all users directly joining the supergroup need to be approved by supergroup administrators. Always false for channels and supergroups without username, location, or a linked chat
1446        pub join_by_request: bool,
1447        /// True, if the slow mode is enabled in the supergroup
1448        pub is_slow_mode_enabled: bool,
1449        /// True, if the supergroup is a channel
1450        pub is_channel: bool,
1451        /// True, if the supergroup is a broadcast group, i.e. only administrators can send messages and there is no limit on the number of members
1452        pub is_broadcast_group: bool,
1453        /// True, if the supergroup must be shown as a forum by default
1454        pub is_forum: bool,
1455        /// True, if the supergroup or channel is verified
1456        pub is_verified: bool,
1457        /// If non-empty, contains a human-readable description of the reason why access to this supergroup or channel must be restricted
1458        pub restriction_reason: String,
1459        /// True, if many users reported this supergroup or channel as a scam
1460        pub is_scam: bool,
1461        /// True, if many users reported this supergroup or channel as a fake account
1462        pub is_fake: bool,
1463        /// True, if the channel has non-expired stories available to the current user
1464        pub has_active_stories: bool,
1465        /// True, if the channel has unread non-expired stories available to the current user
1466        pub has_unread_active_stories: bool,
1467    }
1468    /// Contains full information about a supergroup or channel
1469    #[serde_as]
1470    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
1471    pub struct SupergroupFullInfo {
1472        /// Chat photo; may be null if empty or unknown. If non-null, then it is the same photo as in chat.photo
1473        pub photo: Option<crate::types::ChatPhoto>,
1474        /// Supergroup or channel description
1475        pub description: String,
1476        /// Number of members in the supergroup or channel; 0 if unknown
1477        pub member_count: i32,
1478        /// Number of privileged users in the supergroup or channel; 0 if unknown
1479        pub administrator_count: i32,
1480        /// Number of restricted users in the supergroup; 0 if unknown
1481        pub restricted_count: i32,
1482        /// Number of users banned from chat; 0 if unknown
1483        pub banned_count: i32,
1484        /// Chat identifier of a discussion group for the channel, or a channel, for which the supergroup is the designated discussion group; 0 if none or unknown
1485        pub linked_chat_id: i64,
1486        /// Delay between consecutive sent messages for non-administrator supergroup members, in seconds
1487        pub slow_mode_delay: i32,
1488        /// Time left before next message can be sent in the supergroup, in seconds. An updateSupergroupFullInfo update is not triggered when value of this field changes, but both new and old values are non-zero
1489        pub slow_mode_delay_expires_in: f64,
1490        /// True, if members of the chat can be retrieved via getSupergroupMembers or searchChatMembers
1491        pub can_get_members: bool,
1492        /// True, if non-administrators can receive only administrators and bots using getSupergroupMembers or searchChatMembers
1493        pub has_hidden_members: bool,
1494        /// True, if non-administrators and non-bots can be hidden in responses to getSupergroupMembers and searchChatMembers for non-administrators
1495        pub can_hide_members: bool,
1496        /// True, if the supergroup sticker set can be changed
1497        pub can_set_sticker_set: bool,
1498        /// True, if the supergroup location can be changed
1499        pub can_set_location: bool,
1500        /// True, if the supergroup or channel statistics are available
1501        pub can_get_statistics: bool,
1502        /// True, if aggressive anti-spam checks can be enabled or disabled in the supergroup
1503        pub can_toggle_aggressive_anti_spam: bool,
1504        /// True, if new chat members will have access to old messages. In public, discussion, of forum groups and all channels, old messages are always available,
1505        /// so this option affects only private non-forum supergroups without a linked chat. The value of this field is only available to chat administrators
1506        pub is_all_history_available: bool,
1507        /// True, if aggressive anti-spam checks are enabled in the supergroup. The value of this field is only available to chat administrators
1508        pub has_aggressive_anti_spam_enabled: bool,
1509        /// True, if the channel has pinned stories
1510        pub has_pinned_stories: bool,
1511        /// Identifier of the supergroup sticker set; 0 if none
1512        #[serde_as(as = "DisplayFromStr")]
1513        pub sticker_set_id: i64,
1514        /// Location to which the supergroup is connected; may be null if none
1515        pub location: Option<crate::types::ChatLocation>,
1516        /// Primary invite link for the chat; may be null. For chat administrators with can_invite_users right only
1517        pub invite_link: Option<crate::types::ChatInviteLink>,
1518        /// List of commands of bots in the group
1519        pub bot_commands: Vec<crate::types::BotCommands>,
1520        /// Identifier of the basic group from which supergroup was upgraded; 0 if none
1521        pub upgraded_from_basic_group_id: i64,
1522        /// Identifier of the last message in the basic group from which supergroup was upgraded; 0 if none
1523        pub upgraded_from_max_message_id: i64,
1524    }
1525    /// Represents a secret chat
1526    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
1527    pub struct SecretChat {
1528        /// Secret chat identifier
1529        pub id: i32,
1530        /// Identifier of the chat partner
1531        pub user_id: i64,
1532        /// State of the secret chat
1533        pub state: crate::enums::SecretChatState,
1534        /// True, if the chat was created by the current user; false otherwise
1535        pub is_outbound: bool,
1536        /// Hash of the currently used key for comparison with the hash of the chat partner's key. This is a string of 36 little-endian bytes, which must be split into groups of 2 bits, each denoting a pixel of one of 4 colors FFFFFF, D5E6F3, 2D5775, and 2F99C9.
1537        /// The pixels must be used to make a 12x12 square image filled from left to right, top to bottom. Alternatively, the first 32 bytes of the hash can be converted to the hexadecimal format and printed as 32 2-digit hex numbers
1538        pub key_hash: String,
1539        /// Secret chat layer; determines features supported by the chat partner's application. Nested text entities and underline and strikethrough entities are supported if the layer >= 101,
1540        /// files bigger than 2000MB are supported if the layer >= 143, spoiler and custom emoji text entities are supported if the layer >= 144
1541        pub layer: i32,
1542    }
1543    /// The message was sent by a known user
1544    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
1545    pub struct MessageSenderUser {
1546        /// Identifier of the user that sent the message
1547        pub user_id: i64,
1548    }
1549    /// The message was sent on behalf of a chat
1550    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
1551    pub struct MessageSenderChat {
1552        /// Identifier of the chat that sent the message
1553        pub chat_id: i64,
1554    }
1555    /// Represents a list of message senders
1556    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
1557    pub struct MessageSenders {
1558        /// Approximate total number of messages senders found
1559        pub total_count: i32,
1560        /// List of message senders
1561        pub senders: Vec<crate::enums::MessageSender>,
1562    }
1563    /// Represents a message sender, which can be used to send messages in a chat
1564    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
1565    pub struct ChatMessageSender {
1566        /// Available message senders
1567        pub sender: crate::enums::MessageSender,
1568        /// True, if Telegram Premium is needed to use the message sender
1569        pub needs_premium: bool,
1570    }
1571    /// Represents a list of message senders, which can be used to send messages in a chat
1572    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
1573    pub struct ChatMessageSenders {
1574        /// List of available message senders
1575        pub senders: Vec<crate::types::ChatMessageSender>,
1576    }
1577    /// Represents a viewer of a message
1578    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
1579    pub struct MessageViewer {
1580        /// User identifier of the viewer
1581        pub user_id: i64,
1582        /// Approximate point in time (Unix timestamp) when the message was viewed
1583        pub view_date: i32,
1584    }
1585    /// Represents a list of message viewers
1586    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
1587    pub struct MessageViewers {
1588        /// List of message viewers
1589        pub viewers: Vec<crate::types::MessageViewer>,
1590    }
1591    /// The message was originally sent by a known user
1592    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
1593    pub struct MessageForwardOriginUser {
1594        /// Identifier of the user that originally sent the message
1595        pub sender_user_id: i64,
1596    }
1597    /// The message was originally sent on behalf of a chat
1598    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
1599    pub struct MessageForwardOriginChat {
1600        /// Identifier of the chat that originally sent the message
1601        pub sender_chat_id: i64,
1602        /// For messages originally sent by an anonymous chat administrator, original message author signature
1603        pub author_signature: String,
1604    }
1605    /// The message was originally sent by a user, which is hidden by their privacy settings
1606    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
1607    pub struct MessageForwardOriginHiddenUser {
1608        /// Name of the sender
1609        pub sender_name: String,
1610    }
1611    /// The message was originally a post in a channel
1612    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
1613    pub struct MessageForwardOriginChannel {
1614        /// Identifier of the chat from which the message was originally forwarded
1615        pub chat_id: i64,
1616        /// Message identifier of the original message
1617        pub message_id: i64,
1618        /// Original post author signature
1619        pub author_signature: String,
1620    }
1621    /// The message was imported from an exported message history
1622    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
1623    pub struct MessageForwardOriginMessageImport {
1624        /// Name of the sender
1625        pub sender_name: String,
1626    }
1627    /// A reaction with an emoji
1628    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
1629    pub struct ReactionTypeEmoji {
1630        /// Text representation of the reaction
1631        pub emoji: String,
1632    }
1633    /// A reaction with a custom emoji
1634    #[serde_as]
1635    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
1636    pub struct ReactionTypeCustomEmoji {
1637        /// Unique identifier of the custom emoji
1638        #[serde_as(as = "DisplayFromStr")]
1639        pub custom_emoji_id: i64,
1640    }
1641    /// Contains information about a forwarded message
1642    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
1643    pub struct MessageForwardInfo {
1644        /// Origin of a forwarded message
1645        pub origin: crate::enums::MessageForwardOrigin,
1646        /// Point in time (Unix timestamp) when the message was originally sent
1647        pub date: i32,
1648        /// The type of a public service announcement for the forwarded message
1649        pub public_service_announcement_type: String,
1650        /// For messages forwarded to the chat with the current user (Saved Messages), to the Replies bot chat, or to the channel's discussion group, the identifier of the chat from which the message was forwarded last time; 0 if unknown
1651        pub from_chat_id: i64,
1652        /// For messages forwarded to the chat with the current user (Saved Messages), to the Replies bot chat, or to the channel's discussion group, the identifier of the original message from which the new message was forwarded last time; 0 if unknown
1653        pub from_message_id: i64,
1654    }
1655    /// Contains information about replies to a message
1656    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
1657    pub struct MessageReplyInfo {
1658        /// Number of times the message was directly or indirectly replied
1659        pub reply_count: i32,
1660        /// Identifiers of at most 3 recent repliers to the message; available in channels with a discussion supergroup. The users and chats are expected to be inaccessible: only their photo and name will be available
1661        pub recent_replier_ids: Vec<crate::enums::MessageSender>,
1662        /// Identifier of the last read incoming reply to the message
1663        pub last_read_inbox_message_id: i64,
1664        /// Identifier of the last read outgoing reply to the message
1665        pub last_read_outbox_message_id: i64,
1666        /// Identifier of the last reply to the message
1667        pub last_message_id: i64,
1668    }
1669    /// Contains information about a reaction to a message
1670    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
1671    pub struct MessageReaction {
1672        /// Type of the reaction
1673        pub r#type: crate::enums::ReactionType,
1674        /// Number of times the reaction was added
1675        pub total_count: i32,
1676        /// True, if the reaction is chosen by the current user
1677        pub is_chosen: bool,
1678        /// Identifiers of at most 3 recent message senders, added the reaction; available in private, basic group and supergroup chats
1679        pub recent_sender_ids: Vec<crate::enums::MessageSender>,
1680    }
1681    /// Contains information about interactions with a message
1682    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
1683    pub struct MessageInteractionInfo {
1684        /// Number of times the message was viewed
1685        pub view_count: i32,
1686        /// Number of times the message was forwarded
1687        pub forward_count: i32,
1688        /// Information about direct or indirect replies to the message; may be null. Currently, available only in channels with a discussion supergroup and discussion supergroups for messages, which are not replies itself
1689        pub reply_info: Option<crate::types::MessageReplyInfo>,
1690        /// The list of reactions added to the message
1691        pub reactions: Vec<crate::types::MessageReaction>,
1692    }
1693    /// Contains information about an unread reaction to a message
1694    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
1695    pub struct UnreadReaction {
1696        /// Type of the reaction
1697        pub r#type: crate::enums::ReactionType,
1698        /// Identifier of the sender, added the reaction
1699        pub sender_id: crate::enums::MessageSender,
1700        /// True, if the reaction was added with a big animation
1701        pub is_big: bool,
1702    }
1703    /// The message is being sent now, but has not yet been delivered to the server
1704    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
1705    pub struct MessageSendingStatePending {
1706        /// Non-persistent message sending identifier, specified by the application
1707        pub sending_id: i32,
1708    }
1709    /// The message failed to be sent
1710    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
1711    pub struct MessageSendingStateFailed {
1712        /// The cause of the message sending failure
1713        pub error: crate::types::Error,
1714        /// True, if the message can be re-sent
1715        pub can_retry: bool,
1716        /// True, if the message can be re-sent only on behalf of a different sender
1717        pub need_another_sender: bool,
1718        /// Time left before the message can be re-sent, in seconds. No update is sent when this field changes
1719        pub retry_after: f64,
1720    }
1721    /// Describes a replied message
1722    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
1723    pub struct MessageReplyToMessage {
1724        /// The identifier of the chat to which the replied message belongs; ignored for outgoing replies. For example, messages in the Replies chat are replies to messages in different chats
1725        pub chat_id: i64,
1726        /// The identifier of the replied message
1727        pub message_id: i64,
1728    }
1729    /// Describes a replied story
1730    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
1731    pub struct MessageReplyToStory {
1732        /// The identifier of the sender of the replied story. Currently, stories can be replied only in the sender's chat
1733        pub story_sender_chat_id: i64,
1734        /// The identifier of the replied story
1735        pub story_id: i32,
1736    }
1737    /// Describes a message
1738    #[serde_as]
1739    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
1740    pub struct Message {
1741        /// Message identifier; unique for the chat to which the message belongs
1742        pub id: i64,
1743        /// Identifier of the sender of the message
1744        pub sender_id: crate::enums::MessageSender,
1745        /// Chat identifier
1746        pub chat_id: i64,
1747        /// The sending state of the message; may be null if the message isn't being sent and didn't fail to be sent
1748        pub sending_state: Option<crate::enums::MessageSendingState>,
1749        /// The scheduling state of the message; may be null if the message isn't scheduled
1750        pub scheduling_state: Option<crate::enums::MessageSchedulingState>,
1751        /// True, if the message is outgoing
1752        pub is_outgoing: bool,
1753        /// True, if the message is pinned
1754        pub is_pinned: bool,
1755        /// True, if the message can be edited. For live location and poll messages this fields shows whether editMessageLiveLocation or stopPoll can be used with this message by the application
1756        pub can_be_edited: bool,
1757        /// True, if the message can be forwarded
1758        pub can_be_forwarded: bool,
1759        /// True, if content of the message can be saved locally or copied
1760        pub can_be_saved: bool,
1761        /// True, if the message can be deleted only for the current user while other users will continue to see it
1762        pub can_be_deleted_only_for_self: bool,
1763        /// True, if the message can be deleted for all users
1764        pub can_be_deleted_for_all_users: bool,
1765        /// True, if the list of added reactions is available through getMessageAddedReactions
1766        pub can_get_added_reactions: bool,
1767        /// True, if the message statistics are available through getMessageStatistics
1768        pub can_get_statistics: bool,
1769        /// True, if information about the message thread is available through getMessageThread and getMessageThreadHistory
1770        pub can_get_message_thread: bool,
1771        /// True, if chat members already viewed the message can be received through getMessageViewers
1772        pub can_get_viewers: bool,
1773        /// True, if media timestamp links can be generated for media timestamp entities in the message text, caption or web page description through getMessageLink
1774        pub can_get_media_timestamp_links: bool,
1775        /// True, if reactions on the message can be reported through reportMessageReactions
1776        pub can_report_reactions: bool,
1777        /// True, if media timestamp entities refers to a media in this message as opposed to a media in the replied message
1778        pub has_timestamped_media: bool,
1779        /// True, if the message is a channel post. All messages to channels are channel posts, all other messages are not channel posts
1780        pub is_channel_post: bool,
1781        /// True, if the message is a forum topic message
1782        pub is_topic_message: bool,
1783        /// True, if the message contains an unread mention for the current user
1784        pub contains_unread_mention: bool,
1785        /// Point in time (Unix timestamp) when the message was sent
1786        pub date: i32,
1787        /// Point in time (Unix timestamp) when the message was last edited
1788        pub edit_date: i32,
1789        /// Information about the initial message sender; may be null if none or unknown
1790        pub forward_info: Option<crate::types::MessageForwardInfo>,
1791        /// Information about interactions with the message; may be null if none
1792        pub interaction_info: Option<crate::types::MessageInteractionInfo>,
1793        /// Information about unread reactions added to the message
1794        pub unread_reactions: Vec<crate::types::UnreadReaction>,
1795        /// Information about the message or the story this message is replying to; may be null if none
1796        pub reply_to: Option<crate::enums::MessageReplyTo>,
1797        /// If non-zero, the identifier of the message thread the message belongs to; unique within the chat to which the message belongs
1798        pub message_thread_id: i64,
1799        /// The message's self-destruct type; may be null if none
1800        pub self_destruct_type: Option<crate::enums::MessageSelfDestructType>,
1801        /// Time left before the message self-destruct timer expires, in seconds; 0 if self-desctruction isn't scheduled yet
1802        pub self_destruct_in: f64,
1803        /// Time left before the message will be automatically deleted by message_auto_delete_time setting of the chat, in seconds; 0 if never
1804        pub auto_delete_in: f64,
1805        /// If non-zero, the user identifier of the bot through which this message was sent
1806        pub via_bot_user_id: i64,
1807        /// For channel posts and anonymous group messages, optional author signature
1808        pub author_signature: String,
1809        /// Unique identifier of an album this message belongs to. Only audios, documents, photos and videos can be grouped together in albums
1810        #[serde_as(as = "DisplayFromStr")]
1811        pub media_album_id: i64,
1812        /// If non-empty, contains a human-readable description of the reason why access to this message must be restricted
1813        pub restriction_reason: String,
1814        /// Content of the message
1815        pub content: crate::enums::MessageContent,
1816        /// Reply markup for the message; may be null if none
1817        pub reply_markup: Option<crate::enums::ReplyMarkup>,
1818    }
1819    /// Contains a list of messages
1820    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
1821    pub struct Messages {
1822        /// Approximate total number of messages found
1823        pub total_count: i32,
1824        /// List of messages; messages may be null
1825        pub messages: Vec<Option<crate::types::Message>>,
1826    }
1827    /// Contains a list of messages found by a search
1828    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
1829    pub struct FoundMessages {
1830        /// Approximate total number of messages found; -1 if unknown
1831        pub total_count: i32,
1832        /// List of messages
1833        pub messages: Vec<crate::types::Message>,
1834        /// The offset for the next request. If empty, there are no more results
1835        pub next_offset: String,
1836    }
1837    /// Contains a list of messages found by a search in a given chat
1838    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
1839    pub struct FoundChatMessages {
1840        /// Approximate total number of messages found; -1 if unknown
1841        pub total_count: i32,
1842        /// List of messages
1843        pub messages: Vec<crate::types::Message>,
1844        /// The offset for the next request. If 0, there are no more results
1845        pub next_from_message_id: i64,
1846    }
1847    /// Contains information about a message in a specific position
1848    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
1849    pub struct MessagePosition {
1850        /// 0-based message position in the full list of suitable messages
1851        pub position: i32,
1852        /// Message identifier
1853        pub message_id: i64,
1854        /// Point in time (Unix timestamp) when the message was sent
1855        pub date: i32,
1856    }
1857    /// Contains a list of message positions
1858    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
1859    pub struct MessagePositions {
1860        /// Total number of messages found
1861        pub total_count: i32,
1862        /// List of message positions
1863        pub positions: Vec<crate::types::MessagePosition>,
1864    }
1865    /// Contains information about found messages sent on a specific day
1866    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
1867    pub struct MessageCalendarDay {
1868        /// Total number of found messages sent on the day
1869        pub total_count: i32,
1870        /// First message sent on the day
1871        pub message: crate::types::Message,
1872    }
1873    /// Contains information about found messages, split by days according to the option "utc_time_offset"
1874    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
1875    pub struct MessageCalendar {
1876        /// Total number of found messages
1877        pub total_count: i32,
1878        /// Information about messages sent
1879        pub days: Vec<crate::types::MessageCalendarDay>,
1880    }
1881    /// The sponsor is a bot
1882    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
1883    pub struct MessageSponsorTypeBot {
1884        /// User identifier of the bot
1885        pub bot_user_id: i64,
1886        /// An internal link to be opened when the sponsored message is clicked
1887        pub link: crate::enums::InternalLinkType,
1888    }
1889    /// The sponsor is a public channel chat
1890    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
1891    pub struct MessageSponsorTypePublicChannel {
1892        /// Sponsor chat identifier
1893        pub chat_id: i64,
1894        /// An internal link to be opened when the sponsored message is clicked; may be null if the sponsor chat needs to be opened instead
1895        pub link: Option<crate::enums::InternalLinkType>,
1896    }
1897    /// The sponsor is a private channel chat
1898    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
1899    pub struct MessageSponsorTypePrivateChannel {
1900        /// Title of the chat
1901        pub title: String,
1902        /// Invite link for the channel
1903        pub invite_link: String,
1904    }
1905    /// The sponsor is a website
1906    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
1907    pub struct MessageSponsorTypeWebsite {
1908        /// URL of the website
1909        pub url: String,
1910        /// Name of the website
1911        pub name: String,
1912    }
1913    /// Information about the sponsor of a message
1914    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
1915    pub struct MessageSponsor {
1916        /// Type of the sponsor
1917        pub r#type: crate::enums::MessageSponsorType,
1918        /// Photo of the sponsor; may be null if must not be shown
1919        pub photo: Option<crate::types::ChatPhotoInfo>,
1920        /// Additional optional information about the sponsor to be shown along with the message
1921        pub info: String,
1922    }
1923    /// Describes a sponsored message
1924    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
1925    pub struct SponsoredMessage {
1926        /// Message identifier; unique for the chat to which the sponsored message belongs among both ordinary and sponsored messages
1927        pub message_id: i64,
1928        /// True, if the message needs to be labeled as "recommended" instead of "sponsored"
1929        pub is_recommended: bool,
1930        /// Content of the message. Currently, can be only of the type messageText
1931        pub content: crate::enums::MessageContent,
1932        /// Information about the sponsor of the message
1933        pub sponsor: crate::types::MessageSponsor,
1934        /// If non-empty, additional information about the sponsored message to be shown along with the message
1935        pub additional_info: String,
1936    }
1937    /// Contains a list of sponsored messages
1938    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
1939    pub struct SponsoredMessages {
1940        /// List of sponsored messages
1941        pub messages: Vec<crate::types::SponsoredMessage>,
1942        /// The minimum number of messages between shown sponsored messages, or 0 if only one sponsored message must be shown after all ordinary messages
1943        pub messages_between: i32,
1944    }
1945    /// Describes a file added to file download list
1946    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
1947    pub struct FileDownload {
1948        /// File identifier
1949        pub file_id: i32,
1950        /// The message with the file
1951        pub message: crate::types::Message,
1952        /// Point in time (Unix timestamp) when the file was added to the download list
1953        pub add_date: i32,
1954        /// Point in time (Unix timestamp) when the file downloading was completed; 0 if the file downloading isn't completed
1955        pub complete_date: i32,
1956        /// True, if downloading of the file is paused
1957        pub is_paused: bool,
1958    }
1959    /// Contains number of being downloaded and recently downloaded files found
1960    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
1961    pub struct DownloadedFileCounts {
1962        /// Number of active file downloads found, including paused
1963        pub active_count: i32,
1964        /// Number of paused file downloads found
1965        pub paused_count: i32,
1966        /// Number of completed file downloads found
1967        pub completed_count: i32,
1968    }
1969    /// Contains a list of downloaded files, found by a search
1970    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
1971    pub struct FoundFileDownloads {
1972        /// Total number of suitable files, ignoring offset
1973        pub total_counts: crate::types::DownloadedFileCounts,
1974        /// The list of files
1975        pub files: Vec<crate::types::FileDownload>,
1976        /// The offset for the next request. If empty, there are no more results
1977        pub next_offset: String,
1978    }
1979    /// Contains information about notification settings for a chat or a forum topic
1980    #[serde_as]
1981    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
1982    pub struct ChatNotificationSettings {
1983        /// If true, mute_for is ignored and the value for the relevant type of chat or the forum chat is used instead
1984        pub use_default_mute_for: bool,
1985        /// Time left before notifications will be unmuted, in seconds
1986        pub mute_for: i32,
1987        /// If true, the value for the relevant type of chat or the forum chat is used instead of sound_id
1988        pub use_default_sound: bool,
1989        /// Identifier of the notification sound to be played for messages; 0 if sound is disabled
1990        #[serde_as(as = "DisplayFromStr")]
1991        pub sound_id: i64,
1992        /// If true, show_preview is ignored and the value for the relevant type of chat or the forum chat is used instead
1993        pub use_default_show_preview: bool,
1994        /// True, if message content must be displayed in notifications
1995        pub show_preview: bool,
1996        /// If true, mute_stories is ignored and the value for the relevant type of chat is used instead
1997        pub use_default_mute_stories: bool,
1998        /// True, if story notifications are disabled for the chat
1999        pub mute_stories: bool,
2000        /// If true, the value for the relevant type of chat is used instead of story_sound_id
2001        pub use_default_story_sound: bool,
2002        /// Identifier of the notification sound to be played for stories; 0 if sound is disabled
2003        #[serde_as(as = "DisplayFromStr")]
2004        pub story_sound_id: i64,
2005        /// If true, show_story_sender is ignored and the value for the relevant type of chat is used instead
2006        pub use_default_show_story_sender: bool,
2007        /// True, if the sender of stories must be displayed in notifications
2008        pub show_story_sender: bool,
2009        /// If true, disable_pinned_message_notifications is ignored and the value for the relevant type of chat or the forum chat is used instead
2010        pub use_default_disable_pinned_message_notifications: bool,
2011        /// If true, notifications for incoming pinned messages will be created as for an ordinary unread message
2012        pub disable_pinned_message_notifications: bool,
2013        /// If true, disable_mention_notifications is ignored and the value for the relevant type of chat or the forum chat is used instead
2014        pub use_default_disable_mention_notifications: bool,
2015        /// If true, notifications for messages with mentions will be created as for an ordinary unread message
2016        pub disable_mention_notifications: bool,
2017    }
2018    /// Contains information about notification settings for several chats
2019    #[serde_as]
2020    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
2021    pub struct ScopeNotificationSettings {
2022        /// Time left before notifications will be unmuted, in seconds
2023        pub mute_for: i32,
2024        /// Identifier of the notification sound to be played; 0 if sound is disabled
2025        #[serde_as(as = "DisplayFromStr")]
2026        pub sound_id: i64,
2027        /// True, if message content must be displayed in notifications
2028        pub show_preview: bool,
2029        /// If true, mute_stories is ignored and story notifications are received only for the first 5 chats from topChatCategoryUsers
2030        pub use_default_mute_stories: bool,
2031        /// True, if story notifications are disabled for the chat
2032        pub mute_stories: bool,
2033        /// Identifier of the notification sound to be played for stories; 0 if sound is disabled
2034        #[serde_as(as = "DisplayFromStr")]
2035        pub story_sound_id: i64,
2036        /// True, if the sender of stories must be displayed in notifications
2037        pub show_story_sender: bool,
2038        /// True, if notifications for incoming pinned messages will be created as for an ordinary unread message
2039        pub disable_pinned_message_notifications: bool,
2040        /// True, if notifications for messages with mentions will be created as for an ordinary unread message
2041        pub disable_mention_notifications: bool,
2042    }
2043    /// Contains information about a message draft
2044    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
2045    pub struct DraftMessage {
2046        /// Identifier of the replied message; 0 if none
2047        pub reply_to_message_id: i64,
2048        /// Point in time (Unix timestamp) when the draft was created
2049        pub date: i32,
2050        /// Content of the message draft; must be of the type inputMessageText
2051        pub input_message_text: crate::enums::InputMessageContent,
2052    }
2053    /// An ordinary chat with a user
2054    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
2055    pub struct ChatTypePrivate {
2056        /// User identifier
2057        pub user_id: i64,
2058    }
2059    /// A basic group (a chat with 0-200 other users)
2060    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
2061    pub struct ChatTypeBasicGroup {
2062        /// Basic group identifier
2063        pub basic_group_id: i64,
2064    }
2065    /// A supergroup or channel (with unlimited members)
2066    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
2067    pub struct ChatTypeSupergroup {
2068        /// Supergroup or channel identifier
2069        pub supergroup_id: i64,
2070        /// True, if the supergroup is a channel
2071        pub is_channel: bool,
2072    }
2073    /// A secret chat with a user
2074    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
2075    pub struct ChatTypeSecret {
2076        /// Secret chat identifier
2077        pub secret_chat_id: i32,
2078        /// User identifier of the secret chat peer
2079        pub user_id: i64,
2080    }
2081    /// Represents an icon for a chat folder
2082    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
2083    pub struct ChatFolderIcon {
2084        /// The chosen icon name for short folder representation; one of "All", "Unread", "Unmuted", "Bots", "Channels", "Groups", "Private", "Custom", "Setup", "Cat", "Crown",
2085        /// "Favorite", "Flower", "Game", "Home", "Love", "Mask", "Party", "Sport", "Study", "Trade", "Travel", "Work", "Airplane", "Book", "Light", "Like", "Money", "Note", "Palette"
2086        pub name: String,
2087    }
2088    /// Represents a folder for user chats
2089    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
2090    pub struct ChatFolder {
2091        /// The title of the folder; 1-12 characters without line feeds
2092        pub title: String,
2093        /// The chosen icon for the chat folder; may be null. If null, use getChatFolderDefaultIconName to get default icon name for the folder
2094        pub icon: Option<crate::types::ChatFolderIcon>,
2095        /// True, if at least one link has been created for the folder
2096        pub is_shareable: bool,
2097        /// The chat identifiers of pinned chats in the folder. There can be up to getOption("chat_folder_chosen_chat_count_max") pinned and always included non-secret chats and the same number of secret chats, but the limit can be increased with Telegram Premium
2098        pub pinned_chat_ids: Vec<i64>,
2099        /// The chat identifiers of always included chats in the folder. There can be up to getOption("chat_folder_chosen_chat_count_max") pinned and always included non-secret chats and the same number of secret chats, but the limit can be increased with Telegram Premium
2100        pub included_chat_ids: Vec<i64>,
2101        /// The chat identifiers of always excluded chats in the folder. There can be up to getOption("chat_folder_chosen_chat_count_max") always excluded non-secret chats and the same number of secret chats, but the limit can be increased with Telegram Premium
2102        pub excluded_chat_ids: Vec<i64>,
2103        /// True, if muted chats need to be excluded
2104        pub exclude_muted: bool,
2105        /// True, if read chats need to be excluded
2106        pub exclude_read: bool,
2107        /// True, if archived chats need to be excluded
2108        pub exclude_archived: bool,
2109        /// True, if contacts need to be included
2110        pub include_contacts: bool,
2111        /// True, if non-contact users need to be included
2112        pub include_non_contacts: bool,
2113        /// True, if bots need to be included
2114        pub include_bots: bool,
2115        /// True, if basic groups and supergroups need to be included
2116        pub include_groups: bool,
2117        /// True, if channels need to be included
2118        pub include_channels: bool,
2119    }
2120    /// Contains basic information about a chat folder
2121    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
2122    pub struct ChatFolderInfo {
2123        /// Unique chat folder identifier
2124        pub id: i32,
2125        /// The title of the folder; 1-12 characters without line feeds
2126        pub title: String,
2127        /// The chosen or default icon for the chat folder
2128        pub icon: crate::types::ChatFolderIcon,
2129        /// True, if at least one link has been created for the folder
2130        pub is_shareable: bool,
2131        /// True, if the chat folder has invite links created by the current user
2132        pub has_my_invite_links: bool,
2133    }
2134    /// Contains a chat folder invite link
2135    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
2136    pub struct ChatFolderInviteLink {
2137        /// The chat folder invite link
2138        pub invite_link: String,
2139        /// Name of the link
2140        pub name: String,
2141        /// Identifiers of chats, included in the link
2142        pub chat_ids: Vec<i64>,
2143    }
2144    /// Represents a list of chat folder invite links
2145    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
2146    pub struct ChatFolderInviteLinks {
2147        /// List of the invite links
2148        pub invite_links: Vec<crate::types::ChatFolderInviteLink>,
2149    }
2150    /// Contains information about an invite link to a chat folder
2151    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
2152    pub struct ChatFolderInviteLinkInfo {
2153        /// Basic information about the chat folder; chat folder identifier will be 0 if the user didn't have the chat folder yet
2154        pub chat_folder_info: crate::types::ChatFolderInfo,
2155        /// Identifiers of the chats from the link, which aren't added to the folder yet
2156        pub missing_chat_ids: Vec<i64>,
2157        /// Identifiers of the chats from the link, which are added to the folder already
2158        pub added_chat_ids: Vec<i64>,
2159    }
2160    /// Describes a recommended chat folder
2161    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
2162    pub struct RecommendedChatFolder {
2163        /// The chat folder
2164        pub folder: crate::types::ChatFolder,
2165        /// Chat folder description
2166        pub description: String,
2167    }
2168    /// Contains a list of recommended chat folders
2169    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
2170    pub struct RecommendedChatFolders {
2171        /// List of recommended chat folders
2172        pub chat_folders: Vec<crate::types::RecommendedChatFolder>,
2173    }
2174    /// Contains settings for automatic moving of chats to and from the Archive chat lists
2175    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
2176    pub struct ArchiveChatListSettings {
2177        /// True, if new chats from non-contacts will be automatically archived and muted. Can be set to true only if the option "can_archive_and_mute_new_chats_from_unknown_users" is true
2178        pub archive_and_mute_new_chats_from_unknown_users: bool,
2179        /// True, if unmuted chats will be kept in the Archive chat list when they get a new message
2180        pub keep_unmuted_chats_archived: bool,
2181        /// True, if unmuted chats, that are always included or pinned in a folder, will be kept in the Archive chat list when they get a new message. Ignored if keep_unmuted_chats_archived == true
2182        pub keep_chats_from_folders_archived: bool,
2183    }
2184    /// A list of chats added to a chat folder
2185    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
2186    pub struct ChatListFolder {
2187        /// Chat folder identifier
2188        pub chat_folder_id: i32,
2189    }
2190    /// Contains a list of chat lists
2191    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
2192    pub struct ChatLists {
2193        /// List of chat lists
2194        pub chat_lists: Vec<crate::enums::ChatList>,
2195    }
2196    /// The chat contains a public service announcement
2197    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
2198    pub struct ChatSourcePublicServiceAnnouncement {
2199        /// The type of the announcement
2200        pub r#type: String,
2201        /// The text of the announcement
2202        pub text: String,
2203    }
2204    /// Describes a position of a chat in a chat list
2205    #[serde_as]
2206    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
2207    pub struct ChatPosition {
2208        /// The chat list
2209        pub list: crate::enums::ChatList,
2210        /// A parameter used to determine order of the chat in the chat list. Chats must be sorted by the pair (order, chat.id) in descending order
2211        #[serde_as(as = "DisplayFromStr")]
2212        pub order: i64,
2213        /// True, if the chat is pinned in the chat list
2214        pub is_pinned: bool,
2215        /// Source of the chat in the chat list; may be null
2216        pub source: Option<crate::enums::ChatSource>,
2217    }
2218    /// Only specific reactions are available in the chat
2219    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
2220    pub struct ChatAvailableReactionsSome {
2221        /// The list of reactions
2222        pub reactions: Vec<crate::enums::ReactionType>,
2223    }
2224    /// Describes a video chat
2225    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
2226    pub struct VideoChat {
2227        /// Group call identifier of an active video chat; 0 if none. Full information about the video chat can be received through the method getGroupCall
2228        pub group_call_id: i32,
2229        /// True, if the video chat has participants
2230        pub has_participants: bool,
2231        /// Default group call participant identifier to join the video chat; may be null
2232        pub default_participant_id: Option<crate::enums::MessageSender>,
2233    }
2234    /// A chat. (Can be a private chat, basic group, supergroup, or secret chat)
2235    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
2236    pub struct Chat {
2237        /// Chat unique identifier
2238        pub id: i64,
2239        /// Type of the chat
2240        pub r#type: crate::enums::ChatType,
2241        /// Chat title
2242        pub title: String,
2243        /// Chat photo; may be null
2244        pub photo: Option<crate::types::ChatPhotoInfo>,
2245        /// Actions that non-administrator chat members are allowed to take in the chat
2246        pub permissions: crate::types::ChatPermissions,
2247        /// Last message in the chat; may be null if none or unknown
2248        pub last_message: Option<crate::types::Message>,
2249        /// Positions of the chat in chat lists
2250        pub positions: Vec<crate::types::ChatPosition>,
2251        /// Identifier of a user or chat that is selected to send messages in the chat; may be null if the user can't change message sender
2252        pub message_sender_id: Option<crate::enums::MessageSender>,
2253        /// Block list to which the chat is added; may be null if none
2254        pub block_list: Option<crate::enums::BlockList>,
2255        /// True, if chat content can't be saved locally, forwarded, or copied
2256        pub has_protected_content: bool,
2257        /// True, if translation of all messages in the chat must be suggested to the user
2258        pub is_translatable: bool,
2259        /// True, if the chat is marked as unread
2260        pub is_marked_as_unread: bool,
2261        /// True, if the chat has scheduled messages
2262        pub has_scheduled_messages: bool,
2263        /// True, if the chat messages can be deleted only for the current user while other users will continue to see the messages
2264        pub can_be_deleted_only_for_self: bool,
2265        /// True, if the chat messages can be deleted for all users
2266        pub can_be_deleted_for_all_users: bool,
2267        /// True, if the chat can be reported to Telegram moderators through reportChat or reportChatPhoto
2268        pub can_be_reported: bool,
2269        /// Default value of the disable_notification parameter, used when a message is sent to the chat
2270        pub default_disable_notification: bool,
2271        /// Number of unread messages in the chat
2272        pub unread_count: i32,
2273        /// Identifier of the last read incoming message
2274        pub last_read_inbox_message_id: i64,
2275        /// Identifier of the last read outgoing message
2276        pub last_read_outbox_message_id: i64,
2277        /// Number of unread messages with a mention/reply in the chat
2278        pub unread_mention_count: i32,
2279        /// Number of messages with unread reactions in the chat
2280        pub unread_reaction_count: i32,
2281        /// Notification settings for the chat
2282        pub notification_settings: crate::types::ChatNotificationSettings,
2283        /// Types of reaction, available in the chat
2284        pub available_reactions: crate::enums::ChatAvailableReactions,
2285        /// Current message auto-delete or self-destruct timer setting for the chat, in seconds; 0 if disabled. Self-destruct timer in secret chats starts after the message or its content is viewed. Auto-delete timer in other chats starts from the send date
2286        pub message_auto_delete_time: i32,
2287        /// Background set for the chat; may be null if none
2288        pub background: Option<crate::types::ChatBackground>,
2289        /// If non-empty, name of a theme, set for the chat
2290        pub theme_name: String,
2291        /// Information about actions which must be possible to do through the chat action bar; may be null if none
2292        pub action_bar: Option<crate::enums::ChatActionBar>,
2293        /// Information about video chat of the chat
2294        pub video_chat: crate::types::VideoChat,
2295        /// Information about pending join requests; may be null if none
2296        pub pending_join_requests: Option<crate::types::ChatJoinRequestsInfo>,
2297        /// Identifier of the message from which reply markup needs to be used; 0 if there is no default custom reply markup in the chat
2298        pub reply_markup_message_id: i64,
2299        /// A draft of a message in the chat; may be null if none
2300        pub draft_message: Option<crate::types::DraftMessage>,
2301        /// Application-specific data associated with the chat. (For example, the chat scroll position or local chat notification settings can be stored here.) Persistent if the message database is used
2302        pub client_data: String,
2303    }
2304    /// Represents a list of chats
2305    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
2306    pub struct Chats {
2307        /// Approximate total number of chats found
2308        pub total_count: i32,
2309        /// List of chat identifiers
2310        pub chat_ids: Vec<i64>,
2311    }
2312    /// Describes a chat located nearby
2313    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
2314    pub struct ChatNearby {
2315        /// Chat identifier
2316        pub chat_id: i64,
2317        /// Distance to the chat location, in meters
2318        pub distance: i32,
2319    }
2320    /// Represents a list of chats located nearby
2321    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
2322    pub struct ChatsNearby {
2323        /// List of users nearby
2324        pub users_nearby: Vec<crate::types::ChatNearby>,
2325        /// List of location-based supergroups nearby
2326        pub supergroups_nearby: Vec<crate::types::ChatNearby>,
2327    }
2328    /// The chat can be reported as spam using the method reportChat with the reason reportReasonSpam. If the chat is a private chat with a user with an emoji status, then a notice about emoji status usage must be shown
2329    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
2330    pub struct ChatActionBarReportSpam {
2331        /// If true, the chat was automatically archived and can be moved back to the main chat list using addChatToList simultaneously with setting chat notification settings to default using setChatNotificationSettings
2332        pub can_unarchive: bool,
2333    }
2334    /// The chat is a private or secret chat, which can be reported using the method reportChat, or the other user can be blocked using the method setMessageSenderBlockList,
2335    /// or the other user can be added to the contact list using the method addContact. If the chat is a private chat with a user with an emoji status, then a notice about emoji status usage must be shown
2336    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
2337    pub struct ChatActionBarReportAddBlock {
2338        /// If true, the chat was automatically archived and can be moved back to the main chat list using addChatToList simultaneously with setting chat notification settings to default using setChatNotificationSettings
2339        pub can_unarchive: bool,
2340        /// If non-negative, the current user was found by the peer through searchChatsNearby and this is the distance between the users
2341        pub distance: i32,
2342    }
2343    /// The chat is a private chat with an administrator of a chat to which the user sent join request
2344    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
2345    pub struct ChatActionBarJoinRequest {
2346        /// Title of the chat to which the join request was sent
2347        pub title: String,
2348        /// True, if the join request was sent to a channel chat
2349        pub is_channel: bool,
2350        /// Point in time (Unix timestamp) when the join request was sent
2351        pub request_date: i32,
2352    }
2353    /// A button that allows the user to create and send a poll when pressed; available only in private chats
2354    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
2355    pub struct KeyboardButtonTypeRequestPoll {
2356        /// If true, only regular polls must be allowed to create
2357        pub force_regular: bool,
2358        /// If true, only polls in quiz mode must be allowed to create
2359        pub force_quiz: bool,
2360    }
2361    /// A button that requests a user to be shared by the current user; available only in private chats. Use the method shareUserWithBot to complete the request
2362    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
2363    pub struct KeyboardButtonTypeRequestUser {
2364        /// Unique button identifier
2365        pub id: i32,
2366        /// True, if the shared user must or must not be a bot
2367        pub restrict_user_is_bot: bool,
2368        /// True, if the shared user must be a bot; otherwise, the shared user must no be a bot. Ignored if restrict_user_is_bot is false
2369        pub user_is_bot: bool,
2370        /// True, if the shared user must or must not be a Telegram Premium user
2371        pub restrict_user_is_premium: bool,
2372        /// True, if the shared user must be a Telegram Premium user; otherwise, the shared user must no be a Telegram Premium user. Ignored if restrict_user_is_premium is false
2373        pub user_is_premium: bool,
2374    }
2375    /// A button that requests a chat to be shared by the current user; available only in private chats. Use the method shareChatWithBot to complete the request
2376    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
2377    pub struct KeyboardButtonTypeRequestChat {
2378        /// Unique button identifier
2379        pub id: i32,
2380        /// True, if the chat must be a channel; otherwise, a basic group or a supergroup chat is shared
2381        pub chat_is_channel: bool,
2382        /// True, if the chat must or must not be a forum supergroup
2383        pub restrict_chat_is_forum: bool,
2384        /// True, if the chat must be a forum supergroup; otherwise, the chat must not be a forum supergroup. Ignored if restrict_chat_is_forum is false
2385        pub chat_is_forum: bool,
2386        /// True, if the chat must or must not have a username
2387        pub restrict_chat_has_username: bool,
2388        /// True, if the chat must have a username; otherwise, the chat must not have a username. Ignored if restrict_chat_has_username is false
2389        pub chat_has_username: bool,
2390        /// True, if the chat must be created by the current user
2391        pub chat_is_created: bool,
2392        /// Expected user administrator rights in the chat; may be null if they aren't restricted
2393        pub user_administrator_rights: Option<crate::types::ChatAdministratorRights>,
2394        /// Expected bot administrator rights in the chat; may be null if they aren't restricted
2395        pub bot_administrator_rights: Option<crate::types::ChatAdministratorRights>,
2396        /// True, if the bot must be a member of the chat; for basic group and supergroup chats only
2397        pub bot_is_member: bool,
2398    }
2399    /// A button that opens a Web App by calling getWebAppUrl
2400    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
2401    pub struct KeyboardButtonTypeWebApp {
2402        /// An HTTP URL to pass to getWebAppUrl
2403        pub url: String,
2404    }
2405    /// Represents a single button in a bot keyboard
2406    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
2407    pub struct KeyboardButton {
2408        /// Text of the button
2409        pub text: String,
2410        /// Type of the button
2411        pub r#type: crate::enums::KeyboardButtonType,
2412    }
2413    /// A button that opens a specified URL
2414    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
2415    pub struct InlineKeyboardButtonTypeUrl {
2416        /// HTTP or tg: URL to open
2417        pub url: String,
2418    }
2419    /// A button that opens a specified URL and automatically authorize the current user by calling getLoginUrlInfo
2420    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
2421    pub struct InlineKeyboardButtonTypeLoginUrl {
2422        /// An HTTP URL to pass to getLoginUrlInfo
2423        pub url: String,
2424        /// Unique button identifier
2425        pub id: i64,
2426        /// If non-empty, new text of the button in forwarded messages
2427        pub forward_text: String,
2428    }
2429    /// A button that opens a Web App by calling openWebApp
2430    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
2431    pub struct InlineKeyboardButtonTypeWebApp {
2432        /// An HTTP URL to pass to openWebApp
2433        pub url: String,
2434    }
2435    /// A button that sends a callback query to a bot
2436    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
2437    pub struct InlineKeyboardButtonTypeCallback {
2438        /// Data to be sent to the bot via a callback query
2439        pub data: String,
2440    }
2441    /// A button that asks for the 2-step verification password of the current user and then sends a callback query to a bot
2442    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
2443    pub struct InlineKeyboardButtonTypeCallbackWithPassword {
2444        /// Data to be sent to the bot via a callback query
2445        pub data: String,
2446    }
2447    /// A button that forces an inline query to the bot to be inserted in the input field
2448    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
2449    pub struct InlineKeyboardButtonTypeSwitchInline {
2450        /// Inline query to be sent to the bot
2451        pub query: String,
2452        /// Target chat from which to send the inline query
2453        pub target_chat: crate::enums::TargetChat,
2454    }
2455    /// A button with a user reference to be handled in the same way as textEntityTypeMentionName entities
2456    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
2457    pub struct InlineKeyboardButtonTypeUser {
2458        /// User identifier
2459        pub user_id: i64,
2460    }
2461    /// Represents a single button in an inline keyboard
2462    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
2463    pub struct InlineKeyboardButton {
2464        /// Text of the button
2465        pub text: String,
2466        /// Type of the button
2467        pub r#type: crate::enums::InlineKeyboardButtonType,
2468    }
2469    /// Instructs application to remove the keyboard once this message has been received. This kind of keyboard can't be received in an incoming message; instead, updateChatReplyMarkup with message_id == 0 will be sent
2470    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
2471    pub struct ReplyMarkupRemoveKeyboard {
2472        /// True, if the keyboard is removed only for the mentioned users or the target user of a reply
2473        pub is_personal: bool,
2474    }
2475    /// Instructs application to force a reply to this message
2476    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
2477    pub struct ReplyMarkupForceReply {
2478        /// True, if a forced reply must automatically be shown to the current user. For outgoing messages, specify true to show the forced reply only for the mentioned users and for the target user of a reply
2479        pub is_personal: bool,
2480        /// If non-empty, the placeholder to be shown in the input field when the reply is active; 0-64 characters
2481        pub input_field_placeholder: String,
2482    }
2483    /// Contains a custom keyboard layout to quickly reply to bots
2484    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
2485    pub struct ReplyMarkupShowKeyboard {
2486        /// A list of rows of bot keyboard buttons
2487        pub rows: Vec<Vec<crate::types::KeyboardButton>>,
2488        /// True, if the keyboard is supposed to always be shown when the ordinary keyboard is hidden
2489        pub is_persistent: bool,
2490        /// True, if the application needs to resize the keyboard vertically
2491        pub resize_keyboard: bool,
2492        /// True, if the application needs to hide the keyboard after use
2493        pub one_time: bool,
2494        /// True, if the keyboard must automatically be shown to the current user. For outgoing messages, specify true to show the keyboard only for the mentioned users and for the target user of a reply
2495        pub is_personal: bool,
2496        /// If non-empty, the placeholder to be shown in the input field when the keyboard is active; 0-64 characters
2497        pub input_field_placeholder: String,
2498    }
2499    /// Contains an inline keyboard layout
2500    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
2501    pub struct ReplyMarkupInlineKeyboard {
2502        /// A list of rows of inline keyboard buttons
2503        pub rows: Vec<Vec<crate::types::InlineKeyboardButton>>,
2504    }
2505    /// An HTTP URL needs to be open
2506    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
2507    pub struct LoginUrlInfoOpen {
2508        /// The URL to open
2509        pub url: String,
2510        /// True, if there is no need to show an ordinary open URL confirmation
2511        pub skip_confirmation: bool,
2512    }
2513    /// An authorization confirmation dialog needs to be shown to the user
2514    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
2515    pub struct LoginUrlInfoRequestConfirmation {
2516        /// An HTTP URL to be opened
2517        pub url: String,
2518        /// A domain of the URL
2519        pub domain: String,
2520        /// User identifier of a bot linked with the website
2521        pub bot_user_id: i64,
2522        /// True, if the user must be asked for the permission to the bot to send them messages
2523        pub request_write_access: bool,
2524    }
2525    /// Contains information about a Web App found by its short name
2526    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
2527    pub struct FoundWebApp {
2528        /// The Web App
2529        pub web_app: crate::types::WebApp,
2530        /// True, if the app supports "settings_button_pressed" event
2531        pub supports_settings: bool,
2532        /// True, if the user must be asked for the permission to the bot to send them messages
2533        pub request_write_access: bool,
2534        /// True, if there is no need to show an ordinary open URL confirmation before opening the Web App. The field must be ignored and confirmation must be shown anyway if the Web App link was hidden
2535        pub skip_confirmation: bool,
2536    }
2537    /// Contains information about a Web App
2538    #[serde_as]
2539    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
2540    pub struct WebAppInfo {
2541        /// Unique identifier for the Web App launch
2542        #[serde_as(as = "DisplayFromStr")]
2543        pub launch_id: i64,
2544        /// A Web App URL to open in a web view
2545        pub url: String,
2546    }
2547    /// Contains information about a message thread
2548    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
2549    pub struct MessageThreadInfo {
2550        /// Identifier of the chat to which the message thread belongs
2551        pub chat_id: i64,
2552        /// Message thread identifier, unique within the chat
2553        pub message_thread_id: i64,
2554        /// Information about the message thread; may be null for forum topic threads
2555        pub reply_info: Option<crate::types::MessageReplyInfo>,
2556        /// Approximate number of unread messages in the message thread
2557        pub unread_message_count: i32,
2558        /// The messages from which the thread starts. The messages are returned in a reverse chronological order (i.e., in order of decreasing message_id)
2559        pub messages: Vec<crate::types::Message>,
2560        /// A draft of a message in the message thread; may be null if none
2561        pub draft_message: Option<crate::types::DraftMessage>,
2562    }
2563    /// Describes a forum topic icon
2564    #[serde_as]
2565    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
2566    pub struct ForumTopicIcon {
2567        /// Color of the topic icon in RGB format
2568        pub color: i32,
2569        /// Unique identifier of the custom emoji shown on the topic icon; 0 if none
2570        #[serde_as(as = "DisplayFromStr")]
2571        pub custom_emoji_id: i64,
2572    }
2573    /// Contains basic information about a forum topic
2574    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
2575    pub struct ForumTopicInfo {
2576        /// Message thread identifier of the topic
2577        pub message_thread_id: i64,
2578        /// Name of the topic
2579        pub name: String,
2580        /// Icon of the topic
2581        pub icon: crate::types::ForumTopicIcon,
2582        /// Point in time (Unix timestamp) when the topic was created
2583        pub creation_date: i32,
2584        /// Identifier of the creator of the topic
2585        pub creator_id: crate::enums::MessageSender,
2586        /// True, if the topic is the General topic list
2587        pub is_general: bool,
2588        /// True, if the topic was created by the current user
2589        pub is_outgoing: bool,
2590        /// True, if the topic is closed
2591        pub is_closed: bool,
2592        /// True, if the topic is hidden above the topic list and closed; for General topic only
2593        pub is_hidden: bool,
2594    }
2595    /// Describes a forum topic
2596    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
2597    pub struct ForumTopic {
2598        /// Basic information about the topic
2599        pub info: crate::types::ForumTopicInfo,
2600        /// Last message in the topic; may be null if unknown
2601        pub last_message: Option<crate::types::Message>,
2602        /// True, if the topic is pinned in the topic list
2603        pub is_pinned: bool,
2604        /// Number of unread messages in the topic
2605        pub unread_count: i32,
2606        /// Identifier of the last read incoming message
2607        pub last_read_inbox_message_id: i64,
2608        /// Identifier of the last read outgoing message
2609        pub last_read_outbox_message_id: i64,
2610        /// Number of unread messages with a mention/reply in the topic
2611        pub unread_mention_count: i32,
2612        /// Number of messages with unread reactions in the topic
2613        pub unread_reaction_count: i32,
2614        /// Notification settings for the topic
2615        pub notification_settings: crate::types::ChatNotificationSettings,
2616        /// A draft of a message in the topic; may be null if none
2617        pub draft_message: Option<crate::types::DraftMessage>,
2618    }
2619    /// Describes a list of forum topics
2620    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
2621    pub struct ForumTopics {
2622        /// Approximate total number of forum topics found
2623        pub total_count: i32,
2624        /// List of forum topics
2625        pub topics: Vec<crate::types::ForumTopic>,
2626        /// Offset date for the next getForumTopics request
2627        pub next_offset_date: i32,
2628        /// Offset message identifier for the next getForumTopics request
2629        pub next_offset_message_id: i64,
2630        /// Offset message thread identifier for the next getForumTopics request
2631        pub next_offset_message_thread_id: i64,
2632    }
2633    /// A plain text
2634    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
2635    pub struct RichTextPlain {
2636        /// Text
2637        pub text: String,
2638    }
2639    /// A bold rich text
2640    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
2641    pub struct RichTextBold {
2642        /// Text
2643        pub text: crate::enums::RichText,
2644    }
2645    /// An italicized rich text
2646    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
2647    pub struct RichTextItalic {
2648        /// Text
2649        pub text: crate::enums::RichText,
2650    }
2651    /// An underlined rich text
2652    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
2653    pub struct RichTextUnderline {
2654        /// Text
2655        pub text: crate::enums::RichText,
2656    }
2657    /// A strikethrough rich text
2658    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
2659    pub struct RichTextStrikethrough {
2660        /// Text
2661        pub text: crate::enums::RichText,
2662    }
2663    /// A fixed-width rich text
2664    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
2665    pub struct RichTextFixed {
2666        /// Text
2667        pub text: crate::enums::RichText,
2668    }
2669    /// A rich text URL link
2670    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
2671    pub struct RichTextUrl {
2672        /// Text
2673        pub text: crate::enums::RichText,
2674        /// URL
2675        pub url: String,
2676        /// True, if the URL has cached instant view server-side
2677        pub is_cached: bool,
2678    }
2679    /// A rich text email link
2680    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
2681    pub struct RichTextEmailAddress {
2682        /// Text
2683        pub text: crate::enums::RichText,
2684        /// Email address
2685        pub email_address: String,
2686    }
2687    /// A subscript rich text
2688    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
2689    pub struct RichTextSubscript {
2690        /// Text
2691        pub text: crate::enums::RichText,
2692    }
2693    /// A superscript rich text
2694    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
2695    pub struct RichTextSuperscript {
2696        /// Text
2697        pub text: crate::enums::RichText,
2698    }
2699    /// A marked rich text
2700    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
2701    pub struct RichTextMarked {
2702        /// Text
2703        pub text: crate::enums::RichText,
2704    }
2705    /// A rich text phone number
2706    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
2707    pub struct RichTextPhoneNumber {
2708        /// Text
2709        pub text: crate::enums::RichText,
2710        /// Phone number
2711        pub phone_number: String,
2712    }
2713    /// A small image inside the text
2714    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
2715    pub struct RichTextIcon {
2716        /// The image represented as a document. The image can be in GIF, JPEG or PNG format
2717        pub document: crate::types::Document,
2718        /// Width of a bounding box in which the image must be shown; 0 if unknown
2719        pub width: i32,
2720        /// Height of a bounding box in which the image must be shown; 0 if unknown
2721        pub height: i32,
2722    }
2723    /// A reference to a richTexts object on the same web page
2724    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
2725    pub struct RichTextReference {
2726        /// The text
2727        pub text: crate::enums::RichText,
2728        /// The name of a richTextAnchor object, which is the first element of the target richTexts object
2729        pub anchor_name: String,
2730        /// An HTTP URL, opening the reference
2731        pub url: String,
2732    }
2733    /// An anchor
2734    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
2735    pub struct RichTextAnchor {
2736        /// Anchor name
2737        pub name: String,
2738    }
2739    /// A link to an anchor on the same web page
2740    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
2741    pub struct RichTextAnchorLink {
2742        /// The link text
2743        pub text: crate::enums::RichText,
2744        /// The anchor name. If the name is empty, the link must bring back to top
2745        pub anchor_name: String,
2746        /// An HTTP URL, opening the anchor
2747        pub url: String,
2748    }
2749    /// A concatenation of rich texts
2750    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
2751    pub struct RichTexts {
2752        /// Texts
2753        pub texts: Vec<crate::enums::RichText>,
2754    }
2755    /// Contains a caption of an instant view web page block, consisting of a text and a trailing credit
2756    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
2757    pub struct PageBlockCaption {
2758        /// Content of the caption
2759        pub text: crate::enums::RichText,
2760        /// Block credit (like HTML tag <cite>)
2761        pub credit: crate::enums::RichText,
2762    }
2763    /// Describes an item of a list page block
2764    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
2765    pub struct PageBlockListItem {
2766        /// Item label
2767        pub label: String,
2768        /// Item blocks
2769        pub page_blocks: Vec<crate::enums::PageBlock>,
2770    }
2771    /// Represents a cell of a table
2772    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
2773    pub struct PageBlockTableCell {
2774        /// Cell text; may be null. If the text is null, then the cell must be invisible
2775        pub text: Option<crate::enums::RichText>,
2776        /// True, if it is a header cell
2777        pub is_header: bool,
2778        /// The number of columns the cell spans
2779        pub colspan: i32,
2780        /// The number of rows the cell spans
2781        pub rowspan: i32,
2782        /// Horizontal cell content alignment
2783        pub align: crate::enums::PageBlockHorizontalAlignment,
2784        /// Vertical cell content alignment
2785        pub valign: crate::enums::PageBlockVerticalAlignment,
2786    }
2787    /// Contains information about a related article
2788    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
2789    pub struct PageBlockRelatedArticle {
2790        /// Related article URL
2791        pub url: String,
2792        /// Article title; may be empty
2793        pub title: String,
2794        /// Article description; may be empty
2795        pub description: String,
2796        /// Article photo; may be null
2797        pub photo: Option<crate::types::Photo>,
2798        /// Article author; may be empty
2799        pub author: String,
2800        /// Point in time (Unix timestamp) when the article was published; 0 if unknown
2801        pub publish_date: i32,
2802    }
2803    /// The title of a page
2804    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
2805    pub struct PageBlockTitle {
2806        /// Title
2807        pub title: crate::enums::RichText,
2808    }
2809    /// The subtitle of a page
2810    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
2811    pub struct PageBlockSubtitle {
2812        /// Subtitle
2813        pub subtitle: crate::enums::RichText,
2814    }
2815    /// The author and publishing date of a page
2816    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
2817    pub struct PageBlockAuthorDate {
2818        /// Author
2819        pub author: crate::enums::RichText,
2820        /// Point in time (Unix timestamp) when the article was published; 0 if unknown
2821        pub publish_date: i32,
2822    }
2823    /// A header
2824    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
2825    pub struct PageBlockHeader {
2826        /// Header
2827        pub header: crate::enums::RichText,
2828    }
2829    /// A subheader
2830    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
2831    pub struct PageBlockSubheader {
2832        /// Subheader
2833        pub subheader: crate::enums::RichText,
2834    }
2835    /// A kicker
2836    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
2837    pub struct PageBlockKicker {
2838        /// Kicker
2839        pub kicker: crate::enums::RichText,
2840    }
2841    /// A text paragraph
2842    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
2843    pub struct PageBlockParagraph {
2844        /// Paragraph text
2845        pub text: crate::enums::RichText,
2846    }
2847    /// A preformatted text paragraph
2848    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
2849    pub struct PageBlockPreformatted {
2850        /// Paragraph text
2851        pub text: crate::enums::RichText,
2852        /// Programming language for which the text needs to be formatted
2853        pub language: String,
2854    }
2855    /// The footer of a page
2856    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
2857    pub struct PageBlockFooter {
2858        /// Footer
2859        pub footer: crate::enums::RichText,
2860    }
2861    /// An invisible anchor on a page, which can be used in a URL to open the page from the specified anchor
2862    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
2863    pub struct PageBlockAnchor {
2864        /// Name of the anchor
2865        pub name: String,
2866    }
2867    /// A list of data blocks
2868    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
2869    pub struct PageBlockList {
2870        /// The items of the list
2871        pub items: Vec<crate::types::PageBlockListItem>,
2872    }
2873    /// A block quote
2874    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
2875    pub struct PageBlockBlockQuote {
2876        /// Quote text
2877        pub text: crate::enums::RichText,
2878        /// Quote credit
2879        pub credit: crate::enums::RichText,
2880    }
2881    /// A pull quote
2882    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
2883    pub struct PageBlockPullQuote {
2884        /// Quote text
2885        pub text: crate::enums::RichText,
2886        /// Quote credit
2887        pub credit: crate::enums::RichText,
2888    }
2889    /// An animation
2890    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
2891    pub struct PageBlockAnimation {
2892        /// Animation file; may be null
2893        pub animation: Option<crate::types::Animation>,
2894        /// Animation caption
2895        pub caption: crate::types::PageBlockCaption,
2896        /// True, if the animation must be played automatically
2897        pub need_autoplay: bool,
2898    }
2899    /// An audio file
2900    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
2901    pub struct PageBlockAudio {
2902        /// Audio file; may be null
2903        pub audio: Option<crate::types::Audio>,
2904        /// Audio file caption
2905        pub caption: crate::types::PageBlockCaption,
2906    }
2907    /// A photo
2908    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
2909    pub struct PageBlockPhoto {
2910        /// Photo file; may be null
2911        pub photo: Option<crate::types::Photo>,
2912        /// Photo caption
2913        pub caption: crate::types::PageBlockCaption,
2914        /// URL that needs to be opened when the photo is clicked
2915        pub url: String,
2916    }
2917    /// A video
2918    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
2919    pub struct PageBlockVideo {
2920        /// Video file; may be null
2921        pub video: Option<crate::types::Video>,
2922        /// Video caption
2923        pub caption: crate::types::PageBlockCaption,
2924        /// True, if the video must be played automatically
2925        pub need_autoplay: bool,
2926        /// True, if the video must be looped
2927        pub is_looped: bool,
2928    }
2929    /// A voice note
2930    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
2931    pub struct PageBlockVoiceNote {
2932        /// Voice note; may be null
2933        pub voice_note: Option<crate::types::VoiceNote>,
2934        /// Voice note caption
2935        pub caption: crate::types::PageBlockCaption,
2936    }
2937    /// A page cover
2938    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
2939    pub struct PageBlockCover {
2940        /// Cover
2941        pub cover: crate::enums::PageBlock,
2942    }
2943    /// An embedded web page
2944    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
2945    pub struct PageBlockEmbedded {
2946        /// Web page URL, if available
2947        pub url: String,
2948        /// HTML-markup of the embedded page
2949        pub html: String,
2950        /// Poster photo, if available; may be null
2951        pub poster_photo: Option<crate::types::Photo>,
2952        /// Block width; 0 if unknown
2953        pub width: i32,
2954        /// Block height; 0 if unknown
2955        pub height: i32,
2956        /// Block caption
2957        pub caption: crate::types::PageBlockCaption,
2958        /// True, if the block must be full width
2959        pub is_full_width: bool,
2960        /// True, if scrolling needs to be allowed
2961        pub allow_scrolling: bool,
2962    }
2963    /// An embedded post
2964    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
2965    pub struct PageBlockEmbeddedPost {
2966        /// Web page URL
2967        pub url: String,
2968        /// Post author
2969        pub author: String,
2970        /// Post author photo; may be null
2971        pub author_photo: Option<crate::types::Photo>,
2972        /// Point in time (Unix timestamp) when the post was created; 0 if unknown
2973        pub date: i32,
2974        /// Post content
2975        pub page_blocks: Vec<crate::enums::PageBlock>,
2976        /// Post caption
2977        pub caption: crate::types::PageBlockCaption,
2978    }
2979    /// A collage
2980    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
2981    pub struct PageBlockCollage {
2982        /// Collage item contents
2983        pub page_blocks: Vec<crate::enums::PageBlock>,
2984        /// Block caption
2985        pub caption: crate::types::PageBlockCaption,
2986    }
2987    /// A slideshow
2988    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
2989    pub struct PageBlockSlideshow {
2990        /// Slideshow item contents
2991        pub page_blocks: Vec<crate::enums::PageBlock>,
2992        /// Block caption
2993        pub caption: crate::types::PageBlockCaption,
2994    }
2995    /// A link to a chat
2996    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
2997    pub struct PageBlockChatLink {
2998        /// Chat title
2999        pub title: String,
3000        /// Chat photo; may be null
3001        pub photo: Option<crate::types::ChatPhotoInfo>,
3002        /// Chat username by which all other information about the chat can be resolved
3003        pub username: String,
3004    }
3005    /// A table
3006    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
3007    pub struct PageBlockTable {
3008        /// Table caption
3009        pub caption: crate::enums::RichText,
3010        /// Table cells
3011        pub cells: Vec<Vec<crate::types::PageBlockTableCell>>,
3012        /// True, if the table is bordered
3013        pub is_bordered: bool,
3014        /// True, if the table is striped
3015        pub is_striped: bool,
3016    }
3017    /// A collapsible block
3018    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
3019    pub struct PageBlockDetails {
3020        /// Always visible heading for the block
3021        pub header: crate::enums::RichText,
3022        /// Block contents
3023        pub page_blocks: Vec<crate::enums::PageBlock>,
3024        /// True, if the block is open by default
3025        pub is_open: bool,
3026    }
3027    /// Related articles
3028    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
3029    pub struct PageBlockRelatedArticles {
3030        /// Block header
3031        pub header: crate::enums::RichText,
3032        /// List of related articles
3033        pub articles: Vec<crate::types::PageBlockRelatedArticle>,
3034    }
3035    /// A map
3036    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
3037    pub struct PageBlockMap {
3038        /// Location of the map center
3039        pub location: crate::types::Location,
3040        /// Map zoom level
3041        pub zoom: i32,
3042        /// Map width
3043        pub width: i32,
3044        /// Map height
3045        pub height: i32,
3046        /// Block caption
3047        pub caption: crate::types::PageBlockCaption,
3048    }
3049    /// Describes an instant view page for a web page
3050    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
3051    pub struct WebPageInstantView {
3052        /// Content of the web page
3053        pub page_blocks: Vec<crate::enums::PageBlock>,
3054        /// Number of the instant view views; 0 if unknown
3055        pub view_count: i32,
3056        /// Version of the instant view; currently, can be 1 or 2
3057        pub version: i32,
3058        /// True, if the instant view must be shown from right to left
3059        pub is_rtl: bool,
3060        /// True, if the instant view contains the full page. A network request might be needed to get the full web page instant view
3061        pub is_full: bool,
3062        /// An internal link to be opened to leave feedback about the instant view
3063        pub feedback_link: crate::enums::InternalLinkType,
3064    }
3065    /// Describes a web page preview
3066    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
3067    pub struct WebPage {
3068        /// Original URL of the link
3069        pub url: String,
3070        /// URL to display
3071        pub display_url: String,
3072        /// Type of the web page. Can be: article, photo, audio, video, document, profile, app, or something else
3073        pub r#type: String,
3074        /// Short name of the site (e.g., Google Docs, App Store)
3075        pub site_name: String,
3076        /// Title of the content
3077        pub title: String,
3078        /// Description of the content
3079        pub description: crate::types::FormattedText,
3080        /// Image representing the content; may be null
3081        pub photo: Option<crate::types::Photo>,
3082        /// URL to show in the embedded preview
3083        pub embed_url: String,
3084        /// MIME type of the embedded preview, (e.g., text/html or video/mp4)
3085        pub embed_type: String,
3086        /// Width of the embedded preview
3087        pub embed_width: i32,
3088        /// Height of the embedded preview
3089        pub embed_height: i32,
3090        /// Duration of the content, in seconds
3091        pub duration: i32,
3092        /// Author of the content
3093        pub author: String,
3094        /// Preview of the content as an animation, if available; may be null
3095        pub animation: Option<crate::types::Animation>,
3096        /// Preview of the content as an audio file, if available; may be null
3097        pub audio: Option<crate::types::Audio>,
3098        /// Preview of the content as a document, if available; may be null
3099        pub document: Option<crate::types::Document>,
3100        /// Preview of the content as a sticker for small WEBP files, if available; may be null
3101        pub sticker: Option<crate::types::Sticker>,
3102        /// Preview of the content as a video, if available; may be null
3103        pub video: Option<crate::types::Video>,
3104        /// Preview of the content as a video note, if available; may be null
3105        pub video_note: Option<crate::types::VideoNote>,
3106        /// Preview of the content as a voice note, if available; may be null
3107        pub voice_note: Option<crate::types::VoiceNote>,
3108        /// The identifier of the sender of the previewed story; 0 if none
3109        pub story_sender_chat_id: i64,
3110        /// The identifier of the previewed story; 0 if none
3111        pub story_id: i32,
3112        /// Version of web page instant view (currently, can be 1 or 2); 0 if none
3113        pub instant_view_version: i32,
3114    }
3115    /// Contains information about a country
3116    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
3117    pub struct CountryInfo {
3118        /// A two-letter ISO 3166-1 alpha-2 country code
3119        pub country_code: String,
3120        /// Native name of the country
3121        pub name: String,
3122        /// English name of the country
3123        pub english_name: String,
3124        /// True, if the country must be hidden from the list of all countries
3125        pub is_hidden: bool,
3126        /// List of country calling codes
3127        pub calling_codes: Vec<String>,
3128    }
3129    /// Contains information about countries
3130    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
3131    pub struct Countries {
3132        /// The list of countries
3133        pub countries: Vec<crate::types::CountryInfo>,
3134    }
3135    /// Contains information about a phone number
3136    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
3137    pub struct PhoneNumberInfo {
3138        /// Information about the country to which the phone number belongs; may be null
3139        pub country: Option<crate::types::CountryInfo>,
3140        /// The part of the phone number denoting country calling code or its part
3141        pub country_calling_code: String,
3142        /// The phone number without country calling code formatted accordingly to local rules. Expected digits are returned as '-', but even more digits might be entered by the user
3143        pub formatted_phone_number: String,
3144        /// True, if the phone number was bought on Fragment and isn't tied to a SIM card
3145        pub is_anonymous: bool,
3146    }
3147    /// Describes an action associated with a bank card number
3148    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
3149    pub struct BankCardActionOpenUrl {
3150        /// Action text
3151        pub text: String,
3152        /// The URL to be opened
3153        pub url: String,
3154    }
3155    /// Information about a bank card
3156    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
3157    pub struct BankCardInfo {
3158        /// Title of the bank card description
3159        pub title: String,
3160        /// Actions that can be done with the bank card number
3161        pub actions: Vec<crate::types::BankCardActionOpenUrl>,
3162    }
3163    /// Describes an address
3164    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
3165    pub struct Address {
3166        /// A two-letter ISO 3166-1 alpha-2 country code
3167        pub country_code: String,
3168        /// State, if applicable
3169        pub state: String,
3170        /// City
3171        pub city: String,
3172        /// First line of the address
3173        pub street_line1: String,
3174        /// Second line of the address
3175        pub street_line2: String,
3176        /// Address postal code
3177        pub postal_code: String,
3178    }
3179    /// Contains parameters of the application theme
3180    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
3181    pub struct ThemeParameters {
3182        /// A color of the background in the RGB24 format
3183        pub background_color: i32,
3184        /// A secondary color for the background in the RGB24 format
3185        pub secondary_background_color: i32,
3186        /// A color of text in the RGB24 format
3187        pub text_color: i32,
3188        /// A color of hints in the RGB24 format
3189        pub hint_color: i32,
3190        /// A color of links in the RGB24 format
3191        pub link_color: i32,
3192        /// A color of the buttons in the RGB24 format
3193        pub button_color: i32,
3194        /// A color of text on the buttons in the RGB24 format
3195        pub button_text_color: i32,
3196    }
3197    /// Portion of the price of a product (e.g., "delivery cost", "tax amount")
3198    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
3199    pub struct LabeledPricePart {
3200        /// Label for this portion of the product price
3201        pub label: String,
3202        /// Currency amount in the smallest units of the currency
3203        pub amount: i64,
3204    }
3205    /// Product invoice
3206    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
3207    pub struct Invoice {
3208        /// ISO 4217 currency code
3209        pub currency: String,
3210        /// A list of objects used to calculate the total price of the product
3211        pub price_parts: Vec<crate::types::LabeledPricePart>,
3212        /// The maximum allowed amount of tip in the smallest units of the currency
3213        pub max_tip_amount: i64,
3214        /// Suggested amounts of tip in the smallest units of the currency
3215        pub suggested_tip_amounts: Vec<i64>,
3216        /// An HTTP URL with terms of service for recurring payments. If non-empty, the invoice payment will result in recurring payments and the user must accept the terms of service before allowed to pay
3217        pub recurring_payment_terms_of_service_url: String,
3218        /// An HTTP URL with terms of service for non-recurring payments. If non-empty, then the user must accept the terms of service before allowed to pay
3219        pub terms_of_service_url: String,
3220        /// True, if the payment is a test payment
3221        pub is_test: bool,
3222        /// True, if the user's name is needed for payment
3223        pub need_name: bool,
3224        /// True, if the user's phone number is needed for payment
3225        pub need_phone_number: bool,
3226        /// True, if the user's email address is needed for payment
3227        pub need_email_address: bool,
3228        /// True, if the user's shipping address is needed for payment
3229        pub need_shipping_address: bool,
3230        /// True, if the user's phone number will be sent to the provider
3231        pub send_phone_number_to_provider: bool,
3232        /// True, if the user's email address will be sent to the provider
3233        pub send_email_address_to_provider: bool,
3234        /// True, if the total price depends on the shipping method
3235        pub is_flexible: bool,
3236    }
3237    /// Order information
3238    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
3239    pub struct OrderInfo {
3240        /// Name of the user
3241        pub name: String,
3242        /// Phone number of the user
3243        pub phone_number: String,
3244        /// Email address of the user
3245        pub email_address: String,
3246        /// Shipping address for this order; may be null
3247        pub shipping_address: Option<crate::types::Address>,
3248    }
3249    /// One shipping option
3250    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
3251    pub struct ShippingOption {
3252        /// Shipping option identifier
3253        pub id: String,
3254        /// Option title
3255        pub title: String,
3256        /// A list of objects used to calculate the total shipping costs
3257        pub price_parts: Vec<crate::types::LabeledPricePart>,
3258    }
3259    /// Contains information about saved payment credentials
3260    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
3261    pub struct SavedCredentials {
3262        /// Unique identifier of the saved credentials
3263        pub id: String,
3264        /// Title of the saved credentials
3265        pub title: String,
3266    }
3267    /// Applies if a user chooses some previously saved payment credentials. To use their previously saved credentials, the user must have a valid temporary password
3268    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
3269    pub struct InputCredentialsSaved {
3270        /// Identifier of the saved credentials
3271        pub saved_credentials_id: String,
3272    }
3273    /// Applies if a user enters new credentials on a payment provider website
3274    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
3275    pub struct InputCredentialsNew {
3276        /// JSON-encoded data with the credential identifier from the payment provider
3277        pub data: String,
3278        /// True, if the credential identifier can be saved on the server side
3279        pub allow_save: bool,
3280    }
3281    /// Applies if a user enters new credentials using Apple Pay
3282    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
3283    pub struct InputCredentialsApplePay {
3284        /// JSON-encoded data with the credential identifier
3285        pub data: String,
3286    }
3287    /// Applies if a user enters new credentials using Google Pay
3288    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
3289    pub struct InputCredentialsGooglePay {
3290        /// JSON-encoded data with the credential identifier
3291        pub data: String,
3292    }
3293    /// Smart Glocal payment provider
3294    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
3295    pub struct PaymentProviderSmartGlocal {
3296        /// Public payment token
3297        pub public_token: String,
3298    }
3299    /// Stripe payment provider
3300    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
3301    pub struct PaymentProviderStripe {
3302        /// Stripe API publishable key
3303        pub publishable_key: String,
3304        /// True, if the user country must be provided
3305        pub need_country: bool,
3306        /// True, if the user ZIP/postal code must be provided
3307        pub need_postal_code: bool,
3308        /// True, if the cardholder name must be provided
3309        pub need_cardholder_name: bool,
3310    }
3311    /// Some other payment provider, for which a web payment form must be shown
3312    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
3313    pub struct PaymentProviderOther {
3314        /// Payment form URL
3315        pub url: String,
3316    }
3317    /// Describes an additional payment option
3318    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
3319    pub struct PaymentOption {
3320        /// Title for the payment option
3321        pub title: String,
3322        /// Payment form URL to be opened in a web view
3323        pub url: String,
3324    }
3325    /// Contains information about an invoice payment form
3326    #[serde_as]
3327    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
3328    pub struct PaymentForm {
3329        /// The payment form identifier
3330        #[serde_as(as = "DisplayFromStr")]
3331        pub id: i64,
3332        /// Full information about the invoice
3333        pub invoice: crate::types::Invoice,
3334        /// User identifier of the seller bot
3335        pub seller_bot_user_id: i64,
3336        /// User identifier of the payment provider bot
3337        pub payment_provider_user_id: i64,
3338        /// Information about the payment provider
3339        pub payment_provider: crate::enums::PaymentProvider,
3340        /// The list of additional payment options
3341        pub additional_payment_options: Vec<crate::types::PaymentOption>,
3342        /// Saved server-side order information; may be null
3343        pub saved_order_info: Option<crate::types::OrderInfo>,
3344        /// The list of saved payment credentials
3345        pub saved_credentials: Vec<crate::types::SavedCredentials>,
3346        /// True, if the user can choose to save credentials
3347        pub can_save_credentials: bool,
3348        /// True, if the user will be able to save credentials, if sets up a 2-step verification password
3349        pub need_password: bool,
3350        /// Product title
3351        pub product_title: String,
3352        /// Product description
3353        pub product_description: crate::types::FormattedText,
3354        /// Product photo; may be null
3355        pub product_photo: Option<crate::types::Photo>,
3356    }
3357    /// Contains a temporary identifier of validated order information, which is stored for one hour, and the available shipping options
3358    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
3359    pub struct ValidatedOrderInfo {
3360        /// Temporary identifier of the order information
3361        pub order_info_id: String,
3362        /// Available shipping options
3363        pub shipping_options: Vec<crate::types::ShippingOption>,
3364    }
3365    /// Contains the result of a payment request
3366    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
3367    pub struct PaymentResult {
3368        /// True, if the payment request was successful; otherwise, the verification_url will be non-empty
3369        pub success: bool,
3370        /// URL for additional payment credentials verification
3371        pub verification_url: String,
3372    }
3373    /// Contains information about a successful payment
3374    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
3375    pub struct PaymentReceipt {
3376        /// Product title
3377        pub title: String,
3378        /// Product description
3379        pub description: crate::types::FormattedText,
3380        /// Product photo; may be null
3381        pub photo: Option<crate::types::Photo>,
3382        /// Point in time (Unix timestamp) when the payment was made
3383        pub date: i32,
3384        /// User identifier of the seller bot
3385        pub seller_bot_user_id: i64,
3386        /// User identifier of the payment provider bot
3387        pub payment_provider_user_id: i64,
3388        /// Information about the invoice
3389        pub invoice: crate::types::Invoice,
3390        /// Order information; may be null
3391        pub order_info: Option<crate::types::OrderInfo>,
3392        /// Chosen shipping option; may be null
3393        pub shipping_option: Option<crate::types::ShippingOption>,
3394        /// Title of the saved credentials chosen by the buyer
3395        pub credentials_title: String,
3396        /// The amount of tip chosen by the buyer in the smallest units of the currency
3397        pub tip_amount: i64,
3398    }
3399    /// An invoice from a message of the type messageInvoice
3400    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
3401    pub struct InputInvoiceMessage {
3402        /// Chat identifier of the message
3403        pub chat_id: i64,
3404        /// Message identifier
3405        pub message_id: i64,
3406    }
3407    /// An invoice from a link of the type internalLinkTypeInvoice
3408    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
3409    pub struct InputInvoiceName {
3410        /// Name of the invoice
3411        pub name: String,
3412    }
3413    /// The media is hidden until the invoice is paid
3414    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
3415    pub struct MessageExtendedMediaPreview {
3416        /// Media width; 0 if unknown
3417        pub width: i32,
3418        /// Media height; 0 if unknown
3419        pub height: i32,
3420        /// Media duration; 0 if unknown
3421        pub duration: i32,
3422        /// Media minithumbnail; may be null
3423        pub minithumbnail: Option<crate::types::Minithumbnail>,
3424        /// Media caption
3425        pub caption: crate::types::FormattedText,
3426    }
3427    /// The media is a photo
3428    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
3429    pub struct MessageExtendedMediaPhoto {
3430        /// The photo
3431        pub photo: crate::types::Photo,
3432        /// Photo caption
3433        pub caption: crate::types::FormattedText,
3434    }
3435    /// The media is a video
3436    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
3437    pub struct MessageExtendedMediaVideo {
3438        /// The video
3439        pub video: crate::types::Video,
3440        /// Photo caption
3441        pub caption: crate::types::FormattedText,
3442    }
3443    /// The media is unsupported
3444    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
3445    pub struct MessageExtendedMediaUnsupported {
3446        /// Media caption
3447        pub caption: crate::types::FormattedText,
3448    }
3449    /// File with the date it was uploaded
3450    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
3451    pub struct DatedFile {
3452        /// The file
3453        pub file: crate::types::File,
3454        /// Point in time (Unix timestamp) when the file was uploaded
3455        pub date: i32,
3456    }
3457    /// Represents a date according to the Gregorian calendar
3458    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
3459    pub struct Date {
3460        /// Day of the month; 1-31
3461        pub day: i32,
3462        /// Month; 1-12
3463        pub month: i32,
3464        /// Year; 1-9999
3465        pub year: i32,
3466    }
3467    /// Contains the user's personal details
3468    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
3469    pub struct PersonalDetails {
3470        /// First name of the user written in English; 1-255 characters
3471        pub first_name: String,
3472        /// Middle name of the user written in English; 0-255 characters
3473        pub middle_name: String,
3474        /// Last name of the user written in English; 1-255 characters
3475        pub last_name: String,
3476        /// Native first name of the user; 1-255 characters
3477        pub native_first_name: String,
3478        /// Native middle name of the user; 0-255 characters
3479        pub native_middle_name: String,
3480        /// Native last name of the user; 1-255 characters
3481        pub native_last_name: String,
3482        /// Birthdate of the user
3483        pub birthdate: crate::types::Date,
3484        /// Gender of the user, "male" or "female"
3485        pub gender: String,
3486        /// A two-letter ISO 3166-1 alpha-2 country code of the user's country
3487        pub country_code: String,
3488        /// A two-letter ISO 3166-1 alpha-2 country code of the user's residence country
3489        pub residence_country_code: String,
3490    }
3491    /// An identity document
3492    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
3493    pub struct IdentityDocument {
3494        /// Document number; 1-24 characters
3495        pub number: String,
3496        /// Document expiration date; may be null if not applicable
3497        pub expiration_date: Option<crate::types::Date>,
3498        /// Front side of the document
3499        pub front_side: crate::types::DatedFile,
3500        /// Reverse side of the document; only for driver license and identity card; may be null
3501        pub reverse_side: Option<crate::types::DatedFile>,
3502        /// Selfie with the document; may be null
3503        pub selfie: Option<crate::types::DatedFile>,
3504        /// List of files containing a certified English translation of the document
3505        pub translation: Vec<crate::types::DatedFile>,
3506    }
3507    /// An identity document to be saved to Telegram Passport
3508    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
3509    pub struct InputIdentityDocument {
3510        /// Document number; 1-24 characters
3511        pub number: String,
3512        /// Document expiration date; pass null if not applicable
3513        pub expiration_date: Option<crate::types::Date>,
3514        /// Front side of the document
3515        pub front_side: crate::enums::InputFile,
3516        /// Reverse side of the document; only for driver license and identity card; pass null otherwise
3517        pub reverse_side: Option<crate::enums::InputFile>,
3518        /// Selfie with the document; pass null if unavailable
3519        pub selfie: Option<crate::enums::InputFile>,
3520        /// List of files containing a certified English translation of the document
3521        pub translation: Vec<crate::enums::InputFile>,
3522    }
3523    /// A personal document, containing some information about a user
3524    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
3525    pub struct PersonalDocument {
3526        /// List of files containing the pages of the document
3527        pub files: Vec<crate::types::DatedFile>,
3528        /// List of files containing a certified English translation of the document
3529        pub translation: Vec<crate::types::DatedFile>,
3530    }
3531    /// A personal document to be saved to Telegram Passport
3532    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
3533    pub struct InputPersonalDocument {
3534        /// List of files containing the pages of the document
3535        pub files: Vec<crate::enums::InputFile>,
3536        /// List of files containing a certified English translation of the document
3537        pub translation: Vec<crate::enums::InputFile>,
3538    }
3539    /// A Telegram Passport element containing the user's personal details
3540    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
3541    pub struct PassportElementPersonalDetails {
3542        /// Personal details of the user
3543        pub personal_details: crate::types::PersonalDetails,
3544    }
3545    /// A Telegram Passport element containing the user's passport
3546    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
3547    pub struct PassportElementPassport {
3548        /// Passport
3549        pub passport: crate::types::IdentityDocument,
3550    }
3551    /// A Telegram Passport element containing the user's driver license
3552    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
3553    pub struct PassportElementDriverLicense {
3554        /// Driver license
3555        pub driver_license: crate::types::IdentityDocument,
3556    }
3557    /// A Telegram Passport element containing the user's identity card
3558    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
3559    pub struct PassportElementIdentityCard {
3560        /// Identity card
3561        pub identity_card: crate::types::IdentityDocument,
3562    }
3563    /// A Telegram Passport element containing the user's internal passport
3564    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
3565    pub struct PassportElementInternalPassport {
3566        /// Internal passport
3567        pub internal_passport: crate::types::IdentityDocument,
3568    }
3569    /// A Telegram Passport element containing the user's address
3570    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
3571    pub struct PassportElementAddress {
3572        /// Address
3573        pub address: crate::types::Address,
3574    }
3575    /// A Telegram Passport element containing the user's utility bill
3576    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
3577    pub struct PassportElementUtilityBill {
3578        /// Utility bill
3579        pub utility_bill: crate::types::PersonalDocument,
3580    }
3581    /// A Telegram Passport element containing the user's bank statement
3582    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
3583    pub struct PassportElementBankStatement {
3584        /// Bank statement
3585        pub bank_statement: crate::types::PersonalDocument,
3586    }
3587    /// A Telegram Passport element containing the user's rental agreement
3588    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
3589    pub struct PassportElementRentalAgreement {
3590        /// Rental agreement
3591        pub rental_agreement: crate::types::PersonalDocument,
3592    }
3593    /// A Telegram Passport element containing the user's passport registration pages
3594    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
3595    pub struct PassportElementPassportRegistration {
3596        /// Passport registration pages
3597        pub passport_registration: crate::types::PersonalDocument,
3598    }
3599    /// A Telegram Passport element containing the user's temporary registration
3600    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
3601    pub struct PassportElementTemporaryRegistration {
3602        /// Temporary registration
3603        pub temporary_registration: crate::types::PersonalDocument,
3604    }
3605    /// A Telegram Passport element containing the user's phone number
3606    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
3607    pub struct PassportElementPhoneNumber {
3608        /// Phone number
3609        pub phone_number: String,
3610    }
3611    /// A Telegram Passport element containing the user's email address
3612    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
3613    pub struct PassportElementEmailAddress {
3614        /// Email address
3615        pub email_address: String,
3616    }
3617    /// A Telegram Passport element to be saved containing the user's personal details
3618    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
3619    pub struct InputPassportElementPersonalDetails {
3620        /// Personal details of the user
3621        pub personal_details: crate::types::PersonalDetails,
3622    }
3623    /// A Telegram Passport element to be saved containing the user's passport
3624    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
3625    pub struct InputPassportElementPassport {
3626        /// The passport to be saved
3627        pub passport: crate::types::InputIdentityDocument,
3628    }
3629    /// A Telegram Passport element to be saved containing the user's driver license
3630    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
3631    pub struct InputPassportElementDriverLicense {
3632        /// The driver license to be saved
3633        pub driver_license: crate::types::InputIdentityDocument,
3634    }
3635    /// A Telegram Passport element to be saved containing the user's identity card
3636    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
3637    pub struct InputPassportElementIdentityCard {
3638        /// The identity card to be saved
3639        pub identity_card: crate::types::InputIdentityDocument,
3640    }
3641    /// A Telegram Passport element to be saved containing the user's internal passport
3642    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
3643    pub struct InputPassportElementInternalPassport {
3644        /// The internal passport to be saved
3645        pub internal_passport: crate::types::InputIdentityDocument,
3646    }
3647    /// A Telegram Passport element to be saved containing the user's address
3648    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
3649    pub struct InputPassportElementAddress {
3650        /// The address to be saved
3651        pub address: crate::types::Address,
3652    }
3653    /// A Telegram Passport element to be saved containing the user's utility bill
3654    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
3655    pub struct InputPassportElementUtilityBill {
3656        /// The utility bill to be saved
3657        pub utility_bill: crate::types::InputPersonalDocument,
3658    }
3659    /// A Telegram Passport element to be saved containing the user's bank statement
3660    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
3661    pub struct InputPassportElementBankStatement {
3662        /// The bank statement to be saved
3663        pub bank_statement: crate::types::InputPersonalDocument,
3664    }
3665    /// A Telegram Passport element to be saved containing the user's rental agreement
3666    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
3667    pub struct InputPassportElementRentalAgreement {
3668        /// The rental agreement to be saved
3669        pub rental_agreement: crate::types::InputPersonalDocument,
3670    }
3671    /// A Telegram Passport element to be saved containing the user's passport registration
3672    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
3673    pub struct InputPassportElementPassportRegistration {
3674        /// The passport registration page to be saved
3675        pub passport_registration: crate::types::InputPersonalDocument,
3676    }
3677    /// A Telegram Passport element to be saved containing the user's temporary registration
3678    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
3679    pub struct InputPassportElementTemporaryRegistration {
3680        /// The temporary registration document to be saved
3681        pub temporary_registration: crate::types::InputPersonalDocument,
3682    }
3683    /// A Telegram Passport element to be saved containing the user's phone number
3684    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
3685    pub struct InputPassportElementPhoneNumber {
3686        /// The phone number to be saved
3687        pub phone_number: String,
3688    }
3689    /// A Telegram Passport element to be saved containing the user's email address
3690    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
3691    pub struct InputPassportElementEmailAddress {
3692        /// The email address to be saved
3693        pub email_address: String,
3694    }
3695    /// Contains information about saved Telegram Passport elements
3696    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
3697    pub struct PassportElements {
3698        /// Telegram Passport elements
3699        pub elements: Vec<crate::enums::PassportElement>,
3700    }
3701    /// One of the data fields contains an error. The error will be considered resolved when the value of the field changes
3702    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
3703    pub struct PassportElementErrorSourceDataField {
3704        /// Field name
3705        pub field_name: String,
3706    }
3707    /// One of files with the translation of the document contains an error. The error will be considered resolved when the file changes
3708    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
3709    pub struct PassportElementErrorSourceTranslationFile {
3710        /// Index of a file with the error
3711        pub file_index: i32,
3712    }
3713    /// The file contains an error. The error will be considered resolved when the file changes
3714    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
3715    pub struct PassportElementErrorSourceFile {
3716        /// Index of a file with the error
3717        pub file_index: i32,
3718    }
3719    /// Contains the description of an error in a Telegram Passport element
3720    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
3721    pub struct PassportElementError {
3722        /// Type of the Telegram Passport element which has the error
3723        pub r#type: crate::enums::PassportElementType,
3724        /// Error message
3725        pub message: String,
3726        /// Error source
3727        pub source: crate::enums::PassportElementErrorSource,
3728    }
3729    /// Contains information about a Telegram Passport element that was requested by a service
3730    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
3731    pub struct PassportSuitableElement {
3732        /// Type of the element
3733        pub r#type: crate::enums::PassportElementType,
3734        /// True, if a selfie is required with the identity document
3735        pub is_selfie_required: bool,
3736        /// True, if a certified English translation is required with the document
3737        pub is_translation_required: bool,
3738        /// True, if personal details must include the user's name in the language of their country of residence
3739        pub is_native_name_required: bool,
3740    }
3741    /// Contains a description of the required Telegram Passport element that was requested by a service
3742    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
3743    pub struct PassportRequiredElement {
3744        /// List of Telegram Passport elements any of which is enough to provide
3745        pub suitable_elements: Vec<crate::types::PassportSuitableElement>,
3746    }
3747    /// Contains information about a Telegram Passport authorization form that was requested
3748    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
3749    pub struct PassportAuthorizationForm {
3750        /// Unique identifier of the authorization form
3751        pub id: i32,
3752        /// Telegram Passport elements that must be provided to complete the form
3753        pub required_elements: Vec<crate::types::PassportRequiredElement>,
3754        /// URL for the privacy policy of the service; may be empty
3755        pub privacy_policy_url: String,
3756    }
3757    /// Contains information about a Telegram Passport elements and corresponding errors
3758    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
3759    pub struct PassportElementsWithErrors {
3760        /// Telegram Passport elements
3761        pub elements: Vec<crate::enums::PassportElement>,
3762        /// Errors in the elements that are already available
3763        pub errors: Vec<crate::types::PassportElementError>,
3764    }
3765    /// Contains encrypted Telegram Passport data credentials
3766    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
3767    pub struct EncryptedCredentials {
3768        /// The encrypted credentials
3769        pub data: String,
3770        /// The decrypted data hash
3771        pub hash: String,
3772        /// Secret for data decryption, encrypted with the service's public key
3773        pub secret: String,
3774    }
3775    /// Contains information about an encrypted Telegram Passport element; for bots only
3776    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
3777    pub struct EncryptedPassportElement {
3778        /// Type of Telegram Passport element
3779        pub r#type: crate::enums::PassportElementType,
3780        /// Encrypted JSON-encoded data about the user
3781        pub data: String,
3782        /// The front side of an identity document
3783        pub front_side: crate::types::DatedFile,
3784        /// The reverse side of an identity document; may be null
3785        pub reverse_side: Option<crate::types::DatedFile>,
3786        /// Selfie with the document; may be null
3787        pub selfie: Option<crate::types::DatedFile>,
3788        /// List of files containing a certified English translation of the document
3789        pub translation: Vec<crate::types::DatedFile>,
3790        /// List of attached files
3791        pub files: Vec<crate::types::DatedFile>,
3792        /// Unencrypted data, phone number or email address
3793        pub value: String,
3794        /// Hash of the entire element
3795        pub hash: String,
3796    }
3797    /// The element contains an error in an unspecified place. The error will be considered resolved when new data is added
3798    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
3799    pub struct InputPassportElementErrorSourceUnspecified {
3800        /// Current hash of the entire element
3801        pub element_hash: String,
3802    }
3803    /// A data field contains an error. The error is considered resolved when the field's value changes
3804    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
3805    pub struct InputPassportElementErrorSourceDataField {
3806        /// Field name
3807        pub field_name: String,
3808        /// Current data hash
3809        pub data_hash: String,
3810    }
3811    /// The front side of the document contains an error. The error is considered resolved when the file with the front side of the document changes
3812    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
3813    pub struct InputPassportElementErrorSourceFrontSide {
3814        /// Current hash of the file containing the front side
3815        pub file_hash: String,
3816    }
3817    /// The reverse side of the document contains an error. The error is considered resolved when the file with the reverse side of the document changes
3818    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
3819    pub struct InputPassportElementErrorSourceReverseSide {
3820        /// Current hash of the file containing the reverse side
3821        pub file_hash: String,
3822    }
3823    /// The selfie contains an error. The error is considered resolved when the file with the selfie changes
3824    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
3825    pub struct InputPassportElementErrorSourceSelfie {
3826        /// Current hash of the file containing the selfie
3827        pub file_hash: String,
3828    }
3829    /// One of the files containing the translation of the document contains an error. The error is considered resolved when the file with the translation changes
3830    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
3831    pub struct InputPassportElementErrorSourceTranslationFile {
3832        /// Current hash of the file containing the translation
3833        pub file_hash: String,
3834    }
3835    /// The translation of the document contains an error. The error is considered resolved when the list of files changes
3836    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
3837    pub struct InputPassportElementErrorSourceTranslationFiles {
3838        /// Current hashes of all files with the translation
3839        pub file_hashes: Vec<String>,
3840    }
3841    /// The file contains an error. The error is considered resolved when the file changes
3842    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
3843    pub struct InputPassportElementErrorSourceFile {
3844        /// Current hash of the file which has the error
3845        pub file_hash: String,
3846    }
3847    /// The list of attached files contains an error. The error is considered resolved when the file list changes
3848    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
3849    pub struct InputPassportElementErrorSourceFiles {
3850        /// Current hashes of all attached files
3851        pub file_hashes: Vec<String>,
3852    }
3853    /// Contains the description of an error in a Telegram Passport element; for bots only
3854    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
3855    pub struct InputPassportElementError {
3856        /// Type of Telegram Passport element that has the error
3857        pub r#type: crate::enums::PassportElementType,
3858        /// Error message
3859        pub message: String,
3860        /// Error source
3861        pub source: crate::enums::InputPassportElementErrorSource,
3862    }
3863    /// A text message
3864    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
3865    pub struct MessageText {
3866        /// Text of the message
3867        pub text: crate::types::FormattedText,
3868        /// A preview of the web page that's mentioned in the text; may be null
3869        pub web_page: Option<crate::types::WebPage>,
3870    }
3871    /// An animation message (GIF-style).
3872    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
3873    pub struct MessageAnimation {
3874        /// The animation description
3875        pub animation: crate::types::Animation,
3876        /// Animation caption
3877        pub caption: crate::types::FormattedText,
3878        /// True, if the animation preview must be covered by a spoiler animation
3879        pub has_spoiler: bool,
3880        /// True, if the animation thumbnail must be blurred and the animation must be shown only while tapped
3881        pub is_secret: bool,
3882    }
3883    /// An audio message
3884    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
3885    pub struct MessageAudio {
3886        /// The audio description
3887        pub audio: crate::types::Audio,
3888        /// Audio caption
3889        pub caption: crate::types::FormattedText,
3890    }
3891    /// A document message (general file)
3892    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
3893    pub struct MessageDocument {
3894        /// The document description
3895        pub document: crate::types::Document,
3896        /// Document caption
3897        pub caption: crate::types::FormattedText,
3898    }
3899    /// A photo message
3900    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
3901    pub struct MessagePhoto {
3902        /// The photo
3903        pub photo: crate::types::Photo,
3904        /// Photo caption
3905        pub caption: crate::types::FormattedText,
3906        /// True, if the photo preview must be covered by a spoiler animation
3907        pub has_spoiler: bool,
3908        /// True, if the photo must be blurred and must be shown only while tapped
3909        pub is_secret: bool,
3910    }
3911    /// A sticker message
3912    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
3913    pub struct MessageSticker {
3914        /// The sticker description
3915        pub sticker: crate::types::Sticker,
3916        /// True, if premium animation of the sticker must be played
3917        pub is_premium: bool,
3918    }
3919    /// A video message
3920    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
3921    pub struct MessageVideo {
3922        /// The video description
3923        pub video: crate::types::Video,
3924        /// Video caption
3925        pub caption: crate::types::FormattedText,
3926        /// True, if the video preview must be covered by a spoiler animation
3927        pub has_spoiler: bool,
3928        /// True, if the video thumbnail must be blurred and the video must be shown only while tapped
3929        pub is_secret: bool,
3930    }
3931    /// A video note message
3932    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
3933    pub struct MessageVideoNote {
3934        /// The video note description
3935        pub video_note: crate::types::VideoNote,
3936        /// True, if at least one of the recipients has viewed the video note
3937        pub is_viewed: bool,
3938        /// True, if the video note thumbnail must be blurred and the video note must be shown only while tapped
3939        pub is_secret: bool,
3940    }
3941    /// A voice note message
3942    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
3943    pub struct MessageVoiceNote {
3944        /// The voice note description
3945        pub voice_note: crate::types::VoiceNote,
3946        /// Voice note caption
3947        pub caption: crate::types::FormattedText,
3948        /// True, if at least one of the recipients has listened to the voice note
3949        pub is_listened: bool,
3950    }
3951    /// A message with a location
3952    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
3953    pub struct MessageLocation {
3954        /// The location description
3955        pub location: crate::types::Location,
3956        /// Time relative to the message send date, for which the location can be updated, in seconds
3957        pub live_period: i32,
3958        /// Left time for which the location can be updated, in seconds. updateMessageContent is not sent when this field changes
3959        pub expires_in: i32,
3960        /// For live locations, a direction in which the location moves, in degrees; 1-360. If 0 the direction is unknown
3961        pub heading: i32,
3962        /// For live locations, a maximum distance to another chat member for proximity alerts, in meters (0-100000). 0 if the notification is disabled. Available only to the message sender
3963        pub proximity_alert_radius: i32,
3964    }
3965    /// A message with information about a venue
3966    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
3967    pub struct MessageVenue {
3968        /// The venue description
3969        pub venue: crate::types::Venue,
3970    }
3971    /// A message with a user contact
3972    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
3973    pub struct MessageContact {
3974        /// The contact description
3975        pub contact: crate::types::Contact,
3976    }
3977    /// A message with an animated emoji
3978    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
3979    pub struct MessageAnimatedEmoji {
3980        /// The animated emoji
3981        pub animated_emoji: crate::types::AnimatedEmoji,
3982        /// The corresponding emoji
3983        pub emoji: String,
3984    }
3985    /// A dice message. The dice value is randomly generated by the server
3986    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
3987    pub struct MessageDice {
3988        /// The animated stickers with the initial dice animation; may be null if unknown. updateMessageContent will be sent when the sticker became known
3989        pub initial_state: Option<crate::enums::DiceStickers>,
3990        /// The animated stickers with the final dice animation; may be null if unknown. updateMessageContent will be sent when the sticker became known
3991        pub final_state: Option<crate::enums::DiceStickers>,
3992        /// Emoji on which the dice throw animation is based
3993        pub emoji: String,
3994        /// The dice value. If the value is 0, the dice don't have final state yet
3995        pub value: i32,
3996        /// Number of frame after which a success animation like a shower of confetti needs to be shown on updateMessageSendSucceeded
3997        pub success_animation_frame_number: i32,
3998    }
3999    /// A message with a game
4000    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
4001    pub struct MessageGame {
4002        /// The game description
4003        pub game: crate::types::Game,
4004    }
4005    /// A message with a poll
4006    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
4007    pub struct MessagePoll {
4008        /// The poll description
4009        pub poll: crate::types::Poll,
4010    }
4011    /// A message with a forwarded story
4012    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
4013    pub struct MessageStory {
4014        /// Identifier of the chat that posted the story
4015        pub story_sender_chat_id: i64,
4016        /// Story identifier
4017        pub story_id: i32,
4018        /// True, if the story was automatically forwarded because of a mention of the user
4019        pub via_mention: bool,
4020    }
4021    /// A message with an invoice from a bot. Use getInternalLink with internalLinkTypeBotStart to share the invoice
4022    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
4023    pub struct MessageInvoice {
4024        /// Product title
4025        pub title: String,
4026        /// Product description
4027        pub description: crate::types::FormattedText,
4028        /// Product photo; may be null
4029        pub photo: Option<crate::types::Photo>,
4030        /// Currency for the product price
4031        pub currency: String,
4032        /// Product total price in the smallest units of the currency
4033        pub total_amount: i64,
4034        /// Unique invoice bot start_parameter to be passed to getInternalLink
4035        pub start_parameter: String,
4036        /// True, if the invoice is a test invoice
4037        pub is_test: bool,
4038        /// True, if the shipping address must be specified
4039        pub need_shipping_address: bool,
4040        /// The identifier of the message with the receipt, after the product has been purchased
4041        pub receipt_message_id: i64,
4042        /// Extended media attached to the invoice; may be null
4043        pub extended_media: Option<crate::enums::MessageExtendedMedia>,
4044    }
4045    /// A message with information about an ended call
4046    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
4047    pub struct MessageCall {
4048        /// True, if the call was a video call
4049        pub is_video: bool,
4050        /// Reason why the call was discarded
4051        pub discard_reason: crate::enums::CallDiscardReason,
4052        /// Call duration, in seconds
4053        pub duration: i32,
4054    }
4055    /// A new video chat was scheduled
4056    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
4057    pub struct MessageVideoChatScheduled {
4058        /// Identifier of the video chat. The video chat can be received through the method getGroupCall
4059        pub group_call_id: i32,
4060        /// Point in time (Unix timestamp) when the group call is supposed to be started by an administrator
4061        pub start_date: i32,
4062    }
4063    /// A newly created video chat
4064    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
4065    pub struct MessageVideoChatStarted {
4066        /// Identifier of the video chat. The video chat can be received through the method getGroupCall
4067        pub group_call_id: i32,
4068    }
4069    /// A message with information about an ended video chat
4070    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
4071    pub struct MessageVideoChatEnded {
4072        /// Call duration, in seconds
4073        pub duration: i32,
4074    }
4075    /// A message with information about an invite to a video chat
4076    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
4077    pub struct MessageInviteVideoChatParticipants {
4078        /// Identifier of the video chat. The video chat can be received through the method getGroupCall
4079        pub group_call_id: i32,
4080        /// Invited user identifiers
4081        pub user_ids: Vec<i64>,
4082    }
4083    /// A newly created basic group
4084    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
4085    pub struct MessageBasicGroupChatCreate {
4086        /// Title of the basic group
4087        pub title: String,
4088        /// User identifiers of members in the basic group
4089        pub member_user_ids: Vec<i64>,
4090    }
4091    /// A newly created supergroup or channel
4092    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
4093    pub struct MessageSupergroupChatCreate {
4094        /// Title of the supergroup or channel
4095        pub title: String,
4096    }
4097    /// An updated chat title
4098    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
4099    pub struct MessageChatChangeTitle {
4100        /// New chat title
4101        pub title: String,
4102    }
4103    /// An updated chat photo
4104    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
4105    pub struct MessageChatChangePhoto {
4106        /// New chat photo
4107        pub photo: crate::types::ChatPhoto,
4108    }
4109    /// New chat members were added
4110    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
4111    pub struct MessageChatAddMembers {
4112        /// User identifiers of the new members
4113        pub member_user_ids: Vec<i64>,
4114    }
4115    /// A chat member was deleted
4116    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
4117    pub struct MessageChatDeleteMember {
4118        /// User identifier of the deleted chat member
4119        pub user_id: i64,
4120    }
4121    /// A basic group was upgraded to a supergroup and was deactivated as the result
4122    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
4123    pub struct MessageChatUpgradeTo {
4124        /// Identifier of the supergroup to which the basic group was upgraded
4125        pub supergroup_id: i64,
4126    }
4127    /// A supergroup has been created from a basic group
4128    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
4129    pub struct MessageChatUpgradeFrom {
4130        /// Title of the newly created supergroup
4131        pub title: String,
4132        /// The identifier of the original basic group
4133        pub basic_group_id: i64,
4134    }
4135    /// A message has been pinned
4136    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
4137    pub struct MessagePinMessage {
4138        /// Identifier of the pinned message, can be an identifier of a deleted message or 0
4139        pub message_id: i64,
4140    }
4141    /// A new background was set in the chat
4142    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
4143    pub struct MessageChatSetBackground {
4144        /// Identifier of the message with a previously set same background; 0 if none. Can be an identifier of a deleted message
4145        pub old_background_message_id: i64,
4146        /// The new background
4147        pub background: crate::types::ChatBackground,
4148    }
4149    /// A theme in the chat has been changed
4150    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
4151    pub struct MessageChatSetTheme {
4152        /// If non-empty, name of a new theme, set for the chat. Otherwise, chat theme was reset to the default one
4153        pub theme_name: String,
4154    }
4155    /// The auto-delete or self-destruct timer for messages in the chat has been changed
4156    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
4157    pub struct MessageChatSetMessageAutoDeleteTime {
4158        /// New value auto-delete or self-destruct time, in seconds; 0 if disabled
4159        pub message_auto_delete_time: i32,
4160        /// If not 0, a user identifier, which default setting was automatically applied
4161        pub from_user_id: i64,
4162    }
4163    /// A forum topic has been created
4164    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
4165    pub struct MessageForumTopicCreated {
4166        /// Name of the topic
4167        pub name: String,
4168        /// Icon of the topic
4169        pub icon: crate::types::ForumTopicIcon,
4170    }
4171    /// A forum topic has been edited
4172    #[serde_as]
4173    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
4174    pub struct MessageForumTopicEdited {
4175        /// If non-empty, the new name of the topic
4176        pub name: String,
4177        /// True, if icon's custom_emoji_id is changed
4178        pub edit_icon_custom_emoji_id: bool,
4179        /// New unique identifier of the custom emoji shown on the topic icon; 0 if none. Must be ignored if edit_icon_custom_emoji_id is false
4180        #[serde_as(as = "DisplayFromStr")]
4181        pub icon_custom_emoji_id: i64,
4182    }
4183    /// A forum topic has been closed or opened
4184    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
4185    pub struct MessageForumTopicIsClosedToggled {
4186        /// True, if the topic was closed; otherwise, the topic was reopened
4187        pub is_closed: bool,
4188    }
4189    /// A General forum topic has been hidden or unhidden
4190    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
4191    pub struct MessageForumTopicIsHiddenToggled {
4192        /// True, if the topic was hidden; otherwise, the topic was unhidden
4193        pub is_hidden: bool,
4194    }
4195    /// A profile photo was suggested to a user in a private chat
4196    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
4197    pub struct MessageSuggestProfilePhoto {
4198        /// The suggested chat photo. Use the method setProfilePhoto with inputChatPhotoPrevious to apply the photo
4199        pub photo: crate::types::ChatPhoto,
4200    }
4201    /// A non-standard action has happened in the chat
4202    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
4203    pub struct MessageCustomServiceAction {
4204        /// Message text to be shown in the chat
4205        pub text: String,
4206    }
4207    /// A new high score was achieved in a game
4208    #[serde_as]
4209    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
4210    pub struct MessageGameScore {
4211        /// Identifier of the message with the game, can be an identifier of a deleted message
4212        pub game_message_id: i64,
4213        /// Identifier of the game; may be different from the games presented in the message with the game
4214        #[serde_as(as = "DisplayFromStr")]
4215        pub game_id: i64,
4216        /// New score
4217        pub score: i32,
4218    }
4219    /// A payment has been completed
4220    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
4221    pub struct MessagePaymentSuccessful {
4222        /// Identifier of the chat, containing the corresponding invoice message
4223        pub invoice_chat_id: i64,
4224        /// Identifier of the message with the corresponding invoice; can be 0 or an identifier of a deleted message
4225        pub invoice_message_id: i64,
4226        /// Currency for the price of the product
4227        pub currency: String,
4228        /// Total price for the product, in the smallest units of the currency
4229        pub total_amount: i64,
4230        /// True, if this is a recurring payment
4231        pub is_recurring: bool,
4232        /// True, if this is the first recurring payment
4233        pub is_first_recurring: bool,
4234        /// Name of the invoice; may be empty if unknown
4235        pub invoice_name: String,
4236    }
4237    /// A payment has been completed; for bots only
4238    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
4239    pub struct MessagePaymentSuccessfulBot {
4240        /// Currency for price of the product
4241        pub currency: String,
4242        /// Total price for the product, in the smallest units of the currency
4243        pub total_amount: i64,
4244        /// True, if this is a recurring payment
4245        pub is_recurring: bool,
4246        /// True, if this is the first recurring payment
4247        pub is_first_recurring: bool,
4248        /// Invoice payload
4249        pub invoice_payload: String,
4250        /// Identifier of the shipping option chosen by the user; may be empty if not applicable
4251        pub shipping_option_id: String,
4252        /// Information about the order; may be null
4253        pub order_info: Option<crate::types::OrderInfo>,
4254        /// Telegram payment identifier
4255        pub telegram_payment_charge_id: String,
4256        /// Provider payment identifier
4257        pub provider_payment_charge_id: String,
4258    }
4259    /// Telegram Premium was gifted to the user
4260    #[serde_as]
4261    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
4262    pub struct MessageGiftedPremium {
4263        /// The identifier of a user that gifted Telegram Premium; 0 if the gift was anonymous
4264        pub gifter_user_id: i64,
4265        /// Currency for the paid amount
4266        pub currency: String,
4267        /// The paid amount, in the smallest units of the currency
4268        pub amount: i64,
4269        /// Cryptocurrency used to pay for the gift; may be empty if none
4270        pub cryptocurrency: String,
4271        /// The paid amount, in the smallest units of the cryptocurrency
4272        #[serde_as(as = "DisplayFromStr")]
4273        pub cryptocurrency_amount: i64,
4274        /// Number of month the Telegram Premium subscription will be active
4275        pub month_count: i32,
4276        /// A sticker to be shown in the message; may be null if unknown
4277        pub sticker: Option<crate::types::Sticker>,
4278    }
4279    /// The current user shared a user, which was requested by the bot
4280    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
4281    pub struct MessageUserShared {
4282        /// Identifier of the shared user
4283        pub user_id: i64,
4284        /// Identifier of the keyboard button with the request
4285        pub button_id: i32,
4286    }
4287    /// The current user shared a chat, which was requested by the bot
4288    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
4289    pub struct MessageChatShared {
4290        /// Identifier of the shared chat
4291        pub chat_id: i64,
4292        /// Identifier of the keyboard button with the request
4293        pub button_id: i32,
4294    }
4295    /// The current user has connected a website by logging in using Telegram Login Widget on it
4296    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
4297    pub struct MessageWebsiteConnected {
4298        /// Domain name of the connected website
4299        pub domain_name: String,
4300    }
4301    /// The user allowed the bot to send messages
4302    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
4303    pub struct MessageBotWriteAccessAllowed {
4304        /// Information about the Web App, which requested the access; may be null if none or the Web App was opened from the attachment menu
4305        pub web_app: Option<crate::types::WebApp>,
4306        /// True, if user allowed the bot to send messages by an explicit call to allowBotToSendMessages
4307        pub by_request: bool,
4308    }
4309    /// Data from a Web App has been sent to a bot
4310    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
4311    pub struct MessageWebAppDataSent {
4312        /// Text of the keyboardButtonTypeWebApp button, which opened the Web App
4313        pub button_text: String,
4314    }
4315    /// Data from a Web App has been received; for bots only
4316    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
4317    pub struct MessageWebAppDataReceived {
4318        /// Text of the keyboardButtonTypeWebApp button, which opened the Web App
4319        pub button_text: String,
4320        /// The data
4321        pub data: String,
4322    }
4323    /// Telegram Passport data has been sent to a bot
4324    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
4325    pub struct MessagePassportDataSent {
4326        /// List of Telegram Passport element types sent
4327        pub types: Vec<crate::enums::PassportElementType>,
4328    }
4329    /// Telegram Passport data has been received; for bots only
4330    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
4331    pub struct MessagePassportDataReceived {
4332        /// List of received Telegram Passport elements
4333        pub elements: Vec<crate::types::EncryptedPassportElement>,
4334        /// Encrypted data credentials
4335        pub credentials: crate::types::EncryptedCredentials,
4336    }
4337    /// A user in the chat came within proximity alert range
4338    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
4339    pub struct MessageProximityAlertTriggered {
4340        /// The identifier of a user or chat that triggered the proximity alert
4341        pub traveler_id: crate::enums::MessageSender,
4342        /// The identifier of a user or chat that subscribed for the proximity alert
4343        pub watcher_id: crate::enums::MessageSender,
4344        /// The distance between the users
4345        pub distance: i32,
4346    }
4347    /// Text that must be formatted as if inside pre, and code HTML tags
4348    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
4349    pub struct TextEntityTypePreCode {
4350        /// Programming language of the code; as defined by the sender
4351        pub language: String,
4352    }
4353    /// A text description shown instead of a raw URL
4354    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
4355    pub struct TextEntityTypeTextUrl {
4356        /// HTTP or tg: URL to be opened when the link is clicked
4357        pub url: String,
4358    }
4359    /// A text shows instead of a raw mention of the user (e.g., when the user has no username)
4360    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
4361    pub struct TextEntityTypeMentionName {
4362        /// Identifier of the mentioned user
4363        pub user_id: i64,
4364    }
4365    /// A custom emoji. The text behind a custom emoji must be an emoji. Only premium users can use premium custom emoji
4366    #[serde_as]
4367    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
4368    pub struct TextEntityTypeCustomEmoji {
4369        /// Unique identifier of the custom emoji
4370        #[serde_as(as = "DisplayFromStr")]
4371        pub custom_emoji_id: i64,
4372    }
4373    /// A media timestamp
4374    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
4375    pub struct TextEntityTypeMediaTimestamp {
4376        /// Timestamp from which a video/audio/video note/voice note playing must start, in seconds. The media can be in the content or the web page preview of the current message, or in the same places in the replied message
4377        pub media_timestamp: i32,
4378    }
4379    /// A thumbnail to be sent along with a file; must be in JPEG or WEBP format for stickers, and less than 200 KB in size
4380    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
4381    pub struct InputThumbnail {
4382        /// Thumbnail file to send. Sending thumbnails by file_id is currently not supported
4383        pub thumbnail: crate::enums::InputFile,
4384        /// Thumbnail width, usually shouldn't exceed 320. Use 0 if unknown
4385        pub width: i32,
4386        /// Thumbnail height, usually shouldn't exceed 320. Use 0 if unknown
4387        pub height: i32,
4388    }
4389    /// The message will be sent at the specified date
4390    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
4391    pub struct MessageSchedulingStateSendAtDate {
4392        /// Point in time (Unix timestamp) when the message will be sent. The date must be within 367 days in the future
4393        pub send_date: i32,
4394    }
4395    /// The message will be self-destructed in the specified time after its content was opened
4396    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
4397    pub struct MessageSelfDestructTypeTimer {
4398        /// The message's self-destruct time, in seconds; must be between 0 and 60 in private chats
4399        pub self_destruct_time: i32,
4400    }
4401    /// Options to be used when a message is sent
4402    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
4403    pub struct MessageSendOptions {
4404        /// Pass true to disable notification for the message
4405        pub disable_notification: bool,
4406        /// Pass true if the message is sent from the background
4407        pub from_background: bool,
4408        /// Pass true if the content of the message must be protected from forwarding and saving; for bots only
4409        pub protect_content: bool,
4410        /// Pass true if the user explicitly chosen a sticker or a custom emoji from an installed sticker set; applicable only to sendMessage and sendMessageAlbum
4411        pub update_order_of_installed_sticker_sets: bool,
4412        /// Message scheduling state; pass null to send message immediately. Messages sent to a secret chat, live location messages and self-destructing messages can't be scheduled
4413        pub scheduling_state: Option<crate::enums::MessageSchedulingState>,
4414        /// Non-persistent identifier, which will be returned back in messageSendingStatePending object and can be used to match sent messages and corresponding updateNewMessage updates
4415        pub sending_id: i32,
4416    }
4417    /// Options to be used when a message content is copied without reference to the original sender. Service messages and messageInvoice can't be copied
4418    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
4419    pub struct MessageCopyOptions {
4420        /// True, if content of the message needs to be copied without reference to the original sender. Always true if the message is forwarded to a secret chat or is local
4421        pub send_copy: bool,
4422        /// True, if media caption of the message copy needs to be replaced. Ignored if send_copy is false
4423        pub replace_caption: bool,
4424        /// New message caption; pass null to copy message without caption. Ignored if replace_caption is false
4425        pub new_caption: Option<crate::types::FormattedText>,
4426    }
4427    /// A text message
4428    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
4429    pub struct InputMessageText {
4430        /// Formatted text to be sent; 1-getOption("message_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, Code, Pre, PreCode, TextUrl and MentionName entities are allowed to be specified manually
4431        pub text: crate::types::FormattedText,
4432        /// True, if rich web page previews for URLs in the message text must be disabled
4433        pub disable_web_page_preview: bool,
4434        /// True, if a chat message draft must be deleted
4435        pub clear_draft: bool,
4436    }
4437    /// An animation message (GIF-style).
4438    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
4439    pub struct InputMessageAnimation {
4440        /// Animation file to be sent
4441        pub animation: crate::enums::InputFile,
4442        /// Animation thumbnail; pass null to skip thumbnail uploading
4443        pub thumbnail: Option<crate::types::InputThumbnail>,
4444        /// File identifiers of the stickers added to the animation, if applicable
4445        pub added_sticker_file_ids: Vec<i32>,
4446        /// Duration of the animation, in seconds
4447        pub duration: i32,
4448        /// Width of the animation; may be replaced by the server
4449        pub width: i32,
4450        /// Height of the animation; may be replaced by the server
4451        pub height: i32,
4452        /// Animation caption; pass null to use an empty caption; 0-getOption("message_caption_length_max") characters
4453        pub caption: Option<crate::types::FormattedText>,
4454        /// True, if the animation preview must be covered by a spoiler animation; not supported in secret chats
4455        pub has_spoiler: bool,
4456    }
4457    /// An audio message
4458    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
4459    pub struct InputMessageAudio {
4460        /// Audio file to be sent
4461        pub audio: crate::enums::InputFile,
4462        /// Thumbnail of the cover for the album; pass null to skip thumbnail uploading
4463        pub album_cover_thumbnail: Option<crate::types::InputThumbnail>,
4464        /// Duration of the audio, in seconds; may be replaced by the server
4465        pub duration: i32,
4466        /// Title of the audio; 0-64 characters; may be replaced by the server
4467        pub title: String,
4468        /// Performer of the audio; 0-64 characters, may be replaced by the server
4469        pub performer: String,
4470        /// Audio caption; pass null to use an empty caption; 0-getOption("message_caption_length_max") characters
4471        pub caption: Option<crate::types::FormattedText>,
4472    }
4473    /// A document message (general file)
4474    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
4475    pub struct InputMessageDocument {
4476        /// Document to be sent
4477        pub document: crate::enums::InputFile,
4478        /// Document thumbnail; pass null to skip thumbnail uploading
4479        pub thumbnail: Option<crate::types::InputThumbnail>,
4480        /// If true, automatic file type detection will be disabled and the document will always be sent as file. Always true for files sent to secret chats
4481        pub disable_content_type_detection: bool,
4482        /// Document caption; pass null to use an empty caption; 0-getOption("message_caption_length_max") characters
4483        pub caption: Option<crate::types::FormattedText>,
4484    }
4485    /// A photo message
4486    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
4487    pub struct InputMessagePhoto {
4488        /// Photo to send. The photo must be at most 10 MB in size. The photo's width and height must not exceed 10000 in total. Width and height ratio must be at most 20
4489        pub photo: crate::enums::InputFile,
4490        /// Photo thumbnail to be sent; pass null to skip thumbnail uploading. The thumbnail is sent to the other party only in secret chats
4491        pub thumbnail: Option<crate::types::InputThumbnail>,
4492        /// File identifiers of the stickers added to the photo, if applicable
4493        pub added_sticker_file_ids: Vec<i32>,
4494        /// Photo width
4495        pub width: i32,
4496        /// Photo height
4497        pub height: i32,
4498        /// Photo caption; pass null to use an empty caption; 0-getOption("message_caption_length_max") characters
4499        pub caption: Option<crate::types::FormattedText>,
4500        /// Photo self-destruct type; pass null if none; private chats only
4501        pub self_destruct_type: Option<crate::enums::MessageSelfDestructType>,
4502        /// True, if the photo preview must be covered by a spoiler animation; not supported in secret chats
4503        pub has_spoiler: bool,
4504    }
4505    /// A sticker message
4506    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
4507    pub struct InputMessageSticker {
4508        /// Sticker to be sent
4509        pub sticker: crate::enums::InputFile,
4510        /// Sticker thumbnail; pass null to skip thumbnail uploading
4511        pub thumbnail: Option<crate::types::InputThumbnail>,
4512        /// Sticker width
4513        pub width: i32,
4514        /// Sticker height
4515        pub height: i32,
4516        /// Emoji used to choose the sticker
4517        pub emoji: String,
4518    }
4519    /// A video message
4520    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
4521    pub struct InputMessageVideo {
4522        /// Video to be sent
4523        pub video: crate::enums::InputFile,
4524        /// Video thumbnail; pass null to skip thumbnail uploading
4525        pub thumbnail: Option<crate::types::InputThumbnail>,
4526        /// File identifiers of the stickers added to the video, if applicable
4527        pub added_sticker_file_ids: Vec<i32>,
4528        /// Duration of the video, in seconds
4529        pub duration: i32,
4530        /// Video width
4531        pub width: i32,
4532        /// Video height
4533        pub height: i32,
4534        /// True, if the video is supposed to be streamed
4535        pub supports_streaming: bool,
4536        /// Video caption; pass null to use an empty caption; 0-getOption("message_caption_length_max") characters
4537        pub caption: Option<crate::types::FormattedText>,
4538        /// Video self-destruct type; pass null if none; private chats only
4539        pub self_destruct_type: Option<crate::enums::MessageSelfDestructType>,
4540        /// True, if the video preview must be covered by a spoiler animation; not supported in secret chats
4541        pub has_spoiler: bool,
4542    }
4543    /// A video note message
4544    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
4545    pub struct InputMessageVideoNote {
4546        /// Video note to be sent
4547        pub video_note: crate::enums::InputFile,
4548        /// Video thumbnail; pass null to skip thumbnail uploading
4549        pub thumbnail: Option<crate::types::InputThumbnail>,
4550        /// Duration of the video, in seconds
4551        pub duration: i32,
4552        /// Video width and height; must be positive and not greater than 640
4553        pub length: i32,
4554    }
4555    /// A voice note message
4556    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
4557    pub struct InputMessageVoiceNote {
4558        /// Voice note to be sent
4559        pub voice_note: crate::enums::InputFile,
4560        /// Duration of the voice note, in seconds
4561        pub duration: i32,
4562        /// Waveform representation of the voice note in 5-bit format
4563        pub waveform: String,
4564        /// Voice note caption; pass null to use an empty caption; 0-getOption("message_caption_length_max") characters
4565        pub caption: Option<crate::types::FormattedText>,
4566    }
4567    /// A message with a location
4568    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
4569    pub struct InputMessageLocation {
4570        /// Location to be sent
4571        pub location: crate::types::Location,
4572        /// Period for which the location can be updated, in seconds; must be between 60 and 86400 for a live location and 0 otherwise
4573        pub live_period: i32,
4574        /// For live locations, a direction in which the location moves, in degrees; 1-360. Pass 0 if unknown
4575        pub heading: i32,
4576        /// For live locations, a maximum distance to another chat member for proximity alerts, in meters (0-100000). Pass 0 if the notification is disabled. Can't be enabled in channels and Saved Messages
4577        pub proximity_alert_radius: i32,
4578    }
4579    /// A message with information about a venue
4580    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
4581    pub struct InputMessageVenue {
4582        /// Venue to send
4583        pub venue: crate::types::Venue,
4584    }
4585    /// A message containing a user contact
4586    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
4587    pub struct InputMessageContact {
4588        /// Contact to send
4589        pub contact: crate::types::Contact,
4590    }
4591    /// A dice message
4592    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
4593    pub struct InputMessageDice {
4594        /// Emoji on which the dice throw animation is based
4595        pub emoji: String,
4596        /// True, if the chat message draft must be deleted
4597        pub clear_draft: bool,
4598    }
4599    /// A message with a game; not supported for channels or secret chats
4600    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
4601    pub struct InputMessageGame {
4602        /// User identifier of the bot that owns the game
4603        pub bot_user_id: i64,
4604        /// Short name of the game
4605        pub game_short_name: String,
4606    }
4607    /// A message with an invoice; can be used only by bots
4608    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
4609    pub struct InputMessageInvoice {
4610        /// Invoice
4611        pub invoice: crate::types::Invoice,
4612        /// Product title; 1-32 characters
4613        pub title: String,
4614        /// Product description; 0-255 characters
4615        pub description: String,
4616        /// Product photo URL; optional
4617        pub photo_url: String,
4618        /// Product photo size
4619        pub photo_size: i32,
4620        /// Product photo width
4621        pub photo_width: i32,
4622        /// Product photo height
4623        pub photo_height: i32,
4624        /// The invoice payload
4625        pub payload: String,
4626        /// Payment provider token
4627        pub provider_token: String,
4628        /// JSON-encoded data about the invoice, which will be shared with the payment provider
4629        pub provider_data: String,
4630        /// Unique invoice bot deep link parameter for the generation of this invoice. If empty, it would be possible to pay directly from forwards of the invoice message
4631        pub start_parameter: String,
4632        /// The content of extended media attached to the invoice. The content of the message to be sent. Must be one of the following types: inputMessagePhoto, inputMessageVideo
4633        pub extended_media_content: crate::enums::InputMessageContent,
4634    }
4635    /// A message with a poll. Polls can't be sent to secret chats. Polls can be sent only to a private chat with a bot
4636    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
4637    pub struct InputMessagePoll {
4638        /// Poll question; 1-255 characters (up to 300 characters for bots)
4639        pub question: String,
4640        /// List of poll answer options, 2-10 strings 1-100 characters each
4641        pub options: Vec<String>,
4642        /// True, if the poll voters are anonymous. Non-anonymous polls can't be sent or forwarded to channels
4643        pub is_anonymous: bool,
4644        /// Type of the poll
4645        pub r#type: crate::enums::PollType,
4646        /// Amount of time the poll will be active after creation, in seconds; for bots only
4647        pub open_period: i32,
4648        /// Point in time (Unix timestamp) when the poll will automatically be closed; for bots only
4649        pub close_date: i32,
4650        /// True, if the poll needs to be sent already closed; for bots only
4651        pub is_closed: bool,
4652    }
4653    /// A message with a forwarded story. Stories can't be sent to secret chats. A story can be forwarded only if story.can_be_forwarded
4654    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
4655    pub struct InputMessageStory {
4656        /// Identifier of the chat that posted the story
4657        pub story_sender_chat_id: i64,
4658        /// Story identifier
4659        pub story_id: i32,
4660    }
4661    /// A forwarded message
4662    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
4663    pub struct InputMessageForwarded {
4664        /// Identifier for the chat this forwarded message came from
4665        pub from_chat_id: i64,
4666        /// Identifier of the message to forward
4667        pub message_id: i64,
4668        /// True, if a game message is being shared from a launched game; applies only to game messages
4669        pub in_game_share: bool,
4670        /// Options to be used to copy content of the message without reference to the original sender; pass null to forward the message as usual
4671        pub copy_options: Option<crate::types::MessageCopyOptions>,
4672    }
4673    /// The user is uploading a video
4674    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
4675    pub struct ChatActionUploadingVideo {
4676        /// Upload progress, as a percentage
4677        pub progress: i32,
4678    }
4679    /// The user is uploading a voice note
4680    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
4681    pub struct ChatActionUploadingVoiceNote {
4682        /// Upload progress, as a percentage
4683        pub progress: i32,
4684    }
4685    /// The user is uploading a photo
4686    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
4687    pub struct ChatActionUploadingPhoto {
4688        /// Upload progress, as a percentage
4689        pub progress: i32,
4690    }
4691    /// The user is uploading a document
4692    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
4693    pub struct ChatActionUploadingDocument {
4694        /// Upload progress, as a percentage
4695        pub progress: i32,
4696    }
4697    /// The user is uploading a video note
4698    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
4699    pub struct ChatActionUploadingVideoNote {
4700        /// Upload progress, as a percentage
4701        pub progress: i32,
4702    }
4703    /// The user is watching animations sent by the other party by clicking on an animated emoji
4704    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
4705    pub struct ChatActionWatchingAnimations {
4706        /// The animated emoji
4707        pub emoji: String,
4708    }
4709    /// The user is online
4710    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
4711    pub struct UserStatusOnline {
4712        /// Point in time (Unix timestamp) when the user's online status will expire
4713        pub expires: i32,
4714    }
4715    /// The user is offline
4716    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
4717    pub struct UserStatusOffline {
4718        /// Point in time (Unix timestamp) when the user was last online
4719        pub was_online: i32,
4720    }
4721    /// Represents a list of stickers
4722    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
4723    pub struct Stickers {
4724        /// List of stickers
4725        pub stickers: Vec<crate::types::Sticker>,
4726    }
4727    /// Represents a list of emoji
4728    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
4729    pub struct Emojis {
4730        /// List of emojis
4731        pub emojis: Vec<String>,
4732    }
4733    /// Represents a sticker set
4734    #[serde_as]
4735    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
4736    pub struct StickerSet {
4737        /// Identifier of the sticker set
4738        #[serde_as(as = "DisplayFromStr")]
4739        pub id: i64,
4740        /// Title of the sticker set
4741        pub title: String,
4742        /// Name of the sticker set
4743        pub name: String,
4744        /// Sticker set thumbnail in WEBP, TGS, or WEBM format with width and height 100; may be null. The file can be downloaded only before the thumbnail is changed
4745        pub thumbnail: Option<crate::types::Thumbnail>,
4746        /// Sticker set thumbnail's outline represented as a list of closed vector paths; may be empty. The coordinate system origin is in the upper-left corner
4747        pub thumbnail_outline: Vec<crate::types::ClosedVectorPath>,
4748        /// True, if the sticker set has been installed by the current user
4749        pub is_installed: bool,
4750        /// True, if the sticker set has been archived. A sticker set can't be installed and archived simultaneously
4751        pub is_archived: bool,
4752        /// True, if the sticker set is official
4753        pub is_official: bool,
4754        /// Format of the stickers in the set
4755        pub sticker_format: crate::enums::StickerFormat,
4756        /// Type of the stickers in the set
4757        pub sticker_type: crate::enums::StickerType,
4758        /// True for already viewed trending sticker sets
4759        pub is_viewed: bool,
4760        /// List of stickers in this set
4761        pub stickers: Vec<crate::types::Sticker>,
4762        /// A list of emoji corresponding to the stickers in the same order. The list is only for informational purposes, because a sticker is always sent with a fixed emoji from the corresponding Sticker object
4763        pub emojis: Vec<crate::types::Emojis>,
4764    }
4765    /// Represents short information about a sticker set
4766    #[serde_as]
4767    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
4768    pub struct StickerSetInfo {
4769        /// Identifier of the sticker set
4770        #[serde_as(as = "DisplayFromStr")]
4771        pub id: i64,
4772        /// Title of the sticker set
4773        pub title: String,
4774        /// Name of the sticker set
4775        pub name: String,
4776        /// Sticker set thumbnail in WEBP, TGS, or WEBM format with width and height 100; may be null
4777        pub thumbnail: Option<crate::types::Thumbnail>,
4778        /// Sticker set thumbnail's outline represented as a list of closed vector paths; may be empty. The coordinate system origin is in the upper-left corner
4779        pub thumbnail_outline: Vec<crate::types::ClosedVectorPath>,
4780        /// True, if the sticker set has been installed by the current user
4781        pub is_installed: bool,
4782        /// True, if the sticker set has been archived. A sticker set can't be installed and archived simultaneously
4783        pub is_archived: bool,
4784        /// True, if the sticker set is official
4785        pub is_official: bool,
4786        /// Format of the stickers in the set
4787        pub sticker_format: crate::enums::StickerFormat,
4788        /// Type of the stickers in the set
4789        pub sticker_type: crate::enums::StickerType,
4790        /// True for already viewed trending sticker sets
4791        pub is_viewed: bool,
4792        /// Total number of stickers in the set
4793        pub size: i32,
4794        /// Up to the first 5 stickers from the set, depending on the context. If the application needs more stickers the full sticker set needs to be requested
4795        pub covers: Vec<crate::types::Sticker>,
4796    }
4797    /// Represents a list of sticker sets
4798    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
4799    pub struct StickerSets {
4800        /// Approximate total number of sticker sets found
4801        pub total_count: i32,
4802        /// List of sticker sets
4803        pub sets: Vec<crate::types::StickerSetInfo>,
4804    }
4805    /// Represents a list of trending sticker sets
4806    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
4807    pub struct TrendingStickerSets {
4808        /// Approximate total number of trending sticker sets
4809        pub total_count: i32,
4810        /// List of trending sticker sets
4811        pub sets: Vec<crate::types::StickerSetInfo>,
4812        /// True, if the list contains sticker sets with premium stickers
4813        pub is_premium: bool,
4814    }
4815    /// Contains a list of similar emoji to search for in getStickers and searchStickers
4816    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
4817    pub struct EmojiCategory {
4818        /// Name of the category
4819        pub name: String,
4820        /// Custom emoji sticker, which represents icon of the category
4821        pub icon: crate::types::Sticker,
4822        /// List of emojis in the category
4823        pub emojis: Vec<String>,
4824    }
4825    /// Represents a list of emoji categories
4826    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
4827    pub struct EmojiCategories {
4828        /// List of categories
4829        pub categories: Vec<crate::types::EmojiCategory>,
4830    }
4831    /// Represents a viewer of a story
4832    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
4833    pub struct StoryViewer {
4834        /// User identifier of the viewer
4835        pub user_id: i64,
4836        /// Approximate point in time (Unix timestamp) when the story was viewed
4837        pub view_date: i32,
4838        /// Block list to which the user is added; may be null if none
4839        pub block_list: Option<crate::enums::BlockList>,
4840        /// Type of the reaction that was chosen by the user; may be null if none
4841        pub chosen_reaction_type: Option<crate::enums::ReactionType>,
4842    }
4843    /// Represents a list of story viewers
4844    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
4845    pub struct StoryViewers {
4846        /// Approximate total number of story viewers found
4847        pub total_count: i32,
4848        /// Approximate total number of reactions set by found story viewers
4849        pub total_reaction_count: i32,
4850        /// List of story viewers
4851        pub viewers: Vec<crate::types::StoryViewer>,
4852        /// The offset for the next request. If empty, there are no more results
4853        pub next_offset: String,
4854    }
4855    /// Describes position of a clickable rectangle area on a story media
4856    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
4857    pub struct StoryAreaPosition {
4858        /// The abscissa of the rectangle's center, as a percentage of the media width
4859        pub x_percentage: f64,
4860        /// The ordinate of the rectangle's center, as a percentage of the media height
4861        pub y_percentage: f64,
4862        /// The width of the rectangle, as a percentage of the media width
4863        pub width_percentage: f64,
4864        /// The ordinate of the rectangle's center, as a percentage of the media height
4865        pub height_percentage: f64,
4866        /// Clockwise rotation angle of the rectangle, in degrees; 0-360
4867        pub rotation_angle: f64,
4868    }
4869    /// An area pointing to a location
4870    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
4871    pub struct StoryAreaTypeLocation {
4872        /// The location
4873        pub location: crate::types::Location,
4874    }
4875    /// An area pointing to a venue
4876    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
4877    pub struct StoryAreaTypeVenue {
4878        /// Information about the venue
4879        pub venue: crate::types::Venue,
4880    }
4881    /// An area pointing to a suggested reaction. App needs to show a clickable reaction on the area and call setStoryReaction when the are is clicked
4882    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
4883    pub struct StoryAreaTypeSuggestedReaction {
4884        /// Type of the reaction
4885        pub reaction_type: crate::enums::ReactionType,
4886        /// Number of times the reaction was added
4887        pub total_count: i32,
4888        /// True, if reaction has a dark background
4889        pub is_dark: bool,
4890        /// True, if reaction corner is flipped
4891        pub is_flipped: bool,
4892    }
4893    /// Describes a clickable rectangle area on a story media
4894    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
4895    pub struct StoryArea {
4896        /// Position of the area
4897        pub position: crate::types::StoryAreaPosition,
4898        /// Type of the area
4899        pub r#type: crate::enums::StoryAreaType,
4900    }
4901    /// An area pointing to a location
4902    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
4903    pub struct InputStoryAreaTypeLocation {
4904        /// The location
4905        pub location: crate::types::Location,
4906    }
4907    /// An area pointing to a venue found by the bot getOption("venue_search_bot_username")
4908    #[serde_as]
4909    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
4910    pub struct InputStoryAreaTypeFoundVenue {
4911        /// Identifier of the inline query, used to found the venue
4912        #[serde_as(as = "DisplayFromStr")]
4913        pub query_id: i64,
4914        /// Identifier of the inline query result
4915        pub result_id: String,
4916    }
4917    /// An area pointing to a venue already added to the story
4918    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
4919    pub struct InputStoryAreaTypePreviousVenue {
4920        /// Provider of the venue
4921        pub venue_provider: String,
4922        /// Identifier of the venue in the provider database
4923        pub venue_id: String,
4924    }
4925    /// An area pointing to a suggested reaction
4926    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
4927    pub struct InputStoryAreaTypeSuggestedReaction {
4928        /// Type of the reaction
4929        pub reaction_type: crate::enums::ReactionType,
4930        /// True, if reaction has a dark background
4931        pub is_dark: bool,
4932        /// True, if reaction corner is flipped
4933        pub is_flipped: bool,
4934    }
4935    /// Describes a clickable rectangle area on a story media to be added
4936    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
4937    pub struct InputStoryArea {
4938        /// Position of the area
4939        pub position: crate::types::StoryAreaPosition,
4940        /// Type of the area
4941        pub r#type: crate::enums::InputStoryAreaType,
4942    }
4943    /// Contains a list of story areas to be added
4944    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
4945    pub struct InputStoryAreas {
4946        /// List of 0-10 input story areas
4947        pub areas: Vec<crate::types::InputStoryArea>,
4948    }
4949    /// Describes a video file sent in a story
4950    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
4951    pub struct StoryVideo {
4952        /// Duration of the video, in seconds
4953        pub duration: f64,
4954        /// Video width
4955        pub width: i32,
4956        /// Video height
4957        pub height: i32,
4958        /// True, if stickers were added to the video. The list of corresponding sticker sets can be received using getAttachedStickerSets
4959        pub has_stickers: bool,
4960        /// True, if the video has no sound
4961        pub is_animation: bool,
4962        /// Video minithumbnail; may be null
4963        pub minithumbnail: Option<crate::types::Minithumbnail>,
4964        /// Video thumbnail in JPEG or MPEG4 format; may be null
4965        pub thumbnail: Option<crate::types::Thumbnail>,
4966        /// Size of file prefix, which is supposed to be preloaded, in bytes
4967        pub preload_prefix_size: i32,
4968        /// File containing the video
4969        pub video: crate::types::File,
4970    }
4971    /// A photo story
4972    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
4973    pub struct StoryContentPhoto {
4974        /// The photo
4975        pub photo: crate::types::Photo,
4976    }
4977    /// A video story
4978    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
4979    pub struct StoryContentVideo {
4980        /// The video in MPEG4 format
4981        pub video: crate::types::StoryVideo,
4982        /// Alternative version of the video in MPEG4 format, encoded by x264 codec; may be null
4983        pub alternative_video: Option<crate::types::StoryVideo>,
4984    }
4985    /// A photo story
4986    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
4987    pub struct InputStoryContentPhoto {
4988        /// Photo to send. The photo must be at most 10 MB in size. The photo size must be 1080x1920
4989        pub photo: crate::enums::InputFile,
4990        /// File identifiers of the stickers added to the photo, if applicable
4991        pub added_sticker_file_ids: Vec<i32>,
4992    }
4993    /// A video story
4994    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
4995    pub struct InputStoryContentVideo {
4996        /// Video to be sent. The video size must be 720x1280. The video must be streamable and stored in MPEG4 format, after encoding with x265 codec and key frames added each second
4997        pub video: crate::enums::InputFile,
4998        /// File identifiers of the stickers added to the video, if applicable
4999        pub added_sticker_file_ids: Vec<i32>,
5000        /// Precise duration of the video, in seconds; 0-60
5001        pub duration: f64,
5002        /// True, if the video has no sound
5003        pub is_animation: bool,
5004    }
5005    /// Contains information about interactions with a story
5006    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
5007    pub struct StoryInteractionInfo {
5008        /// Number of times the story was viewed
5009        pub view_count: i32,
5010        /// Number of times the story was forwarded; 0 if none or unknown
5011        pub forward_count: i32,
5012        /// Number of reactions added to the story; 0 if none or unknown
5013        pub reaction_count: i32,
5014        /// Identifiers of at most 3 recent viewers of the story
5015        pub recent_viewer_user_ids: Vec<i64>,
5016    }
5017    /// Represents a story
5018    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
5019    pub struct Story {
5020        /// Unique story identifier among stories of the given sender
5021        pub id: i32,
5022        /// Identifier of the chat that posted the story
5023        pub sender_chat_id: i64,
5024        /// Point in time (Unix timestamp) when the story was published
5025        pub date: i32,
5026        /// True, if the story is being sent by the current user
5027        pub is_being_sent: bool,
5028        /// True, if the story is being edited by the current user
5029        pub is_being_edited: bool,
5030        /// True, if the story was edited
5031        pub is_edited: bool,
5032        /// True, if the story is saved in the sender's profile and will be available there after expiration
5033        pub is_pinned: bool,
5034        /// True, if the story is visible only for the current user
5035        pub is_visible_only_for_self: bool,
5036        /// True, if the story can be deleted
5037        pub can_be_deleted: bool,
5038        /// True, if the story can be edited
5039        pub can_be_edited: bool,
5040        /// True, if the story can be forwarded as a message. Otherwise, screenshots and saving of the story content must be also forbidden
5041        pub can_be_forwarded: bool,
5042        /// True, if the story can be replied in the chat with the story sender
5043        pub can_be_replied: bool,
5044        /// True, if the story's is_pinned value can be changed
5045        pub can_toggle_is_pinned: bool,
5046        /// True, if users viewed the story can be received through getStoryViewers
5047        pub can_get_viewers: bool,
5048        /// True, if users viewed the story can't be received, because the story has expired more than getOption("story_viewers_expiration_delay") seconds ago
5049        pub has_expired_viewers: bool,
5050        /// Information about interactions with the story; may be null if the story isn't owned or there were no interactions
5051        pub interaction_info: Option<crate::types::StoryInteractionInfo>,
5052        /// Type of the chosen reaction; may be null if none
5053        pub chosen_reaction_type: Option<crate::enums::ReactionType>,
5054        /// Privacy rules affecting story visibility; may be approximate for non-owned stories
5055        pub privacy_settings: crate::enums::StoryPrivacySettings,
5056        /// Content of the story
5057        pub content: crate::enums::StoryContent,
5058        /// Clickable areas to be shown on the story content
5059        pub areas: Vec<crate::types::StoryArea>,
5060        /// Caption of the story
5061        pub caption: crate::types::FormattedText,
5062    }
5063    /// Represents a list of stories
5064    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
5065    pub struct Stories {
5066        /// Approximate total number of stories found
5067        pub total_count: i32,
5068        /// The list of stories
5069        pub stories: Vec<crate::types::Story>,
5070    }
5071    /// Contains basic information about a story
5072    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
5073    pub struct StoryInfo {
5074        /// Unique story identifier among stories of the given sender
5075        pub story_id: i32,
5076        /// Point in time (Unix timestamp) when the story was published
5077        pub date: i32,
5078        /// True, if the story is available only to close friends
5079        pub is_for_close_friends: bool,
5080    }
5081    /// Describes active stories posted by a chat
5082    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
5083    pub struct ChatActiveStories {
5084        /// Identifier of the chat that posted the stories
5085        pub chat_id: i64,
5086        /// Identifier of the story list in which the stories are shown; may be null if the stories aren't shown in a story list
5087        pub list: Option<crate::enums::StoryList>,
5088        /// A parameter used to determine order of the stories in the story list; 0 if the stories doesn't need to be shown in the story list. Stories must be sorted by the pair (order, story_sender_chat_id) in descending order
5089        pub order: i64,
5090        /// Identifier of the last read active story
5091        pub max_read_story_id: i32,
5092        /// Basic information about the stories; use getStory to get full information about the stories. The stories are in a chronological order (i.e., in order of increasing story identifiers)
5093        pub stories: Vec<crate::types::StoryInfo>,
5094    }
5095    /// Describes current boost status of a chat
5096    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
5097    pub struct ChatBoostStatus {
5098        /// True, if the current user has already boosted the chat
5099        pub is_boosted: bool,
5100        /// Current boost level of the chat
5101        pub level: i32,
5102        /// The number of times the chat was boosted
5103        pub boost_count: i32,
5104        /// The number of boosts added to reach the current level
5105        pub current_level_boost_count: i32,
5106        /// The number of boosts needed to reach the next level; 0 if the next level isn't available
5107        pub next_level_boost_count: i32,
5108        /// Approximate number of Telegram Premium subscribers joined the chat; always 0 if the current user isn't an administrator in the chat
5109        pub premium_member_count: i32,
5110        /// A percentage of Telegram Premium subscribers joined the chat; always 0 if the current user isn't an administrator in the chat
5111        pub premium_member_percentage: f64,
5112    }
5113    /// Describes a boost of a chat
5114    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
5115    pub struct ChatBoost {
5116        /// Identifier of a user that boosted the chat
5117        pub user_id: i64,
5118        /// Point in time (Unix timestamp) when the boost will automatically expire if the user will not prolongate their Telegram Premium subscription
5119        pub expiration_date: i32,
5120    }
5121    /// Contains a list of boosts applied to a chat
5122    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
5123    pub struct FoundChatBoosts {
5124        /// Total number of boosts applied to the chat
5125        pub total_count: i32,
5126        /// List of boosts
5127        pub boosts: Vec<crate::types::ChatBoost>,
5128        /// The offset for the next request. If empty, there are no more results
5129        pub next_offset: String,
5130    }
5131    /// Specifies the supported call protocols
5132    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
5133    pub struct CallProtocol {
5134        /// True, if UDP peer-to-peer connections are supported
5135        pub udp_p2p: bool,
5136        /// True, if connection through UDP reflectors is supported
5137        pub udp_reflector: bool,
5138        /// The minimum supported API layer; use 65
5139        pub min_layer: i32,
5140        /// The maximum supported API layer; use 92
5141        pub max_layer: i32,
5142        /// List of supported tgcalls versions
5143        pub library_versions: Vec<String>,
5144    }
5145    /// A Telegram call reflector
5146    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
5147    pub struct CallServerTypeTelegramReflector {
5148        /// A peer tag to be used with the reflector
5149        pub peer_tag: String,
5150        /// True, if the server uses TCP instead of UDP
5151        pub is_tcp: bool,
5152    }
5153    /// A WebRTC server
5154    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
5155    pub struct CallServerTypeWebrtc {
5156        /// Username to be used for authentication
5157        pub username: String,
5158        /// Authentication password
5159        pub password: String,
5160        /// True, if the server supports TURN
5161        pub supports_turn: bool,
5162        /// True, if the server supports STUN
5163        pub supports_stun: bool,
5164    }
5165    /// Describes a server for relaying call data
5166    #[serde_as]
5167    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
5168    pub struct CallServer {
5169        /// Server identifier
5170        #[serde_as(as = "DisplayFromStr")]
5171        pub id: i64,
5172        /// Server IPv4 address
5173        pub ip_address: String,
5174        /// Server IPv6 address
5175        pub ipv6_address: String,
5176        /// Server port number
5177        pub port: i32,
5178        /// Server type
5179        pub r#type: crate::enums::CallServerType,
5180    }
5181    /// Contains the call identifier
5182    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
5183    pub struct CallId {
5184        /// Call identifier
5185        pub id: i32,
5186    }
5187    /// Contains the group call identifier
5188    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
5189    pub struct GroupCallId {
5190        /// Group call identifier
5191        pub id: i32,
5192    }
5193    /// The call is pending, waiting to be accepted by a user
5194    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
5195    pub struct CallStatePending {
5196        /// True, if the call has already been created by the server
5197        pub is_created: bool,
5198        /// True, if the call has already been received by the other party
5199        pub is_received: bool,
5200    }
5201    /// The call is ready to use
5202    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
5203    pub struct CallStateReady {
5204        /// Call protocols supported by the peer
5205        pub protocol: crate::types::CallProtocol,
5206        /// List of available call servers
5207        pub servers: Vec<crate::types::CallServer>,
5208        /// A JSON-encoded call config
5209        pub config: String,
5210        /// Call encryption key
5211        pub encryption_key: String,
5212        /// Encryption key emojis fingerprint
5213        pub emojis: Vec<String>,
5214        /// True, if peer-to-peer connection is allowed by users privacy settings
5215        pub allow_p2p: bool,
5216    }
5217    /// The call has ended successfully
5218    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
5219    pub struct CallStateDiscarded {
5220        /// The reason, why the call has ended
5221        pub reason: crate::enums::CallDiscardReason,
5222        /// True, if the call rating must be sent to the server
5223        pub need_rating: bool,
5224        /// True, if the call debug information must be sent to the server
5225        pub need_debug_information: bool,
5226        /// True, if the call log must be sent to the server
5227        pub need_log: bool,
5228    }
5229    /// The call has ended with an error
5230    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
5231    pub struct CallStateError {
5232        /// Error. An error with the code 4005000 will be returned if an outgoing call is missed because of an expired timeout
5233        pub error: crate::types::Error,
5234    }
5235    /// Describes an available stream in a group call
5236    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
5237    pub struct GroupCallStream {
5238        /// Identifier of an audio/video channel
5239        pub channel_id: i32,
5240        /// Scale of segment durations in the stream. The duration is 1000/(2**scale) milliseconds
5241        pub scale: i32,
5242        /// Point in time when the stream currently ends; Unix timestamp in milliseconds
5243        pub time_offset: i64,
5244    }
5245    /// Represents a list of group call streams
5246    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
5247    pub struct GroupCallStreams {
5248        /// A list of group call streams
5249        pub streams: Vec<crate::types::GroupCallStream>,
5250    }
5251    /// Represents an RTMP URL
5252    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
5253    pub struct RtmpUrl {
5254        /// The URL
5255        pub url: String,
5256        /// Stream key
5257        pub stream_key: String,
5258    }
5259    /// Describes a recently speaking participant in a group call
5260    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
5261    pub struct GroupCallRecentSpeaker {
5262        /// Group call participant identifier
5263        pub participant_id: crate::enums::MessageSender,
5264        /// True, is the user has spoken recently
5265        pub is_speaking: bool,
5266    }
5267    /// Describes a group call
5268    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
5269    pub struct GroupCall {
5270        /// Group call identifier
5271        pub id: i32,
5272        /// Group call title
5273        pub title: String,
5274        /// Point in time (Unix timestamp) when the group call is supposed to be started by an administrator; 0 if it is already active or was ended
5275        pub scheduled_start_date: i32,
5276        /// True, if the group call is scheduled and the current user will receive a notification when the group call will start
5277        pub enabled_start_notification: bool,
5278        /// True, if the call is active
5279        pub is_active: bool,
5280        /// True, if the chat is an RTMP stream instead of an ordinary video chat
5281        pub is_rtmp_stream: bool,
5282        /// True, if the call is joined
5283        pub is_joined: bool,
5284        /// True, if user was kicked from the call because of network loss and the call needs to be rejoined
5285        pub need_rejoin: bool,
5286        /// True, if the current user can manage the group call
5287        pub can_be_managed: bool,
5288        /// Number of participants in the group call
5289        pub participant_count: i32,
5290        /// True, if group call participants, which are muted, aren't returned in participant list
5291        pub has_hidden_listeners: bool,
5292        /// True, if all group call participants are loaded
5293        pub loaded_all_participants: bool,
5294        /// At most 3 recently speaking users in the group call
5295        pub recent_speakers: Vec<crate::types::GroupCallRecentSpeaker>,
5296        /// True, if the current user's video is enabled
5297        pub is_my_video_enabled: bool,
5298        /// True, if the current user's video is paused
5299        pub is_my_video_paused: bool,
5300        /// True, if the current user can broadcast video or share screen
5301        pub can_enable_video: bool,
5302        /// True, if only group call administrators can unmute new participants
5303        pub mute_new_participants: bool,
5304        /// True, if the current user can enable or disable mute_new_participants setting
5305        pub can_toggle_mute_new_participants: bool,
5306        /// Duration of the ongoing group call recording, in seconds; 0 if none. An updateGroupCall update is not triggered when value of this field changes, but the same recording goes on
5307        pub record_duration: i32,
5308        /// True, if a video file is being recorded for the call
5309        pub is_video_recorded: bool,
5310        /// Call duration, in seconds; for ended calls only
5311        pub duration: i32,
5312    }
5313    /// Describes a group of video synchronization source identifiers
5314    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
5315    pub struct GroupCallVideoSourceGroup {
5316        /// The semantics of sources, one of "SIM" or "FID"
5317        pub semantics: String,
5318        /// The list of synchronization source identifiers
5319        pub source_ids: Vec<i32>,
5320    }
5321    /// Contains information about a group call participant's video channel
5322    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
5323    pub struct GroupCallParticipantVideoInfo {
5324        /// List of synchronization source groups of the video
5325        pub source_groups: Vec<crate::types::GroupCallVideoSourceGroup>,
5326        /// Video channel endpoint identifier
5327        pub endpoint_id: String,
5328        /// True, if the video is paused. This flag needs to be ignored, if new video frames are received
5329        pub is_paused: bool,
5330    }
5331    /// Represents a group call participant
5332    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
5333    pub struct GroupCallParticipant {
5334        /// Identifier of the group call participant
5335        pub participant_id: crate::enums::MessageSender,
5336        /// User's audio channel synchronization source identifier
5337        pub audio_source_id: i32,
5338        /// User's screen sharing audio channel synchronization source identifier
5339        pub screen_sharing_audio_source_id: i32,
5340        /// Information about user's video channel; may be null if there is no active video
5341        pub video_info: Option<crate::types::GroupCallParticipantVideoInfo>,
5342        /// Information about user's screen sharing video channel; may be null if there is no active screen sharing video
5343        pub screen_sharing_video_info: Option<crate::types::GroupCallParticipantVideoInfo>,
5344        /// The participant user's bio or the participant chat's description
5345        pub bio: String,
5346        /// True, if the participant is the current user
5347        pub is_current_user: bool,
5348        /// True, if the participant is speaking as set by setGroupCallParticipantIsSpeaking
5349        pub is_speaking: bool,
5350        /// True, if the participant hand is raised
5351        pub is_hand_raised: bool,
5352        /// True, if the current user can mute the participant for all other group call participants
5353        pub can_be_muted_for_all_users: bool,
5354        /// True, if the current user can allow the participant to unmute themselves or unmute the participant (if the participant is the current user)
5355        pub can_be_unmuted_for_all_users: bool,
5356        /// True, if the current user can mute the participant only for self
5357        pub can_be_muted_for_current_user: bool,
5358        /// True, if the current user can unmute the participant for self
5359        pub can_be_unmuted_for_current_user: bool,
5360        /// True, if the participant is muted for all users
5361        pub is_muted_for_all_users: bool,
5362        /// True, if the participant is muted for the current user
5363        pub is_muted_for_current_user: bool,
5364        /// True, if the participant is muted for all users, but can unmute themselves
5365        pub can_unmute_self: bool,
5366        /// Participant's volume level; 1-20000 in hundreds of percents
5367        pub volume_level: i32,
5368        /// User's order in the group call participant list. Orders must be compared lexicographically. The bigger is order, the higher is user in the list. If order is empty, the user must be removed from the participant list
5369        pub order: String,
5370    }
5371    /// Describes a call
5372    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
5373    pub struct Call {
5374        /// Call identifier, not persistent
5375        pub id: i32,
5376        /// Peer user identifier
5377        pub user_id: i64,
5378        /// True, if the call is outgoing
5379        pub is_outgoing: bool,
5380        /// True, if the call is a video call
5381        pub is_video: bool,
5382        /// Call state
5383        pub state: crate::enums::CallState,
5384    }
5385    /// Settings for Firebase Authentication in the official iOS application
5386    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
5387    pub struct FirebaseAuthenticationSettingsIos {
5388        /// Device token from Apple Push Notification service
5389        pub device_token: String,
5390        /// True, if App Sandbox is enabled
5391        pub is_app_sandbox: bool,
5392    }
5393    /// Contains settings for the authentication of the user's phone number
5394    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
5395    pub struct PhoneNumberAuthenticationSettings {
5396        /// Pass true if the authentication code may be sent via a flash call to the specified phone number
5397        pub allow_flash_call: bool,
5398        /// Pass true if the authentication code may be sent via a missed call to the specified phone number
5399        pub allow_missed_call: bool,
5400        /// Pass true if the authenticated phone number is used on the current device
5401        pub is_current_phone_number: bool,
5402        /// For official applications only. True, if the application can use Android SMS Retriever API (requires Google Play Services >= 10.2) to automatically receive the authentication code from the SMS. See https:developers.google.com/identity/sms-retriever/ for more details
5403        pub allow_sms_retriever_api: bool,
5404        /// For official Android and iOS applications only; pass null otherwise. Settings for Firebase Authentication
5405        pub firebase_authentication_settings: Option<crate::enums::FirebaseAuthenticationSettings>,
5406        /// List of up to 20 authentication tokens, recently received in updateOption("authentication_token") in previously logged out sessions
5407        pub authentication_tokens: Vec<String>,
5408    }
5409    /// Represents a reaction applied to a message
5410    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
5411    pub struct AddedReaction {
5412        /// Type of the reaction
5413        pub r#type: crate::enums::ReactionType,
5414        /// Identifier of the chat member, applied the reaction
5415        pub sender_id: crate::enums::MessageSender,
5416        /// Point in time (Unix timestamp) when the reaction was added
5417        pub date: i32,
5418    }
5419    /// Represents a list of reactions added to a message
5420    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
5421    pub struct AddedReactions {
5422        /// The total number of found reactions
5423        pub total_count: i32,
5424        /// The list of added reactions
5425        pub reactions: Vec<crate::types::AddedReaction>,
5426        /// The offset for the next request. If empty, there are no more results
5427        pub next_offset: String,
5428    }
5429    /// Represents an available reaction
5430    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
5431    pub struct AvailableReaction {
5432        /// Type of the reaction
5433        pub r#type: crate::enums::ReactionType,
5434        /// True, if Telegram Premium is needed to send the reaction
5435        pub needs_premium: bool,
5436    }
5437    /// Represents a list of reactions that can be added to a message
5438    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
5439    pub struct AvailableReactions {
5440        /// List of reactions to be shown at the top
5441        pub top_reactions: Vec<crate::types::AvailableReaction>,
5442        /// List of recently used reactions
5443        pub recent_reactions: Vec<crate::types::AvailableReaction>,
5444        /// List of popular reactions
5445        pub popular_reactions: Vec<crate::types::AvailableReaction>,
5446        /// True, if custom emoji reactions could be added by Telegram Premium subscribers
5447        pub allow_custom_emoji: bool,
5448    }
5449    /// Contains information about a emoji reaction
5450    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
5451    pub struct EmojiReaction {
5452        /// Text representation of the reaction
5453        pub emoji: String,
5454        /// Reaction title
5455        pub title: String,
5456        /// True, if the reaction can be added to new messages and enabled in chats
5457        pub is_active: bool,
5458        /// Static icon for the reaction
5459        pub static_icon: crate::types::Sticker,
5460        /// Appear animation for the reaction
5461        pub appear_animation: crate::types::Sticker,
5462        /// Select animation for the reaction
5463        pub select_animation: crate::types::Sticker,
5464        /// Activate animation for the reaction
5465        pub activate_animation: crate::types::Sticker,
5466        /// Effect animation for the reaction
5467        pub effect_animation: crate::types::Sticker,
5468        /// Around animation for the reaction; may be null
5469        pub around_animation: Option<crate::types::Sticker>,
5470        /// Center animation for the reaction; may be null
5471        pub center_animation: Option<crate::types::Sticker>,
5472    }
5473    /// Represents a list of animations
5474    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
5475    pub struct Animations {
5476        /// List of animations
5477        pub animations: Vec<crate::types::Animation>,
5478    }
5479    /// A regular animated sticker
5480    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
5481    pub struct DiceStickersRegular {
5482        /// The animated sticker with the dice animation
5483        pub sticker: crate::types::Sticker,
5484    }
5485    /// Animated stickers to be combined into a slot machine
5486    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
5487    pub struct DiceStickersSlotMachine {
5488        /// The animated sticker with the slot machine background. The background animation must start playing after all reel animations finish
5489        pub background: crate::types::Sticker,
5490        /// The animated sticker with the lever animation. The lever animation must play once in the initial dice state
5491        pub lever: crate::types::Sticker,
5492        /// The animated sticker with the left reel
5493        pub left_reel: crate::types::Sticker,
5494        /// The animated sticker with the center reel
5495        pub center_reel: crate::types::Sticker,
5496        /// The animated sticker with the right reel
5497        pub right_reel: crate::types::Sticker,
5498    }
5499    /// Represents the result of an importContacts request
5500    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
5501    pub struct ImportedContacts {
5502        /// User identifiers of the imported contacts in the same order as they were specified in the request; 0 if the contact is not yet a registered user
5503        pub user_ids: Vec<i64>,
5504        /// The number of users that imported the corresponding contact; 0 for already registered users or if unavailable
5505        pub importer_count: Vec<i32>,
5506    }
5507    /// The speech recognition is ongoing
5508    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
5509    pub struct SpeechRecognitionResultPending {
5510        /// Partially recognized text
5511        pub partial_text: String,
5512    }
5513    /// The speech recognition successfully finished
5514    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
5515    pub struct SpeechRecognitionResultText {
5516        /// Recognized text
5517        pub text: String,
5518    }
5519    /// The speech recognition failed
5520    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
5521    pub struct SpeechRecognitionResultError {
5522        /// Recognition error
5523        pub error: crate::types::Error,
5524    }
5525    /// Describes a color to highlight a bot added to attachment menu
5526    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
5527    pub struct AttachmentMenuBotColor {
5528        /// Color in the RGB24 format for light themes
5529        pub light_color: i32,
5530        /// Color in the RGB24 format for dark themes
5531        pub dark_color: i32,
5532    }
5533    /// Represents a bot, which can be added to attachment or side menu
5534    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
5535    pub struct AttachmentMenuBot {
5536        /// User identifier of the bot
5537        pub bot_user_id: i64,
5538        /// True, if the bot supports opening from attachment menu in the chat with the bot
5539        pub supports_self_chat: bool,
5540        /// True, if the bot supports opening from attachment menu in private chats with ordinary users
5541        pub supports_user_chats: bool,
5542        /// True, if the bot supports opening from attachment menu in private chats with other bots
5543        pub supports_bot_chats: bool,
5544        /// True, if the bot supports opening from attachment menu in basic group and supergroup chats
5545        pub supports_group_chats: bool,
5546        /// True, if the bot supports opening from attachment menu in channel chats
5547        pub supports_channel_chats: bool,
5548        /// True, if the bot supports "settings_button_pressed" event
5549        pub supports_settings: bool,
5550        /// True, if the user must be asked for the permission to send messages to the bot
5551        pub request_write_access: bool,
5552        /// True, if the bot was explicitly added by the user. If the bot isn't added, then on the first bot launch toggleBotIsAddedToAttachmentMenu must be called and the bot must be added or removed
5553        pub is_added: bool,
5554        /// True, if the bot must be shown in the attachment menu
5555        pub show_in_attachment_menu: bool,
5556        /// True, if the bot must be shown in the side menu
5557        pub show_in_side_menu: bool,
5558        /// True, if a disclaimer, why the bot is shown in the side menu, is needed
5559        pub show_disclaimer_in_side_menu: bool,
5560        /// Name for the bot in attachment menu
5561        pub name: String,
5562        /// Color to highlight selected name of the bot if appropriate; may be null
5563        pub name_color: Option<crate::types::AttachmentMenuBotColor>,
5564        /// Default icon for the bot in SVG format; may be null
5565        pub default_icon: Option<crate::types::File>,
5566        /// Icon for the bot in SVG format for the official iOS app; may be null
5567        pub ios_static_icon: Option<crate::types::File>,
5568        /// Icon for the bot in TGS format for the official iOS app; may be null
5569        pub ios_animated_icon: Option<crate::types::File>,
5570        /// Icon for the bot in PNG format for the official iOS app side menu; may be null
5571        pub ios_side_menu_icon: Option<crate::types::File>,
5572        /// Icon for the bot in TGS format for the official Android app; may be null
5573        pub android_icon: Option<crate::types::File>,
5574        /// Icon for the bot in SVG format for the official Android app side menu; may be null
5575        pub android_side_menu_icon: Option<crate::types::File>,
5576        /// Icon for the bot in TGS format for the official native macOS app; may be null
5577        pub macos_icon: Option<crate::types::File>,
5578        /// Icon for the bot in PNG format for the official macOS app side menu; may be null
5579        pub macos_side_menu_icon: Option<crate::types::File>,
5580        /// Color to highlight selected icon of the bot if appropriate; may be null
5581        pub icon_color: Option<crate::types::AttachmentMenuBotColor>,
5582        /// Default placeholder for opened Web Apps in SVG format; may be null
5583        pub web_app_placeholder: Option<crate::types::File>,
5584    }
5585    /// Information about the message sent by answerWebAppQuery
5586    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
5587    pub struct SentWebAppMessage {
5588        /// Identifier of the sent inline message, if known
5589        pub inline_message_id: String,
5590    }
5591    /// Contains an HTTP URL
5592    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
5593    pub struct HttpUrl {
5594        /// The URL
5595        pub url: String,
5596    }
5597    /// Contains an HTTPS URL, which can be used to get information about a user
5598    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
5599    pub struct UserLink {
5600        /// The URL
5601        pub url: String,
5602        /// Left time for which the link is valid, in seconds; 0 if the link is a public username link
5603        pub expires_in: i32,
5604    }
5605    /// Represents a link to an animated GIF or an animated (i.e., without sound) H.264/MPEG-4 AVC video
5606    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
5607    pub struct InputInlineQueryResultAnimation {
5608        /// Unique identifier of the query result
5609        pub id: String,
5610        /// Title of the query result
5611        pub title: String,
5612        /// URL of the result thumbnail (JPEG, GIF, or MPEG4), if it exists
5613        pub thumbnail_url: String,
5614        /// MIME type of the video thumbnail. If non-empty, must be one of "image/jpeg", "image/gif" and "video/mp4"
5615        pub thumbnail_mime_type: String,
5616        /// The URL of the video file (file size must not exceed 1MB)
5617        pub video_url: String,
5618        /// MIME type of the video file. Must be one of "image/gif" and "video/mp4"
5619        pub video_mime_type: String,
5620        /// Duration of the video, in seconds
5621        pub video_duration: i32,
5622        /// Width of the video
5623        pub video_width: i32,
5624        /// Height of the video
5625        pub video_height: i32,
5626        /// The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null
5627        pub reply_markup: Option<crate::enums::ReplyMarkup>,
5628        /// The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageAnimation, inputMessageInvoice, inputMessageLocation, inputMessageVenue or inputMessageContact
5629        pub input_message_content: crate::enums::InputMessageContent,
5630    }
5631    /// Represents a link to an article or web page
5632    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
5633    pub struct InputInlineQueryResultArticle {
5634        /// Unique identifier of the query result
5635        pub id: String,
5636        /// URL of the result, if it exists
5637        pub url: String,
5638        /// True, if the URL must be not shown
5639        pub hide_url: bool,
5640        /// Title of the result
5641        pub title: String,
5642        /// A short description of the result
5643        pub description: String,
5644        /// URL of the result thumbnail, if it exists
5645        pub thumbnail_url: String,
5646        /// Thumbnail width, if known
5647        pub thumbnail_width: i32,
5648        /// Thumbnail height, if known
5649        pub thumbnail_height: i32,
5650        /// The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null
5651        pub reply_markup: Option<crate::enums::ReplyMarkup>,
5652        /// The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageInvoice, inputMessageLocation, inputMessageVenue or inputMessageContact
5653        pub input_message_content: crate::enums::InputMessageContent,
5654    }
5655    /// Represents a link to an MP3 audio file
5656    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
5657    pub struct InputInlineQueryResultAudio {
5658        /// Unique identifier of the query result
5659        pub id: String,
5660        /// Title of the audio file
5661        pub title: String,
5662        /// Performer of the audio file
5663        pub performer: String,
5664        /// The URL of the audio file
5665        pub audio_url: String,
5666        /// Audio file duration, in seconds
5667        pub audio_duration: i32,
5668        /// The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null
5669        pub reply_markup: Option<crate::enums::ReplyMarkup>,
5670        /// The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageAudio, inputMessageInvoice, inputMessageLocation, inputMessageVenue or inputMessageContact
5671        pub input_message_content: crate::enums::InputMessageContent,
5672    }
5673    /// Represents a user contact
5674    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
5675    pub struct InputInlineQueryResultContact {
5676        /// Unique identifier of the query result
5677        pub id: String,
5678        /// User contact
5679        pub contact: crate::types::Contact,
5680        /// URL of the result thumbnail, if it exists
5681        pub thumbnail_url: String,
5682        /// Thumbnail width, if known
5683        pub thumbnail_width: i32,
5684        /// Thumbnail height, if known
5685        pub thumbnail_height: i32,
5686        /// The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null
5687        pub reply_markup: Option<crate::enums::ReplyMarkup>,
5688        /// The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageInvoice, inputMessageLocation, inputMessageVenue or inputMessageContact
5689        pub input_message_content: crate::enums::InputMessageContent,
5690    }
5691    /// Represents a link to a file
5692    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
5693    pub struct InputInlineQueryResultDocument {
5694        /// Unique identifier of the query result
5695        pub id: String,
5696        /// Title of the resulting file
5697        pub title: String,
5698        /// Short description of the result, if known
5699        pub description: String,
5700        /// URL of the file
5701        pub document_url: String,
5702        /// MIME type of the file content; only "application/pdf" and "application/zip" are currently allowed
5703        pub mime_type: String,
5704        /// The URL of the file thumbnail, if it exists
5705        pub thumbnail_url: String,
5706        /// Width of the thumbnail
5707        pub thumbnail_width: i32,
5708        /// Height of the thumbnail
5709        pub thumbnail_height: i32,
5710        /// The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null
5711        pub reply_markup: Option<crate::enums::ReplyMarkup>,
5712        /// The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageDocument, inputMessageInvoice, inputMessageLocation, inputMessageVenue or inputMessageContact
5713        pub input_message_content: crate::enums::InputMessageContent,
5714    }
5715    /// Represents a game
5716    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
5717    pub struct InputInlineQueryResultGame {
5718        /// Unique identifier of the query result
5719        pub id: String,
5720        /// Short name of the game
5721        pub game_short_name: String,
5722        /// The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null
5723        pub reply_markup: Option<crate::enums::ReplyMarkup>,
5724    }
5725    /// Represents a point on the map
5726    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
5727    pub struct InputInlineQueryResultLocation {
5728        /// Unique identifier of the query result
5729        pub id: String,
5730        /// Location result
5731        pub location: crate::types::Location,
5732        /// Amount of time relative to the message sent time until the location can be updated, in seconds
5733        pub live_period: i32,
5734        /// Title of the result
5735        pub title: String,
5736        /// URL of the result thumbnail, if it exists
5737        pub thumbnail_url: String,
5738        /// Thumbnail width, if known
5739        pub thumbnail_width: i32,
5740        /// Thumbnail height, if known
5741        pub thumbnail_height: i32,
5742        /// The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null
5743        pub reply_markup: Option<crate::enums::ReplyMarkup>,
5744        /// The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageInvoice, inputMessageLocation, inputMessageVenue or inputMessageContact
5745        pub input_message_content: crate::enums::InputMessageContent,
5746    }
5747    /// Represents link to a JPEG image
5748    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
5749    pub struct InputInlineQueryResultPhoto {
5750        /// Unique identifier of the query result
5751        pub id: String,
5752        /// Title of the result, if known
5753        pub title: String,
5754        /// A short description of the result, if known
5755        pub description: String,
5756        /// URL of the photo thumbnail, if it exists
5757        pub thumbnail_url: String,
5758        /// The URL of the JPEG photo (photo size must not exceed 5MB)
5759        pub photo_url: String,
5760        /// Width of the photo
5761        pub photo_width: i32,
5762        /// Height of the photo
5763        pub photo_height: i32,
5764        /// The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null
5765        pub reply_markup: Option<crate::enums::ReplyMarkup>,
5766        /// The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessagePhoto, inputMessageInvoice, inputMessageLocation, inputMessageVenue or inputMessageContact
5767        pub input_message_content: crate::enums::InputMessageContent,
5768    }
5769    /// Represents a link to a WEBP, TGS, or WEBM sticker
5770    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
5771    pub struct InputInlineQueryResultSticker {
5772        /// Unique identifier of the query result
5773        pub id: String,
5774        /// URL of the sticker thumbnail, if it exists
5775        pub thumbnail_url: String,
5776        /// The URL of the WEBP, TGS, or WEBM sticker (sticker file size must not exceed 5MB)
5777        pub sticker_url: String,
5778        /// Width of the sticker
5779        pub sticker_width: i32,
5780        /// Height of the sticker
5781        pub sticker_height: i32,
5782        /// The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null
5783        pub reply_markup: Option<crate::enums::ReplyMarkup>,
5784        /// The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageSticker, inputMessageInvoice, inputMessageLocation, inputMessageVenue or inputMessageContact
5785        pub input_message_content: crate::enums::InputMessageContent,
5786    }
5787    /// Represents information about a venue
5788    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
5789    pub struct InputInlineQueryResultVenue {
5790        /// Unique identifier of the query result
5791        pub id: String,
5792        /// Venue result
5793        pub venue: crate::types::Venue,
5794        /// URL of the result thumbnail, if it exists
5795        pub thumbnail_url: String,
5796        /// Thumbnail width, if known
5797        pub thumbnail_width: i32,
5798        /// Thumbnail height, if known
5799        pub thumbnail_height: i32,
5800        /// The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null
5801        pub reply_markup: Option<crate::enums::ReplyMarkup>,
5802        /// The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageInvoice, inputMessageLocation, inputMessageVenue or inputMessageContact
5803        pub input_message_content: crate::enums::InputMessageContent,
5804    }
5805    /// Represents a link to a page containing an embedded video player or a video file
5806    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
5807    pub struct InputInlineQueryResultVideo {
5808        /// Unique identifier of the query result
5809        pub id: String,
5810        /// Title of the result
5811        pub title: String,
5812        /// A short description of the result, if known
5813        pub description: String,
5814        /// The URL of the video thumbnail (JPEG), if it exists
5815        pub thumbnail_url: String,
5816        /// URL of the embedded video player or video file
5817        pub video_url: String,
5818        /// MIME type of the content of the video URL, only "text/html" or "video/mp4" are currently supported
5819        pub mime_type: String,
5820        /// Width of the video
5821        pub video_width: i32,
5822        /// Height of the video
5823        pub video_height: i32,
5824        /// Video duration, in seconds
5825        pub video_duration: i32,
5826        /// The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null
5827        pub reply_markup: Option<crate::enums::ReplyMarkup>,
5828        /// The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageVideo, inputMessageInvoice, inputMessageLocation, inputMessageVenue or inputMessageContact
5829        pub input_message_content: crate::enums::InputMessageContent,
5830    }
5831    /// Represents a link to an opus-encoded audio file within an OGG container, single channel audio
5832    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
5833    pub struct InputInlineQueryResultVoiceNote {
5834        /// Unique identifier of the query result
5835        pub id: String,
5836        /// Title of the voice note
5837        pub title: String,
5838        /// The URL of the voice note file
5839        pub voice_note_url: String,
5840        /// Duration of the voice note, in seconds
5841        pub voice_note_duration: i32,
5842        /// The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null
5843        pub reply_markup: Option<crate::enums::ReplyMarkup>,
5844        /// The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageVoiceNote, inputMessageInvoice, inputMessageLocation, inputMessageVenue or inputMessageContact
5845        pub input_message_content: crate::enums::InputMessageContent,
5846    }
5847    /// Represents a link to an article or web page
5848    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
5849    pub struct InlineQueryResultArticle {
5850        /// Unique identifier of the query result
5851        pub id: String,
5852        /// URL of the result, if it exists
5853        pub url: String,
5854        /// True, if the URL must be not shown
5855        pub hide_url: bool,
5856        /// Title of the result
5857        pub title: String,
5858        /// A short description of the result
5859        pub description: String,
5860        /// Result thumbnail in JPEG format; may be null
5861        pub thumbnail: Option<crate::types::Thumbnail>,
5862    }
5863    /// Represents a user contact
5864    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
5865    pub struct InlineQueryResultContact {
5866        /// Unique identifier of the query result
5867        pub id: String,
5868        /// A user contact
5869        pub contact: crate::types::Contact,
5870        /// Result thumbnail in JPEG format; may be null
5871        pub thumbnail: Option<crate::types::Thumbnail>,
5872    }
5873    /// Represents a point on the map
5874    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
5875    pub struct InlineQueryResultLocation {
5876        /// Unique identifier of the query result
5877        pub id: String,
5878        /// Location result
5879        pub location: crate::types::Location,
5880        /// Title of the result
5881        pub title: String,
5882        /// Result thumbnail in JPEG format; may be null
5883        pub thumbnail: Option<crate::types::Thumbnail>,
5884    }
5885    /// Represents information about a venue
5886    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
5887    pub struct InlineQueryResultVenue {
5888        /// Unique identifier of the query result
5889        pub id: String,
5890        /// Venue result
5891        pub venue: crate::types::Venue,
5892        /// Result thumbnail in JPEG format; may be null
5893        pub thumbnail: Option<crate::types::Thumbnail>,
5894    }
5895    /// Represents information about a game
5896    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
5897    pub struct InlineQueryResultGame {
5898        /// Unique identifier of the query result
5899        pub id: String,
5900        /// Game result
5901        pub game: crate::types::Game,
5902    }
5903    /// Represents an animation file
5904    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
5905    pub struct InlineQueryResultAnimation {
5906        /// Unique identifier of the query result
5907        pub id: String,
5908        /// Animation file
5909        pub animation: crate::types::Animation,
5910        /// Animation title
5911        pub title: String,
5912    }
5913    /// Represents an audio file
5914    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
5915    pub struct InlineQueryResultAudio {
5916        /// Unique identifier of the query result
5917        pub id: String,
5918        /// Audio file
5919        pub audio: crate::types::Audio,
5920    }
5921    /// Represents a document
5922    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
5923    pub struct InlineQueryResultDocument {
5924        /// Unique identifier of the query result
5925        pub id: String,
5926        /// Document
5927        pub document: crate::types::Document,
5928        /// Document title
5929        pub title: String,
5930        /// Document description
5931        pub description: String,
5932    }
5933    /// Represents a photo
5934    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
5935    pub struct InlineQueryResultPhoto {
5936        /// Unique identifier of the query result
5937        pub id: String,
5938        /// Photo
5939        pub photo: crate::types::Photo,
5940        /// Title of the result, if known
5941        pub title: String,
5942        /// A short description of the result, if known
5943        pub description: String,
5944    }
5945    /// Represents a sticker
5946    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
5947    pub struct InlineQueryResultSticker {
5948        /// Unique identifier of the query result
5949        pub id: String,
5950        /// Sticker
5951        pub sticker: crate::types::Sticker,
5952    }
5953    /// Represents a video
5954    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
5955    pub struct InlineQueryResultVideo {
5956        /// Unique identifier of the query result
5957        pub id: String,
5958        /// Video
5959        pub video: crate::types::Video,
5960        /// Title of the video
5961        pub title: String,
5962        /// Description of the video
5963        pub description: String,
5964    }
5965    /// Represents a voice note
5966    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
5967    pub struct InlineQueryResultVoiceNote {
5968        /// Unique identifier of the query result
5969        pub id: String,
5970        /// Voice note
5971        pub voice_note: crate::types::VoiceNote,
5972        /// Title of the voice note
5973        pub title: String,
5974    }
5975    /// Describes the button that opens a private chat with the bot and sends a start message to the bot with the given parameter
5976    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
5977    pub struct InlineQueryResultsButtonTypeStartBot {
5978        /// The parameter for the bot start message
5979        pub parameter: String,
5980    }
5981    /// Describes the button that opens a Web App by calling getWebAppUrl
5982    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
5983    pub struct InlineQueryResultsButtonTypeWebApp {
5984        /// An HTTP URL to pass to getWebAppUrl
5985        pub url: String,
5986    }
5987    /// Represents a button to be shown above inline query results
5988    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
5989    pub struct InlineQueryResultsButton {
5990        /// The text of the button
5991        pub text: String,
5992        /// Type of the button
5993        pub r#type: crate::enums::InlineQueryResultsButtonType,
5994    }
5995    /// Represents the results of the inline query. Use sendInlineQueryResultMessage to send the result of the query
5996    #[serde_as]
5997    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
5998    pub struct InlineQueryResults {
5999        /// Unique identifier of the inline query
6000        #[serde_as(as = "DisplayFromStr")]
6001        pub inline_query_id: i64,
6002        /// Button to be shown above inline query results; may be null
6003        pub button: Option<crate::types::InlineQueryResultsButton>,
6004        /// Results of the query
6005        pub results: Vec<crate::enums::InlineQueryResult>,
6006        /// The offset for the next request. If empty, there are no more results
6007        pub next_offset: String,
6008    }
6009    /// The payload for a general callback button
6010    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
6011    pub struct CallbackQueryPayloadData {
6012        /// Data that was attached to the callback button
6013        pub data: String,
6014    }
6015    /// The payload for a callback button requiring password
6016    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
6017    pub struct CallbackQueryPayloadDataWithPassword {
6018        /// The 2-step verification password for the current user
6019        pub password: String,
6020        /// Data that was attached to the callback button
6021        pub data: String,
6022    }
6023    /// The payload for a game callback button
6024    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
6025    pub struct CallbackQueryPayloadGame {
6026        /// A short name of the game that was attached to the callback button
6027        pub game_short_name: String,
6028    }
6029    /// Contains a bot's answer to a callback query
6030    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
6031    pub struct CallbackQueryAnswer {
6032        /// Text of the answer
6033        pub text: String,
6034        /// True, if an alert must be shown to the user instead of a toast notification
6035        pub show_alert: bool,
6036        /// URL to be opened
6037        pub url: String,
6038    }
6039    /// Contains the result of a custom request
6040    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
6041    pub struct CustomRequestResult {
6042        /// A JSON-serialized result
6043        pub result: String,
6044    }
6045    /// Contains one row of the game high score table
6046    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
6047    pub struct GameHighScore {
6048        /// Position in the high score table
6049        pub position: i32,
6050        /// User identifier
6051        pub user_id: i64,
6052        /// User score
6053        pub score: i32,
6054    }
6055    /// Contains a list of game high scores
6056    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
6057    pub struct GameHighScores {
6058        /// A list of game high scores
6059        pub scores: Vec<crate::types::GameHighScore>,
6060    }
6061    /// A message was edited
6062    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
6063    pub struct ChatEventMessageEdited {
6064        /// The original message before the edit
6065        pub old_message: crate::types::Message,
6066        /// The message after it was edited
6067        pub new_message: crate::types::Message,
6068    }
6069    /// A message was deleted
6070    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
6071    pub struct ChatEventMessageDeleted {
6072        /// Deleted message
6073        pub message: crate::types::Message,
6074        /// True, if the message deletion can be reported via reportSupergroupAntiSpamFalsePositive
6075        pub can_report_anti_spam_false_positive: bool,
6076    }
6077    /// A message was pinned
6078    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
6079    pub struct ChatEventMessagePinned {
6080        /// Pinned message
6081        pub message: crate::types::Message,
6082    }
6083    /// A message was unpinned
6084    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
6085    pub struct ChatEventMessageUnpinned {
6086        /// Unpinned message
6087        pub message: crate::types::Message,
6088    }
6089    /// A poll in a message was stopped
6090    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
6091    pub struct ChatEventPollStopped {
6092        /// The message with the poll
6093        pub message: crate::types::Message,
6094    }
6095    /// A new member joined the chat via an invite link
6096    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
6097    pub struct ChatEventMemberJoinedByInviteLink {
6098        /// Invite link used to join the chat
6099        pub invite_link: crate::types::ChatInviteLink,
6100        /// True, if the user has joined the chat using an invite link for a chat folder
6101        pub via_chat_folder_invite_link: bool,
6102    }
6103    /// A new member was accepted to the chat by an administrator
6104    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
6105    pub struct ChatEventMemberJoinedByRequest {
6106        /// User identifier of the chat administrator, approved user join request
6107        pub approver_user_id: i64,
6108        /// Invite link used to join the chat; may be null
6109        pub invite_link: Option<crate::types::ChatInviteLink>,
6110    }
6111    /// A new chat member was invited
6112    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
6113    pub struct ChatEventMemberInvited {
6114        /// New member user identifier
6115        pub user_id: i64,
6116        /// New member status
6117        pub status: crate::enums::ChatMemberStatus,
6118    }
6119    /// A chat member has gained/lost administrator status, or the list of their administrator privileges has changed
6120    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
6121    pub struct ChatEventMemberPromoted {
6122        /// Affected chat member user identifier
6123        pub user_id: i64,
6124        /// Previous status of the chat member
6125        pub old_status: crate::enums::ChatMemberStatus,
6126        /// New status of the chat member
6127        pub new_status: crate::enums::ChatMemberStatus,
6128    }
6129    /// A chat member was restricted/unrestricted or banned/unbanned, or the list of their restrictions has changed
6130    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
6131    pub struct ChatEventMemberRestricted {
6132        /// Affected chat member identifier
6133        pub member_id: crate::enums::MessageSender,
6134        /// Previous status of the chat member
6135        pub old_status: crate::enums::ChatMemberStatus,
6136        /// New status of the chat member
6137        pub new_status: crate::enums::ChatMemberStatus,
6138    }
6139    /// The chat available reactions were changed
6140    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
6141    pub struct ChatEventAvailableReactionsChanged {
6142        /// Previous chat available reactions
6143        pub old_available_reactions: crate::enums::ChatAvailableReactions,
6144        /// New chat available reactions
6145        pub new_available_reactions: crate::enums::ChatAvailableReactions,
6146    }
6147    /// The chat description was changed
6148    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
6149    pub struct ChatEventDescriptionChanged {
6150        /// Previous chat description
6151        pub old_description: String,
6152        /// New chat description
6153        pub new_description: String,
6154    }
6155    /// The linked chat of a supergroup was changed
6156    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
6157    pub struct ChatEventLinkedChatChanged {
6158        /// Previous supergroup linked chat identifier
6159        pub old_linked_chat_id: i64,
6160        /// New supergroup linked chat identifier
6161        pub new_linked_chat_id: i64,
6162    }
6163    /// The supergroup location was changed
6164    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
6165    pub struct ChatEventLocationChanged {
6166        /// Previous location; may be null
6167        pub old_location: Option<crate::types::ChatLocation>,
6168        /// New location; may be null
6169        pub new_location: Option<crate::types::ChatLocation>,
6170    }
6171    /// The message auto-delete timer was changed
6172    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
6173    pub struct ChatEventMessageAutoDeleteTimeChanged {
6174        /// Previous value of message_auto_delete_time
6175        pub old_message_auto_delete_time: i32,
6176        /// New value of message_auto_delete_time
6177        pub new_message_auto_delete_time: i32,
6178    }
6179    /// The chat permissions was changed
6180    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
6181    pub struct ChatEventPermissionsChanged {
6182        /// Previous chat permissions
6183        pub old_permissions: crate::types::ChatPermissions,
6184        /// New chat permissions
6185        pub new_permissions: crate::types::ChatPermissions,
6186    }
6187    /// The chat photo was changed
6188    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
6189    pub struct ChatEventPhotoChanged {
6190        /// Previous chat photo value; may be null
6191        pub old_photo: Option<crate::types::ChatPhoto>,
6192        /// New chat photo value; may be null
6193        pub new_photo: Option<crate::types::ChatPhoto>,
6194    }
6195    /// The slow_mode_delay setting of a supergroup was changed
6196    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
6197    pub struct ChatEventSlowModeDelayChanged {
6198        /// Previous value of slow_mode_delay, in seconds
6199        pub old_slow_mode_delay: i32,
6200        /// New value of slow_mode_delay, in seconds
6201        pub new_slow_mode_delay: i32,
6202    }
6203    /// The supergroup sticker set was changed
6204    #[serde_as]
6205    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
6206    pub struct ChatEventStickerSetChanged {
6207        /// Previous identifier of the chat sticker set; 0 if none
6208        #[serde_as(as = "DisplayFromStr")]
6209        pub old_sticker_set_id: i64,
6210        /// New identifier of the chat sticker set; 0 if none
6211        #[serde_as(as = "DisplayFromStr")]
6212        pub new_sticker_set_id: i64,
6213    }
6214    /// The chat title was changed
6215    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
6216    pub struct ChatEventTitleChanged {
6217        /// Previous chat title
6218        pub old_title: String,
6219        /// New chat title
6220        pub new_title: String,
6221    }
6222    /// The chat editable username was changed
6223    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
6224    pub struct ChatEventUsernameChanged {
6225        /// Previous chat username
6226        pub old_username: String,
6227        /// New chat username
6228        pub new_username: String,
6229    }
6230    /// The chat active usernames were changed
6231    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
6232    pub struct ChatEventActiveUsernamesChanged {
6233        /// Previous list of active usernames
6234        pub old_usernames: Vec<String>,
6235        /// New list of active usernames
6236        pub new_usernames: Vec<String>,
6237    }
6238    /// The has_protected_content setting of a channel was toggled
6239    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
6240    pub struct ChatEventHasProtectedContentToggled {
6241        /// New value of has_protected_content
6242        pub has_protected_content: bool,
6243    }
6244    /// The can_invite_users permission of a supergroup chat was toggled
6245    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
6246    pub struct ChatEventInvitesToggled {
6247        /// New value of can_invite_users permission
6248        pub can_invite_users: bool,
6249    }
6250    /// The is_all_history_available setting of a supergroup was toggled
6251    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
6252    pub struct ChatEventIsAllHistoryAvailableToggled {
6253        /// New value of is_all_history_available
6254        pub is_all_history_available: bool,
6255    }
6256    /// The has_aggressive_anti_spam_enabled setting of a supergroup was toggled
6257    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
6258    pub struct ChatEventHasAggressiveAntiSpamEnabledToggled {
6259        /// New value of has_aggressive_anti_spam_enabled
6260        pub has_aggressive_anti_spam_enabled: bool,
6261    }
6262    /// The sign_messages setting of a channel was toggled
6263    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
6264    pub struct ChatEventSignMessagesToggled {
6265        /// New value of sign_messages
6266        pub sign_messages: bool,
6267    }
6268    /// A chat invite link was edited
6269    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
6270    pub struct ChatEventInviteLinkEdited {
6271        /// Previous information about the invite link
6272        pub old_invite_link: crate::types::ChatInviteLink,
6273        /// New information about the invite link
6274        pub new_invite_link: crate::types::ChatInviteLink,
6275    }
6276    /// A chat invite link was revoked
6277    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
6278    pub struct ChatEventInviteLinkRevoked {
6279        /// The invite link
6280        pub invite_link: crate::types::ChatInviteLink,
6281    }
6282    /// A revoked chat invite link was deleted
6283    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
6284    pub struct ChatEventInviteLinkDeleted {
6285        /// The invite link
6286        pub invite_link: crate::types::ChatInviteLink,
6287    }
6288    /// A video chat was created
6289    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
6290    pub struct ChatEventVideoChatCreated {
6291        /// Identifier of the video chat. The video chat can be received through the method getGroupCall
6292        pub group_call_id: i32,
6293    }
6294    /// A video chat was ended
6295    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
6296    pub struct ChatEventVideoChatEnded {
6297        /// Identifier of the video chat. The video chat can be received through the method getGroupCall
6298        pub group_call_id: i32,
6299    }
6300    /// The mute_new_participants setting of a video chat was toggled
6301    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
6302    pub struct ChatEventVideoChatMuteNewParticipantsToggled {
6303        /// New value of the mute_new_participants setting
6304        pub mute_new_participants: bool,
6305    }
6306    /// A video chat participant was muted or unmuted
6307    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
6308    pub struct ChatEventVideoChatParticipantIsMutedToggled {
6309        /// Identifier of the affected group call participant
6310        pub participant_id: crate::enums::MessageSender,
6311        /// New value of is_muted
6312        pub is_muted: bool,
6313    }
6314    /// A video chat participant volume level was changed
6315    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
6316    pub struct ChatEventVideoChatParticipantVolumeLevelChanged {
6317        /// Identifier of the affected group call participant
6318        pub participant_id: crate::enums::MessageSender,
6319        /// New value of volume_level; 1-20000 in hundreds of percents
6320        pub volume_level: i32,
6321    }
6322    /// The is_forum setting of a channel was toggled
6323    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
6324    pub struct ChatEventIsForumToggled {
6325        /// New value of is_forum
6326        pub is_forum: bool,
6327    }
6328    /// A new forum topic was created
6329    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
6330    pub struct ChatEventForumTopicCreated {
6331        /// Information about the topic
6332        pub topic_info: crate::types::ForumTopicInfo,
6333    }
6334    /// A forum topic was edited
6335    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
6336    pub struct ChatEventForumTopicEdited {
6337        /// Old information about the topic
6338        pub old_topic_info: crate::types::ForumTopicInfo,
6339        /// New information about the topic
6340        pub new_topic_info: crate::types::ForumTopicInfo,
6341    }
6342    /// A forum topic was closed or reopened
6343    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
6344    pub struct ChatEventForumTopicToggleIsClosed {
6345        /// New information about the topic
6346        pub topic_info: crate::types::ForumTopicInfo,
6347    }
6348    /// The General forum topic was hidden or unhidden
6349    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
6350    pub struct ChatEventForumTopicToggleIsHidden {
6351        /// New information about the topic
6352        pub topic_info: crate::types::ForumTopicInfo,
6353    }
6354    /// A forum topic was deleted
6355    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
6356    pub struct ChatEventForumTopicDeleted {
6357        /// Information about the topic
6358        pub topic_info: crate::types::ForumTopicInfo,
6359    }
6360    /// A pinned forum topic was changed
6361    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
6362    pub struct ChatEventForumTopicPinned {
6363        /// Information about the old pinned topic; may be null
6364        pub old_topic_info: Option<crate::types::ForumTopicInfo>,
6365        /// Information about the new pinned topic; may be null
6366        pub new_topic_info: Option<crate::types::ForumTopicInfo>,
6367    }
6368    /// Represents a chat event
6369    #[serde_as]
6370    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
6371    pub struct ChatEvent {
6372        /// Chat event identifier
6373        #[serde_as(as = "DisplayFromStr")]
6374        pub id: i64,
6375        /// Point in time (Unix timestamp) when the event happened
6376        pub date: i32,
6377        /// Identifier of the user or chat who performed the action
6378        pub member_id: crate::enums::MessageSender,
6379        /// The action
6380        pub action: crate::enums::ChatEventAction,
6381    }
6382    /// Contains a list of chat events
6383    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
6384    pub struct ChatEvents {
6385        /// List of events
6386        pub events: Vec<crate::types::ChatEvent>,
6387    }
6388    /// Represents a set of filters used to obtain a chat event log
6389    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
6390    pub struct ChatEventLogFilters {
6391        /// True, if message edits need to be returned
6392        pub message_edits: bool,
6393        /// True, if message deletions need to be returned
6394        pub message_deletions: bool,
6395        /// True, if pin/unpin events need to be returned
6396        pub message_pins: bool,
6397        /// True, if members joining events need to be returned
6398        pub member_joins: bool,
6399        /// True, if members leaving events need to be returned
6400        pub member_leaves: bool,
6401        /// True, if invited member events need to be returned
6402        pub member_invites: bool,
6403        /// True, if member promotion/demotion events need to be returned
6404        pub member_promotions: bool,
6405        /// True, if member restricted/unrestricted/banned/unbanned events need to be returned
6406        pub member_restrictions: bool,
6407        /// True, if changes in chat information need to be returned
6408        pub info_changes: bool,
6409        /// True, if changes in chat settings need to be returned
6410        pub setting_changes: bool,
6411        /// True, if changes to invite links need to be returned
6412        pub invite_link_changes: bool,
6413        /// True, if video chat actions need to be returned
6414        pub video_chat_changes: bool,
6415        /// True, if forum-related actions need to be returned
6416        pub forum_changes: bool,
6417    }
6418    /// An ordinary language pack string
6419    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
6420    pub struct LanguagePackStringValueOrdinary {
6421        /// String value
6422        pub value: String,
6423    }
6424    /// A language pack string which has different forms based on the number of some object it mentions. See https:www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html for more information
6425    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
6426    pub struct LanguagePackStringValuePluralized {
6427        /// Value for zero objects
6428        pub zero_value: String,
6429        /// Value for one object
6430        pub one_value: String,
6431        /// Value for two objects
6432        pub two_value: String,
6433        /// Value for few objects
6434        pub few_value: String,
6435        /// Value for many objects
6436        pub many_value: String,
6437        /// Default value
6438        pub other_value: String,
6439    }
6440    /// Represents one language pack string
6441    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
6442    pub struct LanguagePackString {
6443        /// String key
6444        pub key: String,
6445        /// String value; pass null if the string needs to be taken from the built-in English language pack
6446        pub value: Option<crate::enums::LanguagePackStringValue>,
6447    }
6448    /// Contains a list of language pack strings
6449    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
6450    pub struct LanguagePackStrings {
6451        /// A list of language pack strings
6452        pub strings: Vec<crate::types::LanguagePackString>,
6453    }
6454    /// Contains information about a language pack
6455    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
6456    pub struct LanguagePackInfo {
6457        /// Unique language pack identifier
6458        pub id: String,
6459        /// Identifier of a base language pack; may be empty. If a string is missed in the language pack, then it must be fetched from base language pack. Unsupported in custom language packs
6460        pub base_language_pack_id: String,
6461        /// Language name
6462        pub name: String,
6463        /// Name of the language in that language
6464        pub native_name: String,
6465        /// A language code to be used to apply plural forms. See https:www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html for more information
6466        pub plural_code: String,
6467        /// True, if the language pack is official
6468        pub is_official: bool,
6469        /// True, if the language pack strings are RTL
6470        pub is_rtl: bool,
6471        /// True, if the language pack is a beta language pack
6472        pub is_beta: bool,
6473        /// True, if the language pack is installed by the current user
6474        pub is_installed: bool,
6475        /// Total number of non-deleted strings from the language pack
6476        pub total_string_count: i32,
6477        /// Total number of translated strings from the language pack
6478        pub translated_string_count: i32,
6479        /// Total number of non-deleted strings from the language pack available locally
6480        pub local_string_count: i32,
6481        /// Link to language translation interface; empty for custom local language packs
6482        pub translation_url: String,
6483    }
6484    /// Contains information about the current localization target
6485    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
6486    pub struct LocalizationTargetInfo {
6487        /// List of available language packs for this application
6488        pub language_packs: Vec<crate::types::LanguagePackInfo>,
6489    }
6490    /// Contains information about a limit, increased for Premium users
6491    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
6492    pub struct PremiumLimit {
6493        /// The type of the limit
6494        pub r#type: crate::enums::PremiumLimitType,
6495        /// Default value of the limit
6496        pub default_value: i32,
6497        /// Value of the limit for Premium users
6498        pub premium_value: i32,
6499    }
6500    /// Contains information about features, available to Premium users
6501    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
6502    pub struct PremiumFeatures {
6503        /// The list of available features
6504        pub features: Vec<crate::enums::PremiumFeature>,
6505        /// The list of limits, increased for Premium users
6506        pub limits: Vec<crate::types::PremiumLimit>,
6507        /// An internal link to be opened to pay for Telegram Premium if store payment isn't possible; may be null if direct payment isn't available
6508        pub payment_link: Option<crate::enums::InternalLinkType>,
6509    }
6510    /// A limit was exceeded
6511    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
6512    pub struct PremiumSourceLimitExceeded {
6513        /// Type of the exceeded limit
6514        pub limit_type: crate::enums::PremiumLimitType,
6515    }
6516    /// A user tried to use a Premium feature
6517    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
6518    pub struct PremiumSourceFeature {
6519        /// The used feature
6520        pub feature: crate::enums::PremiumFeature,
6521    }
6522    /// A user tried to use a Premium story feature
6523    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
6524    pub struct PremiumSourceStoryFeature {
6525        /// The used feature
6526        pub feature: crate::enums::PremiumStoryFeature,
6527    }
6528    /// A user opened an internal link of the type internalLinkTypePremiumFeatures
6529    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
6530    pub struct PremiumSourceLink {
6531        /// The referrer from the link
6532        pub referrer: String,
6533    }
6534    /// Describes a promotion animation for a Premium feature
6535    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
6536    pub struct PremiumFeaturePromotionAnimation {
6537        /// Premium feature
6538        pub feature: crate::enums::PremiumFeature,
6539        /// Promotion animation for the feature
6540        pub animation: crate::types::Animation,
6541    }
6542    /// Contains state of Telegram Premium subscription and promotion videos for Premium features
6543    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
6544    pub struct PremiumState {
6545        /// Text description of the state of the current Premium subscription; may be empty if the current user has no Telegram Premium subscription
6546        pub state: crate::types::FormattedText,
6547        /// The list of available options for buying Telegram Premium
6548        pub payment_options: Vec<crate::types::PremiumStatePaymentOption>,
6549        /// The list of available promotion animations for Premium features
6550        pub animations: Vec<crate::types::PremiumFeaturePromotionAnimation>,
6551    }
6552    /// The user subscribed to Telegram Premium
6553    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
6554    pub struct StorePaymentPurposePremiumSubscription {
6555        /// Pass true if this is a restore of a Telegram Premium purchase; only for App Store
6556        pub is_restore: bool,
6557        /// Pass true if this is an upgrade from a monthly subscription to early subscription; only for App Store
6558        pub is_upgrade: bool,
6559    }
6560    /// The user gifted Telegram Premium to another user
6561    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
6562    pub struct StorePaymentPurposeGiftedPremium {
6563        /// Identifier of the user for which Premium was gifted
6564        pub user_id: i64,
6565        /// ISO 4217 currency code of the payment currency
6566        pub currency: String,
6567        /// Paid amount, in the smallest units of the currency
6568        pub amount: i64,
6569    }
6570    /// A token for Firebase Cloud Messaging
6571    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
6572    pub struct DeviceTokenFirebaseCloudMessaging {
6573        /// Device registration token; may be empty to deregister a device
6574        pub token: String,
6575        /// True, if push notifications must be additionally encrypted
6576        pub encrypt: bool,
6577    }
6578    /// A token for Apple Push Notification service
6579    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
6580    pub struct DeviceTokenApplePush {
6581        /// Device token; may be empty to deregister a device
6582        pub device_token: String,
6583        /// True, if App Sandbox is enabled
6584        pub is_app_sandbox: bool,
6585    }
6586    /// A token for Apple Push Notification service VoIP notifications
6587    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
6588    pub struct DeviceTokenApplePushVoIp {
6589        /// Device token; may be empty to deregister a device
6590        pub device_token: String,
6591        /// True, if App Sandbox is enabled
6592        pub is_app_sandbox: bool,
6593        /// True, if push notifications must be additionally encrypted
6594        pub encrypt: bool,
6595    }
6596    /// A token for Windows Push Notification Services
6597    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
6598    pub struct DeviceTokenWindowsPush {
6599        /// The access token that will be used to send notifications; may be empty to deregister a device
6600        pub access_token: String,
6601    }
6602    /// A token for Microsoft Push Notification Service
6603    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
6604    pub struct DeviceTokenMicrosoftPush {
6605        /// Push notification channel URI; may be empty to deregister a device
6606        pub channel_uri: String,
6607    }
6608    /// A token for Microsoft Push Notification Service VoIP channel
6609    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
6610    pub struct DeviceTokenMicrosoftPushVoIp {
6611        /// Push notification channel URI; may be empty to deregister a device
6612        pub channel_uri: String,
6613    }
6614    /// A token for web Push API
6615    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
6616    pub struct DeviceTokenWebPush {
6617        /// Absolute URL exposed by the push service where the application server can send push messages; may be empty to deregister a device
6618        pub endpoint: String,
6619        /// Base64url-encoded P-256 elliptic curve Diffie-Hellman public key
6620        pub p256dh_base64url: String,
6621        /// Base64url-encoded authentication secret
6622        pub auth_base64url: String,
6623    }
6624    /// A token for Simple Push API for Firefox OS
6625    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
6626    pub struct DeviceTokenSimplePush {
6627        /// Absolute URL exposed by the push service where the application server can send push messages; may be empty to deregister a device
6628        pub endpoint: String,
6629    }
6630    /// A token for Ubuntu Push Client service
6631    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
6632    pub struct DeviceTokenUbuntuPush {
6633        /// Token; may be empty to deregister a device
6634        pub token: String,
6635    }
6636    /// A token for BlackBerry Push Service
6637    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
6638    pub struct DeviceTokenBlackBerryPush {
6639        /// Token; may be empty to deregister a device
6640        pub token: String,
6641    }
6642    /// A token for Tizen Push Service
6643    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
6644    pub struct DeviceTokenTizenPush {
6645        /// Push service registration identifier; may be empty to deregister a device
6646        pub reg_id: String,
6647    }
6648    /// A token for HUAWEI Push Service
6649    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
6650    pub struct DeviceTokenHuaweiPush {
6651        /// Device registration token; may be empty to deregister a device
6652        pub token: String,
6653        /// True, if push notifications must be additionally encrypted
6654        pub encrypt: bool,
6655    }
6656    /// Contains a globally unique push receiver identifier, which can be used to identify which account has received a push notification
6657    #[serde_as]
6658    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
6659    pub struct PushReceiverId {
6660        /// The globally unique identifier of push notification subscription
6661        #[serde_as(as = "DisplayFromStr")]
6662        pub id: i64,
6663    }
6664    /// Describes a solid fill of a background
6665    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
6666    pub struct BackgroundFillSolid {
6667        /// A color of the background in the RGB24 format
6668        pub color: i32,
6669    }
6670    /// Describes a gradient fill of a background
6671    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
6672    pub struct BackgroundFillGradient {
6673        /// A top color of the background in the RGB24 format
6674        pub top_color: i32,
6675        /// A bottom color of the background in the RGB24 format
6676        pub bottom_color: i32,
6677        /// Clockwise rotation angle of the gradient, in degrees; 0-359. Must always be divisible by 45
6678        pub rotation_angle: i32,
6679    }
6680    /// Describes a freeform gradient fill of a background
6681    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
6682    pub struct BackgroundFillFreeformGradient {
6683        /// A list of 3 or 4 colors of the freeform gradients in the RGB24 format
6684        pub colors: Vec<i32>,
6685    }
6686    /// A wallpaper in JPEG format
6687    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
6688    pub struct BackgroundTypeWallpaper {
6689        /// True, if the wallpaper must be downscaled to fit in 450x450 square and then box-blurred with radius 12
6690        pub is_blurred: bool,
6691        /// True, if the background needs to be slightly moved when device is tilted
6692        pub is_moving: bool,
6693    }
6694    /// A PNG or TGV (gzipped subset of SVG with MIME type "application/x-tgwallpattern") pattern to be combined with the background fill chosen by the user
6695    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
6696    pub struct BackgroundTypePattern {
6697        /// Fill of the background
6698        pub fill: crate::enums::BackgroundFill,
6699        /// Intensity of the pattern when it is shown above the filled background; 0-100.
6700        pub intensity: i32,
6701        /// True, if the background fill must be applied only to the pattern itself. All other pixels are black in this case. For dark themes only
6702        pub is_inverted: bool,
6703        /// True, if the background needs to be slightly moved when device is tilted
6704        pub is_moving: bool,
6705    }
6706    /// A filled background
6707    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
6708    pub struct BackgroundTypeFill {
6709        /// The background fill
6710        pub fill: crate::enums::BackgroundFill,
6711    }
6712    /// A background from a local file
6713    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
6714    pub struct InputBackgroundLocal {
6715        /// Background file to use. Only inputFileLocal and inputFileGenerated are supported. The file must be in JPEG format for wallpapers and in PNG format for patterns
6716        pub background: crate::enums::InputFile,
6717    }
6718    /// A background from the server
6719    #[serde_as]
6720    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
6721    pub struct InputBackgroundRemote {
6722        /// The background identifier
6723        #[serde_as(as = "DisplayFromStr")]
6724        pub background_id: i64,
6725    }
6726    /// A background previously set in the chat; for chat backgrounds only
6727    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
6728    pub struct InputBackgroundPrevious {
6729        /// Identifier of the message with the background
6730        pub message_id: i64,
6731    }
6732    /// Describes theme settings
6733    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
6734    pub struct ThemeSettings {
6735        /// Theme accent color in ARGB format
6736        pub accent_color: i32,
6737        /// The background to be used in chats; may be null
6738        pub background: Option<crate::types::Background>,
6739        /// The fill to be used as a background for outgoing messages
6740        pub outgoing_message_fill: crate::enums::BackgroundFill,
6741        /// If true, the freeform gradient fill needs to be animated on every sent message
6742        pub animate_outgoing_message_fill: bool,
6743        /// Accent color of outgoing messages in ARGB format
6744        pub outgoing_message_accent_color: i32,
6745    }
6746    /// Describes a chat theme
6747    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
6748    pub struct ChatTheme {
6749        /// Theme name
6750        pub name: String,
6751        /// Theme settings for a light chat theme
6752        pub light_settings: crate::types::ThemeSettings,
6753        /// Theme settings for a dark chat theme
6754        pub dark_settings: crate::types::ThemeSettings,
6755    }
6756    /// Contains a list of hashtags
6757    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
6758    pub struct Hashtags {
6759        /// A list of hashtags
6760        pub hashtags: Vec<String>,
6761    }
6762    /// The weekly limit for the number of posted stories exceeded. The user needs to buy Telegram Premium or wait specified time
6763    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
6764    pub struct CanSendStoryResultWeeklyLimitExceeded {
6765        /// Time left before the user can send the next story
6766        pub retry_after: i32,
6767    }
6768    /// The monthly limit for the number of posted stories exceeded. The user needs to buy Telegram Premium or wait specified time
6769    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
6770    pub struct CanSendStoryResultMonthlyLimitExceeded {
6771        /// Time left before the user can send the next story
6772        pub retry_after: i32,
6773    }
6774    /// The chat can be boosted
6775    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
6776    pub struct CanBoostChatResultOk {
6777        /// Identifier of the currently boosted chat from which boost will be removed; 0 if none
6778        pub currently_boosted_chat_id: i64,
6779    }
6780    /// The user must wait the specified time before the boost can be moved to another chat
6781    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
6782    pub struct CanBoostChatResultWaitNeeded {
6783        /// Time left before the user can boost another chat
6784        pub retry_after: i32,
6785    }
6786    /// The 2-step verification was enabled recently, user needs to wait
6787    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
6788    pub struct CanTransferOwnershipResultPasswordTooFresh {
6789        /// Time left before the session can be used to transfer ownership of a chat, in seconds
6790        pub retry_after: i32,
6791    }
6792    /// The session was created recently, user needs to wait
6793    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
6794    pub struct CanTransferOwnershipResultSessionTooFresh {
6795        /// Time left before the session can be used to transfer ownership of a chat, in seconds
6796        pub retry_after: i32,
6797    }
6798    /// The password reset request is pending
6799    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
6800    pub struct ResetPasswordResultPending {
6801        /// Point in time (Unix timestamp) after which the password can be reset immediately using resetPassword
6802        pub pending_reset_date: i32,
6803    }
6804    /// The password reset request was declined
6805    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
6806    pub struct ResetPasswordResultDeclined {
6807        /// Point in time (Unix timestamp) when the password reset can be retried
6808        pub retry_date: i32,
6809    }
6810    /// The messages was exported from a private chat
6811    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
6812    pub struct MessageFileTypePrivate {
6813        /// Name of the other party; may be empty if unrecognized
6814        pub name: String,
6815    }
6816    /// The messages was exported from a group chat
6817    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
6818    pub struct MessageFileTypeGroup {
6819        /// Title of the group chat; may be empty if unrecognized
6820        pub title: String,
6821    }
6822    /// A general message with hidden content
6823    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
6824    pub struct PushMessageContentHidden {
6825        /// True, if the message is a pinned message with the specified content
6826        pub is_pinned: bool,
6827    }
6828    /// An animation message (GIF-style).
6829    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
6830    pub struct PushMessageContentAnimation {
6831        /// Message content; may be null
6832        pub animation: Option<crate::types::Animation>,
6833        /// Animation caption
6834        pub caption: String,
6835        /// True, if the message is a pinned message with the specified content
6836        pub is_pinned: bool,
6837    }
6838    /// An audio message
6839    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
6840    pub struct PushMessageContentAudio {
6841        /// Message content; may be null
6842        pub audio: Option<crate::types::Audio>,
6843        /// True, if the message is a pinned message with the specified content
6844        pub is_pinned: bool,
6845    }
6846    /// A message with a user contact
6847    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
6848    pub struct PushMessageContentContact {
6849        /// Contact's name
6850        pub name: String,
6851        /// True, if the message is a pinned message with the specified content
6852        pub is_pinned: bool,
6853    }
6854    /// A document message (a general file)
6855    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
6856    pub struct PushMessageContentDocument {
6857        /// Message content; may be null
6858        pub document: Option<crate::types::Document>,
6859        /// True, if the message is a pinned message with the specified content
6860        pub is_pinned: bool,
6861    }
6862    /// A message with a game
6863    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
6864    pub struct PushMessageContentGame {
6865        /// Game title, empty for pinned game message
6866        pub title: String,
6867        /// True, if the message is a pinned message with the specified content
6868        pub is_pinned: bool,
6869    }
6870    /// A new high score was achieved in a game
6871    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
6872    pub struct PushMessageContentGameScore {
6873        /// Game title, empty for pinned message
6874        pub title: String,
6875        /// New score, 0 for pinned message
6876        pub score: i32,
6877        /// True, if the message is a pinned message with the specified content
6878        pub is_pinned: bool,
6879    }
6880    /// A message with an invoice from a bot
6881    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
6882    pub struct PushMessageContentInvoice {
6883        /// Product price
6884        pub price: String,
6885        /// True, if the message is a pinned message with the specified content
6886        pub is_pinned: bool,
6887    }
6888    /// A message with a location
6889    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
6890    pub struct PushMessageContentLocation {
6891        /// True, if the location is live
6892        pub is_live: bool,
6893        /// True, if the message is a pinned message with the specified content
6894        pub is_pinned: bool,
6895    }
6896    /// A photo message
6897    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
6898    pub struct PushMessageContentPhoto {
6899        /// Message content; may be null
6900        pub photo: Option<crate::types::Photo>,
6901        /// Photo caption
6902        pub caption: String,
6903        /// True, if the photo is secret
6904        pub is_secret: bool,
6905        /// True, if the message is a pinned message with the specified content
6906        pub is_pinned: bool,
6907    }
6908    /// A message with a poll
6909    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
6910    pub struct PushMessageContentPoll {
6911        /// Poll question
6912        pub question: String,
6913        /// True, if the poll is regular and not in quiz mode
6914        pub is_regular: bool,
6915        /// True, if the message is a pinned message with the specified content
6916        pub is_pinned: bool,
6917    }
6918    /// A message with a sticker
6919    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
6920    pub struct PushMessageContentSticker {
6921        /// Message content; may be null
6922        pub sticker: Option<crate::types::Sticker>,
6923        /// Emoji corresponding to the sticker; may be empty
6924        pub emoji: String,
6925        /// True, if the message is a pinned message with the specified content
6926        pub is_pinned: bool,
6927    }
6928    /// A message with a story
6929    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
6930    pub struct PushMessageContentStory {
6931        /// True, if the message is a pinned message with the specified content
6932        pub is_pinned: bool,
6933    }
6934    /// A text message
6935    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
6936    pub struct PushMessageContentText {
6937        /// Message text
6938        pub text: String,
6939        /// True, if the message is a pinned message with the specified content
6940        pub is_pinned: bool,
6941    }
6942    /// A video message
6943    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
6944    pub struct PushMessageContentVideo {
6945        /// Message content; may be null
6946        pub video: Option<crate::types::Video>,
6947        /// Video caption
6948        pub caption: String,
6949        /// True, if the video is secret
6950        pub is_secret: bool,
6951        /// True, if the message is a pinned message with the specified content
6952        pub is_pinned: bool,
6953    }
6954    /// A video note message
6955    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
6956    pub struct PushMessageContentVideoNote {
6957        /// Message content; may be null
6958        pub video_note: Option<crate::types::VideoNote>,
6959        /// True, if the message is a pinned message with the specified content
6960        pub is_pinned: bool,
6961    }
6962    /// A voice note message
6963    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
6964    pub struct PushMessageContentVoiceNote {
6965        /// Message content; may be null
6966        pub voice_note: Option<crate::types::VoiceNote>,
6967        /// True, if the message is a pinned message with the specified content
6968        pub is_pinned: bool,
6969    }
6970    /// New chat members were invited to a group
6971    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
6972    pub struct PushMessageContentChatAddMembers {
6973        /// Name of the added member
6974        pub member_name: String,
6975        /// True, if the current user was added to the group
6976        pub is_current_user: bool,
6977        /// True, if the user has returned to the group themselves
6978        pub is_returned: bool,
6979    }
6980    /// A chat title was edited
6981    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
6982    pub struct PushMessageContentChatChangeTitle {
6983        /// New chat title
6984        pub title: String,
6985    }
6986    /// A chat background was edited
6987    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
6988    pub struct PushMessageContentChatSetBackground {
6989        /// True, if the set background is the same as the background of the current user
6990        pub is_same: bool,
6991    }
6992    /// A chat theme was edited
6993    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
6994    pub struct PushMessageContentChatSetTheme {
6995        /// If non-empty, name of a new theme, set for the chat. Otherwise, the chat theme was reset to the default one
6996        pub theme_name: String,
6997    }
6998    /// A chat member was deleted
6999    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
7000    pub struct PushMessageContentChatDeleteMember {
7001        /// Name of the deleted member
7002        pub member_name: String,
7003        /// True, if the current user was deleted from the group
7004        pub is_current_user: bool,
7005        /// True, if the user has left the group themselves
7006        pub is_left: bool,
7007    }
7008    /// A new recurring payment was made by the current user
7009    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
7010    pub struct PushMessageContentRecurringPayment {
7011        /// The paid amount
7012        pub amount: String,
7013    }
7014    /// A forwarded messages
7015    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
7016    pub struct PushMessageContentMessageForwards {
7017        /// Number of forwarded messages
7018        pub total_count: i32,
7019    }
7020    /// A media album
7021    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
7022    pub struct PushMessageContentMediaAlbum {
7023        /// Number of messages in the album
7024        pub total_count: i32,
7025        /// True, if the album has at least one photo
7026        pub has_photos: bool,
7027        /// True, if the album has at least one video file
7028        pub has_videos: bool,
7029        /// True, if the album has at least one audio file
7030        pub has_audios: bool,
7031        /// True, if the album has at least one document
7032        pub has_documents: bool,
7033    }
7034    /// New message was received
7035    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
7036    pub struct NotificationTypeNewMessage {
7037        /// The message
7038        pub message: crate::types::Message,
7039        /// True, if message content must be displayed in notifications
7040        pub show_preview: bool,
7041    }
7042    /// New call was received
7043    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
7044    pub struct NotificationTypeNewCall {
7045        /// Call identifier
7046        pub call_id: i32,
7047    }
7048    /// New message was received through a push notification
7049    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
7050    pub struct NotificationTypeNewPushMessage {
7051        /// The message identifier. The message will not be available in the chat history, but the identifier can be used in viewMessages, or as a message to reply
7052        pub message_id: i64,
7053        /// Identifier of the sender of the message. Corresponding user or chat may be inaccessible
7054        pub sender_id: crate::enums::MessageSender,
7055        /// Name of the sender
7056        pub sender_name: String,
7057        /// True, if the message is outgoing
7058        pub is_outgoing: bool,
7059        /// Push message content
7060        pub content: crate::enums::PushMessageContent,
7061    }
7062    /// Describes a notification sound in MP3 format
7063    #[serde_as]
7064    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
7065    pub struct NotificationSound {
7066        /// Unique identifier of the notification sound
7067        #[serde_as(as = "DisplayFromStr")]
7068        pub id: i64,
7069        /// Duration of the sound, in seconds
7070        pub duration: i32,
7071        /// Point in time (Unix timestamp) when the sound was created
7072        pub date: i32,
7073        /// Title of the notification sound
7074        pub title: String,
7075        /// Arbitrary data, defined while the sound was uploaded
7076        pub data: String,
7077        /// File containing the sound
7078        pub sound: crate::types::File,
7079    }
7080    /// Contains a list of notification sounds
7081    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
7082    pub struct NotificationSounds {
7083        /// A list of notification sounds
7084        pub notification_sounds: Vec<crate::types::NotificationSound>,
7085    }
7086    /// Contains information about a notification
7087    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
7088    pub struct Notification {
7089        /// Unique persistent identifier of this notification
7090        pub id: i32,
7091        /// Notification date
7092        pub date: i32,
7093        /// True, if the notification was explicitly sent without sound
7094        pub is_silent: bool,
7095        /// Notification type
7096        pub r#type: crate::enums::NotificationType,
7097    }
7098    /// Describes a group of notifications
7099    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
7100    pub struct NotificationGroup {
7101        /// Unique persistent auto-incremented from 1 identifier of the notification group
7102        pub id: i32,
7103        /// Type of the group
7104        pub r#type: crate::enums::NotificationGroupType,
7105        /// Identifier of a chat to which all notifications in the group belong
7106        pub chat_id: i64,
7107        /// Total number of active notifications in the group
7108        pub total_count: i32,
7109        /// The list of active notifications
7110        pub notifications: Vec<crate::types::Notification>,
7111    }
7112    /// Represents a boolean option
7113    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
7114    pub struct OptionValueBoolean {
7115        /// The value of the option
7116        pub value: bool,
7117    }
7118    /// Represents an integer option
7119    #[serde_as]
7120    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
7121    pub struct OptionValueInteger {
7122        /// The value of the option
7123        #[serde_as(as = "DisplayFromStr")]
7124        pub value: i64,
7125    }
7126    /// Represents a string option
7127    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
7128    pub struct OptionValueString {
7129        /// The value of the option
7130        pub value: String,
7131    }
7132    /// Represents one member of a JSON object
7133    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
7134    pub struct JsonObjectMember {
7135        /// Member's key
7136        pub key: String,
7137        /// Member's value
7138        pub value: crate::enums::JsonValue,
7139    }
7140    /// Represents a boolean JSON value
7141    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
7142    pub struct JsonValueBoolean {
7143        /// The value
7144        pub value: bool,
7145    }
7146    /// Represents a numeric JSON value
7147    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
7148    pub struct JsonValueNumber {
7149        /// The value
7150        pub value: f64,
7151    }
7152    /// Represents a string JSON value
7153    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
7154    pub struct JsonValueString {
7155        /// The value
7156        pub value: String,
7157    }
7158    /// Represents a JSON array
7159    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
7160    pub struct JsonValueArray {
7161        /// The list of array elements
7162        pub values: Vec<crate::enums::JsonValue>,
7163    }
7164    /// Represents a JSON object
7165    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
7166    pub struct JsonValueObject {
7167        /// The list of object members
7168        pub members: Vec<crate::types::JsonObjectMember>,
7169    }
7170    /// The story can be viewed by everyone
7171    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
7172    pub struct StoryPrivacySettingsEveryone {
7173        /// Identifiers of the users that can't see the story; always unknown and empty for non-owned stories
7174        pub except_user_ids: Vec<i64>,
7175    }
7176    /// The story can be viewed by all contacts except chosen users
7177    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
7178    pub struct StoryPrivacySettingsContacts {
7179        /// User identifiers of the contacts that can't see the story; always unknown and empty for non-owned stories
7180        pub except_user_ids: Vec<i64>,
7181    }
7182    /// The story can be viewed by certain specified users
7183    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
7184    pub struct StoryPrivacySettingsSelectedUsers {
7185        /// Identifiers of the users; always unknown and empty for non-owned stories
7186        pub user_ids: Vec<i64>,
7187    }
7188    /// A rule to allow certain specified users to do something
7189    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
7190    pub struct UserPrivacySettingRuleAllowUsers {
7191        /// The user identifiers, total number of users in all rules must not exceed 1000
7192        pub user_ids: Vec<i64>,
7193    }
7194    /// A rule to allow all members of certain specified basic groups and supergroups to doing something
7195    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
7196    pub struct UserPrivacySettingRuleAllowChatMembers {
7197        /// The chat identifiers, total number of chats in all rules must not exceed 20
7198        pub chat_ids: Vec<i64>,
7199    }
7200    /// A rule to restrict all specified users from doing something
7201    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
7202    pub struct UserPrivacySettingRuleRestrictUsers {
7203        /// The user identifiers, total number of users in all rules must not exceed 1000
7204        pub user_ids: Vec<i64>,
7205    }
7206    /// A rule to restrict all members of specified basic groups and supergroups from doing something
7207    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
7208    pub struct UserPrivacySettingRuleRestrictChatMembers {
7209        /// The chat identifiers, total number of chats in all rules must not exceed 20
7210        pub chat_ids: Vec<i64>,
7211    }
7212    /// A list of privacy rules. Rules are matched in the specified order. The first matched rule defines the privacy setting for a given user. If no rule matches, the action is not allowed
7213    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
7214    pub struct UserPrivacySettingRules {
7215        /// A list of rules
7216        pub rules: Vec<crate::enums::UserPrivacySettingRule>,
7217    }
7218    /// Contains information about the period of inactivity after which the current user's account will automatically be deleted
7219    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
7220    pub struct AccountTtl {
7221        /// Number of days of inactivity before the account will be flagged for deletion; 30-366 days
7222        pub days: i32,
7223    }
7224    /// Contains default auto-delete timer setting for new chats
7225    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
7226    pub struct MessageAutoDeleteTime {
7227        /// Message auto-delete time, in seconds. If 0, then messages aren't deleted automatically
7228        pub time: i32,
7229    }
7230    /// Contains information about one session in a Telegram application used by the current user. Sessions must be shown to the user in the returned order
7231    #[serde_as]
7232    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
7233    pub struct Session {
7234        /// Session identifier
7235        #[serde_as(as = "DisplayFromStr")]
7236        pub id: i64,
7237        /// True, if this session is the current session
7238        pub is_current: bool,
7239        /// True, if a 2-step verification password is needed to complete authorization of the session
7240        pub is_password_pending: bool,
7241        /// True, if the session wasn't confirmed from another session
7242        pub is_unconfirmed: bool,
7243        /// True, if incoming secret chats can be accepted by the session
7244        pub can_accept_secret_chats: bool,
7245        /// True, if incoming calls can be accepted by the session
7246        pub can_accept_calls: bool,
7247        /// Session type based on the system and application version, which can be used to display a corresponding icon
7248        pub r#type: crate::enums::SessionType,
7249        /// Telegram API identifier, as provided by the application
7250        pub api_id: i32,
7251        /// Name of the application, as provided by the application
7252        pub application_name: String,
7253        /// The version of the application, as provided by the application
7254        pub application_version: String,
7255        /// True, if the application is an official application or uses the api_id of an official application
7256        pub is_official_application: bool,
7257        /// Model of the device the application has been run or is running on, as provided by the application
7258        pub device_model: String,
7259        /// Operating system the application has been run or is running on, as provided by the application
7260        pub platform: String,
7261        /// Version of the operating system the application has been run or is running on, as provided by the application
7262        pub system_version: String,
7263        /// Point in time (Unix timestamp) when the user has logged in
7264        pub log_in_date: i32,
7265        /// Point in time (Unix timestamp) when the session was last used
7266        pub last_active_date: i32,
7267        /// IP address from which the session was created, in human-readable format
7268        pub ip_address: String,
7269        /// A human-readable description of the location from which the session was created, based on the IP address
7270        pub location: String,
7271    }
7272    /// Contains a list of sessions
7273    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
7274    pub struct Sessions {
7275        /// List of sessions
7276        pub sessions: Vec<crate::types::Session>,
7277        /// Number of days of inactivity before sessions will automatically be terminated; 1-366 days
7278        pub inactive_session_ttl_days: i32,
7279    }
7280    /// Contains information about an unconfirmed session
7281    #[serde_as]
7282    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
7283    pub struct UnconfirmedSession {
7284        /// Session identifier
7285        #[serde_as(as = "DisplayFromStr")]
7286        pub id: i64,
7287        /// Point in time (Unix timestamp) when the user has logged in
7288        pub log_in_date: i32,
7289        /// Model of the device that was used for the session creation, as provided by the application
7290        pub device_model: String,
7291        /// A human-readable description of the location from which the session was created, based on the IP address
7292        pub location: String,
7293    }
7294    /// Contains information about one website the current user is logged in with Telegram
7295    #[serde_as]
7296    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
7297    pub struct ConnectedWebsite {
7298        /// Website identifier
7299        #[serde_as(as = "DisplayFromStr")]
7300        pub id: i64,
7301        /// The domain name of the website
7302        pub domain_name: String,
7303        /// User identifier of a bot linked with the website
7304        pub bot_user_id: i64,
7305        /// The version of a browser used to log in
7306        pub browser: String,
7307        /// Operating system the browser is running on
7308        pub platform: String,
7309        /// Point in time (Unix timestamp) when the user was logged in
7310        pub log_in_date: i32,
7311        /// Point in time (Unix timestamp) when obtained authorization was last used
7312        pub last_active_date: i32,
7313        /// IP address from which the user was logged in, in human-readable format
7314        pub ip_address: String,
7315        /// Human-readable description of a country and a region from which the user was logged in, based on the IP address
7316        pub location: String,
7317    }
7318    /// Contains a list of websites the current user is logged in with Telegram
7319    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
7320    pub struct ConnectedWebsites {
7321        /// List of connected websites
7322        pub websites: Vec<crate::types::ConnectedWebsite>,
7323    }
7324    /// The chat needs to be chosen by the user among chats of the specified types
7325    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
7326    pub struct TargetChatChosen {
7327        /// True, if private chats with ordinary users are allowed
7328        pub allow_user_chats: bool,
7329        /// True, if private chats with other bots are allowed
7330        pub allow_bot_chats: bool,
7331        /// True, if basic group and supergroup chats are allowed
7332        pub allow_group_chats: bool,
7333        /// True, if channel chats are allowed
7334        pub allow_channel_chats: bool,
7335    }
7336    /// The chat needs to be open with the provided internal link
7337    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
7338    pub struct TargetChatInternalLink {
7339        /// An internal link pointing to the chat
7340        pub link: crate::enums::InternalLinkType,
7341    }
7342    /// The link is a link to an attachment menu bot to be opened in the specified or a chosen chat. Process given target_chat to open the chat.
7343    /// Then, call searchPublicChat with the given bot username, check that the user is a bot and can be added to attachment menu. Then, use getAttachmentMenuBot to receive information about the bot.
7344    /// If the bot isn't added to attachment menu, then show a disclaimer about Mini Apps being a third-party apps, ask the user to accept their Terms of service and confirm adding the bot to side and attachment menu.
7345    /// If the user accept the terms and confirms adding, then use toggleBotIsAddedToAttachmentMenu to add the bot.
7346    /// If the attachment menu bot can't be used in the opened chat, show an error to the user. If the bot is added to attachment menu and can be used in the chat, then use openWebApp with the given URL
7347    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
7348    pub struct InternalLinkTypeAttachmentMenuBot {
7349        /// Target chat to be opened
7350        pub target_chat: crate::enums::TargetChat,
7351        /// Username of the bot
7352        pub bot_username: String,
7353        /// URL to be passed to openWebApp
7354        pub url: String,
7355    }
7356    /// The link contains an authentication code. Call checkAuthenticationCode with the code if the current authorization state is authorizationStateWaitCode
7357    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
7358    pub struct InternalLinkTypeAuthenticationCode {
7359        /// The authentication code
7360        pub code: String,
7361    }
7362    /// The link is a link to a background. Call searchBackground with the given background name to process the link
7363    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
7364    pub struct InternalLinkTypeBackground {
7365        /// Name of the background
7366        pub background_name: String,
7367    }
7368    /// The link is a link to a Telegram bot, which is supposed to be added to a channel chat as an administrator. Call searchPublicChat with the given bot username and check that the user is a bot,
7369    /// ask the current user to select a channel chat to add the bot to as an administrator. Then, call getChatMember to receive the current bot rights in the chat and if the bot already is an administrator,
7370    /// check that the current user can edit its administrator rights and combine received rights with the requested administrator rights. Then, show confirmation box to the user, and call setChatMemberStatus with the chosen chat and confirmed rights
7371    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
7372    pub struct InternalLinkTypeBotAddToChannel {
7373        /// Username of the bot
7374        pub bot_username: String,
7375        /// Expected administrator rights for the bot
7376        pub administrator_rights: crate::types::ChatAdministratorRights,
7377    }
7378    /// The link is a link to a chat with a Telegram bot. Call searchPublicChat with the given bot username, check that the user is a bot, show START button in the chat with the bot,
7379    /// and then call sendBotStartMessage with the given start parameter after the button is pressed
7380    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
7381    pub struct InternalLinkTypeBotStart {
7382        /// Username of the bot
7383        pub bot_username: String,
7384        /// The parameter to be passed to sendBotStartMessage
7385        pub start_parameter: String,
7386        /// True, if sendBotStartMessage must be called automatically without showing the START button
7387        pub autostart: bool,
7388    }
7389    /// The link is a link to a Telegram bot, which is supposed to be added to a group chat. Call searchPublicChat with the given bot username, check that the user is a bot and can be added to groups,
7390    /// ask the current user to select a basic group or a supergroup chat to add the bot to, taking into account that bots can be added to a public supergroup only by administrators of the supergroup.
7391    /// If administrator rights are provided by the link, call getChatMember to receive the current bot rights in the chat and if the bot already is an administrator,
7392    /// check that the current user can edit its administrator rights, combine received rights with the requested administrator rights, show confirmation box to the user,
7393    /// and call setChatMemberStatus with the chosen chat and confirmed administrator rights. Before call to setChatMemberStatus it may be required to upgrade the chosen basic group chat to a supergroup chat.
7394    /// Then, if start_parameter isn't empty, call sendBotStartMessage with the given start parameter and the chosen chat; otherwise, just send /start message with bot's username added to the chat.
7395    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
7396    pub struct InternalLinkTypeBotStartInGroup {
7397        /// Username of the bot
7398        pub bot_username: String,
7399        /// The parameter to be passed to sendBotStartMessage
7400        pub start_parameter: String,
7401        /// Expected administrator rights for the bot; may be null
7402        pub administrator_rights: Option<crate::types::ChatAdministratorRights>,
7403    }
7404    /// The link is a link to boost a Telegram chat. Call getChatBoostLinkInfo with the given URL to process the link.
7405    /// If the chat is found, then call getChatBoostStatus and canBoostChat to get the current boost status and check whether the chat can be boosted.
7406    /// If the user wants to boost the chat and the chat can be boosted, then call boostChat
7407    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
7408    pub struct InternalLinkTypeChatBoost {
7409        /// URL to be passed to getChatBoostLinkInfo
7410        pub url: String,
7411    }
7412    /// The link is an invite link to a chat folder. Call checkChatFolderInviteLink with the given invite link to process the link
7413    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
7414    pub struct InternalLinkTypeChatFolderInvite {
7415        /// Internal representation of the invite link
7416        pub invite_link: String,
7417    }
7418    /// The link is a chat invite link. Call checkChatInviteLink with the given invite link to process the link
7419    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
7420    pub struct InternalLinkTypeChatInvite {
7421        /// Internal representation of the invite link
7422        pub invite_link: String,
7423    }
7424    /// The link is a link to a game. Call searchPublicChat with the given bot username, check that the user is a bot, ask the current user to select a chat to send the game, and then call sendMessage with inputMessageGame
7425    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
7426    pub struct InternalLinkTypeGame {
7427        /// Username of the bot that owns the game
7428        pub bot_username: String,
7429        /// Short name of the game
7430        pub game_short_name: String,
7431    }
7432    /// The link must be opened in an Instant View. Call getWebPageInstantView with the given URL to process the link
7433    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
7434    pub struct InternalLinkTypeInstantView {
7435        /// URL to be passed to getWebPageInstantView
7436        pub url: String,
7437        /// An URL to open if getWebPageInstantView fails
7438        pub fallback_url: String,
7439    }
7440    /// The link is a link to an invoice. Call getPaymentForm with the given invoice name to process the link
7441    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
7442    pub struct InternalLinkTypeInvoice {
7443        /// Name of the invoice
7444        pub invoice_name: String,
7445    }
7446    /// The link is a link to a language pack. Call getLanguagePackInfo with the given language pack identifier to process the link
7447    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
7448    pub struct InternalLinkTypeLanguagePack {
7449        /// Language pack identifier
7450        pub language_pack_id: String,
7451    }
7452    /// The link is a link to a Telegram message or a forum topic. Call getMessageLinkInfo with the given URL to process the link
7453    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
7454    pub struct InternalLinkTypeMessage {
7455        /// URL to be passed to getMessageLinkInfo
7456        pub url: String,
7457    }
7458    /// The link contains a message draft text. A share screen needs to be shown to the user, then the chosen chat must be opened and the text is added to the input field
7459    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
7460    pub struct InternalLinkTypeMessageDraft {
7461        /// Message draft text
7462        pub text: crate::types::FormattedText,
7463        /// True, if the first line of the text contains a link. If true, the input field needs to be focused and the text after the link must be selected
7464        pub contains_link: bool,
7465    }
7466    /// The link contains a request of Telegram passport data. Call getPassportAuthorizationForm with the given parameters to process the link if the link was received from outside of the application; otherwise, ignore it
7467    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
7468    pub struct InternalLinkTypePassportDataRequest {
7469        /// User identifier of the service's bot
7470        pub bot_user_id: i64,
7471        /// Telegram Passport element types requested by the service
7472        pub scope: String,
7473        /// Service's public key
7474        pub public_key: String,
7475        /// Unique request identifier provided by the service
7476        pub nonce: String,
7477        /// An HTTP URL to open once the request is finished, canceled, or failed with the parameters tg_passport=success, tg_passport=cancel, or tg_passport=error&error=... respectively.
7478        /// If empty, then onActivityResult method must be used to return response on Android, or the link tgbot{bot_user_id}:passport/success or tgbot{bot_user_id}:passport/cancel must be opened otherwise
7479        pub callback_url: String,
7480    }
7481    /// The link can be used to confirm ownership of a phone number to prevent account deletion. Call sendPhoneNumberConfirmationCode with the given hash and phone number to process the link
7482    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
7483    pub struct InternalLinkTypePhoneNumberConfirmation {
7484        /// Hash value from the link
7485        pub hash: String,
7486        /// Phone number value from the link
7487        pub phone_number: String,
7488    }
7489    /// The link is a link to the Premium features screen of the application from which the user can subscribe to Telegram Premium. Call getPremiumFeatures with the given referrer to process the link
7490    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
7491    pub struct InternalLinkTypePremiumFeatures {
7492        /// Referrer specified in the link
7493        pub referrer: String,
7494    }
7495    /// The link is a link to a proxy. Call addProxy with the given parameters to process the link and add the proxy
7496    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
7497    pub struct InternalLinkTypeProxy {
7498        /// Proxy server domain or IP address
7499        pub server: String,
7500        /// Proxy server port
7501        pub port: i32,
7502        /// Type of the proxy
7503        pub r#type: crate::enums::ProxyType,
7504    }
7505    /// The link is a link to a chat by its username. Call searchPublicChat with the given chat username to process the link
7506    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
7507    pub struct InternalLinkTypePublicChat {
7508        /// Username of the chat
7509        pub chat_username: String,
7510    }
7511    /// The link is a link to a bot, which can be installed to the side menu. Call searchPublicChat with the given bot username, check that the user is a bot and can be added to attachment menu.
7512    /// Then, use getAttachmentMenuBot to receive information about the bot. If the bot isn't added to side menu, then show a disclaimer about Mini Apps being a third-party apps,
7513    /// ask the user to accept their Terms of service and confirm adding the bot to side and attachment menu. If the user accept the terms and confirms adding, then use toggleBotIsAddedToAttachmentMenu to add the bot.
7514    /// If the bot is added to side menu, then use getWebAppUrl with the given URL
7515    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
7516    pub struct InternalLinkTypeSideMenuBot {
7517        /// Username of the bot
7518        pub bot_username: String,
7519        /// URL to be passed to getWebAppUrl
7520        pub url: String,
7521    }
7522    /// The link is a link to a sticker set. Call searchStickerSet with the given sticker set name to process the link and show the sticker set
7523    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
7524    pub struct InternalLinkTypeStickerSet {
7525        /// Name of the sticker set
7526        pub sticker_set_name: String,
7527        /// True, if the sticker set is expected to contain custom emoji
7528        pub expect_custom_emoji: bool,
7529    }
7530    /// The link is a link to a story. Call searchPublicChat with the given sender username, then call getStory with the received chat identifier and the given story identifier
7531    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
7532    pub struct InternalLinkTypeStory {
7533        /// Username of the sender of the story
7534        pub story_sender_username: String,
7535        /// Story identifier
7536        pub story_id: i32,
7537    }
7538    /// The link is a link to a theme. TDLib has no theme support yet
7539    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
7540    pub struct InternalLinkTypeTheme {
7541        /// Name of the theme
7542        pub theme_name: String,
7543    }
7544    /// The link is an unknown tg: link. Call getDeepLinkInfo to process the link
7545    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
7546    pub struct InternalLinkTypeUnknownDeepLink {
7547        /// Link to be passed to getDeepLinkInfo
7548        pub link: String,
7549    }
7550    /// The link is a link to a user by its phone number. Call searchUserByPhoneNumber with the given phone number to process the link
7551    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
7552    pub struct InternalLinkTypeUserPhoneNumber {
7553        /// Phone number of the user
7554        pub phone_number: String,
7555    }
7556    /// The link is a link to a user by a temporary token. Call searchUserByToken with the given token to process the link
7557    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
7558    pub struct InternalLinkTypeUserToken {
7559        /// The token
7560        pub token: String,
7561    }
7562    /// The link is a link to a video chat. Call searchPublicChat with the given chat username, and then joinGroupCall with the given invite hash to process the link
7563    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
7564    pub struct InternalLinkTypeVideoChat {
7565        /// Username of the chat with the video chat
7566        pub chat_username: String,
7567        /// If non-empty, invite hash to be used to join the video chat without being muted by administrators
7568        pub invite_hash: String,
7569        /// True, if the video chat is expected to be a live stream in a channel or a broadcast group
7570        pub is_live_stream: bool,
7571    }
7572    /// The link is a link to a Web App. Call searchPublicChat with the given bot username, check that the user is a bot, then call searchWebApp with the received bot and the given web_app_short_name.
7573    /// Process received foundWebApp by showing a confirmation dialog if needed. If the bot can be added to attachment or side menu, but isn't added yet, then show a disclaimer about Mini Apps being a third-party apps
7574    /// instead of the dialog and ask the user to accept their Terms of service. If the user accept the terms and confirms adding, then use toggleBotIsAddedToAttachmentMenu to add the bot.
7575    /// Then, call getWebAppLinkUrl and open the returned URL as a Web App
7576    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
7577    pub struct InternalLinkTypeWebApp {
7578        /// Username of the bot that owns the Web App
7579        pub bot_username: String,
7580        /// Short name of the Web App
7581        pub web_app_short_name: String,
7582        /// Start parameter to be passed to getWebAppLinkUrl
7583        pub start_parameter: String,
7584    }
7585    /// Contains an HTTPS link to a message in a supergroup or channel, or a forum topic
7586    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
7587    pub struct MessageLink {
7588        /// The link
7589        pub link: String,
7590        /// True, if the link will work for non-members of the chat
7591        pub is_public: bool,
7592    }
7593    /// Contains information about a link to a message or a forum topic in a chat
7594    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
7595    pub struct MessageLinkInfo {
7596        /// True, if the link is a public link for a message or a forum topic in a chat
7597        pub is_public: bool,
7598        /// If found, identifier of the chat to which the link points, 0 otherwise
7599        pub chat_id: i64,
7600        /// If found, identifier of the message thread in which to open the message, or a forum topic to open if the message is missing
7601        pub message_thread_id: i64,
7602        /// If found, the linked message; may be null
7603        pub message: Option<crate::types::Message>,
7604        /// Timestamp from which the video/audio/video note/voice note playing must start, in seconds; 0 if not specified. The media can be in the message content or in its web page preview
7605        pub media_timestamp: i32,
7606        /// True, if the whole media album to which the message belongs is linked
7607        pub for_album: bool,
7608    }
7609    /// Contains an HTTPS link to boost a chat
7610    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
7611    pub struct ChatBoostLink {
7612        /// The link
7613        pub link: String,
7614        /// True, if the link will work for non-members of the chat
7615        pub is_public: bool,
7616    }
7617    /// Contains information about a link to boost a a chat
7618    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
7619    pub struct ChatBoostLinkInfo {
7620        /// True, if the link will work for non-members of the chat
7621        pub is_public: bool,
7622        /// Identifier of the chat to which the link points; 0 if the chat isn't found
7623        pub chat_id: i64,
7624    }
7625    /// Contains a part of a file
7626    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
7627    pub struct FilePart {
7628        /// File bytes
7629        pub data: String,
7630    }
7631    /// Contains the storage usage statistics for a specific file type
7632    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
7633    pub struct StorageStatisticsByFileType {
7634        /// File type
7635        pub file_type: crate::enums::FileType,
7636        /// Total size of the files, in bytes
7637        pub size: i64,
7638        /// Total number of files
7639        pub count: i32,
7640    }
7641    /// Contains the storage usage statistics for a specific chat
7642    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
7643    pub struct StorageStatisticsByChat {
7644        /// Chat identifier; 0 if none
7645        pub chat_id: i64,
7646        /// Total size of the files in the chat, in bytes
7647        pub size: i64,
7648        /// Total number of files in the chat
7649        pub count: i32,
7650        /// Statistics split by file types
7651        pub by_file_type: Vec<crate::types::StorageStatisticsByFileType>,
7652    }
7653    /// Contains the exact storage usage statistics split by chats and file type
7654    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
7655    pub struct StorageStatistics {
7656        /// Total size of files, in bytes
7657        pub size: i64,
7658        /// Total number of files
7659        pub count: i32,
7660        /// Statistics split by chats
7661        pub by_chat: Vec<crate::types::StorageStatisticsByChat>,
7662    }
7663    /// Contains approximate storage usage statistics, excluding files of unknown file type
7664    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
7665    pub struct StorageStatisticsFast {
7666        /// Approximate total size of files, in bytes
7667        pub files_size: i64,
7668        /// Approximate number of files
7669        pub file_count: i32,
7670        /// Size of the database
7671        pub database_size: i64,
7672        /// Size of the language pack database
7673        pub language_pack_database_size: i64,
7674        /// Size of the TDLib internal log
7675        pub log_size: i64,
7676    }
7677    /// Contains database statistics
7678    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
7679    pub struct DatabaseStatistics {
7680        /// Database statistics in an unspecified human-readable format
7681        pub statistics: String,
7682    }
7683    /// Contains information about the total amount of data that was used to send and receive files
7684    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
7685    pub struct NetworkStatisticsEntryFile {
7686        /// Type of the file the data is part of; pass null if the data isn't related to files
7687        pub file_type: Option<crate::enums::FileType>,
7688        /// Type of the network the data was sent through. Call setNetworkType to maintain the actual network type
7689        pub network_type: crate::enums::NetworkType,
7690        /// Total number of bytes sent
7691        pub sent_bytes: i64,
7692        /// Total number of bytes received
7693        pub received_bytes: i64,
7694    }
7695    /// Contains information about the total amount of data that was used for calls
7696    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
7697    pub struct NetworkStatisticsEntryCall {
7698        /// Type of the network the data was sent through. Call setNetworkType to maintain the actual network type
7699        pub network_type: crate::enums::NetworkType,
7700        /// Total number of bytes sent
7701        pub sent_bytes: i64,
7702        /// Total number of bytes received
7703        pub received_bytes: i64,
7704        /// Total call duration, in seconds
7705        pub duration: f64,
7706    }
7707    /// A full list of available network statistic entries
7708    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
7709    pub struct NetworkStatistics {
7710        /// Point in time (Unix timestamp) from which the statistics are collected
7711        pub since_date: i32,
7712        /// Network statistics entries
7713        pub entries: Vec<crate::enums::NetworkStatisticsEntry>,
7714    }
7715    /// Contains auto-download settings
7716    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
7717    pub struct AutoDownloadSettings {
7718        /// True, if the auto-download is enabled
7719        pub is_auto_download_enabled: bool,
7720        /// The maximum size of a photo file to be auto-downloaded, in bytes
7721        pub max_photo_file_size: i32,
7722        /// The maximum size of a video file to be auto-downloaded, in bytes
7723        pub max_video_file_size: i64,
7724        /// The maximum size of other file types to be auto-downloaded, in bytes
7725        pub max_other_file_size: i64,
7726        /// The maximum suggested bitrate for uploaded videos, in kbit/s
7727        pub video_upload_bitrate: i32,
7728        /// True, if the beginning of video files needs to be preloaded for instant playback
7729        pub preload_large_videos: bool,
7730        /// True, if the next audio track needs to be preloaded while the user is listening to an audio file
7731        pub preload_next_audio: bool,
7732        /// True, if stories needs to be preloaded
7733        pub preload_stories: bool,
7734        /// True, if "use less data for calls" option needs to be enabled
7735        pub use_less_data_for_calls: bool,
7736    }
7737    /// Contains auto-download settings presets for the current user
7738    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
7739    pub struct AutoDownloadSettingsPresets {
7740        /// Preset with lowest settings; supposed to be used by default when roaming
7741        pub low: crate::types::AutoDownloadSettings,
7742        /// Preset with medium settings; supposed to be used by default when using mobile data
7743        pub medium: crate::types::AutoDownloadSettings,
7744        /// Preset with highest settings; supposed to be used by default when connected on Wi-Fi
7745        pub high: crate::types::AutoDownloadSettings,
7746    }
7747    /// Autosave settings applied to a chat
7748    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
7749    pub struct AutosaveSettingsScopeChat {
7750        /// Chat identifier
7751        pub chat_id: i64,
7752    }
7753    /// Contains autosave settings for an autosave settings scope
7754    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
7755    pub struct ScopeAutosaveSettings {
7756        /// True, if photo autosave is enabled
7757        pub autosave_photos: bool,
7758        /// True, if video autosave is enabled
7759        pub autosave_videos: bool,
7760        /// The maximum size of a video file to be autosaved, in bytes; 512 KB - 4000 MB
7761        pub max_video_file_size: i64,
7762    }
7763    /// Contains autosave settings for a chat, which overrides default settings for the corresponding scope
7764    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
7765    pub struct AutosaveSettingsException {
7766        /// Chat identifier
7767        pub chat_id: i64,
7768        /// Autosave settings for the chat
7769        pub settings: crate::types::ScopeAutosaveSettings,
7770    }
7771    /// Describes autosave settings
7772    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
7773    pub struct AutosaveSettings {
7774        /// Default autosave settings for private chats
7775        pub private_chat_settings: crate::types::ScopeAutosaveSettings,
7776        /// Default autosave settings for basic group and supergroup chats
7777        pub group_settings: crate::types::ScopeAutosaveSettings,
7778        /// Default autosave settings for channel chats
7779        pub channel_settings: crate::types::ScopeAutosaveSettings,
7780        /// Autosave settings for specific chats
7781        pub exceptions: Vec<crate::types::AutosaveSettingsException>,
7782    }
7783    /// Contains 0-based positions of matched objects
7784    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
7785    pub struct FoundPositions {
7786        /// Total number of matched objects
7787        pub total_count: i32,
7788        /// The positions of the matched objects
7789        pub positions: Vec<i32>,
7790    }
7791    /// A URL linking to a user
7792    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
7793    pub struct TmeUrlTypeUser {
7794        /// Identifier of the user
7795        pub user_id: i64,
7796    }
7797    /// A URL linking to a public supergroup or channel
7798    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
7799    pub struct TmeUrlTypeSupergroup {
7800        /// Identifier of the supergroup or channel
7801        pub supergroup_id: i64,
7802    }
7803    /// A chat invite link
7804    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
7805    pub struct TmeUrlTypeChatInvite {
7806        /// Information about the chat invite link
7807        pub info: crate::types::ChatInviteLinkInfo,
7808    }
7809    /// A URL linking to a sticker set
7810    #[serde_as]
7811    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
7812    pub struct TmeUrlTypeStickerSet {
7813        /// Identifier of the sticker set
7814        #[serde_as(as = "DisplayFromStr")]
7815        pub sticker_set_id: i64,
7816    }
7817    /// Represents a URL linking to an internal Telegram entity
7818    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
7819    pub struct TmeUrl {
7820        /// URL
7821        pub url: String,
7822        /// Type of the URL
7823        pub r#type: crate::enums::TmeUrlType,
7824    }
7825    /// Contains a list of t.me URLs
7826    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
7827    pub struct TmeUrls {
7828        /// List of URLs
7829        pub urls: Vec<crate::types::TmeUrl>,
7830    }
7831    /// Suggests the user to convert specified supergroup to a broadcast group
7832    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
7833    pub struct SuggestedActionConvertToBroadcastGroup {
7834        /// Supergroup identifier
7835        pub supergroup_id: i64,
7836    }
7837    /// Suggests the user to set a 2-step verification password to be able to log in again
7838    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
7839    pub struct SuggestedActionSetPassword {
7840        /// The number of days to pass between consecutive authorizations if the user declines to set password; if 0, then the user is advised to set the password for security reasons
7841        pub authorization_delay: i32,
7842    }
7843    /// Contains a counter
7844    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
7845    pub struct Count {
7846        /// Count
7847        pub count: i32,
7848    }
7849    /// Contains some text
7850    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
7851    pub struct Text {
7852        /// Text
7853        pub text: String,
7854    }
7855    /// Contains a value representing a number of seconds
7856    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
7857    pub struct Seconds {
7858        /// Number of seconds
7859        pub seconds: f64,
7860    }
7861    /// Contains size of downloaded prefix of a file
7862    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
7863    pub struct FileDownloadedPrefixSize {
7864        /// The prefix size, in bytes
7865        pub size: i64,
7866    }
7867    /// Contains information about a tg: deep link
7868    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
7869    pub struct DeepLinkInfo {
7870        /// Text to be shown to the user
7871        pub text: crate::types::FormattedText,
7872        /// True, if the user must be asked to update the application
7873        pub need_update_application: bool,
7874    }
7875    /// The text uses Markdown-style formatting
7876    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
7877    pub struct TextParseModeMarkdown {
7878        /// Version of the parser: 0 or 1 - Telegram Bot API "Markdown" parse mode, 2 - Telegram Bot API "MarkdownV2" parse mode
7879        pub version: i32,
7880    }
7881    /// A SOCKS5 proxy server
7882    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
7883    pub struct ProxyTypeSocks5 {
7884        /// Username for logging in; may be empty
7885        pub username: String,
7886        /// Password for logging in; may be empty
7887        pub password: String,
7888    }
7889    /// A HTTP transparent proxy server
7890    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
7891    pub struct ProxyTypeHttp {
7892        /// Username for logging in; may be empty
7893        pub username: String,
7894        /// Password for logging in; may be empty
7895        pub password: String,
7896        /// Pass true if the proxy supports only HTTP requests and doesn't support transparent TCP connections via HTTP CONNECT method
7897        pub http_only: bool,
7898    }
7899    /// An MTProto proxy server
7900    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
7901    pub struct ProxyTypeMtproto {
7902        /// The proxy's secret in hexadecimal encoding
7903        pub secret: String,
7904    }
7905    /// Contains information about a proxy server
7906    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
7907    pub struct Proxy {
7908        /// Unique identifier of the proxy
7909        pub id: i32,
7910        /// Proxy server domain or IP address
7911        pub server: String,
7912        /// Proxy server port
7913        pub port: i32,
7914        /// Point in time (Unix timestamp) when the proxy was last used; 0 if never
7915        pub last_used_date: i32,
7916        /// True, if the proxy is enabled now
7917        pub is_enabled: bool,
7918        /// Type of the proxy
7919        pub r#type: crate::enums::ProxyType,
7920    }
7921    /// Represents a list of proxy servers
7922    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
7923    pub struct Proxies {
7924        /// List of proxy servers
7925        pub proxies: Vec<crate::types::Proxy>,
7926    }
7927    /// A sticker to be added to a sticker set
7928    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
7929    pub struct InputSticker {
7930        /// File with the sticker; must fit in a 512x512 square. For WEBP stickers the file must be in WEBP or PNG format, which will be converted to WEBP server-side.
7931        /// See https:core.telegram.org/animated_stickers#technical-requirements for technical requirements
7932        pub sticker: crate::enums::InputFile,
7933        /// String with 1-20 emoji corresponding to the sticker
7934        pub emojis: String,
7935        /// Position where the mask is placed; pass null if not specified
7936        pub mask_position: Option<crate::types::MaskPosition>,
7937        /// List of up to 20 keywords with total length up to 64 characters, which can be used to find the sticker
7938        pub keywords: Vec<String>,
7939    }
7940    /// Represents a date range
7941    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
7942    pub struct DateRange {
7943        /// Point in time (Unix timestamp) at which the date range begins
7944        pub start_date: i32,
7945        /// Point in time (Unix timestamp) at which the date range ends
7946        pub end_date: i32,
7947    }
7948    /// A value with information about its recent changes
7949    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
7950    pub struct StatisticalValue {
7951        /// The current value
7952        pub value: f64,
7953        /// The value for the previous day
7954        pub previous_value: f64,
7955        /// The growth rate of the value, as a percentage
7956        pub growth_rate_percentage: f64,
7957    }
7958    /// A graph data
7959    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
7960    pub struct StatisticalGraphData {
7961        /// Graph data in JSON format
7962        pub json_data: String,
7963        /// If non-empty, a token which can be used to receive a zoomed in graph
7964        pub zoom_token: String,
7965    }
7966    /// The graph data to be asynchronously loaded through getStatisticalGraph
7967    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
7968    pub struct StatisticalGraphAsync {
7969        /// The token to use for data loading
7970        pub token: String,
7971    }
7972    /// An error message to be shown to the user instead of the graph
7973    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
7974    pub struct StatisticalGraphError {
7975        /// The error message
7976        pub error_message: String,
7977    }
7978    /// Contains statistics about interactions with a message
7979    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
7980    pub struct ChatStatisticsMessageInteractionInfo {
7981        /// Message identifier
7982        pub message_id: i64,
7983        /// Number of times the message was viewed
7984        pub view_count: i32,
7985        /// Number of times the message was forwarded
7986        pub forward_count: i32,
7987    }
7988    /// Contains statistics about messages sent by a user
7989    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
7990    pub struct ChatStatisticsMessageSenderInfo {
7991        /// User identifier
7992        pub user_id: i64,
7993        /// Number of sent messages
7994        pub sent_message_count: i32,
7995        /// Average number of characters in sent messages; 0 if unknown
7996        pub average_character_count: i32,
7997    }
7998    /// Contains statistics about administrator actions done by a user
7999    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
8000    pub struct ChatStatisticsAdministratorActionsInfo {
8001        /// Administrator user identifier
8002        pub user_id: i64,
8003        /// Number of messages deleted by the administrator
8004        pub deleted_message_count: i32,
8005        /// Number of users banned by the administrator
8006        pub banned_user_count: i32,
8007        /// Number of users restricted by the administrator
8008        pub restricted_user_count: i32,
8009    }
8010    /// Contains statistics about number of new members invited by a user
8011    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
8012    pub struct ChatStatisticsInviterInfo {
8013        /// User identifier
8014        pub user_id: i64,
8015        /// Number of new members invited by the user
8016        pub added_member_count: i32,
8017    }
8018    /// A detailed statistics about a supergroup chat
8019    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
8020    pub struct ChatStatisticsSupergroup {
8021        /// A period to which the statistics applies
8022        pub period: crate::types::DateRange,
8023        /// Number of members in the chat
8024        pub member_count: crate::types::StatisticalValue,
8025        /// Number of messages sent to the chat
8026        pub message_count: crate::types::StatisticalValue,
8027        /// Number of users who viewed messages in the chat
8028        pub viewer_count: crate::types::StatisticalValue,
8029        /// Number of users who sent messages to the chat
8030        pub sender_count: crate::types::StatisticalValue,
8031        /// A graph containing number of members in the chat
8032        pub member_count_graph: crate::enums::StatisticalGraph,
8033        /// A graph containing number of members joined and left the chat
8034        pub join_graph: crate::enums::StatisticalGraph,
8035        /// A graph containing number of new member joins per source
8036        pub join_by_source_graph: crate::enums::StatisticalGraph,
8037        /// A graph containing distribution of active users per language
8038        pub language_graph: crate::enums::StatisticalGraph,
8039        /// A graph containing distribution of sent messages by content type
8040        pub message_content_graph: crate::enums::StatisticalGraph,
8041        /// A graph containing number of different actions in the chat
8042        pub action_graph: crate::enums::StatisticalGraph,
8043        /// A graph containing distribution of message views per hour
8044        pub day_graph: crate::enums::StatisticalGraph,
8045        /// A graph containing distribution of message views per day of week
8046        pub week_graph: crate::enums::StatisticalGraph,
8047        /// List of users sent most messages in the last week
8048        pub top_senders: Vec<crate::types::ChatStatisticsMessageSenderInfo>,
8049        /// List of most active administrators in the last week
8050        pub top_administrators: Vec<crate::types::ChatStatisticsAdministratorActionsInfo>,
8051        /// List of most active inviters of new members in the last week
8052        pub top_inviters: Vec<crate::types::ChatStatisticsInviterInfo>,
8053    }
8054    /// A detailed statistics about a channel chat
8055    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
8056    pub struct ChatStatisticsChannel {
8057        /// A period to which the statistics applies
8058        pub period: crate::types::DateRange,
8059        /// Number of members in the chat
8060        pub member_count: crate::types::StatisticalValue,
8061        /// Mean number of times the recently sent messages was viewed
8062        pub mean_view_count: crate::types::StatisticalValue,
8063        /// Mean number of times the recently sent messages was shared
8064        pub mean_share_count: crate::types::StatisticalValue,
8065        /// A percentage of users with enabled notifications for the chat
8066        pub enabled_notifications_percentage: f64,
8067        /// A graph containing number of members in the chat
8068        pub member_count_graph: crate::enums::StatisticalGraph,
8069        /// A graph containing number of members joined and left the chat
8070        pub join_graph: crate::enums::StatisticalGraph,
8071        /// A graph containing number of members muted and unmuted the chat
8072        pub mute_graph: crate::enums::StatisticalGraph,
8073        /// A graph containing number of message views in a given hour in the last two weeks
8074        pub view_count_by_hour_graph: crate::enums::StatisticalGraph,
8075        /// A graph containing number of message views per source
8076        pub view_count_by_source_graph: crate::enums::StatisticalGraph,
8077        /// A graph containing number of new member joins per source
8078        pub join_by_source_graph: crate::enums::StatisticalGraph,
8079        /// A graph containing number of users viewed chat messages per language
8080        pub language_graph: crate::enums::StatisticalGraph,
8081        /// A graph containing number of chat message views and shares
8082        pub message_interaction_graph: crate::enums::StatisticalGraph,
8083        /// A graph containing number of views of associated with the chat instant views
8084        pub instant_view_interaction_graph: crate::enums::StatisticalGraph,
8085        /// Detailed statistics about number of views and shares of recently sent messages
8086        pub recent_message_interactions: Vec<crate::types::ChatStatisticsMessageInteractionInfo>,
8087    }
8088    /// A detailed statistics about a message
8089    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
8090    pub struct MessageStatistics {
8091        /// A graph containing number of message views and shares
8092        pub message_interaction_graph: crate::enums::StatisticalGraph,
8093    }
8094    /// A point on a Cartesian plane
8095    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
8096    pub struct Point {
8097        /// The point's first coordinate
8098        pub x: f64,
8099        /// The point's second coordinate
8100        pub y: f64,
8101    }
8102    /// A straight line to a given point
8103    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
8104    pub struct VectorPathCommandLine {
8105        /// The end point of the straight line
8106        pub end_point: crate::types::Point,
8107    }
8108    /// A cubic Bézier curve to a given point
8109    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
8110    pub struct VectorPathCommandCubicBezierCurve {
8111        /// The start control point of the curve
8112        pub start_control_point: crate::types::Point,
8113        /// The end control point of the curve
8114        pub end_control_point: crate::types::Point,
8115        /// The end point of the curve
8116        pub end_point: crate::types::Point,
8117    }
8118    /// A scope covering all members of a chat
8119    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
8120    pub struct BotCommandScopeChat {
8121        /// Chat identifier
8122        pub chat_id: i64,
8123    }
8124    /// A scope covering all administrators of a chat
8125    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
8126    pub struct BotCommandScopeChatAdministrators {
8127        /// Chat identifier
8128        pub chat_id: i64,
8129    }
8130    /// A scope covering a member of a chat
8131    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
8132    pub struct BotCommandScopeChatMember {
8133        /// Chat identifier
8134        pub chat_id: i64,
8135        /// User identifier
8136        pub user_id: i64,
8137    }
8138    /// The user authorization state has changed
8139    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
8140    pub struct UpdateAuthorizationState {
8141        /// New authorization state
8142        pub authorization_state: crate::enums::AuthorizationState,
8143    }
8144    /// A new message was received; can also be an outgoing message
8145    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
8146    pub struct UpdateNewMessage {
8147        /// The new message
8148        pub message: crate::types::Message,
8149    }
8150    /// A request to send a message has reached the Telegram server. This doesn't mean that the message will be sent successfully or even that the send message request will be processed.
8151    /// This update will be sent only if the option "use_quick_ack" is set to true. This update may be sent multiple times for the same message
8152    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
8153    pub struct UpdateMessageSendAcknowledged {
8154        /// The chat identifier of the sent message
8155        pub chat_id: i64,
8156        /// A temporary message identifier
8157        pub message_id: i64,
8158    }
8159    /// A message has been successfully sent
8160    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
8161    pub struct UpdateMessageSendSucceeded {
8162        /// The sent message. Usually only the message identifier, date, and content are changed, but almost all other fields can also change
8163        pub message: crate::types::Message,
8164        /// The previous temporary message identifier
8165        pub old_message_id: i64,
8166    }
8167    /// A message failed to send. Be aware that some messages being sent can be irrecoverably deleted, in which case updateDeleteMessages will be received instead of this update
8168    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
8169    pub struct UpdateMessageSendFailed {
8170        /// The failed to send message
8171        pub message: crate::types::Message,
8172        /// The previous temporary message identifier
8173        pub old_message_id: i64,
8174        /// The cause of the message sending failure
8175        pub error: crate::types::Error,
8176    }
8177    /// The message content has changed
8178    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
8179    pub struct UpdateMessageContent {
8180        /// Chat identifier
8181        pub chat_id: i64,
8182        /// Message identifier
8183        pub message_id: i64,
8184        /// New message content
8185        pub new_content: crate::enums::MessageContent,
8186    }
8187    /// A message was edited. Changes in the message content will come in a separate updateMessageContent
8188    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
8189    pub struct UpdateMessageEdited {
8190        /// Chat identifier
8191        pub chat_id: i64,
8192        /// Message identifier
8193        pub message_id: i64,
8194        /// Point in time (Unix timestamp) when the message was edited
8195        pub edit_date: i32,
8196        /// New message reply markup; may be null
8197        pub reply_markup: Option<crate::enums::ReplyMarkup>,
8198    }
8199    /// The message pinned state was changed
8200    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
8201    pub struct UpdateMessageIsPinned {
8202        /// Chat identifier
8203        pub chat_id: i64,
8204        /// The message identifier
8205        pub message_id: i64,
8206        /// True, if the message is pinned
8207        pub is_pinned: bool,
8208    }
8209    /// The information about interactions with a message has changed
8210    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
8211    pub struct UpdateMessageInteractionInfo {
8212        /// Chat identifier
8213        pub chat_id: i64,
8214        /// Message identifier
8215        pub message_id: i64,
8216        /// New information about interactions with the message; may be null
8217        pub interaction_info: Option<crate::types::MessageInteractionInfo>,
8218    }
8219    /// The message content was opened. Updates voice note messages to "listened", video note messages to "viewed" and starts the self-destruct timer
8220    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
8221    pub struct UpdateMessageContentOpened {
8222        /// Chat identifier
8223        pub chat_id: i64,
8224        /// Message identifier
8225        pub message_id: i64,
8226    }
8227    /// A message with an unread mention was read
8228    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
8229    pub struct UpdateMessageMentionRead {
8230        /// Chat identifier
8231        pub chat_id: i64,
8232        /// Message identifier
8233        pub message_id: i64,
8234        /// The new number of unread mention messages left in the chat
8235        pub unread_mention_count: i32,
8236    }
8237    /// The list of unread reactions added to a message was changed
8238    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
8239    pub struct UpdateMessageUnreadReactions {
8240        /// Chat identifier
8241        pub chat_id: i64,
8242        /// Message identifier
8243        pub message_id: i64,
8244        /// The new list of unread reactions
8245        pub unread_reactions: Vec<crate::types::UnreadReaction>,
8246        /// The new number of messages with unread reactions left in the chat
8247        pub unread_reaction_count: i32,
8248    }
8249    /// A message with a live location was viewed. When the update is received, the application is supposed to update the live location
8250    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
8251    pub struct UpdateMessageLiveLocationViewed {
8252        /// Identifier of the chat with the live location message
8253        pub chat_id: i64,
8254        /// Identifier of the message with live location
8255        pub message_id: i64,
8256    }
8257    /// A new chat has been loaded/created. This update is guaranteed to come before the chat identifier is returned to the application. The chat field changes will be reported through separate updates
8258    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
8259    pub struct UpdateNewChat {
8260        /// The chat
8261        pub chat: crate::types::Chat,
8262    }
8263    /// The title of a chat was changed
8264    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
8265    pub struct UpdateChatTitle {
8266        /// Chat identifier
8267        pub chat_id: i64,
8268        /// The new chat title
8269        pub title: String,
8270    }
8271    /// A chat photo was changed
8272    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
8273    pub struct UpdateChatPhoto {
8274        /// Chat identifier
8275        pub chat_id: i64,
8276        /// The new chat photo; may be null
8277        pub photo: Option<crate::types::ChatPhotoInfo>,
8278    }
8279    /// Chat permissions was changed
8280    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
8281    pub struct UpdateChatPermissions {
8282        /// Chat identifier
8283        pub chat_id: i64,
8284        /// The new chat permissions
8285        pub permissions: crate::types::ChatPermissions,
8286    }
8287    /// The last message of a chat was changed. If last_message is null, then the last message in the chat became unknown. Some new unknown messages might be added to the chat in this case
8288    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
8289    pub struct UpdateChatLastMessage {
8290        /// Chat identifier
8291        pub chat_id: i64,
8292        /// The new last message in the chat; may be null
8293        pub last_message: Option<crate::types::Message>,
8294        /// The new chat positions in the chat lists
8295        pub positions: Vec<crate::types::ChatPosition>,
8296    }
8297    /// The position of a chat in a chat list has changed. An updateChatLastMessage or updateChatDraftMessage update might be sent instead of the update
8298    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
8299    pub struct UpdateChatPosition {
8300        /// Chat identifier
8301        pub chat_id: i64,
8302        /// New chat position. If new order is 0, then the chat needs to be removed from the list
8303        pub position: crate::types::ChatPosition,
8304    }
8305    /// Incoming messages were read or the number of unread messages has been changed
8306    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
8307    pub struct UpdateChatReadInbox {
8308        /// Chat identifier
8309        pub chat_id: i64,
8310        /// Identifier of the last read incoming message
8311        pub last_read_inbox_message_id: i64,
8312        /// The number of unread messages left in the chat
8313        pub unread_count: i32,
8314    }
8315    /// Outgoing messages were read
8316    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
8317    pub struct UpdateChatReadOutbox {
8318        /// Chat identifier
8319        pub chat_id: i64,
8320        /// Identifier of last read outgoing message
8321        pub last_read_outbox_message_id: i64,
8322    }
8323    /// The chat action bar was changed
8324    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
8325    pub struct UpdateChatActionBar {
8326        /// Chat identifier
8327        pub chat_id: i64,
8328        /// The new value of the action bar; may be null
8329        pub action_bar: Option<crate::enums::ChatActionBar>,
8330    }
8331    /// The chat available reactions were changed
8332    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
8333    pub struct UpdateChatAvailableReactions {
8334        /// Chat identifier
8335        pub chat_id: i64,
8336        /// The new reactions, available in the chat
8337        pub available_reactions: crate::enums::ChatAvailableReactions,
8338    }
8339    /// A chat draft has changed. Be aware that the update may come in the currently opened chat but with old content of the draft. If the user has changed the content of the draft, this update mustn't be applied
8340    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
8341    pub struct UpdateChatDraftMessage {
8342        /// Chat identifier
8343        pub chat_id: i64,
8344        /// The new draft message; may be null
8345        pub draft_message: Option<crate::types::DraftMessage>,
8346        /// The new chat positions in the chat lists
8347        pub positions: Vec<crate::types::ChatPosition>,
8348    }
8349    /// The message sender that is selected to send messages in a chat has changed
8350    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
8351    pub struct UpdateChatMessageSender {
8352        /// Chat identifier
8353        pub chat_id: i64,
8354        /// New value of message_sender_id; may be null if the user can't change message sender
8355        pub message_sender_id: Option<crate::enums::MessageSender>,
8356    }
8357    /// The message auto-delete or self-destruct timer setting for a chat was changed
8358    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
8359    pub struct UpdateChatMessageAutoDeleteTime {
8360        /// Chat identifier
8361        pub chat_id: i64,
8362        /// New value of message_auto_delete_time
8363        pub message_auto_delete_time: i32,
8364    }
8365    /// Notification settings for a chat were changed
8366    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
8367    pub struct UpdateChatNotificationSettings {
8368        /// Chat identifier
8369        pub chat_id: i64,
8370        /// The new notification settings
8371        pub notification_settings: crate::types::ChatNotificationSettings,
8372    }
8373    /// The chat pending join requests were changed
8374    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
8375    pub struct UpdateChatPendingJoinRequests {
8376        /// Chat identifier
8377        pub chat_id: i64,
8378        /// The new data about pending join requests; may be null
8379        pub pending_join_requests: Option<crate::types::ChatJoinRequestsInfo>,
8380    }
8381    /// The default chat reply markup was changed. Can occur because new messages with reply markup were received or because an old reply markup was hidden by the user
8382    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
8383    pub struct UpdateChatReplyMarkup {
8384        /// Chat identifier
8385        pub chat_id: i64,
8386        /// Identifier of the message from which reply markup needs to be used; 0 if there is no default custom reply markup in the chat
8387        pub reply_markup_message_id: i64,
8388    }
8389    /// The chat background was changed
8390    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
8391    pub struct UpdateChatBackground {
8392        /// Chat identifier
8393        pub chat_id: i64,
8394        /// The new chat background; may be null if background was reset to default
8395        pub background: Option<crate::types::ChatBackground>,
8396    }
8397    /// The chat theme was changed
8398    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
8399    pub struct UpdateChatTheme {
8400        /// Chat identifier
8401        pub chat_id: i64,
8402        /// The new name of the chat theme; may be empty if theme was reset to default
8403        pub theme_name: String,
8404    }
8405    /// The chat unread_mention_count has changed
8406    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
8407    pub struct UpdateChatUnreadMentionCount {
8408        /// Chat identifier
8409        pub chat_id: i64,
8410        /// The number of unread mention messages left in the chat
8411        pub unread_mention_count: i32,
8412    }
8413    /// The chat unread_reaction_count has changed
8414    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
8415    pub struct UpdateChatUnreadReactionCount {
8416        /// Chat identifier
8417        pub chat_id: i64,
8418        /// The number of messages with unread reactions left in the chat
8419        pub unread_reaction_count: i32,
8420    }
8421    /// A chat video chat state has changed
8422    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
8423    pub struct UpdateChatVideoChat {
8424        /// Chat identifier
8425        pub chat_id: i64,
8426        /// New value of video_chat
8427        pub video_chat: crate::types::VideoChat,
8428    }
8429    /// The value of the default disable_notification parameter, used when a message is sent to the chat, was changed
8430    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
8431    pub struct UpdateChatDefaultDisableNotification {
8432        /// Chat identifier
8433        pub chat_id: i64,
8434        /// The new default_disable_notification value
8435        pub default_disable_notification: bool,
8436    }
8437    /// A chat content was allowed or restricted for saving
8438    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
8439    pub struct UpdateChatHasProtectedContent {
8440        /// Chat identifier
8441        pub chat_id: i64,
8442        /// New value of has_protected_content
8443        pub has_protected_content: bool,
8444    }
8445    /// Translation of chat messages was enabled or disabled
8446    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
8447    pub struct UpdateChatIsTranslatable {
8448        /// Chat identifier
8449        pub chat_id: i64,
8450        /// New value of is_translatable
8451        pub is_translatable: bool,
8452    }
8453    /// A chat was marked as unread or was read
8454    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
8455    pub struct UpdateChatIsMarkedAsUnread {
8456        /// Chat identifier
8457        pub chat_id: i64,
8458        /// New value of is_marked_as_unread
8459        pub is_marked_as_unread: bool,
8460    }
8461    /// A chat was blocked or unblocked
8462    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
8463    pub struct UpdateChatBlockList {
8464        /// Chat identifier
8465        pub chat_id: i64,
8466        /// Block list to which the chat is added; may be null if none
8467        pub block_list: Option<crate::enums::BlockList>,
8468    }
8469    /// A chat's has_scheduled_messages field has changed
8470    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
8471    pub struct UpdateChatHasScheduledMessages {
8472        /// Chat identifier
8473        pub chat_id: i64,
8474        /// New value of has_scheduled_messages
8475        pub has_scheduled_messages: bool,
8476    }
8477    /// The list of chat folders or a chat folder has changed
8478    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
8479    pub struct UpdateChatFolders {
8480        /// The new list of chat folders
8481        pub chat_folders: Vec<crate::types::ChatFolderInfo>,
8482        /// Position of the main chat list among chat folders, 0-based
8483        pub main_chat_list_position: i32,
8484    }
8485    /// The number of online group members has changed. This update with non-zero number of online group members is sent only for currently opened chats.
8486    /// There is no guarantee that it will be sent just after the number of online users has changed
8487    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
8488    pub struct UpdateChatOnlineMemberCount {
8489        /// Identifier of the chat
8490        pub chat_id: i64,
8491        /// New number of online members in the chat, or 0 if unknown
8492        pub online_member_count: i32,
8493    }
8494    /// Basic information about a topic in a forum chat was changed
8495    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
8496    pub struct UpdateForumTopicInfo {
8497        /// Chat identifier
8498        pub chat_id: i64,
8499        /// New information about the topic
8500        pub info: crate::types::ForumTopicInfo,
8501    }
8502    /// Notification settings for some type of chats were updated
8503    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
8504    pub struct UpdateScopeNotificationSettings {
8505        /// Types of chats for which notification settings were updated
8506        pub scope: crate::enums::NotificationSettingsScope,
8507        /// The new notification settings
8508        pub notification_settings: crate::types::ScopeNotificationSettings,
8509    }
8510    /// A notification was changed
8511    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
8512    pub struct UpdateNotification {
8513        /// Unique notification group identifier
8514        pub notification_group_id: i32,
8515        /// Changed notification
8516        pub notification: crate::types::Notification,
8517    }
8518    /// A list of active notifications in a notification group has changed
8519    #[serde_as]
8520    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
8521    pub struct UpdateNotificationGroup {
8522        /// Unique notification group identifier
8523        pub notification_group_id: i32,
8524        /// New type of the notification group
8525        pub r#type: crate::enums::NotificationGroupType,
8526        /// Identifier of a chat to which all notifications in the group belong
8527        pub chat_id: i64,
8528        /// Chat identifier, which notification settings must be applied to the added notifications
8529        pub notification_settings_chat_id: i64,
8530        /// Identifier of the notification sound to be played; 0 if sound is disabled
8531        #[serde_as(as = "DisplayFromStr")]
8532        pub notification_sound_id: i64,
8533        /// Total number of unread notifications in the group, can be bigger than number of active notifications
8534        pub total_count: i32,
8535        /// List of added group notifications, sorted by notification identifier
8536        pub added_notifications: Vec<crate::types::Notification>,
8537        /// Identifiers of removed group notifications, sorted by notification identifier
8538        pub removed_notification_ids: Vec<i32>,
8539    }
8540    /// Contains active notifications that was shown on previous application launches. This update is sent only if the message database is used. In that case it comes once before any updateNotification and updateNotificationGroup update
8541    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
8542    pub struct UpdateActiveNotifications {
8543        /// Lists of active notification groups
8544        pub groups: Vec<crate::types::NotificationGroup>,
8545    }
8546    /// Describes whether there are some pending notification updates. Can be used to prevent application from killing, while there are some pending notifications
8547    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
8548    pub struct UpdateHavePendingNotifications {
8549        /// True, if there are some delayed notification updates, which will be sent soon
8550        pub have_delayed_notifications: bool,
8551        /// True, if there can be some yet unreceived notifications, which are being fetched from the server
8552        pub have_unreceived_notifications: bool,
8553    }
8554    /// Some messages were deleted
8555    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
8556    pub struct UpdateDeleteMessages {
8557        /// Chat identifier
8558        pub chat_id: i64,
8559        /// Identifiers of the deleted messages
8560        pub message_ids: Vec<i64>,
8561        /// True, if the messages are permanently deleted by a user (as opposed to just becoming inaccessible)
8562        pub is_permanent: bool,
8563        /// True, if the messages are deleted only from the cache and can possibly be retrieved again in the future
8564        pub from_cache: bool,
8565    }
8566    /// A message sender activity in the chat has changed
8567    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
8568    pub struct UpdateChatAction {
8569        /// Chat identifier
8570        pub chat_id: i64,
8571        /// If not 0, a message thread identifier in which the action was performed
8572        pub message_thread_id: i64,
8573        /// Identifier of a message sender performing the action
8574        pub sender_id: crate::enums::MessageSender,
8575        /// The action
8576        pub action: crate::enums::ChatAction,
8577    }
8578    /// The user went online or offline
8579    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
8580    pub struct UpdateUserStatus {
8581        /// User identifier
8582        pub user_id: i64,
8583        /// New status of the user
8584        pub status: crate::enums::UserStatus,
8585    }
8586    /// Some data of a user has changed. This update is guaranteed to come before the user identifier is returned to the application
8587    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
8588    pub struct UpdateUser {
8589        /// New data about the user
8590        pub user: crate::types::User,
8591    }
8592    /// Some data of a basic group has changed. This update is guaranteed to come before the basic group identifier is returned to the application
8593    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
8594    pub struct UpdateBasicGroup {
8595        /// New data about the group
8596        pub basic_group: crate::types::BasicGroup,
8597    }
8598    /// Some data of a supergroup or a channel has changed. This update is guaranteed to come before the supergroup identifier is returned to the application
8599    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
8600    pub struct UpdateSupergroup {
8601        /// New data about the supergroup
8602        pub supergroup: crate::types::Supergroup,
8603    }
8604    /// Some data of a secret chat has changed. This update is guaranteed to come before the secret chat identifier is returned to the application
8605    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
8606    pub struct UpdateSecretChat {
8607        /// New data about the secret chat
8608        pub secret_chat: crate::types::SecretChat,
8609    }
8610    /// Some data in userFullInfo has been changed
8611    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
8612    pub struct UpdateUserFullInfo {
8613        /// User identifier
8614        pub user_id: i64,
8615        /// New full information about the user
8616        pub user_full_info: crate::types::UserFullInfo,
8617    }
8618    /// Some data in basicGroupFullInfo has been changed
8619    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
8620    pub struct UpdateBasicGroupFullInfo {
8621        /// Identifier of a basic group
8622        pub basic_group_id: i64,
8623        /// New full information about the group
8624        pub basic_group_full_info: crate::types::BasicGroupFullInfo,
8625    }
8626    /// Some data in supergroupFullInfo has been changed
8627    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
8628    pub struct UpdateSupergroupFullInfo {
8629        /// Identifier of the supergroup or channel
8630        pub supergroup_id: i64,
8631        /// New full information about the supergroup
8632        pub supergroup_full_info: crate::types::SupergroupFullInfo,
8633    }
8634    /// A service notification from the server was received. Upon receiving this the application must show a popup with the content of the notification
8635    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
8636    pub struct UpdateServiceNotification {
8637        /// Notification type. If type begins with "AUTH_KEY_DROP_", then two buttons "Cancel" and "Log out" must be shown under notification; if user presses the second, all local data must be destroyed using Destroy method
8638        pub r#type: String,
8639        /// Notification content
8640        pub content: crate::enums::MessageContent,
8641    }
8642    /// Information about a file was updated
8643    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
8644    pub struct UpdateFile {
8645        /// New data about the file
8646        pub file: crate::types::File,
8647    }
8648    /// The file generation process needs to be started by the application
8649    #[serde_as]
8650    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
8651    pub struct UpdateFileGenerationStart {
8652        /// Unique identifier for the generation process
8653        #[serde_as(as = "DisplayFromStr")]
8654        pub generation_id: i64,
8655        /// The path to a file from which a new file is generated; may be empty
8656        pub original_path: String,
8657        /// The path to a file that must be created and where the new file is generated
8658        pub destination_path: String,
8659        /// String specifying the conversion applied to the original file. If conversion is "#url#" than original_path contains an HTTP/HTTPS URL of a file, which must be downloaded by the application
8660        pub conversion: String,
8661    }
8662    /// File generation is no longer needed
8663    #[serde_as]
8664    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
8665    pub struct UpdateFileGenerationStop {
8666        /// Unique identifier for the generation process
8667        #[serde_as(as = "DisplayFromStr")]
8668        pub generation_id: i64,
8669    }
8670    /// The state of the file download list has changed
8671    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
8672    pub struct UpdateFileDownloads {
8673        /// Total size of files in the file download list, in bytes
8674        pub total_size: i64,
8675        /// Total number of files in the file download list
8676        pub total_count: i32,
8677        /// Total downloaded size of files in the file download list, in bytes
8678        pub downloaded_size: i64,
8679    }
8680    /// A file was added to the file download list. This update is sent only after file download list is loaded for the first time
8681    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
8682    pub struct UpdateFileAddedToDownloads {
8683        /// The added file download
8684        pub file_download: crate::types::FileDownload,
8685        /// New number of being downloaded and recently downloaded files found
8686        pub counts: crate::types::DownloadedFileCounts,
8687    }
8688    /// A file download was changed. This update is sent only after file download list is loaded for the first time
8689    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
8690    pub struct UpdateFileDownload {
8691        /// File identifier
8692        pub file_id: i32,
8693        /// Point in time (Unix timestamp) when the file downloading was completed; 0 if the file downloading isn't completed
8694        pub complete_date: i32,
8695        /// True, if downloading of the file is paused
8696        pub is_paused: bool,
8697        /// New number of being downloaded and recently downloaded files found
8698        pub counts: crate::types::DownloadedFileCounts,
8699    }
8700    /// A file was removed from the file download list. This update is sent only after file download list is loaded for the first time
8701    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
8702    pub struct UpdateFileRemovedFromDownloads {
8703        /// File identifier
8704        pub file_id: i32,
8705        /// New number of being downloaded and recently downloaded files found
8706        pub counts: crate::types::DownloadedFileCounts,
8707    }
8708    /// New call was created or information about a call was updated
8709    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
8710    pub struct UpdateCall {
8711        /// New data about a call
8712        pub call: crate::types::Call,
8713    }
8714    /// Information about a group call was updated
8715    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
8716    pub struct UpdateGroupCall {
8717        /// New data about a group call
8718        pub group_call: crate::types::GroupCall,
8719    }
8720    /// Information about a group call participant was changed. The updates are sent only after the group call is received through getGroupCall and only if the call is joined or being joined
8721    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
8722    pub struct UpdateGroupCallParticipant {
8723        /// Identifier of group call
8724        pub group_call_id: i32,
8725        /// New data about a participant
8726        pub participant: crate::types::GroupCallParticipant,
8727    }
8728    /// New call signaling data arrived
8729    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
8730    pub struct UpdateNewCallSignalingData {
8731        /// The call identifier
8732        pub call_id: i32,
8733        /// The data
8734        pub data: String,
8735    }
8736    /// Some privacy setting rules have been changed
8737    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
8738    pub struct UpdateUserPrivacySettingRules {
8739        /// The privacy setting
8740        pub setting: crate::enums::UserPrivacySetting,
8741        /// New privacy rules
8742        pub rules: crate::types::UserPrivacySettingRules,
8743    }
8744    /// Number of unread messages in a chat list has changed. This update is sent only if the message database is used
8745    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
8746    pub struct UpdateUnreadMessageCount {
8747        /// The chat list with changed number of unread messages
8748        pub chat_list: crate::enums::ChatList,
8749        /// Total number of unread messages
8750        pub unread_count: i32,
8751        /// Total number of unread messages in unmuted chats
8752        pub unread_unmuted_count: i32,
8753    }
8754    /// Number of unread chats, i.e. with unread messages or marked as unread, has changed. This update is sent only if the message database is used
8755    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
8756    pub struct UpdateUnreadChatCount {
8757        /// The chat list with changed number of unread messages
8758        pub chat_list: crate::enums::ChatList,
8759        /// Approximate total number of chats in the chat list
8760        pub total_count: i32,
8761        /// Total number of unread chats
8762        pub unread_count: i32,
8763        /// Total number of unread unmuted chats
8764        pub unread_unmuted_count: i32,
8765        /// Total number of chats marked as unread
8766        pub marked_as_unread_count: i32,
8767        /// Total number of unmuted chats marked as unread
8768        pub marked_as_unread_unmuted_count: i32,
8769    }
8770    /// A story was changed
8771    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
8772    pub struct UpdateStory {
8773        /// The new information about the story
8774        pub story: crate::types::Story,
8775    }
8776    /// A story became inaccessible
8777    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
8778    pub struct UpdateStoryDeleted {
8779        /// Identifier of the chat that posted the story
8780        pub story_sender_chat_id: i64,
8781        /// Story identifier
8782        pub story_id: i32,
8783    }
8784    /// A story has been successfully sent
8785    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
8786    pub struct UpdateStorySendSucceeded {
8787        /// The sent story
8788        pub story: crate::types::Story,
8789        /// The previous temporary story identifier
8790        pub old_story_id: i32,
8791    }
8792    /// A story failed to send. If the story sending is canceled, then updateStoryDeleted will be received instead of this update
8793    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
8794    pub struct UpdateStorySendFailed {
8795        /// The failed to send story
8796        pub story: crate::types::Story,
8797        /// The cause of the story sending failure
8798        pub error: crate::types::Error,
8799        /// Type of the error; may be null if unknown
8800        pub error_type: Option<crate::enums::CanSendStoryResult>,
8801    }
8802    /// The list of active stories posted by a specific chat has changed
8803    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
8804    pub struct UpdateChatActiveStories {
8805        /// The new list of active stories
8806        pub active_stories: crate::types::ChatActiveStories,
8807    }
8808    /// Number of chats in a story list has changed
8809    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
8810    pub struct UpdateStoryListChatCount {
8811        /// The story list
8812        pub story_list: crate::enums::StoryList,
8813        /// Approximate total number of chats with active stories in the list
8814        pub chat_count: i32,
8815    }
8816    /// Story stealth mode settings have changed
8817    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
8818    pub struct UpdateStoryStealthMode {
8819        /// Point in time (Unix timestamp) until stealth mode is active; 0 if it is disabled
8820        pub active_until_date: i32,
8821        /// Point in time (Unix timestamp) when stealth mode can be enabled again; 0 if there is no active cooldown
8822        pub cooldown_until_date: i32,
8823    }
8824    /// An option changed its value
8825    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
8826    pub struct UpdateOption {
8827        /// The option name
8828        pub name: String,
8829        /// The new option value
8830        pub value: crate::enums::OptionValue,
8831    }
8832    /// A sticker set has changed
8833    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
8834    pub struct UpdateStickerSet {
8835        /// The sticker set
8836        pub sticker_set: crate::types::StickerSet,
8837    }
8838    /// The list of installed sticker sets was updated
8839    #[serde_as]
8840    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
8841    pub struct UpdateInstalledStickerSets {
8842        /// Type of the affected stickers
8843        pub sticker_type: crate::enums::StickerType,
8844        /// The new list of installed ordinary sticker sets
8845        #[serde_as(as = "Vec<DisplayFromStr>")]
8846        pub sticker_set_ids: Vec<i64>,
8847    }
8848    /// The list of trending sticker sets was updated or some of them were viewed
8849    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
8850    pub struct UpdateTrendingStickerSets {
8851        /// Type of the affected stickers
8852        pub sticker_type: crate::enums::StickerType,
8853        /// The prefix of the list of trending sticker sets with the newest trending sticker sets
8854        pub sticker_sets: crate::types::TrendingStickerSets,
8855    }
8856    /// The list of recently used stickers was updated
8857    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
8858    pub struct UpdateRecentStickers {
8859        /// True, if the list of stickers attached to photo or video files was updated; otherwise, the list of sent stickers is updated
8860        pub is_attached: bool,
8861        /// The new list of file identifiers of recently used stickers
8862        pub sticker_ids: Vec<i32>,
8863    }
8864    /// The list of favorite stickers was updated
8865    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
8866    pub struct UpdateFavoriteStickers {
8867        /// The new list of file identifiers of favorite stickers
8868        pub sticker_ids: Vec<i32>,
8869    }
8870    /// The list of saved animations was updated
8871    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
8872    pub struct UpdateSavedAnimations {
8873        /// The new list of file identifiers of saved animations
8874        pub animation_ids: Vec<i32>,
8875    }
8876    /// The list of saved notifications sounds was updated. This update may not be sent until information about a notification sound was requested for the first time
8877    #[serde_as]
8878    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
8879    pub struct UpdateSavedNotificationSounds {
8880        /// The new list of identifiers of saved notification sounds
8881        #[serde_as(as = "Vec<DisplayFromStr>")]
8882        pub notification_sound_ids: Vec<i64>,
8883    }
8884    /// The selected background has changed
8885    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
8886    pub struct UpdateSelectedBackground {
8887        /// True, if background for dark theme has changed
8888        pub for_dark_theme: bool,
8889        /// The new selected background; may be null
8890        pub background: Option<crate::types::Background>,
8891    }
8892    /// The list of available chat themes has changed
8893    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
8894    pub struct UpdateChatThemes {
8895        /// The new list of chat themes
8896        pub chat_themes: Vec<crate::types::ChatTheme>,
8897    }
8898    /// Some language pack strings have been updated
8899    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
8900    pub struct UpdateLanguagePackStrings {
8901        /// Localization target to which the language pack belongs
8902        pub localization_target: String,
8903        /// Identifier of the updated language pack
8904        pub language_pack_id: String,
8905        /// List of changed language pack strings; empty if all strings have changed
8906        pub strings: Vec<crate::types::LanguagePackString>,
8907    }
8908    /// The connection state has changed. This update must be used only to show a human-readable description of the connection state
8909    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
8910    pub struct UpdateConnectionState {
8911        /// The new connection state
8912        pub state: crate::enums::ConnectionState,
8913    }
8914    /// New terms of service must be accepted by the user. If the terms of service are declined, then the deleteAccount method must be called with the reason "Decline ToS update"
8915    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
8916    pub struct UpdateTermsOfService {
8917        /// Identifier of the terms of service
8918        pub terms_of_service_id: String,
8919        /// The new terms of service
8920        pub terms_of_service: crate::types::TermsOfService,
8921    }
8922    /// The list of users nearby has changed. The update is guaranteed to be sent only 60 seconds after a successful searchChatsNearby request
8923    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
8924    pub struct UpdateUsersNearby {
8925        /// The new list of users nearby
8926        pub users_nearby: Vec<crate::types::ChatNearby>,
8927    }
8928    /// The first unconfirmed session has changed
8929    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
8930    pub struct UpdateUnconfirmedSession {
8931        /// The unconfirmed session; may be null if none
8932        pub session: Option<crate::types::UnconfirmedSession>,
8933    }
8934    /// The list of bots added to attachment or side menu has changed
8935    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
8936    pub struct UpdateAttachmentMenuBots {
8937        /// The new list of bots. The bots must not be shown on scheduled messages screen
8938        pub bots: Vec<crate::types::AttachmentMenuBot>,
8939    }
8940    /// A message was sent by an opened Web App, so the Web App needs to be closed
8941    #[serde_as]
8942    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
8943    pub struct UpdateWebAppMessageSent {
8944        /// Identifier of Web App launch
8945        #[serde_as(as = "DisplayFromStr")]
8946        pub web_app_launch_id: i64,
8947    }
8948    /// The list of active emoji reactions has changed
8949    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
8950    pub struct UpdateActiveEmojiReactions {
8951        /// The new list of active emoji reactions
8952        pub emojis: Vec<String>,
8953    }
8954    /// The type of default reaction has changed
8955    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
8956    pub struct UpdateDefaultReactionType {
8957        /// The new type of the default reaction
8958        pub reaction_type: crate::enums::ReactionType,
8959    }
8960    /// The list of supported dice emojis has changed
8961    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
8962    pub struct UpdateDiceEmojis {
8963        /// The new list of supported dice emojis
8964        pub emojis: Vec<String>,
8965    }
8966    /// Some animated emoji message was clicked and a big animated sticker must be played if the message is visible on the screen. chatActionWatchingAnimations with the text of the message needs to be sent if the sticker is played
8967    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
8968    pub struct UpdateAnimatedEmojiMessageClicked {
8969        /// Chat identifier
8970        pub chat_id: i64,
8971        /// Message identifier
8972        pub message_id: i64,
8973        /// The animated sticker to be played
8974        pub sticker: crate::types::Sticker,
8975    }
8976    /// The parameters of animation search through getOption("animation_search_bot_username") bot has changed
8977    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
8978    pub struct UpdateAnimationSearchParameters {
8979        /// Name of the animation search provider
8980        pub provider: String,
8981        /// The new list of emojis suggested for searching
8982        pub emojis: Vec<String>,
8983    }
8984    /// The list of suggested to the user actions has changed
8985    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
8986    pub struct UpdateSuggestedActions {
8987        /// Added suggested actions
8988        pub added_actions: Vec<crate::enums::SuggestedAction>,
8989        /// Removed suggested actions
8990        pub removed_actions: Vec<crate::enums::SuggestedAction>,
8991    }
8992    /// Adding users to a chat has failed because of their privacy settings. An invite link can be shared with the users if appropriate
8993    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
8994    pub struct UpdateAddChatMembersPrivacyForbidden {
8995        /// Chat identifier
8996        pub chat_id: i64,
8997        /// Identifiers of users, which weren't added because of their privacy settings
8998        pub user_ids: Vec<i64>,
8999    }
9000    /// Autosave settings for some type of chats were updated
9001    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
9002    pub struct UpdateAutosaveSettings {
9003        /// Type of chats for which autosave settings were updated
9004        pub scope: crate::enums::AutosaveSettingsScope,
9005        /// The new autosave settings; may be null if the settings are reset to default
9006        pub settings: Option<crate::types::ScopeAutosaveSettings>,
9007    }
9008    /// A new incoming inline query; for bots only
9009    #[serde_as]
9010    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
9011    pub struct UpdateNewInlineQuery {
9012        /// Unique query identifier
9013        #[serde_as(as = "DisplayFromStr")]
9014        pub id: i64,
9015        /// Identifier of the user who sent the query
9016        pub sender_user_id: i64,
9017        /// User location; may be null
9018        pub user_location: Option<crate::types::Location>,
9019        /// The type of the chat from which the query originated; may be null if unknown
9020        pub chat_type: Option<crate::enums::ChatType>,
9021        /// Text of the query
9022        pub query: String,
9023        /// Offset of the first entry to return
9024        pub offset: String,
9025    }
9026    /// The user has chosen a result of an inline query; for bots only
9027    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
9028    pub struct UpdateNewChosenInlineResult {
9029        /// Identifier of the user who sent the query
9030        pub sender_user_id: i64,
9031        /// User location; may be null
9032        pub user_location: Option<crate::types::Location>,
9033        /// Text of the query
9034        pub query: String,
9035        /// Identifier of the chosen result
9036        pub result_id: String,
9037        /// Identifier of the sent inline message, if known
9038        pub inline_message_id: String,
9039    }
9040    /// A new incoming callback query; for bots only
9041    #[serde_as]
9042    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
9043    pub struct UpdateNewCallbackQuery {
9044        /// Unique query identifier
9045        #[serde_as(as = "DisplayFromStr")]
9046        pub id: i64,
9047        /// Identifier of the user who sent the query
9048        pub sender_user_id: i64,
9049        /// Identifier of the chat where the query was sent
9050        pub chat_id: i64,
9051        /// Identifier of the message from which the query originated
9052        pub message_id: i64,
9053        /// Identifier that uniquely corresponds to the chat to which the message was sent
9054        #[serde_as(as = "DisplayFromStr")]
9055        pub chat_instance: i64,
9056        /// Query payload
9057        pub payload: crate::enums::CallbackQueryPayload,
9058    }
9059    /// A new incoming callback query from a message sent via a bot; for bots only
9060    #[serde_as]
9061    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
9062    pub struct UpdateNewInlineCallbackQuery {
9063        /// Unique query identifier
9064        #[serde_as(as = "DisplayFromStr")]
9065        pub id: i64,
9066        /// Identifier of the user who sent the query
9067        pub sender_user_id: i64,
9068        /// Identifier of the inline message from which the query originated
9069        pub inline_message_id: String,
9070        /// An identifier uniquely corresponding to the chat a message was sent to
9071        #[serde_as(as = "DisplayFromStr")]
9072        pub chat_instance: i64,
9073        /// Query payload
9074        pub payload: crate::enums::CallbackQueryPayload,
9075    }
9076    /// A new incoming shipping query; for bots only. Only for invoices with flexible price
9077    #[serde_as]
9078    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
9079    pub struct UpdateNewShippingQuery {
9080        /// Unique query identifier
9081        #[serde_as(as = "DisplayFromStr")]
9082        pub id: i64,
9083        /// Identifier of the user who sent the query
9084        pub sender_user_id: i64,
9085        /// Invoice payload
9086        pub invoice_payload: String,
9087        /// User shipping address
9088        pub shipping_address: crate::types::Address,
9089    }
9090    /// A new incoming pre-checkout query; for bots only. Contains full information about a checkout
9091    #[serde_as]
9092    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
9093    pub struct UpdateNewPreCheckoutQuery {
9094        /// Unique query identifier
9095        #[serde_as(as = "DisplayFromStr")]
9096        pub id: i64,
9097        /// Identifier of the user who sent the query
9098        pub sender_user_id: i64,
9099        /// Currency for the product price
9100        pub currency: String,
9101        /// Total price for the product, in the smallest units of the currency
9102        pub total_amount: i64,
9103        /// Invoice payload
9104        pub invoice_payload: String,
9105        /// Identifier of a shipping option chosen by the user; may be empty if not applicable
9106        pub shipping_option_id: String,
9107        /// Information about the order; may be null
9108        pub order_info: Option<crate::types::OrderInfo>,
9109    }
9110    /// A new incoming event; for bots only
9111    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
9112    pub struct UpdateNewCustomEvent {
9113        /// A JSON-serialized event
9114        pub event: String,
9115    }
9116    /// A new incoming query; for bots only
9117    #[serde_as]
9118    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
9119    pub struct UpdateNewCustomQuery {
9120        /// The query identifier
9121        #[serde_as(as = "DisplayFromStr")]
9122        pub id: i64,
9123        /// JSON-serialized query data
9124        pub data: String,
9125        /// Query timeout
9126        pub timeout: i32,
9127    }
9128    /// A poll was updated; for bots only
9129    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
9130    pub struct UpdatePoll {
9131        /// New data about the poll
9132        pub poll: crate::types::Poll,
9133    }
9134    /// A user changed the answer to a poll; for bots only
9135    #[serde_as]
9136    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
9137    pub struct UpdatePollAnswer {
9138        /// Unique poll identifier
9139        #[serde_as(as = "DisplayFromStr")]
9140        pub poll_id: i64,
9141        /// Identifier of the message sender that changed the answer to the poll
9142        pub voter_id: crate::enums::MessageSender,
9143        /// 0-based identifiers of answer options, chosen by the user
9144        pub option_ids: Vec<i32>,
9145    }
9146    /// User rights changed in a chat; for bots only
9147    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
9148    pub struct UpdateChatMember {
9149        /// Chat identifier
9150        pub chat_id: i64,
9151        /// Identifier of the user, changing the rights
9152        pub actor_user_id: i64,
9153        /// Point in time (Unix timestamp) when the user rights was changed
9154        pub date: i32,
9155        /// If user has joined the chat using an invite link, the invite link; may be null
9156        pub invite_link: Option<crate::types::ChatInviteLink>,
9157        /// True, if the user has joined the chat using an invite link for a chat folder
9158        pub via_chat_folder_invite_link: bool,
9159        /// Previous chat member
9160        pub old_chat_member: crate::types::ChatMember,
9161        /// New chat member
9162        pub new_chat_member: crate::types::ChatMember,
9163    }
9164    /// A user sent a join request to a chat; for bots only
9165    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
9166    pub struct UpdateNewChatJoinRequest {
9167        /// Chat identifier
9168        pub chat_id: i64,
9169        /// Join request
9170        pub request: crate::types::ChatJoinRequest,
9171        /// Chat identifier of the private chat with the user
9172        pub user_chat_id: i64,
9173        /// The invite link, which was used to send join request; may be null
9174        pub invite_link: Option<crate::types::ChatInviteLink>,
9175    }
9176    /// Contains a list of updates
9177    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
9178    pub struct Updates {
9179        /// List of updates
9180        pub updates: Vec<crate::enums::Update>,
9181    }
9182    /// The log is written to a file
9183    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
9184    pub struct LogStreamFile {
9185        /// Path to the file to where the internal TDLib log will be written
9186        pub path: String,
9187        /// The maximum size of the file to where the internal TDLib log is written before the file will automatically be rotated, in bytes
9188        pub max_file_size: i64,
9189        /// Pass true to additionally redirect stderr to the log file. Ignored on Windows
9190        pub redirect_stderr: bool,
9191    }
9192    /// Contains a TDLib internal log verbosity level
9193    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
9194    pub struct LogVerbosityLevel {
9195        /// Log verbosity level
9196        pub verbosity_level: i32,
9197    }
9198    /// Contains a list of available TDLib internal log tags
9199    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
9200    pub struct LogTags {
9201        /// List of log tags
9202        pub tags: Vec<String>,
9203    }
9204    /// Contains custom information about the user
9205    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
9206    pub struct UserSupportInfo {
9207        /// Information message
9208        pub message: crate::types::FormattedText,
9209        /// Information author
9210        pub author: String,
9211        /// Information change date
9212        pub date: i32,
9213    }
9214    /// A simple object containing a number; for testing only
9215    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
9216    pub struct TestInt {
9217        /// Number
9218        pub value: i32,
9219    }
9220    /// A simple object containing a string; for testing only
9221    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
9222    pub struct TestString {
9223        /// String
9224        pub value: String,
9225    }
9226    /// A simple object containing a sequence of bytes; for testing only
9227    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
9228    pub struct TestBytes {
9229        /// Bytes
9230        pub value: String,
9231    }
9232    /// A simple object containing a vector of numbers; for testing only
9233    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
9234    pub struct TestVectorInt {
9235        /// Vector of numbers
9236        pub value: Vec<i32>,
9237    }
9238    /// A simple object containing a vector of objects that hold a number; for testing only
9239    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
9240    pub struct TestVectorIntObject {
9241        /// Vector of objects
9242        pub value: Vec<crate::types::TestInt>,
9243    }
9244    /// A simple object containing a vector of strings; for testing only
9245    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
9246    pub struct TestVectorString {
9247        /// Vector of strings
9248        pub value: Vec<String>,
9249    }
9250    /// A simple object containing a vector of objects that hold a string; for testing only
9251    #[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)]
9252    pub struct TestVectorStringObject {
9253        /// Vector of objects
9254        pub value: Vec<crate::types::TestString>,
9255    }
9256}
9257pub mod enums {
9258    use serde::{Deserialize, Serialize};
9259    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
9260    #[serde(tag = "@type")]
9261    pub enum Error {
9262        /// An object of this type can be returned on every function call, in case of an error
9263        #[serde(rename(serialize = "error", deserialize = "error"))]
9264        Error(crate::types::Error),
9265    }
9266    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
9267    #[serde(tag = "@type")]
9268    pub enum AuthenticationCodeType {
9269        /// An authentication code is delivered via a private Telegram message, which can be viewed from another active session
9270        #[serde(rename(serialize = "authenticationCodeTypeTelegramMessage", deserialize = "authenticationCodeTypeTelegramMessage"))]
9271        TelegramMessage(crate::types::AuthenticationCodeTypeTelegramMessage),
9272        /// An authentication code is delivered via an SMS message to the specified phone number; applications may not receive this type of code
9273        #[serde(rename(serialize = "authenticationCodeTypeSms", deserialize = "authenticationCodeTypeSms"))]
9274        Sms(crate::types::AuthenticationCodeTypeSms),
9275        /// An authentication code is delivered via a phone call to the specified phone number
9276        #[serde(rename(serialize = "authenticationCodeTypeCall", deserialize = "authenticationCodeTypeCall"))]
9277        Call(crate::types::AuthenticationCodeTypeCall),
9278        /// An authentication code is delivered by an immediately canceled call to the specified phone number. The phone number that calls is the code that must be entered automatically
9279        #[serde(rename(serialize = "authenticationCodeTypeFlashCall", deserialize = "authenticationCodeTypeFlashCall"))]
9280        FlashCall(crate::types::AuthenticationCodeTypeFlashCall),
9281        /// An authentication code is delivered by an immediately canceled call to the specified phone number. The last digits of the phone number that calls are the code that must be entered manually by the user
9282        #[serde(rename(serialize = "authenticationCodeTypeMissedCall", deserialize = "authenticationCodeTypeMissedCall"))]
9283        MissedCall(crate::types::AuthenticationCodeTypeMissedCall),
9284        /// An authentication code is delivered to https:fragment.com. The user must be logged in there via a wallet owning the phone number's NFT
9285        #[serde(rename(serialize = "authenticationCodeTypeFragment", deserialize = "authenticationCodeTypeFragment"))]
9286        Fragment(crate::types::AuthenticationCodeTypeFragment),
9287        /// An authentication code is delivered via Firebase Authentication to the official Android application
9288        #[serde(rename(serialize = "authenticationCodeTypeFirebaseAndroid", deserialize = "authenticationCodeTypeFirebaseAndroid"))]
9289        FirebaseAndroid(crate::types::AuthenticationCodeTypeFirebaseAndroid),
9290        /// An authentication code is delivered via Firebase Authentication to the official iOS application
9291        #[serde(rename(serialize = "authenticationCodeTypeFirebaseIos", deserialize = "authenticationCodeTypeFirebaseIos"))]
9292        FirebaseIos(crate::types::AuthenticationCodeTypeFirebaseIos),
9293    }
9294    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
9295    #[serde(tag = "@type")]
9296    pub enum AuthenticationCodeInfo {
9297        /// Information about the authentication code that was sent
9298        #[serde(rename(serialize = "authenticationCodeInfo", deserialize = "authenticationCodeInfo"))]
9299        AuthenticationCodeInfo(crate::types::AuthenticationCodeInfo),
9300    }
9301    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
9302    #[serde(tag = "@type")]
9303    pub enum EmailAddressAuthenticationCodeInfo {
9304        /// Information about the email address authentication code that was sent
9305        #[serde(rename(serialize = "emailAddressAuthenticationCodeInfo", deserialize = "emailAddressAuthenticationCodeInfo"))]
9306        EmailAddressAuthenticationCodeInfo(crate::types::EmailAddressAuthenticationCodeInfo),
9307    }
9308    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
9309    #[serde(tag = "@type")]
9310    pub enum EmailAddressAuthentication {
9311        /// An authentication code delivered to a user's email address
9312        #[serde(rename(serialize = "emailAddressAuthenticationCode", deserialize = "emailAddressAuthenticationCode"))]
9313        Code(crate::types::EmailAddressAuthenticationCode),
9314        /// An authentication token received through Apple ID
9315        #[serde(rename(serialize = "emailAddressAuthenticationAppleId", deserialize = "emailAddressAuthenticationAppleId"))]
9316        AppleId(crate::types::EmailAddressAuthenticationAppleId),
9317        /// An authentication token received through Google ID
9318        #[serde(rename(serialize = "emailAddressAuthenticationGoogleId", deserialize = "emailAddressAuthenticationGoogleId"))]
9319        GoogleId(crate::types::EmailAddressAuthenticationGoogleId),
9320    }
9321    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
9322    #[serde(tag = "@type")]
9323    pub enum EmailAddressResetState {
9324        /// Email address can be reset after the given period. Call resetAuthenticationEmailAddress to reset it and allow the user to authorize with a code sent to the user's phone number
9325        #[serde(rename(serialize = "emailAddressResetStateAvailable", deserialize = "emailAddressResetStateAvailable"))]
9326        Available(crate::types::EmailAddressResetStateAvailable),
9327        /// Email address reset has already been requested. Call resetAuthenticationEmailAddress to check whether immediate reset is possible
9328        #[serde(rename(serialize = "emailAddressResetStatePending", deserialize = "emailAddressResetStatePending"))]
9329        Pending(crate::types::EmailAddressResetStatePending),
9330    }
9331    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
9332    #[serde(tag = "@type")]
9333    pub enum TextEntity {
9334        /// Represents a part of the text that needs to be formatted in some unusual way
9335        #[serde(rename(serialize = "textEntity", deserialize = "textEntity"))]
9336        TextEntity(crate::types::TextEntity),
9337    }
9338    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
9339    #[serde(tag = "@type")]
9340    pub enum TextEntities {
9341        /// Contains a list of text entities
9342        #[serde(rename(serialize = "textEntities", deserialize = "textEntities"))]
9343        TextEntities(crate::types::TextEntities),
9344    }
9345    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
9346    #[serde(tag = "@type")]
9347    pub enum FormattedText {
9348        /// A text with some entities
9349        #[serde(rename(serialize = "formattedText", deserialize = "formattedText"))]
9350        FormattedText(crate::types::FormattedText),
9351    }
9352    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
9353    #[serde(tag = "@type")]
9354    pub enum TermsOfService {
9355        /// Contains Telegram terms of service
9356        #[serde(rename(serialize = "termsOfService", deserialize = "termsOfService"))]
9357        TermsOfService(crate::types::TermsOfService),
9358    }
9359    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
9360    #[serde(tag = "@type")]
9361    pub enum AuthorizationState {
9362        /// Initialization parameters are needed. Call setTdlibParameters to provide them
9363        #[serde(rename(serialize = "authorizationStateWaitTdlibParameters", deserialize = "authorizationStateWaitTdlibParameters"))]
9364        WaitTdlibParameters,
9365        /// TDLib needs the user's phone number to authorize. Call setAuthenticationPhoneNumber to provide the phone number, or use requestQrCodeAuthentication or checkAuthenticationBotToken for other authentication options
9366        #[serde(rename(serialize = "authorizationStateWaitPhoneNumber", deserialize = "authorizationStateWaitPhoneNumber"))]
9367        WaitPhoneNumber,
9368        /// TDLib needs the user's email address to authorize. Call setAuthenticationEmailAddress to provide the email address, or directly call checkAuthenticationEmailCode with Apple ID/Google ID token if allowed
9369        #[serde(rename(serialize = "authorizationStateWaitEmailAddress", deserialize = "authorizationStateWaitEmailAddress"))]
9370        WaitEmailAddress(crate::types::AuthorizationStateWaitEmailAddress),
9371        /// TDLib needs the user's authentication code sent to an email address to authorize. Call checkAuthenticationEmailCode to provide the code
9372        #[serde(rename(serialize = "authorizationStateWaitEmailCode", deserialize = "authorizationStateWaitEmailCode"))]
9373        WaitEmailCode(crate::types::AuthorizationStateWaitEmailCode),
9374        /// TDLib needs the user's authentication code to authorize. Call checkAuthenticationCode to check the code
9375        #[serde(rename(serialize = "authorizationStateWaitCode", deserialize = "authorizationStateWaitCode"))]
9376        WaitCode(crate::types::AuthorizationStateWaitCode),
9377        /// The user needs to confirm authorization on another logged in device by scanning a QR code with the provided link
9378        #[serde(rename(serialize = "authorizationStateWaitOtherDeviceConfirmation", deserialize = "authorizationStateWaitOtherDeviceConfirmation"))]
9379        WaitOtherDeviceConfirmation(crate::types::AuthorizationStateWaitOtherDeviceConfirmation),
9380        /// The user is unregistered and need to accept terms of service and enter their first name and last name to finish registration. Call registerUser to accept the terms of service and provide the data
9381        #[serde(rename(serialize = "authorizationStateWaitRegistration", deserialize = "authorizationStateWaitRegistration"))]
9382        WaitRegistration(crate::types::AuthorizationStateWaitRegistration),
9383        /// The user has been authorized, but needs to enter a 2-step verification password to start using the application.
9384        /// Call checkAuthenticationPassword to provide the password, or requestAuthenticationPasswordRecovery to recover the password, or deleteAccount to delete the account after a week
9385        #[serde(rename(serialize = "authorizationStateWaitPassword", deserialize = "authorizationStateWaitPassword"))]
9386        WaitPassword(crate::types::AuthorizationStateWaitPassword),
9387        /// The user has been successfully authorized. TDLib is now ready to answer general requests
9388        #[serde(rename(serialize = "authorizationStateReady", deserialize = "authorizationStateReady"))]
9389        Ready,
9390        /// The user is currently logging out
9391        #[serde(rename(serialize = "authorizationStateLoggingOut", deserialize = "authorizationStateLoggingOut"))]
9392        LoggingOut,
9393        /// TDLib is closing, all subsequent queries will be answered with the error 500. Note that closing TDLib can take a while. All resources will be freed only after authorizationStateClosed has been received
9394        #[serde(rename(serialize = "authorizationStateClosing", deserialize = "authorizationStateClosing"))]
9395        Closing,
9396        /// TDLib client is in its final state. All databases are closed and all resources are released. No other updates will be received after this. All queries will be responded to
9397        /// with error code 500. To continue working, one must create a new instance of the TDLib client
9398        #[serde(rename(serialize = "authorizationStateClosed", deserialize = "authorizationStateClosed"))]
9399        Closed,
9400    }
9401    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
9402    #[serde(tag = "@type")]
9403    pub enum PasswordState {
9404        /// Represents the current state of 2-step verification
9405        #[serde(rename(serialize = "passwordState", deserialize = "passwordState"))]
9406        PasswordState(crate::types::PasswordState),
9407    }
9408    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
9409    #[serde(tag = "@type")]
9410    pub enum RecoveryEmailAddress {
9411        /// Contains information about the current recovery email address
9412        #[serde(rename(serialize = "recoveryEmailAddress", deserialize = "recoveryEmailAddress"))]
9413        RecoveryEmailAddress(crate::types::RecoveryEmailAddress),
9414    }
9415    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
9416    #[serde(tag = "@type")]
9417    pub enum TemporaryPasswordState {
9418        /// Returns information about the availability of a temporary password, which can be used for payments
9419        #[serde(rename(serialize = "temporaryPasswordState", deserialize = "temporaryPasswordState"))]
9420        TemporaryPasswordState(crate::types::TemporaryPasswordState),
9421    }
9422    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
9423    #[serde(tag = "@type")]
9424    pub enum LocalFile {
9425        /// Represents a local file
9426        #[serde(rename(serialize = "localFile", deserialize = "localFile"))]
9427        LocalFile(crate::types::LocalFile),
9428    }
9429    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
9430    #[serde(tag = "@type")]
9431    pub enum RemoteFile {
9432        /// Represents a remote file
9433        #[serde(rename(serialize = "remoteFile", deserialize = "remoteFile"))]
9434        RemoteFile(crate::types::RemoteFile),
9435    }
9436    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
9437    #[serde(tag = "@type")]
9438    pub enum File {
9439        /// Represents a file
9440        #[serde(rename(serialize = "file", deserialize = "file"))]
9441        File(crate::types::File),
9442    }
9443    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
9444    #[serde(tag = "@type")]
9445    pub enum InputFile {
9446        /// A file defined by its unique identifier
9447        #[serde(rename(serialize = "inputFileId", deserialize = "inputFileId"))]
9448        Id(crate::types::InputFileId),
9449        /// A file defined by its remote identifier. The remote identifier is guaranteed to be usable only if the corresponding file is still accessible to the user and known to TDLib.
9450        /// For example, if the file is from a message, then the message must be not deleted and accessible to the user. If the file database is disabled, then the corresponding object with the file must be preloaded by the application
9451        #[serde(rename(serialize = "inputFileRemote", deserialize = "inputFileRemote"))]
9452        Remote(crate::types::InputFileRemote),
9453        /// A file defined by a local path
9454        #[serde(rename(serialize = "inputFileLocal", deserialize = "inputFileLocal"))]
9455        Local(crate::types::InputFileLocal),
9456        /// A file generated by the application
9457        #[serde(rename(serialize = "inputFileGenerated", deserialize = "inputFileGenerated"))]
9458        Generated(crate::types::InputFileGenerated),
9459    }
9460    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
9461    #[serde(tag = "@type")]
9462    pub enum PhotoSize {
9463        /// Describes an image in JPEG format
9464        #[serde(rename(serialize = "photoSize", deserialize = "photoSize"))]
9465        PhotoSize(crate::types::PhotoSize),
9466    }
9467    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
9468    #[serde(tag = "@type")]
9469    pub enum Minithumbnail {
9470        /// Thumbnail image of a very poor quality and low resolution
9471        #[serde(rename(serialize = "minithumbnail", deserialize = "minithumbnail"))]
9472        Minithumbnail(crate::types::Minithumbnail),
9473    }
9474    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
9475    #[serde(tag = "@type")]
9476    pub enum ThumbnailFormat {
9477        /// The thumbnail is in JPEG format
9478        #[serde(rename(serialize = "thumbnailFormatJpeg", deserialize = "thumbnailFormatJpeg"))]
9479        Jpeg,
9480        /// The thumbnail is in static GIF format. It will be used only for some bot inline query results
9481        #[serde(rename(serialize = "thumbnailFormatGif", deserialize = "thumbnailFormatGif"))]
9482        Gif,
9483        /// The thumbnail is in MPEG4 format. It will be used only for some animations and videos
9484        #[serde(rename(serialize = "thumbnailFormatMpeg4", deserialize = "thumbnailFormatMpeg4"))]
9485        Mpeg4,
9486        /// The thumbnail is in PNG format. It will be used only for background patterns
9487        #[serde(rename(serialize = "thumbnailFormatPng", deserialize = "thumbnailFormatPng"))]
9488        Png,
9489        /// The thumbnail is in TGS format. It will be used only for TGS sticker sets
9490        #[serde(rename(serialize = "thumbnailFormatTgs", deserialize = "thumbnailFormatTgs"))]
9491        Tgs,
9492        /// The thumbnail is in WEBM format. It will be used only for WEBM sticker sets
9493        #[serde(rename(serialize = "thumbnailFormatWebm", deserialize = "thumbnailFormatWebm"))]
9494        Webm,
9495        /// The thumbnail is in WEBP format. It will be used only for some stickers
9496        #[serde(rename(serialize = "thumbnailFormatWebp", deserialize = "thumbnailFormatWebp"))]
9497        Webp,
9498    }
9499    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
9500    #[serde(tag = "@type")]
9501    pub enum Thumbnail {
9502        /// Represents a thumbnail
9503        #[serde(rename(serialize = "thumbnail", deserialize = "thumbnail"))]
9504        Thumbnail(crate::types::Thumbnail),
9505    }
9506    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
9507    #[serde(tag = "@type")]
9508    pub enum MaskPoint {
9509        /// The mask is placed relatively to the forehead
9510        #[serde(rename(serialize = "maskPointForehead", deserialize = "maskPointForehead"))]
9511        Forehead,
9512        /// The mask is placed relatively to the eyes
9513        #[serde(rename(serialize = "maskPointEyes", deserialize = "maskPointEyes"))]
9514        Eyes,
9515        /// The mask is placed relatively to the mouth
9516        #[serde(rename(serialize = "maskPointMouth", deserialize = "maskPointMouth"))]
9517        Mouth,
9518        /// The mask is placed relatively to the chin
9519        #[serde(rename(serialize = "maskPointChin", deserialize = "maskPointChin"))]
9520        Chin,
9521    }
9522    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
9523    #[serde(tag = "@type")]
9524    pub enum MaskPosition {
9525        /// Position on a photo where a mask is placed
9526        #[serde(rename(serialize = "maskPosition", deserialize = "maskPosition"))]
9527        MaskPosition(crate::types::MaskPosition),
9528    }
9529    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
9530    #[serde(tag = "@type")]
9531    pub enum StickerFormat {
9532        /// The sticker is an image in WEBP format
9533        #[serde(rename(serialize = "stickerFormatWebp", deserialize = "stickerFormatWebp"))]
9534        Webp,
9535        /// The sticker is an animation in TGS format
9536        #[serde(rename(serialize = "stickerFormatTgs", deserialize = "stickerFormatTgs"))]
9537        Tgs,
9538        /// The sticker is a video in WEBM format
9539        #[serde(rename(serialize = "stickerFormatWebm", deserialize = "stickerFormatWebm"))]
9540        Webm,
9541    }
9542    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
9543    #[serde(tag = "@type")]
9544    pub enum StickerType {
9545        /// The sticker is a regular sticker
9546        #[serde(rename(serialize = "stickerTypeRegular", deserialize = "stickerTypeRegular"))]
9547        Regular,
9548        /// The sticker is a mask in WEBP format to be placed on photos or videos
9549        #[serde(rename(serialize = "stickerTypeMask", deserialize = "stickerTypeMask"))]
9550        Mask,
9551        /// The sticker is a custom emoji to be used inside message text and caption
9552        #[serde(rename(serialize = "stickerTypeCustomEmoji", deserialize = "stickerTypeCustomEmoji"))]
9553        CustomEmoji,
9554    }
9555    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
9556    #[serde(tag = "@type")]
9557    pub enum StickerFullType {
9558        /// The sticker is a regular sticker
9559        #[serde(rename(serialize = "stickerFullTypeRegular", deserialize = "stickerFullTypeRegular"))]
9560        Regular(crate::types::StickerFullTypeRegular),
9561        /// The sticker is a mask in WEBP format to be placed on photos or videos
9562        #[serde(rename(serialize = "stickerFullTypeMask", deserialize = "stickerFullTypeMask"))]
9563        Mask(crate::types::StickerFullTypeMask),
9564        /// The sticker is a custom emoji to be used inside message text and caption. Currently, only Telegram Premium users can use custom emoji
9565        #[serde(rename(serialize = "stickerFullTypeCustomEmoji", deserialize = "stickerFullTypeCustomEmoji"))]
9566        CustomEmoji(crate::types::StickerFullTypeCustomEmoji),
9567    }
9568    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
9569    #[serde(tag = "@type")]
9570    pub enum ClosedVectorPath {
9571        /// Represents a closed vector path. The path begins at the end point of the last command
9572        #[serde(rename(serialize = "closedVectorPath", deserialize = "closedVectorPath"))]
9573        ClosedVectorPath(crate::types::ClosedVectorPath),
9574    }
9575    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
9576    #[serde(tag = "@type")]
9577    pub enum PollOption {
9578        /// Describes one answer option of a poll
9579        #[serde(rename(serialize = "pollOption", deserialize = "pollOption"))]
9580        PollOption(crate::types::PollOption),
9581    }
9582    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
9583    #[serde(tag = "@type")]
9584    pub enum PollType {
9585        /// A regular poll
9586        #[serde(rename(serialize = "pollTypeRegular", deserialize = "pollTypeRegular"))]
9587        Regular(crate::types::PollTypeRegular),
9588        /// A poll in quiz mode, which has exactly one correct answer option and can be answered only once
9589        #[serde(rename(serialize = "pollTypeQuiz", deserialize = "pollTypeQuiz"))]
9590        Quiz(crate::types::PollTypeQuiz),
9591    }
9592    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
9593    #[serde(tag = "@type")]
9594    pub enum Animation {
9595        /// Describes an animation file. The animation must be encoded in GIF or MPEG4 format
9596        #[serde(rename(serialize = "animation", deserialize = "animation"))]
9597        Animation(crate::types::Animation),
9598    }
9599    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
9600    #[serde(tag = "@type")]
9601    pub enum Audio {
9602        /// Describes an audio file. Audio is usually in MP3 or M4A format
9603        #[serde(rename(serialize = "audio", deserialize = "audio"))]
9604        Audio(crate::types::Audio),
9605    }
9606    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
9607    #[serde(tag = "@type")]
9608    pub enum Document {
9609        /// Describes a document of any type
9610        #[serde(rename(serialize = "document", deserialize = "document"))]
9611        Document(crate::types::Document),
9612    }
9613    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
9614    #[serde(tag = "@type")]
9615    pub enum Photo {
9616        /// Describes a photo
9617        #[serde(rename(serialize = "photo", deserialize = "photo"))]
9618        Photo(crate::types::Photo),
9619    }
9620    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
9621    #[serde(tag = "@type")]
9622    pub enum Sticker {
9623        /// Describes a sticker
9624        #[serde(rename(serialize = "sticker", deserialize = "sticker"))]
9625        Sticker(crate::types::Sticker),
9626    }
9627    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
9628    #[serde(tag = "@type")]
9629    pub enum Video {
9630        /// Describes a video file
9631        #[serde(rename(serialize = "video", deserialize = "video"))]
9632        Video(crate::types::Video),
9633    }
9634    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
9635    #[serde(tag = "@type")]
9636    pub enum VideoNote {
9637        /// Describes a video note. The video must be equal in width and height, cropped to a circle, and stored in MPEG4 format
9638        #[serde(rename(serialize = "videoNote", deserialize = "videoNote"))]
9639        VideoNote(crate::types::VideoNote),
9640    }
9641    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
9642    #[serde(tag = "@type")]
9643    pub enum VoiceNote {
9644        /// Describes a voice note. The voice note must be encoded with the Opus codec, and stored inside an OGG container. Voice notes can have only a single audio channel
9645        #[serde(rename(serialize = "voiceNote", deserialize = "voiceNote"))]
9646        VoiceNote(crate::types::VoiceNote),
9647    }
9648    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
9649    #[serde(tag = "@type")]
9650    pub enum AnimatedEmoji {
9651        /// Describes an animated or custom representation of an emoji
9652        #[serde(rename(serialize = "animatedEmoji", deserialize = "animatedEmoji"))]
9653        AnimatedEmoji(crate::types::AnimatedEmoji),
9654    }
9655    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
9656    #[serde(tag = "@type")]
9657    pub enum Contact {
9658        /// Describes a user contact
9659        #[serde(rename(serialize = "contact", deserialize = "contact"))]
9660        Contact(crate::types::Contact),
9661    }
9662    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
9663    #[serde(tag = "@type")]
9664    pub enum Location {
9665        /// Describes a location on planet Earth
9666        #[serde(rename(serialize = "location", deserialize = "location"))]
9667        Location(crate::types::Location),
9668    }
9669    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
9670    #[serde(tag = "@type")]
9671    pub enum Venue {
9672        /// Describes a venue
9673        #[serde(rename(serialize = "venue", deserialize = "venue"))]
9674        Venue(crate::types::Venue),
9675    }
9676    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
9677    #[serde(tag = "@type")]
9678    pub enum Game {
9679        /// Describes a game. Use getInternalLink with internalLinkTypeGame to share the game
9680        #[serde(rename(serialize = "game", deserialize = "game"))]
9681        Game(crate::types::Game),
9682    }
9683    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
9684    #[serde(tag = "@type")]
9685    pub enum WebApp {
9686        /// Describes a Web App. Use getInternalLink with internalLinkTypeWebApp to share the Web App
9687        #[serde(rename(serialize = "webApp", deserialize = "webApp"))]
9688        WebApp(crate::types::WebApp),
9689    }
9690    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
9691    #[serde(tag = "@type")]
9692    pub enum Poll {
9693        /// Describes a poll
9694        #[serde(rename(serialize = "poll", deserialize = "poll"))]
9695        Poll(crate::types::Poll),
9696    }
9697    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
9698    #[serde(tag = "@type")]
9699    pub enum Background {
9700        /// Describes a chat background
9701        #[serde(rename(serialize = "background", deserialize = "background"))]
9702        Background(crate::types::Background),
9703    }
9704    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
9705    #[serde(tag = "@type")]
9706    pub enum Backgrounds {
9707        /// Contains a list of backgrounds
9708        #[serde(rename(serialize = "backgrounds", deserialize = "backgrounds"))]
9709        Backgrounds(crate::types::Backgrounds),
9710    }
9711    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
9712    #[serde(tag = "@type")]
9713    pub enum ChatBackground {
9714        /// Describes a background set for a specific chat
9715        #[serde(rename(serialize = "chatBackground", deserialize = "chatBackground"))]
9716        ChatBackground(crate::types::ChatBackground),
9717    }
9718    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
9719    #[serde(tag = "@type")]
9720    pub enum ProfilePhoto {
9721        /// Describes a user profile photo
9722        #[serde(rename(serialize = "profilePhoto", deserialize = "profilePhoto"))]
9723        ProfilePhoto(crate::types::ProfilePhoto),
9724    }
9725    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
9726    #[serde(tag = "@type")]
9727    pub enum ChatPhotoInfo {
9728        /// Contains basic information about the photo of a chat
9729        #[serde(rename(serialize = "chatPhotoInfo", deserialize = "chatPhotoInfo"))]
9730        ChatPhotoInfo(crate::types::ChatPhotoInfo),
9731    }
9732    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
9733    #[serde(tag = "@type")]
9734    pub enum UserType {
9735        /// A regular user
9736        #[serde(rename(serialize = "userTypeRegular", deserialize = "userTypeRegular"))]
9737        Regular,
9738        /// A deleted user or deleted bot. No information on the user besides the user identifier is available. It is not possible to perform any active actions on this type of user
9739        #[serde(rename(serialize = "userTypeDeleted", deserialize = "userTypeDeleted"))]
9740        Deleted,
9741        /// A bot (see https:core.telegram.org/bots)
9742        #[serde(rename(serialize = "userTypeBot", deserialize = "userTypeBot"))]
9743        Bot(crate::types::UserTypeBot),
9744        /// No information on the user besides the user identifier is available, yet this user has not been deleted. This object is extremely rare and must be handled like a deleted user. It is not possible to perform any actions on users of this type
9745        #[serde(rename(serialize = "userTypeUnknown", deserialize = "userTypeUnknown"))]
9746        Unknown,
9747    }
9748    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
9749    #[serde(tag = "@type")]
9750    pub enum BotCommand {
9751        /// Represents a command supported by a bot
9752        #[serde(rename(serialize = "botCommand", deserialize = "botCommand"))]
9753        BotCommand(crate::types::BotCommand),
9754    }
9755    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
9756    #[serde(tag = "@type")]
9757    pub enum BotCommands {
9758        /// Contains a list of bot commands
9759        #[serde(rename(serialize = "botCommands", deserialize = "botCommands"))]
9760        BotCommands(crate::types::BotCommands),
9761    }
9762    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
9763    #[serde(tag = "@type")]
9764    pub enum BotMenuButton {
9765        /// Describes a button to be shown instead of bot commands menu button
9766        #[serde(rename(serialize = "botMenuButton", deserialize = "botMenuButton"))]
9767        BotMenuButton(crate::types::BotMenuButton),
9768    }
9769    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
9770    #[serde(tag = "@type")]
9771    pub enum ChatLocation {
9772        /// Represents a location to which a chat is connected
9773        #[serde(rename(serialize = "chatLocation", deserialize = "chatLocation"))]
9774        ChatLocation(crate::types::ChatLocation),
9775    }
9776    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
9777    #[serde(tag = "@type")]
9778    pub enum ChatPhotoStickerType {
9779        /// Information about the sticker, which was used to create the chat photo
9780        #[serde(rename(serialize = "chatPhotoStickerTypeRegularOrMask", deserialize = "chatPhotoStickerTypeRegularOrMask"))]
9781        RegularOrMask(crate::types::ChatPhotoStickerTypeRegularOrMask),
9782        /// Information about the custom emoji, which was used to create the chat photo
9783        #[serde(rename(serialize = "chatPhotoStickerTypeCustomEmoji", deserialize = "chatPhotoStickerTypeCustomEmoji"))]
9784        CustomEmoji(crate::types::ChatPhotoStickerTypeCustomEmoji),
9785    }
9786    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
9787    #[serde(tag = "@type")]
9788    pub enum ChatPhotoSticker {
9789        /// Information about the sticker, which was used to create the chat photo. The sticker is shown at the center of the photo and occupies at most 67% of it
9790        #[serde(rename(serialize = "chatPhotoSticker", deserialize = "chatPhotoSticker"))]
9791        ChatPhotoSticker(crate::types::ChatPhotoSticker),
9792    }
9793    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
9794    #[serde(tag = "@type")]
9795    pub enum AnimatedChatPhoto {
9796        /// Animated variant of a chat photo in MPEG4 format
9797        #[serde(rename(serialize = "animatedChatPhoto", deserialize = "animatedChatPhoto"))]
9798        AnimatedChatPhoto(crate::types::AnimatedChatPhoto),
9799    }
9800    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
9801    #[serde(tag = "@type")]
9802    pub enum ChatPhoto {
9803        /// Describes a chat or user profile photo
9804        #[serde(rename(serialize = "chatPhoto", deserialize = "chatPhoto"))]
9805        ChatPhoto(crate::types::ChatPhoto),
9806    }
9807    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
9808    #[serde(tag = "@type")]
9809    pub enum ChatPhotos {
9810        /// Contains a list of chat or user profile photos
9811        #[serde(rename(serialize = "chatPhotos", deserialize = "chatPhotos"))]
9812        ChatPhotos(crate::types::ChatPhotos),
9813    }
9814    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
9815    #[serde(tag = "@type")]
9816    pub enum InputChatPhoto {
9817        /// A previously used profile photo of the current user
9818        #[serde(rename(serialize = "inputChatPhotoPrevious", deserialize = "inputChatPhotoPrevious"))]
9819        Previous(crate::types::InputChatPhotoPrevious),
9820        /// A static photo in JPEG format
9821        #[serde(rename(serialize = "inputChatPhotoStatic", deserialize = "inputChatPhotoStatic"))]
9822        Static(crate::types::InputChatPhotoStatic),
9823        /// An animation in MPEG4 format; must be square, at most 10 seconds long, have width between 160 and 1280 and be at most 2MB in size
9824        #[serde(rename(serialize = "inputChatPhotoAnimation", deserialize = "inputChatPhotoAnimation"))]
9825        Animation(crate::types::InputChatPhotoAnimation),
9826        /// A sticker on a custom background
9827        #[serde(rename(serialize = "inputChatPhotoSticker", deserialize = "inputChatPhotoSticker"))]
9828        Sticker(crate::types::InputChatPhotoSticker),
9829    }
9830    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
9831    #[serde(tag = "@type")]
9832    pub enum ChatPermissions {
9833        /// Describes actions that a user is allowed to take in a chat
9834        #[serde(rename(serialize = "chatPermissions", deserialize = "chatPermissions"))]
9835        ChatPermissions(crate::types::ChatPermissions),
9836    }
9837    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
9838    #[serde(tag = "@type")]
9839    pub enum ChatAdministratorRights {
9840        /// Describes rights of the administrator
9841        #[serde(rename(serialize = "chatAdministratorRights", deserialize = "chatAdministratorRights"))]
9842        ChatAdministratorRights(crate::types::ChatAdministratorRights),
9843    }
9844    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
9845    #[serde(tag = "@type")]
9846    pub enum PremiumPaymentOption {
9847        /// Describes an option for buying Telegram Premium to a user
9848        #[serde(rename(serialize = "premiumPaymentOption", deserialize = "premiumPaymentOption"))]
9849        PremiumPaymentOption(crate::types::PremiumPaymentOption),
9850    }
9851    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
9852    #[serde(tag = "@type")]
9853    pub enum PremiumStatePaymentOption {
9854        /// Describes an option for buying or upgrading Telegram Premium for self
9855        #[serde(rename(serialize = "premiumStatePaymentOption", deserialize = "premiumStatePaymentOption"))]
9856        PremiumStatePaymentOption(crate::types::PremiumStatePaymentOption),
9857    }
9858    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
9859    #[serde(tag = "@type")]
9860    pub enum EmojiStatus {
9861        /// Describes a custom emoji to be shown instead of the Telegram Premium badge
9862        #[serde(rename(serialize = "emojiStatus", deserialize = "emojiStatus"))]
9863        EmojiStatus(crate::types::EmojiStatus),
9864    }
9865    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
9866    #[serde(tag = "@type")]
9867    pub enum EmojiStatuses {
9868        /// Contains a list of custom emoji identifiers, which can be set as emoji statuses
9869        #[serde(rename(serialize = "emojiStatuses", deserialize = "emojiStatuses"))]
9870        EmojiStatuses(crate::types::EmojiStatuses),
9871    }
9872    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
9873    #[serde(tag = "@type")]
9874    pub enum Usernames {
9875        /// Describes usernames assigned to a user, a supergroup, or a channel
9876        #[serde(rename(serialize = "usernames", deserialize = "usernames"))]
9877        Usernames(crate::types::Usernames),
9878    }
9879    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
9880    #[serde(tag = "@type")]
9881    pub enum User {
9882        /// Represents a user
9883        #[serde(rename(serialize = "user", deserialize = "user"))]
9884        User(crate::types::User),
9885    }
9886    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
9887    #[serde(tag = "@type")]
9888    pub enum BotInfo {
9889        /// Contains information about a bot
9890        #[serde(rename(serialize = "botInfo", deserialize = "botInfo"))]
9891        BotInfo(crate::types::BotInfo),
9892    }
9893    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
9894    #[serde(tag = "@type")]
9895    pub enum UserFullInfo {
9896        /// Contains full information about a user
9897        #[serde(rename(serialize = "userFullInfo", deserialize = "userFullInfo"))]
9898        UserFullInfo(crate::types::UserFullInfo),
9899    }
9900    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
9901    #[serde(tag = "@type")]
9902    pub enum Users {
9903        /// Represents a list of users
9904        #[serde(rename(serialize = "users", deserialize = "users"))]
9905        Users(crate::types::Users),
9906    }
9907    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
9908    #[serde(tag = "@type")]
9909    pub enum ChatAdministrator {
9910        /// Contains information about a chat administrator
9911        #[serde(rename(serialize = "chatAdministrator", deserialize = "chatAdministrator"))]
9912        ChatAdministrator(crate::types::ChatAdministrator),
9913    }
9914    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
9915    #[serde(tag = "@type")]
9916    pub enum ChatAdministrators {
9917        /// Represents a list of chat administrators
9918        #[serde(rename(serialize = "chatAdministrators", deserialize = "chatAdministrators"))]
9919        ChatAdministrators(crate::types::ChatAdministrators),
9920    }
9921    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
9922    #[serde(tag = "@type")]
9923    pub enum ChatMemberStatus {
9924        /// The user is the owner of the chat and has all the administrator privileges
9925        #[serde(rename(serialize = "chatMemberStatusCreator", deserialize = "chatMemberStatusCreator"))]
9926        Creator(crate::types::ChatMemberStatusCreator),
9927        /// The user is a member of the chat and has some additional privileges. In basic groups, administrators can edit and delete messages sent by others, add new members, ban unprivileged members, and manage video chats.
9928        /// In supergroups and channels, there are more detailed options for administrator privileges
9929        #[serde(rename(serialize = "chatMemberStatusAdministrator", deserialize = "chatMemberStatusAdministrator"))]
9930        Administrator(crate::types::ChatMemberStatusAdministrator),
9931        /// The user is a member of the chat, without any additional privileges or restrictions
9932        #[serde(rename(serialize = "chatMemberStatusMember", deserialize = "chatMemberStatusMember"))]
9933        Member,
9934        /// The user is under certain restrictions in the chat. Not supported in basic groups and channels
9935        #[serde(rename(serialize = "chatMemberStatusRestricted", deserialize = "chatMemberStatusRestricted"))]
9936        Restricted(crate::types::ChatMemberStatusRestricted),
9937        /// The user or the chat is not a chat member
9938        #[serde(rename(serialize = "chatMemberStatusLeft", deserialize = "chatMemberStatusLeft"))]
9939        Left,
9940        /// The user or the chat was banned (and hence is not a member of the chat). Implies the user can't return to the chat, view messages, or be used as a participant identifier to join a video chat of the chat
9941        #[serde(rename(serialize = "chatMemberStatusBanned", deserialize = "chatMemberStatusBanned"))]
9942        Banned(crate::types::ChatMemberStatusBanned),
9943    }
9944    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
9945    #[serde(tag = "@type")]
9946    pub enum ChatMember {
9947        /// Describes a user or a chat as a member of another chat
9948        #[serde(rename(serialize = "chatMember", deserialize = "chatMember"))]
9949        ChatMember(crate::types::ChatMember),
9950    }
9951    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
9952    #[serde(tag = "@type")]
9953    pub enum ChatMembers {
9954        /// Contains a list of chat members
9955        #[serde(rename(serialize = "chatMembers", deserialize = "chatMembers"))]
9956        ChatMembers(crate::types::ChatMembers),
9957    }
9958    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
9959    #[serde(tag = "@type")]
9960    pub enum ChatMembersFilter {
9961        /// Returns contacts of the user
9962        #[serde(rename(serialize = "chatMembersFilterContacts", deserialize = "chatMembersFilterContacts"))]
9963        Contacts,
9964        /// Returns the owner and administrators
9965        #[serde(rename(serialize = "chatMembersFilterAdministrators", deserialize = "chatMembersFilterAdministrators"))]
9966        Administrators,
9967        /// Returns all chat members, including restricted chat members
9968        #[serde(rename(serialize = "chatMembersFilterMembers", deserialize = "chatMembersFilterMembers"))]
9969        Members,
9970        /// Returns users which can be mentioned in the chat
9971        #[serde(rename(serialize = "chatMembersFilterMention", deserialize = "chatMembersFilterMention"))]
9972        Mention(crate::types::ChatMembersFilterMention),
9973        /// Returns users under certain restrictions in the chat; can be used only by administrators in a supergroup
9974        #[serde(rename(serialize = "chatMembersFilterRestricted", deserialize = "chatMembersFilterRestricted"))]
9975        Restricted,
9976        /// Returns users banned from the chat; can be used only by administrators in a supergroup or in a channel
9977        #[serde(rename(serialize = "chatMembersFilterBanned", deserialize = "chatMembersFilterBanned"))]
9978        Banned,
9979        /// Returns bot members of the chat
9980        #[serde(rename(serialize = "chatMembersFilterBots", deserialize = "chatMembersFilterBots"))]
9981        Bots,
9982    }
9983    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
9984    #[serde(tag = "@type")]
9985    pub enum SupergroupMembersFilter {
9986        /// Returns recently active users in reverse chronological order
9987        #[serde(rename(serialize = "supergroupMembersFilterRecent", deserialize = "supergroupMembersFilterRecent"))]
9988        Recent,
9989        /// Returns contacts of the user, which are members of the supergroup or channel
9990        #[serde(rename(serialize = "supergroupMembersFilterContacts", deserialize = "supergroupMembersFilterContacts"))]
9991        Contacts(crate::types::SupergroupMembersFilterContacts),
9992        /// Returns the owner and administrators
9993        #[serde(rename(serialize = "supergroupMembersFilterAdministrators", deserialize = "supergroupMembersFilterAdministrators"))]
9994        Administrators,
9995        /// Used to search for supergroup or channel members via a (string) query
9996        #[serde(rename(serialize = "supergroupMembersFilterSearch", deserialize = "supergroupMembersFilterSearch"))]
9997        Search(crate::types::SupergroupMembersFilterSearch),
9998        /// Returns restricted supergroup members; can be used only by administrators
9999        #[serde(rename(serialize = "supergroupMembersFilterRestricted", deserialize = "supergroupMembersFilterRestricted"))]
10000        Restricted(crate::types::SupergroupMembersFilterRestricted),
10001        /// Returns users banned from the supergroup or channel; can be used only by administrators
10002        #[serde(rename(serialize = "supergroupMembersFilterBanned", deserialize = "supergroupMembersFilterBanned"))]
10003        Banned(crate::types::SupergroupMembersFilterBanned),
10004        /// Returns users which can be mentioned in the supergroup
10005        #[serde(rename(serialize = "supergroupMembersFilterMention", deserialize = "supergroupMembersFilterMention"))]
10006        Mention(crate::types::SupergroupMembersFilterMention),
10007        /// Returns bot members of the supergroup or channel
10008        #[serde(rename(serialize = "supergroupMembersFilterBots", deserialize = "supergroupMembersFilterBots"))]
10009        Bots,
10010    }
10011    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
10012    #[serde(tag = "@type")]
10013    pub enum ChatInviteLink {
10014        /// Contains a chat invite link
10015        #[serde(rename(serialize = "chatInviteLink", deserialize = "chatInviteLink"))]
10016        ChatInviteLink(crate::types::ChatInviteLink),
10017    }
10018    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
10019    #[serde(tag = "@type")]
10020    pub enum ChatInviteLinks {
10021        /// Contains a list of chat invite links
10022        #[serde(rename(serialize = "chatInviteLinks", deserialize = "chatInviteLinks"))]
10023        ChatInviteLinks(crate::types::ChatInviteLinks),
10024    }
10025    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
10026    #[serde(tag = "@type")]
10027    pub enum ChatInviteLinkCount {
10028        /// Describes a chat administrator with a number of active and revoked chat invite links
10029        #[serde(rename(serialize = "chatInviteLinkCount", deserialize = "chatInviteLinkCount"))]
10030        ChatInviteLinkCount(crate::types::ChatInviteLinkCount),
10031    }
10032    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
10033    #[serde(tag = "@type")]
10034    pub enum ChatInviteLinkCounts {
10035        /// Contains a list of chat invite link counts
10036        #[serde(rename(serialize = "chatInviteLinkCounts", deserialize = "chatInviteLinkCounts"))]
10037        ChatInviteLinkCounts(crate::types::ChatInviteLinkCounts),
10038    }
10039    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
10040    #[serde(tag = "@type")]
10041    pub enum ChatInviteLinkMember {
10042        /// Describes a chat member joined a chat via an invite link
10043        #[serde(rename(serialize = "chatInviteLinkMember", deserialize = "chatInviteLinkMember"))]
10044        ChatInviteLinkMember(crate::types::ChatInviteLinkMember),
10045    }
10046    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
10047    #[serde(tag = "@type")]
10048    pub enum ChatInviteLinkMembers {
10049        /// Contains a list of chat members joined a chat via an invite link
10050        #[serde(rename(serialize = "chatInviteLinkMembers", deserialize = "chatInviteLinkMembers"))]
10051        ChatInviteLinkMembers(crate::types::ChatInviteLinkMembers),
10052    }
10053    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
10054    #[serde(tag = "@type")]
10055    pub enum InviteLinkChatType {
10056        /// The link is an invite link for a basic group
10057        #[serde(rename(serialize = "inviteLinkChatTypeBasicGroup", deserialize = "inviteLinkChatTypeBasicGroup"))]
10058        BasicGroup,
10059        /// The link is an invite link for a supergroup
10060        #[serde(rename(serialize = "inviteLinkChatTypeSupergroup", deserialize = "inviteLinkChatTypeSupergroup"))]
10061        Supergroup,
10062        /// The link is an invite link for a channel
10063        #[serde(rename(serialize = "inviteLinkChatTypeChannel", deserialize = "inviteLinkChatTypeChannel"))]
10064        Channel,
10065    }
10066    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
10067    #[serde(tag = "@type")]
10068    pub enum ChatInviteLinkInfo {
10069        /// Contains information about a chat invite link
10070        #[serde(rename(serialize = "chatInviteLinkInfo", deserialize = "chatInviteLinkInfo"))]
10071        ChatInviteLinkInfo(crate::types::ChatInviteLinkInfo),
10072    }
10073    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
10074    #[serde(tag = "@type")]
10075    pub enum ChatJoinRequest {
10076        /// Describes a user that sent a join request and waits for administrator approval
10077        #[serde(rename(serialize = "chatJoinRequest", deserialize = "chatJoinRequest"))]
10078        ChatJoinRequest(crate::types::ChatJoinRequest),
10079    }
10080    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
10081    #[serde(tag = "@type")]
10082    pub enum ChatJoinRequests {
10083        /// Contains a list of requests to join a chat
10084        #[serde(rename(serialize = "chatJoinRequests", deserialize = "chatJoinRequests"))]
10085        ChatJoinRequests(crate::types::ChatJoinRequests),
10086    }
10087    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
10088    #[serde(tag = "@type")]
10089    pub enum ChatJoinRequestsInfo {
10090        /// Contains information about pending join requests for a chat
10091        #[serde(rename(serialize = "chatJoinRequestsInfo", deserialize = "chatJoinRequestsInfo"))]
10092        ChatJoinRequestsInfo(crate::types::ChatJoinRequestsInfo),
10093    }
10094    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
10095    #[serde(tag = "@type")]
10096    pub enum BasicGroup {
10097        /// Represents a basic group of 0-200 users (must be upgraded to a supergroup to accommodate more than 200 users)
10098        #[serde(rename(serialize = "basicGroup", deserialize = "basicGroup"))]
10099        BasicGroup(crate::types::BasicGroup),
10100    }
10101    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
10102    #[serde(tag = "@type")]
10103    pub enum BasicGroupFullInfo {
10104        /// Contains full information about a basic group
10105        #[serde(rename(serialize = "basicGroupFullInfo", deserialize = "basicGroupFullInfo"))]
10106        BasicGroupFullInfo(crate::types::BasicGroupFullInfo),
10107    }
10108    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
10109    #[serde(tag = "@type")]
10110    pub enum Supergroup {
10111        /// Represents a supergroup or channel with zero or more members (subscribers in the case of channels). From the point of view of the system, a channel is a special kind of a supergroup:
10112        /// only administrators can post and see the list of members, and posts from all administrators use the name and photo of the channel instead of individual names and profile photos.
10113        /// Unlike supergroups, channels can have an unlimited number of subscribers
10114        #[serde(rename(serialize = "supergroup", deserialize = "supergroup"))]
10115        Supergroup(crate::types::Supergroup),
10116    }
10117    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
10118    #[serde(tag = "@type")]
10119    pub enum SupergroupFullInfo {
10120        /// Contains full information about a supergroup or channel
10121        #[serde(rename(serialize = "supergroupFullInfo", deserialize = "supergroupFullInfo"))]
10122        SupergroupFullInfo(crate::types::SupergroupFullInfo),
10123    }
10124    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
10125    #[serde(tag = "@type")]
10126    pub enum SecretChatState {
10127        /// The secret chat is not yet created; waiting for the other user to get online
10128        #[serde(rename(serialize = "secretChatStatePending", deserialize = "secretChatStatePending"))]
10129        Pending,
10130        /// The secret chat is ready to use
10131        #[serde(rename(serialize = "secretChatStateReady", deserialize = "secretChatStateReady"))]
10132        Ready,
10133        /// The secret chat is closed
10134        #[serde(rename(serialize = "secretChatStateClosed", deserialize = "secretChatStateClosed"))]
10135        Closed,
10136    }
10137    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
10138    #[serde(tag = "@type")]
10139    pub enum SecretChat {
10140        /// Represents a secret chat
10141        #[serde(rename(serialize = "secretChat", deserialize = "secretChat"))]
10142        SecretChat(crate::types::SecretChat),
10143    }
10144    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
10145    #[serde(tag = "@type")]
10146    pub enum MessageSender {
10147        /// The message was sent by a known user
10148        #[serde(rename(serialize = "messageSenderUser", deserialize = "messageSenderUser"))]
10149        User(crate::types::MessageSenderUser),
10150        /// The message was sent on behalf of a chat
10151        #[serde(rename(serialize = "messageSenderChat", deserialize = "messageSenderChat"))]
10152        Chat(crate::types::MessageSenderChat),
10153    }
10154    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
10155    #[serde(tag = "@type")]
10156    pub enum MessageSenders {
10157        /// Represents a list of message senders
10158        #[serde(rename(serialize = "messageSenders", deserialize = "messageSenders"))]
10159        MessageSenders(crate::types::MessageSenders),
10160    }
10161    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
10162    #[serde(tag = "@type")]
10163    pub enum ChatMessageSender {
10164        /// Represents a message sender, which can be used to send messages in a chat
10165        #[serde(rename(serialize = "chatMessageSender", deserialize = "chatMessageSender"))]
10166        ChatMessageSender(crate::types::ChatMessageSender),
10167    }
10168    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
10169    #[serde(tag = "@type")]
10170    pub enum ChatMessageSenders {
10171        /// Represents a list of message senders, which can be used to send messages in a chat
10172        #[serde(rename(serialize = "chatMessageSenders", deserialize = "chatMessageSenders"))]
10173        ChatMessageSenders(crate::types::ChatMessageSenders),
10174    }
10175    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
10176    #[serde(tag = "@type")]
10177    pub enum MessageViewer {
10178        /// Represents a viewer of a message
10179        #[serde(rename(serialize = "messageViewer", deserialize = "messageViewer"))]
10180        MessageViewer(crate::types::MessageViewer),
10181    }
10182    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
10183    #[serde(tag = "@type")]
10184    pub enum MessageViewers {
10185        /// Represents a list of message viewers
10186        #[serde(rename(serialize = "messageViewers", deserialize = "messageViewers"))]
10187        MessageViewers(crate::types::MessageViewers),
10188    }
10189    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
10190    #[serde(tag = "@type")]
10191    pub enum MessageForwardOrigin {
10192        /// The message was originally sent by a known user
10193        #[serde(rename(serialize = "messageForwardOriginUser", deserialize = "messageForwardOriginUser"))]
10194        User(crate::types::MessageForwardOriginUser),
10195        /// The message was originally sent on behalf of a chat
10196        #[serde(rename(serialize = "messageForwardOriginChat", deserialize = "messageForwardOriginChat"))]
10197        Chat(crate::types::MessageForwardOriginChat),
10198        /// The message was originally sent by a user, which is hidden by their privacy settings
10199        #[serde(rename(serialize = "messageForwardOriginHiddenUser", deserialize = "messageForwardOriginHiddenUser"))]
10200        HiddenUser(crate::types::MessageForwardOriginHiddenUser),
10201        /// The message was originally a post in a channel
10202        #[serde(rename(serialize = "messageForwardOriginChannel", deserialize = "messageForwardOriginChannel"))]
10203        Channel(crate::types::MessageForwardOriginChannel),
10204        /// The message was imported from an exported message history
10205        #[serde(rename(serialize = "messageForwardOriginMessageImport", deserialize = "messageForwardOriginMessageImport"))]
10206        MessageImport(crate::types::MessageForwardOriginMessageImport),
10207    }
10208    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
10209    #[serde(tag = "@type")]
10210    pub enum ReactionType {
10211        /// A reaction with an emoji
10212        #[serde(rename(serialize = "reactionTypeEmoji", deserialize = "reactionTypeEmoji"))]
10213        Emoji(crate::types::ReactionTypeEmoji),
10214        /// A reaction with a custom emoji
10215        #[serde(rename(serialize = "reactionTypeCustomEmoji", deserialize = "reactionTypeCustomEmoji"))]
10216        CustomEmoji(crate::types::ReactionTypeCustomEmoji),
10217    }
10218    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
10219    #[serde(tag = "@type")]
10220    pub enum MessageForwardInfo {
10221        /// Contains information about a forwarded message
10222        #[serde(rename(serialize = "messageForwardInfo", deserialize = "messageForwardInfo"))]
10223        MessageForwardInfo(crate::types::MessageForwardInfo),
10224    }
10225    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
10226    #[serde(tag = "@type")]
10227    pub enum MessageReplyInfo {
10228        /// Contains information about replies to a message
10229        #[serde(rename(serialize = "messageReplyInfo", deserialize = "messageReplyInfo"))]
10230        MessageReplyInfo(crate::types::MessageReplyInfo),
10231    }
10232    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
10233    #[serde(tag = "@type")]
10234    pub enum MessageReaction {
10235        /// Contains information about a reaction to a message
10236        #[serde(rename(serialize = "messageReaction", deserialize = "messageReaction"))]
10237        MessageReaction(crate::types::MessageReaction),
10238    }
10239    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
10240    #[serde(tag = "@type")]
10241    pub enum MessageInteractionInfo {
10242        /// Contains information about interactions with a message
10243        #[serde(rename(serialize = "messageInteractionInfo", deserialize = "messageInteractionInfo"))]
10244        MessageInteractionInfo(crate::types::MessageInteractionInfo),
10245    }
10246    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
10247    #[serde(tag = "@type")]
10248    pub enum UnreadReaction {
10249        /// Contains information about an unread reaction to a message
10250        #[serde(rename(serialize = "unreadReaction", deserialize = "unreadReaction"))]
10251        UnreadReaction(crate::types::UnreadReaction),
10252    }
10253    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
10254    #[serde(tag = "@type")]
10255    pub enum MessageSendingState {
10256        /// The message is being sent now, but has not yet been delivered to the server
10257        #[serde(rename(serialize = "messageSendingStatePending", deserialize = "messageSendingStatePending"))]
10258        Pending(crate::types::MessageSendingStatePending),
10259        /// The message failed to be sent
10260        #[serde(rename(serialize = "messageSendingStateFailed", deserialize = "messageSendingStateFailed"))]
10261        Failed(crate::types::MessageSendingStateFailed),
10262    }
10263    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
10264    #[serde(tag = "@type")]
10265    pub enum MessageReplyTo {
10266        /// Describes a replied message
10267        #[serde(rename(serialize = "messageReplyToMessage", deserialize = "messageReplyToMessage"))]
10268        Message(crate::types::MessageReplyToMessage),
10269        /// Describes a replied story
10270        #[serde(rename(serialize = "messageReplyToStory", deserialize = "messageReplyToStory"))]
10271        Story(crate::types::MessageReplyToStory),
10272    }
10273    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
10274    #[serde(tag = "@type")]
10275    pub enum Message {
10276        /// Describes a message
10277        #[serde(rename(serialize = "message", deserialize = "message"))]
10278        Message(crate::types::Message),
10279    }
10280    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
10281    #[serde(tag = "@type")]
10282    pub enum Messages {
10283        /// Contains a list of messages
10284        #[serde(rename(serialize = "messages", deserialize = "messages"))]
10285        Messages(crate::types::Messages),
10286    }
10287    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
10288    #[serde(tag = "@type")]
10289    pub enum FoundMessages {
10290        /// Contains a list of messages found by a search
10291        #[serde(rename(serialize = "foundMessages", deserialize = "foundMessages"))]
10292        FoundMessages(crate::types::FoundMessages),
10293    }
10294    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
10295    #[serde(tag = "@type")]
10296    pub enum FoundChatMessages {
10297        /// Contains a list of messages found by a search in a given chat
10298        #[serde(rename(serialize = "foundChatMessages", deserialize = "foundChatMessages"))]
10299        FoundChatMessages(crate::types::FoundChatMessages),
10300    }
10301    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
10302    #[serde(tag = "@type")]
10303    pub enum MessagePosition {
10304        /// Contains information about a message in a specific position
10305        #[serde(rename(serialize = "messagePosition", deserialize = "messagePosition"))]
10306        MessagePosition(crate::types::MessagePosition),
10307    }
10308    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
10309    #[serde(tag = "@type")]
10310    pub enum MessagePositions {
10311        /// Contains a list of message positions
10312        #[serde(rename(serialize = "messagePositions", deserialize = "messagePositions"))]
10313        MessagePositions(crate::types::MessagePositions),
10314    }
10315    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
10316    #[serde(tag = "@type")]
10317    pub enum MessageCalendarDay {
10318        /// Contains information about found messages sent on a specific day
10319        #[serde(rename(serialize = "messageCalendarDay", deserialize = "messageCalendarDay"))]
10320        MessageCalendarDay(crate::types::MessageCalendarDay),
10321    }
10322    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
10323    #[serde(tag = "@type")]
10324    pub enum MessageCalendar {
10325        /// Contains information about found messages, split by days according to the option "utc_time_offset"
10326        #[serde(rename(serialize = "messageCalendar", deserialize = "messageCalendar"))]
10327        MessageCalendar(crate::types::MessageCalendar),
10328    }
10329    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
10330    #[serde(tag = "@type")]
10331    pub enum MessageSource {
10332        /// The message is from a chat history
10333        #[serde(rename(serialize = "messageSourceChatHistory", deserialize = "messageSourceChatHistory"))]
10334        ChatHistory,
10335        /// The message is from a message thread history
10336        #[serde(rename(serialize = "messageSourceMessageThreadHistory", deserialize = "messageSourceMessageThreadHistory"))]
10337        MessageThreadHistory,
10338        /// The message is from a forum topic history
10339        #[serde(rename(serialize = "messageSourceForumTopicHistory", deserialize = "messageSourceForumTopicHistory"))]
10340        ForumTopicHistory,
10341        /// The message is from chat, message thread or forum topic history preview
10342        #[serde(rename(serialize = "messageSourceHistoryPreview", deserialize = "messageSourceHistoryPreview"))]
10343        HistoryPreview,
10344        /// The message is from a chat list or a forum topic list
10345        #[serde(rename(serialize = "messageSourceChatList", deserialize = "messageSourceChatList"))]
10346        ChatList,
10347        /// The message is from search results, including file downloads, local file list, outgoing document messages, calendar
10348        #[serde(rename(serialize = "messageSourceSearch", deserialize = "messageSourceSearch"))]
10349        Search,
10350        /// The message is from a chat event log
10351        #[serde(rename(serialize = "messageSourceChatEventLog", deserialize = "messageSourceChatEventLog"))]
10352        ChatEventLog,
10353        /// The message is from a notification
10354        #[serde(rename(serialize = "messageSourceNotification", deserialize = "messageSourceNotification"))]
10355        Notification,
10356        /// The message was screenshotted; the source must be used only if the message content was visible during the screenshot
10357        #[serde(rename(serialize = "messageSourceScreenshot", deserialize = "messageSourceScreenshot"))]
10358        Screenshot,
10359        /// The message is from some other source
10360        #[serde(rename(serialize = "messageSourceOther", deserialize = "messageSourceOther"))]
10361        Other,
10362    }
10363    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
10364    #[serde(tag = "@type")]
10365    pub enum MessageSponsorType {
10366        /// The sponsor is a bot
10367        #[serde(rename(serialize = "messageSponsorTypeBot", deserialize = "messageSponsorTypeBot"))]
10368        Bot(crate::types::MessageSponsorTypeBot),
10369        /// The sponsor is a public channel chat
10370        #[serde(rename(serialize = "messageSponsorTypePublicChannel", deserialize = "messageSponsorTypePublicChannel"))]
10371        PublicChannel(crate::types::MessageSponsorTypePublicChannel),
10372        /// The sponsor is a private channel chat
10373        #[serde(rename(serialize = "messageSponsorTypePrivateChannel", deserialize = "messageSponsorTypePrivateChannel"))]
10374        PrivateChannel(crate::types::MessageSponsorTypePrivateChannel),
10375        /// The sponsor is a website
10376        #[serde(rename(serialize = "messageSponsorTypeWebsite", deserialize = "messageSponsorTypeWebsite"))]
10377        Website(crate::types::MessageSponsorTypeWebsite),
10378    }
10379    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
10380    #[serde(tag = "@type")]
10381    pub enum MessageSponsor {
10382        /// Information about the sponsor of a message
10383        #[serde(rename(serialize = "messageSponsor", deserialize = "messageSponsor"))]
10384        MessageSponsor(crate::types::MessageSponsor),
10385    }
10386    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
10387    #[serde(tag = "@type")]
10388    pub enum SponsoredMessage {
10389        /// Describes a sponsored message
10390        #[serde(rename(serialize = "sponsoredMessage", deserialize = "sponsoredMessage"))]
10391        SponsoredMessage(crate::types::SponsoredMessage),
10392    }
10393    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
10394    #[serde(tag = "@type")]
10395    pub enum SponsoredMessages {
10396        /// Contains a list of sponsored messages
10397        #[serde(rename(serialize = "sponsoredMessages", deserialize = "sponsoredMessages"))]
10398        SponsoredMessages(crate::types::SponsoredMessages),
10399    }
10400    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
10401    #[serde(tag = "@type")]
10402    pub enum FileDownload {
10403        /// Describes a file added to file download list
10404        #[serde(rename(serialize = "fileDownload", deserialize = "fileDownload"))]
10405        FileDownload(crate::types::FileDownload),
10406    }
10407    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
10408    #[serde(tag = "@type")]
10409    pub enum DownloadedFileCounts {
10410        /// Contains number of being downloaded and recently downloaded files found
10411        #[serde(rename(serialize = "downloadedFileCounts", deserialize = "downloadedFileCounts"))]
10412        DownloadedFileCounts(crate::types::DownloadedFileCounts),
10413    }
10414    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
10415    #[serde(tag = "@type")]
10416    pub enum FoundFileDownloads {
10417        /// Contains a list of downloaded files, found by a search
10418        #[serde(rename(serialize = "foundFileDownloads", deserialize = "foundFileDownloads"))]
10419        FoundFileDownloads(crate::types::FoundFileDownloads),
10420    }
10421    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
10422    #[serde(tag = "@type")]
10423    pub enum NotificationSettingsScope {
10424        /// Notification settings applied to all private and secret chats when the corresponding chat setting has a default value
10425        #[serde(rename(serialize = "notificationSettingsScopePrivateChats", deserialize = "notificationSettingsScopePrivateChats"))]
10426        PrivateChats,
10427        /// Notification settings applied to all basic group and supergroup chats when the corresponding chat setting has a default value
10428        #[serde(rename(serialize = "notificationSettingsScopeGroupChats", deserialize = "notificationSettingsScopeGroupChats"))]
10429        GroupChats,
10430        /// Notification settings applied to all channel chats when the corresponding chat setting has a default value
10431        #[serde(rename(serialize = "notificationSettingsScopeChannelChats", deserialize = "notificationSettingsScopeChannelChats"))]
10432        ChannelChats,
10433    }
10434    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
10435    #[serde(tag = "@type")]
10436    pub enum ChatNotificationSettings {
10437        /// Contains information about notification settings for a chat or a forum topic
10438        #[serde(rename(serialize = "chatNotificationSettings", deserialize = "chatNotificationSettings"))]
10439        ChatNotificationSettings(crate::types::ChatNotificationSettings),
10440    }
10441    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
10442    #[serde(tag = "@type")]
10443    pub enum ScopeNotificationSettings {
10444        /// Contains information about notification settings for several chats
10445        #[serde(rename(serialize = "scopeNotificationSettings", deserialize = "scopeNotificationSettings"))]
10446        ScopeNotificationSettings(crate::types::ScopeNotificationSettings),
10447    }
10448    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
10449    #[serde(tag = "@type")]
10450    pub enum DraftMessage {
10451        /// Contains information about a message draft
10452        #[serde(rename(serialize = "draftMessage", deserialize = "draftMessage"))]
10453        DraftMessage(crate::types::DraftMessage),
10454    }
10455    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
10456    #[serde(tag = "@type")]
10457    pub enum ChatType {
10458        /// An ordinary chat with a user
10459        #[serde(rename(serialize = "chatTypePrivate", deserialize = "chatTypePrivate"))]
10460        Private(crate::types::ChatTypePrivate),
10461        /// A basic group (a chat with 0-200 other users)
10462        #[serde(rename(serialize = "chatTypeBasicGroup", deserialize = "chatTypeBasicGroup"))]
10463        BasicGroup(crate::types::ChatTypeBasicGroup),
10464        /// A supergroup or channel (with unlimited members)
10465        #[serde(rename(serialize = "chatTypeSupergroup", deserialize = "chatTypeSupergroup"))]
10466        Supergroup(crate::types::ChatTypeSupergroup),
10467        /// A secret chat with a user
10468        #[serde(rename(serialize = "chatTypeSecret", deserialize = "chatTypeSecret"))]
10469        Secret(crate::types::ChatTypeSecret),
10470    }
10471    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
10472    #[serde(tag = "@type")]
10473    pub enum ChatFolderIcon {
10474        /// Represents an icon for a chat folder
10475        #[serde(rename(serialize = "chatFolderIcon", deserialize = "chatFolderIcon"))]
10476        ChatFolderIcon(crate::types::ChatFolderIcon),
10477    }
10478    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
10479    #[serde(tag = "@type")]
10480    pub enum ChatFolder {
10481        /// Represents a folder for user chats
10482        #[serde(rename(serialize = "chatFolder", deserialize = "chatFolder"))]
10483        ChatFolder(crate::types::ChatFolder),
10484    }
10485    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
10486    #[serde(tag = "@type")]
10487    pub enum ChatFolderInfo {
10488        /// Contains basic information about a chat folder
10489        #[serde(rename(serialize = "chatFolderInfo", deserialize = "chatFolderInfo"))]
10490        ChatFolderInfo(crate::types::ChatFolderInfo),
10491    }
10492    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
10493    #[serde(tag = "@type")]
10494    pub enum ChatFolderInviteLink {
10495        /// Contains a chat folder invite link
10496        #[serde(rename(serialize = "chatFolderInviteLink", deserialize = "chatFolderInviteLink"))]
10497        ChatFolderInviteLink(crate::types::ChatFolderInviteLink),
10498    }
10499    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
10500    #[serde(tag = "@type")]
10501    pub enum ChatFolderInviteLinks {
10502        /// Represents a list of chat folder invite links
10503        #[serde(rename(serialize = "chatFolderInviteLinks", deserialize = "chatFolderInviteLinks"))]
10504        ChatFolderInviteLinks(crate::types::ChatFolderInviteLinks),
10505    }
10506    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
10507    #[serde(tag = "@type")]
10508    pub enum ChatFolderInviteLinkInfo {
10509        /// Contains information about an invite link to a chat folder
10510        #[serde(rename(serialize = "chatFolderInviteLinkInfo", deserialize = "chatFolderInviteLinkInfo"))]
10511        ChatFolderInviteLinkInfo(crate::types::ChatFolderInviteLinkInfo),
10512    }
10513    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
10514    #[serde(tag = "@type")]
10515    pub enum RecommendedChatFolder {
10516        /// Describes a recommended chat folder
10517        #[serde(rename(serialize = "recommendedChatFolder", deserialize = "recommendedChatFolder"))]
10518        RecommendedChatFolder(crate::types::RecommendedChatFolder),
10519    }
10520    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
10521    #[serde(tag = "@type")]
10522    pub enum RecommendedChatFolders {
10523        /// Contains a list of recommended chat folders
10524        #[serde(rename(serialize = "recommendedChatFolders", deserialize = "recommendedChatFolders"))]
10525        RecommendedChatFolders(crate::types::RecommendedChatFolders),
10526    }
10527    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
10528    #[serde(tag = "@type")]
10529    pub enum ArchiveChatListSettings {
10530        /// Contains settings for automatic moving of chats to and from the Archive chat lists
10531        #[serde(rename(serialize = "archiveChatListSettings", deserialize = "archiveChatListSettings"))]
10532        ArchiveChatListSettings(crate::types::ArchiveChatListSettings),
10533    }
10534    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
10535    #[serde(tag = "@type")]
10536    pub enum ChatList {
10537        /// A main list of chats
10538        #[serde(rename(serialize = "chatListMain", deserialize = "chatListMain"))]
10539        Main,
10540        /// A list of chats usually located at the top of the main chat list. Unmuted chats are automatically moved from the Archive to the Main chat list when a new message arrives
10541        #[serde(rename(serialize = "chatListArchive", deserialize = "chatListArchive"))]
10542        Archive,
10543        /// A list of chats added to a chat folder
10544        #[serde(rename(serialize = "chatListFolder", deserialize = "chatListFolder"))]
10545        Folder(crate::types::ChatListFolder),
10546    }
10547    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
10548    #[serde(tag = "@type")]
10549    pub enum ChatLists {
10550        /// Contains a list of chat lists
10551        #[serde(rename(serialize = "chatLists", deserialize = "chatLists"))]
10552        ChatLists(crate::types::ChatLists),
10553    }
10554    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
10555    #[serde(tag = "@type")]
10556    pub enum ChatSource {
10557        /// The chat is sponsored by the user's MTProxy server
10558        #[serde(rename(serialize = "chatSourceMtprotoProxy", deserialize = "chatSourceMtprotoProxy"))]
10559        MtprotoProxy,
10560        /// The chat contains a public service announcement
10561        #[serde(rename(serialize = "chatSourcePublicServiceAnnouncement", deserialize = "chatSourcePublicServiceAnnouncement"))]
10562        PublicServiceAnnouncement(crate::types::ChatSourcePublicServiceAnnouncement),
10563    }
10564    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
10565    #[serde(tag = "@type")]
10566    pub enum ChatPosition {
10567        /// Describes a position of a chat in a chat list
10568        #[serde(rename(serialize = "chatPosition", deserialize = "chatPosition"))]
10569        ChatPosition(crate::types::ChatPosition),
10570    }
10571    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
10572    #[serde(tag = "@type")]
10573    pub enum ChatAvailableReactions {
10574        /// All reactions are available in the chat
10575        #[serde(rename(serialize = "chatAvailableReactionsAll", deserialize = "chatAvailableReactionsAll"))]
10576        All,
10577        /// Only specific reactions are available in the chat
10578        #[serde(rename(serialize = "chatAvailableReactionsSome", deserialize = "chatAvailableReactionsSome"))]
10579        Some(crate::types::ChatAvailableReactionsSome),
10580    }
10581    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
10582    #[serde(tag = "@type")]
10583    pub enum VideoChat {
10584        /// Describes a video chat
10585        #[serde(rename(serialize = "videoChat", deserialize = "videoChat"))]
10586        VideoChat(crate::types::VideoChat),
10587    }
10588    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
10589    #[serde(tag = "@type")]
10590    pub enum Chat {
10591        /// A chat. (Can be a private chat, basic group, supergroup, or secret chat)
10592        #[serde(rename(serialize = "chat", deserialize = "chat"))]
10593        Chat(crate::types::Chat),
10594    }
10595    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
10596    #[serde(tag = "@type")]
10597    pub enum Chats {
10598        /// Represents a list of chats
10599        #[serde(rename(serialize = "chats", deserialize = "chats"))]
10600        Chats(crate::types::Chats),
10601    }
10602    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
10603    #[serde(tag = "@type")]
10604    pub enum ChatNearby {
10605        /// Describes a chat located nearby
10606        #[serde(rename(serialize = "chatNearby", deserialize = "chatNearby"))]
10607        ChatNearby(crate::types::ChatNearby),
10608    }
10609    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
10610    #[serde(tag = "@type")]
10611    pub enum ChatsNearby {
10612        /// Represents a list of chats located nearby
10613        #[serde(rename(serialize = "chatsNearby", deserialize = "chatsNearby"))]
10614        ChatsNearby(crate::types::ChatsNearby),
10615    }
10616    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
10617    #[serde(tag = "@type")]
10618    pub enum PublicChatType {
10619        /// The chat is public, because it has an active username
10620        #[serde(rename(serialize = "publicChatTypeHasUsername", deserialize = "publicChatTypeHasUsername"))]
10621        HasUsername,
10622        /// The chat is public, because it is a location-based supergroup
10623        #[serde(rename(serialize = "publicChatTypeIsLocationBased", deserialize = "publicChatTypeIsLocationBased"))]
10624        IsLocationBased,
10625    }
10626    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
10627    #[serde(tag = "@type")]
10628    pub enum ChatActionBar {
10629        /// The chat can be reported as spam using the method reportChat with the reason reportReasonSpam. If the chat is a private chat with a user with an emoji status, then a notice about emoji status usage must be shown
10630        #[serde(rename(serialize = "chatActionBarReportSpam", deserialize = "chatActionBarReportSpam"))]
10631        ReportSpam(crate::types::ChatActionBarReportSpam),
10632        /// The chat is a location-based supergroup, which can be reported as having unrelated location using the method reportChat with the reason reportReasonUnrelatedLocation
10633        #[serde(rename(serialize = "chatActionBarReportUnrelatedLocation", deserialize = "chatActionBarReportUnrelatedLocation"))]
10634        ReportUnrelatedLocation,
10635        /// The chat is a recently created group chat to which new members can be invited
10636        #[serde(rename(serialize = "chatActionBarInviteMembers", deserialize = "chatActionBarInviteMembers"))]
10637        InviteMembers,
10638        /// The chat is a private or secret chat, which can be reported using the method reportChat, or the other user can be blocked using the method setMessageSenderBlockList,
10639        /// or the other user can be added to the contact list using the method addContact. If the chat is a private chat with a user with an emoji status, then a notice about emoji status usage must be shown
10640        #[serde(rename(serialize = "chatActionBarReportAddBlock", deserialize = "chatActionBarReportAddBlock"))]
10641        ReportAddBlock(crate::types::ChatActionBarReportAddBlock),
10642        /// The chat is a private or secret chat and the other user can be added to the contact list using the method addContact
10643        #[serde(rename(serialize = "chatActionBarAddContact", deserialize = "chatActionBarAddContact"))]
10644        AddContact,
10645        /// The chat is a private or secret chat with a mutual contact and the user's phone number can be shared with the other user using the method sharePhoneNumber
10646        #[serde(rename(serialize = "chatActionBarSharePhoneNumber", deserialize = "chatActionBarSharePhoneNumber"))]
10647        SharePhoneNumber,
10648        /// The chat is a private chat with an administrator of a chat to which the user sent join request
10649        #[serde(rename(serialize = "chatActionBarJoinRequest", deserialize = "chatActionBarJoinRequest"))]
10650        JoinRequest(crate::types::ChatActionBarJoinRequest),
10651    }
10652    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
10653    #[serde(tag = "@type")]
10654    pub enum KeyboardButtonType {
10655        /// A simple button, with text that must be sent when the button is pressed
10656        #[serde(rename(serialize = "keyboardButtonTypeText", deserialize = "keyboardButtonTypeText"))]
10657        Text,
10658        /// A button that sends the user's phone number when pressed; available only in private chats
10659        #[serde(rename(serialize = "keyboardButtonTypeRequestPhoneNumber", deserialize = "keyboardButtonTypeRequestPhoneNumber"))]
10660        RequestPhoneNumber,
10661        /// A button that sends the user's location when pressed; available only in private chats
10662        #[serde(rename(serialize = "keyboardButtonTypeRequestLocation", deserialize = "keyboardButtonTypeRequestLocation"))]
10663        RequestLocation,
10664        /// A button that allows the user to create and send a poll when pressed; available only in private chats
10665        #[serde(rename(serialize = "keyboardButtonTypeRequestPoll", deserialize = "keyboardButtonTypeRequestPoll"))]
10666        RequestPoll(crate::types::KeyboardButtonTypeRequestPoll),
10667        /// A button that requests a user to be shared by the current user; available only in private chats. Use the method shareUserWithBot to complete the request
10668        #[serde(rename(serialize = "keyboardButtonTypeRequestUser", deserialize = "keyboardButtonTypeRequestUser"))]
10669        RequestUser(crate::types::KeyboardButtonTypeRequestUser),
10670        /// A button that requests a chat to be shared by the current user; available only in private chats. Use the method shareChatWithBot to complete the request
10671        #[serde(rename(serialize = "keyboardButtonTypeRequestChat", deserialize = "keyboardButtonTypeRequestChat"))]
10672        RequestChat(crate::types::KeyboardButtonTypeRequestChat),
10673        /// A button that opens a Web App by calling getWebAppUrl
10674        #[serde(rename(serialize = "keyboardButtonTypeWebApp", deserialize = "keyboardButtonTypeWebApp"))]
10675        WebApp(crate::types::KeyboardButtonTypeWebApp),
10676    }
10677    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
10678    #[serde(tag = "@type")]
10679    pub enum KeyboardButton {
10680        /// Represents a single button in a bot keyboard
10681        #[serde(rename(serialize = "keyboardButton", deserialize = "keyboardButton"))]
10682        KeyboardButton(crate::types::KeyboardButton),
10683    }
10684    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
10685    #[serde(tag = "@type")]
10686    pub enum InlineKeyboardButtonType {
10687        /// A button that opens a specified URL
10688        #[serde(rename(serialize = "inlineKeyboardButtonTypeUrl", deserialize = "inlineKeyboardButtonTypeUrl"))]
10689        Url(crate::types::InlineKeyboardButtonTypeUrl),
10690        /// A button that opens a specified URL and automatically authorize the current user by calling getLoginUrlInfo
10691        #[serde(rename(serialize = "inlineKeyboardButtonTypeLoginUrl", deserialize = "inlineKeyboardButtonTypeLoginUrl"))]
10692        LoginUrl(crate::types::InlineKeyboardButtonTypeLoginUrl),
10693        /// A button that opens a Web App by calling openWebApp
10694        #[serde(rename(serialize = "inlineKeyboardButtonTypeWebApp", deserialize = "inlineKeyboardButtonTypeWebApp"))]
10695        WebApp(crate::types::InlineKeyboardButtonTypeWebApp),
10696        /// A button that sends a callback query to a bot
10697        #[serde(rename(serialize = "inlineKeyboardButtonTypeCallback", deserialize = "inlineKeyboardButtonTypeCallback"))]
10698        Callback(crate::types::InlineKeyboardButtonTypeCallback),
10699        /// A button that asks for the 2-step verification password of the current user and then sends a callback query to a bot
10700        #[serde(rename(serialize = "inlineKeyboardButtonTypeCallbackWithPassword", deserialize = "inlineKeyboardButtonTypeCallbackWithPassword"))]
10701        CallbackWithPassword(crate::types::InlineKeyboardButtonTypeCallbackWithPassword),
10702        /// A button with a game that sends a callback query to a bot. This button must be in the first column and row of the keyboard and can be attached only to a message with content of the type messageGame
10703        #[serde(rename(serialize = "inlineKeyboardButtonTypeCallbackGame", deserialize = "inlineKeyboardButtonTypeCallbackGame"))]
10704        CallbackGame,
10705        /// A button that forces an inline query to the bot to be inserted in the input field
10706        #[serde(rename(serialize = "inlineKeyboardButtonTypeSwitchInline", deserialize = "inlineKeyboardButtonTypeSwitchInline"))]
10707        SwitchInline(crate::types::InlineKeyboardButtonTypeSwitchInline),
10708        /// A button to buy something. This button must be in the first column and row of the keyboard and can be attached only to a message with content of the type messageInvoice
10709        #[serde(rename(serialize = "inlineKeyboardButtonTypeBuy", deserialize = "inlineKeyboardButtonTypeBuy"))]
10710        Buy,
10711        /// A button with a user reference to be handled in the same way as textEntityTypeMentionName entities
10712        #[serde(rename(serialize = "inlineKeyboardButtonTypeUser", deserialize = "inlineKeyboardButtonTypeUser"))]
10713        User(crate::types::InlineKeyboardButtonTypeUser),
10714    }
10715    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
10716    #[serde(tag = "@type")]
10717    pub enum InlineKeyboardButton {
10718        /// Represents a single button in an inline keyboard
10719        #[serde(rename(serialize = "inlineKeyboardButton", deserialize = "inlineKeyboardButton"))]
10720        InlineKeyboardButton(crate::types::InlineKeyboardButton),
10721    }
10722    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
10723    #[serde(tag = "@type")]
10724    pub enum ReplyMarkup {
10725        /// Instructs application to remove the keyboard once this message has been received. This kind of keyboard can't be received in an incoming message; instead, updateChatReplyMarkup with message_id == 0 will be sent
10726        #[serde(rename(serialize = "replyMarkupRemoveKeyboard", deserialize = "replyMarkupRemoveKeyboard"))]
10727        RemoveKeyboard(crate::types::ReplyMarkupRemoveKeyboard),
10728        /// Instructs application to force a reply to this message
10729        #[serde(rename(serialize = "replyMarkupForceReply", deserialize = "replyMarkupForceReply"))]
10730        ForceReply(crate::types::ReplyMarkupForceReply),
10731        /// Contains a custom keyboard layout to quickly reply to bots
10732        #[serde(rename(serialize = "replyMarkupShowKeyboard", deserialize = "replyMarkupShowKeyboard"))]
10733        ShowKeyboard(crate::types::ReplyMarkupShowKeyboard),
10734        /// Contains an inline keyboard layout
10735        #[serde(rename(serialize = "replyMarkupInlineKeyboard", deserialize = "replyMarkupInlineKeyboard"))]
10736        InlineKeyboard(crate::types::ReplyMarkupInlineKeyboard),
10737    }
10738    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
10739    #[serde(tag = "@type")]
10740    pub enum LoginUrlInfo {
10741        /// An HTTP URL needs to be open
10742        #[serde(rename(serialize = "loginUrlInfoOpen", deserialize = "loginUrlInfoOpen"))]
10743        Open(crate::types::LoginUrlInfoOpen),
10744        /// An authorization confirmation dialog needs to be shown to the user
10745        #[serde(rename(serialize = "loginUrlInfoRequestConfirmation", deserialize = "loginUrlInfoRequestConfirmation"))]
10746        RequestConfirmation(crate::types::LoginUrlInfoRequestConfirmation),
10747    }
10748    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
10749    #[serde(tag = "@type")]
10750    pub enum FoundWebApp {
10751        /// Contains information about a Web App found by its short name
10752        #[serde(rename(serialize = "foundWebApp", deserialize = "foundWebApp"))]
10753        FoundWebApp(crate::types::FoundWebApp),
10754    }
10755    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
10756    #[serde(tag = "@type")]
10757    pub enum WebAppInfo {
10758        /// Contains information about a Web App
10759        #[serde(rename(serialize = "webAppInfo", deserialize = "webAppInfo"))]
10760        WebAppInfo(crate::types::WebAppInfo),
10761    }
10762    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
10763    #[serde(tag = "@type")]
10764    pub enum MessageThreadInfo {
10765        /// Contains information about a message thread
10766        #[serde(rename(serialize = "messageThreadInfo", deserialize = "messageThreadInfo"))]
10767        MessageThreadInfo(crate::types::MessageThreadInfo),
10768    }
10769    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
10770    #[serde(tag = "@type")]
10771    pub enum ForumTopicIcon {
10772        /// Describes a forum topic icon
10773        #[serde(rename(serialize = "forumTopicIcon", deserialize = "forumTopicIcon"))]
10774        ForumTopicIcon(crate::types::ForumTopicIcon),
10775    }
10776    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
10777    #[serde(tag = "@type")]
10778    pub enum ForumTopicInfo {
10779        /// Contains basic information about a forum topic
10780        #[serde(rename(serialize = "forumTopicInfo", deserialize = "forumTopicInfo"))]
10781        ForumTopicInfo(crate::types::ForumTopicInfo),
10782    }
10783    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
10784    #[serde(tag = "@type")]
10785    pub enum ForumTopic {
10786        /// Describes a forum topic
10787        #[serde(rename(serialize = "forumTopic", deserialize = "forumTopic"))]
10788        ForumTopic(crate::types::ForumTopic),
10789    }
10790    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
10791    #[serde(tag = "@type")]
10792    pub enum ForumTopics {
10793        /// Describes a list of forum topics
10794        #[serde(rename(serialize = "forumTopics", deserialize = "forumTopics"))]
10795        ForumTopics(crate::types::ForumTopics),
10796    }
10797    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
10798    #[serde(tag = "@type")]
10799    pub enum RichText {
10800        /// A plain text
10801        #[serde(rename(serialize = "richTextPlain", deserialize = "richTextPlain"))]
10802        Plain(crate::types::RichTextPlain),
10803        /// A bold rich text
10804        #[serde(rename(serialize = "richTextBold", deserialize = "richTextBold"))]
10805        Bold(Box<crate::types::RichTextBold>),
10806        /// An italicized rich text
10807        #[serde(rename(serialize = "richTextItalic", deserialize = "richTextItalic"))]
10808        Italic(Box<crate::types::RichTextItalic>),
10809        /// An underlined rich text
10810        #[serde(rename(serialize = "richTextUnderline", deserialize = "richTextUnderline"))]
10811        Underline(Box<crate::types::RichTextUnderline>),
10812        /// A strikethrough rich text
10813        #[serde(rename(serialize = "richTextStrikethrough", deserialize = "richTextStrikethrough"))]
10814        Strikethrough(Box<crate::types::RichTextStrikethrough>),
10815        /// A fixed-width rich text
10816        #[serde(rename(serialize = "richTextFixed", deserialize = "richTextFixed"))]
10817        Fixed(Box<crate::types::RichTextFixed>),
10818        /// A rich text URL link
10819        #[serde(rename(serialize = "richTextUrl", deserialize = "richTextUrl"))]
10820        Url(Box<crate::types::RichTextUrl>),
10821        /// A rich text email link
10822        #[serde(rename(serialize = "richTextEmailAddress", deserialize = "richTextEmailAddress"))]
10823        EmailAddress(Box<crate::types::RichTextEmailAddress>),
10824        /// A subscript rich text
10825        #[serde(rename(serialize = "richTextSubscript", deserialize = "richTextSubscript"))]
10826        Subscript(Box<crate::types::RichTextSubscript>),
10827        /// A superscript rich text
10828        #[serde(rename(serialize = "richTextSuperscript", deserialize = "richTextSuperscript"))]
10829        Superscript(Box<crate::types::RichTextSuperscript>),
10830        /// A marked rich text
10831        #[serde(rename(serialize = "richTextMarked", deserialize = "richTextMarked"))]
10832        Marked(Box<crate::types::RichTextMarked>),
10833        /// A rich text phone number
10834        #[serde(rename(serialize = "richTextPhoneNumber", deserialize = "richTextPhoneNumber"))]
10835        PhoneNumber(Box<crate::types::RichTextPhoneNumber>),
10836        /// A small image inside the text
10837        #[serde(rename(serialize = "richTextIcon", deserialize = "richTextIcon"))]
10838        Icon(crate::types::RichTextIcon),
10839        /// A reference to a richTexts object on the same web page
10840        #[serde(rename(serialize = "richTextReference", deserialize = "richTextReference"))]
10841        Reference(Box<crate::types::RichTextReference>),
10842        /// An anchor
10843        #[serde(rename(serialize = "richTextAnchor", deserialize = "richTextAnchor"))]
10844        Anchor(crate::types::RichTextAnchor),
10845        /// A link to an anchor on the same web page
10846        #[serde(rename(serialize = "richTextAnchorLink", deserialize = "richTextAnchorLink"))]
10847        AnchorLink(Box<crate::types::RichTextAnchorLink>),
10848        /// A concatenation of rich texts
10849        #[serde(rename(serialize = "richTexts", deserialize = "richTexts"))]
10850        RichTexts(crate::types::RichTexts),
10851    }
10852    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
10853    #[serde(tag = "@type")]
10854    pub enum PageBlockCaption {
10855        /// Contains a caption of an instant view web page block, consisting of a text and a trailing credit
10856        #[serde(rename(serialize = "pageBlockCaption", deserialize = "pageBlockCaption"))]
10857        PageBlockCaption(crate::types::PageBlockCaption),
10858    }
10859    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
10860    #[serde(tag = "@type")]
10861    pub enum PageBlockListItem {
10862        /// Describes an item of a list page block
10863        #[serde(rename(serialize = "pageBlockListItem", deserialize = "pageBlockListItem"))]
10864        PageBlockListItem(crate::types::PageBlockListItem),
10865    }
10866    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
10867    #[serde(tag = "@type")]
10868    pub enum PageBlockHorizontalAlignment {
10869        /// The content must be left-aligned
10870        #[serde(rename(serialize = "pageBlockHorizontalAlignmentLeft", deserialize = "pageBlockHorizontalAlignmentLeft"))]
10871        Left,
10872        /// The content must be center-aligned
10873        #[serde(rename(serialize = "pageBlockHorizontalAlignmentCenter", deserialize = "pageBlockHorizontalAlignmentCenter"))]
10874        Center,
10875        /// The content must be right-aligned
10876        #[serde(rename(serialize = "pageBlockHorizontalAlignmentRight", deserialize = "pageBlockHorizontalAlignmentRight"))]
10877        Right,
10878    }
10879    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
10880    #[serde(tag = "@type")]
10881    pub enum PageBlockVerticalAlignment {
10882        /// The content must be top-aligned
10883        #[serde(rename(serialize = "pageBlockVerticalAlignmentTop", deserialize = "pageBlockVerticalAlignmentTop"))]
10884        Top,
10885        /// The content must be middle-aligned
10886        #[serde(rename(serialize = "pageBlockVerticalAlignmentMiddle", deserialize = "pageBlockVerticalAlignmentMiddle"))]
10887        Middle,
10888        /// The content must be bottom-aligned
10889        #[serde(rename(serialize = "pageBlockVerticalAlignmentBottom", deserialize = "pageBlockVerticalAlignmentBottom"))]
10890        Bottom,
10891    }
10892    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
10893    #[serde(tag = "@type")]
10894    pub enum PageBlockTableCell {
10895        /// Represents a cell of a table
10896        #[serde(rename(serialize = "pageBlockTableCell", deserialize = "pageBlockTableCell"))]
10897        PageBlockTableCell(crate::types::PageBlockTableCell),
10898    }
10899    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
10900    #[serde(tag = "@type")]
10901    pub enum PageBlockRelatedArticle {
10902        /// Contains information about a related article
10903        #[serde(rename(serialize = "pageBlockRelatedArticle", deserialize = "pageBlockRelatedArticle"))]
10904        PageBlockRelatedArticle(crate::types::PageBlockRelatedArticle),
10905    }
10906    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
10907    #[serde(tag = "@type")]
10908    pub enum PageBlock {
10909        /// The title of a page
10910        #[serde(rename(serialize = "pageBlockTitle", deserialize = "pageBlockTitle"))]
10911        Title(crate::types::PageBlockTitle),
10912        /// The subtitle of a page
10913        #[serde(rename(serialize = "pageBlockSubtitle", deserialize = "pageBlockSubtitle"))]
10914        Subtitle(crate::types::PageBlockSubtitle),
10915        /// The author and publishing date of a page
10916        #[serde(rename(serialize = "pageBlockAuthorDate", deserialize = "pageBlockAuthorDate"))]
10917        AuthorDate(crate::types::PageBlockAuthorDate),
10918        /// A header
10919        #[serde(rename(serialize = "pageBlockHeader", deserialize = "pageBlockHeader"))]
10920        Header(crate::types::PageBlockHeader),
10921        /// A subheader
10922        #[serde(rename(serialize = "pageBlockSubheader", deserialize = "pageBlockSubheader"))]
10923        Subheader(crate::types::PageBlockSubheader),
10924        /// A kicker
10925        #[serde(rename(serialize = "pageBlockKicker", deserialize = "pageBlockKicker"))]
10926        Kicker(crate::types::PageBlockKicker),
10927        /// A text paragraph
10928        #[serde(rename(serialize = "pageBlockParagraph", deserialize = "pageBlockParagraph"))]
10929        Paragraph(crate::types::PageBlockParagraph),
10930        /// A preformatted text paragraph
10931        #[serde(rename(serialize = "pageBlockPreformatted", deserialize = "pageBlockPreformatted"))]
10932        Preformatted(crate::types::PageBlockPreformatted),
10933        /// The footer of a page
10934        #[serde(rename(serialize = "pageBlockFooter", deserialize = "pageBlockFooter"))]
10935        Footer(crate::types::PageBlockFooter),
10936        /// An empty block separating a page
10937        #[serde(rename(serialize = "pageBlockDivider", deserialize = "pageBlockDivider"))]
10938        Divider,
10939        /// An invisible anchor on a page, which can be used in a URL to open the page from the specified anchor
10940        #[serde(rename(serialize = "pageBlockAnchor", deserialize = "pageBlockAnchor"))]
10941        Anchor(crate::types::PageBlockAnchor),
10942        /// A list of data blocks
10943        #[serde(rename(serialize = "pageBlockList", deserialize = "pageBlockList"))]
10944        List(crate::types::PageBlockList),
10945        /// A block quote
10946        #[serde(rename(serialize = "pageBlockBlockQuote", deserialize = "pageBlockBlockQuote"))]
10947        BlockQuote(crate::types::PageBlockBlockQuote),
10948        /// A pull quote
10949        #[serde(rename(serialize = "pageBlockPullQuote", deserialize = "pageBlockPullQuote"))]
10950        PullQuote(crate::types::PageBlockPullQuote),
10951        /// An animation
10952        #[serde(rename(serialize = "pageBlockAnimation", deserialize = "pageBlockAnimation"))]
10953        Animation(crate::types::PageBlockAnimation),
10954        /// An audio file
10955        #[serde(rename(serialize = "pageBlockAudio", deserialize = "pageBlockAudio"))]
10956        Audio(crate::types::PageBlockAudio),
10957        /// A photo
10958        #[serde(rename(serialize = "pageBlockPhoto", deserialize = "pageBlockPhoto"))]
10959        Photo(crate::types::PageBlockPhoto),
10960        /// A video
10961        #[serde(rename(serialize = "pageBlockVideo", deserialize = "pageBlockVideo"))]
10962        Video(crate::types::PageBlockVideo),
10963        /// A voice note
10964        #[serde(rename(serialize = "pageBlockVoiceNote", deserialize = "pageBlockVoiceNote"))]
10965        VoiceNote(crate::types::PageBlockVoiceNote),
10966        /// A page cover
10967        #[serde(rename(serialize = "pageBlockCover", deserialize = "pageBlockCover"))]
10968        Cover(Box<crate::types::PageBlockCover>),
10969        /// An embedded web page
10970        #[serde(rename(serialize = "pageBlockEmbedded", deserialize = "pageBlockEmbedded"))]
10971        Embedded(crate::types::PageBlockEmbedded),
10972        /// An embedded post
10973        #[serde(rename(serialize = "pageBlockEmbeddedPost", deserialize = "pageBlockEmbeddedPost"))]
10974        EmbeddedPost(crate::types::PageBlockEmbeddedPost),
10975        /// A collage
10976        #[serde(rename(serialize = "pageBlockCollage", deserialize = "pageBlockCollage"))]
10977        Collage(crate::types::PageBlockCollage),
10978        /// A slideshow
10979        #[serde(rename(serialize = "pageBlockSlideshow", deserialize = "pageBlockSlideshow"))]
10980        Slideshow(crate::types::PageBlockSlideshow),
10981        /// A link to a chat
10982        #[serde(rename(serialize = "pageBlockChatLink", deserialize = "pageBlockChatLink"))]
10983        ChatLink(crate::types::PageBlockChatLink),
10984        /// A table
10985        #[serde(rename(serialize = "pageBlockTable", deserialize = "pageBlockTable"))]
10986        Table(crate::types::PageBlockTable),
10987        /// A collapsible block
10988        #[serde(rename(serialize = "pageBlockDetails", deserialize = "pageBlockDetails"))]
10989        Details(crate::types::PageBlockDetails),
10990        /// Related articles
10991        #[serde(rename(serialize = "pageBlockRelatedArticles", deserialize = "pageBlockRelatedArticles"))]
10992        RelatedArticles(crate::types::PageBlockRelatedArticles),
10993        /// A map
10994        #[serde(rename(serialize = "pageBlockMap", deserialize = "pageBlockMap"))]
10995        Map(crate::types::PageBlockMap),
10996    }
10997    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
10998    #[serde(tag = "@type")]
10999    pub enum WebPageInstantView {
11000        /// Describes an instant view page for a web page
11001        #[serde(rename(serialize = "webPageInstantView", deserialize = "webPageInstantView"))]
11002        WebPageInstantView(crate::types::WebPageInstantView),
11003    }
11004    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
11005    #[serde(tag = "@type")]
11006    pub enum WebPage {
11007        /// Describes a web page preview
11008        #[serde(rename(serialize = "webPage", deserialize = "webPage"))]
11009        WebPage(crate::types::WebPage),
11010    }
11011    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
11012    #[serde(tag = "@type")]
11013    pub enum CountryInfo {
11014        /// Contains information about a country
11015        #[serde(rename(serialize = "countryInfo", deserialize = "countryInfo"))]
11016        CountryInfo(crate::types::CountryInfo),
11017    }
11018    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
11019    #[serde(tag = "@type")]
11020    pub enum Countries {
11021        /// Contains information about countries
11022        #[serde(rename(serialize = "countries", deserialize = "countries"))]
11023        Countries(crate::types::Countries),
11024    }
11025    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
11026    #[serde(tag = "@type")]
11027    pub enum PhoneNumberInfo {
11028        /// Contains information about a phone number
11029        #[serde(rename(serialize = "phoneNumberInfo", deserialize = "phoneNumberInfo"))]
11030        PhoneNumberInfo(crate::types::PhoneNumberInfo),
11031    }
11032    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
11033    #[serde(tag = "@type")]
11034    pub enum BankCardActionOpenUrl {
11035        /// Describes an action associated with a bank card number
11036        #[serde(rename(serialize = "bankCardActionOpenUrl", deserialize = "bankCardActionOpenUrl"))]
11037        BankCardActionOpenUrl(crate::types::BankCardActionOpenUrl),
11038    }
11039    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
11040    #[serde(tag = "@type")]
11041    pub enum BankCardInfo {
11042        /// Information about a bank card
11043        #[serde(rename(serialize = "bankCardInfo", deserialize = "bankCardInfo"))]
11044        BankCardInfo(crate::types::BankCardInfo),
11045    }
11046    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
11047    #[serde(tag = "@type")]
11048    pub enum Address {
11049        /// Describes an address
11050        #[serde(rename(serialize = "address", deserialize = "address"))]
11051        Address(crate::types::Address),
11052    }
11053    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
11054    #[serde(tag = "@type")]
11055    pub enum ThemeParameters {
11056        /// Contains parameters of the application theme
11057        #[serde(rename(serialize = "themeParameters", deserialize = "themeParameters"))]
11058        ThemeParameters(crate::types::ThemeParameters),
11059    }
11060    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
11061    #[serde(tag = "@type")]
11062    pub enum LabeledPricePart {
11063        /// Portion of the price of a product (e.g., "delivery cost", "tax amount")
11064        #[serde(rename(serialize = "labeledPricePart", deserialize = "labeledPricePart"))]
11065        LabeledPricePart(crate::types::LabeledPricePart),
11066    }
11067    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
11068    #[serde(tag = "@type")]
11069    pub enum Invoice {
11070        /// Product invoice
11071        #[serde(rename(serialize = "invoice", deserialize = "invoice"))]
11072        Invoice(crate::types::Invoice),
11073    }
11074    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
11075    #[serde(tag = "@type")]
11076    pub enum OrderInfo {
11077        /// Order information
11078        #[serde(rename(serialize = "orderInfo", deserialize = "orderInfo"))]
11079        OrderInfo(crate::types::OrderInfo),
11080    }
11081    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
11082    #[serde(tag = "@type")]
11083    pub enum ShippingOption {
11084        /// One shipping option
11085        #[serde(rename(serialize = "shippingOption", deserialize = "shippingOption"))]
11086        ShippingOption(crate::types::ShippingOption),
11087    }
11088    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
11089    #[serde(tag = "@type")]
11090    pub enum SavedCredentials {
11091        /// Contains information about saved payment credentials
11092        #[serde(rename(serialize = "savedCredentials", deserialize = "savedCredentials"))]
11093        SavedCredentials(crate::types::SavedCredentials),
11094    }
11095    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
11096    #[serde(tag = "@type")]
11097    pub enum InputCredentials {
11098        /// Applies if a user chooses some previously saved payment credentials. To use their previously saved credentials, the user must have a valid temporary password
11099        #[serde(rename(serialize = "inputCredentialsSaved", deserialize = "inputCredentialsSaved"))]
11100        Saved(crate::types::InputCredentialsSaved),
11101        /// Applies if a user enters new credentials on a payment provider website
11102        #[serde(rename(serialize = "inputCredentialsNew", deserialize = "inputCredentialsNew"))]
11103        New(crate::types::InputCredentialsNew),
11104        /// Applies if a user enters new credentials using Apple Pay
11105        #[serde(rename(serialize = "inputCredentialsApplePay", deserialize = "inputCredentialsApplePay"))]
11106        ApplePay(crate::types::InputCredentialsApplePay),
11107        /// Applies if a user enters new credentials using Google Pay
11108        #[serde(rename(serialize = "inputCredentialsGooglePay", deserialize = "inputCredentialsGooglePay"))]
11109        GooglePay(crate::types::InputCredentialsGooglePay),
11110    }
11111    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
11112    #[serde(tag = "@type")]
11113    pub enum PaymentProvider {
11114        /// Smart Glocal payment provider
11115        #[serde(rename(serialize = "paymentProviderSmartGlocal", deserialize = "paymentProviderSmartGlocal"))]
11116        SmartGlocal(crate::types::PaymentProviderSmartGlocal),
11117        /// Stripe payment provider
11118        #[serde(rename(serialize = "paymentProviderStripe", deserialize = "paymentProviderStripe"))]
11119        Stripe(crate::types::PaymentProviderStripe),
11120        /// Some other payment provider, for which a web payment form must be shown
11121        #[serde(rename(serialize = "paymentProviderOther", deserialize = "paymentProviderOther"))]
11122        Other(crate::types::PaymentProviderOther),
11123    }
11124    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
11125    #[serde(tag = "@type")]
11126    pub enum PaymentOption {
11127        /// Describes an additional payment option
11128        #[serde(rename(serialize = "paymentOption", deserialize = "paymentOption"))]
11129        PaymentOption(crate::types::PaymentOption),
11130    }
11131    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
11132    #[serde(tag = "@type")]
11133    pub enum PaymentForm {
11134        /// Contains information about an invoice payment form
11135        #[serde(rename(serialize = "paymentForm", deserialize = "paymentForm"))]
11136        PaymentForm(crate::types::PaymentForm),
11137    }
11138    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
11139    #[serde(tag = "@type")]
11140    pub enum ValidatedOrderInfo {
11141        /// Contains a temporary identifier of validated order information, which is stored for one hour, and the available shipping options
11142        #[serde(rename(serialize = "validatedOrderInfo", deserialize = "validatedOrderInfo"))]
11143        ValidatedOrderInfo(crate::types::ValidatedOrderInfo),
11144    }
11145    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
11146    #[serde(tag = "@type")]
11147    pub enum PaymentResult {
11148        /// Contains the result of a payment request
11149        #[serde(rename(serialize = "paymentResult", deserialize = "paymentResult"))]
11150        PaymentResult(crate::types::PaymentResult),
11151    }
11152    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
11153    #[serde(tag = "@type")]
11154    pub enum PaymentReceipt {
11155        /// Contains information about a successful payment
11156        #[serde(rename(serialize = "paymentReceipt", deserialize = "paymentReceipt"))]
11157        PaymentReceipt(crate::types::PaymentReceipt),
11158    }
11159    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
11160    #[serde(tag = "@type")]
11161    pub enum InputInvoice {
11162        /// An invoice from a message of the type messageInvoice
11163        #[serde(rename(serialize = "inputInvoiceMessage", deserialize = "inputInvoiceMessage"))]
11164        Message(crate::types::InputInvoiceMessage),
11165        /// An invoice from a link of the type internalLinkTypeInvoice
11166        #[serde(rename(serialize = "inputInvoiceName", deserialize = "inputInvoiceName"))]
11167        Name(crate::types::InputInvoiceName),
11168    }
11169    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
11170    #[serde(tag = "@type")]
11171    pub enum MessageExtendedMedia {
11172        /// The media is hidden until the invoice is paid
11173        #[serde(rename(serialize = "messageExtendedMediaPreview", deserialize = "messageExtendedMediaPreview"))]
11174        Preview(crate::types::MessageExtendedMediaPreview),
11175        /// The media is a photo
11176        #[serde(rename(serialize = "messageExtendedMediaPhoto", deserialize = "messageExtendedMediaPhoto"))]
11177        Photo(crate::types::MessageExtendedMediaPhoto),
11178        /// The media is a video
11179        #[serde(rename(serialize = "messageExtendedMediaVideo", deserialize = "messageExtendedMediaVideo"))]
11180        Video(crate::types::MessageExtendedMediaVideo),
11181        /// The media is unsupported
11182        #[serde(rename(serialize = "messageExtendedMediaUnsupported", deserialize = "messageExtendedMediaUnsupported"))]
11183        Unsupported(crate::types::MessageExtendedMediaUnsupported),
11184    }
11185    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
11186    #[serde(tag = "@type")]
11187    pub enum DatedFile {
11188        /// File with the date it was uploaded
11189        #[serde(rename(serialize = "datedFile", deserialize = "datedFile"))]
11190        DatedFile(crate::types::DatedFile),
11191    }
11192    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
11193    #[serde(tag = "@type")]
11194    pub enum PassportElementType {
11195        /// A Telegram Passport element containing the user's personal details
11196        #[serde(rename(serialize = "passportElementTypePersonalDetails", deserialize = "passportElementTypePersonalDetails"))]
11197        PersonalDetails,
11198        /// A Telegram Passport element containing the user's passport
11199        #[serde(rename(serialize = "passportElementTypePassport", deserialize = "passportElementTypePassport"))]
11200        Passport,
11201        /// A Telegram Passport element containing the user's driver license
11202        #[serde(rename(serialize = "passportElementTypeDriverLicense", deserialize = "passportElementTypeDriverLicense"))]
11203        DriverLicense,
11204        /// A Telegram Passport element containing the user's identity card
11205        #[serde(rename(serialize = "passportElementTypeIdentityCard", deserialize = "passportElementTypeIdentityCard"))]
11206        IdentityCard,
11207        /// A Telegram Passport element containing the user's internal passport
11208        #[serde(rename(serialize = "passportElementTypeInternalPassport", deserialize = "passportElementTypeInternalPassport"))]
11209        InternalPassport,
11210        /// A Telegram Passport element containing the user's address
11211        #[serde(rename(serialize = "passportElementTypeAddress", deserialize = "passportElementTypeAddress"))]
11212        Address,
11213        /// A Telegram Passport element containing the user's utility bill
11214        #[serde(rename(serialize = "passportElementTypeUtilityBill", deserialize = "passportElementTypeUtilityBill"))]
11215        UtilityBill,
11216        /// A Telegram Passport element containing the user's bank statement
11217        #[serde(rename(serialize = "passportElementTypeBankStatement", deserialize = "passportElementTypeBankStatement"))]
11218        BankStatement,
11219        /// A Telegram Passport element containing the user's rental agreement
11220        #[serde(rename(serialize = "passportElementTypeRentalAgreement", deserialize = "passportElementTypeRentalAgreement"))]
11221        RentalAgreement,
11222        /// A Telegram Passport element containing the registration page of the user's passport
11223        #[serde(rename(serialize = "passportElementTypePassportRegistration", deserialize = "passportElementTypePassportRegistration"))]
11224        PassportRegistration,
11225        /// A Telegram Passport element containing the user's temporary registration
11226        #[serde(rename(serialize = "passportElementTypeTemporaryRegistration", deserialize = "passportElementTypeTemporaryRegistration"))]
11227        TemporaryRegistration,
11228        /// A Telegram Passport element containing the user's phone number
11229        #[serde(rename(serialize = "passportElementTypePhoneNumber", deserialize = "passportElementTypePhoneNumber"))]
11230        PhoneNumber,
11231        /// A Telegram Passport element containing the user's email address
11232        #[serde(rename(serialize = "passportElementTypeEmailAddress", deserialize = "passportElementTypeEmailAddress"))]
11233        EmailAddress,
11234    }
11235    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
11236    #[serde(tag = "@type")]
11237    pub enum Date {
11238        /// Represents a date according to the Gregorian calendar
11239        #[serde(rename(serialize = "date", deserialize = "date"))]
11240        Date(crate::types::Date),
11241    }
11242    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
11243    #[serde(tag = "@type")]
11244    pub enum PersonalDetails {
11245        /// Contains the user's personal details
11246        #[serde(rename(serialize = "personalDetails", deserialize = "personalDetails"))]
11247        PersonalDetails(crate::types::PersonalDetails),
11248    }
11249    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
11250    #[serde(tag = "@type")]
11251    pub enum IdentityDocument {
11252        /// An identity document
11253        #[serde(rename(serialize = "identityDocument", deserialize = "identityDocument"))]
11254        IdentityDocument(crate::types::IdentityDocument),
11255    }
11256    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
11257    #[serde(tag = "@type")]
11258    pub enum InputIdentityDocument {
11259        /// An identity document to be saved to Telegram Passport
11260        #[serde(rename(serialize = "inputIdentityDocument", deserialize = "inputIdentityDocument"))]
11261        InputIdentityDocument(crate::types::InputIdentityDocument),
11262    }
11263    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
11264    #[serde(tag = "@type")]
11265    pub enum PersonalDocument {
11266        /// A personal document, containing some information about a user
11267        #[serde(rename(serialize = "personalDocument", deserialize = "personalDocument"))]
11268        PersonalDocument(crate::types::PersonalDocument),
11269    }
11270    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
11271    #[serde(tag = "@type")]
11272    pub enum InputPersonalDocument {
11273        /// A personal document to be saved to Telegram Passport
11274        #[serde(rename(serialize = "inputPersonalDocument", deserialize = "inputPersonalDocument"))]
11275        InputPersonalDocument(crate::types::InputPersonalDocument),
11276    }
11277    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
11278    #[serde(tag = "@type")]
11279    pub enum PassportElement {
11280        /// A Telegram Passport element containing the user's personal details
11281        #[serde(rename(serialize = "passportElementPersonalDetails", deserialize = "passportElementPersonalDetails"))]
11282        PersonalDetails(crate::types::PassportElementPersonalDetails),
11283        /// A Telegram Passport element containing the user's passport
11284        #[serde(rename(serialize = "passportElementPassport", deserialize = "passportElementPassport"))]
11285        Passport(crate::types::PassportElementPassport),
11286        /// A Telegram Passport element containing the user's driver license
11287        #[serde(rename(serialize = "passportElementDriverLicense", deserialize = "passportElementDriverLicense"))]
11288        DriverLicense(crate::types::PassportElementDriverLicense),
11289        /// A Telegram Passport element containing the user's identity card
11290        #[serde(rename(serialize = "passportElementIdentityCard", deserialize = "passportElementIdentityCard"))]
11291        IdentityCard(crate::types::PassportElementIdentityCard),
11292        /// A Telegram Passport element containing the user's internal passport
11293        #[serde(rename(serialize = "passportElementInternalPassport", deserialize = "passportElementInternalPassport"))]
11294        InternalPassport(crate::types::PassportElementInternalPassport),
11295        /// A Telegram Passport element containing the user's address
11296        #[serde(rename(serialize = "passportElementAddress", deserialize = "passportElementAddress"))]
11297        Address(crate::types::PassportElementAddress),
11298        /// A Telegram Passport element containing the user's utility bill
11299        #[serde(rename(serialize = "passportElementUtilityBill", deserialize = "passportElementUtilityBill"))]
11300        UtilityBill(crate::types::PassportElementUtilityBill),
11301        /// A Telegram Passport element containing the user's bank statement
11302        #[serde(rename(serialize = "passportElementBankStatement", deserialize = "passportElementBankStatement"))]
11303        BankStatement(crate::types::PassportElementBankStatement),
11304        /// A Telegram Passport element containing the user's rental agreement
11305        #[serde(rename(serialize = "passportElementRentalAgreement", deserialize = "passportElementRentalAgreement"))]
11306        RentalAgreement(crate::types::PassportElementRentalAgreement),
11307        /// A Telegram Passport element containing the user's passport registration pages
11308        #[serde(rename(serialize = "passportElementPassportRegistration", deserialize = "passportElementPassportRegistration"))]
11309        PassportRegistration(crate::types::PassportElementPassportRegistration),
11310        /// A Telegram Passport element containing the user's temporary registration
11311        #[serde(rename(serialize = "passportElementTemporaryRegistration", deserialize = "passportElementTemporaryRegistration"))]
11312        TemporaryRegistration(crate::types::PassportElementTemporaryRegistration),
11313        /// A Telegram Passport element containing the user's phone number
11314        #[serde(rename(serialize = "passportElementPhoneNumber", deserialize = "passportElementPhoneNumber"))]
11315        PhoneNumber(crate::types::PassportElementPhoneNumber),
11316        /// A Telegram Passport element containing the user's email address
11317        #[serde(rename(serialize = "passportElementEmailAddress", deserialize = "passportElementEmailAddress"))]
11318        EmailAddress(crate::types::PassportElementEmailAddress),
11319    }
11320    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
11321    #[serde(tag = "@type")]
11322    pub enum InputPassportElement {
11323        /// A Telegram Passport element to be saved containing the user's personal details
11324        #[serde(rename(serialize = "inputPassportElementPersonalDetails", deserialize = "inputPassportElementPersonalDetails"))]
11325        PersonalDetails(crate::types::InputPassportElementPersonalDetails),
11326        /// A Telegram Passport element to be saved containing the user's passport
11327        #[serde(rename(serialize = "inputPassportElementPassport", deserialize = "inputPassportElementPassport"))]
11328        Passport(crate::types::InputPassportElementPassport),
11329        /// A Telegram Passport element to be saved containing the user's driver license
11330        #[serde(rename(serialize = "inputPassportElementDriverLicense", deserialize = "inputPassportElementDriverLicense"))]
11331        DriverLicense(crate::types::InputPassportElementDriverLicense),
11332        /// A Telegram Passport element to be saved containing the user's identity card
11333        #[serde(rename(serialize = "inputPassportElementIdentityCard", deserialize = "inputPassportElementIdentityCard"))]
11334        IdentityCard(crate::types::InputPassportElementIdentityCard),
11335        /// A Telegram Passport element to be saved containing the user's internal passport
11336        #[serde(rename(serialize = "inputPassportElementInternalPassport", deserialize = "inputPassportElementInternalPassport"))]
11337        InternalPassport(crate::types::InputPassportElementInternalPassport),
11338        /// A Telegram Passport element to be saved containing the user's address
11339        #[serde(rename(serialize = "inputPassportElementAddress", deserialize = "inputPassportElementAddress"))]
11340        Address(crate::types::InputPassportElementAddress),
11341        /// A Telegram Passport element to be saved containing the user's utility bill
11342        #[serde(rename(serialize = "inputPassportElementUtilityBill", deserialize = "inputPassportElementUtilityBill"))]
11343        UtilityBill(crate::types::InputPassportElementUtilityBill),
11344        /// A Telegram Passport element to be saved containing the user's bank statement
11345        #[serde(rename(serialize = "inputPassportElementBankStatement", deserialize = "inputPassportElementBankStatement"))]
11346        BankStatement(crate::types::InputPassportElementBankStatement),
11347        /// A Telegram Passport element to be saved containing the user's rental agreement
11348        #[serde(rename(serialize = "inputPassportElementRentalAgreement", deserialize = "inputPassportElementRentalAgreement"))]
11349        RentalAgreement(crate::types::InputPassportElementRentalAgreement),
11350        /// A Telegram Passport element to be saved containing the user's passport registration
11351        #[serde(rename(serialize = "inputPassportElementPassportRegistration", deserialize = "inputPassportElementPassportRegistration"))]
11352        PassportRegistration(crate::types::InputPassportElementPassportRegistration),
11353        /// A Telegram Passport element to be saved containing the user's temporary registration
11354        #[serde(rename(serialize = "inputPassportElementTemporaryRegistration", deserialize = "inputPassportElementTemporaryRegistration"))]
11355        TemporaryRegistration(crate::types::InputPassportElementTemporaryRegistration),
11356        /// A Telegram Passport element to be saved containing the user's phone number
11357        #[serde(rename(serialize = "inputPassportElementPhoneNumber", deserialize = "inputPassportElementPhoneNumber"))]
11358        PhoneNumber(crate::types::InputPassportElementPhoneNumber),
11359        /// A Telegram Passport element to be saved containing the user's email address
11360        #[serde(rename(serialize = "inputPassportElementEmailAddress", deserialize = "inputPassportElementEmailAddress"))]
11361        EmailAddress(crate::types::InputPassportElementEmailAddress),
11362    }
11363    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
11364    #[serde(tag = "@type")]
11365    pub enum PassportElements {
11366        /// Contains information about saved Telegram Passport elements
11367        #[serde(rename(serialize = "passportElements", deserialize = "passportElements"))]
11368        PassportElements(crate::types::PassportElements),
11369    }
11370    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
11371    #[serde(tag = "@type")]
11372    pub enum PassportElementErrorSource {
11373        /// The element contains an error in an unspecified place. The error will be considered resolved when new data is added
11374        #[serde(rename(serialize = "passportElementErrorSourceUnspecified", deserialize = "passportElementErrorSourceUnspecified"))]
11375        Unspecified,
11376        /// One of the data fields contains an error. The error will be considered resolved when the value of the field changes
11377        #[serde(rename(serialize = "passportElementErrorSourceDataField", deserialize = "passportElementErrorSourceDataField"))]
11378        DataField(crate::types::PassportElementErrorSourceDataField),
11379        /// The front side of the document contains an error. The error will be considered resolved when the file with the front side changes
11380        #[serde(rename(serialize = "passportElementErrorSourceFrontSide", deserialize = "passportElementErrorSourceFrontSide"))]
11381        FrontSide,
11382        /// The reverse side of the document contains an error. The error will be considered resolved when the file with the reverse side changes
11383        #[serde(rename(serialize = "passportElementErrorSourceReverseSide", deserialize = "passportElementErrorSourceReverseSide"))]
11384        ReverseSide,
11385        /// The selfie with the document contains an error. The error will be considered resolved when the file with the selfie changes
11386        #[serde(rename(serialize = "passportElementErrorSourceSelfie", deserialize = "passportElementErrorSourceSelfie"))]
11387        Selfie,
11388        /// One of files with the translation of the document contains an error. The error will be considered resolved when the file changes
11389        #[serde(rename(serialize = "passportElementErrorSourceTranslationFile", deserialize = "passportElementErrorSourceTranslationFile"))]
11390        TranslationFile(crate::types::PassportElementErrorSourceTranslationFile),
11391        /// The translation of the document contains an error. The error will be considered resolved when the list of translation files changes
11392        #[serde(rename(serialize = "passportElementErrorSourceTranslationFiles", deserialize = "passportElementErrorSourceTranslationFiles"))]
11393        TranslationFiles,
11394        /// The file contains an error. The error will be considered resolved when the file changes
11395        #[serde(rename(serialize = "passportElementErrorSourceFile", deserialize = "passportElementErrorSourceFile"))]
11396        File(crate::types::PassportElementErrorSourceFile),
11397        /// The list of attached files contains an error. The error will be considered resolved when the list of files changes
11398        #[serde(rename(serialize = "passportElementErrorSourceFiles", deserialize = "passportElementErrorSourceFiles"))]
11399        Files,
11400    }
11401    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
11402    #[serde(tag = "@type")]
11403    pub enum PassportElementError {
11404        /// Contains the description of an error in a Telegram Passport element
11405        #[serde(rename(serialize = "passportElementError", deserialize = "passportElementError"))]
11406        PassportElementError(crate::types::PassportElementError),
11407    }
11408    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
11409    #[serde(tag = "@type")]
11410    pub enum PassportSuitableElement {
11411        /// Contains information about a Telegram Passport element that was requested by a service
11412        #[serde(rename(serialize = "passportSuitableElement", deserialize = "passportSuitableElement"))]
11413        PassportSuitableElement(crate::types::PassportSuitableElement),
11414    }
11415    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
11416    #[serde(tag = "@type")]
11417    pub enum PassportRequiredElement {
11418        /// Contains a description of the required Telegram Passport element that was requested by a service
11419        #[serde(rename(serialize = "passportRequiredElement", deserialize = "passportRequiredElement"))]
11420        PassportRequiredElement(crate::types::PassportRequiredElement),
11421    }
11422    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
11423    #[serde(tag = "@type")]
11424    pub enum PassportAuthorizationForm {
11425        /// Contains information about a Telegram Passport authorization form that was requested
11426        #[serde(rename(serialize = "passportAuthorizationForm", deserialize = "passportAuthorizationForm"))]
11427        PassportAuthorizationForm(crate::types::PassportAuthorizationForm),
11428    }
11429    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
11430    #[serde(tag = "@type")]
11431    pub enum PassportElementsWithErrors {
11432        /// Contains information about a Telegram Passport elements and corresponding errors
11433        #[serde(rename(serialize = "passportElementsWithErrors", deserialize = "passportElementsWithErrors"))]
11434        PassportElementsWithErrors(crate::types::PassportElementsWithErrors),
11435    }
11436    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
11437    #[serde(tag = "@type")]
11438    pub enum EncryptedCredentials {
11439        /// Contains encrypted Telegram Passport data credentials
11440        #[serde(rename(serialize = "encryptedCredentials", deserialize = "encryptedCredentials"))]
11441        EncryptedCredentials(crate::types::EncryptedCredentials),
11442    }
11443    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
11444    #[serde(tag = "@type")]
11445    pub enum EncryptedPassportElement {
11446        /// Contains information about an encrypted Telegram Passport element; for bots only
11447        #[serde(rename(serialize = "encryptedPassportElement", deserialize = "encryptedPassportElement"))]
11448        EncryptedPassportElement(crate::types::EncryptedPassportElement),
11449    }
11450    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
11451    #[serde(tag = "@type")]
11452    pub enum InputPassportElementErrorSource {
11453        /// The element contains an error in an unspecified place. The error will be considered resolved when new data is added
11454        #[serde(rename(serialize = "inputPassportElementErrorSourceUnspecified", deserialize = "inputPassportElementErrorSourceUnspecified"))]
11455        Unspecified(crate::types::InputPassportElementErrorSourceUnspecified),
11456        /// A data field contains an error. The error is considered resolved when the field's value changes
11457        #[serde(rename(serialize = "inputPassportElementErrorSourceDataField", deserialize = "inputPassportElementErrorSourceDataField"))]
11458        DataField(crate::types::InputPassportElementErrorSourceDataField),
11459        /// The front side of the document contains an error. The error is considered resolved when the file with the front side of the document changes
11460        #[serde(rename(serialize = "inputPassportElementErrorSourceFrontSide", deserialize = "inputPassportElementErrorSourceFrontSide"))]
11461        FrontSide(crate::types::InputPassportElementErrorSourceFrontSide),
11462        /// The reverse side of the document contains an error. The error is considered resolved when the file with the reverse side of the document changes
11463        #[serde(rename(serialize = "inputPassportElementErrorSourceReverseSide", deserialize = "inputPassportElementErrorSourceReverseSide"))]
11464        ReverseSide(crate::types::InputPassportElementErrorSourceReverseSide),
11465        /// The selfie contains an error. The error is considered resolved when the file with the selfie changes
11466        #[serde(rename(serialize = "inputPassportElementErrorSourceSelfie", deserialize = "inputPassportElementErrorSourceSelfie"))]
11467        Selfie(crate::types::InputPassportElementErrorSourceSelfie),
11468        /// One of the files containing the translation of the document contains an error. The error is considered resolved when the file with the translation changes
11469        #[serde(rename(serialize = "inputPassportElementErrorSourceTranslationFile", deserialize = "inputPassportElementErrorSourceTranslationFile"))]
11470        TranslationFile(crate::types::InputPassportElementErrorSourceTranslationFile),
11471        /// The translation of the document contains an error. The error is considered resolved when the list of files changes
11472        #[serde(rename(serialize = "inputPassportElementErrorSourceTranslationFiles", deserialize = "inputPassportElementErrorSourceTranslationFiles"))]
11473        TranslationFiles(crate::types::InputPassportElementErrorSourceTranslationFiles),
11474        /// The file contains an error. The error is considered resolved when the file changes
11475        #[serde(rename(serialize = "inputPassportElementErrorSourceFile", deserialize = "inputPassportElementErrorSourceFile"))]
11476        File(crate::types::InputPassportElementErrorSourceFile),
11477        /// The list of attached files contains an error. The error is considered resolved when the file list changes
11478        #[serde(rename(serialize = "inputPassportElementErrorSourceFiles", deserialize = "inputPassportElementErrorSourceFiles"))]
11479        Files(crate::types::InputPassportElementErrorSourceFiles),
11480    }
11481    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
11482    #[serde(tag = "@type")]
11483    pub enum InputPassportElementError {
11484        /// Contains the description of an error in a Telegram Passport element; for bots only
11485        #[serde(rename(serialize = "inputPassportElementError", deserialize = "inputPassportElementError"))]
11486        InputPassportElementError(crate::types::InputPassportElementError),
11487    }
11488    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
11489    #[serde(tag = "@type")]
11490    pub enum MessageContent {
11491        /// A text message
11492        #[serde(rename(serialize = "messageText", deserialize = "messageText"))]
11493        MessageText(crate::types::MessageText),
11494        /// An animation message (GIF-style).
11495        #[serde(rename(serialize = "messageAnimation", deserialize = "messageAnimation"))]
11496        MessageAnimation(crate::types::MessageAnimation),
11497        /// An audio message
11498        #[serde(rename(serialize = "messageAudio", deserialize = "messageAudio"))]
11499        MessageAudio(crate::types::MessageAudio),
11500        /// A document message (general file)
11501        #[serde(rename(serialize = "messageDocument", deserialize = "messageDocument"))]
11502        MessageDocument(crate::types::MessageDocument),
11503        /// A photo message
11504        #[serde(rename(serialize = "messagePhoto", deserialize = "messagePhoto"))]
11505        MessagePhoto(crate::types::MessagePhoto),
11506        /// A self-destructed photo message
11507        #[serde(rename(serialize = "messageExpiredPhoto", deserialize = "messageExpiredPhoto"))]
11508        MessageExpiredPhoto,
11509        /// A sticker message
11510        #[serde(rename(serialize = "messageSticker", deserialize = "messageSticker"))]
11511        MessageSticker(crate::types::MessageSticker),
11512        /// A video message
11513        #[serde(rename(serialize = "messageVideo", deserialize = "messageVideo"))]
11514        MessageVideo(crate::types::MessageVideo),
11515        /// A self-destructed video message
11516        #[serde(rename(serialize = "messageExpiredVideo", deserialize = "messageExpiredVideo"))]
11517        MessageExpiredVideo,
11518        /// A video note message
11519        #[serde(rename(serialize = "messageVideoNote", deserialize = "messageVideoNote"))]
11520        MessageVideoNote(crate::types::MessageVideoNote),
11521        /// A voice note message
11522        #[serde(rename(serialize = "messageVoiceNote", deserialize = "messageVoiceNote"))]
11523        MessageVoiceNote(crate::types::MessageVoiceNote),
11524        /// A message with a location
11525        #[serde(rename(serialize = "messageLocation", deserialize = "messageLocation"))]
11526        MessageLocation(crate::types::MessageLocation),
11527        /// A message with information about a venue
11528        #[serde(rename(serialize = "messageVenue", deserialize = "messageVenue"))]
11529        MessageVenue(crate::types::MessageVenue),
11530        /// A message with a user contact
11531        #[serde(rename(serialize = "messageContact", deserialize = "messageContact"))]
11532        MessageContact(crate::types::MessageContact),
11533        /// A message with an animated emoji
11534        #[serde(rename(serialize = "messageAnimatedEmoji", deserialize = "messageAnimatedEmoji"))]
11535        MessageAnimatedEmoji(crate::types::MessageAnimatedEmoji),
11536        /// A dice message. The dice value is randomly generated by the server
11537        #[serde(rename(serialize = "messageDice", deserialize = "messageDice"))]
11538        MessageDice(crate::types::MessageDice),
11539        /// A message with a game
11540        #[serde(rename(serialize = "messageGame", deserialize = "messageGame"))]
11541        MessageGame(crate::types::MessageGame),
11542        /// A message with a poll
11543        #[serde(rename(serialize = "messagePoll", deserialize = "messagePoll"))]
11544        MessagePoll(crate::types::MessagePoll),
11545        /// A message with a forwarded story
11546        #[serde(rename(serialize = "messageStory", deserialize = "messageStory"))]
11547        MessageStory(crate::types::MessageStory),
11548        /// A message with an invoice from a bot. Use getInternalLink with internalLinkTypeBotStart to share the invoice
11549        #[serde(rename(serialize = "messageInvoice", deserialize = "messageInvoice"))]
11550        MessageInvoice(crate::types::MessageInvoice),
11551        /// A message with information about an ended call
11552        #[serde(rename(serialize = "messageCall", deserialize = "messageCall"))]
11553        MessageCall(crate::types::MessageCall),
11554        /// A new video chat was scheduled
11555        #[serde(rename(serialize = "messageVideoChatScheduled", deserialize = "messageVideoChatScheduled"))]
11556        MessageVideoChatScheduled(crate::types::MessageVideoChatScheduled),
11557        /// A newly created video chat
11558        #[serde(rename(serialize = "messageVideoChatStarted", deserialize = "messageVideoChatStarted"))]
11559        MessageVideoChatStarted(crate::types::MessageVideoChatStarted),
11560        /// A message with information about an ended video chat
11561        #[serde(rename(serialize = "messageVideoChatEnded", deserialize = "messageVideoChatEnded"))]
11562        MessageVideoChatEnded(crate::types::MessageVideoChatEnded),
11563        /// A message with information about an invite to a video chat
11564        #[serde(rename(serialize = "messageInviteVideoChatParticipants", deserialize = "messageInviteVideoChatParticipants"))]
11565        MessageInviteVideoChatParticipants(crate::types::MessageInviteVideoChatParticipants),
11566        /// A newly created basic group
11567        #[serde(rename(serialize = "messageBasicGroupChatCreate", deserialize = "messageBasicGroupChatCreate"))]
11568        MessageBasicGroupChatCreate(crate::types::MessageBasicGroupChatCreate),
11569        /// A newly created supergroup or channel
11570        #[serde(rename(serialize = "messageSupergroupChatCreate", deserialize = "messageSupergroupChatCreate"))]
11571        MessageSupergroupChatCreate(crate::types::MessageSupergroupChatCreate),
11572        /// An updated chat title
11573        #[serde(rename(serialize = "messageChatChangeTitle", deserialize = "messageChatChangeTitle"))]
11574        MessageChatChangeTitle(crate::types::MessageChatChangeTitle),
11575        /// An updated chat photo
11576        #[serde(rename(serialize = "messageChatChangePhoto", deserialize = "messageChatChangePhoto"))]
11577        MessageChatChangePhoto(crate::types::MessageChatChangePhoto),
11578        /// A deleted chat photo
11579        #[serde(rename(serialize = "messageChatDeletePhoto", deserialize = "messageChatDeletePhoto"))]
11580        MessageChatDeletePhoto,
11581        /// New chat members were added
11582        #[serde(rename(serialize = "messageChatAddMembers", deserialize = "messageChatAddMembers"))]
11583        MessageChatAddMembers(crate::types::MessageChatAddMembers),
11584        /// A new member joined the chat via an invite link
11585        #[serde(rename(serialize = "messageChatJoinByLink", deserialize = "messageChatJoinByLink"))]
11586        MessageChatJoinByLink,
11587        /// A new member was accepted to the chat by an administrator
11588        #[serde(rename(serialize = "messageChatJoinByRequest", deserialize = "messageChatJoinByRequest"))]
11589        MessageChatJoinByRequest,
11590        /// A chat member was deleted
11591        #[serde(rename(serialize = "messageChatDeleteMember", deserialize = "messageChatDeleteMember"))]
11592        MessageChatDeleteMember(crate::types::MessageChatDeleteMember),
11593        /// A basic group was upgraded to a supergroup and was deactivated as the result
11594        #[serde(rename(serialize = "messageChatUpgradeTo", deserialize = "messageChatUpgradeTo"))]
11595        MessageChatUpgradeTo(crate::types::MessageChatUpgradeTo),
11596        /// A supergroup has been created from a basic group
11597        #[serde(rename(serialize = "messageChatUpgradeFrom", deserialize = "messageChatUpgradeFrom"))]
11598        MessageChatUpgradeFrom(crate::types::MessageChatUpgradeFrom),
11599        /// A message has been pinned
11600        #[serde(rename(serialize = "messagePinMessage", deserialize = "messagePinMessage"))]
11601        MessagePinMessage(crate::types::MessagePinMessage),
11602        /// A screenshot of a message in the chat has been taken
11603        #[serde(rename(serialize = "messageScreenshotTaken", deserialize = "messageScreenshotTaken"))]
11604        MessageScreenshotTaken,
11605        /// A new background was set in the chat
11606        #[serde(rename(serialize = "messageChatSetBackground", deserialize = "messageChatSetBackground"))]
11607        MessageChatSetBackground(crate::types::MessageChatSetBackground),
11608        /// A theme in the chat has been changed
11609        #[serde(rename(serialize = "messageChatSetTheme", deserialize = "messageChatSetTheme"))]
11610        MessageChatSetTheme(crate::types::MessageChatSetTheme),
11611        /// The auto-delete or self-destruct timer for messages in the chat has been changed
11612        #[serde(rename(serialize = "messageChatSetMessageAutoDeleteTime", deserialize = "messageChatSetMessageAutoDeleteTime"))]
11613        MessageChatSetMessageAutoDeleteTime(crate::types::MessageChatSetMessageAutoDeleteTime),
11614        /// A forum topic has been created
11615        #[serde(rename(serialize = "messageForumTopicCreated", deserialize = "messageForumTopicCreated"))]
11616        MessageForumTopicCreated(crate::types::MessageForumTopicCreated),
11617        /// A forum topic has been edited
11618        #[serde(rename(serialize = "messageForumTopicEdited", deserialize = "messageForumTopicEdited"))]
11619        MessageForumTopicEdited(crate::types::MessageForumTopicEdited),
11620        /// A forum topic has been closed or opened
11621        #[serde(rename(serialize = "messageForumTopicIsClosedToggled", deserialize = "messageForumTopicIsClosedToggled"))]
11622        MessageForumTopicIsClosedToggled(crate::types::MessageForumTopicIsClosedToggled),
11623        /// A General forum topic has been hidden or unhidden
11624        #[serde(rename(serialize = "messageForumTopicIsHiddenToggled", deserialize = "messageForumTopicIsHiddenToggled"))]
11625        MessageForumTopicIsHiddenToggled(crate::types::MessageForumTopicIsHiddenToggled),
11626        /// A profile photo was suggested to a user in a private chat
11627        #[serde(rename(serialize = "messageSuggestProfilePhoto", deserialize = "messageSuggestProfilePhoto"))]
11628        MessageSuggestProfilePhoto(crate::types::MessageSuggestProfilePhoto),
11629        /// A non-standard action has happened in the chat
11630        #[serde(rename(serialize = "messageCustomServiceAction", deserialize = "messageCustomServiceAction"))]
11631        MessageCustomServiceAction(crate::types::MessageCustomServiceAction),
11632        /// A new high score was achieved in a game
11633        #[serde(rename(serialize = "messageGameScore", deserialize = "messageGameScore"))]
11634        MessageGameScore(crate::types::MessageGameScore),
11635        /// A payment has been completed
11636        #[serde(rename(serialize = "messagePaymentSuccessful", deserialize = "messagePaymentSuccessful"))]
11637        MessagePaymentSuccessful(crate::types::MessagePaymentSuccessful),
11638        /// A payment has been completed; for bots only
11639        #[serde(rename(serialize = "messagePaymentSuccessfulBot", deserialize = "messagePaymentSuccessfulBot"))]
11640        MessagePaymentSuccessfulBot(crate::types::MessagePaymentSuccessfulBot),
11641        /// Telegram Premium was gifted to the user
11642        #[serde(rename(serialize = "messageGiftedPremium", deserialize = "messageGiftedPremium"))]
11643        MessageGiftedPremium(crate::types::MessageGiftedPremium),
11644        /// A contact has registered with Telegram
11645        #[serde(rename(serialize = "messageContactRegistered", deserialize = "messageContactRegistered"))]
11646        MessageContactRegistered,
11647        /// The current user shared a user, which was requested by the bot
11648        #[serde(rename(serialize = "messageUserShared", deserialize = "messageUserShared"))]
11649        MessageUserShared(crate::types::MessageUserShared),
11650        /// The current user shared a chat, which was requested by the bot
11651        #[serde(rename(serialize = "messageChatShared", deserialize = "messageChatShared"))]
11652        MessageChatShared(crate::types::MessageChatShared),
11653        /// The current user has connected a website by logging in using Telegram Login Widget on it
11654        #[serde(rename(serialize = "messageWebsiteConnected", deserialize = "messageWebsiteConnected"))]
11655        MessageWebsiteConnected(crate::types::MessageWebsiteConnected),
11656        /// The user allowed the bot to send messages
11657        #[serde(rename(serialize = "messageBotWriteAccessAllowed", deserialize = "messageBotWriteAccessAllowed"))]
11658        MessageBotWriteAccessAllowed(crate::types::MessageBotWriteAccessAllowed),
11659        /// Data from a Web App has been sent to a bot
11660        #[serde(rename(serialize = "messageWebAppDataSent", deserialize = "messageWebAppDataSent"))]
11661        MessageWebAppDataSent(crate::types::MessageWebAppDataSent),
11662        /// Data from a Web App has been received; for bots only
11663        #[serde(rename(serialize = "messageWebAppDataReceived", deserialize = "messageWebAppDataReceived"))]
11664        MessageWebAppDataReceived(crate::types::MessageWebAppDataReceived),
11665        /// Telegram Passport data has been sent to a bot
11666        #[serde(rename(serialize = "messagePassportDataSent", deserialize = "messagePassportDataSent"))]
11667        MessagePassportDataSent(crate::types::MessagePassportDataSent),
11668        /// Telegram Passport data has been received; for bots only
11669        #[serde(rename(serialize = "messagePassportDataReceived", deserialize = "messagePassportDataReceived"))]
11670        MessagePassportDataReceived(crate::types::MessagePassportDataReceived),
11671        /// A user in the chat came within proximity alert range
11672        #[serde(rename(serialize = "messageProximityAlertTriggered", deserialize = "messageProximityAlertTriggered"))]
11673        MessageProximityAlertTriggered(crate::types::MessageProximityAlertTriggered),
11674        /// A message content that is not supported in the current TDLib version
11675        #[serde(rename(serialize = "messageUnsupported", deserialize = "messageUnsupported"))]
11676        MessageUnsupported,
11677    }
11678    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
11679    #[serde(tag = "@type")]
11680    pub enum TextEntityType {
11681        /// A mention of a user, a supergroup, or a channel by their username
11682        #[serde(rename(serialize = "textEntityTypeMention", deserialize = "textEntityTypeMention"))]
11683        Mention,
11684        /// A hashtag text, beginning with "#"
11685        #[serde(rename(serialize = "textEntityTypeHashtag", deserialize = "textEntityTypeHashtag"))]
11686        Hashtag,
11687        /// A cashtag text, beginning with "$" and consisting of capital English letters (e.g., "$USD")
11688        #[serde(rename(serialize = "textEntityTypeCashtag", deserialize = "textEntityTypeCashtag"))]
11689        Cashtag,
11690        /// A bot command, beginning with "/"
11691        #[serde(rename(serialize = "textEntityTypeBotCommand", deserialize = "textEntityTypeBotCommand"))]
11692        BotCommand,
11693        /// An HTTP URL
11694        #[serde(rename(serialize = "textEntityTypeUrl", deserialize = "textEntityTypeUrl"))]
11695        Url,
11696        /// An email address
11697        #[serde(rename(serialize = "textEntityTypeEmailAddress", deserialize = "textEntityTypeEmailAddress"))]
11698        EmailAddress,
11699        /// A phone number
11700        #[serde(rename(serialize = "textEntityTypePhoneNumber", deserialize = "textEntityTypePhoneNumber"))]
11701        PhoneNumber,
11702        /// A bank card number. The getBankCardInfo method can be used to get information about the bank card
11703        #[serde(rename(serialize = "textEntityTypeBankCardNumber", deserialize = "textEntityTypeBankCardNumber"))]
11704        BankCardNumber,
11705        /// A bold text
11706        #[serde(rename(serialize = "textEntityTypeBold", deserialize = "textEntityTypeBold"))]
11707        Bold,
11708        /// An italic text
11709        #[serde(rename(serialize = "textEntityTypeItalic", deserialize = "textEntityTypeItalic"))]
11710        Italic,
11711        /// An underlined text
11712        #[serde(rename(serialize = "textEntityTypeUnderline", deserialize = "textEntityTypeUnderline"))]
11713        Underline,
11714        /// A strikethrough text
11715        #[serde(rename(serialize = "textEntityTypeStrikethrough", deserialize = "textEntityTypeStrikethrough"))]
11716        Strikethrough,
11717        /// A spoiler text
11718        #[serde(rename(serialize = "textEntityTypeSpoiler", deserialize = "textEntityTypeSpoiler"))]
11719        Spoiler,
11720        /// Text that must be formatted as if inside a code HTML tag
11721        #[serde(rename(serialize = "textEntityTypeCode", deserialize = "textEntityTypeCode"))]
11722        Code,
11723        /// Text that must be formatted as if inside a pre HTML tag
11724        #[serde(rename(serialize = "textEntityTypePre", deserialize = "textEntityTypePre"))]
11725        Pre,
11726        /// Text that must be formatted as if inside pre, and code HTML tags
11727        #[serde(rename(serialize = "textEntityTypePreCode", deserialize = "textEntityTypePreCode"))]
11728        PreCode(crate::types::TextEntityTypePreCode),
11729        /// A text description shown instead of a raw URL
11730        #[serde(rename(serialize = "textEntityTypeTextUrl", deserialize = "textEntityTypeTextUrl"))]
11731        TextUrl(crate::types::TextEntityTypeTextUrl),
11732        /// A text shows instead of a raw mention of the user (e.g., when the user has no username)
11733        #[serde(rename(serialize = "textEntityTypeMentionName", deserialize = "textEntityTypeMentionName"))]
11734        MentionName(crate::types::TextEntityTypeMentionName),
11735        /// A custom emoji. The text behind a custom emoji must be an emoji. Only premium users can use premium custom emoji
11736        #[serde(rename(serialize = "textEntityTypeCustomEmoji", deserialize = "textEntityTypeCustomEmoji"))]
11737        CustomEmoji(crate::types::TextEntityTypeCustomEmoji),
11738        /// A media timestamp
11739        #[serde(rename(serialize = "textEntityTypeMediaTimestamp", deserialize = "textEntityTypeMediaTimestamp"))]
11740        MediaTimestamp(crate::types::TextEntityTypeMediaTimestamp),
11741    }
11742    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
11743    #[serde(tag = "@type")]
11744    pub enum InputThumbnail {
11745        /// A thumbnail to be sent along with a file; must be in JPEG or WEBP format for stickers, and less than 200 KB in size
11746        #[serde(rename(serialize = "inputThumbnail", deserialize = "inputThumbnail"))]
11747        InputThumbnail(crate::types::InputThumbnail),
11748    }
11749    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
11750    #[serde(tag = "@type")]
11751    pub enum MessageSchedulingState {
11752        /// The message will be sent at the specified date
11753        #[serde(rename(serialize = "messageSchedulingStateSendAtDate", deserialize = "messageSchedulingStateSendAtDate"))]
11754        SendAtDate(crate::types::MessageSchedulingStateSendAtDate),
11755        /// The message will be sent when the peer will be online. Applicable to private chats only and when the exact online status of the peer is known
11756        #[serde(rename(serialize = "messageSchedulingStateSendWhenOnline", deserialize = "messageSchedulingStateSendWhenOnline"))]
11757        SendWhenOnline,
11758    }
11759    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
11760    #[serde(tag = "@type")]
11761    pub enum MessageSelfDestructType {
11762        /// The message will be self-destructed in the specified time after its content was opened
11763        #[serde(rename(serialize = "messageSelfDestructTypeTimer", deserialize = "messageSelfDestructTypeTimer"))]
11764        Timer(crate::types::MessageSelfDestructTypeTimer),
11765        /// The message can be opened only once and will be self-destructed once closed
11766        #[serde(rename(serialize = "messageSelfDestructTypeImmediately", deserialize = "messageSelfDestructTypeImmediately"))]
11767        Immediately,
11768    }
11769    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
11770    #[serde(tag = "@type")]
11771    pub enum MessageSendOptions {
11772        /// Options to be used when a message is sent
11773        #[serde(rename(serialize = "messageSendOptions", deserialize = "messageSendOptions"))]
11774        MessageSendOptions(crate::types::MessageSendOptions),
11775    }
11776    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
11777    #[serde(tag = "@type")]
11778    pub enum MessageCopyOptions {
11779        /// Options to be used when a message content is copied without reference to the original sender. Service messages and messageInvoice can't be copied
11780        #[serde(rename(serialize = "messageCopyOptions", deserialize = "messageCopyOptions"))]
11781        MessageCopyOptions(crate::types::MessageCopyOptions),
11782    }
11783    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
11784    #[serde(tag = "@type")]
11785    pub enum InputMessageContent {
11786        /// A text message
11787        #[serde(rename(serialize = "inputMessageText", deserialize = "inputMessageText"))]
11788        InputMessageText(crate::types::InputMessageText),
11789        /// An animation message (GIF-style).
11790        #[serde(rename(serialize = "inputMessageAnimation", deserialize = "inputMessageAnimation"))]
11791        InputMessageAnimation(crate::types::InputMessageAnimation),
11792        /// An audio message
11793        #[serde(rename(serialize = "inputMessageAudio", deserialize = "inputMessageAudio"))]
11794        InputMessageAudio(crate::types::InputMessageAudio),
11795        /// A document message (general file)
11796        #[serde(rename(serialize = "inputMessageDocument", deserialize = "inputMessageDocument"))]
11797        InputMessageDocument(crate::types::InputMessageDocument),
11798        /// A photo message
11799        #[serde(rename(serialize = "inputMessagePhoto", deserialize = "inputMessagePhoto"))]
11800        InputMessagePhoto(crate::types::InputMessagePhoto),
11801        /// A sticker message
11802        #[serde(rename(serialize = "inputMessageSticker", deserialize = "inputMessageSticker"))]
11803        InputMessageSticker(crate::types::InputMessageSticker),
11804        /// A video message
11805        #[serde(rename(serialize = "inputMessageVideo", deserialize = "inputMessageVideo"))]
11806        InputMessageVideo(crate::types::InputMessageVideo),
11807        /// A video note message
11808        #[serde(rename(serialize = "inputMessageVideoNote", deserialize = "inputMessageVideoNote"))]
11809        InputMessageVideoNote(crate::types::InputMessageVideoNote),
11810        /// A voice note message
11811        #[serde(rename(serialize = "inputMessageVoiceNote", deserialize = "inputMessageVoiceNote"))]
11812        InputMessageVoiceNote(crate::types::InputMessageVoiceNote),
11813        /// A message with a location
11814        #[serde(rename(serialize = "inputMessageLocation", deserialize = "inputMessageLocation"))]
11815        InputMessageLocation(crate::types::InputMessageLocation),
11816        /// A message with information about a venue
11817        #[serde(rename(serialize = "inputMessageVenue", deserialize = "inputMessageVenue"))]
11818        InputMessageVenue(crate::types::InputMessageVenue),
11819        /// A message containing a user contact
11820        #[serde(rename(serialize = "inputMessageContact", deserialize = "inputMessageContact"))]
11821        InputMessageContact(crate::types::InputMessageContact),
11822        /// A dice message
11823        #[serde(rename(serialize = "inputMessageDice", deserialize = "inputMessageDice"))]
11824        InputMessageDice(crate::types::InputMessageDice),
11825        /// A message with a game; not supported for channels or secret chats
11826        #[serde(rename(serialize = "inputMessageGame", deserialize = "inputMessageGame"))]
11827        InputMessageGame(crate::types::InputMessageGame),
11828        /// A message with an invoice; can be used only by bots
11829        #[serde(rename(serialize = "inputMessageInvoice", deserialize = "inputMessageInvoice"))]
11830        InputMessageInvoice(Box<crate::types::InputMessageInvoice>),
11831        /// A message with a poll. Polls can't be sent to secret chats. Polls can be sent only to a private chat with a bot
11832        #[serde(rename(serialize = "inputMessagePoll", deserialize = "inputMessagePoll"))]
11833        InputMessagePoll(crate::types::InputMessagePoll),
11834        /// A message with a forwarded story. Stories can't be sent to secret chats. A story can be forwarded only if story.can_be_forwarded
11835        #[serde(rename(serialize = "inputMessageStory", deserialize = "inputMessageStory"))]
11836        InputMessageStory(crate::types::InputMessageStory),
11837        /// A forwarded message
11838        #[serde(rename(serialize = "inputMessageForwarded", deserialize = "inputMessageForwarded"))]
11839        InputMessageForwarded(crate::types::InputMessageForwarded),
11840    }
11841    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
11842    #[serde(tag = "@type")]
11843    pub enum SearchMessagesFilter {
11844        /// Returns all found messages, no filter is applied
11845        #[serde(rename(serialize = "searchMessagesFilterEmpty", deserialize = "searchMessagesFilterEmpty"))]
11846        Empty,
11847        /// Returns only animation messages
11848        #[serde(rename(serialize = "searchMessagesFilterAnimation", deserialize = "searchMessagesFilterAnimation"))]
11849        Animation,
11850        /// Returns only audio messages
11851        #[serde(rename(serialize = "searchMessagesFilterAudio", deserialize = "searchMessagesFilterAudio"))]
11852        Audio,
11853        /// Returns only document messages
11854        #[serde(rename(serialize = "searchMessagesFilterDocument", deserialize = "searchMessagesFilterDocument"))]
11855        Document,
11856        /// Returns only photo messages
11857        #[serde(rename(serialize = "searchMessagesFilterPhoto", deserialize = "searchMessagesFilterPhoto"))]
11858        Photo,
11859        /// Returns only video messages
11860        #[serde(rename(serialize = "searchMessagesFilterVideo", deserialize = "searchMessagesFilterVideo"))]
11861        Video,
11862        /// Returns only voice note messages
11863        #[serde(rename(serialize = "searchMessagesFilterVoiceNote", deserialize = "searchMessagesFilterVoiceNote"))]
11864        VoiceNote,
11865        /// Returns only photo and video messages
11866        #[serde(rename(serialize = "searchMessagesFilterPhotoAndVideo", deserialize = "searchMessagesFilterPhotoAndVideo"))]
11867        PhotoAndVideo,
11868        /// Returns only messages containing URLs
11869        #[serde(rename(serialize = "searchMessagesFilterUrl", deserialize = "searchMessagesFilterUrl"))]
11870        Url,
11871        /// Returns only messages containing chat photos
11872        #[serde(rename(serialize = "searchMessagesFilterChatPhoto", deserialize = "searchMessagesFilterChatPhoto"))]
11873        ChatPhoto,
11874        /// Returns only video note messages
11875        #[serde(rename(serialize = "searchMessagesFilterVideoNote", deserialize = "searchMessagesFilterVideoNote"))]
11876        VideoNote,
11877        /// Returns only voice and video note messages
11878        #[serde(rename(serialize = "searchMessagesFilterVoiceAndVideoNote", deserialize = "searchMessagesFilterVoiceAndVideoNote"))]
11879        VoiceAndVideoNote,
11880        /// Returns only messages with mentions of the current user, or messages that are replies to their messages
11881        #[serde(rename(serialize = "searchMessagesFilterMention", deserialize = "searchMessagesFilterMention"))]
11882        Mention,
11883        /// Returns only messages with unread mentions of the current user, or messages that are replies to their messages. When using this filter the results can't be additionally filtered by a query, a message thread or by the sending user
11884        #[serde(rename(serialize = "searchMessagesFilterUnreadMention", deserialize = "searchMessagesFilterUnreadMention"))]
11885        UnreadMention,
11886        /// Returns only messages with unread reactions for the current user. When using this filter the results can't be additionally filtered by a query, a message thread or by the sending user
11887        #[serde(rename(serialize = "searchMessagesFilterUnreadReaction", deserialize = "searchMessagesFilterUnreadReaction"))]
11888        UnreadReaction,
11889        /// Returns only failed to send messages. This filter can be used only if the message database is used
11890        #[serde(rename(serialize = "searchMessagesFilterFailedToSend", deserialize = "searchMessagesFilterFailedToSend"))]
11891        FailedToSend,
11892        /// Returns only pinned messages
11893        #[serde(rename(serialize = "searchMessagesFilterPinned", deserialize = "searchMessagesFilterPinned"))]
11894        Pinned,
11895    }
11896    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
11897    #[serde(tag = "@type")]
11898    pub enum ChatAction {
11899        /// The user is typing a message
11900        #[serde(rename(serialize = "chatActionTyping", deserialize = "chatActionTyping"))]
11901        Typing,
11902        /// The user is recording a video
11903        #[serde(rename(serialize = "chatActionRecordingVideo", deserialize = "chatActionRecordingVideo"))]
11904        RecordingVideo,
11905        /// The user is uploading a video
11906        #[serde(rename(serialize = "chatActionUploadingVideo", deserialize = "chatActionUploadingVideo"))]
11907        UploadingVideo(crate::types::ChatActionUploadingVideo),
11908        /// The user is recording a voice note
11909        #[serde(rename(serialize = "chatActionRecordingVoiceNote", deserialize = "chatActionRecordingVoiceNote"))]
11910        RecordingVoiceNote,
11911        /// The user is uploading a voice note
11912        #[serde(rename(serialize = "chatActionUploadingVoiceNote", deserialize = "chatActionUploadingVoiceNote"))]
11913        UploadingVoiceNote(crate::types::ChatActionUploadingVoiceNote),
11914        /// The user is uploading a photo
11915        #[serde(rename(serialize = "chatActionUploadingPhoto", deserialize = "chatActionUploadingPhoto"))]
11916        UploadingPhoto(crate::types::ChatActionUploadingPhoto),
11917        /// The user is uploading a document
11918        #[serde(rename(serialize = "chatActionUploadingDocument", deserialize = "chatActionUploadingDocument"))]
11919        UploadingDocument(crate::types::ChatActionUploadingDocument),
11920        /// The user is picking a sticker to send
11921        #[serde(rename(serialize = "chatActionChoosingSticker", deserialize = "chatActionChoosingSticker"))]
11922        ChoosingSticker,
11923        /// The user is picking a location or venue to send
11924        #[serde(rename(serialize = "chatActionChoosingLocation", deserialize = "chatActionChoosingLocation"))]
11925        ChoosingLocation,
11926        /// The user is picking a contact to send
11927        #[serde(rename(serialize = "chatActionChoosingContact", deserialize = "chatActionChoosingContact"))]
11928        ChoosingContact,
11929        /// The user has started to play a game
11930        #[serde(rename(serialize = "chatActionStartPlayingGame", deserialize = "chatActionStartPlayingGame"))]
11931        StartPlayingGame,
11932        /// The user is recording a video note
11933        #[serde(rename(serialize = "chatActionRecordingVideoNote", deserialize = "chatActionRecordingVideoNote"))]
11934        RecordingVideoNote,
11935        /// The user is uploading a video note
11936        #[serde(rename(serialize = "chatActionUploadingVideoNote", deserialize = "chatActionUploadingVideoNote"))]
11937        UploadingVideoNote(crate::types::ChatActionUploadingVideoNote),
11938        /// The user is watching animations sent by the other party by clicking on an animated emoji
11939        #[serde(rename(serialize = "chatActionWatchingAnimations", deserialize = "chatActionWatchingAnimations"))]
11940        WatchingAnimations(crate::types::ChatActionWatchingAnimations),
11941        /// The user has canceled the previous action
11942        #[serde(rename(serialize = "chatActionCancel", deserialize = "chatActionCancel"))]
11943        Cancel,
11944    }
11945    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
11946    #[serde(tag = "@type")]
11947    pub enum UserStatus {
11948        /// The user status was never changed
11949        #[serde(rename(serialize = "userStatusEmpty", deserialize = "userStatusEmpty"))]
11950        Empty,
11951        /// The user is online
11952        #[serde(rename(serialize = "userStatusOnline", deserialize = "userStatusOnline"))]
11953        Online(crate::types::UserStatusOnline),
11954        /// The user is offline
11955        #[serde(rename(serialize = "userStatusOffline", deserialize = "userStatusOffline"))]
11956        Offline(crate::types::UserStatusOffline),
11957        /// The user was online recently
11958        #[serde(rename(serialize = "userStatusRecently", deserialize = "userStatusRecently"))]
11959        Recently,
11960        /// The user is offline, but was online last week
11961        #[serde(rename(serialize = "userStatusLastWeek", deserialize = "userStatusLastWeek"))]
11962        LastWeek,
11963        /// The user is offline, but was online last month
11964        #[serde(rename(serialize = "userStatusLastMonth", deserialize = "userStatusLastMonth"))]
11965        LastMonth,
11966    }
11967    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
11968    #[serde(tag = "@type")]
11969    pub enum Stickers {
11970        /// Represents a list of stickers
11971        #[serde(rename(serialize = "stickers", deserialize = "stickers"))]
11972        Stickers(crate::types::Stickers),
11973    }
11974    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
11975    #[serde(tag = "@type")]
11976    pub enum Emojis {
11977        /// Represents a list of emoji
11978        #[serde(rename(serialize = "emojis", deserialize = "emojis"))]
11979        Emojis(crate::types::Emojis),
11980    }
11981    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
11982    #[serde(tag = "@type")]
11983    pub enum StickerSet {
11984        /// Represents a sticker set
11985        #[serde(rename(serialize = "stickerSet", deserialize = "stickerSet"))]
11986        StickerSet(crate::types::StickerSet),
11987    }
11988    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
11989    #[serde(tag = "@type")]
11990    pub enum StickerSetInfo {
11991        /// Represents short information about a sticker set
11992        #[serde(rename(serialize = "stickerSetInfo", deserialize = "stickerSetInfo"))]
11993        StickerSetInfo(crate::types::StickerSetInfo),
11994    }
11995    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
11996    #[serde(tag = "@type")]
11997    pub enum StickerSets {
11998        /// Represents a list of sticker sets
11999        #[serde(rename(serialize = "stickerSets", deserialize = "stickerSets"))]
12000        StickerSets(crate::types::StickerSets),
12001    }
12002    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
12003    #[serde(tag = "@type")]
12004    pub enum TrendingStickerSets {
12005        /// Represents a list of trending sticker sets
12006        #[serde(rename(serialize = "trendingStickerSets", deserialize = "trendingStickerSets"))]
12007        TrendingStickerSets(crate::types::TrendingStickerSets),
12008    }
12009    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
12010    #[serde(tag = "@type")]
12011    pub enum EmojiCategory {
12012        /// Contains a list of similar emoji to search for in getStickers and searchStickers
12013        #[serde(rename(serialize = "emojiCategory", deserialize = "emojiCategory"))]
12014        EmojiCategory(crate::types::EmojiCategory),
12015    }
12016    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
12017    #[serde(tag = "@type")]
12018    pub enum EmojiCategories {
12019        /// Represents a list of emoji categories
12020        #[serde(rename(serialize = "emojiCategories", deserialize = "emojiCategories"))]
12021        EmojiCategories(crate::types::EmojiCategories),
12022    }
12023    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
12024    #[serde(tag = "@type")]
12025    pub enum EmojiCategoryType {
12026        /// The category must be used by default
12027        #[serde(rename(serialize = "emojiCategoryTypeDefault", deserialize = "emojiCategoryTypeDefault"))]
12028        Default,
12029        /// The category must be used for emoji status selection
12030        #[serde(rename(serialize = "emojiCategoryTypeEmojiStatus", deserialize = "emojiCategoryTypeEmojiStatus"))]
12031        EmojiStatus,
12032        /// The category must be used for chat photo emoji selection
12033        #[serde(rename(serialize = "emojiCategoryTypeChatPhoto", deserialize = "emojiCategoryTypeChatPhoto"))]
12034        ChatPhoto,
12035    }
12036    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
12037    #[serde(tag = "@type")]
12038    pub enum StoryViewer {
12039        /// Represents a viewer of a story
12040        #[serde(rename(serialize = "storyViewer", deserialize = "storyViewer"))]
12041        StoryViewer(crate::types::StoryViewer),
12042    }
12043    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
12044    #[serde(tag = "@type")]
12045    pub enum StoryViewers {
12046        /// Represents a list of story viewers
12047        #[serde(rename(serialize = "storyViewers", deserialize = "storyViewers"))]
12048        StoryViewers(crate::types::StoryViewers),
12049    }
12050    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
12051    #[serde(tag = "@type")]
12052    pub enum StoryAreaPosition {
12053        /// Describes position of a clickable rectangle area on a story media
12054        #[serde(rename(serialize = "storyAreaPosition", deserialize = "storyAreaPosition"))]
12055        StoryAreaPosition(crate::types::StoryAreaPosition),
12056    }
12057    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
12058    #[serde(tag = "@type")]
12059    pub enum StoryAreaType {
12060        /// An area pointing to a location
12061        #[serde(rename(serialize = "storyAreaTypeLocation", deserialize = "storyAreaTypeLocation"))]
12062        Location(crate::types::StoryAreaTypeLocation),
12063        /// An area pointing to a venue
12064        #[serde(rename(serialize = "storyAreaTypeVenue", deserialize = "storyAreaTypeVenue"))]
12065        Venue(crate::types::StoryAreaTypeVenue),
12066        /// An area pointing to a suggested reaction. App needs to show a clickable reaction on the area and call setStoryReaction when the are is clicked
12067        #[serde(rename(serialize = "storyAreaTypeSuggestedReaction", deserialize = "storyAreaTypeSuggestedReaction"))]
12068        SuggestedReaction(crate::types::StoryAreaTypeSuggestedReaction),
12069    }
12070    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
12071    #[serde(tag = "@type")]
12072    pub enum StoryArea {
12073        /// Describes a clickable rectangle area on a story media
12074        #[serde(rename(serialize = "storyArea", deserialize = "storyArea"))]
12075        StoryArea(crate::types::StoryArea),
12076    }
12077    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
12078    #[serde(tag = "@type")]
12079    pub enum InputStoryAreaType {
12080        /// An area pointing to a location
12081        #[serde(rename(serialize = "inputStoryAreaTypeLocation", deserialize = "inputStoryAreaTypeLocation"))]
12082        Location(crate::types::InputStoryAreaTypeLocation),
12083        /// An area pointing to a venue found by the bot getOption("venue_search_bot_username")
12084        #[serde(rename(serialize = "inputStoryAreaTypeFoundVenue", deserialize = "inputStoryAreaTypeFoundVenue"))]
12085        FoundVenue(crate::types::InputStoryAreaTypeFoundVenue),
12086        /// An area pointing to a venue already added to the story
12087        #[serde(rename(serialize = "inputStoryAreaTypePreviousVenue", deserialize = "inputStoryAreaTypePreviousVenue"))]
12088        PreviousVenue(crate::types::InputStoryAreaTypePreviousVenue),
12089        /// An area pointing to a suggested reaction
12090        #[serde(rename(serialize = "inputStoryAreaTypeSuggestedReaction", deserialize = "inputStoryAreaTypeSuggestedReaction"))]
12091        SuggestedReaction(crate::types::InputStoryAreaTypeSuggestedReaction),
12092    }
12093    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
12094    #[serde(tag = "@type")]
12095    pub enum InputStoryArea {
12096        /// Describes a clickable rectangle area on a story media to be added
12097        #[serde(rename(serialize = "inputStoryArea", deserialize = "inputStoryArea"))]
12098        InputStoryArea(crate::types::InputStoryArea),
12099    }
12100    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
12101    #[serde(tag = "@type")]
12102    pub enum InputStoryAreas {
12103        /// Contains a list of story areas to be added
12104        #[serde(rename(serialize = "inputStoryAreas", deserialize = "inputStoryAreas"))]
12105        InputStoryAreas(crate::types::InputStoryAreas),
12106    }
12107    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
12108    #[serde(tag = "@type")]
12109    pub enum StoryVideo {
12110        /// Describes a video file sent in a story
12111        #[serde(rename(serialize = "storyVideo", deserialize = "storyVideo"))]
12112        StoryVideo(crate::types::StoryVideo),
12113    }
12114    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
12115    #[serde(tag = "@type")]
12116    pub enum StoryContent {
12117        /// A photo story
12118        #[serde(rename(serialize = "storyContentPhoto", deserialize = "storyContentPhoto"))]
12119        Photo(crate::types::StoryContentPhoto),
12120        /// A video story
12121        #[serde(rename(serialize = "storyContentVideo", deserialize = "storyContentVideo"))]
12122        Video(crate::types::StoryContentVideo),
12123        /// A story content that is not supported in the current TDLib version
12124        #[serde(rename(serialize = "storyContentUnsupported", deserialize = "storyContentUnsupported"))]
12125        Unsupported,
12126    }
12127    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
12128    #[serde(tag = "@type")]
12129    pub enum InputStoryContent {
12130        /// A photo story
12131        #[serde(rename(serialize = "inputStoryContentPhoto", deserialize = "inputStoryContentPhoto"))]
12132        Photo(crate::types::InputStoryContentPhoto),
12133        /// A video story
12134        #[serde(rename(serialize = "inputStoryContentVideo", deserialize = "inputStoryContentVideo"))]
12135        Video(crate::types::InputStoryContentVideo),
12136    }
12137    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
12138    #[serde(tag = "@type")]
12139    pub enum StoryList {
12140        /// The list of stories, shown in the main chat list and folder chat lists
12141        #[serde(rename(serialize = "storyListMain", deserialize = "storyListMain"))]
12142        Main,
12143        /// The list of stories, shown in the Arvhive chat list
12144        #[serde(rename(serialize = "storyListArchive", deserialize = "storyListArchive"))]
12145        Archive,
12146    }
12147    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
12148    #[serde(tag = "@type")]
12149    pub enum StoryInteractionInfo {
12150        /// Contains information about interactions with a story
12151        #[serde(rename(serialize = "storyInteractionInfo", deserialize = "storyInteractionInfo"))]
12152        StoryInteractionInfo(crate::types::StoryInteractionInfo),
12153    }
12154    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
12155    #[serde(tag = "@type")]
12156    pub enum Story {
12157        /// Represents a story
12158        #[serde(rename(serialize = "story", deserialize = "story"))]
12159        Story(crate::types::Story),
12160    }
12161    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
12162    #[serde(tag = "@type")]
12163    pub enum Stories {
12164        /// Represents a list of stories
12165        #[serde(rename(serialize = "stories", deserialize = "stories"))]
12166        Stories(crate::types::Stories),
12167    }
12168    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
12169    #[serde(tag = "@type")]
12170    pub enum StoryInfo {
12171        /// Contains basic information about a story
12172        #[serde(rename(serialize = "storyInfo", deserialize = "storyInfo"))]
12173        StoryInfo(crate::types::StoryInfo),
12174    }
12175    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
12176    #[serde(tag = "@type")]
12177    pub enum ChatActiveStories {
12178        /// Describes active stories posted by a chat
12179        #[serde(rename(serialize = "chatActiveStories", deserialize = "chatActiveStories"))]
12180        ChatActiveStories(crate::types::ChatActiveStories),
12181    }
12182    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
12183    #[serde(tag = "@type")]
12184    pub enum ChatBoostStatus {
12185        /// Describes current boost status of a chat
12186        #[serde(rename(serialize = "chatBoostStatus", deserialize = "chatBoostStatus"))]
12187        ChatBoostStatus(crate::types::ChatBoostStatus),
12188    }
12189    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
12190    #[serde(tag = "@type")]
12191    pub enum ChatBoost {
12192        /// Describes a boost of a chat
12193        #[serde(rename(serialize = "chatBoost", deserialize = "chatBoost"))]
12194        ChatBoost(crate::types::ChatBoost),
12195    }
12196    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
12197    #[serde(tag = "@type")]
12198    pub enum FoundChatBoosts {
12199        /// Contains a list of boosts applied to a chat
12200        #[serde(rename(serialize = "foundChatBoosts", deserialize = "foundChatBoosts"))]
12201        FoundChatBoosts(crate::types::FoundChatBoosts),
12202    }
12203    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
12204    #[serde(tag = "@type")]
12205    pub enum CallDiscardReason {
12206        /// The call wasn't discarded, or the reason is unknown
12207        #[serde(rename(serialize = "callDiscardReasonEmpty", deserialize = "callDiscardReasonEmpty"))]
12208        Empty,
12209        /// The call was ended before the conversation started. It was canceled by the caller or missed by the other party
12210        #[serde(rename(serialize = "callDiscardReasonMissed", deserialize = "callDiscardReasonMissed"))]
12211        Missed,
12212        /// The call was ended before the conversation started. It was declined by the other party
12213        #[serde(rename(serialize = "callDiscardReasonDeclined", deserialize = "callDiscardReasonDeclined"))]
12214        Declined,
12215        /// The call was ended during the conversation because the users were disconnected
12216        #[serde(rename(serialize = "callDiscardReasonDisconnected", deserialize = "callDiscardReasonDisconnected"))]
12217        Disconnected,
12218        /// The call was ended because one of the parties hung up
12219        #[serde(rename(serialize = "callDiscardReasonHungUp", deserialize = "callDiscardReasonHungUp"))]
12220        HungUp,
12221    }
12222    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
12223    #[serde(tag = "@type")]
12224    pub enum CallProtocol {
12225        /// Specifies the supported call protocols
12226        #[serde(rename(serialize = "callProtocol", deserialize = "callProtocol"))]
12227        CallProtocol(crate::types::CallProtocol),
12228    }
12229    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
12230    #[serde(tag = "@type")]
12231    pub enum CallServerType {
12232        /// A Telegram call reflector
12233        #[serde(rename(serialize = "callServerTypeTelegramReflector", deserialize = "callServerTypeTelegramReflector"))]
12234        TelegramReflector(crate::types::CallServerTypeTelegramReflector),
12235        /// A WebRTC server
12236        #[serde(rename(serialize = "callServerTypeWebrtc", deserialize = "callServerTypeWebrtc"))]
12237        Webrtc(crate::types::CallServerTypeWebrtc),
12238    }
12239    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
12240    #[serde(tag = "@type")]
12241    pub enum CallServer {
12242        /// Describes a server for relaying call data
12243        #[serde(rename(serialize = "callServer", deserialize = "callServer"))]
12244        CallServer(crate::types::CallServer),
12245    }
12246    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
12247    #[serde(tag = "@type")]
12248    pub enum CallId {
12249        /// Contains the call identifier
12250        #[serde(rename(serialize = "callId", deserialize = "callId"))]
12251        CallId(crate::types::CallId),
12252    }
12253    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
12254    #[serde(tag = "@type")]
12255    pub enum GroupCallId {
12256        /// Contains the group call identifier
12257        #[serde(rename(serialize = "groupCallId", deserialize = "groupCallId"))]
12258        GroupCallId(crate::types::GroupCallId),
12259    }
12260    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
12261    #[serde(tag = "@type")]
12262    pub enum CallState {
12263        /// The call is pending, waiting to be accepted by a user
12264        #[serde(rename(serialize = "callStatePending", deserialize = "callStatePending"))]
12265        Pending(crate::types::CallStatePending),
12266        /// The call has been answered and encryption keys are being exchanged
12267        #[serde(rename(serialize = "callStateExchangingKeys", deserialize = "callStateExchangingKeys"))]
12268        ExchangingKeys,
12269        /// The call is ready to use
12270        #[serde(rename(serialize = "callStateReady", deserialize = "callStateReady"))]
12271        Ready(crate::types::CallStateReady),
12272        /// The call is hanging up after discardCall has been called
12273        #[serde(rename(serialize = "callStateHangingUp", deserialize = "callStateHangingUp"))]
12274        HangingUp,
12275        /// The call has ended successfully
12276        #[serde(rename(serialize = "callStateDiscarded", deserialize = "callStateDiscarded"))]
12277        Discarded(crate::types::CallStateDiscarded),
12278        /// The call has ended with an error
12279        #[serde(rename(serialize = "callStateError", deserialize = "callStateError"))]
12280        Error(crate::types::CallStateError),
12281    }
12282    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
12283    #[serde(tag = "@type")]
12284    pub enum GroupCallVideoQuality {
12285        /// The worst available video quality
12286        #[serde(rename(serialize = "groupCallVideoQualityThumbnail", deserialize = "groupCallVideoQualityThumbnail"))]
12287        Thumbnail,
12288        /// The medium video quality
12289        #[serde(rename(serialize = "groupCallVideoQualityMedium", deserialize = "groupCallVideoQualityMedium"))]
12290        Medium,
12291        /// The best available video quality
12292        #[serde(rename(serialize = "groupCallVideoQualityFull", deserialize = "groupCallVideoQualityFull"))]
12293        Full,
12294    }
12295    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
12296    #[serde(tag = "@type")]
12297    pub enum GroupCallStream {
12298        /// Describes an available stream in a group call
12299        #[serde(rename(serialize = "groupCallStream", deserialize = "groupCallStream"))]
12300        GroupCallStream(crate::types::GroupCallStream),
12301    }
12302    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
12303    #[serde(tag = "@type")]
12304    pub enum GroupCallStreams {
12305        /// Represents a list of group call streams
12306        #[serde(rename(serialize = "groupCallStreams", deserialize = "groupCallStreams"))]
12307        GroupCallStreams(crate::types::GroupCallStreams),
12308    }
12309    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
12310    #[serde(tag = "@type")]
12311    pub enum RtmpUrl {
12312        /// Represents an RTMP URL
12313        #[serde(rename(serialize = "rtmpUrl", deserialize = "rtmpUrl"))]
12314        RtmpUrl(crate::types::RtmpUrl),
12315    }
12316    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
12317    #[serde(tag = "@type")]
12318    pub enum GroupCallRecentSpeaker {
12319        /// Describes a recently speaking participant in a group call
12320        #[serde(rename(serialize = "groupCallRecentSpeaker", deserialize = "groupCallRecentSpeaker"))]
12321        GroupCallRecentSpeaker(crate::types::GroupCallRecentSpeaker),
12322    }
12323    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
12324    #[serde(tag = "@type")]
12325    pub enum GroupCall {
12326        /// Describes a group call
12327        #[serde(rename(serialize = "groupCall", deserialize = "groupCall"))]
12328        GroupCall(crate::types::GroupCall),
12329    }
12330    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
12331    #[serde(tag = "@type")]
12332    pub enum GroupCallVideoSourceGroup {
12333        /// Describes a group of video synchronization source identifiers
12334        #[serde(rename(serialize = "groupCallVideoSourceGroup", deserialize = "groupCallVideoSourceGroup"))]
12335        GroupCallVideoSourceGroup(crate::types::GroupCallVideoSourceGroup),
12336    }
12337    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
12338    #[serde(tag = "@type")]
12339    pub enum GroupCallParticipantVideoInfo {
12340        /// Contains information about a group call participant's video channel
12341        #[serde(rename(serialize = "groupCallParticipantVideoInfo", deserialize = "groupCallParticipantVideoInfo"))]
12342        GroupCallParticipantVideoInfo(crate::types::GroupCallParticipantVideoInfo),
12343    }
12344    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
12345    #[serde(tag = "@type")]
12346    pub enum GroupCallParticipant {
12347        /// Represents a group call participant
12348        #[serde(rename(serialize = "groupCallParticipant", deserialize = "groupCallParticipant"))]
12349        GroupCallParticipant(crate::types::GroupCallParticipant),
12350    }
12351    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
12352    #[serde(tag = "@type")]
12353    pub enum CallProblem {
12354        /// The user heard their own voice
12355        #[serde(rename(serialize = "callProblemEcho", deserialize = "callProblemEcho"))]
12356        Echo,
12357        /// The user heard background noise
12358        #[serde(rename(serialize = "callProblemNoise", deserialize = "callProblemNoise"))]
12359        Noise,
12360        /// The other side kept disappearing
12361        #[serde(rename(serialize = "callProblemInterruptions", deserialize = "callProblemInterruptions"))]
12362        Interruptions,
12363        /// The speech was distorted
12364        #[serde(rename(serialize = "callProblemDistortedSpeech", deserialize = "callProblemDistortedSpeech"))]
12365        DistortedSpeech,
12366        /// The user couldn't hear the other side
12367        #[serde(rename(serialize = "callProblemSilentLocal", deserialize = "callProblemSilentLocal"))]
12368        SilentLocal,
12369        /// The other side couldn't hear the user
12370        #[serde(rename(serialize = "callProblemSilentRemote", deserialize = "callProblemSilentRemote"))]
12371        SilentRemote,
12372        /// The call ended unexpectedly
12373        #[serde(rename(serialize = "callProblemDropped", deserialize = "callProblemDropped"))]
12374        Dropped,
12375        /// The video was distorted
12376        #[serde(rename(serialize = "callProblemDistortedVideo", deserialize = "callProblemDistortedVideo"))]
12377        DistortedVideo,
12378        /// The video was pixelated
12379        #[serde(rename(serialize = "callProblemPixelatedVideo", deserialize = "callProblemPixelatedVideo"))]
12380        PixelatedVideo,
12381    }
12382    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
12383    #[serde(tag = "@type")]
12384    pub enum Call {
12385        /// Describes a call
12386        #[serde(rename(serialize = "call", deserialize = "call"))]
12387        Call(crate::types::Call),
12388    }
12389    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
12390    #[serde(tag = "@type")]
12391    pub enum FirebaseAuthenticationSettings {
12392        /// Settings for Firebase Authentication in the official Android application
12393        #[serde(rename(serialize = "firebaseAuthenticationSettingsAndroid", deserialize = "firebaseAuthenticationSettingsAndroid"))]
12394        Android,
12395        /// Settings for Firebase Authentication in the official iOS application
12396        #[serde(rename(serialize = "firebaseAuthenticationSettingsIos", deserialize = "firebaseAuthenticationSettingsIos"))]
12397        Ios(crate::types::FirebaseAuthenticationSettingsIos),
12398    }
12399    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
12400    #[serde(tag = "@type")]
12401    pub enum PhoneNumberAuthenticationSettings {
12402        /// Contains settings for the authentication of the user's phone number
12403        #[serde(rename(serialize = "phoneNumberAuthenticationSettings", deserialize = "phoneNumberAuthenticationSettings"))]
12404        PhoneNumberAuthenticationSettings(crate::types::PhoneNumberAuthenticationSettings),
12405    }
12406    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
12407    #[serde(tag = "@type")]
12408    pub enum AddedReaction {
12409        /// Represents a reaction applied to a message
12410        #[serde(rename(serialize = "addedReaction", deserialize = "addedReaction"))]
12411        AddedReaction(crate::types::AddedReaction),
12412    }
12413    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
12414    #[serde(tag = "@type")]
12415    pub enum AddedReactions {
12416        /// Represents a list of reactions added to a message
12417        #[serde(rename(serialize = "addedReactions", deserialize = "addedReactions"))]
12418        AddedReactions(crate::types::AddedReactions),
12419    }
12420    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
12421    #[serde(tag = "@type")]
12422    pub enum AvailableReaction {
12423        /// Represents an available reaction
12424        #[serde(rename(serialize = "availableReaction", deserialize = "availableReaction"))]
12425        AvailableReaction(crate::types::AvailableReaction),
12426    }
12427    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
12428    #[serde(tag = "@type")]
12429    pub enum AvailableReactions {
12430        /// Represents a list of reactions that can be added to a message
12431        #[serde(rename(serialize = "availableReactions", deserialize = "availableReactions"))]
12432        AvailableReactions(crate::types::AvailableReactions),
12433    }
12434    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
12435    #[serde(tag = "@type")]
12436    pub enum EmojiReaction {
12437        /// Contains information about a emoji reaction
12438        #[serde(rename(serialize = "emojiReaction", deserialize = "emojiReaction"))]
12439        EmojiReaction(crate::types::EmojiReaction),
12440    }
12441    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
12442    #[serde(tag = "@type")]
12443    pub enum Animations {
12444        /// Represents a list of animations
12445        #[serde(rename(serialize = "animations", deserialize = "animations"))]
12446        Animations(crate::types::Animations),
12447    }
12448    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
12449    #[serde(tag = "@type")]
12450    pub enum DiceStickers {
12451        /// A regular animated sticker
12452        #[serde(rename(serialize = "diceStickersRegular", deserialize = "diceStickersRegular"))]
12453        Regular(crate::types::DiceStickersRegular),
12454        /// Animated stickers to be combined into a slot machine
12455        #[serde(rename(serialize = "diceStickersSlotMachine", deserialize = "diceStickersSlotMachine"))]
12456        SlotMachine(crate::types::DiceStickersSlotMachine),
12457    }
12458    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
12459    #[serde(tag = "@type")]
12460    pub enum ImportedContacts {
12461        /// Represents the result of an importContacts request
12462        #[serde(rename(serialize = "importedContacts", deserialize = "importedContacts"))]
12463        ImportedContacts(crate::types::ImportedContacts),
12464    }
12465    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
12466    #[serde(tag = "@type")]
12467    pub enum SpeechRecognitionResult {
12468        /// The speech recognition is ongoing
12469        #[serde(rename(serialize = "speechRecognitionResultPending", deserialize = "speechRecognitionResultPending"))]
12470        Pending(crate::types::SpeechRecognitionResultPending),
12471        /// The speech recognition successfully finished
12472        #[serde(rename(serialize = "speechRecognitionResultText", deserialize = "speechRecognitionResultText"))]
12473        Text(crate::types::SpeechRecognitionResultText),
12474        /// The speech recognition failed
12475        #[serde(rename(serialize = "speechRecognitionResultError", deserialize = "speechRecognitionResultError"))]
12476        Error(crate::types::SpeechRecognitionResultError),
12477    }
12478    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
12479    #[serde(tag = "@type")]
12480    pub enum AttachmentMenuBotColor {
12481        /// Describes a color to highlight a bot added to attachment menu
12482        #[serde(rename(serialize = "attachmentMenuBotColor", deserialize = "attachmentMenuBotColor"))]
12483        AttachmentMenuBotColor(crate::types::AttachmentMenuBotColor),
12484    }
12485    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
12486    #[serde(tag = "@type")]
12487    pub enum AttachmentMenuBot {
12488        /// Represents a bot, which can be added to attachment or side menu
12489        #[serde(rename(serialize = "attachmentMenuBot", deserialize = "attachmentMenuBot"))]
12490        AttachmentMenuBot(crate::types::AttachmentMenuBot),
12491    }
12492    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
12493    #[serde(tag = "@type")]
12494    pub enum SentWebAppMessage {
12495        /// Information about the message sent by answerWebAppQuery
12496        #[serde(rename(serialize = "sentWebAppMessage", deserialize = "sentWebAppMessage"))]
12497        SentWebAppMessage(crate::types::SentWebAppMessage),
12498    }
12499    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
12500    #[serde(tag = "@type")]
12501    pub enum HttpUrl {
12502        /// Contains an HTTP URL
12503        #[serde(rename(serialize = "httpUrl", deserialize = "httpUrl"))]
12504        HttpUrl(crate::types::HttpUrl),
12505    }
12506    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
12507    #[serde(tag = "@type")]
12508    pub enum UserLink {
12509        /// Contains an HTTPS URL, which can be used to get information about a user
12510        #[serde(rename(serialize = "userLink", deserialize = "userLink"))]
12511        UserLink(crate::types::UserLink),
12512    }
12513    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
12514    #[serde(tag = "@type")]
12515    pub enum InputInlineQueryResult {
12516        /// Represents a link to an animated GIF or an animated (i.e., without sound) H.264/MPEG-4 AVC video
12517        #[serde(rename(serialize = "inputInlineQueryResultAnimation", deserialize = "inputInlineQueryResultAnimation"))]
12518        Animation(crate::types::InputInlineQueryResultAnimation),
12519        /// Represents a link to an article or web page
12520        #[serde(rename(serialize = "inputInlineQueryResultArticle", deserialize = "inputInlineQueryResultArticle"))]
12521        Article(crate::types::InputInlineQueryResultArticle),
12522        /// Represents a link to an MP3 audio file
12523        #[serde(rename(serialize = "inputInlineQueryResultAudio", deserialize = "inputInlineQueryResultAudio"))]
12524        Audio(crate::types::InputInlineQueryResultAudio),
12525        /// Represents a user contact
12526        #[serde(rename(serialize = "inputInlineQueryResultContact", deserialize = "inputInlineQueryResultContact"))]
12527        Contact(crate::types::InputInlineQueryResultContact),
12528        /// Represents a link to a file
12529        #[serde(rename(serialize = "inputInlineQueryResultDocument", deserialize = "inputInlineQueryResultDocument"))]
12530        Document(crate::types::InputInlineQueryResultDocument),
12531        /// Represents a game
12532        #[serde(rename(serialize = "inputInlineQueryResultGame", deserialize = "inputInlineQueryResultGame"))]
12533        Game(crate::types::InputInlineQueryResultGame),
12534        /// Represents a point on the map
12535        #[serde(rename(serialize = "inputInlineQueryResultLocation", deserialize = "inputInlineQueryResultLocation"))]
12536        Location(crate::types::InputInlineQueryResultLocation),
12537        /// Represents link to a JPEG image
12538        #[serde(rename(serialize = "inputInlineQueryResultPhoto", deserialize = "inputInlineQueryResultPhoto"))]
12539        Photo(crate::types::InputInlineQueryResultPhoto),
12540        /// Represents a link to a WEBP, TGS, or WEBM sticker
12541        #[serde(rename(serialize = "inputInlineQueryResultSticker", deserialize = "inputInlineQueryResultSticker"))]
12542        Sticker(crate::types::InputInlineQueryResultSticker),
12543        /// Represents information about a venue
12544        #[serde(rename(serialize = "inputInlineQueryResultVenue", deserialize = "inputInlineQueryResultVenue"))]
12545        Venue(crate::types::InputInlineQueryResultVenue),
12546        /// Represents a link to a page containing an embedded video player or a video file
12547        #[serde(rename(serialize = "inputInlineQueryResultVideo", deserialize = "inputInlineQueryResultVideo"))]
12548        Video(crate::types::InputInlineQueryResultVideo),
12549        /// Represents a link to an opus-encoded audio file within an OGG container, single channel audio
12550        #[serde(rename(serialize = "inputInlineQueryResultVoiceNote", deserialize = "inputInlineQueryResultVoiceNote"))]
12551        VoiceNote(crate::types::InputInlineQueryResultVoiceNote),
12552    }
12553    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
12554    #[serde(tag = "@type")]
12555    pub enum InlineQueryResult {
12556        /// Represents a link to an article or web page
12557        #[serde(rename(serialize = "inlineQueryResultArticle", deserialize = "inlineQueryResultArticle"))]
12558        Article(crate::types::InlineQueryResultArticle),
12559        /// Represents a user contact
12560        #[serde(rename(serialize = "inlineQueryResultContact", deserialize = "inlineQueryResultContact"))]
12561        Contact(crate::types::InlineQueryResultContact),
12562        /// Represents a point on the map
12563        #[serde(rename(serialize = "inlineQueryResultLocation", deserialize = "inlineQueryResultLocation"))]
12564        Location(crate::types::InlineQueryResultLocation),
12565        /// Represents information about a venue
12566        #[serde(rename(serialize = "inlineQueryResultVenue", deserialize = "inlineQueryResultVenue"))]
12567        Venue(crate::types::InlineQueryResultVenue),
12568        /// Represents information about a game
12569        #[serde(rename(serialize = "inlineQueryResultGame", deserialize = "inlineQueryResultGame"))]
12570        Game(crate::types::InlineQueryResultGame),
12571        /// Represents an animation file
12572        #[serde(rename(serialize = "inlineQueryResultAnimation", deserialize = "inlineQueryResultAnimation"))]
12573        Animation(crate::types::InlineQueryResultAnimation),
12574        /// Represents an audio file
12575        #[serde(rename(serialize = "inlineQueryResultAudio", deserialize = "inlineQueryResultAudio"))]
12576        Audio(crate::types::InlineQueryResultAudio),
12577        /// Represents a document
12578        #[serde(rename(serialize = "inlineQueryResultDocument", deserialize = "inlineQueryResultDocument"))]
12579        Document(crate::types::InlineQueryResultDocument),
12580        /// Represents a photo
12581        #[serde(rename(serialize = "inlineQueryResultPhoto", deserialize = "inlineQueryResultPhoto"))]
12582        Photo(crate::types::InlineQueryResultPhoto),
12583        /// Represents a sticker
12584        #[serde(rename(serialize = "inlineQueryResultSticker", deserialize = "inlineQueryResultSticker"))]
12585        Sticker(crate::types::InlineQueryResultSticker),
12586        /// Represents a video
12587        #[serde(rename(serialize = "inlineQueryResultVideo", deserialize = "inlineQueryResultVideo"))]
12588        Video(crate::types::InlineQueryResultVideo),
12589        /// Represents a voice note
12590        #[serde(rename(serialize = "inlineQueryResultVoiceNote", deserialize = "inlineQueryResultVoiceNote"))]
12591        VoiceNote(crate::types::InlineQueryResultVoiceNote),
12592    }
12593    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
12594    #[serde(tag = "@type")]
12595    pub enum InlineQueryResultsButtonType {
12596        /// Describes the button that opens a private chat with the bot and sends a start message to the bot with the given parameter
12597        #[serde(rename(serialize = "inlineQueryResultsButtonTypeStartBot", deserialize = "inlineQueryResultsButtonTypeStartBot"))]
12598        StartBot(crate::types::InlineQueryResultsButtonTypeStartBot),
12599        /// Describes the button that opens a Web App by calling getWebAppUrl
12600        #[serde(rename(serialize = "inlineQueryResultsButtonTypeWebApp", deserialize = "inlineQueryResultsButtonTypeWebApp"))]
12601        WebApp(crate::types::InlineQueryResultsButtonTypeWebApp),
12602    }
12603    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
12604    #[serde(tag = "@type")]
12605    pub enum InlineQueryResultsButton {
12606        /// Represents a button to be shown above inline query results
12607        #[serde(rename(serialize = "inlineQueryResultsButton", deserialize = "inlineQueryResultsButton"))]
12608        InlineQueryResultsButton(crate::types::InlineQueryResultsButton),
12609    }
12610    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
12611    #[serde(tag = "@type")]
12612    pub enum InlineQueryResults {
12613        /// Represents the results of the inline query. Use sendInlineQueryResultMessage to send the result of the query
12614        #[serde(rename(serialize = "inlineQueryResults", deserialize = "inlineQueryResults"))]
12615        InlineQueryResults(crate::types::InlineQueryResults),
12616    }
12617    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
12618    #[serde(tag = "@type")]
12619    pub enum CallbackQueryPayload {
12620        /// The payload for a general callback button
12621        #[serde(rename(serialize = "callbackQueryPayloadData", deserialize = "callbackQueryPayloadData"))]
12622        Data(crate::types::CallbackQueryPayloadData),
12623        /// The payload for a callback button requiring password
12624        #[serde(rename(serialize = "callbackQueryPayloadDataWithPassword", deserialize = "callbackQueryPayloadDataWithPassword"))]
12625        DataWithPassword(crate::types::CallbackQueryPayloadDataWithPassword),
12626        /// The payload for a game callback button
12627        #[serde(rename(serialize = "callbackQueryPayloadGame", deserialize = "callbackQueryPayloadGame"))]
12628        Game(crate::types::CallbackQueryPayloadGame),
12629    }
12630    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
12631    #[serde(tag = "@type")]
12632    pub enum CallbackQueryAnswer {
12633        /// Contains a bot's answer to a callback query
12634        #[serde(rename(serialize = "callbackQueryAnswer", deserialize = "callbackQueryAnswer"))]
12635        CallbackQueryAnswer(crate::types::CallbackQueryAnswer),
12636    }
12637    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
12638    #[serde(tag = "@type")]
12639    pub enum CustomRequestResult {
12640        /// Contains the result of a custom request
12641        #[serde(rename(serialize = "customRequestResult", deserialize = "customRequestResult"))]
12642        CustomRequestResult(crate::types::CustomRequestResult),
12643    }
12644    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
12645    #[serde(tag = "@type")]
12646    pub enum GameHighScore {
12647        /// Contains one row of the game high score table
12648        #[serde(rename(serialize = "gameHighScore", deserialize = "gameHighScore"))]
12649        GameHighScore(crate::types::GameHighScore),
12650    }
12651    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
12652    #[serde(tag = "@type")]
12653    pub enum GameHighScores {
12654        /// Contains a list of game high scores
12655        #[serde(rename(serialize = "gameHighScores", deserialize = "gameHighScores"))]
12656        GameHighScores(crate::types::GameHighScores),
12657    }
12658    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
12659    #[serde(tag = "@type")]
12660    pub enum ChatEventAction {
12661        /// A message was edited
12662        #[serde(rename(serialize = "chatEventMessageEdited", deserialize = "chatEventMessageEdited"))]
12663        ChatEventMessageEdited(crate::types::ChatEventMessageEdited),
12664        /// A message was deleted
12665        #[serde(rename(serialize = "chatEventMessageDeleted", deserialize = "chatEventMessageDeleted"))]
12666        ChatEventMessageDeleted(crate::types::ChatEventMessageDeleted),
12667        /// A message was pinned
12668        #[serde(rename(serialize = "chatEventMessagePinned", deserialize = "chatEventMessagePinned"))]
12669        ChatEventMessagePinned(crate::types::ChatEventMessagePinned),
12670        /// A message was unpinned
12671        #[serde(rename(serialize = "chatEventMessageUnpinned", deserialize = "chatEventMessageUnpinned"))]
12672        ChatEventMessageUnpinned(crate::types::ChatEventMessageUnpinned),
12673        /// A poll in a message was stopped
12674        #[serde(rename(serialize = "chatEventPollStopped", deserialize = "chatEventPollStopped"))]
12675        ChatEventPollStopped(crate::types::ChatEventPollStopped),
12676        /// A new member joined the chat
12677        #[serde(rename(serialize = "chatEventMemberJoined", deserialize = "chatEventMemberJoined"))]
12678        ChatEventMemberJoined,
12679        /// A new member joined the chat via an invite link
12680        #[serde(rename(serialize = "chatEventMemberJoinedByInviteLink", deserialize = "chatEventMemberJoinedByInviteLink"))]
12681        ChatEventMemberJoinedByInviteLink(crate::types::ChatEventMemberJoinedByInviteLink),
12682        /// A new member was accepted to the chat by an administrator
12683        #[serde(rename(serialize = "chatEventMemberJoinedByRequest", deserialize = "chatEventMemberJoinedByRequest"))]
12684        ChatEventMemberJoinedByRequest(crate::types::ChatEventMemberJoinedByRequest),
12685        /// A new chat member was invited
12686        #[serde(rename(serialize = "chatEventMemberInvited", deserialize = "chatEventMemberInvited"))]
12687        ChatEventMemberInvited(crate::types::ChatEventMemberInvited),
12688        /// A member left the chat
12689        #[serde(rename(serialize = "chatEventMemberLeft", deserialize = "chatEventMemberLeft"))]
12690        ChatEventMemberLeft,
12691        /// A chat member has gained/lost administrator status, or the list of their administrator privileges has changed
12692        #[serde(rename(serialize = "chatEventMemberPromoted", deserialize = "chatEventMemberPromoted"))]
12693        ChatEventMemberPromoted(crate::types::ChatEventMemberPromoted),
12694        /// A chat member was restricted/unrestricted or banned/unbanned, or the list of their restrictions has changed
12695        #[serde(rename(serialize = "chatEventMemberRestricted", deserialize = "chatEventMemberRestricted"))]
12696        ChatEventMemberRestricted(crate::types::ChatEventMemberRestricted),
12697        /// The chat available reactions were changed
12698        #[serde(rename(serialize = "chatEventAvailableReactionsChanged", deserialize = "chatEventAvailableReactionsChanged"))]
12699        ChatEventAvailableReactionsChanged(crate::types::ChatEventAvailableReactionsChanged),
12700        /// The chat description was changed
12701        #[serde(rename(serialize = "chatEventDescriptionChanged", deserialize = "chatEventDescriptionChanged"))]
12702        ChatEventDescriptionChanged(crate::types::ChatEventDescriptionChanged),
12703        /// The linked chat of a supergroup was changed
12704        #[serde(rename(serialize = "chatEventLinkedChatChanged", deserialize = "chatEventLinkedChatChanged"))]
12705        ChatEventLinkedChatChanged(crate::types::ChatEventLinkedChatChanged),
12706        /// The supergroup location was changed
12707        #[serde(rename(serialize = "chatEventLocationChanged", deserialize = "chatEventLocationChanged"))]
12708        ChatEventLocationChanged(crate::types::ChatEventLocationChanged),
12709        /// The message auto-delete timer was changed
12710        #[serde(rename(serialize = "chatEventMessageAutoDeleteTimeChanged", deserialize = "chatEventMessageAutoDeleteTimeChanged"))]
12711        ChatEventMessageAutoDeleteTimeChanged(crate::types::ChatEventMessageAutoDeleteTimeChanged),
12712        /// The chat permissions was changed
12713        #[serde(rename(serialize = "chatEventPermissionsChanged", deserialize = "chatEventPermissionsChanged"))]
12714        ChatEventPermissionsChanged(crate::types::ChatEventPermissionsChanged),
12715        /// The chat photo was changed
12716        #[serde(rename(serialize = "chatEventPhotoChanged", deserialize = "chatEventPhotoChanged"))]
12717        ChatEventPhotoChanged(crate::types::ChatEventPhotoChanged),
12718        /// The slow_mode_delay setting of a supergroup was changed
12719        #[serde(rename(serialize = "chatEventSlowModeDelayChanged", deserialize = "chatEventSlowModeDelayChanged"))]
12720        ChatEventSlowModeDelayChanged(crate::types::ChatEventSlowModeDelayChanged),
12721        /// The supergroup sticker set was changed
12722        #[serde(rename(serialize = "chatEventStickerSetChanged", deserialize = "chatEventStickerSetChanged"))]
12723        ChatEventStickerSetChanged(crate::types::ChatEventStickerSetChanged),
12724        /// The chat title was changed
12725        #[serde(rename(serialize = "chatEventTitleChanged", deserialize = "chatEventTitleChanged"))]
12726        ChatEventTitleChanged(crate::types::ChatEventTitleChanged),
12727        /// The chat editable username was changed
12728        #[serde(rename(serialize = "chatEventUsernameChanged", deserialize = "chatEventUsernameChanged"))]
12729        ChatEventUsernameChanged(crate::types::ChatEventUsernameChanged),
12730        /// The chat active usernames were changed
12731        #[serde(rename(serialize = "chatEventActiveUsernamesChanged", deserialize = "chatEventActiveUsernamesChanged"))]
12732        ChatEventActiveUsernamesChanged(crate::types::ChatEventActiveUsernamesChanged),
12733        /// The has_protected_content setting of a channel was toggled
12734        #[serde(rename(serialize = "chatEventHasProtectedContentToggled", deserialize = "chatEventHasProtectedContentToggled"))]
12735        ChatEventHasProtectedContentToggled(crate::types::ChatEventHasProtectedContentToggled),
12736        /// The can_invite_users permission of a supergroup chat was toggled
12737        #[serde(rename(serialize = "chatEventInvitesToggled", deserialize = "chatEventInvitesToggled"))]
12738        ChatEventInvitesToggled(crate::types::ChatEventInvitesToggled),
12739        /// The is_all_history_available setting of a supergroup was toggled
12740        #[serde(rename(serialize = "chatEventIsAllHistoryAvailableToggled", deserialize = "chatEventIsAllHistoryAvailableToggled"))]
12741        ChatEventIsAllHistoryAvailableToggled(crate::types::ChatEventIsAllHistoryAvailableToggled),
12742        /// The has_aggressive_anti_spam_enabled setting of a supergroup was toggled
12743        #[serde(rename(serialize = "chatEventHasAggressiveAntiSpamEnabledToggled", deserialize = "chatEventHasAggressiveAntiSpamEnabledToggled"))]
12744        ChatEventHasAggressiveAntiSpamEnabledToggled(crate::types::ChatEventHasAggressiveAntiSpamEnabledToggled),
12745        /// The sign_messages setting of a channel was toggled
12746        #[serde(rename(serialize = "chatEventSignMessagesToggled", deserialize = "chatEventSignMessagesToggled"))]
12747        ChatEventSignMessagesToggled(crate::types::ChatEventSignMessagesToggled),
12748        /// A chat invite link was edited
12749        #[serde(rename(serialize = "chatEventInviteLinkEdited", deserialize = "chatEventInviteLinkEdited"))]
12750        ChatEventInviteLinkEdited(crate::types::ChatEventInviteLinkEdited),
12751        /// A chat invite link was revoked
12752        #[serde(rename(serialize = "chatEventInviteLinkRevoked", deserialize = "chatEventInviteLinkRevoked"))]
12753        ChatEventInviteLinkRevoked(crate::types::ChatEventInviteLinkRevoked),
12754        /// A revoked chat invite link was deleted
12755        #[serde(rename(serialize = "chatEventInviteLinkDeleted", deserialize = "chatEventInviteLinkDeleted"))]
12756        ChatEventInviteLinkDeleted(crate::types::ChatEventInviteLinkDeleted),
12757        /// A video chat was created
12758        #[serde(rename(serialize = "chatEventVideoChatCreated", deserialize = "chatEventVideoChatCreated"))]
12759        ChatEventVideoChatCreated(crate::types::ChatEventVideoChatCreated),
12760        /// A video chat was ended
12761        #[serde(rename(serialize = "chatEventVideoChatEnded", deserialize = "chatEventVideoChatEnded"))]
12762        ChatEventVideoChatEnded(crate::types::ChatEventVideoChatEnded),
12763        /// The mute_new_participants setting of a video chat was toggled
12764        #[serde(rename(serialize = "chatEventVideoChatMuteNewParticipantsToggled", deserialize = "chatEventVideoChatMuteNewParticipantsToggled"))]
12765        ChatEventVideoChatMuteNewParticipantsToggled(crate::types::ChatEventVideoChatMuteNewParticipantsToggled),
12766        /// A video chat participant was muted or unmuted
12767        #[serde(rename(serialize = "chatEventVideoChatParticipantIsMutedToggled", deserialize = "chatEventVideoChatParticipantIsMutedToggled"))]
12768        ChatEventVideoChatParticipantIsMutedToggled(crate::types::ChatEventVideoChatParticipantIsMutedToggled),
12769        /// A video chat participant volume level was changed
12770        #[serde(rename(serialize = "chatEventVideoChatParticipantVolumeLevelChanged", deserialize = "chatEventVideoChatParticipantVolumeLevelChanged"))]
12771        ChatEventVideoChatParticipantVolumeLevelChanged(crate::types::ChatEventVideoChatParticipantVolumeLevelChanged),
12772        /// The is_forum setting of a channel was toggled
12773        #[serde(rename(serialize = "chatEventIsForumToggled", deserialize = "chatEventIsForumToggled"))]
12774        ChatEventIsForumToggled(crate::types::ChatEventIsForumToggled),
12775        /// A new forum topic was created
12776        #[serde(rename(serialize = "chatEventForumTopicCreated", deserialize = "chatEventForumTopicCreated"))]
12777        ChatEventForumTopicCreated(crate::types::ChatEventForumTopicCreated),
12778        /// A forum topic was edited
12779        #[serde(rename(serialize = "chatEventForumTopicEdited", deserialize = "chatEventForumTopicEdited"))]
12780        ChatEventForumTopicEdited(crate::types::ChatEventForumTopicEdited),
12781        /// A forum topic was closed or reopened
12782        #[serde(rename(serialize = "chatEventForumTopicToggleIsClosed", deserialize = "chatEventForumTopicToggleIsClosed"))]
12783        ChatEventForumTopicToggleIsClosed(crate::types::ChatEventForumTopicToggleIsClosed),
12784        /// The General forum topic was hidden or unhidden
12785        #[serde(rename(serialize = "chatEventForumTopicToggleIsHidden", deserialize = "chatEventForumTopicToggleIsHidden"))]
12786        ChatEventForumTopicToggleIsHidden(crate::types::ChatEventForumTopicToggleIsHidden),
12787        /// A forum topic was deleted
12788        #[serde(rename(serialize = "chatEventForumTopicDeleted", deserialize = "chatEventForumTopicDeleted"))]
12789        ChatEventForumTopicDeleted(crate::types::ChatEventForumTopicDeleted),
12790        /// A pinned forum topic was changed
12791        #[serde(rename(serialize = "chatEventForumTopicPinned", deserialize = "chatEventForumTopicPinned"))]
12792        ChatEventForumTopicPinned(crate::types::ChatEventForumTopicPinned),
12793    }
12794    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
12795    #[serde(tag = "@type")]
12796    pub enum ChatEvent {
12797        /// Represents a chat event
12798        #[serde(rename(serialize = "chatEvent", deserialize = "chatEvent"))]
12799        ChatEvent(crate::types::ChatEvent),
12800    }
12801    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
12802    #[serde(tag = "@type")]
12803    pub enum ChatEvents {
12804        /// Contains a list of chat events
12805        #[serde(rename(serialize = "chatEvents", deserialize = "chatEvents"))]
12806        ChatEvents(crate::types::ChatEvents),
12807    }
12808    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
12809    #[serde(tag = "@type")]
12810    pub enum ChatEventLogFilters {
12811        /// Represents a set of filters used to obtain a chat event log
12812        #[serde(rename(serialize = "chatEventLogFilters", deserialize = "chatEventLogFilters"))]
12813        ChatEventLogFilters(crate::types::ChatEventLogFilters),
12814    }
12815    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
12816    #[serde(tag = "@type")]
12817    pub enum LanguagePackStringValue {
12818        /// An ordinary language pack string
12819        #[serde(rename(serialize = "languagePackStringValueOrdinary", deserialize = "languagePackStringValueOrdinary"))]
12820        Ordinary(crate::types::LanguagePackStringValueOrdinary),
12821        /// A language pack string which has different forms based on the number of some object it mentions. See https:www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html for more information
12822        #[serde(rename(serialize = "languagePackStringValuePluralized", deserialize = "languagePackStringValuePluralized"))]
12823        Pluralized(crate::types::LanguagePackStringValuePluralized),
12824        /// A deleted language pack string, the value must be taken from the built-in English language pack
12825        #[serde(rename(serialize = "languagePackStringValueDeleted", deserialize = "languagePackStringValueDeleted"))]
12826        Deleted,
12827    }
12828    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
12829    #[serde(tag = "@type")]
12830    pub enum LanguagePackString {
12831        /// Represents one language pack string
12832        #[serde(rename(serialize = "languagePackString", deserialize = "languagePackString"))]
12833        LanguagePackString(crate::types::LanguagePackString),
12834    }
12835    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
12836    #[serde(tag = "@type")]
12837    pub enum LanguagePackStrings {
12838        /// Contains a list of language pack strings
12839        #[serde(rename(serialize = "languagePackStrings", deserialize = "languagePackStrings"))]
12840        LanguagePackStrings(crate::types::LanguagePackStrings),
12841    }
12842    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
12843    #[serde(tag = "@type")]
12844    pub enum LanguagePackInfo {
12845        /// Contains information about a language pack
12846        #[serde(rename(serialize = "languagePackInfo", deserialize = "languagePackInfo"))]
12847        LanguagePackInfo(crate::types::LanguagePackInfo),
12848    }
12849    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
12850    #[serde(tag = "@type")]
12851    pub enum LocalizationTargetInfo {
12852        /// Contains information about the current localization target
12853        #[serde(rename(serialize = "localizationTargetInfo", deserialize = "localizationTargetInfo"))]
12854        LocalizationTargetInfo(crate::types::LocalizationTargetInfo),
12855    }
12856    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
12857    #[serde(tag = "@type")]
12858    pub enum PremiumLimitType {
12859        /// The maximum number of joined supergroups and channels
12860        #[serde(rename(serialize = "premiumLimitTypeSupergroupCount", deserialize = "premiumLimitTypeSupergroupCount"))]
12861        SupergroupCount,
12862        /// The maximum number of pinned chats in the main chat list
12863        #[serde(rename(serialize = "premiumLimitTypePinnedChatCount", deserialize = "premiumLimitTypePinnedChatCount"))]
12864        PinnedChatCount,
12865        /// The maximum number of created public chats
12866        #[serde(rename(serialize = "premiumLimitTypeCreatedPublicChatCount", deserialize = "premiumLimitTypeCreatedPublicChatCount"))]
12867        CreatedPublicChatCount,
12868        /// The maximum number of saved animations
12869        #[serde(rename(serialize = "premiumLimitTypeSavedAnimationCount", deserialize = "premiumLimitTypeSavedAnimationCount"))]
12870        SavedAnimationCount,
12871        /// The maximum number of favorite stickers
12872        #[serde(rename(serialize = "premiumLimitTypeFavoriteStickerCount", deserialize = "premiumLimitTypeFavoriteStickerCount"))]
12873        FavoriteStickerCount,
12874        /// The maximum number of chat folders
12875        #[serde(rename(serialize = "premiumLimitTypeChatFolderCount", deserialize = "premiumLimitTypeChatFolderCount"))]
12876        ChatFolderCount,
12877        /// The maximum number of pinned and always included, or always excluded chats in a chat folder
12878        #[serde(rename(serialize = "premiumLimitTypeChatFolderChosenChatCount", deserialize = "premiumLimitTypeChatFolderChosenChatCount"))]
12879        ChatFolderChosenChatCount,
12880        /// The maximum number of pinned chats in the archive chat list
12881        #[serde(rename(serialize = "premiumLimitTypePinnedArchivedChatCount", deserialize = "premiumLimitTypePinnedArchivedChatCount"))]
12882        PinnedArchivedChatCount,
12883        /// The maximum length of sent media caption
12884        #[serde(rename(serialize = "premiumLimitTypeCaptionLength", deserialize = "premiumLimitTypeCaptionLength"))]
12885        CaptionLength,
12886        /// The maximum length of the user's bio
12887        #[serde(rename(serialize = "premiumLimitTypeBioLength", deserialize = "premiumLimitTypeBioLength"))]
12888        BioLength,
12889        /// The maximum number of invite links for a chat folder
12890        #[serde(rename(serialize = "premiumLimitTypeChatFolderInviteLinkCount", deserialize = "premiumLimitTypeChatFolderInviteLinkCount"))]
12891        ChatFolderInviteLinkCount,
12892        /// The maximum number of added shareable chat folders
12893        #[serde(rename(serialize = "premiumLimitTypeShareableChatFolderCount", deserialize = "premiumLimitTypeShareableChatFolderCount"))]
12894        ShareableChatFolderCount,
12895        /// The maximum number of active stories
12896        #[serde(rename(serialize = "premiumLimitTypeActiveStoryCount", deserialize = "premiumLimitTypeActiveStoryCount"))]
12897        ActiveStoryCount,
12898        /// The maximum number of stories sent per week
12899        #[serde(rename(serialize = "premiumLimitTypeWeeklySentStoryCount", deserialize = "premiumLimitTypeWeeklySentStoryCount"))]
12900        WeeklySentStoryCount,
12901        /// The maximum number of stories sent per month
12902        #[serde(rename(serialize = "premiumLimitTypeMonthlySentStoryCount", deserialize = "premiumLimitTypeMonthlySentStoryCount"))]
12903        MonthlySentStoryCount,
12904        /// The maximum length of captions of sent stories
12905        #[serde(rename(serialize = "premiumLimitTypeStoryCaptionLength", deserialize = "premiumLimitTypeStoryCaptionLength"))]
12906        StoryCaptionLength,
12907        /// The maximum number of suggested reaction areas on a story
12908        #[serde(rename(serialize = "premiumLimitTypeStorySuggestedReactionAreaCount", deserialize = "premiumLimitTypeStorySuggestedReactionAreaCount"))]
12909        StorySuggestedReactionAreaCount,
12910    }
12911    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
12912    #[serde(tag = "@type")]
12913    pub enum PremiumFeature {
12914        /// Increased limits
12915        #[serde(rename(serialize = "premiumFeatureIncreasedLimits", deserialize = "premiumFeatureIncreasedLimits"))]
12916        IncreasedLimits,
12917        /// Increased maximum upload file size
12918        #[serde(rename(serialize = "premiumFeatureIncreasedUploadFileSize", deserialize = "premiumFeatureIncreasedUploadFileSize"))]
12919        IncreasedUploadFileSize,
12920        /// Improved download speed
12921        #[serde(rename(serialize = "premiumFeatureImprovedDownloadSpeed", deserialize = "premiumFeatureImprovedDownloadSpeed"))]
12922        ImprovedDownloadSpeed,
12923        /// The ability to convert voice notes to text
12924        #[serde(rename(serialize = "premiumFeatureVoiceRecognition", deserialize = "premiumFeatureVoiceRecognition"))]
12925        VoiceRecognition,
12926        /// Disabled ads
12927        #[serde(rename(serialize = "premiumFeatureDisabledAds", deserialize = "premiumFeatureDisabledAds"))]
12928        DisabledAds,
12929        /// Allowed to use more reactions
12930        #[serde(rename(serialize = "premiumFeatureUniqueReactions", deserialize = "premiumFeatureUniqueReactions"))]
12931        UniqueReactions,
12932        /// Allowed to use premium stickers with unique effects
12933        #[serde(rename(serialize = "premiumFeatureUniqueStickers", deserialize = "premiumFeatureUniqueStickers"))]
12934        UniqueStickers,
12935        /// Allowed to use custom emoji stickers in message texts and captions
12936        #[serde(rename(serialize = "premiumFeatureCustomEmoji", deserialize = "premiumFeatureCustomEmoji"))]
12937        CustomEmoji,
12938        /// Ability to change position of the main chat list, archive and mute all new chats from non-contacts, and completely disable notifications about the user's contacts joined Telegram
12939        #[serde(rename(serialize = "premiumFeatureAdvancedChatManagement", deserialize = "premiumFeatureAdvancedChatManagement"))]
12940        AdvancedChatManagement,
12941        /// A badge in the user's profile
12942        #[serde(rename(serialize = "premiumFeatureProfileBadge", deserialize = "premiumFeatureProfileBadge"))]
12943        ProfileBadge,
12944        /// An emoji status shown along with the user's name
12945        #[serde(rename(serialize = "premiumFeatureEmojiStatus", deserialize = "premiumFeatureEmojiStatus"))]
12946        EmojiStatus,
12947        /// Profile photo animation on message and chat screens
12948        #[serde(rename(serialize = "premiumFeatureAnimatedProfilePhoto", deserialize = "premiumFeatureAnimatedProfilePhoto"))]
12949        AnimatedProfilePhoto,
12950        /// The ability to set a custom emoji as a forum topic icon
12951        #[serde(rename(serialize = "premiumFeatureForumTopicIcon", deserialize = "premiumFeatureForumTopicIcon"))]
12952        ForumTopicIcon,
12953        /// Allowed to set a premium application icons
12954        #[serde(rename(serialize = "premiumFeatureAppIcons", deserialize = "premiumFeatureAppIcons"))]
12955        AppIcons,
12956        /// Allowed to translate chat messages real-time
12957        #[serde(rename(serialize = "premiumFeatureRealTimeChatTranslation", deserialize = "premiumFeatureRealTimeChatTranslation"))]
12958        RealTimeChatTranslation,
12959        /// Allowed to use many additional features for stories
12960        #[serde(rename(serialize = "premiumFeatureUpgradedStories", deserialize = "premiumFeatureUpgradedStories"))]
12961        UpgradedStories,
12962        /// The ability to boost chats
12963        #[serde(rename(serialize = "premiumFeatureChatBoost", deserialize = "premiumFeatureChatBoost"))]
12964        ChatBoost,
12965    }
12966    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
12967    #[serde(tag = "@type")]
12968    pub enum PremiumStoryFeature {
12969        /// User stories are displayed before stories of non-premium contacts and channels
12970        #[serde(rename(serialize = "premiumStoryFeaturePriorityOrder", deserialize = "premiumStoryFeaturePriorityOrder"))]
12971        PriorityOrder,
12972        /// The ability to hide the fact that the user viewed other's stories
12973        #[serde(rename(serialize = "premiumStoryFeatureStealthMode", deserialize = "premiumStoryFeatureStealthMode"))]
12974        StealthMode,
12975        /// The ability to check who opened the current user's stories after they expire
12976        #[serde(rename(serialize = "premiumStoryFeaturePermanentViewsHistory", deserialize = "premiumStoryFeaturePermanentViewsHistory"))]
12977        PermanentViewsHistory,
12978        /// The ability to set custom expiration duration for stories
12979        #[serde(rename(serialize = "premiumStoryFeatureCustomExpirationDuration", deserialize = "premiumStoryFeatureCustomExpirationDuration"))]
12980        CustomExpirationDuration,
12981        /// The ability to save other's unprotected stories
12982        #[serde(rename(serialize = "premiumStoryFeatureSaveStories", deserialize = "premiumStoryFeatureSaveStories"))]
12983        SaveStories,
12984        /// The ability to use links and formatting in story caption
12985        #[serde(rename(serialize = "premiumStoryFeatureLinksAndFormatting", deserialize = "premiumStoryFeatureLinksAndFormatting"))]
12986        LinksAndFormatting,
12987    }
12988    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
12989    #[serde(tag = "@type")]
12990    pub enum PremiumLimit {
12991        /// Contains information about a limit, increased for Premium users
12992        #[serde(rename(serialize = "premiumLimit", deserialize = "premiumLimit"))]
12993        PremiumLimit(crate::types::PremiumLimit),
12994    }
12995    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
12996    #[serde(tag = "@type")]
12997    pub enum PremiumFeatures {
12998        /// Contains information about features, available to Premium users
12999        #[serde(rename(serialize = "premiumFeatures", deserialize = "premiumFeatures"))]
13000        PremiumFeatures(crate::types::PremiumFeatures),
13001    }
13002    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
13003    #[serde(tag = "@type")]
13004    pub enum PremiumSource {
13005        /// A limit was exceeded
13006        #[serde(rename(serialize = "premiumSourceLimitExceeded", deserialize = "premiumSourceLimitExceeded"))]
13007        LimitExceeded(crate::types::PremiumSourceLimitExceeded),
13008        /// A user tried to use a Premium feature
13009        #[serde(rename(serialize = "premiumSourceFeature", deserialize = "premiumSourceFeature"))]
13010        Feature(crate::types::PremiumSourceFeature),
13011        /// A user tried to use a Premium story feature
13012        #[serde(rename(serialize = "premiumSourceStoryFeature", deserialize = "premiumSourceStoryFeature"))]
13013        StoryFeature(crate::types::PremiumSourceStoryFeature),
13014        /// A user opened an internal link of the type internalLinkTypePremiumFeatures
13015        #[serde(rename(serialize = "premiumSourceLink", deserialize = "premiumSourceLink"))]
13016        Link(crate::types::PremiumSourceLink),
13017        /// A user opened the Premium features screen from settings
13018        #[serde(rename(serialize = "premiumSourceSettings", deserialize = "premiumSourceSettings"))]
13019        Settings,
13020    }
13021    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
13022    #[serde(tag = "@type")]
13023    pub enum PremiumFeaturePromotionAnimation {
13024        /// Describes a promotion animation for a Premium feature
13025        #[serde(rename(serialize = "premiumFeaturePromotionAnimation", deserialize = "premiumFeaturePromotionAnimation"))]
13026        PremiumFeaturePromotionAnimation(crate::types::PremiumFeaturePromotionAnimation),
13027    }
13028    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
13029    #[serde(tag = "@type")]
13030    pub enum PremiumState {
13031        /// Contains state of Telegram Premium subscription and promotion videos for Premium features
13032        #[serde(rename(serialize = "premiumState", deserialize = "premiumState"))]
13033        PremiumState(crate::types::PremiumState),
13034    }
13035    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
13036    #[serde(tag = "@type")]
13037    pub enum StorePaymentPurpose {
13038        /// The user subscribed to Telegram Premium
13039        #[serde(rename(serialize = "storePaymentPurposePremiumSubscription", deserialize = "storePaymentPurposePremiumSubscription"))]
13040        PremiumSubscription(crate::types::StorePaymentPurposePremiumSubscription),
13041        /// The user gifted Telegram Premium to another user
13042        #[serde(rename(serialize = "storePaymentPurposeGiftedPremium", deserialize = "storePaymentPurposeGiftedPremium"))]
13043        GiftedPremium(crate::types::StorePaymentPurposeGiftedPremium),
13044    }
13045    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
13046    #[serde(tag = "@type")]
13047    pub enum DeviceToken {
13048        /// A token for Firebase Cloud Messaging
13049        #[serde(rename(serialize = "deviceTokenFirebaseCloudMessaging", deserialize = "deviceTokenFirebaseCloudMessaging"))]
13050        FirebaseCloudMessaging(crate::types::DeviceTokenFirebaseCloudMessaging),
13051        /// A token for Apple Push Notification service
13052        #[serde(rename(serialize = "deviceTokenApplePush", deserialize = "deviceTokenApplePush"))]
13053        ApplePush(crate::types::DeviceTokenApplePush),
13054        /// A token for Apple Push Notification service VoIP notifications
13055        #[serde(rename(serialize = "deviceTokenApplePushVoIP", deserialize = "deviceTokenApplePushVoIP"))]
13056        ApplePushVoIp(crate::types::DeviceTokenApplePushVoIp),
13057        /// A token for Windows Push Notification Services
13058        #[serde(rename(serialize = "deviceTokenWindowsPush", deserialize = "deviceTokenWindowsPush"))]
13059        WindowsPush(crate::types::DeviceTokenWindowsPush),
13060        /// A token for Microsoft Push Notification Service
13061        #[serde(rename(serialize = "deviceTokenMicrosoftPush", deserialize = "deviceTokenMicrosoftPush"))]
13062        MicrosoftPush(crate::types::DeviceTokenMicrosoftPush),
13063        /// A token for Microsoft Push Notification Service VoIP channel
13064        #[serde(rename(serialize = "deviceTokenMicrosoftPushVoIP", deserialize = "deviceTokenMicrosoftPushVoIP"))]
13065        MicrosoftPushVoIp(crate::types::DeviceTokenMicrosoftPushVoIp),
13066        /// A token for web Push API
13067        #[serde(rename(serialize = "deviceTokenWebPush", deserialize = "deviceTokenWebPush"))]
13068        WebPush(crate::types::DeviceTokenWebPush),
13069        /// A token for Simple Push API for Firefox OS
13070        #[serde(rename(serialize = "deviceTokenSimplePush", deserialize = "deviceTokenSimplePush"))]
13071        SimplePush(crate::types::DeviceTokenSimplePush),
13072        /// A token for Ubuntu Push Client service
13073        #[serde(rename(serialize = "deviceTokenUbuntuPush", deserialize = "deviceTokenUbuntuPush"))]
13074        UbuntuPush(crate::types::DeviceTokenUbuntuPush),
13075        /// A token for BlackBerry Push Service
13076        #[serde(rename(serialize = "deviceTokenBlackBerryPush", deserialize = "deviceTokenBlackBerryPush"))]
13077        BlackBerryPush(crate::types::DeviceTokenBlackBerryPush),
13078        /// A token for Tizen Push Service
13079        #[serde(rename(serialize = "deviceTokenTizenPush", deserialize = "deviceTokenTizenPush"))]
13080        TizenPush(crate::types::DeviceTokenTizenPush),
13081        /// A token for HUAWEI Push Service
13082        #[serde(rename(serialize = "deviceTokenHuaweiPush", deserialize = "deviceTokenHuaweiPush"))]
13083        HuaweiPush(crate::types::DeviceTokenHuaweiPush),
13084    }
13085    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
13086    #[serde(tag = "@type")]
13087    pub enum PushReceiverId {
13088        /// Contains a globally unique push receiver identifier, which can be used to identify which account has received a push notification
13089        #[serde(rename(serialize = "pushReceiverId", deserialize = "pushReceiverId"))]
13090        PushReceiverId(crate::types::PushReceiverId),
13091    }
13092    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
13093    #[serde(tag = "@type")]
13094    pub enum BackgroundFill {
13095        /// Describes a solid fill of a background
13096        #[serde(rename(serialize = "backgroundFillSolid", deserialize = "backgroundFillSolid"))]
13097        Solid(crate::types::BackgroundFillSolid),
13098        /// Describes a gradient fill of a background
13099        #[serde(rename(serialize = "backgroundFillGradient", deserialize = "backgroundFillGradient"))]
13100        Gradient(crate::types::BackgroundFillGradient),
13101        /// Describes a freeform gradient fill of a background
13102        #[serde(rename(serialize = "backgroundFillFreeformGradient", deserialize = "backgroundFillFreeformGradient"))]
13103        FreeformGradient(crate::types::BackgroundFillFreeformGradient),
13104    }
13105    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
13106    #[serde(tag = "@type")]
13107    pub enum BackgroundType {
13108        /// A wallpaper in JPEG format
13109        #[serde(rename(serialize = "backgroundTypeWallpaper", deserialize = "backgroundTypeWallpaper"))]
13110        Wallpaper(crate::types::BackgroundTypeWallpaper),
13111        /// A PNG or TGV (gzipped subset of SVG with MIME type "application/x-tgwallpattern") pattern to be combined with the background fill chosen by the user
13112        #[serde(rename(serialize = "backgroundTypePattern", deserialize = "backgroundTypePattern"))]
13113        Pattern(crate::types::BackgroundTypePattern),
13114        /// A filled background
13115        #[serde(rename(serialize = "backgroundTypeFill", deserialize = "backgroundTypeFill"))]
13116        Fill(crate::types::BackgroundTypeFill),
13117    }
13118    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
13119    #[serde(tag = "@type")]
13120    pub enum InputBackground {
13121        /// A background from a local file
13122        #[serde(rename(serialize = "inputBackgroundLocal", deserialize = "inputBackgroundLocal"))]
13123        Local(crate::types::InputBackgroundLocal),
13124        /// A background from the server
13125        #[serde(rename(serialize = "inputBackgroundRemote", deserialize = "inputBackgroundRemote"))]
13126        Remote(crate::types::InputBackgroundRemote),
13127        /// A background previously set in the chat; for chat backgrounds only
13128        #[serde(rename(serialize = "inputBackgroundPrevious", deserialize = "inputBackgroundPrevious"))]
13129        Previous(crate::types::InputBackgroundPrevious),
13130    }
13131    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
13132    #[serde(tag = "@type")]
13133    pub enum ThemeSettings {
13134        /// Describes theme settings
13135        #[serde(rename(serialize = "themeSettings", deserialize = "themeSettings"))]
13136        ThemeSettings(crate::types::ThemeSettings),
13137    }
13138    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
13139    #[serde(tag = "@type")]
13140    pub enum ChatTheme {
13141        /// Describes a chat theme
13142        #[serde(rename(serialize = "chatTheme", deserialize = "chatTheme"))]
13143        ChatTheme(crate::types::ChatTheme),
13144    }
13145    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
13146    #[serde(tag = "@type")]
13147    pub enum Hashtags {
13148        /// Contains a list of hashtags
13149        #[serde(rename(serialize = "hashtags", deserialize = "hashtags"))]
13150        Hashtags(crate::types::Hashtags),
13151    }
13152    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
13153    #[serde(tag = "@type")]
13154    pub enum CanSendStoryResult {
13155        /// A story can be sent
13156        #[serde(rename(serialize = "canSendStoryResultOk", deserialize = "canSendStoryResultOk"))]
13157        Ok,
13158        /// The user must subscribe to Telegram Premium to be able to post stories
13159        #[serde(rename(serialize = "canSendStoryResultPremiumNeeded", deserialize = "canSendStoryResultPremiumNeeded"))]
13160        PremiumNeeded,
13161        /// The channel chat must be boosted first by Telegram Premium subscribers to post more stories. Call getChatBoostStatus to get current boost status of the chat
13162        #[serde(rename(serialize = "canSendStoryResultBoostNeeded", deserialize = "canSendStoryResultBoostNeeded"))]
13163        BoostNeeded,
13164        /// The limit for the number of active stories exceeded. The user can buy Telegram Premium, delete an active story, or wait for the oldest story to expire
13165        #[serde(rename(serialize = "canSendStoryResultActiveStoryLimitExceeded", deserialize = "canSendStoryResultActiveStoryLimitExceeded"))]
13166        ActiveStoryLimitExceeded,
13167        /// The weekly limit for the number of posted stories exceeded. The user needs to buy Telegram Premium or wait specified time
13168        #[serde(rename(serialize = "canSendStoryResultWeeklyLimitExceeded", deserialize = "canSendStoryResultWeeklyLimitExceeded"))]
13169        WeeklyLimitExceeded(crate::types::CanSendStoryResultWeeklyLimitExceeded),
13170        /// The monthly limit for the number of posted stories exceeded. The user needs to buy Telegram Premium or wait specified time
13171        #[serde(rename(serialize = "canSendStoryResultMonthlyLimitExceeded", deserialize = "canSendStoryResultMonthlyLimitExceeded"))]
13172        MonthlyLimitExceeded(crate::types::CanSendStoryResultMonthlyLimitExceeded),
13173    }
13174    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
13175    #[serde(tag = "@type")]
13176    pub enum CanBoostChatResult {
13177        /// The chat can be boosted
13178        #[serde(rename(serialize = "canBoostChatResultOk", deserialize = "canBoostChatResultOk"))]
13179        Ok(crate::types::CanBoostChatResultOk),
13180        /// The chat can't be boosted
13181        #[serde(rename(serialize = "canBoostChatResultInvalidChat", deserialize = "canBoostChatResultInvalidChat"))]
13182        InvalidChat,
13183        /// The chat is already boosted by the user
13184        #[serde(rename(serialize = "canBoostChatResultAlreadyBoosted", deserialize = "canBoostChatResultAlreadyBoosted"))]
13185        AlreadyBoosted,
13186        /// The user must subscribe to Telegram Premium to be able to boost chats
13187        #[serde(rename(serialize = "canBoostChatResultPremiumNeeded", deserialize = "canBoostChatResultPremiumNeeded"))]
13188        PremiumNeeded,
13189        /// The user must have Telegram Premium subscription instead of a gifted Telegram Premium
13190        #[serde(rename(serialize = "canBoostChatResultPremiumSubscriptionNeeded", deserialize = "canBoostChatResultPremiumSubscriptionNeeded"))]
13191        PremiumSubscriptionNeeded,
13192        /// The user must wait the specified time before the boost can be moved to another chat
13193        #[serde(rename(serialize = "canBoostChatResultWaitNeeded", deserialize = "canBoostChatResultWaitNeeded"))]
13194        WaitNeeded(crate::types::CanBoostChatResultWaitNeeded),
13195    }
13196    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
13197    #[serde(tag = "@type")]
13198    pub enum CanTransferOwnershipResult {
13199        /// The session can be used
13200        #[serde(rename(serialize = "canTransferOwnershipResultOk", deserialize = "canTransferOwnershipResultOk"))]
13201        Ok,
13202        /// The 2-step verification needs to be enabled first
13203        #[serde(rename(serialize = "canTransferOwnershipResultPasswordNeeded", deserialize = "canTransferOwnershipResultPasswordNeeded"))]
13204        PasswordNeeded,
13205        /// The 2-step verification was enabled recently, user needs to wait
13206        #[serde(rename(serialize = "canTransferOwnershipResultPasswordTooFresh", deserialize = "canTransferOwnershipResultPasswordTooFresh"))]
13207        PasswordTooFresh(crate::types::CanTransferOwnershipResultPasswordTooFresh),
13208        /// The session was created recently, user needs to wait
13209        #[serde(rename(serialize = "canTransferOwnershipResultSessionTooFresh", deserialize = "canTransferOwnershipResultSessionTooFresh"))]
13210        SessionTooFresh(crate::types::CanTransferOwnershipResultSessionTooFresh),
13211    }
13212    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
13213    #[serde(tag = "@type")]
13214    pub enum CheckChatUsernameResult {
13215        /// The username can be set
13216        #[serde(rename(serialize = "checkChatUsernameResultOk", deserialize = "checkChatUsernameResultOk"))]
13217        Ok,
13218        /// The username is invalid
13219        #[serde(rename(serialize = "checkChatUsernameResultUsernameInvalid", deserialize = "checkChatUsernameResultUsernameInvalid"))]
13220        UsernameInvalid,
13221        /// The username is occupied
13222        #[serde(rename(serialize = "checkChatUsernameResultUsernameOccupied", deserialize = "checkChatUsernameResultUsernameOccupied"))]
13223        UsernameOccupied,
13224        /// The username can be purchased at fragment.com
13225        #[serde(rename(serialize = "checkChatUsernameResultUsernamePurchasable", deserialize = "checkChatUsernameResultUsernamePurchasable"))]
13226        UsernamePurchasable,
13227        /// The user has too many chats with username, one of them must be made private first
13228        #[serde(rename(serialize = "checkChatUsernameResultPublicChatsTooMany", deserialize = "checkChatUsernameResultPublicChatsTooMany"))]
13229        PublicChatsTooMany,
13230        /// The user can't be a member of a public supergroup
13231        #[serde(rename(serialize = "checkChatUsernameResultPublicGroupsUnavailable", deserialize = "checkChatUsernameResultPublicGroupsUnavailable"))]
13232        PublicGroupsUnavailable,
13233    }
13234    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
13235    #[serde(tag = "@type")]
13236    pub enum CheckStickerSetNameResult {
13237        /// The name can be set
13238        #[serde(rename(serialize = "checkStickerSetNameResultOk", deserialize = "checkStickerSetNameResultOk"))]
13239        Ok,
13240        /// The name is invalid
13241        #[serde(rename(serialize = "checkStickerSetNameResultNameInvalid", deserialize = "checkStickerSetNameResultNameInvalid"))]
13242        NameInvalid,
13243        /// The name is occupied
13244        #[serde(rename(serialize = "checkStickerSetNameResultNameOccupied", deserialize = "checkStickerSetNameResultNameOccupied"))]
13245        NameOccupied,
13246    }
13247    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
13248    #[serde(tag = "@type")]
13249    pub enum ResetPasswordResult {
13250        /// The password was reset
13251        #[serde(rename(serialize = "resetPasswordResultOk", deserialize = "resetPasswordResultOk"))]
13252        Ok,
13253        /// The password reset request is pending
13254        #[serde(rename(serialize = "resetPasswordResultPending", deserialize = "resetPasswordResultPending"))]
13255        Pending(crate::types::ResetPasswordResultPending),
13256        /// The password reset request was declined
13257        #[serde(rename(serialize = "resetPasswordResultDeclined", deserialize = "resetPasswordResultDeclined"))]
13258        Declined(crate::types::ResetPasswordResultDeclined),
13259    }
13260    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
13261    #[serde(tag = "@type")]
13262    pub enum MessageFileType {
13263        /// The messages was exported from a private chat
13264        #[serde(rename(serialize = "messageFileTypePrivate", deserialize = "messageFileTypePrivate"))]
13265        Private(crate::types::MessageFileTypePrivate),
13266        /// The messages was exported from a group chat
13267        #[serde(rename(serialize = "messageFileTypeGroup", deserialize = "messageFileTypeGroup"))]
13268        Group(crate::types::MessageFileTypeGroup),
13269        /// The messages was exported from a chat of unknown type
13270        #[serde(rename(serialize = "messageFileTypeUnknown", deserialize = "messageFileTypeUnknown"))]
13271        Unknown,
13272    }
13273    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
13274    #[serde(tag = "@type")]
13275    pub enum PushMessageContent {
13276        /// A general message with hidden content
13277        #[serde(rename(serialize = "pushMessageContentHidden", deserialize = "pushMessageContentHidden"))]
13278        Hidden(crate::types::PushMessageContentHidden),
13279        /// An animation message (GIF-style).
13280        #[serde(rename(serialize = "pushMessageContentAnimation", deserialize = "pushMessageContentAnimation"))]
13281        Animation(crate::types::PushMessageContentAnimation),
13282        /// An audio message
13283        #[serde(rename(serialize = "pushMessageContentAudio", deserialize = "pushMessageContentAudio"))]
13284        Audio(crate::types::PushMessageContentAudio),
13285        /// A message with a user contact
13286        #[serde(rename(serialize = "pushMessageContentContact", deserialize = "pushMessageContentContact"))]
13287        Contact(crate::types::PushMessageContentContact),
13288        /// A contact has registered with Telegram
13289        #[serde(rename(serialize = "pushMessageContentContactRegistered", deserialize = "pushMessageContentContactRegistered"))]
13290        ContactRegistered,
13291        /// A document message (a general file)
13292        #[serde(rename(serialize = "pushMessageContentDocument", deserialize = "pushMessageContentDocument"))]
13293        Document(crate::types::PushMessageContentDocument),
13294        /// A message with a game
13295        #[serde(rename(serialize = "pushMessageContentGame", deserialize = "pushMessageContentGame"))]
13296        Game(crate::types::PushMessageContentGame),
13297        /// A new high score was achieved in a game
13298        #[serde(rename(serialize = "pushMessageContentGameScore", deserialize = "pushMessageContentGameScore"))]
13299        GameScore(crate::types::PushMessageContentGameScore),
13300        /// A message with an invoice from a bot
13301        #[serde(rename(serialize = "pushMessageContentInvoice", deserialize = "pushMessageContentInvoice"))]
13302        Invoice(crate::types::PushMessageContentInvoice),
13303        /// A message with a location
13304        #[serde(rename(serialize = "pushMessageContentLocation", deserialize = "pushMessageContentLocation"))]
13305        Location(crate::types::PushMessageContentLocation),
13306        /// A photo message
13307        #[serde(rename(serialize = "pushMessageContentPhoto", deserialize = "pushMessageContentPhoto"))]
13308        Photo(crate::types::PushMessageContentPhoto),
13309        /// A message with a poll
13310        #[serde(rename(serialize = "pushMessageContentPoll", deserialize = "pushMessageContentPoll"))]
13311        Poll(crate::types::PushMessageContentPoll),
13312        /// A screenshot of a message in the chat has been taken
13313        #[serde(rename(serialize = "pushMessageContentScreenshotTaken", deserialize = "pushMessageContentScreenshotTaken"))]
13314        ScreenshotTaken,
13315        /// A message with a sticker
13316        #[serde(rename(serialize = "pushMessageContentSticker", deserialize = "pushMessageContentSticker"))]
13317        Sticker(crate::types::PushMessageContentSticker),
13318        /// A message with a story
13319        #[serde(rename(serialize = "pushMessageContentStory", deserialize = "pushMessageContentStory"))]
13320        Story(crate::types::PushMessageContentStory),
13321        /// A text message
13322        #[serde(rename(serialize = "pushMessageContentText", deserialize = "pushMessageContentText"))]
13323        Text(crate::types::PushMessageContentText),
13324        /// A video message
13325        #[serde(rename(serialize = "pushMessageContentVideo", deserialize = "pushMessageContentVideo"))]
13326        Video(crate::types::PushMessageContentVideo),
13327        /// A video note message
13328        #[serde(rename(serialize = "pushMessageContentVideoNote", deserialize = "pushMessageContentVideoNote"))]
13329        VideoNote(crate::types::PushMessageContentVideoNote),
13330        /// A voice note message
13331        #[serde(rename(serialize = "pushMessageContentVoiceNote", deserialize = "pushMessageContentVoiceNote"))]
13332        VoiceNote(crate::types::PushMessageContentVoiceNote),
13333        /// A newly created basic group
13334        #[serde(rename(serialize = "pushMessageContentBasicGroupChatCreate", deserialize = "pushMessageContentBasicGroupChatCreate"))]
13335        BasicGroupChatCreate,
13336        /// New chat members were invited to a group
13337        #[serde(rename(serialize = "pushMessageContentChatAddMembers", deserialize = "pushMessageContentChatAddMembers"))]
13338        ChatAddMembers(crate::types::PushMessageContentChatAddMembers),
13339        /// A chat photo was edited
13340        #[serde(rename(serialize = "pushMessageContentChatChangePhoto", deserialize = "pushMessageContentChatChangePhoto"))]
13341        ChatChangePhoto,
13342        /// A chat title was edited
13343        #[serde(rename(serialize = "pushMessageContentChatChangeTitle", deserialize = "pushMessageContentChatChangeTitle"))]
13344        ChatChangeTitle(crate::types::PushMessageContentChatChangeTitle),
13345        /// A chat background was edited
13346        #[serde(rename(serialize = "pushMessageContentChatSetBackground", deserialize = "pushMessageContentChatSetBackground"))]
13347        ChatSetBackground(crate::types::PushMessageContentChatSetBackground),
13348        /// A chat theme was edited
13349        #[serde(rename(serialize = "pushMessageContentChatSetTheme", deserialize = "pushMessageContentChatSetTheme"))]
13350        ChatSetTheme(crate::types::PushMessageContentChatSetTheme),
13351        /// A chat member was deleted
13352        #[serde(rename(serialize = "pushMessageContentChatDeleteMember", deserialize = "pushMessageContentChatDeleteMember"))]
13353        ChatDeleteMember(crate::types::PushMessageContentChatDeleteMember),
13354        /// A new member joined the chat via an invite link
13355        #[serde(rename(serialize = "pushMessageContentChatJoinByLink", deserialize = "pushMessageContentChatJoinByLink"))]
13356        ChatJoinByLink,
13357        /// A new member was accepted to the chat by an administrator
13358        #[serde(rename(serialize = "pushMessageContentChatJoinByRequest", deserialize = "pushMessageContentChatJoinByRequest"))]
13359        ChatJoinByRequest,
13360        /// A new recurring payment was made by the current user
13361        #[serde(rename(serialize = "pushMessageContentRecurringPayment", deserialize = "pushMessageContentRecurringPayment"))]
13362        RecurringPayment(crate::types::PushMessageContentRecurringPayment),
13363        /// A profile photo was suggested to the user
13364        #[serde(rename(serialize = "pushMessageContentSuggestProfilePhoto", deserialize = "pushMessageContentSuggestProfilePhoto"))]
13365        SuggestProfilePhoto,
13366        /// A forwarded messages
13367        #[serde(rename(serialize = "pushMessageContentMessageForwards", deserialize = "pushMessageContentMessageForwards"))]
13368        MessageForwards(crate::types::PushMessageContentMessageForwards),
13369        /// A media album
13370        #[serde(rename(serialize = "pushMessageContentMediaAlbum", deserialize = "pushMessageContentMediaAlbum"))]
13371        MediaAlbum(crate::types::PushMessageContentMediaAlbum),
13372    }
13373    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
13374    #[serde(tag = "@type")]
13375    pub enum NotificationType {
13376        /// New message was received
13377        #[serde(rename(serialize = "notificationTypeNewMessage", deserialize = "notificationTypeNewMessage"))]
13378        NewMessage(crate::types::NotificationTypeNewMessage),
13379        /// New secret chat was created
13380        #[serde(rename(serialize = "notificationTypeNewSecretChat", deserialize = "notificationTypeNewSecretChat"))]
13381        NewSecretChat,
13382        /// New call was received
13383        #[serde(rename(serialize = "notificationTypeNewCall", deserialize = "notificationTypeNewCall"))]
13384        NewCall(crate::types::NotificationTypeNewCall),
13385        /// New message was received through a push notification
13386        #[serde(rename(serialize = "notificationTypeNewPushMessage", deserialize = "notificationTypeNewPushMessage"))]
13387        NewPushMessage(crate::types::NotificationTypeNewPushMessage),
13388    }
13389    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
13390    #[serde(tag = "@type")]
13391    pub enum NotificationGroupType {
13392        /// A group containing notifications of type notificationTypeNewMessage and notificationTypeNewPushMessage with ordinary unread messages
13393        #[serde(rename(serialize = "notificationGroupTypeMessages", deserialize = "notificationGroupTypeMessages"))]
13394        Messages,
13395        /// A group containing notifications of type notificationTypeNewMessage and notificationTypeNewPushMessage with unread mentions of the current user, replies to their messages, or a pinned message
13396        #[serde(rename(serialize = "notificationGroupTypeMentions", deserialize = "notificationGroupTypeMentions"))]
13397        Mentions,
13398        /// A group containing a notification of type notificationTypeNewSecretChat
13399        #[serde(rename(serialize = "notificationGroupTypeSecretChat", deserialize = "notificationGroupTypeSecretChat"))]
13400        SecretChat,
13401        /// A group containing notifications of type notificationTypeNewCall
13402        #[serde(rename(serialize = "notificationGroupTypeCalls", deserialize = "notificationGroupTypeCalls"))]
13403        Calls,
13404    }
13405    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
13406    #[serde(tag = "@type")]
13407    pub enum NotificationSound {
13408        /// Describes a notification sound in MP3 format
13409        #[serde(rename(serialize = "notificationSound", deserialize = "notificationSound"))]
13410        NotificationSound(crate::types::NotificationSound),
13411    }
13412    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
13413    #[serde(tag = "@type")]
13414    pub enum NotificationSounds {
13415        /// Contains a list of notification sounds
13416        #[serde(rename(serialize = "notificationSounds", deserialize = "notificationSounds"))]
13417        NotificationSounds(crate::types::NotificationSounds),
13418    }
13419    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
13420    #[serde(tag = "@type")]
13421    pub enum Notification {
13422        /// Contains information about a notification
13423        #[serde(rename(serialize = "notification", deserialize = "notification"))]
13424        Notification(crate::types::Notification),
13425    }
13426    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
13427    #[serde(tag = "@type")]
13428    pub enum NotificationGroup {
13429        /// Describes a group of notifications
13430        #[serde(rename(serialize = "notificationGroup", deserialize = "notificationGroup"))]
13431        NotificationGroup(crate::types::NotificationGroup),
13432    }
13433    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
13434    #[serde(tag = "@type")]
13435    pub enum OptionValue {
13436        /// Represents a boolean option
13437        #[serde(rename(serialize = "optionValueBoolean", deserialize = "optionValueBoolean"))]
13438        Boolean(crate::types::OptionValueBoolean),
13439        /// Represents an unknown option or an option which has a default value
13440        #[serde(rename(serialize = "optionValueEmpty", deserialize = "optionValueEmpty"))]
13441        Empty,
13442        /// Represents an integer option
13443        #[serde(rename(serialize = "optionValueInteger", deserialize = "optionValueInteger"))]
13444        Integer(crate::types::OptionValueInteger),
13445        /// Represents a string option
13446        #[serde(rename(serialize = "optionValueString", deserialize = "optionValueString"))]
13447        String(crate::types::OptionValueString),
13448    }
13449    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
13450    #[serde(tag = "@type")]
13451    pub enum JsonObjectMember {
13452        /// Represents one member of a JSON object
13453        #[serde(rename(serialize = "jsonObjectMember", deserialize = "jsonObjectMember"))]
13454        JsonObjectMember(crate::types::JsonObjectMember),
13455    }
13456    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
13457    #[serde(tag = "@type")]
13458    pub enum JsonValue {
13459        /// Represents a null JSON value
13460        #[serde(rename(serialize = "jsonValueNull", deserialize = "jsonValueNull"))]
13461        Null,
13462        /// Represents a boolean JSON value
13463        #[serde(rename(serialize = "jsonValueBoolean", deserialize = "jsonValueBoolean"))]
13464        Boolean(crate::types::JsonValueBoolean),
13465        /// Represents a numeric JSON value
13466        #[serde(rename(serialize = "jsonValueNumber", deserialize = "jsonValueNumber"))]
13467        Number(crate::types::JsonValueNumber),
13468        /// Represents a string JSON value
13469        #[serde(rename(serialize = "jsonValueString", deserialize = "jsonValueString"))]
13470        String(crate::types::JsonValueString),
13471        /// Represents a JSON array
13472        #[serde(rename(serialize = "jsonValueArray", deserialize = "jsonValueArray"))]
13473        Array(crate::types::JsonValueArray),
13474        /// Represents a JSON object
13475        #[serde(rename(serialize = "jsonValueObject", deserialize = "jsonValueObject"))]
13476        Object(crate::types::JsonValueObject),
13477    }
13478    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
13479    #[serde(tag = "@type")]
13480    pub enum StoryPrivacySettings {
13481        /// The story can be viewed by everyone
13482        #[serde(rename(serialize = "storyPrivacySettingsEveryone", deserialize = "storyPrivacySettingsEveryone"))]
13483        Everyone(crate::types::StoryPrivacySettingsEveryone),
13484        /// The story can be viewed by all contacts except chosen users
13485        #[serde(rename(serialize = "storyPrivacySettingsContacts", deserialize = "storyPrivacySettingsContacts"))]
13486        Contacts(crate::types::StoryPrivacySettingsContacts),
13487        /// The story can be viewed by all close friends
13488        #[serde(rename(serialize = "storyPrivacySettingsCloseFriends", deserialize = "storyPrivacySettingsCloseFriends"))]
13489        CloseFriends,
13490        /// The story can be viewed by certain specified users
13491        #[serde(rename(serialize = "storyPrivacySettingsSelectedUsers", deserialize = "storyPrivacySettingsSelectedUsers"))]
13492        SelectedUsers(crate::types::StoryPrivacySettingsSelectedUsers),
13493    }
13494    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
13495    #[serde(tag = "@type")]
13496    pub enum UserPrivacySettingRule {
13497        /// A rule to allow all users to do something
13498        #[serde(rename(serialize = "userPrivacySettingRuleAllowAll", deserialize = "userPrivacySettingRuleAllowAll"))]
13499        AllowAll,
13500        /// A rule to allow all contacts of the user to do something
13501        #[serde(rename(serialize = "userPrivacySettingRuleAllowContacts", deserialize = "userPrivacySettingRuleAllowContacts"))]
13502        AllowContacts,
13503        /// A rule to allow certain specified users to do something
13504        #[serde(rename(serialize = "userPrivacySettingRuleAllowUsers", deserialize = "userPrivacySettingRuleAllowUsers"))]
13505        AllowUsers(crate::types::UserPrivacySettingRuleAllowUsers),
13506        /// A rule to allow all members of certain specified basic groups and supergroups to doing something
13507        #[serde(rename(serialize = "userPrivacySettingRuleAllowChatMembers", deserialize = "userPrivacySettingRuleAllowChatMembers"))]
13508        AllowChatMembers(crate::types::UserPrivacySettingRuleAllowChatMembers),
13509        /// A rule to restrict all users from doing something
13510        #[serde(rename(serialize = "userPrivacySettingRuleRestrictAll", deserialize = "userPrivacySettingRuleRestrictAll"))]
13511        RestrictAll,
13512        /// A rule to restrict all contacts of the user from doing something
13513        #[serde(rename(serialize = "userPrivacySettingRuleRestrictContacts", deserialize = "userPrivacySettingRuleRestrictContacts"))]
13514        RestrictContacts,
13515        /// A rule to restrict all specified users from doing something
13516        #[serde(rename(serialize = "userPrivacySettingRuleRestrictUsers", deserialize = "userPrivacySettingRuleRestrictUsers"))]
13517        RestrictUsers(crate::types::UserPrivacySettingRuleRestrictUsers),
13518        /// A rule to restrict all members of specified basic groups and supergroups from doing something
13519        #[serde(rename(serialize = "userPrivacySettingRuleRestrictChatMembers", deserialize = "userPrivacySettingRuleRestrictChatMembers"))]
13520        RestrictChatMembers(crate::types::UserPrivacySettingRuleRestrictChatMembers),
13521    }
13522    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
13523    #[serde(tag = "@type")]
13524    pub enum UserPrivacySettingRules {
13525        /// A list of privacy rules. Rules are matched in the specified order. The first matched rule defines the privacy setting for a given user. If no rule matches, the action is not allowed
13526        #[serde(rename(serialize = "userPrivacySettingRules", deserialize = "userPrivacySettingRules"))]
13527        UserPrivacySettingRules(crate::types::UserPrivacySettingRules),
13528    }
13529    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
13530    #[serde(tag = "@type")]
13531    pub enum UserPrivacySetting {
13532        /// A privacy setting for managing whether the user's online status is visible
13533        #[serde(rename(serialize = "userPrivacySettingShowStatus", deserialize = "userPrivacySettingShowStatus"))]
13534        ShowStatus,
13535        /// A privacy setting for managing whether the user's profile photo is visible
13536        #[serde(rename(serialize = "userPrivacySettingShowProfilePhoto", deserialize = "userPrivacySettingShowProfilePhoto"))]
13537        ShowProfilePhoto,
13538        /// A privacy setting for managing whether a link to the user's account is included in forwarded messages
13539        #[serde(rename(serialize = "userPrivacySettingShowLinkInForwardedMessages", deserialize = "userPrivacySettingShowLinkInForwardedMessages"))]
13540        ShowLinkInForwardedMessages,
13541        /// A privacy setting for managing whether the user's phone number is visible
13542        #[serde(rename(serialize = "userPrivacySettingShowPhoneNumber", deserialize = "userPrivacySettingShowPhoneNumber"))]
13543        ShowPhoneNumber,
13544        /// A privacy setting for managing whether the user's bio is visible
13545        #[serde(rename(serialize = "userPrivacySettingShowBio", deserialize = "userPrivacySettingShowBio"))]
13546        ShowBio,
13547        /// A privacy setting for managing whether the user can be invited to chats
13548        #[serde(rename(serialize = "userPrivacySettingAllowChatInvites", deserialize = "userPrivacySettingAllowChatInvites"))]
13549        AllowChatInvites,
13550        /// A privacy setting for managing whether the user can be called
13551        #[serde(rename(serialize = "userPrivacySettingAllowCalls", deserialize = "userPrivacySettingAllowCalls"))]
13552        AllowCalls,
13553        /// A privacy setting for managing whether peer-to-peer connections can be used for calls
13554        #[serde(rename(serialize = "userPrivacySettingAllowPeerToPeerCalls", deserialize = "userPrivacySettingAllowPeerToPeerCalls"))]
13555        AllowPeerToPeerCalls,
13556        /// A privacy setting for managing whether the user can be found by their phone number. Checked only if the phone number is not known to the other user. Can be set only to "Allow contacts" or "Allow all"
13557        #[serde(rename(serialize = "userPrivacySettingAllowFindingByPhoneNumber", deserialize = "userPrivacySettingAllowFindingByPhoneNumber"))]
13558        AllowFindingByPhoneNumber,
13559        /// A privacy setting for managing whether the user can receive voice and video messages in private chats
13560        #[serde(rename(serialize = "userPrivacySettingAllowPrivateVoiceAndVideoNoteMessages", deserialize = "userPrivacySettingAllowPrivateVoiceAndVideoNoteMessages"))]
13561        AllowPrivateVoiceAndVideoNoteMessages,
13562    }
13563    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
13564    #[serde(tag = "@type")]
13565    pub enum AccountTtl {
13566        /// Contains information about the period of inactivity after which the current user's account will automatically be deleted
13567        #[serde(rename(serialize = "accountTtl", deserialize = "accountTtl"))]
13568        AccountTtl(crate::types::AccountTtl),
13569    }
13570    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
13571    #[serde(tag = "@type")]
13572    pub enum MessageAutoDeleteTime {
13573        /// Contains default auto-delete timer setting for new chats
13574        #[serde(rename(serialize = "messageAutoDeleteTime", deserialize = "messageAutoDeleteTime"))]
13575        MessageAutoDeleteTime(crate::types::MessageAutoDeleteTime),
13576    }
13577    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
13578    #[serde(tag = "@type")]
13579    pub enum SessionType {
13580        /// The session is running on an Android device
13581        #[serde(rename(serialize = "sessionTypeAndroid", deserialize = "sessionTypeAndroid"))]
13582        Android,
13583        /// The session is running on a generic Apple device
13584        #[serde(rename(serialize = "sessionTypeApple", deserialize = "sessionTypeApple"))]
13585        Apple,
13586        /// The session is running on the Brave browser
13587        #[serde(rename(serialize = "sessionTypeBrave", deserialize = "sessionTypeBrave"))]
13588        Brave,
13589        /// The session is running on the Chrome browser
13590        #[serde(rename(serialize = "sessionTypeChrome", deserialize = "sessionTypeChrome"))]
13591        Chrome,
13592        /// The session is running on the Edge browser
13593        #[serde(rename(serialize = "sessionTypeEdge", deserialize = "sessionTypeEdge"))]
13594        Edge,
13595        /// The session is running on the Firefox browser
13596        #[serde(rename(serialize = "sessionTypeFirefox", deserialize = "sessionTypeFirefox"))]
13597        Firefox,
13598        /// The session is running on an iPad device
13599        #[serde(rename(serialize = "sessionTypeIpad", deserialize = "sessionTypeIpad"))]
13600        Ipad,
13601        /// The session is running on an iPhone device
13602        #[serde(rename(serialize = "sessionTypeIphone", deserialize = "sessionTypeIphone"))]
13603        Iphone,
13604        /// The session is running on a Linux device
13605        #[serde(rename(serialize = "sessionTypeLinux", deserialize = "sessionTypeLinux"))]
13606        Linux,
13607        /// The session is running on a Mac device
13608        #[serde(rename(serialize = "sessionTypeMac", deserialize = "sessionTypeMac"))]
13609        Mac,
13610        /// The session is running on the Opera browser
13611        #[serde(rename(serialize = "sessionTypeOpera", deserialize = "sessionTypeOpera"))]
13612        Opera,
13613        /// The session is running on the Safari browser
13614        #[serde(rename(serialize = "sessionTypeSafari", deserialize = "sessionTypeSafari"))]
13615        Safari,
13616        /// The session is running on an Ubuntu device
13617        #[serde(rename(serialize = "sessionTypeUbuntu", deserialize = "sessionTypeUbuntu"))]
13618        Ubuntu,
13619        /// The session is running on an unknown type of device
13620        #[serde(rename(serialize = "sessionTypeUnknown", deserialize = "sessionTypeUnknown"))]
13621        Unknown,
13622        /// The session is running on the Vivaldi browser
13623        #[serde(rename(serialize = "sessionTypeVivaldi", deserialize = "sessionTypeVivaldi"))]
13624        Vivaldi,
13625        /// The session is running on a Windows device
13626        #[serde(rename(serialize = "sessionTypeWindows", deserialize = "sessionTypeWindows"))]
13627        Windows,
13628        /// The session is running on an Xbox console
13629        #[serde(rename(serialize = "sessionTypeXbox", deserialize = "sessionTypeXbox"))]
13630        Xbox,
13631    }
13632    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
13633    #[serde(tag = "@type")]
13634    pub enum Session {
13635        /// Contains information about one session in a Telegram application used by the current user. Sessions must be shown to the user in the returned order
13636        #[serde(rename(serialize = "session", deserialize = "session"))]
13637        Session(crate::types::Session),
13638    }
13639    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
13640    #[serde(tag = "@type")]
13641    pub enum Sessions {
13642        /// Contains a list of sessions
13643        #[serde(rename(serialize = "sessions", deserialize = "sessions"))]
13644        Sessions(crate::types::Sessions),
13645    }
13646    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
13647    #[serde(tag = "@type")]
13648    pub enum UnconfirmedSession {
13649        /// Contains information about an unconfirmed session
13650        #[serde(rename(serialize = "unconfirmedSession", deserialize = "unconfirmedSession"))]
13651        UnconfirmedSession(crate::types::UnconfirmedSession),
13652    }
13653    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
13654    #[serde(tag = "@type")]
13655    pub enum ConnectedWebsite {
13656        /// Contains information about one website the current user is logged in with Telegram
13657        #[serde(rename(serialize = "connectedWebsite", deserialize = "connectedWebsite"))]
13658        ConnectedWebsite(crate::types::ConnectedWebsite),
13659    }
13660    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
13661    #[serde(tag = "@type")]
13662    pub enum ConnectedWebsites {
13663        /// Contains a list of websites the current user is logged in with Telegram
13664        #[serde(rename(serialize = "connectedWebsites", deserialize = "connectedWebsites"))]
13665        ConnectedWebsites(crate::types::ConnectedWebsites),
13666    }
13667    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
13668    #[serde(tag = "@type")]
13669    pub enum ReportReason {
13670        /// The chat contains spam messages
13671        #[serde(rename(serialize = "reportReasonSpam", deserialize = "reportReasonSpam"))]
13672        Spam,
13673        /// The chat promotes violence
13674        #[serde(rename(serialize = "reportReasonViolence", deserialize = "reportReasonViolence"))]
13675        Violence,
13676        /// The chat contains pornographic messages
13677        #[serde(rename(serialize = "reportReasonPornography", deserialize = "reportReasonPornography"))]
13678        Pornography,
13679        /// The chat has child abuse related content
13680        #[serde(rename(serialize = "reportReasonChildAbuse", deserialize = "reportReasonChildAbuse"))]
13681        ChildAbuse,
13682        /// The chat contains copyrighted content
13683        #[serde(rename(serialize = "reportReasonCopyright", deserialize = "reportReasonCopyright"))]
13684        Copyright,
13685        /// The location-based chat is unrelated to its stated location
13686        #[serde(rename(serialize = "reportReasonUnrelatedLocation", deserialize = "reportReasonUnrelatedLocation"))]
13687        UnrelatedLocation,
13688        /// The chat represents a fake account
13689        #[serde(rename(serialize = "reportReasonFake", deserialize = "reportReasonFake"))]
13690        Fake,
13691        /// The chat has illegal drugs related content
13692        #[serde(rename(serialize = "reportReasonIllegalDrugs", deserialize = "reportReasonIllegalDrugs"))]
13693        IllegalDrugs,
13694        /// The chat contains messages with personal details
13695        #[serde(rename(serialize = "reportReasonPersonalDetails", deserialize = "reportReasonPersonalDetails"))]
13696        PersonalDetails,
13697        /// A custom reason provided by the user
13698        #[serde(rename(serialize = "reportReasonCustom", deserialize = "reportReasonCustom"))]
13699        Custom,
13700    }
13701    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
13702    #[serde(tag = "@type")]
13703    pub enum TargetChat {
13704        /// The currently opened chat needs to be kept
13705        #[serde(rename(serialize = "targetChatCurrent", deserialize = "targetChatCurrent"))]
13706        Current,
13707        /// The chat needs to be chosen by the user among chats of the specified types
13708        #[serde(rename(serialize = "targetChatChosen", deserialize = "targetChatChosen"))]
13709        Chosen(crate::types::TargetChatChosen),
13710        /// The chat needs to be open with the provided internal link
13711        #[serde(rename(serialize = "targetChatInternalLink", deserialize = "targetChatInternalLink"))]
13712        InternalLink(Box<crate::types::TargetChatInternalLink>),
13713    }
13714    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
13715    #[serde(tag = "@type")]
13716    pub enum InternalLinkType {
13717        /// The link is a link to the active sessions section of the application. Use getActiveSessions to handle the link
13718        #[serde(rename(serialize = "internalLinkTypeActiveSessions", deserialize = "internalLinkTypeActiveSessions"))]
13719        ActiveSessions,
13720        /// The link is a link to an attachment menu bot to be opened in the specified or a chosen chat. Process given target_chat to open the chat.
13721        /// Then, call searchPublicChat with the given bot username, check that the user is a bot and can be added to attachment menu. Then, use getAttachmentMenuBot to receive information about the bot.
13722        /// If the bot isn't added to attachment menu, then show a disclaimer about Mini Apps being a third-party apps, ask the user to accept their Terms of service and confirm adding the bot to side and attachment menu.
13723        /// If the user accept the terms and confirms adding, then use toggleBotIsAddedToAttachmentMenu to add the bot.
13724        /// If the attachment menu bot can't be used in the opened chat, show an error to the user. If the bot is added to attachment menu and can be used in the chat, then use openWebApp with the given URL
13725        #[serde(rename(serialize = "internalLinkTypeAttachmentMenuBot", deserialize = "internalLinkTypeAttachmentMenuBot"))]
13726        AttachmentMenuBot(Box<crate::types::InternalLinkTypeAttachmentMenuBot>),
13727        /// The link contains an authentication code. Call checkAuthenticationCode with the code if the current authorization state is authorizationStateWaitCode
13728        #[serde(rename(serialize = "internalLinkTypeAuthenticationCode", deserialize = "internalLinkTypeAuthenticationCode"))]
13729        AuthenticationCode(crate::types::InternalLinkTypeAuthenticationCode),
13730        /// The link is a link to a background. Call searchBackground with the given background name to process the link
13731        #[serde(rename(serialize = "internalLinkTypeBackground", deserialize = "internalLinkTypeBackground"))]
13732        Background(crate::types::InternalLinkTypeBackground),
13733        /// The link is a link to a Telegram bot, which is supposed to be added to a channel chat as an administrator. Call searchPublicChat with the given bot username and check that the user is a bot,
13734        /// ask the current user to select a channel chat to add the bot to as an administrator. Then, call getChatMember to receive the current bot rights in the chat and if the bot already is an administrator,
13735        /// check that the current user can edit its administrator rights and combine received rights with the requested administrator rights. Then, show confirmation box to the user, and call setChatMemberStatus with the chosen chat and confirmed rights
13736        #[serde(rename(serialize = "internalLinkTypeBotAddToChannel", deserialize = "internalLinkTypeBotAddToChannel"))]
13737        BotAddToChannel(crate::types::InternalLinkTypeBotAddToChannel),
13738        /// The link is a link to a chat with a Telegram bot. Call searchPublicChat with the given bot username, check that the user is a bot, show START button in the chat with the bot,
13739        /// and then call sendBotStartMessage with the given start parameter after the button is pressed
13740        #[serde(rename(serialize = "internalLinkTypeBotStart", deserialize = "internalLinkTypeBotStart"))]
13741        BotStart(crate::types::InternalLinkTypeBotStart),
13742        /// The link is a link to a Telegram bot, which is supposed to be added to a group chat. Call searchPublicChat with the given bot username, check that the user is a bot and can be added to groups,
13743        /// ask the current user to select a basic group or a supergroup chat to add the bot to, taking into account that bots can be added to a public supergroup only by administrators of the supergroup.
13744        /// If administrator rights are provided by the link, call getChatMember to receive the current bot rights in the chat and if the bot already is an administrator,
13745        /// check that the current user can edit its administrator rights, combine received rights with the requested administrator rights, show confirmation box to the user,
13746        /// and call setChatMemberStatus with the chosen chat and confirmed administrator rights. Before call to setChatMemberStatus it may be required to upgrade the chosen basic group chat to a supergroup chat.
13747        /// Then, if start_parameter isn't empty, call sendBotStartMessage with the given start parameter and the chosen chat; otherwise, just send /start message with bot's username added to the chat.
13748        #[serde(rename(serialize = "internalLinkTypeBotStartInGroup", deserialize = "internalLinkTypeBotStartInGroup"))]
13749        BotStartInGroup(crate::types::InternalLinkTypeBotStartInGroup),
13750        /// The link is a link to the change phone number section of the app
13751        #[serde(rename(serialize = "internalLinkTypeChangePhoneNumber", deserialize = "internalLinkTypeChangePhoneNumber"))]
13752        ChangePhoneNumber,
13753        /// The link is a link to boost a Telegram chat. Call getChatBoostLinkInfo with the given URL to process the link.
13754        /// If the chat is found, then call getChatBoostStatus and canBoostChat to get the current boost status and check whether the chat can be boosted.
13755        /// If the user wants to boost the chat and the chat can be boosted, then call boostChat
13756        #[serde(rename(serialize = "internalLinkTypeChatBoost", deserialize = "internalLinkTypeChatBoost"))]
13757        ChatBoost(crate::types::InternalLinkTypeChatBoost),
13758        /// The link is an invite link to a chat folder. Call checkChatFolderInviteLink with the given invite link to process the link
13759        #[serde(rename(serialize = "internalLinkTypeChatFolderInvite", deserialize = "internalLinkTypeChatFolderInvite"))]
13760        ChatFolderInvite(crate::types::InternalLinkTypeChatFolderInvite),
13761        /// The link is a link to the folder section of the app settings
13762        #[serde(rename(serialize = "internalLinkTypeChatFolderSettings", deserialize = "internalLinkTypeChatFolderSettings"))]
13763        ChatFolderSettings,
13764        /// The link is a chat invite link. Call checkChatInviteLink with the given invite link to process the link
13765        #[serde(rename(serialize = "internalLinkTypeChatInvite", deserialize = "internalLinkTypeChatInvite"))]
13766        ChatInvite(crate::types::InternalLinkTypeChatInvite),
13767        /// The link is a link to the default message auto-delete timer settings section of the app settings
13768        #[serde(rename(serialize = "internalLinkTypeDefaultMessageAutoDeleteTimerSettings", deserialize = "internalLinkTypeDefaultMessageAutoDeleteTimerSettings"))]
13769        DefaultMessageAutoDeleteTimerSettings,
13770        /// The link is a link to the edit profile section of the app settings
13771        #[serde(rename(serialize = "internalLinkTypeEditProfileSettings", deserialize = "internalLinkTypeEditProfileSettings"))]
13772        EditProfileSettings,
13773        /// The link is a link to a game. Call searchPublicChat with the given bot username, check that the user is a bot, ask the current user to select a chat to send the game, and then call sendMessage with inputMessageGame
13774        #[serde(rename(serialize = "internalLinkTypeGame", deserialize = "internalLinkTypeGame"))]
13775        Game(crate::types::InternalLinkTypeGame),
13776        /// The link must be opened in an Instant View. Call getWebPageInstantView with the given URL to process the link
13777        #[serde(rename(serialize = "internalLinkTypeInstantView", deserialize = "internalLinkTypeInstantView"))]
13778        InstantView(crate::types::InternalLinkTypeInstantView),
13779        /// The link is a link to an invoice. Call getPaymentForm with the given invoice name to process the link
13780        #[serde(rename(serialize = "internalLinkTypeInvoice", deserialize = "internalLinkTypeInvoice"))]
13781        Invoice(crate::types::InternalLinkTypeInvoice),
13782        /// The link is a link to a language pack. Call getLanguagePackInfo with the given language pack identifier to process the link
13783        #[serde(rename(serialize = "internalLinkTypeLanguagePack", deserialize = "internalLinkTypeLanguagePack"))]
13784        LanguagePack(crate::types::InternalLinkTypeLanguagePack),
13785        /// The link is a link to the language section of the app settings
13786        #[serde(rename(serialize = "internalLinkTypeLanguageSettings", deserialize = "internalLinkTypeLanguageSettings"))]
13787        LanguageSettings,
13788        /// The link is a link to a Telegram message or a forum topic. Call getMessageLinkInfo with the given URL to process the link
13789        #[serde(rename(serialize = "internalLinkTypeMessage", deserialize = "internalLinkTypeMessage"))]
13790        Message(crate::types::InternalLinkTypeMessage),
13791        /// The link contains a message draft text. A share screen needs to be shown to the user, then the chosen chat must be opened and the text is added to the input field
13792        #[serde(rename(serialize = "internalLinkTypeMessageDraft", deserialize = "internalLinkTypeMessageDraft"))]
13793        MessageDraft(crate::types::InternalLinkTypeMessageDraft),
13794        /// The link contains a request of Telegram passport data. Call getPassportAuthorizationForm with the given parameters to process the link if the link was received from outside of the application; otherwise, ignore it
13795        #[serde(rename(serialize = "internalLinkTypePassportDataRequest", deserialize = "internalLinkTypePassportDataRequest"))]
13796        PassportDataRequest(crate::types::InternalLinkTypePassportDataRequest),
13797        /// The link can be used to confirm ownership of a phone number to prevent account deletion. Call sendPhoneNumberConfirmationCode with the given hash and phone number to process the link
13798        #[serde(rename(serialize = "internalLinkTypePhoneNumberConfirmation", deserialize = "internalLinkTypePhoneNumberConfirmation"))]
13799        PhoneNumberConfirmation(crate::types::InternalLinkTypePhoneNumberConfirmation),
13800        /// The link is a link to the Premium features screen of the application from which the user can subscribe to Telegram Premium. Call getPremiumFeatures with the given referrer to process the link
13801        #[serde(rename(serialize = "internalLinkTypePremiumFeatures", deserialize = "internalLinkTypePremiumFeatures"))]
13802        PremiumFeatures(crate::types::InternalLinkTypePremiumFeatures),
13803        /// The link is a link to the privacy and security section of the app settings
13804        #[serde(rename(serialize = "internalLinkTypePrivacyAndSecuritySettings", deserialize = "internalLinkTypePrivacyAndSecuritySettings"))]
13805        PrivacyAndSecuritySettings,
13806        /// The link is a link to a proxy. Call addProxy with the given parameters to process the link and add the proxy
13807        #[serde(rename(serialize = "internalLinkTypeProxy", deserialize = "internalLinkTypeProxy"))]
13808        Proxy(crate::types::InternalLinkTypeProxy),
13809        /// The link is a link to a chat by its username. Call searchPublicChat with the given chat username to process the link
13810        #[serde(rename(serialize = "internalLinkTypePublicChat", deserialize = "internalLinkTypePublicChat"))]
13811        PublicChat(crate::types::InternalLinkTypePublicChat),
13812        /// The link can be used to login the current user on another device, but it must be scanned from QR-code using in-app camera. An alert similar to
13813        /// "This code can be used to allow someone to log in to your Telegram account. To confirm Telegram login, please go to Settings > Devices > Scan QR and scan the code" needs to be shown
13814        #[serde(rename(serialize = "internalLinkTypeQrCodeAuthentication", deserialize = "internalLinkTypeQrCodeAuthentication"))]
13815        QrCodeAuthentication,
13816        /// The link forces restore of App Store purchases when opened. For official iOS application only
13817        #[serde(rename(serialize = "internalLinkTypeRestorePurchases", deserialize = "internalLinkTypeRestorePurchases"))]
13818        RestorePurchases,
13819        /// The link is a link to application settings
13820        #[serde(rename(serialize = "internalLinkTypeSettings", deserialize = "internalLinkTypeSettings"))]
13821        Settings,
13822        /// The link is a link to a bot, which can be installed to the side menu. Call searchPublicChat with the given bot username, check that the user is a bot and can be added to attachment menu.
13823        /// Then, use getAttachmentMenuBot to receive information about the bot. If the bot isn't added to side menu, then show a disclaimer about Mini Apps being a third-party apps,
13824        /// ask the user to accept their Terms of service and confirm adding the bot to side and attachment menu. If the user accept the terms and confirms adding, then use toggleBotIsAddedToAttachmentMenu to add the bot.
13825        /// If the bot is added to side menu, then use getWebAppUrl with the given URL
13826        #[serde(rename(serialize = "internalLinkTypeSideMenuBot", deserialize = "internalLinkTypeSideMenuBot"))]
13827        SideMenuBot(crate::types::InternalLinkTypeSideMenuBot),
13828        /// The link is a link to a sticker set. Call searchStickerSet with the given sticker set name to process the link and show the sticker set
13829        #[serde(rename(serialize = "internalLinkTypeStickerSet", deserialize = "internalLinkTypeStickerSet"))]
13830        StickerSet(crate::types::InternalLinkTypeStickerSet),
13831        /// The link is a link to a story. Call searchPublicChat with the given sender username, then call getStory with the received chat identifier and the given story identifier
13832        #[serde(rename(serialize = "internalLinkTypeStory", deserialize = "internalLinkTypeStory"))]
13833        Story(crate::types::InternalLinkTypeStory),
13834        /// The link is a link to a theme. TDLib has no theme support yet
13835        #[serde(rename(serialize = "internalLinkTypeTheme", deserialize = "internalLinkTypeTheme"))]
13836        Theme(crate::types::InternalLinkTypeTheme),
13837        /// The link is a link to the theme section of the app settings
13838        #[serde(rename(serialize = "internalLinkTypeThemeSettings", deserialize = "internalLinkTypeThemeSettings"))]
13839        ThemeSettings,
13840        /// The link is an unknown tg: link. Call getDeepLinkInfo to process the link
13841        #[serde(rename(serialize = "internalLinkTypeUnknownDeepLink", deserialize = "internalLinkTypeUnknownDeepLink"))]
13842        UnknownDeepLink(crate::types::InternalLinkTypeUnknownDeepLink),
13843        /// The link is a link to an unsupported proxy. An alert can be shown to the user
13844        #[serde(rename(serialize = "internalLinkTypeUnsupportedProxy", deserialize = "internalLinkTypeUnsupportedProxy"))]
13845        UnsupportedProxy,
13846        /// The link is a link to a user by its phone number. Call searchUserByPhoneNumber with the given phone number to process the link
13847        #[serde(rename(serialize = "internalLinkTypeUserPhoneNumber", deserialize = "internalLinkTypeUserPhoneNumber"))]
13848        UserPhoneNumber(crate::types::InternalLinkTypeUserPhoneNumber),
13849        /// The link is a link to a user by a temporary token. Call searchUserByToken with the given token to process the link
13850        #[serde(rename(serialize = "internalLinkTypeUserToken", deserialize = "internalLinkTypeUserToken"))]
13851        UserToken(crate::types::InternalLinkTypeUserToken),
13852        /// The link is a link to a video chat. Call searchPublicChat with the given chat username, and then joinGroupCall with the given invite hash to process the link
13853        #[serde(rename(serialize = "internalLinkTypeVideoChat", deserialize = "internalLinkTypeVideoChat"))]
13854        VideoChat(crate::types::InternalLinkTypeVideoChat),
13855        /// The link is a link to a Web App. Call searchPublicChat with the given bot username, check that the user is a bot, then call searchWebApp with the received bot and the given web_app_short_name.
13856        /// Process received foundWebApp by showing a confirmation dialog if needed. If the bot can be added to attachment or side menu, but isn't added yet, then show a disclaimer about Mini Apps being a third-party apps
13857        /// instead of the dialog and ask the user to accept their Terms of service. If the user accept the terms and confirms adding, then use toggleBotIsAddedToAttachmentMenu to add the bot.
13858        /// Then, call getWebAppLinkUrl and open the returned URL as a Web App
13859        #[serde(rename(serialize = "internalLinkTypeWebApp", deserialize = "internalLinkTypeWebApp"))]
13860        WebApp(crate::types::InternalLinkTypeWebApp),
13861    }
13862    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
13863    #[serde(tag = "@type")]
13864    pub enum MessageLink {
13865        /// Contains an HTTPS link to a message in a supergroup or channel, or a forum topic
13866        #[serde(rename(serialize = "messageLink", deserialize = "messageLink"))]
13867        MessageLink(crate::types::MessageLink),
13868    }
13869    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
13870    #[serde(tag = "@type")]
13871    pub enum MessageLinkInfo {
13872        /// Contains information about a link to a message or a forum topic in a chat
13873        #[serde(rename(serialize = "messageLinkInfo", deserialize = "messageLinkInfo"))]
13874        MessageLinkInfo(crate::types::MessageLinkInfo),
13875    }
13876    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
13877    #[serde(tag = "@type")]
13878    pub enum ChatBoostLink {
13879        /// Contains an HTTPS link to boost a chat
13880        #[serde(rename(serialize = "chatBoostLink", deserialize = "chatBoostLink"))]
13881        ChatBoostLink(crate::types::ChatBoostLink),
13882    }
13883    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
13884    #[serde(tag = "@type")]
13885    pub enum ChatBoostLinkInfo {
13886        /// Contains information about a link to boost a a chat
13887        #[serde(rename(serialize = "chatBoostLinkInfo", deserialize = "chatBoostLinkInfo"))]
13888        ChatBoostLinkInfo(crate::types::ChatBoostLinkInfo),
13889    }
13890    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
13891    #[serde(tag = "@type")]
13892    pub enum BlockList {
13893        /// The main block list that disallows writing messages to the current user, receiving their status and photo, viewing of stories, and some other actions
13894        #[serde(rename(serialize = "blockListMain", deserialize = "blockListMain"))]
13895        Main,
13896        /// The block list that disallows viewing of stories of the current user
13897        #[serde(rename(serialize = "blockListStories", deserialize = "blockListStories"))]
13898        Stories,
13899    }
13900    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
13901    #[serde(tag = "@type")]
13902    pub enum FilePart {
13903        /// Contains a part of a file
13904        #[serde(rename(serialize = "filePart", deserialize = "filePart"))]
13905        FilePart(crate::types::FilePart),
13906    }
13907    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
13908    #[serde(tag = "@type")]
13909    pub enum FileType {
13910        /// The data is not a file
13911        #[serde(rename(serialize = "fileTypeNone", deserialize = "fileTypeNone"))]
13912        None,
13913        /// The file is an animation
13914        #[serde(rename(serialize = "fileTypeAnimation", deserialize = "fileTypeAnimation"))]
13915        Animation,
13916        /// The file is an audio file
13917        #[serde(rename(serialize = "fileTypeAudio", deserialize = "fileTypeAudio"))]
13918        Audio,
13919        /// The file is a document
13920        #[serde(rename(serialize = "fileTypeDocument", deserialize = "fileTypeDocument"))]
13921        Document,
13922        /// The file is a notification sound
13923        #[serde(rename(serialize = "fileTypeNotificationSound", deserialize = "fileTypeNotificationSound"))]
13924        NotificationSound,
13925        /// The file is a photo
13926        #[serde(rename(serialize = "fileTypePhoto", deserialize = "fileTypePhoto"))]
13927        Photo,
13928        /// The file is a photo published as a story
13929        #[serde(rename(serialize = "fileTypePhotoStory", deserialize = "fileTypePhotoStory"))]
13930        PhotoStory,
13931        /// The file is a profile photo
13932        #[serde(rename(serialize = "fileTypeProfilePhoto", deserialize = "fileTypeProfilePhoto"))]
13933        ProfilePhoto,
13934        /// The file was sent to a secret chat (the file type is not known to the server)
13935        #[serde(rename(serialize = "fileTypeSecret", deserialize = "fileTypeSecret"))]
13936        Secret,
13937        /// The file is a thumbnail of a file from a secret chat
13938        #[serde(rename(serialize = "fileTypeSecretThumbnail", deserialize = "fileTypeSecretThumbnail"))]
13939        SecretThumbnail,
13940        /// The file is a file from Secure storage used for storing Telegram Passport files
13941        #[serde(rename(serialize = "fileTypeSecure", deserialize = "fileTypeSecure"))]
13942        Secure,
13943        /// The file is a sticker
13944        #[serde(rename(serialize = "fileTypeSticker", deserialize = "fileTypeSticker"))]
13945        Sticker,
13946        /// The file is a thumbnail of another file
13947        #[serde(rename(serialize = "fileTypeThumbnail", deserialize = "fileTypeThumbnail"))]
13948        Thumbnail,
13949        /// The file type is not yet known
13950        #[serde(rename(serialize = "fileTypeUnknown", deserialize = "fileTypeUnknown"))]
13951        Unknown,
13952        /// The file is a video
13953        #[serde(rename(serialize = "fileTypeVideo", deserialize = "fileTypeVideo"))]
13954        Video,
13955        /// The file is a video note
13956        #[serde(rename(serialize = "fileTypeVideoNote", deserialize = "fileTypeVideoNote"))]
13957        VideoNote,
13958        /// The file is a video published as a story
13959        #[serde(rename(serialize = "fileTypeVideoStory", deserialize = "fileTypeVideoStory"))]
13960        VideoStory,
13961        /// The file is a voice note
13962        #[serde(rename(serialize = "fileTypeVoiceNote", deserialize = "fileTypeVoiceNote"))]
13963        VoiceNote,
13964        /// The file is a wallpaper or a background pattern
13965        #[serde(rename(serialize = "fileTypeWallpaper", deserialize = "fileTypeWallpaper"))]
13966        Wallpaper,
13967    }
13968    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
13969    #[serde(tag = "@type")]
13970    pub enum StorageStatisticsByFileType {
13971        /// Contains the storage usage statistics for a specific file type
13972        #[serde(rename(serialize = "storageStatisticsByFileType", deserialize = "storageStatisticsByFileType"))]
13973        StorageStatisticsByFileType(crate::types::StorageStatisticsByFileType),
13974    }
13975    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
13976    #[serde(tag = "@type")]
13977    pub enum StorageStatisticsByChat {
13978        /// Contains the storage usage statistics for a specific chat
13979        #[serde(rename(serialize = "storageStatisticsByChat", deserialize = "storageStatisticsByChat"))]
13980        StorageStatisticsByChat(crate::types::StorageStatisticsByChat),
13981    }
13982    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
13983    #[serde(tag = "@type")]
13984    pub enum StorageStatistics {
13985        /// Contains the exact storage usage statistics split by chats and file type
13986        #[serde(rename(serialize = "storageStatistics", deserialize = "storageStatistics"))]
13987        StorageStatistics(crate::types::StorageStatistics),
13988    }
13989    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
13990    #[serde(tag = "@type")]
13991    pub enum StorageStatisticsFast {
13992        /// Contains approximate storage usage statistics, excluding files of unknown file type
13993        #[serde(rename(serialize = "storageStatisticsFast", deserialize = "storageStatisticsFast"))]
13994        StorageStatisticsFast(crate::types::StorageStatisticsFast),
13995    }
13996    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
13997    #[serde(tag = "@type")]
13998    pub enum DatabaseStatistics {
13999        /// Contains database statistics
14000        #[serde(rename(serialize = "databaseStatistics", deserialize = "databaseStatistics"))]
14001        DatabaseStatistics(crate::types::DatabaseStatistics),
14002    }
14003    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
14004    #[serde(tag = "@type")]
14005    pub enum NetworkType {
14006        /// The network is not available
14007        #[serde(rename(serialize = "networkTypeNone", deserialize = "networkTypeNone"))]
14008        None,
14009        /// A mobile network
14010        #[serde(rename(serialize = "networkTypeMobile", deserialize = "networkTypeMobile"))]
14011        Mobile,
14012        /// A mobile roaming network
14013        #[serde(rename(serialize = "networkTypeMobileRoaming", deserialize = "networkTypeMobileRoaming"))]
14014        MobileRoaming,
14015        /// A Wi-Fi network
14016        #[serde(rename(serialize = "networkTypeWiFi", deserialize = "networkTypeWiFi"))]
14017        WiFi,
14018        /// A different network type (e.g., Ethernet network)
14019        #[serde(rename(serialize = "networkTypeOther", deserialize = "networkTypeOther"))]
14020        Other,
14021    }
14022    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
14023    #[serde(tag = "@type")]
14024    pub enum NetworkStatisticsEntry {
14025        /// Contains information about the total amount of data that was used to send and receive files
14026        #[serde(rename(serialize = "networkStatisticsEntryFile", deserialize = "networkStatisticsEntryFile"))]
14027        File(crate::types::NetworkStatisticsEntryFile),
14028        /// Contains information about the total amount of data that was used for calls
14029        #[serde(rename(serialize = "networkStatisticsEntryCall", deserialize = "networkStatisticsEntryCall"))]
14030        Call(crate::types::NetworkStatisticsEntryCall),
14031    }
14032    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
14033    #[serde(tag = "@type")]
14034    pub enum NetworkStatistics {
14035        /// A full list of available network statistic entries
14036        #[serde(rename(serialize = "networkStatistics", deserialize = "networkStatistics"))]
14037        NetworkStatistics(crate::types::NetworkStatistics),
14038    }
14039    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
14040    #[serde(tag = "@type")]
14041    pub enum AutoDownloadSettings {
14042        /// Contains auto-download settings
14043        #[serde(rename(serialize = "autoDownloadSettings", deserialize = "autoDownloadSettings"))]
14044        AutoDownloadSettings(crate::types::AutoDownloadSettings),
14045    }
14046    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
14047    #[serde(tag = "@type")]
14048    pub enum AutoDownloadSettingsPresets {
14049        /// Contains auto-download settings presets for the current user
14050        #[serde(rename(serialize = "autoDownloadSettingsPresets", deserialize = "autoDownloadSettingsPresets"))]
14051        AutoDownloadSettingsPresets(crate::types::AutoDownloadSettingsPresets),
14052    }
14053    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
14054    #[serde(tag = "@type")]
14055    pub enum AutosaveSettingsScope {
14056        /// Autosave settings applied to all private chats without chat-specific settings
14057        #[serde(rename(serialize = "autosaveSettingsScopePrivateChats", deserialize = "autosaveSettingsScopePrivateChats"))]
14058        PrivateChats,
14059        /// Autosave settings applied to all basic group and supergroup chats without chat-specific settings
14060        #[serde(rename(serialize = "autosaveSettingsScopeGroupChats", deserialize = "autosaveSettingsScopeGroupChats"))]
14061        GroupChats,
14062        /// Autosave settings applied to all channel chats without chat-specific settings
14063        #[serde(rename(serialize = "autosaveSettingsScopeChannelChats", deserialize = "autosaveSettingsScopeChannelChats"))]
14064        ChannelChats,
14065        /// Autosave settings applied to a chat
14066        #[serde(rename(serialize = "autosaveSettingsScopeChat", deserialize = "autosaveSettingsScopeChat"))]
14067        Chat(crate::types::AutosaveSettingsScopeChat),
14068    }
14069    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
14070    #[serde(tag = "@type")]
14071    pub enum ScopeAutosaveSettings {
14072        /// Contains autosave settings for an autosave settings scope
14073        #[serde(rename(serialize = "scopeAutosaveSettings", deserialize = "scopeAutosaveSettings"))]
14074        ScopeAutosaveSettings(crate::types::ScopeAutosaveSettings),
14075    }
14076    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
14077    #[serde(tag = "@type")]
14078    pub enum AutosaveSettingsException {
14079        /// Contains autosave settings for a chat, which overrides default settings for the corresponding scope
14080        #[serde(rename(serialize = "autosaveSettingsException", deserialize = "autosaveSettingsException"))]
14081        AutosaveSettingsException(crate::types::AutosaveSettingsException),
14082    }
14083    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
14084    #[serde(tag = "@type")]
14085    pub enum AutosaveSettings {
14086        /// Describes autosave settings
14087        #[serde(rename(serialize = "autosaveSettings", deserialize = "autosaveSettings"))]
14088        AutosaveSettings(crate::types::AutosaveSettings),
14089    }
14090    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
14091    #[serde(tag = "@type")]
14092    pub enum ConnectionState {
14093        /// Currently waiting for the network to become available. Use setNetworkType to change the available network type
14094        #[serde(rename(serialize = "connectionStateWaitingForNetwork", deserialize = "connectionStateWaitingForNetwork"))]
14095        WaitingForNetwork,
14096        /// Currently establishing a connection with a proxy server
14097        #[serde(rename(serialize = "connectionStateConnectingToProxy", deserialize = "connectionStateConnectingToProxy"))]
14098        ConnectingToProxy,
14099        /// Currently establishing a connection to the Telegram servers
14100        #[serde(rename(serialize = "connectionStateConnecting", deserialize = "connectionStateConnecting"))]
14101        Connecting,
14102        /// Downloading data received while the application was offline
14103        #[serde(rename(serialize = "connectionStateUpdating", deserialize = "connectionStateUpdating"))]
14104        Updating,
14105        /// There is a working connection to the Telegram servers
14106        #[serde(rename(serialize = "connectionStateReady", deserialize = "connectionStateReady"))]
14107        Ready,
14108    }
14109    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
14110    #[serde(tag = "@type")]
14111    pub enum TopChatCategory {
14112        /// A category containing frequently used private chats with non-bot users
14113        #[serde(rename(serialize = "topChatCategoryUsers", deserialize = "topChatCategoryUsers"))]
14114        Users,
14115        /// A category containing frequently used private chats with bot users
14116        #[serde(rename(serialize = "topChatCategoryBots", deserialize = "topChatCategoryBots"))]
14117        Bots,
14118        /// A category containing frequently used basic groups and supergroups
14119        #[serde(rename(serialize = "topChatCategoryGroups", deserialize = "topChatCategoryGroups"))]
14120        Groups,
14121        /// A category containing frequently used channels
14122        #[serde(rename(serialize = "topChatCategoryChannels", deserialize = "topChatCategoryChannels"))]
14123        Channels,
14124        /// A category containing frequently used chats with inline bots sorted by their usage in inline mode
14125        #[serde(rename(serialize = "topChatCategoryInlineBots", deserialize = "topChatCategoryInlineBots"))]
14126        InlineBots,
14127        /// A category containing frequently used chats used for calls
14128        #[serde(rename(serialize = "topChatCategoryCalls", deserialize = "topChatCategoryCalls"))]
14129        Calls,
14130        /// A category containing frequently used chats used to forward messages
14131        #[serde(rename(serialize = "topChatCategoryForwardChats", deserialize = "topChatCategoryForwardChats"))]
14132        ForwardChats,
14133    }
14134    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
14135    #[serde(tag = "@type")]
14136    pub enum FoundPositions {
14137        /// Contains 0-based positions of matched objects
14138        #[serde(rename(serialize = "foundPositions", deserialize = "foundPositions"))]
14139        FoundPositions(crate::types::FoundPositions),
14140    }
14141    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
14142    #[serde(tag = "@type")]
14143    pub enum TmeUrlType {
14144        /// A URL linking to a user
14145        #[serde(rename(serialize = "tMeUrlTypeUser", deserialize = "tMeUrlTypeUser"))]
14146        User(crate::types::TmeUrlTypeUser),
14147        /// A URL linking to a public supergroup or channel
14148        #[serde(rename(serialize = "tMeUrlTypeSupergroup", deserialize = "tMeUrlTypeSupergroup"))]
14149        Supergroup(crate::types::TmeUrlTypeSupergroup),
14150        /// A chat invite link
14151        #[serde(rename(serialize = "tMeUrlTypeChatInvite", deserialize = "tMeUrlTypeChatInvite"))]
14152        ChatInvite(crate::types::TmeUrlTypeChatInvite),
14153        /// A URL linking to a sticker set
14154        #[serde(rename(serialize = "tMeUrlTypeStickerSet", deserialize = "tMeUrlTypeStickerSet"))]
14155        StickerSet(crate::types::TmeUrlTypeStickerSet),
14156    }
14157    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
14158    #[serde(tag = "@type")]
14159    pub enum TmeUrl {
14160        /// Represents a URL linking to an internal Telegram entity
14161        #[serde(rename(serialize = "tMeUrl", deserialize = "tMeUrl"))]
14162        TmeUrl(crate::types::TmeUrl),
14163    }
14164    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
14165    #[serde(tag = "@type")]
14166    pub enum TmeUrls {
14167        /// Contains a list of t.me URLs
14168        #[serde(rename(serialize = "tMeUrls", deserialize = "tMeUrls"))]
14169        TmeUrls(crate::types::TmeUrls),
14170    }
14171    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
14172    #[serde(tag = "@type")]
14173    pub enum SuggestedAction {
14174        /// Suggests the user to enable archive_and_mute_new_chats_from_unknown_users setting in archiveChatListSettings
14175        #[serde(rename(serialize = "suggestedActionEnableArchiveAndMuteNewChats", deserialize = "suggestedActionEnableArchiveAndMuteNewChats"))]
14176        EnableArchiveAndMuteNewChats,
14177        /// Suggests the user to check whether they still remember their 2-step verification password
14178        #[serde(rename(serialize = "suggestedActionCheckPassword", deserialize = "suggestedActionCheckPassword"))]
14179        CheckPassword,
14180        /// Suggests the user to check whether authorization phone number is correct and change the phone number if it is inaccessible
14181        #[serde(rename(serialize = "suggestedActionCheckPhoneNumber", deserialize = "suggestedActionCheckPhoneNumber"))]
14182        CheckPhoneNumber,
14183        /// Suggests the user to view a hint about the meaning of one and two check marks on sent messages
14184        #[serde(rename(serialize = "suggestedActionViewChecksHint", deserialize = "suggestedActionViewChecksHint"))]
14185        ViewChecksHint,
14186        /// Suggests the user to convert specified supergroup to a broadcast group
14187        #[serde(rename(serialize = "suggestedActionConvertToBroadcastGroup", deserialize = "suggestedActionConvertToBroadcastGroup"))]
14188        ConvertToBroadcastGroup(crate::types::SuggestedActionConvertToBroadcastGroup),
14189        /// Suggests the user to set a 2-step verification password to be able to log in again
14190        #[serde(rename(serialize = "suggestedActionSetPassword", deserialize = "suggestedActionSetPassword"))]
14191        SetPassword(crate::types::SuggestedActionSetPassword),
14192        /// Suggests the user to upgrade the Premium subscription from monthly payments to annual payments
14193        #[serde(rename(serialize = "suggestedActionUpgradePremium", deserialize = "suggestedActionUpgradePremium"))]
14194        UpgradePremium,
14195        /// Suggests the user to restore a recently expired Premium subscription
14196        #[serde(rename(serialize = "suggestedActionRestorePremium", deserialize = "suggestedActionRestorePremium"))]
14197        RestorePremium,
14198        /// Suggests the user to subscribe to the Premium subscription with annual payments
14199        #[serde(rename(serialize = "suggestedActionSubscribeToAnnualPremium", deserialize = "suggestedActionSubscribeToAnnualPremium"))]
14200        SubscribeToAnnualPremium,
14201    }
14202    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
14203    #[serde(tag = "@type")]
14204    pub enum Count {
14205        /// Contains a counter
14206        #[serde(rename(serialize = "count", deserialize = "count"))]
14207        Count(crate::types::Count),
14208    }
14209    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
14210    #[serde(tag = "@type")]
14211    pub enum Text {
14212        /// Contains some text
14213        #[serde(rename(serialize = "text", deserialize = "text"))]
14214        Text(crate::types::Text),
14215    }
14216    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
14217    #[serde(tag = "@type")]
14218    pub enum Seconds {
14219        /// Contains a value representing a number of seconds
14220        #[serde(rename(serialize = "seconds", deserialize = "seconds"))]
14221        Seconds(crate::types::Seconds),
14222    }
14223    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
14224    #[serde(tag = "@type")]
14225    pub enum FileDownloadedPrefixSize {
14226        /// Contains size of downloaded prefix of a file
14227        #[serde(rename(serialize = "fileDownloadedPrefixSize", deserialize = "fileDownloadedPrefixSize"))]
14228        FileDownloadedPrefixSize(crate::types::FileDownloadedPrefixSize),
14229    }
14230    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
14231    #[serde(tag = "@type")]
14232    pub enum DeepLinkInfo {
14233        /// Contains information about a tg: deep link
14234        #[serde(rename(serialize = "deepLinkInfo", deserialize = "deepLinkInfo"))]
14235        DeepLinkInfo(crate::types::DeepLinkInfo),
14236    }
14237    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
14238    #[serde(tag = "@type")]
14239    pub enum TextParseMode {
14240        /// The text uses Markdown-style formatting
14241        #[serde(rename(serialize = "textParseModeMarkdown", deserialize = "textParseModeMarkdown"))]
14242        Markdown(crate::types::TextParseModeMarkdown),
14243        /// The text uses HTML-style formatting. The same as Telegram Bot API "HTML" parse mode
14244        #[serde(rename(serialize = "textParseModeHTML", deserialize = "textParseModeHTML"))]
14245        Html,
14246    }
14247    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
14248    #[serde(tag = "@type")]
14249    pub enum ProxyType {
14250        /// A SOCKS5 proxy server
14251        #[serde(rename(serialize = "proxyTypeSocks5", deserialize = "proxyTypeSocks5"))]
14252        Socks5(crate::types::ProxyTypeSocks5),
14253        /// A HTTP transparent proxy server
14254        #[serde(rename(serialize = "proxyTypeHttp", deserialize = "proxyTypeHttp"))]
14255        Http(crate::types::ProxyTypeHttp),
14256        /// An MTProto proxy server
14257        #[serde(rename(serialize = "proxyTypeMtproto", deserialize = "proxyTypeMtproto"))]
14258        Mtproto(crate::types::ProxyTypeMtproto),
14259    }
14260    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
14261    #[serde(tag = "@type")]
14262    pub enum Proxy {
14263        /// Contains information about a proxy server
14264        #[serde(rename(serialize = "proxy", deserialize = "proxy"))]
14265        Proxy(crate::types::Proxy),
14266    }
14267    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
14268    #[serde(tag = "@type")]
14269    pub enum Proxies {
14270        /// Represents a list of proxy servers
14271        #[serde(rename(serialize = "proxies", deserialize = "proxies"))]
14272        Proxies(crate::types::Proxies),
14273    }
14274    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
14275    #[serde(tag = "@type")]
14276    pub enum InputSticker {
14277        /// A sticker to be added to a sticker set
14278        #[serde(rename(serialize = "inputSticker", deserialize = "inputSticker"))]
14279        InputSticker(crate::types::InputSticker),
14280    }
14281    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
14282    #[serde(tag = "@type")]
14283    pub enum DateRange {
14284        /// Represents a date range
14285        #[serde(rename(serialize = "dateRange", deserialize = "dateRange"))]
14286        DateRange(crate::types::DateRange),
14287    }
14288    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
14289    #[serde(tag = "@type")]
14290    pub enum StatisticalValue {
14291        /// A value with information about its recent changes
14292        #[serde(rename(serialize = "statisticalValue", deserialize = "statisticalValue"))]
14293        StatisticalValue(crate::types::StatisticalValue),
14294    }
14295    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
14296    #[serde(tag = "@type")]
14297    pub enum StatisticalGraph {
14298        /// A graph data
14299        #[serde(rename(serialize = "statisticalGraphData", deserialize = "statisticalGraphData"))]
14300        Data(crate::types::StatisticalGraphData),
14301        /// The graph data to be asynchronously loaded through getStatisticalGraph
14302        #[serde(rename(serialize = "statisticalGraphAsync", deserialize = "statisticalGraphAsync"))]
14303        Async(crate::types::StatisticalGraphAsync),
14304        /// An error message to be shown to the user instead of the graph
14305        #[serde(rename(serialize = "statisticalGraphError", deserialize = "statisticalGraphError"))]
14306        Error(crate::types::StatisticalGraphError),
14307    }
14308    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
14309    #[serde(tag = "@type")]
14310    pub enum ChatStatisticsMessageInteractionInfo {
14311        /// Contains statistics about interactions with a message
14312        #[serde(rename(serialize = "chatStatisticsMessageInteractionInfo", deserialize = "chatStatisticsMessageInteractionInfo"))]
14313        ChatStatisticsMessageInteractionInfo(crate::types::ChatStatisticsMessageInteractionInfo),
14314    }
14315    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
14316    #[serde(tag = "@type")]
14317    pub enum ChatStatisticsMessageSenderInfo {
14318        /// Contains statistics about messages sent by a user
14319        #[serde(rename(serialize = "chatStatisticsMessageSenderInfo", deserialize = "chatStatisticsMessageSenderInfo"))]
14320        ChatStatisticsMessageSenderInfo(crate::types::ChatStatisticsMessageSenderInfo),
14321    }
14322    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
14323    #[serde(tag = "@type")]
14324    pub enum ChatStatisticsAdministratorActionsInfo {
14325        /// Contains statistics about administrator actions done by a user
14326        #[serde(rename(serialize = "chatStatisticsAdministratorActionsInfo", deserialize = "chatStatisticsAdministratorActionsInfo"))]
14327        ChatStatisticsAdministratorActionsInfo(crate::types::ChatStatisticsAdministratorActionsInfo),
14328    }
14329    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
14330    #[serde(tag = "@type")]
14331    pub enum ChatStatisticsInviterInfo {
14332        /// Contains statistics about number of new members invited by a user
14333        #[serde(rename(serialize = "chatStatisticsInviterInfo", deserialize = "chatStatisticsInviterInfo"))]
14334        ChatStatisticsInviterInfo(crate::types::ChatStatisticsInviterInfo),
14335    }
14336    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
14337    #[serde(tag = "@type")]
14338    pub enum ChatStatistics {
14339        /// A detailed statistics about a supergroup chat
14340        #[serde(rename(serialize = "chatStatisticsSupergroup", deserialize = "chatStatisticsSupergroup"))]
14341        Supergroup(crate::types::ChatStatisticsSupergroup),
14342        /// A detailed statistics about a channel chat
14343        #[serde(rename(serialize = "chatStatisticsChannel", deserialize = "chatStatisticsChannel"))]
14344        Channel(crate::types::ChatStatisticsChannel),
14345    }
14346    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
14347    #[serde(tag = "@type")]
14348    pub enum MessageStatistics {
14349        /// A detailed statistics about a message
14350        #[serde(rename(serialize = "messageStatistics", deserialize = "messageStatistics"))]
14351        MessageStatistics(crate::types::MessageStatistics),
14352    }
14353    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
14354    #[serde(tag = "@type")]
14355    pub enum Point {
14356        /// A point on a Cartesian plane
14357        #[serde(rename(serialize = "point", deserialize = "point"))]
14358        Point(crate::types::Point),
14359    }
14360    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
14361    #[serde(tag = "@type")]
14362    pub enum VectorPathCommand {
14363        /// A straight line to a given point
14364        #[serde(rename(serialize = "vectorPathCommandLine", deserialize = "vectorPathCommandLine"))]
14365        Line(crate::types::VectorPathCommandLine),
14366        /// A cubic Bézier curve to a given point
14367        #[serde(rename(serialize = "vectorPathCommandCubicBezierCurve", deserialize = "vectorPathCommandCubicBezierCurve"))]
14368        CubicBezierCurve(crate::types::VectorPathCommandCubicBezierCurve),
14369    }
14370    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
14371    #[serde(tag = "@type")]
14372    pub enum BotCommandScope {
14373        /// A scope covering all users
14374        #[serde(rename(serialize = "botCommandScopeDefault", deserialize = "botCommandScopeDefault"))]
14375        Default,
14376        /// A scope covering all private chats
14377        #[serde(rename(serialize = "botCommandScopeAllPrivateChats", deserialize = "botCommandScopeAllPrivateChats"))]
14378        AllPrivateChats,
14379        /// A scope covering all group and supergroup chats
14380        #[serde(rename(serialize = "botCommandScopeAllGroupChats", deserialize = "botCommandScopeAllGroupChats"))]
14381        AllGroupChats,
14382        /// A scope covering all group and supergroup chat administrators
14383        #[serde(rename(serialize = "botCommandScopeAllChatAdministrators", deserialize = "botCommandScopeAllChatAdministrators"))]
14384        AllChatAdministrators,
14385        /// A scope covering all members of a chat
14386        #[serde(rename(serialize = "botCommandScopeChat", deserialize = "botCommandScopeChat"))]
14387        Chat(crate::types::BotCommandScopeChat),
14388        /// A scope covering all administrators of a chat
14389        #[serde(rename(serialize = "botCommandScopeChatAdministrators", deserialize = "botCommandScopeChatAdministrators"))]
14390        ChatAdministrators(crate::types::BotCommandScopeChatAdministrators),
14391        /// A scope covering a member of a chat
14392        #[serde(rename(serialize = "botCommandScopeChatMember", deserialize = "botCommandScopeChatMember"))]
14393        ChatMember(crate::types::BotCommandScopeChatMember),
14394    }
14395    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
14396    #[serde(tag = "@type")]
14397    pub enum Update {
14398        /// The user authorization state has changed
14399        #[serde(rename(serialize = "updateAuthorizationState", deserialize = "updateAuthorizationState"))]
14400        AuthorizationState(crate::types::UpdateAuthorizationState),
14401        /// A new message was received; can also be an outgoing message
14402        #[serde(rename(serialize = "updateNewMessage", deserialize = "updateNewMessage"))]
14403        NewMessage(crate::types::UpdateNewMessage),
14404        /// A request to send a message has reached the Telegram server. This doesn't mean that the message will be sent successfully or even that the send message request will be processed.
14405        /// This update will be sent only if the option "use_quick_ack" is set to true. This update may be sent multiple times for the same message
14406        #[serde(rename(serialize = "updateMessageSendAcknowledged", deserialize = "updateMessageSendAcknowledged"))]
14407        MessageSendAcknowledged(crate::types::UpdateMessageSendAcknowledged),
14408        /// A message has been successfully sent
14409        #[serde(rename(serialize = "updateMessageSendSucceeded", deserialize = "updateMessageSendSucceeded"))]
14410        MessageSendSucceeded(crate::types::UpdateMessageSendSucceeded),
14411        /// A message failed to send. Be aware that some messages being sent can be irrecoverably deleted, in which case updateDeleteMessages will be received instead of this update
14412        #[serde(rename(serialize = "updateMessageSendFailed", deserialize = "updateMessageSendFailed"))]
14413        MessageSendFailed(crate::types::UpdateMessageSendFailed),
14414        /// The message content has changed
14415        #[serde(rename(serialize = "updateMessageContent", deserialize = "updateMessageContent"))]
14416        MessageContent(crate::types::UpdateMessageContent),
14417        /// A message was edited. Changes in the message content will come in a separate updateMessageContent
14418        #[serde(rename(serialize = "updateMessageEdited", deserialize = "updateMessageEdited"))]
14419        MessageEdited(crate::types::UpdateMessageEdited),
14420        /// The message pinned state was changed
14421        #[serde(rename(serialize = "updateMessageIsPinned", deserialize = "updateMessageIsPinned"))]
14422        MessageIsPinned(crate::types::UpdateMessageIsPinned),
14423        /// The information about interactions with a message has changed
14424        #[serde(rename(serialize = "updateMessageInteractionInfo", deserialize = "updateMessageInteractionInfo"))]
14425        MessageInteractionInfo(crate::types::UpdateMessageInteractionInfo),
14426        /// The message content was opened. Updates voice note messages to "listened", video note messages to "viewed" and starts the self-destruct timer
14427        #[serde(rename(serialize = "updateMessageContentOpened", deserialize = "updateMessageContentOpened"))]
14428        MessageContentOpened(crate::types::UpdateMessageContentOpened),
14429        /// A message with an unread mention was read
14430        #[serde(rename(serialize = "updateMessageMentionRead", deserialize = "updateMessageMentionRead"))]
14431        MessageMentionRead(crate::types::UpdateMessageMentionRead),
14432        /// The list of unread reactions added to a message was changed
14433        #[serde(rename(serialize = "updateMessageUnreadReactions", deserialize = "updateMessageUnreadReactions"))]
14434        MessageUnreadReactions(crate::types::UpdateMessageUnreadReactions),
14435        /// A message with a live location was viewed. When the update is received, the application is supposed to update the live location
14436        #[serde(rename(serialize = "updateMessageLiveLocationViewed", deserialize = "updateMessageLiveLocationViewed"))]
14437        MessageLiveLocationViewed(crate::types::UpdateMessageLiveLocationViewed),
14438        /// A new chat has been loaded/created. This update is guaranteed to come before the chat identifier is returned to the application. The chat field changes will be reported through separate updates
14439        #[serde(rename(serialize = "updateNewChat", deserialize = "updateNewChat"))]
14440        NewChat(crate::types::UpdateNewChat),
14441        /// The title of a chat was changed
14442        #[serde(rename(serialize = "updateChatTitle", deserialize = "updateChatTitle"))]
14443        ChatTitle(crate::types::UpdateChatTitle),
14444        /// A chat photo was changed
14445        #[serde(rename(serialize = "updateChatPhoto", deserialize = "updateChatPhoto"))]
14446        ChatPhoto(crate::types::UpdateChatPhoto),
14447        /// Chat permissions was changed
14448        #[serde(rename(serialize = "updateChatPermissions", deserialize = "updateChatPermissions"))]
14449        ChatPermissions(crate::types::UpdateChatPermissions),
14450        /// The last message of a chat was changed. If last_message is null, then the last message in the chat became unknown. Some new unknown messages might be added to the chat in this case
14451        #[serde(rename(serialize = "updateChatLastMessage", deserialize = "updateChatLastMessage"))]
14452        ChatLastMessage(crate::types::UpdateChatLastMessage),
14453        /// The position of a chat in a chat list has changed. An updateChatLastMessage or updateChatDraftMessage update might be sent instead of the update
14454        #[serde(rename(serialize = "updateChatPosition", deserialize = "updateChatPosition"))]
14455        ChatPosition(crate::types::UpdateChatPosition),
14456        /// Incoming messages were read or the number of unread messages has been changed
14457        #[serde(rename(serialize = "updateChatReadInbox", deserialize = "updateChatReadInbox"))]
14458        ChatReadInbox(crate::types::UpdateChatReadInbox),
14459        /// Outgoing messages were read
14460        #[serde(rename(serialize = "updateChatReadOutbox", deserialize = "updateChatReadOutbox"))]
14461        ChatReadOutbox(crate::types::UpdateChatReadOutbox),
14462        /// The chat action bar was changed
14463        #[serde(rename(serialize = "updateChatActionBar", deserialize = "updateChatActionBar"))]
14464        ChatActionBar(crate::types::UpdateChatActionBar),
14465        /// The chat available reactions were changed
14466        #[serde(rename(serialize = "updateChatAvailableReactions", deserialize = "updateChatAvailableReactions"))]
14467        ChatAvailableReactions(crate::types::UpdateChatAvailableReactions),
14468        /// A chat draft has changed. Be aware that the update may come in the currently opened chat but with old content of the draft. If the user has changed the content of the draft, this update mustn't be applied
14469        #[serde(rename(serialize = "updateChatDraftMessage", deserialize = "updateChatDraftMessage"))]
14470        ChatDraftMessage(crate::types::UpdateChatDraftMessage),
14471        /// The message sender that is selected to send messages in a chat has changed
14472        #[serde(rename(serialize = "updateChatMessageSender", deserialize = "updateChatMessageSender"))]
14473        ChatMessageSender(crate::types::UpdateChatMessageSender),
14474        /// The message auto-delete or self-destruct timer setting for a chat was changed
14475        #[serde(rename(serialize = "updateChatMessageAutoDeleteTime", deserialize = "updateChatMessageAutoDeleteTime"))]
14476        ChatMessageAutoDeleteTime(crate::types::UpdateChatMessageAutoDeleteTime),
14477        /// Notification settings for a chat were changed
14478        #[serde(rename(serialize = "updateChatNotificationSettings", deserialize = "updateChatNotificationSettings"))]
14479        ChatNotificationSettings(crate::types::UpdateChatNotificationSettings),
14480        /// The chat pending join requests were changed
14481        #[serde(rename(serialize = "updateChatPendingJoinRequests", deserialize = "updateChatPendingJoinRequests"))]
14482        ChatPendingJoinRequests(crate::types::UpdateChatPendingJoinRequests),
14483        /// The default chat reply markup was changed. Can occur because new messages with reply markup were received or because an old reply markup was hidden by the user
14484        #[serde(rename(serialize = "updateChatReplyMarkup", deserialize = "updateChatReplyMarkup"))]
14485        ChatReplyMarkup(crate::types::UpdateChatReplyMarkup),
14486        /// The chat background was changed
14487        #[serde(rename(serialize = "updateChatBackground", deserialize = "updateChatBackground"))]
14488        ChatBackground(crate::types::UpdateChatBackground),
14489        /// The chat theme was changed
14490        #[serde(rename(serialize = "updateChatTheme", deserialize = "updateChatTheme"))]
14491        ChatTheme(crate::types::UpdateChatTheme),
14492        /// The chat unread_mention_count has changed
14493        #[serde(rename(serialize = "updateChatUnreadMentionCount", deserialize = "updateChatUnreadMentionCount"))]
14494        ChatUnreadMentionCount(crate::types::UpdateChatUnreadMentionCount),
14495        /// The chat unread_reaction_count has changed
14496        #[serde(rename(serialize = "updateChatUnreadReactionCount", deserialize = "updateChatUnreadReactionCount"))]
14497        ChatUnreadReactionCount(crate::types::UpdateChatUnreadReactionCount),
14498        /// A chat video chat state has changed
14499        #[serde(rename(serialize = "updateChatVideoChat", deserialize = "updateChatVideoChat"))]
14500        ChatVideoChat(crate::types::UpdateChatVideoChat),
14501        /// The value of the default disable_notification parameter, used when a message is sent to the chat, was changed
14502        #[serde(rename(serialize = "updateChatDefaultDisableNotification", deserialize = "updateChatDefaultDisableNotification"))]
14503        ChatDefaultDisableNotification(crate::types::UpdateChatDefaultDisableNotification),
14504        /// A chat content was allowed or restricted for saving
14505        #[serde(rename(serialize = "updateChatHasProtectedContent", deserialize = "updateChatHasProtectedContent"))]
14506        ChatHasProtectedContent(crate::types::UpdateChatHasProtectedContent),
14507        /// Translation of chat messages was enabled or disabled
14508        #[serde(rename(serialize = "updateChatIsTranslatable", deserialize = "updateChatIsTranslatable"))]
14509        ChatIsTranslatable(crate::types::UpdateChatIsTranslatable),
14510        /// A chat was marked as unread or was read
14511        #[serde(rename(serialize = "updateChatIsMarkedAsUnread", deserialize = "updateChatIsMarkedAsUnread"))]
14512        ChatIsMarkedAsUnread(crate::types::UpdateChatIsMarkedAsUnread),
14513        /// A chat was blocked or unblocked
14514        #[serde(rename(serialize = "updateChatBlockList", deserialize = "updateChatBlockList"))]
14515        ChatBlockList(crate::types::UpdateChatBlockList),
14516        /// A chat's has_scheduled_messages field has changed
14517        #[serde(rename(serialize = "updateChatHasScheduledMessages", deserialize = "updateChatHasScheduledMessages"))]
14518        ChatHasScheduledMessages(crate::types::UpdateChatHasScheduledMessages),
14519        /// The list of chat folders or a chat folder has changed
14520        #[serde(rename(serialize = "updateChatFolders", deserialize = "updateChatFolders"))]
14521        ChatFolders(crate::types::UpdateChatFolders),
14522        /// The number of online group members has changed. This update with non-zero number of online group members is sent only for currently opened chats.
14523        /// There is no guarantee that it will be sent just after the number of online users has changed
14524        #[serde(rename(serialize = "updateChatOnlineMemberCount", deserialize = "updateChatOnlineMemberCount"))]
14525        ChatOnlineMemberCount(crate::types::UpdateChatOnlineMemberCount),
14526        /// Basic information about a topic in a forum chat was changed
14527        #[serde(rename(serialize = "updateForumTopicInfo", deserialize = "updateForumTopicInfo"))]
14528        ForumTopicInfo(crate::types::UpdateForumTopicInfo),
14529        /// Notification settings for some type of chats were updated
14530        #[serde(rename(serialize = "updateScopeNotificationSettings", deserialize = "updateScopeNotificationSettings"))]
14531        ScopeNotificationSettings(crate::types::UpdateScopeNotificationSettings),
14532        /// A notification was changed
14533        #[serde(rename(serialize = "updateNotification", deserialize = "updateNotification"))]
14534        Notification(crate::types::UpdateNotification),
14535        /// A list of active notifications in a notification group has changed
14536        #[serde(rename(serialize = "updateNotificationGroup", deserialize = "updateNotificationGroup"))]
14537        NotificationGroup(crate::types::UpdateNotificationGroup),
14538        /// Contains active notifications that was shown on previous application launches. This update is sent only if the message database is used. In that case it comes once before any updateNotification and updateNotificationGroup update
14539        #[serde(rename(serialize = "updateActiveNotifications", deserialize = "updateActiveNotifications"))]
14540        ActiveNotifications(crate::types::UpdateActiveNotifications),
14541        /// Describes whether there are some pending notification updates. Can be used to prevent application from killing, while there are some pending notifications
14542        #[serde(rename(serialize = "updateHavePendingNotifications", deserialize = "updateHavePendingNotifications"))]
14543        HavePendingNotifications(crate::types::UpdateHavePendingNotifications),
14544        /// Some messages were deleted
14545        #[serde(rename(serialize = "updateDeleteMessages", deserialize = "updateDeleteMessages"))]
14546        DeleteMessages(crate::types::UpdateDeleteMessages),
14547        /// A message sender activity in the chat has changed
14548        #[serde(rename(serialize = "updateChatAction", deserialize = "updateChatAction"))]
14549        ChatAction(crate::types::UpdateChatAction),
14550        /// The user went online or offline
14551        #[serde(rename(serialize = "updateUserStatus", deserialize = "updateUserStatus"))]
14552        UserStatus(crate::types::UpdateUserStatus),
14553        /// Some data of a user has changed. This update is guaranteed to come before the user identifier is returned to the application
14554        #[serde(rename(serialize = "updateUser", deserialize = "updateUser"))]
14555        User(crate::types::UpdateUser),
14556        /// Some data of a basic group has changed. This update is guaranteed to come before the basic group identifier is returned to the application
14557        #[serde(rename(serialize = "updateBasicGroup", deserialize = "updateBasicGroup"))]
14558        BasicGroup(crate::types::UpdateBasicGroup),
14559        /// Some data of a supergroup or a channel has changed. This update is guaranteed to come before the supergroup identifier is returned to the application
14560        #[serde(rename(serialize = "updateSupergroup", deserialize = "updateSupergroup"))]
14561        Supergroup(crate::types::UpdateSupergroup),
14562        /// Some data of a secret chat has changed. This update is guaranteed to come before the secret chat identifier is returned to the application
14563        #[serde(rename(serialize = "updateSecretChat", deserialize = "updateSecretChat"))]
14564        SecretChat(crate::types::UpdateSecretChat),
14565        /// Some data in userFullInfo has been changed
14566        #[serde(rename(serialize = "updateUserFullInfo", deserialize = "updateUserFullInfo"))]
14567        UserFullInfo(crate::types::UpdateUserFullInfo),
14568        /// Some data in basicGroupFullInfo has been changed
14569        #[serde(rename(serialize = "updateBasicGroupFullInfo", deserialize = "updateBasicGroupFullInfo"))]
14570        BasicGroupFullInfo(crate::types::UpdateBasicGroupFullInfo),
14571        /// Some data in supergroupFullInfo has been changed
14572        #[serde(rename(serialize = "updateSupergroupFullInfo", deserialize = "updateSupergroupFullInfo"))]
14573        SupergroupFullInfo(crate::types::UpdateSupergroupFullInfo),
14574        /// A service notification from the server was received. Upon receiving this the application must show a popup with the content of the notification
14575        #[serde(rename(serialize = "updateServiceNotification", deserialize = "updateServiceNotification"))]
14576        ServiceNotification(crate::types::UpdateServiceNotification),
14577        /// Information about a file was updated
14578        #[serde(rename(serialize = "updateFile", deserialize = "updateFile"))]
14579        File(crate::types::UpdateFile),
14580        /// The file generation process needs to be started by the application
14581        #[serde(rename(serialize = "updateFileGenerationStart", deserialize = "updateFileGenerationStart"))]
14582        FileGenerationStart(crate::types::UpdateFileGenerationStart),
14583        /// File generation is no longer needed
14584        #[serde(rename(serialize = "updateFileGenerationStop", deserialize = "updateFileGenerationStop"))]
14585        FileGenerationStop(crate::types::UpdateFileGenerationStop),
14586        /// The state of the file download list has changed
14587        #[serde(rename(serialize = "updateFileDownloads", deserialize = "updateFileDownloads"))]
14588        FileDownloads(crate::types::UpdateFileDownloads),
14589        /// A file was added to the file download list. This update is sent only after file download list is loaded for the first time
14590        #[serde(rename(serialize = "updateFileAddedToDownloads", deserialize = "updateFileAddedToDownloads"))]
14591        FileAddedToDownloads(crate::types::UpdateFileAddedToDownloads),
14592        /// A file download was changed. This update is sent only after file download list is loaded for the first time
14593        #[serde(rename(serialize = "updateFileDownload", deserialize = "updateFileDownload"))]
14594        FileDownload(crate::types::UpdateFileDownload),
14595        /// A file was removed from the file download list. This update is sent only after file download list is loaded for the first time
14596        #[serde(rename(serialize = "updateFileRemovedFromDownloads", deserialize = "updateFileRemovedFromDownloads"))]
14597        FileRemovedFromDownloads(crate::types::UpdateFileRemovedFromDownloads),
14598        /// New call was created or information about a call was updated
14599        #[serde(rename(serialize = "updateCall", deserialize = "updateCall"))]
14600        Call(crate::types::UpdateCall),
14601        /// Information about a group call was updated
14602        #[serde(rename(serialize = "updateGroupCall", deserialize = "updateGroupCall"))]
14603        GroupCall(crate::types::UpdateGroupCall),
14604        /// Information about a group call participant was changed. The updates are sent only after the group call is received through getGroupCall and only if the call is joined or being joined
14605        #[serde(rename(serialize = "updateGroupCallParticipant", deserialize = "updateGroupCallParticipant"))]
14606        GroupCallParticipant(crate::types::UpdateGroupCallParticipant),
14607        /// New call signaling data arrived
14608        #[serde(rename(serialize = "updateNewCallSignalingData", deserialize = "updateNewCallSignalingData"))]
14609        NewCallSignalingData(crate::types::UpdateNewCallSignalingData),
14610        /// Some privacy setting rules have been changed
14611        #[serde(rename(serialize = "updateUserPrivacySettingRules", deserialize = "updateUserPrivacySettingRules"))]
14612        UserPrivacySettingRules(crate::types::UpdateUserPrivacySettingRules),
14613        /// Number of unread messages in a chat list has changed. This update is sent only if the message database is used
14614        #[serde(rename(serialize = "updateUnreadMessageCount", deserialize = "updateUnreadMessageCount"))]
14615        UnreadMessageCount(crate::types::UpdateUnreadMessageCount),
14616        /// Number of unread chats, i.e. with unread messages or marked as unread, has changed. This update is sent only if the message database is used
14617        #[serde(rename(serialize = "updateUnreadChatCount", deserialize = "updateUnreadChatCount"))]
14618        UnreadChatCount(crate::types::UpdateUnreadChatCount),
14619        /// A story was changed
14620        #[serde(rename(serialize = "updateStory", deserialize = "updateStory"))]
14621        Story(crate::types::UpdateStory),
14622        /// A story became inaccessible
14623        #[serde(rename(serialize = "updateStoryDeleted", deserialize = "updateStoryDeleted"))]
14624        StoryDeleted(crate::types::UpdateStoryDeleted),
14625        /// A story has been successfully sent
14626        #[serde(rename(serialize = "updateStorySendSucceeded", deserialize = "updateStorySendSucceeded"))]
14627        StorySendSucceeded(crate::types::UpdateStorySendSucceeded),
14628        /// A story failed to send. If the story sending is canceled, then updateStoryDeleted will be received instead of this update
14629        #[serde(rename(serialize = "updateStorySendFailed", deserialize = "updateStorySendFailed"))]
14630        StorySendFailed(crate::types::UpdateStorySendFailed),
14631        /// The list of active stories posted by a specific chat has changed
14632        #[serde(rename(serialize = "updateChatActiveStories", deserialize = "updateChatActiveStories"))]
14633        ChatActiveStories(crate::types::UpdateChatActiveStories),
14634        /// Number of chats in a story list has changed
14635        #[serde(rename(serialize = "updateStoryListChatCount", deserialize = "updateStoryListChatCount"))]
14636        StoryListChatCount(crate::types::UpdateStoryListChatCount),
14637        /// Story stealth mode settings have changed
14638        #[serde(rename(serialize = "updateStoryStealthMode", deserialize = "updateStoryStealthMode"))]
14639        StoryStealthMode(crate::types::UpdateStoryStealthMode),
14640        /// An option changed its value
14641        #[serde(rename(serialize = "updateOption", deserialize = "updateOption"))]
14642        Option(crate::types::UpdateOption),
14643        /// A sticker set has changed
14644        #[serde(rename(serialize = "updateStickerSet", deserialize = "updateStickerSet"))]
14645        StickerSet(crate::types::UpdateStickerSet),
14646        /// The list of installed sticker sets was updated
14647        #[serde(rename(serialize = "updateInstalledStickerSets", deserialize = "updateInstalledStickerSets"))]
14648        InstalledStickerSets(crate::types::UpdateInstalledStickerSets),
14649        /// The list of trending sticker sets was updated or some of them were viewed
14650        #[serde(rename(serialize = "updateTrendingStickerSets", deserialize = "updateTrendingStickerSets"))]
14651        TrendingStickerSets(crate::types::UpdateTrendingStickerSets),
14652        /// The list of recently used stickers was updated
14653        #[serde(rename(serialize = "updateRecentStickers", deserialize = "updateRecentStickers"))]
14654        RecentStickers(crate::types::UpdateRecentStickers),
14655        /// The list of favorite stickers was updated
14656        #[serde(rename(serialize = "updateFavoriteStickers", deserialize = "updateFavoriteStickers"))]
14657        FavoriteStickers(crate::types::UpdateFavoriteStickers),
14658        /// The list of saved animations was updated
14659        #[serde(rename(serialize = "updateSavedAnimations", deserialize = "updateSavedAnimations"))]
14660        SavedAnimations(crate::types::UpdateSavedAnimations),
14661        /// The list of saved notifications sounds was updated. This update may not be sent until information about a notification sound was requested for the first time
14662        #[serde(rename(serialize = "updateSavedNotificationSounds", deserialize = "updateSavedNotificationSounds"))]
14663        SavedNotificationSounds(crate::types::UpdateSavedNotificationSounds),
14664        /// The selected background has changed
14665        #[serde(rename(serialize = "updateSelectedBackground", deserialize = "updateSelectedBackground"))]
14666        SelectedBackground(crate::types::UpdateSelectedBackground),
14667        /// The list of available chat themes has changed
14668        #[serde(rename(serialize = "updateChatThemes", deserialize = "updateChatThemes"))]
14669        ChatThemes(crate::types::UpdateChatThemes),
14670        /// Some language pack strings have been updated
14671        #[serde(rename(serialize = "updateLanguagePackStrings", deserialize = "updateLanguagePackStrings"))]
14672        LanguagePackStrings(crate::types::UpdateLanguagePackStrings),
14673        /// The connection state has changed. This update must be used only to show a human-readable description of the connection state
14674        #[serde(rename(serialize = "updateConnectionState", deserialize = "updateConnectionState"))]
14675        ConnectionState(crate::types::UpdateConnectionState),
14676        /// New terms of service must be accepted by the user. If the terms of service are declined, then the deleteAccount method must be called with the reason "Decline ToS update"
14677        #[serde(rename(serialize = "updateTermsOfService", deserialize = "updateTermsOfService"))]
14678        TermsOfService(crate::types::UpdateTermsOfService),
14679        /// The list of users nearby has changed. The update is guaranteed to be sent only 60 seconds after a successful searchChatsNearby request
14680        #[serde(rename(serialize = "updateUsersNearby", deserialize = "updateUsersNearby"))]
14681        UsersNearby(crate::types::UpdateUsersNearby),
14682        /// The first unconfirmed session has changed
14683        #[serde(rename(serialize = "updateUnconfirmedSession", deserialize = "updateUnconfirmedSession"))]
14684        UnconfirmedSession(crate::types::UpdateUnconfirmedSession),
14685        /// The list of bots added to attachment or side menu has changed
14686        #[serde(rename(serialize = "updateAttachmentMenuBots", deserialize = "updateAttachmentMenuBots"))]
14687        AttachmentMenuBots(crate::types::UpdateAttachmentMenuBots),
14688        /// A message was sent by an opened Web App, so the Web App needs to be closed
14689        #[serde(rename(serialize = "updateWebAppMessageSent", deserialize = "updateWebAppMessageSent"))]
14690        WebAppMessageSent(crate::types::UpdateWebAppMessageSent),
14691        /// The list of active emoji reactions has changed
14692        #[serde(rename(serialize = "updateActiveEmojiReactions", deserialize = "updateActiveEmojiReactions"))]
14693        ActiveEmojiReactions(crate::types::UpdateActiveEmojiReactions),
14694        /// The type of default reaction has changed
14695        #[serde(rename(serialize = "updateDefaultReactionType", deserialize = "updateDefaultReactionType"))]
14696        DefaultReactionType(crate::types::UpdateDefaultReactionType),
14697        /// The list of supported dice emojis has changed
14698        #[serde(rename(serialize = "updateDiceEmojis", deserialize = "updateDiceEmojis"))]
14699        DiceEmojis(crate::types::UpdateDiceEmojis),
14700        /// Some animated emoji message was clicked and a big animated sticker must be played if the message is visible on the screen. chatActionWatchingAnimations with the text of the message needs to be sent if the sticker is played
14701        #[serde(rename(serialize = "updateAnimatedEmojiMessageClicked", deserialize = "updateAnimatedEmojiMessageClicked"))]
14702        AnimatedEmojiMessageClicked(crate::types::UpdateAnimatedEmojiMessageClicked),
14703        /// The parameters of animation search through getOption("animation_search_bot_username") bot has changed
14704        #[serde(rename(serialize = "updateAnimationSearchParameters", deserialize = "updateAnimationSearchParameters"))]
14705        AnimationSearchParameters(crate::types::UpdateAnimationSearchParameters),
14706        /// The list of suggested to the user actions has changed
14707        #[serde(rename(serialize = "updateSuggestedActions", deserialize = "updateSuggestedActions"))]
14708        SuggestedActions(crate::types::UpdateSuggestedActions),
14709        /// Adding users to a chat has failed because of their privacy settings. An invite link can be shared with the users if appropriate
14710        #[serde(rename(serialize = "updateAddChatMembersPrivacyForbidden", deserialize = "updateAddChatMembersPrivacyForbidden"))]
14711        AddChatMembersPrivacyForbidden(crate::types::UpdateAddChatMembersPrivacyForbidden),
14712        /// Autosave settings for some type of chats were updated
14713        #[serde(rename(serialize = "updateAutosaveSettings", deserialize = "updateAutosaveSettings"))]
14714        AutosaveSettings(crate::types::UpdateAutosaveSettings),
14715        /// A new incoming inline query; for bots only
14716        #[serde(rename(serialize = "updateNewInlineQuery", deserialize = "updateNewInlineQuery"))]
14717        NewInlineQuery(crate::types::UpdateNewInlineQuery),
14718        /// The user has chosen a result of an inline query; for bots only
14719        #[serde(rename(serialize = "updateNewChosenInlineResult", deserialize = "updateNewChosenInlineResult"))]
14720        NewChosenInlineResult(crate::types::UpdateNewChosenInlineResult),
14721        /// A new incoming callback query; for bots only
14722        #[serde(rename(serialize = "updateNewCallbackQuery", deserialize = "updateNewCallbackQuery"))]
14723        NewCallbackQuery(crate::types::UpdateNewCallbackQuery),
14724        /// A new incoming callback query from a message sent via a bot; for bots only
14725        #[serde(rename(serialize = "updateNewInlineCallbackQuery", deserialize = "updateNewInlineCallbackQuery"))]
14726        NewInlineCallbackQuery(crate::types::UpdateNewInlineCallbackQuery),
14727        /// A new incoming shipping query; for bots only. Only for invoices with flexible price
14728        #[serde(rename(serialize = "updateNewShippingQuery", deserialize = "updateNewShippingQuery"))]
14729        NewShippingQuery(crate::types::UpdateNewShippingQuery),
14730        /// A new incoming pre-checkout query; for bots only. Contains full information about a checkout
14731        #[serde(rename(serialize = "updateNewPreCheckoutQuery", deserialize = "updateNewPreCheckoutQuery"))]
14732        NewPreCheckoutQuery(crate::types::UpdateNewPreCheckoutQuery),
14733        /// A new incoming event; for bots only
14734        #[serde(rename(serialize = "updateNewCustomEvent", deserialize = "updateNewCustomEvent"))]
14735        NewCustomEvent(crate::types::UpdateNewCustomEvent),
14736        /// A new incoming query; for bots only
14737        #[serde(rename(serialize = "updateNewCustomQuery", deserialize = "updateNewCustomQuery"))]
14738        NewCustomQuery(crate::types::UpdateNewCustomQuery),
14739        /// A poll was updated; for bots only
14740        #[serde(rename(serialize = "updatePoll", deserialize = "updatePoll"))]
14741        Poll(crate::types::UpdatePoll),
14742        /// A user changed the answer to a poll; for bots only
14743        #[serde(rename(serialize = "updatePollAnswer", deserialize = "updatePollAnswer"))]
14744        PollAnswer(crate::types::UpdatePollAnswer),
14745        /// User rights changed in a chat; for bots only
14746        #[serde(rename(serialize = "updateChatMember", deserialize = "updateChatMember"))]
14747        ChatMember(crate::types::UpdateChatMember),
14748        /// A user sent a join request to a chat; for bots only
14749        #[serde(rename(serialize = "updateNewChatJoinRequest", deserialize = "updateNewChatJoinRequest"))]
14750        NewChatJoinRequest(crate::types::UpdateNewChatJoinRequest),
14751    }
14752    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
14753    #[serde(tag = "@type")]
14754    pub enum Updates {
14755        /// Contains a list of updates
14756        #[serde(rename(serialize = "updates", deserialize = "updates"))]
14757        Updates(crate::types::Updates),
14758    }
14759    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
14760    #[serde(tag = "@type")]
14761    pub enum LogStream {
14762        /// The log is written to stderr or an OS specific log
14763        #[serde(rename(serialize = "logStreamDefault", deserialize = "logStreamDefault"))]
14764        Default,
14765        /// The log is written to a file
14766        #[serde(rename(serialize = "logStreamFile", deserialize = "logStreamFile"))]
14767        File(crate::types::LogStreamFile),
14768        /// The log is written nowhere
14769        #[serde(rename(serialize = "logStreamEmpty", deserialize = "logStreamEmpty"))]
14770        Empty,
14771    }
14772    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
14773    #[serde(tag = "@type")]
14774    pub enum LogVerbosityLevel {
14775        /// Contains a TDLib internal log verbosity level
14776        #[serde(rename(serialize = "logVerbosityLevel", deserialize = "logVerbosityLevel"))]
14777        LogVerbosityLevel(crate::types::LogVerbosityLevel),
14778    }
14779    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
14780    #[serde(tag = "@type")]
14781    pub enum LogTags {
14782        /// Contains a list of available TDLib internal log tags
14783        #[serde(rename(serialize = "logTags", deserialize = "logTags"))]
14784        LogTags(crate::types::LogTags),
14785    }
14786    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
14787    #[serde(tag = "@type")]
14788    pub enum UserSupportInfo {
14789        /// Contains custom information about the user
14790        #[serde(rename(serialize = "userSupportInfo", deserialize = "userSupportInfo"))]
14791        UserSupportInfo(crate::types::UserSupportInfo),
14792    }
14793    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
14794    #[serde(tag = "@type")]
14795    pub enum TestInt {
14796        /// A simple object containing a number; for testing only
14797        #[serde(rename(serialize = "testInt", deserialize = "testInt"))]
14798        TestInt(crate::types::TestInt),
14799    }
14800    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
14801    #[serde(tag = "@type")]
14802    pub enum TestString {
14803        /// A simple object containing a string; for testing only
14804        #[serde(rename(serialize = "testString", deserialize = "testString"))]
14805        TestString(crate::types::TestString),
14806    }
14807    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
14808    #[serde(tag = "@type")]
14809    pub enum TestBytes {
14810        /// A simple object containing a sequence of bytes; for testing only
14811        #[serde(rename(serialize = "testBytes", deserialize = "testBytes"))]
14812        TestBytes(crate::types::TestBytes),
14813    }
14814    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
14815    #[serde(tag = "@type")]
14816    pub enum TestVectorInt {
14817        /// A simple object containing a vector of numbers; for testing only
14818        #[serde(rename(serialize = "testVectorInt", deserialize = "testVectorInt"))]
14819        TestVectorInt(crate::types::TestVectorInt),
14820    }
14821    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
14822    #[serde(tag = "@type")]
14823    pub enum TestVectorIntObject {
14824        /// A simple object containing a vector of objects that hold a number; for testing only
14825        #[serde(rename(serialize = "testVectorIntObject", deserialize = "testVectorIntObject"))]
14826        TestVectorIntObject(crate::types::TestVectorIntObject),
14827    }
14828    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
14829    #[serde(tag = "@type")]
14830    pub enum TestVectorString {
14831        /// A simple object containing a vector of strings; for testing only
14832        #[serde(rename(serialize = "testVectorString", deserialize = "testVectorString"))]
14833        TestVectorString(crate::types::TestVectorString),
14834    }
14835    #[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
14836    #[serde(tag = "@type")]
14837    pub enum TestVectorStringObject {
14838        /// A simple object containing a vector of objects that hold a string; for testing only
14839        #[serde(rename(serialize = "testVectorStringObject", deserialize = "testVectorStringObject"))]
14840        TestVectorStringObject(crate::types::TestVectorStringObject),
14841    }
14842}
14843pub mod functions {
14844    use serde_json::json;
14845    use crate::send_request;
14846    /// Returns the current authorization state; this is an offline request. For informational purposes only. Use updateAuthorizationState instead to maintain the current authorization state. Can be called before initialization
14847    /// # Arguments
14848    /// * `client_id` - The client id to send the request to
14849    #[allow(clippy::too_many_arguments)]
14850    pub async fn get_authorization_state(client_id: i32) -> Result<crate::enums::AuthorizationState, crate::types::Error> {
14851        let request = json!({
14852            "@type": "getAuthorizationState",
14853        });
14854        let response = send_request(client_id, request).await;
14855        if response["@type"] == "error" {
14856            return Err(serde_json::from_value(response).unwrap())
14857        }
14858        Ok(serde_json::from_value(response).unwrap())
14859    }
14860    /// Sets the parameters for TDLib initialization. Works only when the current authorization state is authorizationStateWaitTdlibParameters
14861    /// # Arguments
14862    /// * `use_test_dc` - Pass true to use Telegram test environment instead of the production environment
14863    /// * `database_directory` - The path to the directory for the persistent database; if empty, the current working directory will be used
14864    /// * `files_directory` - The path to the directory for storing files; if empty, database_directory will be used
14865    /// * `database_encryption_key` - Encryption key for the database. If the encryption key is invalid, then an error with code 401 will be returned
14866    /// * `use_file_database` - Pass true to keep information about downloaded and uploaded files between application restarts
14867    /// * `use_chat_info_database` - Pass true to keep cache of users, basic groups, supergroups, channels and secret chats between restarts. Implies use_file_database
14868    /// * `use_message_database` - Pass true to keep cache of chats and messages between restarts. Implies use_chat_info_database
14869    /// * `use_secret_chats` - Pass true to enable support for secret chats
14870    /// * `api_id` - Application identifier for Telegram API access, which can be obtained at https:my.telegram.org
14871    /// * `api_hash` - Application identifier hash for Telegram API access, which can be obtained at https:my.telegram.org
14872    /// * `system_language_code` - IETF language tag of the user's operating system language; must be non-empty
14873    /// * `device_model` - Model of the device the application is being run on; must be non-empty
14874    /// * `system_version` - Version of the operating system the application is being run on. If empty, the version is automatically detected by TDLib
14875    /// * `application_version` - Application version; must be non-empty
14876    /// * `enable_storage_optimizer` - Pass true to automatically delete old files in background
14877    /// * `ignore_file_names` - Pass true to ignore original file names for downloaded files. Otherwise, downloaded files are saved under names as close as possible to the original name
14878    /// * `client_id` - The client id to send the request to
14879    #[allow(clippy::too_many_arguments)]
14880    pub async fn set_tdlib_parameters(use_test_dc: bool, database_directory: String, files_directory: String, database_encryption_key: String, use_file_database: bool, use_chat_info_database: bool, use_message_database: bool, use_secret_chats: bool, api_id: i32, api_hash: String, system_language_code: String, device_model: String, system_version: String, application_version: String, enable_storage_optimizer: bool, ignore_file_names: bool, client_id: i32) -> Result<(), crate::types::Error> {
14881        let request = json!({
14882            "@type": "setTdlibParameters",
14883            "use_test_dc": use_test_dc,
14884            "database_directory": database_directory,
14885            "files_directory": files_directory,
14886            "database_encryption_key": database_encryption_key,
14887            "use_file_database": use_file_database,
14888            "use_chat_info_database": use_chat_info_database,
14889            "use_message_database": use_message_database,
14890            "use_secret_chats": use_secret_chats,
14891            "api_id": api_id,
14892            "api_hash": api_hash,
14893            "system_language_code": system_language_code,
14894            "device_model": device_model,
14895            "system_version": system_version,
14896            "application_version": application_version,
14897            "enable_storage_optimizer": enable_storage_optimizer,
14898            "ignore_file_names": ignore_file_names,
14899        });
14900        let response = send_request(client_id, request).await;
14901        if response["@type"] == "error" {
14902            return Err(serde_json::from_value(response).unwrap())
14903        }
14904        Ok(())
14905    }
14906    /// Sets the phone number of the user and sends an authentication code to the user. Works only when the current authorization state is authorizationStateWaitPhoneNumber,
14907    /// or if there is no pending authentication query and the current authorization state is authorizationStateWaitEmailAddress, authorizationStateWaitEmailCode, authorizationStateWaitCode, authorizationStateWaitRegistration, or authorizationStateWaitPassword
14908    /// # Arguments
14909    /// * `phone_number` - The phone number of the user, in international format
14910    /// * `settings` - Settings for the authentication of the user's phone number; pass null to use default settings
14911    /// * `client_id` - The client id to send the request to
14912    #[allow(clippy::too_many_arguments)]
14913    pub async fn set_authentication_phone_number(phone_number: String, settings: Option<crate::types::PhoneNumberAuthenticationSettings>, client_id: i32) -> Result<(), crate::types::Error> {
14914        let request = json!({
14915            "@type": "setAuthenticationPhoneNumber",
14916            "phone_number": phone_number,
14917            "settings": settings,
14918        });
14919        let response = send_request(client_id, request).await;
14920        if response["@type"] == "error" {
14921            return Err(serde_json::from_value(response).unwrap())
14922        }
14923        Ok(())
14924    }
14925    /// Sets the email address of the user and sends an authentication code to the email address. Works only when the current authorization state is authorizationStateWaitEmailAddress
14926    /// # Arguments
14927    /// * `email_address` - The email address of the user
14928    /// * `client_id` - The client id to send the request to
14929    #[allow(clippy::too_many_arguments)]
14930    pub async fn set_authentication_email_address(email_address: String, client_id: i32) -> Result<(), crate::types::Error> {
14931        let request = json!({
14932            "@type": "setAuthenticationEmailAddress",
14933            "email_address": email_address,
14934        });
14935        let response = send_request(client_id, request).await;
14936        if response["@type"] == "error" {
14937            return Err(serde_json::from_value(response).unwrap())
14938        }
14939        Ok(())
14940    }
14941    /// Resends an authentication code to the user. Works only when the current authorization state is authorizationStateWaitCode, the next_code_type of the result is not null and the server-specified timeout has passed,
14942    /// or when the current authorization state is authorizationStateWaitEmailCode
14943    /// # Arguments
14944    /// * `client_id` - The client id to send the request to
14945    #[allow(clippy::too_many_arguments)]
14946    pub async fn resend_authentication_code(client_id: i32) -> Result<(), crate::types::Error> {
14947        let request = json!({
14948            "@type": "resendAuthenticationCode",
14949        });
14950        let response = send_request(client_id, request).await;
14951        if response["@type"] == "error" {
14952            return Err(serde_json::from_value(response).unwrap())
14953        }
14954        Ok(())
14955    }
14956    /// Checks the authentication of a email address. Works only when the current authorization state is authorizationStateWaitEmailCode
14957    /// # Arguments
14958    /// * `code` - Email address authentication to check
14959    /// * `client_id` - The client id to send the request to
14960    #[allow(clippy::too_many_arguments)]
14961    pub async fn check_authentication_email_code(code: crate::enums::EmailAddressAuthentication, client_id: i32) -> Result<(), crate::types::Error> {
14962        let request = json!({
14963            "@type": "checkAuthenticationEmailCode",
14964            "code": code,
14965        });
14966        let response = send_request(client_id, request).await;
14967        if response["@type"] == "error" {
14968            return Err(serde_json::from_value(response).unwrap())
14969        }
14970        Ok(())
14971    }
14972    /// Checks the authentication code. Works only when the current authorization state is authorizationStateWaitCode
14973    /// # Arguments
14974    /// * `code` - Authentication code to check
14975    /// * `client_id` - The client id to send the request to
14976    #[allow(clippy::too_many_arguments)]
14977    pub async fn check_authentication_code(code: String, client_id: i32) -> Result<(), crate::types::Error> {
14978        let request = json!({
14979            "@type": "checkAuthenticationCode",
14980            "code": code,
14981        });
14982        let response = send_request(client_id, request).await;
14983        if response["@type"] == "error" {
14984            return Err(serde_json::from_value(response).unwrap())
14985        }
14986        Ok(())
14987    }
14988    /// Requests QR code authentication by scanning a QR code on another logged in device. Works only when the current authorization state is authorizationStateWaitPhoneNumber,
14989    /// or if there is no pending authentication query and the current authorization state is authorizationStateWaitEmailAddress, authorizationStateWaitEmailCode, authorizationStateWaitCode, authorizationStateWaitRegistration, or authorizationStateWaitPassword
14990    /// # Arguments
14991    /// * `other_user_ids` - List of user identifiers of other users currently using the application
14992    /// * `client_id` - The client id to send the request to
14993    #[allow(clippy::too_many_arguments)]
14994    pub async fn request_qr_code_authentication(other_user_ids: Vec<i64>, client_id: i32) -> Result<(), crate::types::Error> {
14995        let request = json!({
14996            "@type": "requestQrCodeAuthentication",
14997            "other_user_ids": other_user_ids,
14998        });
14999        let response = send_request(client_id, request).await;
15000        if response["@type"] == "error" {
15001            return Err(serde_json::from_value(response).unwrap())
15002        }
15003        Ok(())
15004    }
15005    /// Finishes user registration. Works only when the current authorization state is authorizationStateWaitRegistration
15006    /// # Arguments
15007    /// * `first_name` - The first name of the user; 1-64 characters
15008    /// * `last_name` - The last name of the user; 0-64 characters
15009    /// * `client_id` - The client id to send the request to
15010    #[allow(clippy::too_many_arguments)]
15011    pub async fn register_user(first_name: String, last_name: String, client_id: i32) -> Result<(), crate::types::Error> {
15012        let request = json!({
15013            "@type": "registerUser",
15014            "first_name": first_name,
15015            "last_name": last_name,
15016        });
15017        let response = send_request(client_id, request).await;
15018        if response["@type"] == "error" {
15019            return Err(serde_json::from_value(response).unwrap())
15020        }
15021        Ok(())
15022    }
15023    /// Resets the login email address. May return an error with a message "TASK_ALREADY_EXISTS" if reset is still pending.
15024    /// Works only when the current authorization state is authorizationStateWaitEmailCode and authorization_state.can_reset_email_address == true
15025    /// # Arguments
15026    /// * `client_id` - The client id to send the request to
15027    #[allow(clippy::too_many_arguments)]
15028    pub async fn reset_authentication_email_address(client_id: i32) -> Result<(), crate::types::Error> {
15029        let request = json!({
15030            "@type": "resetAuthenticationEmailAddress",
15031        });
15032        let response = send_request(client_id, request).await;
15033        if response["@type"] == "error" {
15034            return Err(serde_json::from_value(response).unwrap())
15035        }
15036        Ok(())
15037    }
15038    /// Checks the 2-step verification password for correctness. Works only when the current authorization state is authorizationStateWaitPassword
15039    /// # Arguments
15040    /// * `password` - The 2-step verification password to check
15041    /// * `client_id` - The client id to send the request to
15042    #[allow(clippy::too_many_arguments)]
15043    pub async fn check_authentication_password(password: String, client_id: i32) -> Result<(), crate::types::Error> {
15044        let request = json!({
15045            "@type": "checkAuthenticationPassword",
15046            "password": password,
15047        });
15048        let response = send_request(client_id, request).await;
15049        if response["@type"] == "error" {
15050            return Err(serde_json::from_value(response).unwrap())
15051        }
15052        Ok(())
15053    }
15054    /// Requests to send a 2-step verification password recovery code to an email address that was previously set up. Works only when the current authorization state is authorizationStateWaitPassword
15055    /// # Arguments
15056    /// * `client_id` - The client id to send the request to
15057    #[allow(clippy::too_many_arguments)]
15058    pub async fn request_authentication_password_recovery(client_id: i32) -> Result<(), crate::types::Error> {
15059        let request = json!({
15060            "@type": "requestAuthenticationPasswordRecovery",
15061        });
15062        let response = send_request(client_id, request).await;
15063        if response["@type"] == "error" {
15064            return Err(serde_json::from_value(response).unwrap())
15065        }
15066        Ok(())
15067    }
15068    /// Checks whether a 2-step verification password recovery code sent to an email address is valid. Works only when the current authorization state is authorizationStateWaitPassword
15069    /// # Arguments
15070    /// * `recovery_code` - Recovery code to check
15071    /// * `client_id` - The client id to send the request to
15072    #[allow(clippy::too_many_arguments)]
15073    pub async fn check_authentication_password_recovery_code(recovery_code: String, client_id: i32) -> Result<(), crate::types::Error> {
15074        let request = json!({
15075            "@type": "checkAuthenticationPasswordRecoveryCode",
15076            "recovery_code": recovery_code,
15077        });
15078        let response = send_request(client_id, request).await;
15079        if response["@type"] == "error" {
15080            return Err(serde_json::from_value(response).unwrap())
15081        }
15082        Ok(())
15083    }
15084    /// Recovers the 2-step verification password with a password recovery code sent to an email address that was previously set up. Works only when the current authorization state is authorizationStateWaitPassword
15085    /// # Arguments
15086    /// * `recovery_code` - Recovery code to check
15087    /// * `new_password` - New 2-step verification password of the user; may be empty to remove the password
15088    /// * `new_hint` - New password hint; may be empty
15089    /// * `client_id` - The client id to send the request to
15090    #[allow(clippy::too_many_arguments)]
15091    pub async fn recover_authentication_password(recovery_code: String, new_password: String, new_hint: String, client_id: i32) -> Result<(), crate::types::Error> {
15092        let request = json!({
15093            "@type": "recoverAuthenticationPassword",
15094            "recovery_code": recovery_code,
15095            "new_password": new_password,
15096            "new_hint": new_hint,
15097        });
15098        let response = send_request(client_id, request).await;
15099        if response["@type"] == "error" {
15100            return Err(serde_json::from_value(response).unwrap())
15101        }
15102        Ok(())
15103    }
15104    /// Sends Firebase Authentication SMS to the phone number of the user. Works only when the current authorization state is authorizationStateWaitCode and the server returned code of the type authenticationCodeTypeFirebaseAndroid or authenticationCodeTypeFirebaseIos
15105    /// # Arguments
15106    /// * `token` - SafetyNet Attestation API token for the Android application, or secret from push notification for the iOS application
15107    /// * `client_id` - The client id to send the request to
15108    #[allow(clippy::too_many_arguments)]
15109    pub async fn send_authentication_firebase_sms(token: String, client_id: i32) -> Result<(), crate::types::Error> {
15110        let request = json!({
15111            "@type": "sendAuthenticationFirebaseSms",
15112            "token": token,
15113        });
15114        let response = send_request(client_id, request).await;
15115        if response["@type"] == "error" {
15116            return Err(serde_json::from_value(response).unwrap())
15117        }
15118        Ok(())
15119    }
15120    /// Checks the authentication token of a bot; to log in as a bot. Works only when the current authorization state is authorizationStateWaitPhoneNumber. Can be used instead of setAuthenticationPhoneNumber and checkAuthenticationCode to log in
15121    /// # Arguments
15122    /// * `token` - The bot token
15123    /// * `client_id` - The client id to send the request to
15124    #[allow(clippy::too_many_arguments)]
15125    pub async fn check_authentication_bot_token(token: String, client_id: i32) -> Result<(), crate::types::Error> {
15126        let request = json!({
15127            "@type": "checkAuthenticationBotToken",
15128            "token": token,
15129        });
15130        let response = send_request(client_id, request).await;
15131        if response["@type"] == "error" {
15132            return Err(serde_json::from_value(response).unwrap())
15133        }
15134        Ok(())
15135    }
15136    /// Closes the TDLib instance after a proper logout. Requires an available network connection. All local data will be destroyed. After the logout completes, updateAuthorizationState with authorizationStateClosed will be sent
15137    /// # Arguments
15138    /// * `client_id` - The client id to send the request to
15139    #[allow(clippy::too_many_arguments)]
15140    pub async fn log_out(client_id: i32) -> Result<(), crate::types::Error> {
15141        let request = json!({
15142            "@type": "logOut",
15143        });
15144        let response = send_request(client_id, request).await;
15145        if response["@type"] == "error" {
15146            return Err(serde_json::from_value(response).unwrap())
15147        }
15148        Ok(())
15149    }
15150    /// Closes the TDLib instance. All databases will be flushed to disk and properly closed. After the close completes, updateAuthorizationState with authorizationStateClosed will be sent. Can be called before initialization
15151    /// # Arguments
15152    /// * `client_id` - The client id to send the request to
15153    #[allow(clippy::too_many_arguments)]
15154    pub async fn close(client_id: i32) -> Result<(), crate::types::Error> {
15155        let request = json!({
15156            "@type": "close",
15157        });
15158        let response = send_request(client_id, request).await;
15159        if response["@type"] == "error" {
15160            return Err(serde_json::from_value(response).unwrap())
15161        }
15162        Ok(())
15163    }
15164    /// Closes the TDLib instance, destroying all local data without a proper logout. The current user session will remain in the list of all active sessions. All local data will be destroyed.
15165    /// After the destruction completes updateAuthorizationState with authorizationStateClosed will be sent. Can be called before authorization
15166    /// # Arguments
15167    /// * `client_id` - The client id to send the request to
15168    #[allow(clippy::too_many_arguments)]
15169    pub async fn destroy(client_id: i32) -> Result<(), crate::types::Error> {
15170        let request = json!({
15171            "@type": "destroy",
15172        });
15173        let response = send_request(client_id, request).await;
15174        if response["@type"] == "error" {
15175            return Err(serde_json::from_value(response).unwrap())
15176        }
15177        Ok(())
15178    }
15179    /// Confirms QR code authentication on another device. Returns created session on success
15180    /// # Arguments
15181    /// * `link` - A link from a QR code. The link must be scanned by the in-app camera
15182    /// * `client_id` - The client id to send the request to
15183    #[allow(clippy::too_many_arguments)]
15184    pub async fn confirm_qr_code_authentication(link: String, client_id: i32) -> Result<crate::enums::Session, crate::types::Error> {
15185        let request = json!({
15186            "@type": "confirmQrCodeAuthentication",
15187            "link": link,
15188        });
15189        let response = send_request(client_id, request).await;
15190        if response["@type"] == "error" {
15191            return Err(serde_json::from_value(response).unwrap())
15192        }
15193        Ok(serde_json::from_value(response).unwrap())
15194    }
15195    /// Returns all updates needed to restore current TDLib state, i.e. all actual updateAuthorizationState/updateUser/updateNewChat and others. This is especially useful if TDLib is run in a separate process. Can be called before initialization
15196    /// # Arguments
15197    /// * `client_id` - The client id to send the request to
15198    #[allow(clippy::too_many_arguments)]
15199    pub async fn get_current_state(client_id: i32) -> Result<crate::enums::Updates, crate::types::Error> {
15200        let request = json!({
15201            "@type": "getCurrentState",
15202        });
15203        let response = send_request(client_id, request).await;
15204        if response["@type"] == "error" {
15205            return Err(serde_json::from_value(response).unwrap())
15206        }
15207        Ok(serde_json::from_value(response).unwrap())
15208    }
15209    /// Changes the database encryption key. Usually the encryption key is never changed and is stored in some OS keychain
15210    /// # Arguments
15211    /// * `new_encryption_key` - New encryption key
15212    /// * `client_id` - The client id to send the request to
15213    #[allow(clippy::too_many_arguments)]
15214    pub async fn set_database_encryption_key(new_encryption_key: String, client_id: i32) -> Result<(), crate::types::Error> {
15215        let request = json!({
15216            "@type": "setDatabaseEncryptionKey",
15217            "new_encryption_key": new_encryption_key,
15218        });
15219        let response = send_request(client_id, request).await;
15220        if response["@type"] == "error" {
15221            return Err(serde_json::from_value(response).unwrap())
15222        }
15223        Ok(())
15224    }
15225    /// Returns the current state of 2-step verification
15226    /// # Arguments
15227    /// * `client_id` - The client id to send the request to
15228    #[allow(clippy::too_many_arguments)]
15229    pub async fn get_password_state(client_id: i32) -> Result<crate::enums::PasswordState, crate::types::Error> {
15230        let request = json!({
15231            "@type": "getPasswordState",
15232        });
15233        let response = send_request(client_id, request).await;
15234        if response["@type"] == "error" {
15235            return Err(serde_json::from_value(response).unwrap())
15236        }
15237        Ok(serde_json::from_value(response).unwrap())
15238    }
15239    /// Changes the 2-step verification password for the current user. If a new recovery email address is specified, then the change will not be applied until the new recovery email address is confirmed
15240    /// # Arguments
15241    /// * `old_password` - Previous 2-step verification password of the user
15242    /// * `new_password` - New 2-step verification password of the user; may be empty to remove the password
15243    /// * `new_hint` - New password hint; may be empty
15244    /// * `set_recovery_email_address` - Pass true to change also the recovery email address
15245    /// * `new_recovery_email_address` - New recovery email address; may be empty
15246    /// * `client_id` - The client id to send the request to
15247    #[allow(clippy::too_many_arguments)]
15248    pub async fn set_password(old_password: String, new_password: String, new_hint: String, set_recovery_email_address: bool, new_recovery_email_address: String, client_id: i32) -> Result<crate::enums::PasswordState, crate::types::Error> {
15249        let request = json!({
15250            "@type": "setPassword",
15251            "old_password": old_password,
15252            "new_password": new_password,
15253            "new_hint": new_hint,
15254            "set_recovery_email_address": set_recovery_email_address,
15255            "new_recovery_email_address": new_recovery_email_address,
15256        });
15257        let response = send_request(client_id, request).await;
15258        if response["@type"] == "error" {
15259            return Err(serde_json::from_value(response).unwrap())
15260        }
15261        Ok(serde_json::from_value(response).unwrap())
15262    }
15263    /// Changes the login email address of the user. The email address can be changed only if the current user already has login email and passwordState.login_email_address_pattern is non-empty.
15264    /// The change will not be applied until the new login email address is confirmed with checkLoginEmailAddressCode. To use Apple ID/Google ID instead of a email address, call checkLoginEmailAddressCode directly
15265    /// # Arguments
15266    /// * `new_login_email_address` - New login email address
15267    /// * `client_id` - The client id to send the request to
15268    #[allow(clippy::too_many_arguments)]
15269    pub async fn set_login_email_address(new_login_email_address: String, client_id: i32) -> Result<crate::enums::EmailAddressAuthenticationCodeInfo, crate::types::Error> {
15270        let request = json!({
15271            "@type": "setLoginEmailAddress",
15272            "new_login_email_address": new_login_email_address,
15273        });
15274        let response = send_request(client_id, request).await;
15275        if response["@type"] == "error" {
15276            return Err(serde_json::from_value(response).unwrap())
15277        }
15278        Ok(serde_json::from_value(response).unwrap())
15279    }
15280    /// Resends the login email address verification code
15281    /// # Arguments
15282    /// * `client_id` - The client id to send the request to
15283    #[allow(clippy::too_many_arguments)]
15284    pub async fn resend_login_email_address_code(client_id: i32) -> Result<crate::enums::EmailAddressAuthenticationCodeInfo, crate::types::Error> {
15285        let request = json!({
15286            "@type": "resendLoginEmailAddressCode",
15287        });
15288        let response = send_request(client_id, request).await;
15289        if response["@type"] == "error" {
15290            return Err(serde_json::from_value(response).unwrap())
15291        }
15292        Ok(serde_json::from_value(response).unwrap())
15293    }
15294    /// Checks the login email address authentication
15295    /// # Arguments
15296    /// * `code` - Email address authentication to check
15297    /// * `client_id` - The client id to send the request to
15298    #[allow(clippy::too_many_arguments)]
15299    pub async fn check_login_email_address_code(code: crate::enums::EmailAddressAuthentication, client_id: i32) -> Result<(), crate::types::Error> {
15300        let request = json!({
15301            "@type": "checkLoginEmailAddressCode",
15302            "code": code,
15303        });
15304        let response = send_request(client_id, request).await;
15305        if response["@type"] == "error" {
15306            return Err(serde_json::from_value(response).unwrap())
15307        }
15308        Ok(())
15309    }
15310    /// Returns a 2-step verification recovery email address that was previously set up. This method can be used to verify a password provided by the user
15311    /// # Arguments
15312    /// * `password` - The 2-step verification password for the current user
15313    /// * `client_id` - The client id to send the request to
15314    #[allow(clippy::too_many_arguments)]
15315    pub async fn get_recovery_email_address(password: String, client_id: i32) -> Result<crate::enums::RecoveryEmailAddress, crate::types::Error> {
15316        let request = json!({
15317            "@type": "getRecoveryEmailAddress",
15318            "password": password,
15319        });
15320        let response = send_request(client_id, request).await;
15321        if response["@type"] == "error" {
15322            return Err(serde_json::from_value(response).unwrap())
15323        }
15324        Ok(serde_json::from_value(response).unwrap())
15325    }
15326    /// Changes the 2-step verification recovery email address of the user. If a new recovery email address is specified, then the change will not be applied until the new recovery email address is confirmed.
15327    /// If new_recovery_email_address is the same as the email address that is currently set up, this call succeeds immediately and aborts all other requests waiting for an email confirmation
15328    /// # Arguments
15329    /// * `password` - The 2-step verification password of the current user
15330    /// * `new_recovery_email_address` - New recovery email address
15331    /// * `client_id` - The client id to send the request to
15332    #[allow(clippy::too_many_arguments)]
15333    pub async fn set_recovery_email_address(password: String, new_recovery_email_address: String, client_id: i32) -> Result<crate::enums::PasswordState, crate::types::Error> {
15334        let request = json!({
15335            "@type": "setRecoveryEmailAddress",
15336            "password": password,
15337            "new_recovery_email_address": new_recovery_email_address,
15338        });
15339        let response = send_request(client_id, request).await;
15340        if response["@type"] == "error" {
15341            return Err(serde_json::from_value(response).unwrap())
15342        }
15343        Ok(serde_json::from_value(response).unwrap())
15344    }
15345    /// Checks the 2-step verification recovery email address verification code
15346    /// # Arguments
15347    /// * `code` - Verification code to check
15348    /// * `client_id` - The client id to send the request to
15349    #[allow(clippy::too_many_arguments)]
15350    pub async fn check_recovery_email_address_code(code: String, client_id: i32) -> Result<crate::enums::PasswordState, crate::types::Error> {
15351        let request = json!({
15352            "@type": "checkRecoveryEmailAddressCode",
15353            "code": code,
15354        });
15355        let response = send_request(client_id, request).await;
15356        if response["@type"] == "error" {
15357            return Err(serde_json::from_value(response).unwrap())
15358        }
15359        Ok(serde_json::from_value(response).unwrap())
15360    }
15361    /// Resends the 2-step verification recovery email address verification code
15362    /// # Arguments
15363    /// * `client_id` - The client id to send the request to
15364    #[allow(clippy::too_many_arguments)]
15365    pub async fn resend_recovery_email_address_code(client_id: i32) -> Result<crate::enums::PasswordState, crate::types::Error> {
15366        let request = json!({
15367            "@type": "resendRecoveryEmailAddressCode",
15368        });
15369        let response = send_request(client_id, request).await;
15370        if response["@type"] == "error" {
15371            return Err(serde_json::from_value(response).unwrap())
15372        }
15373        Ok(serde_json::from_value(response).unwrap())
15374    }
15375    /// Requests to send a 2-step verification password recovery code to an email address that was previously set up
15376    /// # Arguments
15377    /// * `client_id` - The client id to send the request to
15378    #[allow(clippy::too_many_arguments)]
15379    pub async fn request_password_recovery(client_id: i32) -> Result<crate::enums::EmailAddressAuthenticationCodeInfo, crate::types::Error> {
15380        let request = json!({
15381            "@type": "requestPasswordRecovery",
15382        });
15383        let response = send_request(client_id, request).await;
15384        if response["@type"] == "error" {
15385            return Err(serde_json::from_value(response).unwrap())
15386        }
15387        Ok(serde_json::from_value(response).unwrap())
15388    }
15389    /// Checks whether a 2-step verification password recovery code sent to an email address is valid
15390    /// # Arguments
15391    /// * `recovery_code` - Recovery code to check
15392    /// * `client_id` - The client id to send the request to
15393    #[allow(clippy::too_many_arguments)]
15394    pub async fn check_password_recovery_code(recovery_code: String, client_id: i32) -> Result<(), crate::types::Error> {
15395        let request = json!({
15396            "@type": "checkPasswordRecoveryCode",
15397            "recovery_code": recovery_code,
15398        });
15399        let response = send_request(client_id, request).await;
15400        if response["@type"] == "error" {
15401            return Err(serde_json::from_value(response).unwrap())
15402        }
15403        Ok(())
15404    }
15405    /// Recovers the 2-step verification password using a recovery code sent to an email address that was previously set up
15406    /// # Arguments
15407    /// * `recovery_code` - Recovery code to check
15408    /// * `new_password` - New 2-step verification password of the user; may be empty to remove the password
15409    /// * `new_hint` - New password hint; may be empty
15410    /// * `client_id` - The client id to send the request to
15411    #[allow(clippy::too_many_arguments)]
15412    pub async fn recover_password(recovery_code: String, new_password: String, new_hint: String, client_id: i32) -> Result<crate::enums::PasswordState, crate::types::Error> {
15413        let request = json!({
15414            "@type": "recoverPassword",
15415            "recovery_code": recovery_code,
15416            "new_password": new_password,
15417            "new_hint": new_hint,
15418        });
15419        let response = send_request(client_id, request).await;
15420        if response["@type"] == "error" {
15421            return Err(serde_json::from_value(response).unwrap())
15422        }
15423        Ok(serde_json::from_value(response).unwrap())
15424    }
15425    /// Removes 2-step verification password without previous password and access to recovery email address. The password can't be reset immediately and the request needs to be repeated after the specified time
15426    /// # Arguments
15427    /// * `client_id` - The client id to send the request to
15428    #[allow(clippy::too_many_arguments)]
15429    pub async fn reset_password(client_id: i32) -> Result<crate::enums::ResetPasswordResult, crate::types::Error> {
15430        let request = json!({
15431            "@type": "resetPassword",
15432        });
15433        let response = send_request(client_id, request).await;
15434        if response["@type"] == "error" {
15435            return Err(serde_json::from_value(response).unwrap())
15436        }
15437        Ok(serde_json::from_value(response).unwrap())
15438    }
15439    /// Cancels reset of 2-step verification password. The method can be called if passwordState.pending_reset_date > 0
15440    /// # Arguments
15441    /// * `client_id` - The client id to send the request to
15442    #[allow(clippy::too_many_arguments)]
15443    pub async fn cancel_password_reset(client_id: i32) -> Result<(), crate::types::Error> {
15444        let request = json!({
15445            "@type": "cancelPasswordReset",
15446        });
15447        let response = send_request(client_id, request).await;
15448        if response["@type"] == "error" {
15449            return Err(serde_json::from_value(response).unwrap())
15450        }
15451        Ok(())
15452    }
15453    /// Creates a new temporary password for processing payments
15454    /// # Arguments
15455    /// * `password` - The 2-step verification password of the current user
15456    /// * `valid_for` - Time during which the temporary password will be valid, in seconds; must be between 60 and 86400
15457    /// * `client_id` - The client id to send the request to
15458    #[allow(clippy::too_many_arguments)]
15459    pub async fn create_temporary_password(password: String, valid_for: i32, client_id: i32) -> Result<crate::enums::TemporaryPasswordState, crate::types::Error> {
15460        let request = json!({
15461            "@type": "createTemporaryPassword",
15462            "password": password,
15463            "valid_for": valid_for,
15464        });
15465        let response = send_request(client_id, request).await;
15466        if response["@type"] == "error" {
15467            return Err(serde_json::from_value(response).unwrap())
15468        }
15469        Ok(serde_json::from_value(response).unwrap())
15470    }
15471    /// Returns information about the current temporary password
15472    /// # Arguments
15473    /// * `client_id` - The client id to send the request to
15474    #[allow(clippy::too_many_arguments)]
15475    pub async fn get_temporary_password_state(client_id: i32) -> Result<crate::enums::TemporaryPasswordState, crate::types::Error> {
15476        let request = json!({
15477            "@type": "getTemporaryPasswordState",
15478        });
15479        let response = send_request(client_id, request).await;
15480        if response["@type"] == "error" {
15481            return Err(serde_json::from_value(response).unwrap())
15482        }
15483        Ok(serde_json::from_value(response).unwrap())
15484    }
15485    /// Returns the current user
15486    /// # Arguments
15487    /// * `client_id` - The client id to send the request to
15488    #[allow(clippy::too_many_arguments)]
15489    pub async fn get_me(client_id: i32) -> Result<crate::enums::User, crate::types::Error> {
15490        let request = json!({
15491            "@type": "getMe",
15492        });
15493        let response = send_request(client_id, request).await;
15494        if response["@type"] == "error" {
15495            return Err(serde_json::from_value(response).unwrap())
15496        }
15497        Ok(serde_json::from_value(response).unwrap())
15498    }
15499    /// Returns information about a user by their identifier. This is an offline request if the current user is not a bot
15500    /// # Arguments
15501    /// * `user_id` - User identifier
15502    /// * `client_id` - The client id to send the request to
15503    #[allow(clippy::too_many_arguments)]
15504    pub async fn get_user(user_id: i64, client_id: i32) -> Result<crate::enums::User, crate::types::Error> {
15505        let request = json!({
15506            "@type": "getUser",
15507            "user_id": user_id,
15508        });
15509        let response = send_request(client_id, request).await;
15510        if response["@type"] == "error" {
15511            return Err(serde_json::from_value(response).unwrap())
15512        }
15513        Ok(serde_json::from_value(response).unwrap())
15514    }
15515    /// Returns full information about a user by their identifier
15516    /// # Arguments
15517    /// * `user_id` - User identifier
15518    /// * `client_id` - The client id to send the request to
15519    #[allow(clippy::too_many_arguments)]
15520    pub async fn get_user_full_info(user_id: i64, client_id: i32) -> Result<crate::enums::UserFullInfo, crate::types::Error> {
15521        let request = json!({
15522            "@type": "getUserFullInfo",
15523            "user_id": user_id,
15524        });
15525        let response = send_request(client_id, request).await;
15526        if response["@type"] == "error" {
15527            return Err(serde_json::from_value(response).unwrap())
15528        }
15529        Ok(serde_json::from_value(response).unwrap())
15530    }
15531    /// Returns information about a basic group by its identifier. This is an offline request if the current user is not a bot
15532    /// # Arguments
15533    /// * `basic_group_id` - Basic group identifier
15534    /// * `client_id` - The client id to send the request to
15535    #[allow(clippy::too_many_arguments)]
15536    pub async fn get_basic_group(basic_group_id: i64, client_id: i32) -> Result<crate::enums::BasicGroup, crate::types::Error> {
15537        let request = json!({
15538            "@type": "getBasicGroup",
15539            "basic_group_id": basic_group_id,
15540        });
15541        let response = send_request(client_id, request).await;
15542        if response["@type"] == "error" {
15543            return Err(serde_json::from_value(response).unwrap())
15544        }
15545        Ok(serde_json::from_value(response).unwrap())
15546    }
15547    /// Returns full information about a basic group by its identifier
15548    /// # Arguments
15549    /// * `basic_group_id` - Basic group identifier
15550    /// * `client_id` - The client id to send the request to
15551    #[allow(clippy::too_many_arguments)]
15552    pub async fn get_basic_group_full_info(basic_group_id: i64, client_id: i32) -> Result<crate::enums::BasicGroupFullInfo, crate::types::Error> {
15553        let request = json!({
15554            "@type": "getBasicGroupFullInfo",
15555            "basic_group_id": basic_group_id,
15556        });
15557        let response = send_request(client_id, request).await;
15558        if response["@type"] == "error" {
15559            return Err(serde_json::from_value(response).unwrap())
15560        }
15561        Ok(serde_json::from_value(response).unwrap())
15562    }
15563    /// Returns information about a supergroup or a channel by its identifier. This is an offline request if the current user is not a bot
15564    /// # Arguments
15565    /// * `supergroup_id` - Supergroup or channel identifier
15566    /// * `client_id` - The client id to send the request to
15567    #[allow(clippy::too_many_arguments)]
15568    pub async fn get_supergroup(supergroup_id: i64, client_id: i32) -> Result<crate::enums::Supergroup, crate::types::Error> {
15569        let request = json!({
15570            "@type": "getSupergroup",
15571            "supergroup_id": supergroup_id,
15572        });
15573        let response = send_request(client_id, request).await;
15574        if response["@type"] == "error" {
15575            return Err(serde_json::from_value(response).unwrap())
15576        }
15577        Ok(serde_json::from_value(response).unwrap())
15578    }
15579    /// Returns full information about a supergroup or a channel by its identifier, cached for up to 1 minute
15580    /// # Arguments
15581    /// * `supergroup_id` - Supergroup or channel identifier
15582    /// * `client_id` - The client id to send the request to
15583    #[allow(clippy::too_many_arguments)]
15584    pub async fn get_supergroup_full_info(supergroup_id: i64, client_id: i32) -> Result<crate::enums::SupergroupFullInfo, crate::types::Error> {
15585        let request = json!({
15586            "@type": "getSupergroupFullInfo",
15587            "supergroup_id": supergroup_id,
15588        });
15589        let response = send_request(client_id, request).await;
15590        if response["@type"] == "error" {
15591            return Err(serde_json::from_value(response).unwrap())
15592        }
15593        Ok(serde_json::from_value(response).unwrap())
15594    }
15595    /// Returns information about a secret chat by its identifier. This is an offline request
15596    /// # Arguments
15597    /// * `secret_chat_id` - Secret chat identifier
15598    /// * `client_id` - The client id to send the request to
15599    #[allow(clippy::too_many_arguments)]
15600    pub async fn get_secret_chat(secret_chat_id: i32, client_id: i32) -> Result<crate::enums::SecretChat, crate::types::Error> {
15601        let request = json!({
15602            "@type": "getSecretChat",
15603            "secret_chat_id": secret_chat_id,
15604        });
15605        let response = send_request(client_id, request).await;
15606        if response["@type"] == "error" {
15607            return Err(serde_json::from_value(response).unwrap())
15608        }
15609        Ok(serde_json::from_value(response).unwrap())
15610    }
15611    /// Returns information about a chat by its identifier; this is an offline request if the current user is not a bot
15612    /// # Arguments
15613    /// * `chat_id` - Chat identifier
15614    /// * `client_id` - The client id to send the request to
15615    #[allow(clippy::too_many_arguments)]
15616    pub async fn get_chat(chat_id: i64, client_id: i32) -> Result<crate::enums::Chat, crate::types::Error> {
15617        let request = json!({
15618            "@type": "getChat",
15619            "chat_id": chat_id,
15620        });
15621        let response = send_request(client_id, request).await;
15622        if response["@type"] == "error" {
15623            return Err(serde_json::from_value(response).unwrap())
15624        }
15625        Ok(serde_json::from_value(response).unwrap())
15626    }
15627    /// Returns information about a message
15628    /// # Arguments
15629    /// * `chat_id` - Identifier of the chat the message belongs to
15630    /// * `message_id` - Identifier of the message to get
15631    /// * `client_id` - The client id to send the request to
15632    #[allow(clippy::too_many_arguments)]
15633    pub async fn get_message(chat_id: i64, message_id: i64, client_id: i32) -> Result<crate::enums::Message, crate::types::Error> {
15634        let request = json!({
15635            "@type": "getMessage",
15636            "chat_id": chat_id,
15637            "message_id": message_id,
15638        });
15639        let response = send_request(client_id, request).await;
15640        if response["@type"] == "error" {
15641            return Err(serde_json::from_value(response).unwrap())
15642        }
15643        Ok(serde_json::from_value(response).unwrap())
15644    }
15645    /// Returns information about a message, if it is available without sending network request. This is an offline request
15646    /// # Arguments
15647    /// * `chat_id` - Identifier of the chat the message belongs to
15648    /// * `message_id` - Identifier of the message to get
15649    /// * `client_id` - The client id to send the request to
15650    #[allow(clippy::too_many_arguments)]
15651    pub async fn get_message_locally(chat_id: i64, message_id: i64, client_id: i32) -> Result<crate::enums::Message, crate::types::Error> {
15652        let request = json!({
15653            "@type": "getMessageLocally",
15654            "chat_id": chat_id,
15655            "message_id": message_id,
15656        });
15657        let response = send_request(client_id, request).await;
15658        if response["@type"] == "error" {
15659            return Err(serde_json::from_value(response).unwrap())
15660        }
15661        Ok(serde_json::from_value(response).unwrap())
15662    }
15663    /// Returns information about a message that is replied by a given message. Also, returns the pinned message, the game message, the invoice message, and the topic creation message for messages
15664    /// of the types messagePinMessage, messageGameScore, messagePaymentSuccessful, messageChatSetBackground and topic messages without replied message respectively
15665    /// # Arguments
15666    /// * `chat_id` - Identifier of the chat the message belongs to
15667    /// * `message_id` - Identifier of the reply message
15668    /// * `client_id` - The client id to send the request to
15669    #[allow(clippy::too_many_arguments)]
15670    pub async fn get_replied_message(chat_id: i64, message_id: i64, client_id: i32) -> Result<crate::enums::Message, crate::types::Error> {
15671        let request = json!({
15672            "@type": "getRepliedMessage",
15673            "chat_id": chat_id,
15674            "message_id": message_id,
15675        });
15676        let response = send_request(client_id, request).await;
15677        if response["@type"] == "error" {
15678            return Err(serde_json::from_value(response).unwrap())
15679        }
15680        Ok(serde_json::from_value(response).unwrap())
15681    }
15682    /// Returns information about a newest pinned message in the chat
15683    /// # Arguments
15684    /// * `chat_id` - Identifier of the chat the message belongs to
15685    /// * `client_id` - The client id to send the request to
15686    #[allow(clippy::too_many_arguments)]
15687    pub async fn get_chat_pinned_message(chat_id: i64, client_id: i32) -> Result<crate::enums::Message, crate::types::Error> {
15688        let request = json!({
15689            "@type": "getChatPinnedMessage",
15690            "chat_id": chat_id,
15691        });
15692        let response = send_request(client_id, request).await;
15693        if response["@type"] == "error" {
15694            return Err(serde_json::from_value(response).unwrap())
15695        }
15696        Ok(serde_json::from_value(response).unwrap())
15697    }
15698    /// Returns information about a message with the callback button that originated a callback query; for bots only
15699    /// # Arguments
15700    /// * `chat_id` - Identifier of the chat the message belongs to
15701    /// * `message_id` - Message identifier
15702    /// * `callback_query_id` - Identifier of the callback query
15703    /// * `client_id` - The client id to send the request to
15704    #[allow(clippy::too_many_arguments)]
15705    pub async fn get_callback_query_message(chat_id: i64, message_id: i64, callback_query_id: i64, client_id: i32) -> Result<crate::enums::Message, crate::types::Error> {
15706        let request = json!({
15707            "@type": "getCallbackQueryMessage",
15708            "chat_id": chat_id,
15709            "message_id": message_id,
15710            "callback_query_id": callback_query_id,
15711        });
15712        let response = send_request(client_id, request).await;
15713        if response["@type"] == "error" {
15714            return Err(serde_json::from_value(response).unwrap())
15715        }
15716        Ok(serde_json::from_value(response).unwrap())
15717    }
15718    /// Returns information about messages. If a message is not found, returns null on the corresponding position of the result
15719    /// # Arguments
15720    /// * `chat_id` - Identifier of the chat the messages belong to
15721    /// * `message_ids` - Identifiers of the messages to get
15722    /// * `client_id` - The client id to send the request to
15723    #[allow(clippy::too_many_arguments)]
15724    pub async fn get_messages(chat_id: i64, message_ids: Vec<i64>, client_id: i32) -> Result<crate::enums::Messages, crate::types::Error> {
15725        let request = json!({
15726            "@type": "getMessages",
15727            "chat_id": chat_id,
15728            "message_ids": message_ids,
15729        });
15730        let response = send_request(client_id, request).await;
15731        if response["@type"] == "error" {
15732            return Err(serde_json::from_value(response).unwrap())
15733        }
15734        Ok(serde_json::from_value(response).unwrap())
15735    }
15736    /// Returns information about a message thread. Can be used only if message.can_get_message_thread == true
15737    /// # Arguments
15738    /// * `chat_id` - Chat identifier
15739    /// * `message_id` - Identifier of the message
15740    /// * `client_id` - The client id to send the request to
15741    #[allow(clippy::too_many_arguments)]
15742    pub async fn get_message_thread(chat_id: i64, message_id: i64, client_id: i32) -> Result<crate::enums::MessageThreadInfo, crate::types::Error> {
15743        let request = json!({
15744            "@type": "getMessageThread",
15745            "chat_id": chat_id,
15746            "message_id": message_id,
15747        });
15748        let response = send_request(client_id, request).await;
15749        if response["@type"] == "error" {
15750            return Err(serde_json::from_value(response).unwrap())
15751        }
15752        Ok(serde_json::from_value(response).unwrap())
15753    }
15754    /// Returns viewers of a recent outgoing message in a basic group or a supergroup chat. For video notes and voice notes only users, opened content of the message, are returned. The method can be called if message.can_get_viewers == true
15755    /// # Arguments
15756    /// * `chat_id` - Chat identifier
15757    /// * `message_id` - Identifier of the message
15758    /// * `client_id` - The client id to send the request to
15759    #[allow(clippy::too_many_arguments)]
15760    pub async fn get_message_viewers(chat_id: i64, message_id: i64, client_id: i32) -> Result<crate::enums::MessageViewers, crate::types::Error> {
15761        let request = json!({
15762            "@type": "getMessageViewers",
15763            "chat_id": chat_id,
15764            "message_id": message_id,
15765        });
15766        let response = send_request(client_id, request).await;
15767        if response["@type"] == "error" {
15768            return Err(serde_json::from_value(response).unwrap())
15769        }
15770        Ok(serde_json::from_value(response).unwrap())
15771    }
15772    /// Returns information about a file; this is an offline request
15773    /// # Arguments
15774    /// * `file_id` - Identifier of the file to get
15775    /// * `client_id` - The client id to send the request to
15776    #[allow(clippy::too_many_arguments)]
15777    pub async fn get_file(file_id: i32, client_id: i32) -> Result<crate::enums::File, crate::types::Error> {
15778        let request = json!({
15779            "@type": "getFile",
15780            "file_id": file_id,
15781        });
15782        let response = send_request(client_id, request).await;
15783        if response["@type"] == "error" {
15784            return Err(serde_json::from_value(response).unwrap())
15785        }
15786        Ok(serde_json::from_value(response).unwrap())
15787    }
15788    /// Returns information about a file by its remote identifier; this is an offline request. Can be used to register a URL as a file for further uploading, or sending as a message. Even the request succeeds, the file can be used only if it is still accessible to the user.
15789    /// For example, if the file is from a message, then the message must be not deleted and accessible to the user. If the file database is disabled, then the corresponding object with the file must be preloaded by the application
15790    /// # Arguments
15791    /// * `remote_file_id` - Remote identifier of the file to get
15792    /// * `file_type` - File type; pass null if unknown
15793    /// * `client_id` - The client id to send the request to
15794    #[allow(clippy::too_many_arguments)]
15795    pub async fn get_remote_file(remote_file_id: String, file_type: Option<crate::enums::FileType>, client_id: i32) -> Result<crate::enums::File, crate::types::Error> {
15796        let request = json!({
15797            "@type": "getRemoteFile",
15798            "remote_file_id": remote_file_id,
15799            "file_type": file_type,
15800        });
15801        let response = send_request(client_id, request).await;
15802        if response["@type"] == "error" {
15803            return Err(serde_json::from_value(response).unwrap())
15804        }
15805        Ok(serde_json::from_value(response).unwrap())
15806    }
15807    /// Loads more chats from a chat list. The loaded chats and their positions in the chat list will be sent through updates. Chats are sorted by the pair (chat.position.order, chat.id) in descending order. Returns a 404 error if all chats have been loaded
15808    /// # Arguments
15809    /// * `chat_list` - The chat list in which to load chats; pass null to load chats from the main chat list
15810    /// * `limit` - The maximum number of chats to be loaded. For optimal performance, the number of loaded chats is chosen by TDLib and can be smaller than the specified limit, even if the end of the list is not reached
15811    /// * `client_id` - The client id to send the request to
15812    #[allow(clippy::too_many_arguments)]
15813    pub async fn load_chats(chat_list: Option<crate::enums::ChatList>, limit: i32, client_id: i32) -> Result<(), crate::types::Error> {
15814        let request = json!({
15815            "@type": "loadChats",
15816            "chat_list": chat_list,
15817            "limit": limit,
15818        });
15819        let response = send_request(client_id, request).await;
15820        if response["@type"] == "error" {
15821            return Err(serde_json::from_value(response).unwrap())
15822        }
15823        Ok(())
15824    }
15825    /// Returns an ordered list of chats from the beginning of a chat list. For informational purposes only. Use loadChats and updates processing instead to maintain chat lists in a consistent state
15826    /// # Arguments
15827    /// * `chat_list` - The chat list in which to return chats; pass null to get chats from the main chat list
15828    /// * `limit` - The maximum number of chats to be returned
15829    /// * `client_id` - The client id to send the request to
15830    #[allow(clippy::too_many_arguments)]
15831    pub async fn get_chats(chat_list: Option<crate::enums::ChatList>, limit: i32, client_id: i32) -> Result<crate::enums::Chats, crate::types::Error> {
15832        let request = json!({
15833            "@type": "getChats",
15834            "chat_list": chat_list,
15835            "limit": limit,
15836        });
15837        let response = send_request(client_id, request).await;
15838        if response["@type"] == "error" {
15839            return Err(serde_json::from_value(response).unwrap())
15840        }
15841        Ok(serde_json::from_value(response).unwrap())
15842    }
15843    /// Searches a public chat by its username. Currently, only private chats, supergroups and channels can be public. Returns the chat if found; otherwise, an error is returned
15844    /// # Arguments
15845    /// * `username` - Username to be resolved
15846    /// * `client_id` - The client id to send the request to
15847    #[allow(clippy::too_many_arguments)]
15848    pub async fn search_public_chat(username: String, client_id: i32) -> Result<crate::enums::Chat, crate::types::Error> {
15849        let request = json!({
15850            "@type": "searchPublicChat",
15851            "username": username,
15852        });
15853        let response = send_request(client_id, request).await;
15854        if response["@type"] == "error" {
15855            return Err(serde_json::from_value(response).unwrap())
15856        }
15857        Ok(serde_json::from_value(response).unwrap())
15858    }
15859    /// Searches public chats by looking for specified query in their username and title. Currently, only private chats, supergroups and channels can be public. Returns a meaningful number of results.
15860    /// Excludes private chats with contacts and chats from the chat list from the results
15861    /// # Arguments
15862    /// * `query` - Query to search for
15863    /// * `client_id` - The client id to send the request to
15864    #[allow(clippy::too_many_arguments)]
15865    pub async fn search_public_chats(query: String, client_id: i32) -> Result<crate::enums::Chats, crate::types::Error> {
15866        let request = json!({
15867            "@type": "searchPublicChats",
15868            "query": query,
15869        });
15870        let response = send_request(client_id, request).await;
15871        if response["@type"] == "error" {
15872            return Err(serde_json::from_value(response).unwrap())
15873        }
15874        Ok(serde_json::from_value(response).unwrap())
15875    }
15876    /// Searches for the specified query in the title and username of already known chats; this is an offline request. Returns chats in the order seen in the main chat list
15877    /// # Arguments
15878    /// * `query` - Query to search for. If the query is empty, returns up to 50 recently found chats
15879    /// * `limit` - The maximum number of chats to be returned
15880    /// * `client_id` - The client id to send the request to
15881    #[allow(clippy::too_many_arguments)]
15882    pub async fn search_chats(query: String, limit: i32, client_id: i32) -> Result<crate::enums::Chats, crate::types::Error> {
15883        let request = json!({
15884            "@type": "searchChats",
15885            "query": query,
15886            "limit": limit,
15887        });
15888        let response = send_request(client_id, request).await;
15889        if response["@type"] == "error" {
15890            return Err(serde_json::from_value(response).unwrap())
15891        }
15892        Ok(serde_json::from_value(response).unwrap())
15893    }
15894    /// Searches for the specified query in the title and username of already known chats via request to the server. Returns chats in the order seen in the main chat list
15895    /// # Arguments
15896    /// * `query` - Query to search for
15897    /// * `limit` - The maximum number of chats to be returned
15898    /// * `client_id` - The client id to send the request to
15899    #[allow(clippy::too_many_arguments)]
15900    pub async fn search_chats_on_server(query: String, limit: i32, client_id: i32) -> Result<crate::enums::Chats, crate::types::Error> {
15901        let request = json!({
15902            "@type": "searchChatsOnServer",
15903            "query": query,
15904            "limit": limit,
15905        });
15906        let response = send_request(client_id, request).await;
15907        if response["@type"] == "error" {
15908            return Err(serde_json::from_value(response).unwrap())
15909        }
15910        Ok(serde_json::from_value(response).unwrap())
15911    }
15912    /// Returns a list of users and location-based supergroups nearby. The list of users nearby will be updated for 60 seconds after the request by the updates updateUsersNearby.
15913    /// The request must be sent again every 25 seconds with adjusted location to not miss new chats
15914    /// # Arguments
15915    /// * `location` - Current user location
15916    /// * `client_id` - The client id to send the request to
15917    #[allow(clippy::too_many_arguments)]
15918    pub async fn search_chats_nearby(location: crate::types::Location, client_id: i32) -> Result<crate::enums::ChatsNearby, crate::types::Error> {
15919        let request = json!({
15920            "@type": "searchChatsNearby",
15921            "location": location,
15922        });
15923        let response = send_request(client_id, request).await;
15924        if response["@type"] == "error" {
15925            return Err(serde_json::from_value(response).unwrap())
15926        }
15927        Ok(serde_json::from_value(response).unwrap())
15928    }
15929    /// Returns a list of frequently used chats
15930    /// # Arguments
15931    /// * `category` - Category of chats to be returned
15932    /// * `limit` - The maximum number of chats to be returned; up to 30
15933    /// * `client_id` - The client id to send the request to
15934    #[allow(clippy::too_many_arguments)]
15935    pub async fn get_top_chats(category: crate::enums::TopChatCategory, limit: i32, client_id: i32) -> Result<crate::enums::Chats, crate::types::Error> {
15936        let request = json!({
15937            "@type": "getTopChats",
15938            "category": category,
15939            "limit": limit,
15940        });
15941        let response = send_request(client_id, request).await;
15942        if response["@type"] == "error" {
15943            return Err(serde_json::from_value(response).unwrap())
15944        }
15945        Ok(serde_json::from_value(response).unwrap())
15946    }
15947    /// Removes a chat from the list of frequently used chats. Supported only if the chat info database is enabled
15948    /// # Arguments
15949    /// * `category` - Category of frequently used chats
15950    /// * `chat_id` - Chat identifier
15951    /// * `client_id` - The client id to send the request to
15952    #[allow(clippy::too_many_arguments)]
15953    pub async fn remove_top_chat(category: crate::enums::TopChatCategory, chat_id: i64, client_id: i32) -> Result<(), crate::types::Error> {
15954        let request = json!({
15955            "@type": "removeTopChat",
15956            "category": category,
15957            "chat_id": chat_id,
15958        });
15959        let response = send_request(client_id, request).await;
15960        if response["@type"] == "error" {
15961            return Err(serde_json::from_value(response).unwrap())
15962        }
15963        Ok(())
15964    }
15965    /// Searches for the specified query in the title and username of up to 50 recently found chats; this is an offline request
15966    /// # Arguments
15967    /// * `query` - Query to search for
15968    /// * `limit` - The maximum number of chats to be returned
15969    /// * `client_id` - The client id to send the request to
15970    #[allow(clippy::too_many_arguments)]
15971    pub async fn search_recently_found_chats(query: String, limit: i32, client_id: i32) -> Result<crate::enums::Chats, crate::types::Error> {
15972        let request = json!({
15973            "@type": "searchRecentlyFoundChats",
15974            "query": query,
15975            "limit": limit,
15976        });
15977        let response = send_request(client_id, request).await;
15978        if response["@type"] == "error" {
15979            return Err(serde_json::from_value(response).unwrap())
15980        }
15981        Ok(serde_json::from_value(response).unwrap())
15982    }
15983    /// Adds a chat to the list of recently found chats. The chat is added to the beginning of the list. If the chat is already in the list, it will be removed from the list first
15984    /// # Arguments
15985    /// * `chat_id` - Identifier of the chat to add
15986    /// * `client_id` - The client id to send the request to
15987    #[allow(clippy::too_many_arguments)]
15988    pub async fn add_recently_found_chat(chat_id: i64, client_id: i32) -> Result<(), crate::types::Error> {
15989        let request = json!({
15990            "@type": "addRecentlyFoundChat",
15991            "chat_id": chat_id,
15992        });
15993        let response = send_request(client_id, request).await;
15994        if response["@type"] == "error" {
15995            return Err(serde_json::from_value(response).unwrap())
15996        }
15997        Ok(())
15998    }
15999    /// Removes a chat from the list of recently found chats
16000    /// # Arguments
16001    /// * `chat_id` - Identifier of the chat to be removed
16002    /// * `client_id` - The client id to send the request to
16003    #[allow(clippy::too_many_arguments)]
16004    pub async fn remove_recently_found_chat(chat_id: i64, client_id: i32) -> Result<(), crate::types::Error> {
16005        let request = json!({
16006            "@type": "removeRecentlyFoundChat",
16007            "chat_id": chat_id,
16008        });
16009        let response = send_request(client_id, request).await;
16010        if response["@type"] == "error" {
16011            return Err(serde_json::from_value(response).unwrap())
16012        }
16013        Ok(())
16014    }
16015    /// Clears the list of recently found chats
16016    /// # Arguments
16017    /// * `client_id` - The client id to send the request to
16018    #[allow(clippy::too_many_arguments)]
16019    pub async fn clear_recently_found_chats(client_id: i32) -> Result<(), crate::types::Error> {
16020        let request = json!({
16021            "@type": "clearRecentlyFoundChats",
16022        });
16023        let response = send_request(client_id, request).await;
16024        if response["@type"] == "error" {
16025            return Err(serde_json::from_value(response).unwrap())
16026        }
16027        Ok(())
16028    }
16029    /// Returns recently opened chats; this is an offline request. Returns chats in the order of last opening
16030    /// # Arguments
16031    /// * `limit` - The maximum number of chats to be returned
16032    /// * `client_id` - The client id to send the request to
16033    #[allow(clippy::too_many_arguments)]
16034    pub async fn get_recently_opened_chats(limit: i32, client_id: i32) -> Result<crate::enums::Chats, crate::types::Error> {
16035        let request = json!({
16036            "@type": "getRecentlyOpenedChats",
16037            "limit": limit,
16038        });
16039        let response = send_request(client_id, request).await;
16040        if response["@type"] == "error" {
16041            return Err(serde_json::from_value(response).unwrap())
16042        }
16043        Ok(serde_json::from_value(response).unwrap())
16044    }
16045    /// Checks whether a username can be set for a chat
16046    /// # Arguments
16047    /// * `chat_id` - Chat identifier; must be identifier of a supergroup chat, or a channel chat, or a private chat with self, or 0 if the chat is being created
16048    /// * `username` - Username to be checked
16049    /// * `client_id` - The client id to send the request to
16050    #[allow(clippy::too_many_arguments)]
16051    pub async fn check_chat_username(chat_id: i64, username: String, client_id: i32) -> Result<crate::enums::CheckChatUsernameResult, crate::types::Error> {
16052        let request = json!({
16053            "@type": "checkChatUsername",
16054            "chat_id": chat_id,
16055            "username": username,
16056        });
16057        let response = send_request(client_id, request).await;
16058        if response["@type"] == "error" {
16059            return Err(serde_json::from_value(response).unwrap())
16060        }
16061        Ok(serde_json::from_value(response).unwrap())
16062    }
16063    /// Returns a list of public chats of the specified type, owned by the user
16064    /// # Arguments
16065    /// * `r#type` - Type of the public chats to return
16066    /// * `client_id` - The client id to send the request to
16067    #[allow(clippy::too_many_arguments)]
16068    pub async fn get_created_public_chats(r#type: crate::enums::PublicChatType, client_id: i32) -> Result<crate::enums::Chats, crate::types::Error> {
16069        let request = json!({
16070            "@type": "getCreatedPublicChats",
16071            "type": r#type,
16072        });
16073        let response = send_request(client_id, request).await;
16074        if response["@type"] == "error" {
16075            return Err(serde_json::from_value(response).unwrap())
16076        }
16077        Ok(serde_json::from_value(response).unwrap())
16078    }
16079    /// Checks whether the maximum number of owned public chats has been reached. Returns corresponding error if the limit was reached. The limit can be increased with Telegram Premium
16080    /// # Arguments
16081    /// * `r#type` - Type of the public chats, for which to check the limit
16082    /// * `client_id` - The client id to send the request to
16083    #[allow(clippy::too_many_arguments)]
16084    pub async fn check_created_public_chats_limit(r#type: crate::enums::PublicChatType, client_id: i32) -> Result<(), crate::types::Error> {
16085        let request = json!({
16086            "@type": "checkCreatedPublicChatsLimit",
16087            "type": r#type,
16088        });
16089        let response = send_request(client_id, request).await;
16090        if response["@type"] == "error" {
16091            return Err(serde_json::from_value(response).unwrap())
16092        }
16093        Ok(())
16094    }
16095    /// Returns a list of basic group and supergroup chats, which can be used as a discussion group for a channel. Returned basic group chats must be first upgraded to supergroups before they can be set as a discussion group.
16096    /// To set a returned supergroup as a discussion group, access to its old messages must be enabled using toggleSupergroupIsAllHistoryAvailable first
16097    /// # Arguments
16098    /// * `client_id` - The client id to send the request to
16099    #[allow(clippy::too_many_arguments)]
16100    pub async fn get_suitable_discussion_chats(client_id: i32) -> Result<crate::enums::Chats, crate::types::Error> {
16101        let request = json!({
16102            "@type": "getSuitableDiscussionChats",
16103        });
16104        let response = send_request(client_id, request).await;
16105        if response["@type"] == "error" {
16106            return Err(serde_json::from_value(response).unwrap())
16107        }
16108        Ok(serde_json::from_value(response).unwrap())
16109    }
16110    /// Returns a list of recently inactive supergroups and channels. Can be used when user reaches limit on the number of joined supergroups and channels and receives CHANNELS_TOO_MUCH error. Also, the limit can be increased with Telegram Premium
16111    /// # Arguments
16112    /// * `client_id` - The client id to send the request to
16113    #[allow(clippy::too_many_arguments)]
16114    pub async fn get_inactive_supergroup_chats(client_id: i32) -> Result<crate::enums::Chats, crate::types::Error> {
16115        let request = json!({
16116            "@type": "getInactiveSupergroupChats",
16117        });
16118        let response = send_request(client_id, request).await;
16119        if response["@type"] == "error" {
16120            return Err(serde_json::from_value(response).unwrap())
16121        }
16122        Ok(serde_json::from_value(response).unwrap())
16123    }
16124    /// Returns a list of common group chats with a given user. Chats are sorted by their type and creation date
16125    /// # Arguments
16126    /// * `user_id` - User identifier
16127    /// * `offset_chat_id` - Chat identifier starting from which to return chats; use 0 for the first request
16128    /// * `limit` - The maximum number of chats to be returned; up to 100
16129    /// * `client_id` - The client id to send the request to
16130    #[allow(clippy::too_many_arguments)]
16131    pub async fn get_groups_in_common(user_id: i64, offset_chat_id: i64, limit: i32, client_id: i32) -> Result<crate::enums::Chats, crate::types::Error> {
16132        let request = json!({
16133            "@type": "getGroupsInCommon",
16134            "user_id": user_id,
16135            "offset_chat_id": offset_chat_id,
16136            "limit": limit,
16137        });
16138        let response = send_request(client_id, request).await;
16139        if response["@type"] == "error" {
16140            return Err(serde_json::from_value(response).unwrap())
16141        }
16142        Ok(serde_json::from_value(response).unwrap())
16143    }
16144    /// Returns messages in a chat. The messages are returned in a reverse chronological order (i.e., in order of decreasing message_id).
16145    /// For optimal performance, the number of returned messages is chosen by TDLib. This is an offline request if only_local is true
16146    /// # Arguments
16147    /// * `chat_id` - Chat identifier
16148    /// * `from_message_id` - Identifier of the message starting from which history must be fetched; use 0 to get results from the last message
16149    /// * `offset` - Specify 0 to get results from exactly the from_message_id or a negative offset up to 99 to get additionally some newer messages
16150    /// * `limit` - The maximum number of messages to be returned; must be positive and can't be greater than 100. If the offset is negative, the limit must be greater than or equal to -offset.
16151    /// For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit
16152    /// * `only_local` - Pass true to get only messages that are available without sending network requests
16153    /// * `client_id` - The client id to send the request to
16154    #[allow(clippy::too_many_arguments)]
16155    pub async fn get_chat_history(chat_id: i64, from_message_id: i64, offset: i32, limit: i32, only_local: bool, client_id: i32) -> Result<crate::enums::Messages, crate::types::Error> {
16156        let request = json!({
16157            "@type": "getChatHistory",
16158            "chat_id": chat_id,
16159            "from_message_id": from_message_id,
16160            "offset": offset,
16161            "limit": limit,
16162            "only_local": only_local,
16163        });
16164        let response = send_request(client_id, request).await;
16165        if response["@type"] == "error" {
16166            return Err(serde_json::from_value(response).unwrap())
16167        }
16168        Ok(serde_json::from_value(response).unwrap())
16169    }
16170    /// Returns messages in a message thread of a message. Can be used only if message.can_get_message_thread == true. Message thread of a channel message is in the channel's linked supergroup.
16171    /// The messages are returned in a reverse chronological order (i.e., in order of decreasing message_id). For optimal performance, the number of returned messages is chosen by TDLib
16172    /// # Arguments
16173    /// * `chat_id` - Chat identifier
16174    /// * `message_id` - Message identifier, which thread history needs to be returned
16175    /// * `from_message_id` - Identifier of the message starting from which history must be fetched; use 0 to get results from the last message
16176    /// * `offset` - Specify 0 to get results from exactly the from_message_id or a negative offset up to 99 to get additionally some newer messages
16177    /// * `limit` - The maximum number of messages to be returned; must be positive and can't be greater than 100. If the offset is negative, the limit must be greater than or equal to -offset.
16178    /// For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit
16179    /// * `client_id` - The client id to send the request to
16180    #[allow(clippy::too_many_arguments)]
16181    pub async fn get_message_thread_history(chat_id: i64, message_id: i64, from_message_id: i64, offset: i32, limit: i32, client_id: i32) -> Result<crate::enums::Messages, crate::types::Error> {
16182        let request = json!({
16183            "@type": "getMessageThreadHistory",
16184            "chat_id": chat_id,
16185            "message_id": message_id,
16186            "from_message_id": from_message_id,
16187            "offset": offset,
16188            "limit": limit,
16189        });
16190        let response = send_request(client_id, request).await;
16191        if response["@type"] == "error" {
16192            return Err(serde_json::from_value(response).unwrap())
16193        }
16194        Ok(serde_json::from_value(response).unwrap())
16195    }
16196    /// Deletes all messages in the chat. Use chat.can_be_deleted_only_for_self and chat.can_be_deleted_for_all_users fields to find whether and how the method can be applied to the chat
16197    /// # Arguments
16198    /// * `chat_id` - Chat identifier
16199    /// * `remove_from_chat_list` - Pass true to remove the chat from all chat lists
16200    /// * `revoke` - Pass true to delete chat history for all users
16201    /// * `client_id` - The client id to send the request to
16202    #[allow(clippy::too_many_arguments)]
16203    pub async fn delete_chat_history(chat_id: i64, remove_from_chat_list: bool, revoke: bool, client_id: i32) -> Result<(), crate::types::Error> {
16204        let request = json!({
16205            "@type": "deleteChatHistory",
16206            "chat_id": chat_id,
16207            "remove_from_chat_list": remove_from_chat_list,
16208            "revoke": revoke,
16209        });
16210        let response = send_request(client_id, request).await;
16211        if response["@type"] == "error" {
16212            return Err(serde_json::from_value(response).unwrap())
16213        }
16214        Ok(())
16215    }
16216    /// Deletes a chat along with all messages in the corresponding chat for all chat members. For group chats this will release the usernames and remove all members.
16217    /// Use the field chat.can_be_deleted_for_all_users to find whether the method can be applied to the chat
16218    /// # Arguments
16219    /// * `chat_id` - Chat identifier
16220    /// * `client_id` - The client id to send the request to
16221    #[allow(clippy::too_many_arguments)]
16222    pub async fn delete_chat(chat_id: i64, client_id: i32) -> Result<(), crate::types::Error> {
16223        let request = json!({
16224            "@type": "deleteChat",
16225            "chat_id": chat_id,
16226        });
16227        let response = send_request(client_id, request).await;
16228        if response["@type"] == "error" {
16229            return Err(serde_json::from_value(response).unwrap())
16230        }
16231        Ok(())
16232    }
16233    /// Searches for messages with given words in the chat. Returns the results in reverse chronological order, i.e. in order of decreasing message_id. Cannot be used in secret chats with a non-empty query
16234    /// (searchSecretMessages must be used instead), or without an enabled message database. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit.
16235    /// A combination of query, sender_id, filter and message_thread_id search criteria is expected to be supported, only if it is required for Telegram official application implementation
16236    /// # Arguments
16237    /// * `chat_id` - Identifier of the chat in which to search messages
16238    /// * `query` - Query to search for
16239    /// * `sender_id` - Identifier of the sender of messages to search for; pass null to search for messages from any sender. Not supported in secret chats
16240    /// * `from_message_id` - Identifier of the message starting from which history must be fetched; use 0 to get results from the last message
16241    /// * `offset` - Specify 0 to get results from exactly the from_message_id or a negative offset to get the specified message and some newer messages
16242    /// * `limit` - The maximum number of messages to be returned; must be positive and can't be greater than 100. If the offset is negative, the limit must be greater than -offset.
16243    /// For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit
16244    /// * `filter` - Additional filter for messages to search; pass null to search for all messages
16245    /// * `message_thread_id` - If not 0, only messages in the specified thread will be returned; supergroups only
16246    /// * `client_id` - The client id to send the request to
16247    #[allow(clippy::too_many_arguments)]
16248    pub async fn search_chat_messages(chat_id: i64, query: String, sender_id: Option<crate::enums::MessageSender>, from_message_id: i64, offset: i32, limit: i32, filter: Option<crate::enums::SearchMessagesFilter>, message_thread_id: i64, client_id: i32) -> Result<crate::enums::FoundChatMessages, crate::types::Error> {
16249        let request = json!({
16250            "@type": "searchChatMessages",
16251            "chat_id": chat_id,
16252            "query": query,
16253            "sender_id": sender_id,
16254            "from_message_id": from_message_id,
16255            "offset": offset,
16256            "limit": limit,
16257            "filter": filter,
16258            "message_thread_id": message_thread_id,
16259        });
16260        let response = send_request(client_id, request).await;
16261        if response["@type"] == "error" {
16262            return Err(serde_json::from_value(response).unwrap())
16263        }
16264        Ok(serde_json::from_value(response).unwrap())
16265    }
16266    /// Searches for messages in all chats except secret chats. Returns the results in reverse chronological order (i.e., in order of decreasing (date, chat_id, message_id)).
16267    /// For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit
16268    /// # Arguments
16269    /// * `chat_list` - Chat list in which to search messages; pass null to search in all chats regardless of their chat list. Only Main and Archive chat lists are supported
16270    /// * `query` - Query to search for
16271    /// * `offset` - Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results
16272    /// * `limit` - The maximum number of messages to be returned; up to 100. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit
16273    /// * `filter` - Additional filter for messages to search; pass null to search for all messages. Filters searchMessagesFilterMention, searchMessagesFilterUnreadMention, searchMessagesFilterUnreadReaction, searchMessagesFilterFailedToSend, and searchMessagesFilterPinned are unsupported in this function
16274    /// * `min_date` - If not 0, the minimum date of the messages to return
16275    /// * `max_date` - If not 0, the maximum date of the messages to return
16276    /// * `client_id` - The client id to send the request to
16277    #[allow(clippy::too_many_arguments)]
16278    pub async fn search_messages(chat_list: Option<crate::enums::ChatList>, query: String, offset: String, limit: i32, filter: Option<crate::enums::SearchMessagesFilter>, min_date: i32, max_date: i32, client_id: i32) -> Result<crate::enums::FoundMessages, crate::types::Error> {
16279        let request = json!({
16280            "@type": "searchMessages",
16281            "chat_list": chat_list,
16282            "query": query,
16283            "offset": offset,
16284            "limit": limit,
16285            "filter": filter,
16286            "min_date": min_date,
16287            "max_date": max_date,
16288        });
16289        let response = send_request(client_id, request).await;
16290        if response["@type"] == "error" {
16291            return Err(serde_json::from_value(response).unwrap())
16292        }
16293        Ok(serde_json::from_value(response).unwrap())
16294    }
16295    /// Searches for messages in secret chats. Returns the results in reverse chronological order. For optimal performance, the number of returned messages is chosen by TDLib
16296    /// # Arguments
16297    /// * `chat_id` - Identifier of the chat in which to search. Specify 0 to search in all secret chats
16298    /// * `query` - Query to search for. If empty, searchChatMessages must be used instead
16299    /// * `offset` - Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results
16300    /// * `limit` - The maximum number of messages to be returned; up to 100. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit
16301    /// * `filter` - Additional filter for messages to search; pass null to search for all messages
16302    /// * `client_id` - The client id to send the request to
16303    #[allow(clippy::too_many_arguments)]
16304    pub async fn search_secret_messages(chat_id: i64, query: String, offset: String, limit: i32, filter: Option<crate::enums::SearchMessagesFilter>, client_id: i32) -> Result<crate::enums::FoundMessages, crate::types::Error> {
16305        let request = json!({
16306            "@type": "searchSecretMessages",
16307            "chat_id": chat_id,
16308            "query": query,
16309            "offset": offset,
16310            "limit": limit,
16311            "filter": filter,
16312        });
16313        let response = send_request(client_id, request).await;
16314        if response["@type"] == "error" {
16315            return Err(serde_json::from_value(response).unwrap())
16316        }
16317        Ok(serde_json::from_value(response).unwrap())
16318    }
16319    /// Searches for call messages. Returns the results in reverse chronological order (i.e., in order of decreasing message_id). For optimal performance, the number of returned messages is chosen by TDLib
16320    /// # Arguments
16321    /// * `offset` - Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results
16322    /// * `limit` - The maximum number of messages to be returned; up to 100. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit
16323    /// * `only_missed` - Pass true to search only for messages with missed/declined calls
16324    /// * `client_id` - The client id to send the request to
16325    #[allow(clippy::too_many_arguments)]
16326    pub async fn search_call_messages(offset: String, limit: i32, only_missed: bool, client_id: i32) -> Result<crate::enums::FoundMessages, crate::types::Error> {
16327        let request = json!({
16328            "@type": "searchCallMessages",
16329            "offset": offset,
16330            "limit": limit,
16331            "only_missed": only_missed,
16332        });
16333        let response = send_request(client_id, request).await;
16334        if response["@type"] == "error" {
16335            return Err(serde_json::from_value(response).unwrap())
16336        }
16337        Ok(serde_json::from_value(response).unwrap())
16338    }
16339    /// Searches for outgoing messages with content of the type messageDocument in all chats except secret chats. Returns the results in reverse chronological order
16340    /// # Arguments
16341    /// * `query` - Query to search for in document file name and message caption
16342    /// * `limit` - The maximum number of messages to be returned; up to 100
16343    /// * `client_id` - The client id to send the request to
16344    #[allow(clippy::too_many_arguments)]
16345    pub async fn search_outgoing_document_messages(query: String, limit: i32, client_id: i32) -> Result<crate::enums::FoundMessages, crate::types::Error> {
16346        let request = json!({
16347            "@type": "searchOutgoingDocumentMessages",
16348            "query": query,
16349            "limit": limit,
16350        });
16351        let response = send_request(client_id, request).await;
16352        if response["@type"] == "error" {
16353            return Err(serde_json::from_value(response).unwrap())
16354        }
16355        Ok(serde_json::from_value(response).unwrap())
16356    }
16357    /// Deletes all call messages
16358    /// # Arguments
16359    /// * `revoke` - Pass true to delete the messages for all users
16360    /// * `client_id` - The client id to send the request to
16361    #[allow(clippy::too_many_arguments)]
16362    pub async fn delete_all_call_messages(revoke: bool, client_id: i32) -> Result<(), crate::types::Error> {
16363        let request = json!({
16364            "@type": "deleteAllCallMessages",
16365            "revoke": revoke,
16366        });
16367        let response = send_request(client_id, request).await;
16368        if response["@type"] == "error" {
16369            return Err(serde_json::from_value(response).unwrap())
16370        }
16371        Ok(())
16372    }
16373    /// Returns information about the recent locations of chat members that were sent to the chat. Returns up to 1 location message per user
16374    /// # Arguments
16375    /// * `chat_id` - Chat identifier
16376    /// * `limit` - The maximum number of messages to be returned
16377    /// * `client_id` - The client id to send the request to
16378    #[allow(clippy::too_many_arguments)]
16379    pub async fn search_chat_recent_location_messages(chat_id: i64, limit: i32, client_id: i32) -> Result<crate::enums::Messages, crate::types::Error> {
16380        let request = json!({
16381            "@type": "searchChatRecentLocationMessages",
16382            "chat_id": chat_id,
16383            "limit": limit,
16384        });
16385        let response = send_request(client_id, request).await;
16386        if response["@type"] == "error" {
16387            return Err(serde_json::from_value(response).unwrap())
16388        }
16389        Ok(serde_json::from_value(response).unwrap())
16390    }
16391    /// Returns all active live locations that need to be updated by the application. The list is persistent across application restarts only if the message database is used
16392    /// # Arguments
16393    /// * `client_id` - The client id to send the request to
16394    #[allow(clippy::too_many_arguments)]
16395    pub async fn get_active_live_location_messages(client_id: i32) -> Result<crate::enums::Messages, crate::types::Error> {
16396        let request = json!({
16397            "@type": "getActiveLiveLocationMessages",
16398        });
16399        let response = send_request(client_id, request).await;
16400        if response["@type"] == "error" {
16401            return Err(serde_json::from_value(response).unwrap())
16402        }
16403        Ok(serde_json::from_value(response).unwrap())
16404    }
16405    /// Returns the last message sent in a chat no later than the specified date
16406    /// # Arguments
16407    /// * `chat_id` - Chat identifier
16408    /// * `date` - Point in time (Unix timestamp) relative to which to search for messages
16409    /// * `client_id` - The client id to send the request to
16410    #[allow(clippy::too_many_arguments)]
16411    pub async fn get_chat_message_by_date(chat_id: i64, date: i32, client_id: i32) -> Result<crate::enums::Message, crate::types::Error> {
16412        let request = json!({
16413            "@type": "getChatMessageByDate",
16414            "chat_id": chat_id,
16415            "date": date,
16416        });
16417        let response = send_request(client_id, request).await;
16418        if response["@type"] == "error" {
16419            return Err(serde_json::from_value(response).unwrap())
16420        }
16421        Ok(serde_json::from_value(response).unwrap())
16422    }
16423    /// Returns sparse positions of messages of the specified type in the chat to be used for shared media scroll implementation. Returns the results in reverse chronological order (i.e., in order of decreasing message_id).
16424    /// Cannot be used in secret chats or with searchMessagesFilterFailedToSend filter without an enabled message database
16425    /// # Arguments
16426    /// * `chat_id` - Identifier of the chat in which to return information about message positions
16427    /// * `filter` - Filter for message content. Filters searchMessagesFilterEmpty, searchMessagesFilterMention, searchMessagesFilterUnreadMention, and searchMessagesFilterUnreadReaction are unsupported in this function
16428    /// * `from_message_id` - The message identifier from which to return information about message positions
16429    /// * `limit` - The expected number of message positions to be returned; 50-2000. A smaller number of positions can be returned, if there are not enough appropriate messages
16430    /// * `client_id` - The client id to send the request to
16431    #[allow(clippy::too_many_arguments)]
16432    pub async fn get_chat_sparse_message_positions(chat_id: i64, filter: crate::enums::SearchMessagesFilter, from_message_id: i64, limit: i32, client_id: i32) -> Result<crate::enums::MessagePositions, crate::types::Error> {
16433        let request = json!({
16434            "@type": "getChatSparseMessagePositions",
16435            "chat_id": chat_id,
16436            "filter": filter,
16437            "from_message_id": from_message_id,
16438            "limit": limit,
16439        });
16440        let response = send_request(client_id, request).await;
16441        if response["@type"] == "error" {
16442            return Err(serde_json::from_value(response).unwrap())
16443        }
16444        Ok(serde_json::from_value(response).unwrap())
16445    }
16446    /// Returns information about the next messages of the specified type in the chat split by days. Returns the results in reverse chronological order. Can return partial result for the last returned day. Behavior of this method depends on the value of the option "utc_time_offset"
16447    /// # Arguments
16448    /// * `chat_id` - Identifier of the chat in which to return information about messages
16449    /// * `filter` - Filter for message content. Filters searchMessagesFilterEmpty, searchMessagesFilterMention, searchMessagesFilterUnreadMention, and searchMessagesFilterUnreadReaction are unsupported in this function
16450    /// * `from_message_id` - The message identifier from which to return information about messages; use 0 to get results from the last message
16451    /// * `client_id` - The client id to send the request to
16452    #[allow(clippy::too_many_arguments)]
16453    pub async fn get_chat_message_calendar(chat_id: i64, filter: crate::enums::SearchMessagesFilter, from_message_id: i64, client_id: i32) -> Result<crate::enums::MessageCalendar, crate::types::Error> {
16454        let request = json!({
16455            "@type": "getChatMessageCalendar",
16456            "chat_id": chat_id,
16457            "filter": filter,
16458            "from_message_id": from_message_id,
16459        });
16460        let response = send_request(client_id, request).await;
16461        if response["@type"] == "error" {
16462            return Err(serde_json::from_value(response).unwrap())
16463        }
16464        Ok(serde_json::from_value(response).unwrap())
16465    }
16466    /// Returns approximate number of messages of the specified type in the chat
16467    /// # Arguments
16468    /// * `chat_id` - Identifier of the chat in which to count messages
16469    /// * `filter` - Filter for message content; searchMessagesFilterEmpty is unsupported in this function
16470    /// * `return_local` - Pass true to get the number of messages without sending network requests, or -1 if the number of messages is unknown locally
16471    /// * `client_id` - The client id to send the request to
16472    #[allow(clippy::too_many_arguments)]
16473    pub async fn get_chat_message_count(chat_id: i64, filter: crate::enums::SearchMessagesFilter, return_local: bool, client_id: i32) -> Result<crate::enums::Count, crate::types::Error> {
16474        let request = json!({
16475            "@type": "getChatMessageCount",
16476            "chat_id": chat_id,
16477            "filter": filter,
16478            "return_local": return_local,
16479        });
16480        let response = send_request(client_id, request).await;
16481        if response["@type"] == "error" {
16482            return Err(serde_json::from_value(response).unwrap())
16483        }
16484        Ok(serde_json::from_value(response).unwrap())
16485    }
16486    /// Returns approximate 1-based position of a message among messages, which can be found by the specified filter in the chat. Cannot be used in secret chats
16487    /// # Arguments
16488    /// * `chat_id` - Identifier of the chat in which to find message position
16489    /// * `message_id` - Message identifier
16490    /// * `filter` - Filter for message content; searchMessagesFilterEmpty, searchMessagesFilterUnreadMention, searchMessagesFilterUnreadReaction, and searchMessagesFilterFailedToSend are unsupported in this function
16491    /// * `message_thread_id` - If not 0, only messages in the specified thread will be considered; supergroups only
16492    /// * `client_id` - The client id to send the request to
16493    #[allow(clippy::too_many_arguments)]
16494    pub async fn get_chat_message_position(chat_id: i64, message_id: i64, filter: crate::enums::SearchMessagesFilter, message_thread_id: i64, client_id: i32) -> Result<crate::enums::Count, crate::types::Error> {
16495        let request = json!({
16496            "@type": "getChatMessagePosition",
16497            "chat_id": chat_id,
16498            "message_id": message_id,
16499            "filter": filter,
16500            "message_thread_id": message_thread_id,
16501        });
16502        let response = send_request(client_id, request).await;
16503        if response["@type"] == "error" {
16504            return Err(serde_json::from_value(response).unwrap())
16505        }
16506        Ok(serde_json::from_value(response).unwrap())
16507    }
16508    /// Returns all scheduled messages in a chat. The messages are returned in a reverse chronological order (i.e., in order of decreasing message_id)
16509    /// # Arguments
16510    /// * `chat_id` - Chat identifier
16511    /// * `client_id` - The client id to send the request to
16512    #[allow(clippy::too_many_arguments)]
16513    pub async fn get_chat_scheduled_messages(chat_id: i64, client_id: i32) -> Result<crate::enums::Messages, crate::types::Error> {
16514        let request = json!({
16515            "@type": "getChatScheduledMessages",
16516            "chat_id": chat_id,
16517        });
16518        let response = send_request(client_id, request).await;
16519        if response["@type"] == "error" {
16520            return Err(serde_json::from_value(response).unwrap())
16521        }
16522        Ok(serde_json::from_value(response).unwrap())
16523    }
16524    /// Returns forwarded copies of a channel message to different public channels. For optimal performance, the number of returned messages is chosen by TDLib
16525    /// # Arguments
16526    /// * `chat_id` - Chat identifier of the message
16527    /// * `message_id` - Message identifier
16528    /// * `offset` - Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results
16529    /// * `limit` - The maximum number of messages to be returned; must be positive and can't be greater than 100. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit
16530    /// * `client_id` - The client id to send the request to
16531    #[allow(clippy::too_many_arguments)]
16532    pub async fn get_message_public_forwards(chat_id: i64, message_id: i64, offset: String, limit: i32, client_id: i32) -> Result<crate::enums::FoundMessages, crate::types::Error> {
16533        let request = json!({
16534            "@type": "getMessagePublicForwards",
16535            "chat_id": chat_id,
16536            "message_id": message_id,
16537            "offset": offset,
16538            "limit": limit,
16539        });
16540        let response = send_request(client_id, request).await;
16541        if response["@type"] == "error" {
16542            return Err(serde_json::from_value(response).unwrap())
16543        }
16544        Ok(serde_json::from_value(response).unwrap())
16545    }
16546    /// Returns sponsored messages to be shown in a chat; for channel chats only
16547    /// # Arguments
16548    /// * `chat_id` - Identifier of the chat
16549    /// * `client_id` - The client id to send the request to
16550    #[allow(clippy::too_many_arguments)]
16551    pub async fn get_chat_sponsored_messages(chat_id: i64, client_id: i32) -> Result<crate::enums::SponsoredMessages, crate::types::Error> {
16552        let request = json!({
16553            "@type": "getChatSponsoredMessages",
16554            "chat_id": chat_id,
16555        });
16556        let response = send_request(client_id, request).await;
16557        if response["@type"] == "error" {
16558            return Err(serde_json::from_value(response).unwrap())
16559        }
16560        Ok(serde_json::from_value(response).unwrap())
16561    }
16562    /// Informs TDLib that the user opened the sponsored chat via the button, the name, the photo, or a mention in the sponsored message
16563    /// # Arguments
16564    /// * `chat_id` - Chat identifier of the sponsored message
16565    /// * `message_id` - Identifier of the sponsored message
16566    /// * `client_id` - The client id to send the request to
16567    #[allow(clippy::too_many_arguments)]
16568    pub async fn click_chat_sponsored_message(chat_id: i64, message_id: i64, client_id: i32) -> Result<(), crate::types::Error> {
16569        let request = json!({
16570            "@type": "clickChatSponsoredMessage",
16571            "chat_id": chat_id,
16572            "message_id": message_id,
16573        });
16574        let response = send_request(client_id, request).await;
16575        if response["@type"] == "error" {
16576            return Err(serde_json::from_value(response).unwrap())
16577        }
16578        Ok(())
16579    }
16580    /// Removes an active notification from notification list. Needs to be called only if the notification is removed by the current user
16581    /// # Arguments
16582    /// * `notification_group_id` - Identifier of notification group to which the notification belongs
16583    /// * `notification_id` - Identifier of removed notification
16584    /// * `client_id` - The client id to send the request to
16585    #[allow(clippy::too_many_arguments)]
16586    pub async fn remove_notification(notification_group_id: i32, notification_id: i32, client_id: i32) -> Result<(), crate::types::Error> {
16587        let request = json!({
16588            "@type": "removeNotification",
16589            "notification_group_id": notification_group_id,
16590            "notification_id": notification_id,
16591        });
16592        let response = send_request(client_id, request).await;
16593        if response["@type"] == "error" {
16594            return Err(serde_json::from_value(response).unwrap())
16595        }
16596        Ok(())
16597    }
16598    /// Removes a group of active notifications. Needs to be called only if the notification group is removed by the current user
16599    /// # Arguments
16600    /// * `notification_group_id` - Notification group identifier
16601    /// * `max_notification_id` - The maximum identifier of removed notifications
16602    /// * `client_id` - The client id to send the request to
16603    #[allow(clippy::too_many_arguments)]
16604    pub async fn remove_notification_group(notification_group_id: i32, max_notification_id: i32, client_id: i32) -> Result<(), crate::types::Error> {
16605        let request = json!({
16606            "@type": "removeNotificationGroup",
16607            "notification_group_id": notification_group_id,
16608            "max_notification_id": max_notification_id,
16609        });
16610        let response = send_request(client_id, request).await;
16611        if response["@type"] == "error" {
16612            return Err(serde_json::from_value(response).unwrap())
16613        }
16614        Ok(())
16615    }
16616    /// Returns an HTTPS link to a message in a chat. Available only for already sent messages in supergroups and channels, or if message.can_get_media_timestamp_links and a media timestamp link is generated. This is an offline request
16617    /// # Arguments
16618    /// * `chat_id` - Identifier of the chat to which the message belongs
16619    /// * `message_id` - Identifier of the message
16620    /// * `media_timestamp` - If not 0, timestamp from which the video/audio/video note/voice note playing must start, in seconds. The media can be in the message content or in its web page preview
16621    /// * `for_album` - Pass true to create a link for the whole media album
16622    /// * `in_message_thread` - Pass true to create a link to the message as a channel post comment, in a message thread, or a forum topic
16623    /// * `client_id` - The client id to send the request to
16624    #[allow(clippy::too_many_arguments)]
16625    pub async fn get_message_link(chat_id: i64, message_id: i64, media_timestamp: i32, for_album: bool, in_message_thread: bool, client_id: i32) -> Result<crate::enums::MessageLink, crate::types::Error> {
16626        let request = json!({
16627            "@type": "getMessageLink",
16628            "chat_id": chat_id,
16629            "message_id": message_id,
16630            "media_timestamp": media_timestamp,
16631            "for_album": for_album,
16632            "in_message_thread": in_message_thread,
16633        });
16634        let response = send_request(client_id, request).await;
16635        if response["@type"] == "error" {
16636            return Err(serde_json::from_value(response).unwrap())
16637        }
16638        Ok(serde_json::from_value(response).unwrap())
16639    }
16640    /// Returns an HTML code for embedding the message. Available only for messages in supergroups and channels with a username
16641    /// # Arguments
16642    /// * `chat_id` - Identifier of the chat to which the message belongs
16643    /// * `message_id` - Identifier of the message
16644    /// * `for_album` - Pass true to return an HTML code for embedding of the whole media album
16645    /// * `client_id` - The client id to send the request to
16646    #[allow(clippy::too_many_arguments)]
16647    pub async fn get_message_embedding_code(chat_id: i64, message_id: i64, for_album: bool, client_id: i32) -> Result<crate::enums::Text, crate::types::Error> {
16648        let request = json!({
16649            "@type": "getMessageEmbeddingCode",
16650            "chat_id": chat_id,
16651            "message_id": message_id,
16652            "for_album": for_album,
16653        });
16654        let response = send_request(client_id, request).await;
16655        if response["@type"] == "error" {
16656            return Err(serde_json::from_value(response).unwrap())
16657        }
16658        Ok(serde_json::from_value(response).unwrap())
16659    }
16660    /// Returns information about a public or private message link. Can be called for any internal link of the type internalLinkTypeMessage
16661    /// # Arguments
16662    /// * `url` - The message link
16663    /// * `client_id` - The client id to send the request to
16664    #[allow(clippy::too_many_arguments)]
16665    pub async fn get_message_link_info(url: String, client_id: i32) -> Result<crate::enums::MessageLinkInfo, crate::types::Error> {
16666        let request = json!({
16667            "@type": "getMessageLinkInfo",
16668            "url": url,
16669        });
16670        let response = send_request(client_id, request).await;
16671        if response["@type"] == "error" {
16672            return Err(serde_json::from_value(response).unwrap())
16673        }
16674        Ok(serde_json::from_value(response).unwrap())
16675    }
16676    /// Translates a text to the given language. If the current user is a Telegram Premium user, then text formatting is preserved
16677    /// # Arguments
16678    /// * `text` - Text to translate
16679    /// * `to_language_code` - Language code of the language to which the message is translated. Must be one of
16680    /// "af", "sq", "am", "ar", "hy", "az", "eu", "be", "bn", "bs", "bg", "ca", "ceb", "zh-CN", "zh", "zh-Hans", "zh-TW", "zh-Hant", "co", "hr", "cs", "da", "nl", "en", "eo", "et",
16681    /// "fi", "fr", "fy", "gl", "ka", "de", "el", "gu", "ht", "ha", "haw", "he", "iw", "hi", "hmn", "hu", "is", "ig", "id", "in", "ga", "it", "ja", "jv", "kn", "kk", "km", "rw", "ko",
16682    /// "ku", "ky", "lo", "la", "lv", "lt", "lb", "mk", "mg", "ms", "ml", "mt", "mi", "mr", "mn", "my", "ne", "no", "ny", "or", "ps", "fa", "pl", "pt", "pa", "ro", "ru", "sm", "gd", "sr",
16683    /// "st", "sn", "sd", "si", "sk", "sl", "so", "es", "su", "sw", "sv", "tl", "tg", "ta", "tt", "te", "th", "tr", "tk", "uk", "ur", "ug", "uz", "vi", "cy", "xh", "yi", "ji", "yo", "zu"
16684    /// * `client_id` - The client id to send the request to
16685    #[allow(clippy::too_many_arguments)]
16686    pub async fn translate_text(text: crate::types::FormattedText, to_language_code: String, client_id: i32) -> Result<crate::enums::FormattedText, crate::types::Error> {
16687        let request = json!({
16688            "@type": "translateText",
16689            "text": text,
16690            "to_language_code": to_language_code,
16691        });
16692        let response = send_request(client_id, request).await;
16693        if response["@type"] == "error" {
16694            return Err(serde_json::from_value(response).unwrap())
16695        }
16696        Ok(serde_json::from_value(response).unwrap())
16697    }
16698    /// Extracts text or caption of the given message and translates it to the given language. If the current user is a Telegram Premium user, then text formatting is preserved
16699    /// # Arguments
16700    /// * `chat_id` - Identifier of the chat to which the message belongs
16701    /// * `message_id` - Identifier of the message
16702    /// * `to_language_code` - Language code of the language to which the message is translated. Must be one of
16703    /// "af", "sq", "am", "ar", "hy", "az", "eu", "be", "bn", "bs", "bg", "ca", "ceb", "zh-CN", "zh", "zh-Hans", "zh-TW", "zh-Hant", "co", "hr", "cs", "da", "nl", "en", "eo", "et",
16704    /// "fi", "fr", "fy", "gl", "ka", "de", "el", "gu", "ht", "ha", "haw", "he", "iw", "hi", "hmn", "hu", "is", "ig", "id", "in", "ga", "it", "ja", "jv", "kn", "kk", "km", "rw", "ko",
16705    /// "ku", "ky", "lo", "la", "lv", "lt", "lb", "mk", "mg", "ms", "ml", "mt", "mi", "mr", "mn", "my", "ne", "no", "ny", "or", "ps", "fa", "pl", "pt", "pa", "ro", "ru", "sm", "gd", "sr",
16706    /// "st", "sn", "sd", "si", "sk", "sl", "so", "es", "su", "sw", "sv", "tl", "tg", "ta", "tt", "te", "th", "tr", "tk", "uk", "ur", "ug", "uz", "vi", "cy", "xh", "yi", "ji", "yo", "zu"
16707    /// * `client_id` - The client id to send the request to
16708    #[allow(clippy::too_many_arguments)]
16709    pub async fn translate_message_text(chat_id: i64, message_id: i64, to_language_code: String, client_id: i32) -> Result<crate::enums::FormattedText, crate::types::Error> {
16710        let request = json!({
16711            "@type": "translateMessageText",
16712            "chat_id": chat_id,
16713            "message_id": message_id,
16714            "to_language_code": to_language_code,
16715        });
16716        let response = send_request(client_id, request).await;
16717        if response["@type"] == "error" {
16718            return Err(serde_json::from_value(response).unwrap())
16719        }
16720        Ok(serde_json::from_value(response).unwrap())
16721    }
16722    /// Recognizes speech in a video note or a voice note message. The message must be successfully sent and must not be scheduled. May return an error with a message "MSG_VOICE_TOO_LONG" if media duration is too big to be recognized
16723    /// # Arguments
16724    /// * `chat_id` - Identifier of the chat to which the message belongs
16725    /// * `message_id` - Identifier of the message
16726    /// * `client_id` - The client id to send the request to
16727    #[allow(clippy::too_many_arguments)]
16728    pub async fn recognize_speech(chat_id: i64, message_id: i64, client_id: i32) -> Result<(), crate::types::Error> {
16729        let request = json!({
16730            "@type": "recognizeSpeech",
16731            "chat_id": chat_id,
16732            "message_id": message_id,
16733        });
16734        let response = send_request(client_id, request).await;
16735        if response["@type"] == "error" {
16736            return Err(serde_json::from_value(response).unwrap())
16737        }
16738        Ok(())
16739    }
16740    /// Rates recognized speech in a video note or a voice note message
16741    /// # Arguments
16742    /// * `chat_id` - Identifier of the chat to which the message belongs
16743    /// * `message_id` - Identifier of the message
16744    /// * `is_good` - Pass true if the speech recognition is good
16745    /// * `client_id` - The client id to send the request to
16746    #[allow(clippy::too_many_arguments)]
16747    pub async fn rate_speech_recognition(chat_id: i64, message_id: i64, is_good: bool, client_id: i32) -> Result<(), crate::types::Error> {
16748        let request = json!({
16749            "@type": "rateSpeechRecognition",
16750            "chat_id": chat_id,
16751            "message_id": message_id,
16752            "is_good": is_good,
16753        });
16754        let response = send_request(client_id, request).await;
16755        if response["@type"] == "error" {
16756            return Err(serde_json::from_value(response).unwrap())
16757        }
16758        Ok(())
16759    }
16760    /// Returns list of message sender identifiers, which can be used to send messages in a chat
16761    /// # Arguments
16762    /// * `chat_id` - Chat identifier
16763    /// * `client_id` - The client id to send the request to
16764    #[allow(clippy::too_many_arguments)]
16765    pub async fn get_chat_available_message_senders(chat_id: i64, client_id: i32) -> Result<crate::enums::ChatMessageSenders, crate::types::Error> {
16766        let request = json!({
16767            "@type": "getChatAvailableMessageSenders",
16768            "chat_id": chat_id,
16769        });
16770        let response = send_request(client_id, request).await;
16771        if response["@type"] == "error" {
16772            return Err(serde_json::from_value(response).unwrap())
16773        }
16774        Ok(serde_json::from_value(response).unwrap())
16775    }
16776    /// Selects a message sender to send messages in a chat
16777    /// # Arguments
16778    /// * `chat_id` - Chat identifier
16779    /// * `message_sender_id` - New message sender for the chat
16780    /// * `client_id` - The client id to send the request to
16781    #[allow(clippy::too_many_arguments)]
16782    pub async fn set_chat_message_sender(chat_id: i64, message_sender_id: crate::enums::MessageSender, client_id: i32) -> Result<(), crate::types::Error> {
16783        let request = json!({
16784            "@type": "setChatMessageSender",
16785            "chat_id": chat_id,
16786            "message_sender_id": message_sender_id,
16787        });
16788        let response = send_request(client_id, request).await;
16789        if response["@type"] == "error" {
16790            return Err(serde_json::from_value(response).unwrap())
16791        }
16792        Ok(())
16793    }
16794    /// Sends a message. Returns the sent message
16795    /// # Arguments
16796    /// * `chat_id` - Target chat
16797    /// * `message_thread_id` - If not 0, a message thread identifier in which the message will be sent
16798    /// * `reply_to` - Identifier of the replied message or story; pass null if none
16799    /// * `options` - Options to be used to send the message; pass null to use default options
16800    /// * `reply_markup` - Markup for replying to the message; pass null if none; for bots only
16801    /// * `input_message_content` - The content of the message to be sent
16802    /// * `client_id` - The client id to send the request to
16803    #[allow(clippy::too_many_arguments)]
16804    pub async fn send_message(chat_id: i64, message_thread_id: i64, reply_to: Option<crate::enums::MessageReplyTo>, options: Option<crate::types::MessageSendOptions>, reply_markup: Option<crate::enums::ReplyMarkup>, input_message_content: crate::enums::InputMessageContent, client_id: i32) -> Result<crate::enums::Message, crate::types::Error> {
16805        let request = json!({
16806            "@type": "sendMessage",
16807            "chat_id": chat_id,
16808            "message_thread_id": message_thread_id,
16809            "reply_to": reply_to,
16810            "options": options,
16811            "reply_markup": reply_markup,
16812            "input_message_content": input_message_content,
16813        });
16814        let response = send_request(client_id, request).await;
16815        if response["@type"] == "error" {
16816            return Err(serde_json::from_value(response).unwrap())
16817        }
16818        Ok(serde_json::from_value(response).unwrap())
16819    }
16820    /// Sends 2-10 messages grouped together into an album. Currently, only audio, document, photo and video messages can be grouped into an album. Documents and audio files can be only grouped in an album with messages of the same type. Returns sent messages
16821    /// # Arguments
16822    /// * `chat_id` - Target chat
16823    /// * `message_thread_id` - If not 0, a message thread identifier in which the messages will be sent
16824    /// * `reply_to` - Identifier of the replied message or story; pass null if none
16825    /// * `options` - Options to be used to send the messages; pass null to use default options
16826    /// * `input_message_contents` - Contents of messages to be sent. At most 10 messages can be added to an album
16827    /// * `only_preview` - Pass true to get fake messages instead of actually sending them
16828    /// * `client_id` - The client id to send the request to
16829    #[allow(clippy::too_many_arguments)]
16830    pub async fn send_message_album(chat_id: i64, message_thread_id: i64, reply_to: Option<crate::enums::MessageReplyTo>, options: Option<crate::types::MessageSendOptions>, input_message_contents: Vec<crate::enums::InputMessageContent>, only_preview: bool, client_id: i32) -> Result<crate::enums::Messages, crate::types::Error> {
16831        let request = json!({
16832            "@type": "sendMessageAlbum",
16833            "chat_id": chat_id,
16834            "message_thread_id": message_thread_id,
16835            "reply_to": reply_to,
16836            "options": options,
16837            "input_message_contents": input_message_contents,
16838            "only_preview": only_preview,
16839        });
16840        let response = send_request(client_id, request).await;
16841        if response["@type"] == "error" {
16842            return Err(serde_json::from_value(response).unwrap())
16843        }
16844        Ok(serde_json::from_value(response).unwrap())
16845    }
16846    /// Invites a bot to a chat (if it is not yet a member) and sends it the /start command. Bots can't be invited to a private chat other than the chat with the bot. Bots can't be invited to channels (although they can be added as admins) and secret chats. Returns the sent message
16847    /// # Arguments
16848    /// * `bot_user_id` - Identifier of the bot
16849    /// * `chat_id` - Identifier of the target chat
16850    /// * `parameter` - A hidden parameter sent to the bot for deep linking purposes (https:core.telegram.org/bots#deep-linking)
16851    /// * `client_id` - The client id to send the request to
16852    #[allow(clippy::too_many_arguments)]
16853    pub async fn send_bot_start_message(bot_user_id: i64, chat_id: i64, parameter: String, client_id: i32) -> Result<crate::enums::Message, crate::types::Error> {
16854        let request = json!({
16855            "@type": "sendBotStartMessage",
16856            "bot_user_id": bot_user_id,
16857            "chat_id": chat_id,
16858            "parameter": parameter,
16859        });
16860        let response = send_request(client_id, request).await;
16861        if response["@type"] == "error" {
16862            return Err(serde_json::from_value(response).unwrap())
16863        }
16864        Ok(serde_json::from_value(response).unwrap())
16865    }
16866    /// Sends the result of an inline query as a message. Returns the sent message. Always clears a chat draft message
16867    /// # Arguments
16868    /// * `chat_id` - Target chat
16869    /// * `message_thread_id` - If not 0, a message thread identifier in which the message will be sent
16870    /// * `reply_to` - Identifier of the replied message or story; pass null if none
16871    /// * `options` - Options to be used to send the message; pass null to use default options
16872    /// * `query_id` - Identifier of the inline query
16873    /// * `result_id` - Identifier of the inline query result
16874    /// * `hide_via_bot` - Pass true to hide the bot, via which the message is sent. Can be used only for bots getOption("animation_search_bot_username"), getOption("photo_search_bot_username"), and getOption("venue_search_bot_username")
16875    /// * `client_id` - The client id to send the request to
16876    #[allow(clippy::too_many_arguments)]
16877    pub async fn send_inline_query_result_message(chat_id: i64, message_thread_id: i64, reply_to: Option<crate::enums::MessageReplyTo>, options: Option<crate::types::MessageSendOptions>, query_id: i64, result_id: String, hide_via_bot: bool, client_id: i32) -> Result<crate::enums::Message, crate::types::Error> {
16878        let request = json!({
16879            "@type": "sendInlineQueryResultMessage",
16880            "chat_id": chat_id,
16881            "message_thread_id": message_thread_id,
16882            "reply_to": reply_to,
16883            "options": options,
16884            "query_id": query_id,
16885            "result_id": result_id,
16886            "hide_via_bot": hide_via_bot,
16887        });
16888        let response = send_request(client_id, request).await;
16889        if response["@type"] == "error" {
16890            return Err(serde_json::from_value(response).unwrap())
16891        }
16892        Ok(serde_json::from_value(response).unwrap())
16893    }
16894    /// Forwards previously sent messages. Returns the forwarded messages in the same order as the message identifiers passed in message_ids. If a message can't be forwarded, null will be returned instead of the message
16895    /// # Arguments
16896    /// * `chat_id` - Identifier of the chat to which to forward messages
16897    /// * `message_thread_id` - If not 0, a message thread identifier in which the message will be sent; for forum threads only
16898    /// * `from_chat_id` - Identifier of the chat from which to forward messages
16899    /// * `message_ids` - Identifiers of the messages to forward. Message identifiers must be in a strictly increasing order. At most 100 messages can be forwarded simultaneously
16900    /// * `options` - Options to be used to send the messages; pass null to use default options
16901    /// * `send_copy` - Pass true to copy content of the messages without reference to the original sender. Always true if the messages are forwarded to a secret chat or are local
16902    /// * `remove_caption` - Pass true to remove media captions of message copies. Ignored if send_copy is false
16903    /// * `only_preview` - Pass true to get fake messages instead of actually forwarding them
16904    /// * `client_id` - The client id to send the request to
16905    #[allow(clippy::too_many_arguments)]
16906    pub async fn forward_messages(chat_id: i64, message_thread_id: i64, from_chat_id: i64, message_ids: Vec<i64>, options: Option<crate::types::MessageSendOptions>, send_copy: bool, remove_caption: bool, only_preview: bool, client_id: i32) -> Result<crate::enums::Messages, crate::types::Error> {
16907        let request = json!({
16908            "@type": "forwardMessages",
16909            "chat_id": chat_id,
16910            "message_thread_id": message_thread_id,
16911            "from_chat_id": from_chat_id,
16912            "message_ids": message_ids,
16913            "options": options,
16914            "send_copy": send_copy,
16915            "remove_caption": remove_caption,
16916            "only_preview": only_preview,
16917        });
16918        let response = send_request(client_id, request).await;
16919        if response["@type"] == "error" {
16920            return Err(serde_json::from_value(response).unwrap())
16921        }
16922        Ok(serde_json::from_value(response).unwrap())
16923    }
16924    /// Resends messages which failed to send. Can be called only for messages for which messageSendingStateFailed.can_retry is true and after specified in messageSendingStateFailed.retry_after time passed.
16925    /// If a message is re-sent, the corresponding failed to send message is deleted. Returns the sent messages in the same order as the message identifiers passed in message_ids. If a message can't be re-sent, null will be returned instead of the message
16926    /// # Arguments
16927    /// * `chat_id` - Identifier of the chat to send messages
16928    /// * `message_ids` - Identifiers of the messages to resend. Message identifiers must be in a strictly increasing order
16929    /// * `client_id` - The client id to send the request to
16930    #[allow(clippy::too_many_arguments)]
16931    pub async fn resend_messages(chat_id: i64, message_ids: Vec<i64>, client_id: i32) -> Result<crate::enums::Messages, crate::types::Error> {
16932        let request = json!({
16933            "@type": "resendMessages",
16934            "chat_id": chat_id,
16935            "message_ids": message_ids,
16936        });
16937        let response = send_request(client_id, request).await;
16938        if response["@type"] == "error" {
16939            return Err(serde_json::from_value(response).unwrap())
16940        }
16941        Ok(serde_json::from_value(response).unwrap())
16942    }
16943    /// Adds a local message to a chat. The message is persistent across application restarts only if the message database is used. Returns the added message
16944    /// # Arguments
16945    /// * `chat_id` - Target chat
16946    /// * `sender_id` - Identifier of the sender of the message
16947    /// * `reply_to` - Identifier of the replied message or story; pass null if none
16948    /// * `disable_notification` - Pass true to disable notification for the message
16949    /// * `input_message_content` - The content of the message to be added
16950    /// * `client_id` - The client id to send the request to
16951    #[allow(clippy::too_many_arguments)]
16952    pub async fn add_local_message(chat_id: i64, sender_id: crate::enums::MessageSender, reply_to: Option<crate::enums::MessageReplyTo>, disable_notification: bool, input_message_content: crate::enums::InputMessageContent, client_id: i32) -> Result<crate::enums::Message, crate::types::Error> {
16953        let request = json!({
16954            "@type": "addLocalMessage",
16955            "chat_id": chat_id,
16956            "sender_id": sender_id,
16957            "reply_to": reply_to,
16958            "disable_notification": disable_notification,
16959            "input_message_content": input_message_content,
16960        });
16961        let response = send_request(client_id, request).await;
16962        if response["@type"] == "error" {
16963            return Err(serde_json::from_value(response).unwrap())
16964        }
16965        Ok(serde_json::from_value(response).unwrap())
16966    }
16967    /// Deletes messages
16968    /// # Arguments
16969    /// * `chat_id` - Chat identifier
16970    /// * `message_ids` - Identifiers of the messages to be deleted
16971    /// * `revoke` - Pass true to delete messages for all chat members. Always true for supergroups, channels and secret chats
16972    /// * `client_id` - The client id to send the request to
16973    #[allow(clippy::too_many_arguments)]
16974    pub async fn delete_messages(chat_id: i64, message_ids: Vec<i64>, revoke: bool, client_id: i32) -> Result<(), crate::types::Error> {
16975        let request = json!({
16976            "@type": "deleteMessages",
16977            "chat_id": chat_id,
16978            "message_ids": message_ids,
16979            "revoke": revoke,
16980        });
16981        let response = send_request(client_id, request).await;
16982        if response["@type"] == "error" {
16983            return Err(serde_json::from_value(response).unwrap())
16984        }
16985        Ok(())
16986    }
16987    /// Deletes all messages sent by the specified message sender in a chat. Supported only for supergroups; requires can_delete_messages administrator privileges
16988    /// # Arguments
16989    /// * `chat_id` - Chat identifier
16990    /// * `sender_id` - Identifier of the sender of messages to delete
16991    /// * `client_id` - The client id to send the request to
16992    #[allow(clippy::too_many_arguments)]
16993    pub async fn delete_chat_messages_by_sender(chat_id: i64, sender_id: crate::enums::MessageSender, client_id: i32) -> Result<(), crate::types::Error> {
16994        let request = json!({
16995            "@type": "deleteChatMessagesBySender",
16996            "chat_id": chat_id,
16997            "sender_id": sender_id,
16998        });
16999        let response = send_request(client_id, request).await;
17000        if response["@type"] == "error" {
17001            return Err(serde_json::from_value(response).unwrap())
17002        }
17003        Ok(())
17004    }
17005    /// Deletes all messages between the specified dates in a chat. Supported only for private chats and basic groups. Messages sent in the last 30 seconds will not be deleted
17006    /// # Arguments
17007    /// * `chat_id` - Chat identifier
17008    /// * `min_date` - The minimum date of the messages to delete
17009    /// * `max_date` - The maximum date of the messages to delete
17010    /// * `revoke` - Pass true to delete chat messages for all users; private chats only
17011    /// * `client_id` - The client id to send the request to
17012    #[allow(clippy::too_many_arguments)]
17013    pub async fn delete_chat_messages_by_date(chat_id: i64, min_date: i32, max_date: i32, revoke: bool, client_id: i32) -> Result<(), crate::types::Error> {
17014        let request = json!({
17015            "@type": "deleteChatMessagesByDate",
17016            "chat_id": chat_id,
17017            "min_date": min_date,
17018            "max_date": max_date,
17019            "revoke": revoke,
17020        });
17021        let response = send_request(client_id, request).await;
17022        if response["@type"] == "error" {
17023            return Err(serde_json::from_value(response).unwrap())
17024        }
17025        Ok(())
17026    }
17027    /// Edits the text of a message (or a text of a game message). Returns the edited message after the edit is completed on the server side
17028    /// # Arguments
17029    /// * `chat_id` - The chat the message belongs to
17030    /// * `message_id` - Identifier of the message
17031    /// * `reply_markup` - The new message reply markup; pass null if none; for bots only
17032    /// * `input_message_content` - New text content of the message. Must be of type inputMessageText
17033    /// * `client_id` - The client id to send the request to
17034    #[allow(clippy::too_many_arguments)]
17035    pub async fn edit_message_text(chat_id: i64, message_id: i64, reply_markup: Option<crate::enums::ReplyMarkup>, input_message_content: crate::enums::InputMessageContent, client_id: i32) -> Result<crate::enums::Message, crate::types::Error> {
17036        let request = json!({
17037            "@type": "editMessageText",
17038            "chat_id": chat_id,
17039            "message_id": message_id,
17040            "reply_markup": reply_markup,
17041            "input_message_content": input_message_content,
17042        });
17043        let response = send_request(client_id, request).await;
17044        if response["@type"] == "error" {
17045            return Err(serde_json::from_value(response).unwrap())
17046        }
17047        Ok(serde_json::from_value(response).unwrap())
17048    }
17049    /// Edits the message content of a live location. Messages can be edited for a limited period of time specified in the live location. Returns the edited message after the edit is completed on the server side
17050    /// # Arguments
17051    /// * `chat_id` - The chat the message belongs to
17052    /// * `message_id` - Identifier of the message
17053    /// * `reply_markup` - The new message reply markup; pass null if none; for bots only
17054    /// * `location` - New location content of the message; pass null to stop sharing the live location
17055    /// * `heading` - The new direction in which the location moves, in degrees; 1-360. Pass 0 if unknown
17056    /// * `proximity_alert_radius` - The new maximum distance for proximity alerts, in meters (0-100000). Pass 0 if the notification is disabled
17057    /// * `client_id` - The client id to send the request to
17058    #[allow(clippy::too_many_arguments)]
17059    pub async fn edit_message_live_location(chat_id: i64, message_id: i64, reply_markup: Option<crate::enums::ReplyMarkup>, location: Option<crate::types::Location>, heading: i32, proximity_alert_radius: i32, client_id: i32) -> Result<crate::enums::Message, crate::types::Error> {
17060        let request = json!({
17061            "@type": "editMessageLiveLocation",
17062            "chat_id": chat_id,
17063            "message_id": message_id,
17064            "reply_markup": reply_markup,
17065            "location": location,
17066            "heading": heading,
17067            "proximity_alert_radius": proximity_alert_radius,
17068        });
17069        let response = send_request(client_id, request).await;
17070        if response["@type"] == "error" {
17071            return Err(serde_json::from_value(response).unwrap())
17072        }
17073        Ok(serde_json::from_value(response).unwrap())
17074    }
17075    /// Edits the content of a message with an animation, an audio, a document, a photo or a video, including message caption. If only the caption needs to be edited, use editMessageCaption instead.
17076    /// The media can't be edited if the message was set to self-destruct or to a self-destructing media. The type of message content in an album can't be changed with exception of replacing a photo with a video or vice versa. Returns the edited message after the edit is completed on the server side
17077    /// # Arguments
17078    /// * `chat_id` - The chat the message belongs to
17079    /// * `message_id` - Identifier of the message
17080    /// * `reply_markup` - The new message reply markup; pass null if none; for bots only
17081    /// * `input_message_content` - New content of the message. Must be one of the following types: inputMessageAnimation, inputMessageAudio, inputMessageDocument, inputMessagePhoto or inputMessageVideo
17082    /// * `client_id` - The client id to send the request to
17083    #[allow(clippy::too_many_arguments)]
17084    pub async fn edit_message_media(chat_id: i64, message_id: i64, reply_markup: Option<crate::enums::ReplyMarkup>, input_message_content: crate::enums::InputMessageContent, client_id: i32) -> Result<crate::enums::Message, crate::types::Error> {
17085        let request = json!({
17086            "@type": "editMessageMedia",
17087            "chat_id": chat_id,
17088            "message_id": message_id,
17089            "reply_markup": reply_markup,
17090            "input_message_content": input_message_content,
17091        });
17092        let response = send_request(client_id, request).await;
17093        if response["@type"] == "error" {
17094            return Err(serde_json::from_value(response).unwrap())
17095        }
17096        Ok(serde_json::from_value(response).unwrap())
17097    }
17098    /// Edits the message content caption. Returns the edited message after the edit is completed on the server side
17099    /// # Arguments
17100    /// * `chat_id` - The chat the message belongs to
17101    /// * `message_id` - Identifier of the message
17102    /// * `reply_markup` - The new message reply markup; pass null if none; for bots only
17103    /// * `caption` - New message content caption; 0-getOption("message_caption_length_max") characters; pass null to remove caption
17104    /// * `client_id` - The client id to send the request to
17105    #[allow(clippy::too_many_arguments)]
17106    pub async fn edit_message_caption(chat_id: i64, message_id: i64, reply_markup: Option<crate::enums::ReplyMarkup>, caption: Option<crate::types::FormattedText>, client_id: i32) -> Result<crate::enums::Message, crate::types::Error> {
17107        let request = json!({
17108            "@type": "editMessageCaption",
17109            "chat_id": chat_id,
17110            "message_id": message_id,
17111            "reply_markup": reply_markup,
17112            "caption": caption,
17113        });
17114        let response = send_request(client_id, request).await;
17115        if response["@type"] == "error" {
17116            return Err(serde_json::from_value(response).unwrap())
17117        }
17118        Ok(serde_json::from_value(response).unwrap())
17119    }
17120    /// Edits the message reply markup; for bots only. Returns the edited message after the edit is completed on the server side
17121    /// # Arguments
17122    /// * `chat_id` - The chat the message belongs to
17123    /// * `message_id` - Identifier of the message
17124    /// * `reply_markup` - The new message reply markup; pass null if none
17125    /// * `client_id` - The client id to send the request to
17126    #[allow(clippy::too_many_arguments)]
17127    pub async fn edit_message_reply_markup(chat_id: i64, message_id: i64, reply_markup: Option<crate::enums::ReplyMarkup>, client_id: i32) -> Result<crate::enums::Message, crate::types::Error> {
17128        let request = json!({
17129            "@type": "editMessageReplyMarkup",
17130            "chat_id": chat_id,
17131            "message_id": message_id,
17132            "reply_markup": reply_markup,
17133        });
17134        let response = send_request(client_id, request).await;
17135        if response["@type"] == "error" {
17136            return Err(serde_json::from_value(response).unwrap())
17137        }
17138        Ok(serde_json::from_value(response).unwrap())
17139    }
17140    /// Edits the text of an inline text or game message sent via a bot; for bots only
17141    /// # Arguments
17142    /// * `inline_message_id` - Inline message identifier
17143    /// * `reply_markup` - The new message reply markup; pass null if none
17144    /// * `input_message_content` - New text content of the message. Must be of type inputMessageText
17145    /// * `client_id` - The client id to send the request to
17146    #[allow(clippy::too_many_arguments)]
17147    pub async fn edit_inline_message_text(inline_message_id: String, reply_markup: Option<crate::enums::ReplyMarkup>, input_message_content: crate::enums::InputMessageContent, client_id: i32) -> Result<(), crate::types::Error> {
17148        let request = json!({
17149            "@type": "editInlineMessageText",
17150            "inline_message_id": inline_message_id,
17151            "reply_markup": reply_markup,
17152            "input_message_content": input_message_content,
17153        });
17154        let response = send_request(client_id, request).await;
17155        if response["@type"] == "error" {
17156            return Err(serde_json::from_value(response).unwrap())
17157        }
17158        Ok(())
17159    }
17160    /// Edits the content of a live location in an inline message sent via a bot; for bots only
17161    /// # Arguments
17162    /// * `inline_message_id` - Inline message identifier
17163    /// * `reply_markup` - The new message reply markup; pass null if none
17164    /// * `location` - New location content of the message; pass null to stop sharing the live location
17165    /// * `heading` - The new direction in which the location moves, in degrees; 1-360. Pass 0 if unknown
17166    /// * `proximity_alert_radius` - The new maximum distance for proximity alerts, in meters (0-100000). Pass 0 if the notification is disabled
17167    /// * `client_id` - The client id to send the request to
17168    #[allow(clippy::too_many_arguments)]
17169    pub async fn edit_inline_message_live_location(inline_message_id: String, reply_markup: Option<crate::enums::ReplyMarkup>, location: Option<crate::types::Location>, heading: i32, proximity_alert_radius: i32, client_id: i32) -> Result<(), crate::types::Error> {
17170        let request = json!({
17171            "@type": "editInlineMessageLiveLocation",
17172            "inline_message_id": inline_message_id,
17173            "reply_markup": reply_markup,
17174            "location": location,
17175            "heading": heading,
17176            "proximity_alert_radius": proximity_alert_radius,
17177        });
17178        let response = send_request(client_id, request).await;
17179        if response["@type"] == "error" {
17180            return Err(serde_json::from_value(response).unwrap())
17181        }
17182        Ok(())
17183    }
17184    /// Edits the content of a message with an animation, an audio, a document, a photo or a video in an inline message sent via a bot; for bots only
17185    /// # Arguments
17186    /// * `inline_message_id` - Inline message identifier
17187    /// * `reply_markup` - The new message reply markup; pass null if none; for bots only
17188    /// * `input_message_content` - New content of the message. Must be one of the following types: inputMessageAnimation, inputMessageAudio, inputMessageDocument, inputMessagePhoto or inputMessageVideo
17189    /// * `client_id` - The client id to send the request to
17190    #[allow(clippy::too_many_arguments)]
17191    pub async fn edit_inline_message_media(inline_message_id: String, reply_markup: Option<crate::enums::ReplyMarkup>, input_message_content: crate::enums::InputMessageContent, client_id: i32) -> Result<(), crate::types::Error> {
17192        let request = json!({
17193            "@type": "editInlineMessageMedia",
17194            "inline_message_id": inline_message_id,
17195            "reply_markup": reply_markup,
17196            "input_message_content": input_message_content,
17197        });
17198        let response = send_request(client_id, request).await;
17199        if response["@type"] == "error" {
17200            return Err(serde_json::from_value(response).unwrap())
17201        }
17202        Ok(())
17203    }
17204    /// Edits the caption of an inline message sent via a bot; for bots only
17205    /// # Arguments
17206    /// * `inline_message_id` - Inline message identifier
17207    /// * `reply_markup` - The new message reply markup; pass null if none
17208    /// * `caption` - New message content caption; pass null to remove caption; 0-getOption("message_caption_length_max") characters
17209    /// * `client_id` - The client id to send the request to
17210    #[allow(clippy::too_many_arguments)]
17211    pub async fn edit_inline_message_caption(inline_message_id: String, reply_markup: Option<crate::enums::ReplyMarkup>, caption: Option<crate::types::FormattedText>, client_id: i32) -> Result<(), crate::types::Error> {
17212        let request = json!({
17213            "@type": "editInlineMessageCaption",
17214            "inline_message_id": inline_message_id,
17215            "reply_markup": reply_markup,
17216            "caption": caption,
17217        });
17218        let response = send_request(client_id, request).await;
17219        if response["@type"] == "error" {
17220            return Err(serde_json::from_value(response).unwrap())
17221        }
17222        Ok(())
17223    }
17224    /// Edits the reply markup of an inline message sent via a bot; for bots only
17225    /// # Arguments
17226    /// * `inline_message_id` - Inline message identifier
17227    /// * `reply_markup` - The new message reply markup; pass null if none
17228    /// * `client_id` - The client id to send the request to
17229    #[allow(clippy::too_many_arguments)]
17230    pub async fn edit_inline_message_reply_markup(inline_message_id: String, reply_markup: Option<crate::enums::ReplyMarkup>, client_id: i32) -> Result<(), crate::types::Error> {
17231        let request = json!({
17232            "@type": "editInlineMessageReplyMarkup",
17233            "inline_message_id": inline_message_id,
17234            "reply_markup": reply_markup,
17235        });
17236        let response = send_request(client_id, request).await;
17237        if response["@type"] == "error" {
17238            return Err(serde_json::from_value(response).unwrap())
17239        }
17240        Ok(())
17241    }
17242    /// Edits the time when a scheduled message will be sent. Scheduling state of all messages in the same album or forwarded together with the message will be also changed
17243    /// # Arguments
17244    /// * `chat_id` - The chat the message belongs to
17245    /// * `message_id` - Identifier of the message
17246    /// * `scheduling_state` - The new message scheduling state; pass null to send the message immediately
17247    /// * `client_id` - The client id to send the request to
17248    #[allow(clippy::too_many_arguments)]
17249    pub async fn edit_message_scheduling_state(chat_id: i64, message_id: i64, scheduling_state: Option<crate::enums::MessageSchedulingState>, client_id: i32) -> Result<(), crate::types::Error> {
17250        let request = json!({
17251            "@type": "editMessageSchedulingState",
17252            "chat_id": chat_id,
17253            "message_id": message_id,
17254            "scheduling_state": scheduling_state,
17255        });
17256        let response = send_request(client_id, request).await;
17257        if response["@type"] == "error" {
17258            return Err(serde_json::from_value(response).unwrap())
17259        }
17260        Ok(())
17261    }
17262    /// Returns list of custom emojis, which can be used as forum topic icon by all users
17263    /// # Arguments
17264    /// * `client_id` - The client id to send the request to
17265    #[allow(clippy::too_many_arguments)]
17266    pub async fn get_forum_topic_default_icons(client_id: i32) -> Result<crate::enums::Stickers, crate::types::Error> {
17267        let request = json!({
17268            "@type": "getForumTopicDefaultIcons",
17269        });
17270        let response = send_request(client_id, request).await;
17271        if response["@type"] == "error" {
17272            return Err(serde_json::from_value(response).unwrap())
17273        }
17274        Ok(serde_json::from_value(response).unwrap())
17275    }
17276    /// Creates a topic in a forum supergroup chat; requires can_manage_topics rights in the supergroup
17277    /// # Arguments
17278    /// * `chat_id` - Identifier of the chat
17279    /// * `name` - Name of the topic; 1-128 characters
17280    /// * `icon` - Icon of the topic. Icon color must be one of 0x6FB9F0, 0xFFD67E, 0xCB86DB, 0x8EEE98, 0xFF93B2, or 0xFB6F5F. Telegram Premium users can use any custom emoji as topic icon, other users can use only a custom emoji returned by getForumTopicDefaultIcons
17281    /// * `client_id` - The client id to send the request to
17282    #[allow(clippy::too_many_arguments)]
17283    pub async fn create_forum_topic(chat_id: i64, name: String, icon: crate::types::ForumTopicIcon, client_id: i32) -> Result<crate::enums::ForumTopicInfo, crate::types::Error> {
17284        let request = json!({
17285            "@type": "createForumTopic",
17286            "chat_id": chat_id,
17287            "name": name,
17288            "icon": icon,
17289        });
17290        let response = send_request(client_id, request).await;
17291        if response["@type"] == "error" {
17292            return Err(serde_json::from_value(response).unwrap())
17293        }
17294        Ok(serde_json::from_value(response).unwrap())
17295    }
17296    /// Edits title and icon of a topic in a forum supergroup chat; requires can_manage_topics administrator right in the supergroup unless the user is creator of the topic
17297    /// # Arguments
17298    /// * `chat_id` - Identifier of the chat
17299    /// * `message_thread_id` - Message thread identifier of the forum topic
17300    /// * `name` - New name of the topic; 0-128 characters. If empty, the previous topic name is kept
17301    /// * `edit_icon_custom_emoji` - Pass true to edit the icon of the topic. Icon of the General topic can't be edited
17302    /// * `icon_custom_emoji_id` - Identifier of the new custom emoji for topic icon; pass 0 to remove the custom emoji. Ignored if edit_icon_custom_emoji is false. Telegram Premium users can use any custom emoji, other users can use only a custom emoji returned by getForumTopicDefaultIcons
17303    /// * `client_id` - The client id to send the request to
17304    #[allow(clippy::too_many_arguments)]
17305    pub async fn edit_forum_topic(chat_id: i64, message_thread_id: i64, name: String, edit_icon_custom_emoji: bool, icon_custom_emoji_id: i64, client_id: i32) -> Result<(), crate::types::Error> {
17306        let request = json!({
17307            "@type": "editForumTopic",
17308            "chat_id": chat_id,
17309            "message_thread_id": message_thread_id,
17310            "name": name,
17311            "edit_icon_custom_emoji": edit_icon_custom_emoji,
17312            "icon_custom_emoji_id": icon_custom_emoji_id,
17313        });
17314        let response = send_request(client_id, request).await;
17315        if response["@type"] == "error" {
17316            return Err(serde_json::from_value(response).unwrap())
17317        }
17318        Ok(())
17319    }
17320    /// Returns information about a forum topic
17321    /// # Arguments
17322    /// * `chat_id` - Identifier of the chat
17323    /// * `message_thread_id` - Message thread identifier of the forum topic
17324    /// * `client_id` - The client id to send the request to
17325    #[allow(clippy::too_many_arguments)]
17326    pub async fn get_forum_topic(chat_id: i64, message_thread_id: i64, client_id: i32) -> Result<crate::enums::ForumTopic, crate::types::Error> {
17327        let request = json!({
17328            "@type": "getForumTopic",
17329            "chat_id": chat_id,
17330            "message_thread_id": message_thread_id,
17331        });
17332        let response = send_request(client_id, request).await;
17333        if response["@type"] == "error" {
17334            return Err(serde_json::from_value(response).unwrap())
17335        }
17336        Ok(serde_json::from_value(response).unwrap())
17337    }
17338    /// Returns an HTTPS link to a topic in a forum chat. This is an offline request
17339    /// # Arguments
17340    /// * `chat_id` - Identifier of the chat
17341    /// * `message_thread_id` - Message thread identifier of the forum topic
17342    /// * `client_id` - The client id to send the request to
17343    #[allow(clippy::too_many_arguments)]
17344    pub async fn get_forum_topic_link(chat_id: i64, message_thread_id: i64, client_id: i32) -> Result<crate::enums::MessageLink, crate::types::Error> {
17345        let request = json!({
17346            "@type": "getForumTopicLink",
17347            "chat_id": chat_id,
17348            "message_thread_id": message_thread_id,
17349        });
17350        let response = send_request(client_id, request).await;
17351        if response["@type"] == "error" {
17352            return Err(serde_json::from_value(response).unwrap())
17353        }
17354        Ok(serde_json::from_value(response).unwrap())
17355    }
17356    /// Returns found forum topics in a forum chat. This is a temporary method for getting information about topic list from the server
17357    /// # Arguments
17358    /// * `chat_id` - Identifier of the forum chat
17359    /// * `query` - Query to search for in the forum topic's name
17360    /// * `offset_date` - The date starting from which the results need to be fetched. Use 0 or any date in the future to get results from the last topic
17361    /// * `offset_message_id` - The message identifier of the last message in the last found topic, or 0 for the first request
17362    /// * `offset_message_thread_id` - The message thread identifier of the last found topic, or 0 for the first request
17363    /// * `limit` - The maximum number of forum topics to be returned; up to 100. For optimal performance, the number of returned forum topics is chosen by TDLib and can be smaller than the specified limit
17364    /// * `client_id` - The client id to send the request to
17365    #[allow(clippy::too_many_arguments)]
17366    pub async fn get_forum_topics(chat_id: i64, query: String, offset_date: i32, offset_message_id: i64, offset_message_thread_id: i64, limit: i32, client_id: i32) -> Result<crate::enums::ForumTopics, crate::types::Error> {
17367        let request = json!({
17368            "@type": "getForumTopics",
17369            "chat_id": chat_id,
17370            "query": query,
17371            "offset_date": offset_date,
17372            "offset_message_id": offset_message_id,
17373            "offset_message_thread_id": offset_message_thread_id,
17374            "limit": limit,
17375        });
17376        let response = send_request(client_id, request).await;
17377        if response["@type"] == "error" {
17378            return Err(serde_json::from_value(response).unwrap())
17379        }
17380        Ok(serde_json::from_value(response).unwrap())
17381    }
17382    /// Changes the notification settings of a forum topic
17383    /// # Arguments
17384    /// * `chat_id` - Chat identifier
17385    /// * `message_thread_id` - Message thread identifier of the forum topic
17386    /// * `notification_settings` - New notification settings for the forum topic. If the topic is muted for more than 366 days, it is considered to be muted forever
17387    /// * `client_id` - The client id to send the request to
17388    #[allow(clippy::too_many_arguments)]
17389    pub async fn set_forum_topic_notification_settings(chat_id: i64, message_thread_id: i64, notification_settings: crate::types::ChatNotificationSettings, client_id: i32) -> Result<(), crate::types::Error> {
17390        let request = json!({
17391            "@type": "setForumTopicNotificationSettings",
17392            "chat_id": chat_id,
17393            "message_thread_id": message_thread_id,
17394            "notification_settings": notification_settings,
17395        });
17396        let response = send_request(client_id, request).await;
17397        if response["@type"] == "error" {
17398            return Err(serde_json::from_value(response).unwrap())
17399        }
17400        Ok(())
17401    }
17402    /// Toggles whether a topic is closed in a forum supergroup chat; requires can_manage_topics administrator right in the supergroup unless the user is creator of the topic
17403    /// # Arguments
17404    /// * `chat_id` - Identifier of the chat
17405    /// * `message_thread_id` - Message thread identifier of the forum topic
17406    /// * `is_closed` - Pass true to close the topic; pass false to reopen it
17407    /// * `client_id` - The client id to send the request to
17408    #[allow(clippy::too_many_arguments)]
17409    pub async fn toggle_forum_topic_is_closed(chat_id: i64, message_thread_id: i64, is_closed: bool, client_id: i32) -> Result<(), crate::types::Error> {
17410        let request = json!({
17411            "@type": "toggleForumTopicIsClosed",
17412            "chat_id": chat_id,
17413            "message_thread_id": message_thread_id,
17414            "is_closed": is_closed,
17415        });
17416        let response = send_request(client_id, request).await;
17417        if response["@type"] == "error" {
17418            return Err(serde_json::from_value(response).unwrap())
17419        }
17420        Ok(())
17421    }
17422    /// Toggles whether a General topic is hidden in a forum supergroup chat; requires can_manage_topics administrator right in the supergroup
17423    /// # Arguments
17424    /// * `chat_id` - Identifier of the chat
17425    /// * `is_hidden` - Pass true to hide and close the General topic; pass false to unhide it
17426    /// * `client_id` - The client id to send the request to
17427    #[allow(clippy::too_many_arguments)]
17428    pub async fn toggle_general_forum_topic_is_hidden(chat_id: i64, is_hidden: bool, client_id: i32) -> Result<(), crate::types::Error> {
17429        let request = json!({
17430            "@type": "toggleGeneralForumTopicIsHidden",
17431            "chat_id": chat_id,
17432            "is_hidden": is_hidden,
17433        });
17434        let response = send_request(client_id, request).await;
17435        if response["@type"] == "error" {
17436            return Err(serde_json::from_value(response).unwrap())
17437        }
17438        Ok(())
17439    }
17440    /// Changes the pinned state of a forum topic; requires can_manage_topics administrator right in the supergroup. There can be up to getOption("pinned_forum_topic_count_max") pinned forum topics
17441    /// # Arguments
17442    /// * `chat_id` - Chat identifier
17443    /// * `message_thread_id` - Message thread identifier of the forum topic
17444    /// * `is_pinned` - Pass true to pin the topic; pass false to unpin it
17445    /// * `client_id` - The client id to send the request to
17446    #[allow(clippy::too_many_arguments)]
17447    pub async fn toggle_forum_topic_is_pinned(chat_id: i64, message_thread_id: i64, is_pinned: bool, client_id: i32) -> Result<(), crate::types::Error> {
17448        let request = json!({
17449            "@type": "toggleForumTopicIsPinned",
17450            "chat_id": chat_id,
17451            "message_thread_id": message_thread_id,
17452            "is_pinned": is_pinned,
17453        });
17454        let response = send_request(client_id, request).await;
17455        if response["@type"] == "error" {
17456            return Err(serde_json::from_value(response).unwrap())
17457        }
17458        Ok(())
17459    }
17460    /// Changes the order of pinned forum topics
17461    /// # Arguments
17462    /// * `chat_id` - Chat identifier
17463    /// * `message_thread_ids` - The new list of pinned forum topics
17464    /// * `client_id` - The client id to send the request to
17465    #[allow(clippy::too_many_arguments)]
17466    pub async fn set_pinned_forum_topics(chat_id: i64, message_thread_ids: Vec<i64>, client_id: i32) -> Result<(), crate::types::Error> {
17467        let request = json!({
17468            "@type": "setPinnedForumTopics",
17469            "chat_id": chat_id,
17470            "message_thread_ids": message_thread_ids,
17471        });
17472        let response = send_request(client_id, request).await;
17473        if response["@type"] == "error" {
17474            return Err(serde_json::from_value(response).unwrap())
17475        }
17476        Ok(())
17477    }
17478    /// Deletes all messages in a forum topic; requires can_delete_messages administrator right in the supergroup unless the user is creator of the topic, the topic has no messages from other users and has at most 11 messages
17479    /// # Arguments
17480    /// * `chat_id` - Identifier of the chat
17481    /// * `message_thread_id` - Message thread identifier of the forum topic
17482    /// * `client_id` - The client id to send the request to
17483    #[allow(clippy::too_many_arguments)]
17484    pub async fn delete_forum_topic(chat_id: i64, message_thread_id: i64, client_id: i32) -> Result<(), crate::types::Error> {
17485        let request = json!({
17486            "@type": "deleteForumTopic",
17487            "chat_id": chat_id,
17488            "message_thread_id": message_thread_id,
17489        });
17490        let response = send_request(client_id, request).await;
17491        if response["@type"] == "error" {
17492            return Err(serde_json::from_value(response).unwrap())
17493        }
17494        Ok(())
17495    }
17496    /// Returns information about a emoji reaction. Returns a 404 error if the reaction is not found
17497    /// # Arguments
17498    /// * `emoji` - Text representation of the reaction
17499    /// * `client_id` - The client id to send the request to
17500    #[allow(clippy::too_many_arguments)]
17501    pub async fn get_emoji_reaction(emoji: String, client_id: i32) -> Result<crate::enums::EmojiReaction, crate::types::Error> {
17502        let request = json!({
17503            "@type": "getEmojiReaction",
17504            "emoji": emoji,
17505        });
17506        let response = send_request(client_id, request).await;
17507        if response["@type"] == "error" {
17508            return Err(serde_json::from_value(response).unwrap())
17509        }
17510        Ok(serde_json::from_value(response).unwrap())
17511    }
17512    /// Returns TGS stickers with generic animations for custom emoji reactions
17513    /// # Arguments
17514    /// * `client_id` - The client id to send the request to
17515    #[allow(clippy::too_many_arguments)]
17516    pub async fn get_custom_emoji_reaction_animations(client_id: i32) -> Result<crate::enums::Stickers, crate::types::Error> {
17517        let request = json!({
17518            "@type": "getCustomEmojiReactionAnimations",
17519        });
17520        let response = send_request(client_id, request).await;
17521        if response["@type"] == "error" {
17522            return Err(serde_json::from_value(response).unwrap())
17523        }
17524        Ok(serde_json::from_value(response).unwrap())
17525    }
17526    /// Returns reactions, which can be added to a message. The list can change after updateActiveEmojiReactions, updateChatAvailableReactions for the chat, or updateMessageInteractionInfo for the message
17527    /// # Arguments
17528    /// * `chat_id` - Identifier of the chat to which the message belongs
17529    /// * `message_id` - Identifier of the message
17530    /// * `row_size` - Number of reaction per row, 5-25
17531    /// * `client_id` - The client id to send the request to
17532    #[allow(clippy::too_many_arguments)]
17533    pub async fn get_message_available_reactions(chat_id: i64, message_id: i64, row_size: i32, client_id: i32) -> Result<crate::enums::AvailableReactions, crate::types::Error> {
17534        let request = json!({
17535            "@type": "getMessageAvailableReactions",
17536            "chat_id": chat_id,
17537            "message_id": message_id,
17538            "row_size": row_size,
17539        });
17540        let response = send_request(client_id, request).await;
17541        if response["@type"] == "error" {
17542            return Err(serde_json::from_value(response).unwrap())
17543        }
17544        Ok(serde_json::from_value(response).unwrap())
17545    }
17546    /// Clears the list of recently used reactions
17547    /// # Arguments
17548    /// * `client_id` - The client id to send the request to
17549    #[allow(clippy::too_many_arguments)]
17550    pub async fn clear_recent_reactions(client_id: i32) -> Result<(), crate::types::Error> {
17551        let request = json!({
17552            "@type": "clearRecentReactions",
17553        });
17554        let response = send_request(client_id, request).await;
17555        if response["@type"] == "error" {
17556            return Err(serde_json::from_value(response).unwrap())
17557        }
17558        Ok(())
17559    }
17560    /// Adds a reaction to a message. Use getMessageAvailableReactions to receive the list of available reactions for the message
17561    /// # Arguments
17562    /// * `chat_id` - Identifier of the chat to which the message belongs
17563    /// * `message_id` - Identifier of the message
17564    /// * `reaction_type` - Type of the reaction to add
17565    /// * `is_big` - Pass true if the reaction is added with a big animation
17566    /// * `update_recent_reactions` - Pass true if the reaction needs to be added to recent reactions
17567    /// * `client_id` - The client id to send the request to
17568    #[allow(clippy::too_many_arguments)]
17569    pub async fn add_message_reaction(chat_id: i64, message_id: i64, reaction_type: crate::enums::ReactionType, is_big: bool, update_recent_reactions: bool, client_id: i32) -> Result<(), crate::types::Error> {
17570        let request = json!({
17571            "@type": "addMessageReaction",
17572            "chat_id": chat_id,
17573            "message_id": message_id,
17574            "reaction_type": reaction_type,
17575            "is_big": is_big,
17576            "update_recent_reactions": update_recent_reactions,
17577        });
17578        let response = send_request(client_id, request).await;
17579        if response["@type"] == "error" {
17580            return Err(serde_json::from_value(response).unwrap())
17581        }
17582        Ok(())
17583    }
17584    /// Removes a reaction from a message. A chosen reaction can always be removed
17585    /// # Arguments
17586    /// * `chat_id` - Identifier of the chat to which the message belongs
17587    /// * `message_id` - Identifier of the message
17588    /// * `reaction_type` - Type of the reaction to remove
17589    /// * `client_id` - The client id to send the request to
17590    #[allow(clippy::too_many_arguments)]
17591    pub async fn remove_message_reaction(chat_id: i64, message_id: i64, reaction_type: crate::enums::ReactionType, client_id: i32) -> Result<(), crate::types::Error> {
17592        let request = json!({
17593            "@type": "removeMessageReaction",
17594            "chat_id": chat_id,
17595            "message_id": message_id,
17596            "reaction_type": reaction_type,
17597        });
17598        let response = send_request(client_id, request).await;
17599        if response["@type"] == "error" {
17600            return Err(serde_json::from_value(response).unwrap())
17601        }
17602        Ok(())
17603    }
17604    /// Returns reactions added for a message, along with their sender
17605    /// # Arguments
17606    /// * `chat_id` - Identifier of the chat to which the message belongs
17607    /// * `message_id` - Identifier of the message
17608    /// * `reaction_type` - Type of the reactions to return; pass null to return all added reactions
17609    /// * `offset` - Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results
17610    /// * `limit` - The maximum number of reactions to be returned; must be positive and can't be greater than 100
17611    /// * `client_id` - The client id to send the request to
17612    #[allow(clippy::too_many_arguments)]
17613    pub async fn get_message_added_reactions(chat_id: i64, message_id: i64, reaction_type: Option<crate::enums::ReactionType>, offset: String, limit: i32, client_id: i32) -> Result<crate::enums::AddedReactions, crate::types::Error> {
17614        let request = json!({
17615            "@type": "getMessageAddedReactions",
17616            "chat_id": chat_id,
17617            "message_id": message_id,
17618            "reaction_type": reaction_type,
17619            "offset": offset,
17620            "limit": limit,
17621        });
17622        let response = send_request(client_id, request).await;
17623        if response["@type"] == "error" {
17624            return Err(serde_json::from_value(response).unwrap())
17625        }
17626        Ok(serde_json::from_value(response).unwrap())
17627    }
17628    /// Changes type of default reaction for the current user
17629    /// # Arguments
17630    /// * `reaction_type` - New type of the default reaction
17631    /// * `client_id` - The client id to send the request to
17632    #[allow(clippy::too_many_arguments)]
17633    pub async fn set_default_reaction_type(reaction_type: crate::enums::ReactionType, client_id: i32) -> Result<(), crate::types::Error> {
17634        let request = json!({
17635            "@type": "setDefaultReactionType",
17636            "reaction_type": reaction_type,
17637        });
17638        let response = send_request(client_id, request).await;
17639        if response["@type"] == "error" {
17640            return Err(serde_json::from_value(response).unwrap())
17641        }
17642        Ok(())
17643    }
17644    /// Returns all entities (mentions, hashtags, cashtags, bot commands, bank card numbers, URLs, and email addresses) found in the text. Can be called synchronously
17645    /// # Arguments
17646    /// * `text` - The text in which to look for entities
17647    /// * `client_id` - The client id to send the request to
17648    #[allow(clippy::too_many_arguments)]
17649    pub async fn get_text_entities(text: String, client_id: i32) -> Result<crate::enums::TextEntities, crate::types::Error> {
17650        let request = json!({
17651            "@type": "getTextEntities",
17652            "text": text,
17653        });
17654        let response = send_request(client_id, request).await;
17655        if response["@type"] == "error" {
17656            return Err(serde_json::from_value(response).unwrap())
17657        }
17658        Ok(serde_json::from_value(response).unwrap())
17659    }
17660    /// Parses Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, Code, Pre, PreCode, TextUrl and MentionName entities from a marked-up text. Can be called synchronously
17661    /// # Arguments
17662    /// * `text` - The text to parse
17663    /// * `parse_mode` - Text parse mode
17664    /// * `client_id` - The client id to send the request to
17665    #[allow(clippy::too_many_arguments)]
17666    pub async fn parse_text_entities(text: String, parse_mode: crate::enums::TextParseMode, client_id: i32) -> Result<crate::enums::FormattedText, crate::types::Error> {
17667        let request = json!({
17668            "@type": "parseTextEntities",
17669            "text": text,
17670            "parse_mode": parse_mode,
17671        });
17672        let response = send_request(client_id, request).await;
17673        if response["@type"] == "error" {
17674            return Err(serde_json::from_value(response).unwrap())
17675        }
17676        Ok(serde_json::from_value(response).unwrap())
17677    }
17678    /// Parses Markdown entities in a human-friendly format, ignoring markup errors. Can be called synchronously
17679    /// # Arguments
17680    /// * `text` - The text to parse. For example, "__italic__ ~~strikethrough~~ ||spoiler|| **bold** `code` ```pre``` __[italic__ text_url](telegram.org) __italic**bold italic__bold**"
17681    /// * `client_id` - The client id to send the request to
17682    #[allow(clippy::too_many_arguments)]
17683    pub async fn parse_markdown(text: crate::types::FormattedText, client_id: i32) -> Result<crate::enums::FormattedText, crate::types::Error> {
17684        let request = json!({
17685            "@type": "parseMarkdown",
17686            "text": text,
17687        });
17688        let response = send_request(client_id, request).await;
17689        if response["@type"] == "error" {
17690            return Err(serde_json::from_value(response).unwrap())
17691        }
17692        Ok(serde_json::from_value(response).unwrap())
17693    }
17694    /// Replaces text entities with Markdown formatting in a human-friendly format. Entities that can't be represented in Markdown unambiguously are kept as is. Can be called synchronously
17695    /// # Arguments
17696    /// * `text` - The text
17697    /// * `client_id` - The client id to send the request to
17698    #[allow(clippy::too_many_arguments)]
17699    pub async fn get_markdown_text(text: crate::types::FormattedText, client_id: i32) -> Result<crate::enums::FormattedText, crate::types::Error> {
17700        let request = json!({
17701            "@type": "getMarkdownText",
17702            "text": text,
17703        });
17704        let response = send_request(client_id, request).await;
17705        if response["@type"] == "error" {
17706            return Err(serde_json::from_value(response).unwrap())
17707        }
17708        Ok(serde_json::from_value(response).unwrap())
17709    }
17710    /// Returns the MIME type of a file, guessed by its extension. Returns an empty string on failure. Can be called synchronously
17711    /// # Arguments
17712    /// * `file_name` - The name of the file or path to the file
17713    /// * `client_id` - The client id to send the request to
17714    #[allow(clippy::too_many_arguments)]
17715    pub async fn get_file_mime_type(file_name: String, client_id: i32) -> Result<crate::enums::Text, crate::types::Error> {
17716        let request = json!({
17717            "@type": "getFileMimeType",
17718            "file_name": file_name,
17719        });
17720        let response = send_request(client_id, request).await;
17721        if response["@type"] == "error" {
17722            return Err(serde_json::from_value(response).unwrap())
17723        }
17724        Ok(serde_json::from_value(response).unwrap())
17725    }
17726    /// Returns the extension of a file, guessed by its MIME type. Returns an empty string on failure. Can be called synchronously
17727    /// # Arguments
17728    /// * `mime_type` - The MIME type of the file
17729    /// * `client_id` - The client id to send the request to
17730    #[allow(clippy::too_many_arguments)]
17731    pub async fn get_file_extension(mime_type: String, client_id: i32) -> Result<crate::enums::Text, crate::types::Error> {
17732        let request = json!({
17733            "@type": "getFileExtension",
17734            "mime_type": mime_type,
17735        });
17736        let response = send_request(client_id, request).await;
17737        if response["@type"] == "error" {
17738            return Err(serde_json::from_value(response).unwrap())
17739        }
17740        Ok(serde_json::from_value(response).unwrap())
17741    }
17742    /// Removes potentially dangerous characters from the name of a file. The encoding of the file name is supposed to be UTF-8. Returns an empty string on failure. Can be called synchronously
17743    /// # Arguments
17744    /// * `file_name` - File name or path to the file
17745    /// * `client_id` - The client id to send the request to
17746    #[allow(clippy::too_many_arguments)]
17747    pub async fn clean_file_name(file_name: String, client_id: i32) -> Result<crate::enums::Text, crate::types::Error> {
17748        let request = json!({
17749            "@type": "cleanFileName",
17750            "file_name": file_name,
17751        });
17752        let response = send_request(client_id, request).await;
17753        if response["@type"] == "error" {
17754            return Err(serde_json::from_value(response).unwrap())
17755        }
17756        Ok(serde_json::from_value(response).unwrap())
17757    }
17758    /// Returns a string stored in the local database from the specified localization target and language pack by its key. Returns a 404 error if the string is not found. Can be called synchronously
17759    /// # Arguments
17760    /// * `language_pack_database_path` - Path to the language pack database in which strings are stored
17761    /// * `localization_target` - Localization target to which the language pack belongs
17762    /// * `language_pack_id` - Language pack identifier
17763    /// * `key` - Language pack key of the string to be returned
17764    /// * `client_id` - The client id to send the request to
17765    #[allow(clippy::too_many_arguments)]
17766    pub async fn get_language_pack_string(language_pack_database_path: String, localization_target: String, language_pack_id: String, key: String, client_id: i32) -> Result<crate::enums::LanguagePackStringValue, crate::types::Error> {
17767        let request = json!({
17768            "@type": "getLanguagePackString",
17769            "language_pack_database_path": language_pack_database_path,
17770            "localization_target": localization_target,
17771            "language_pack_id": language_pack_id,
17772            "key": key,
17773        });
17774        let response = send_request(client_id, request).await;
17775        if response["@type"] == "error" {
17776            return Err(serde_json::from_value(response).unwrap())
17777        }
17778        Ok(serde_json::from_value(response).unwrap())
17779    }
17780    /// Converts a JSON-serialized string to corresponding JsonValue object. Can be called synchronously
17781    /// # Arguments
17782    /// * `json` - The JSON-serialized string
17783    /// * `client_id` - The client id to send the request to
17784    #[allow(clippy::too_many_arguments)]
17785    pub async fn get_json_value(json: String, client_id: i32) -> Result<crate::enums::JsonValue, crate::types::Error> {
17786        let request = json!({
17787            "@type": "getJsonValue",
17788            "json": json,
17789        });
17790        let response = send_request(client_id, request).await;
17791        if response["@type"] == "error" {
17792            return Err(serde_json::from_value(response).unwrap())
17793        }
17794        Ok(serde_json::from_value(response).unwrap())
17795    }
17796    /// Converts a JsonValue object to corresponding JSON-serialized string. Can be called synchronously
17797    /// # Arguments
17798    /// * `json_value` - The JsonValue object
17799    /// * `client_id` - The client id to send the request to
17800    #[allow(clippy::too_many_arguments)]
17801    pub async fn get_json_string(json_value: crate::enums::JsonValue, client_id: i32) -> Result<crate::enums::Text, crate::types::Error> {
17802        let request = json!({
17803            "@type": "getJsonString",
17804            "json_value": json_value,
17805        });
17806        let response = send_request(client_id, request).await;
17807        if response["@type"] == "error" {
17808            return Err(serde_json::from_value(response).unwrap())
17809        }
17810        Ok(serde_json::from_value(response).unwrap())
17811    }
17812    /// Converts a themeParameters object to corresponding JSON-serialized string. Can be called synchronously
17813    /// # Arguments
17814    /// * `theme` - Theme parameters to convert to JSON
17815    /// * `client_id` - The client id to send the request to
17816    #[allow(clippy::too_many_arguments)]
17817    pub async fn get_theme_parameters_json_string(theme: crate::types::ThemeParameters, client_id: i32) -> Result<crate::enums::Text, crate::types::Error> {
17818        let request = json!({
17819            "@type": "getThemeParametersJsonString",
17820            "theme": theme,
17821        });
17822        let response = send_request(client_id, request).await;
17823        if response["@type"] == "error" {
17824            return Err(serde_json::from_value(response).unwrap())
17825        }
17826        Ok(serde_json::from_value(response).unwrap())
17827    }
17828    /// Changes the user answer to a poll. A poll in quiz mode can be answered only once
17829    /// # Arguments
17830    /// * `chat_id` - Identifier of the chat to which the poll belongs
17831    /// * `message_id` - Identifier of the message containing the poll
17832    /// * `option_ids` - 0-based identifiers of answer options, chosen by the user. User can choose more than 1 answer option only is the poll allows multiple answers
17833    /// * `client_id` - The client id to send the request to
17834    #[allow(clippy::too_many_arguments)]
17835    pub async fn set_poll_answer(chat_id: i64, message_id: i64, option_ids: Vec<i32>, client_id: i32) -> Result<(), crate::types::Error> {
17836        let request = json!({
17837            "@type": "setPollAnswer",
17838            "chat_id": chat_id,
17839            "message_id": message_id,
17840            "option_ids": option_ids,
17841        });
17842        let response = send_request(client_id, request).await;
17843        if response["@type"] == "error" {
17844            return Err(serde_json::from_value(response).unwrap())
17845        }
17846        Ok(())
17847    }
17848    /// Returns message senders voted for the specified option in a non-anonymous polls. For optimal performance, the number of returned users is chosen by TDLib
17849    /// # Arguments
17850    /// * `chat_id` - Identifier of the chat to which the poll belongs
17851    /// * `message_id` - Identifier of the message containing the poll
17852    /// * `option_id` - 0-based identifier of the answer option
17853    /// * `offset` - Number of voters to skip in the result; must be non-negative
17854    /// * `limit` - The maximum number of voters to be returned; must be positive and can't be greater than 50. For optimal performance, the number of returned voters is chosen by TDLib and can be smaller than the specified limit, even if the end of the voter list has not been reached
17855    /// * `client_id` - The client id to send the request to
17856    #[allow(clippy::too_many_arguments)]
17857    pub async fn get_poll_voters(chat_id: i64, message_id: i64, option_id: i32, offset: i32, limit: i32, client_id: i32) -> Result<crate::enums::MessageSenders, crate::types::Error> {
17858        let request = json!({
17859            "@type": "getPollVoters",
17860            "chat_id": chat_id,
17861            "message_id": message_id,
17862            "option_id": option_id,
17863            "offset": offset,
17864            "limit": limit,
17865        });
17866        let response = send_request(client_id, request).await;
17867        if response["@type"] == "error" {
17868            return Err(serde_json::from_value(response).unwrap())
17869        }
17870        Ok(serde_json::from_value(response).unwrap())
17871    }
17872    /// Stops a poll. A poll in a message can be stopped when the message has can_be_edited flag is set
17873    /// # Arguments
17874    /// * `chat_id` - Identifier of the chat to which the poll belongs
17875    /// * `message_id` - Identifier of the message containing the poll
17876    /// * `reply_markup` - The new message reply markup; pass null if none; for bots only
17877    /// * `client_id` - The client id to send the request to
17878    #[allow(clippy::too_many_arguments)]
17879    pub async fn stop_poll(chat_id: i64, message_id: i64, reply_markup: Option<crate::enums::ReplyMarkup>, client_id: i32) -> Result<(), crate::types::Error> {
17880        let request = json!({
17881            "@type": "stopPoll",
17882            "chat_id": chat_id,
17883            "message_id": message_id,
17884            "reply_markup": reply_markup,
17885        });
17886        let response = send_request(client_id, request).await;
17887        if response["@type"] == "error" {
17888            return Err(serde_json::from_value(response).unwrap())
17889        }
17890        Ok(())
17891    }
17892    /// Hides a suggested action
17893    /// # Arguments
17894    /// * `action` - Suggested action to hide
17895    /// * `client_id` - The client id to send the request to
17896    #[allow(clippy::too_many_arguments)]
17897    pub async fn hide_suggested_action(action: crate::enums::SuggestedAction, client_id: i32) -> Result<(), crate::types::Error> {
17898        let request = json!({
17899            "@type": "hideSuggestedAction",
17900            "action": action,
17901        });
17902        let response = send_request(client_id, request).await;
17903        if response["@type"] == "error" {
17904            return Err(serde_json::from_value(response).unwrap())
17905        }
17906        Ok(())
17907    }
17908    /// Returns information about a button of type inlineKeyboardButtonTypeLoginUrl. The method needs to be called when the user presses the button
17909    /// # Arguments
17910    /// * `chat_id` - Chat identifier of the message with the button
17911    /// * `message_id` - Message identifier of the message with the button
17912    /// * `button_id` - Button identifier
17913    /// * `client_id` - The client id to send the request to
17914    #[allow(clippy::too_many_arguments)]
17915    pub async fn get_login_url_info(chat_id: i64, message_id: i64, button_id: i64, client_id: i32) -> Result<crate::enums::LoginUrlInfo, crate::types::Error> {
17916        let request = json!({
17917            "@type": "getLoginUrlInfo",
17918            "chat_id": chat_id,
17919            "message_id": message_id,
17920            "button_id": button_id,
17921        });
17922        let response = send_request(client_id, request).await;
17923        if response["@type"] == "error" {
17924            return Err(serde_json::from_value(response).unwrap())
17925        }
17926        Ok(serde_json::from_value(response).unwrap())
17927    }
17928    /// Returns an HTTP URL which can be used to automatically authorize the user on a website after clicking an inline button of type inlineKeyboardButtonTypeLoginUrl.
17929    /// Use the method getLoginUrlInfo to find whether a prior user confirmation is needed. If an error is returned, then the button must be handled as an ordinary URL button
17930    /// # Arguments
17931    /// * `chat_id` - Chat identifier of the message with the button
17932    /// * `message_id` - Message identifier of the message with the button
17933    /// * `button_id` - Button identifier
17934    /// * `allow_write_access` - Pass true to allow the bot to send messages to the current user
17935    /// * `client_id` - The client id to send the request to
17936    #[allow(clippy::too_many_arguments)]
17937    pub async fn get_login_url(chat_id: i64, message_id: i64, button_id: i64, allow_write_access: bool, client_id: i32) -> Result<crate::enums::HttpUrl, crate::types::Error> {
17938        let request = json!({
17939            "@type": "getLoginUrl",
17940            "chat_id": chat_id,
17941            "message_id": message_id,
17942            "button_id": button_id,
17943            "allow_write_access": allow_write_access,
17944        });
17945        let response = send_request(client_id, request).await;
17946        if response["@type"] == "error" {
17947            return Err(serde_json::from_value(response).unwrap())
17948        }
17949        Ok(serde_json::from_value(response).unwrap())
17950    }
17951    /// Shares a user after pressing a keyboardButtonTypeRequestUser button with the bot
17952    /// # Arguments
17953    /// * `chat_id` - Identifier of the chat with the bot
17954    /// * `message_id` - Identifier of the message with the button
17955    /// * `button_id` - Identifier of the button
17956    /// * `shared_user_id` - Identifier of the shared user
17957    /// * `only_check` - Pass true to check that the user can be shared by the button instead of actually sharing them
17958    /// * `client_id` - The client id to send the request to
17959    #[allow(clippy::too_many_arguments)]
17960    pub async fn share_user_with_bot(chat_id: i64, message_id: i64, button_id: i32, shared_user_id: i64, only_check: bool, client_id: i32) -> Result<(), crate::types::Error> {
17961        let request = json!({
17962            "@type": "shareUserWithBot",
17963            "chat_id": chat_id,
17964            "message_id": message_id,
17965            "button_id": button_id,
17966            "shared_user_id": shared_user_id,
17967            "only_check": only_check,
17968        });
17969        let response = send_request(client_id, request).await;
17970        if response["@type"] == "error" {
17971            return Err(serde_json::from_value(response).unwrap())
17972        }
17973        Ok(())
17974    }
17975    /// Shares a chat after pressing a keyboardButtonTypeRequestChat button with the bot
17976    /// # Arguments
17977    /// * `chat_id` - Identifier of the chat with the bot
17978    /// * `message_id` - Identifier of the message with the button
17979    /// * `button_id` - Identifier of the button
17980    /// * `shared_chat_id` - Identifier of the shared chat
17981    /// * `only_check` - Pass true to check that the chat can be shared by the button instead of actually sharing it. Doesn't check bot_is_member and bot_administrator_rights restrictions.
17982    /// If the bot must be a member, then all chats from getGroupsInCommon and all chats, where the user can add the bot, are suitable. In the latter case the bot will be automatically added to the chat.
17983    /// If the bot must be an administrator, then all chats, where the bot already has requested rights or can be added to administrators by the user, are suitable. In the latter case the bot will be automatically granted requested rights
17984    /// * `client_id` - The client id to send the request to
17985    #[allow(clippy::too_many_arguments)]
17986    pub async fn share_chat_with_bot(chat_id: i64, message_id: i64, button_id: i32, shared_chat_id: i64, only_check: bool, client_id: i32) -> Result<(), crate::types::Error> {
17987        let request = json!({
17988            "@type": "shareChatWithBot",
17989            "chat_id": chat_id,
17990            "message_id": message_id,
17991            "button_id": button_id,
17992            "shared_chat_id": shared_chat_id,
17993            "only_check": only_check,
17994        });
17995        let response = send_request(client_id, request).await;
17996        if response["@type"] == "error" {
17997            return Err(serde_json::from_value(response).unwrap())
17998        }
17999        Ok(())
18000    }
18001    /// Sends an inline query to a bot and returns its results. Returns an error with code 502 if the bot fails to answer the query before the query timeout expires
18002    /// # Arguments
18003    /// * `bot_user_id` - Identifier of the target bot
18004    /// * `chat_id` - Identifier of the chat where the query was sent
18005    /// * `user_location` - Location of the user; pass null if unknown or the bot doesn't need user's location
18006    /// * `query` - Text of the query
18007    /// * `offset` - Offset of the first entry to return; use empty string to get the first chunk of results
18008    /// * `client_id` - The client id to send the request to
18009    #[allow(clippy::too_many_arguments)]
18010    pub async fn get_inline_query_results(bot_user_id: i64, chat_id: i64, user_location: Option<crate::types::Location>, query: String, offset: String, client_id: i32) -> Result<crate::enums::InlineQueryResults, crate::types::Error> {
18011        let request = json!({
18012            "@type": "getInlineQueryResults",
18013            "bot_user_id": bot_user_id,
18014            "chat_id": chat_id,
18015            "user_location": user_location,
18016            "query": query,
18017            "offset": offset,
18018        });
18019        let response = send_request(client_id, request).await;
18020        if response["@type"] == "error" {
18021            return Err(serde_json::from_value(response).unwrap())
18022        }
18023        Ok(serde_json::from_value(response).unwrap())
18024    }
18025    /// Sets the result of an inline query; for bots only
18026    /// # Arguments
18027    /// * `inline_query_id` - Identifier of the inline query
18028    /// * `is_personal` - Pass true if results may be cached and returned only for the user that sent the query. By default, results may be returned to any user who sends the same query
18029    /// * `button` - Button to be shown above inline query results; pass null if none
18030    /// * `results` - The results of the query
18031    /// * `cache_time` - Allowed time to cache the results of the query, in seconds
18032    /// * `next_offset` - Offset for the next inline query; pass an empty string if there are no more results
18033    /// * `client_id` - The client id to send the request to
18034    #[allow(clippy::too_many_arguments)]
18035    pub async fn answer_inline_query(inline_query_id: i64, is_personal: bool, button: Option<crate::types::InlineQueryResultsButton>, results: Vec<crate::enums::InputInlineQueryResult>, cache_time: i32, next_offset: String, client_id: i32) -> Result<(), crate::types::Error> {
18036        let request = json!({
18037            "@type": "answerInlineQuery",
18038            "inline_query_id": inline_query_id,
18039            "is_personal": is_personal,
18040            "button": button,
18041            "results": results,
18042            "cache_time": cache_time,
18043            "next_offset": next_offset,
18044        });
18045        let response = send_request(client_id, request).await;
18046        if response["@type"] == "error" {
18047            return Err(serde_json::from_value(response).unwrap())
18048        }
18049        Ok(())
18050    }
18051    /// Returns information about a Web App by its short name. Returns a 404 error if the Web App is not found
18052    /// # Arguments
18053    /// * `bot_user_id` - Identifier of the target bot
18054    /// * `web_app_short_name` - Short name of the Web App
18055    /// * `client_id` - The client id to send the request to
18056    #[allow(clippy::too_many_arguments)]
18057    pub async fn search_web_app(bot_user_id: i64, web_app_short_name: String, client_id: i32) -> Result<crate::enums::FoundWebApp, crate::types::Error> {
18058        let request = json!({
18059            "@type": "searchWebApp",
18060            "bot_user_id": bot_user_id,
18061            "web_app_short_name": web_app_short_name,
18062        });
18063        let response = send_request(client_id, request).await;
18064        if response["@type"] == "error" {
18065            return Err(serde_json::from_value(response).unwrap())
18066        }
18067        Ok(serde_json::from_value(response).unwrap())
18068    }
18069    /// Returns an HTTPS URL of a Web App to open after a link of the type internalLinkTypeWebApp is clicked
18070    /// # Arguments
18071    /// * `chat_id` - Identifier of the chat in which the link was clicked; pass 0 if none
18072    /// * `bot_user_id` - Identifier of the target bot
18073    /// * `web_app_short_name` - Short name of the Web App
18074    /// * `start_parameter` - Start parameter from internalLinkTypeWebApp
18075    /// * `theme` - Preferred Web App theme; pass null to use the default theme
18076    /// * `application_name` - Short name of the application; 0-64 English letters, digits, and underscores
18077    /// * `allow_write_access` - Pass true if the current user allowed the bot to send them messages
18078    /// * `client_id` - The client id to send the request to
18079    #[allow(clippy::too_many_arguments)]
18080    pub async fn get_web_app_link_url(chat_id: i64, bot_user_id: i64, web_app_short_name: String, start_parameter: String, theme: Option<crate::types::ThemeParameters>, application_name: String, allow_write_access: bool, client_id: i32) -> Result<crate::enums::HttpUrl, crate::types::Error> {
18081        let request = json!({
18082            "@type": "getWebAppLinkUrl",
18083            "chat_id": chat_id,
18084            "bot_user_id": bot_user_id,
18085            "web_app_short_name": web_app_short_name,
18086            "start_parameter": start_parameter,
18087            "theme": theme,
18088            "application_name": application_name,
18089            "allow_write_access": allow_write_access,
18090        });
18091        let response = send_request(client_id, request).await;
18092        if response["@type"] == "error" {
18093            return Err(serde_json::from_value(response).unwrap())
18094        }
18095        Ok(serde_json::from_value(response).unwrap())
18096    }
18097    /// Returns an HTTPS URL of a Web App to open from the side menu, a keyboardButtonTypeWebApp button, an inlineQueryResultsButtonTypeWebApp button, or an internalLinkTypeSideMenuBot link
18098    /// # Arguments
18099    /// * `bot_user_id` - Identifier of the target bot
18100    /// * `url` - The URL from a keyboardButtonTypeWebApp button, inlineQueryResultsButtonTypeWebApp button, an internalLinkTypeSideMenuBot link, or an empty when the bot is opened from the side menu
18101    /// * `theme` - Preferred Web App theme; pass null to use the default theme
18102    /// * `application_name` - Short name of the application; 0-64 English letters, digits, and underscores
18103    /// * `client_id` - The client id to send the request to
18104    #[allow(clippy::too_many_arguments)]
18105    pub async fn get_web_app_url(bot_user_id: i64, url: String, theme: Option<crate::types::ThemeParameters>, application_name: String, client_id: i32) -> Result<crate::enums::HttpUrl, crate::types::Error> {
18106        let request = json!({
18107            "@type": "getWebAppUrl",
18108            "bot_user_id": bot_user_id,
18109            "url": url,
18110            "theme": theme,
18111            "application_name": application_name,
18112        });
18113        let response = send_request(client_id, request).await;
18114        if response["@type"] == "error" {
18115            return Err(serde_json::from_value(response).unwrap())
18116        }
18117        Ok(serde_json::from_value(response).unwrap())
18118    }
18119    /// Sends data received from a keyboardButtonTypeWebApp Web App to a bot
18120    /// # Arguments
18121    /// * `bot_user_id` - Identifier of the target bot
18122    /// * `button_text` - Text of the keyboardButtonTypeWebApp button, which opened the Web App
18123    /// * `data` - The data
18124    /// * `client_id` - The client id to send the request to
18125    #[allow(clippy::too_many_arguments)]
18126    pub async fn send_web_app_data(bot_user_id: i64, button_text: String, data: String, client_id: i32) -> Result<(), crate::types::Error> {
18127        let request = json!({
18128            "@type": "sendWebAppData",
18129            "bot_user_id": bot_user_id,
18130            "button_text": button_text,
18131            "data": data,
18132        });
18133        let response = send_request(client_id, request).await;
18134        if response["@type"] == "error" {
18135            return Err(serde_json::from_value(response).unwrap())
18136        }
18137        Ok(())
18138    }
18139    /// Informs TDLib that a Web App is being opened from the attachment menu, a botMenuButton button, an internalLinkTypeAttachmentMenuBot link, or an inlineKeyboardButtonTypeWebApp button.
18140    /// For each bot, a confirmation alert about data sent to the bot must be shown once
18141    /// # Arguments
18142    /// * `chat_id` - Identifier of the chat in which the Web App is opened. The Web App can't be opened in secret chats
18143    /// * `bot_user_id` - Identifier of the bot, providing the Web App
18144    /// * `url` - The URL from an inlineKeyboardButtonTypeWebApp button, a botMenuButton button, an internalLinkTypeAttachmentMenuBot link, or an empty string otherwise
18145    /// * `theme` - Preferred Web App theme; pass null to use the default theme
18146    /// * `application_name` - Short name of the application; 0-64 English letters, digits, and underscores
18147    /// * `message_thread_id` - If not 0, a message thread identifier in which the message will be sent
18148    /// * `reply_to` - Identifier of the replied message or story for the message sent by the Web App; pass null if none
18149    /// * `client_id` - The client id to send the request to
18150    #[allow(clippy::too_many_arguments)]
18151    pub async fn open_web_app(chat_id: i64, bot_user_id: i64, url: String, theme: Option<crate::types::ThemeParameters>, application_name: String, message_thread_id: i64, reply_to: Option<crate::enums::MessageReplyTo>, client_id: i32) -> Result<crate::enums::WebAppInfo, crate::types::Error> {
18152        let request = json!({
18153            "@type": "openWebApp",
18154            "chat_id": chat_id,
18155            "bot_user_id": bot_user_id,
18156            "url": url,
18157            "theme": theme,
18158            "application_name": application_name,
18159            "message_thread_id": message_thread_id,
18160            "reply_to": reply_to,
18161        });
18162        let response = send_request(client_id, request).await;
18163        if response["@type"] == "error" {
18164            return Err(serde_json::from_value(response).unwrap())
18165        }
18166        Ok(serde_json::from_value(response).unwrap())
18167    }
18168    /// Informs TDLib that a previously opened Web App was closed
18169    /// # Arguments
18170    /// * `web_app_launch_id` - Identifier of Web App launch, received from openWebApp
18171    /// * `client_id` - The client id to send the request to
18172    #[allow(clippy::too_many_arguments)]
18173    pub async fn close_web_app(web_app_launch_id: i64, client_id: i32) -> Result<(), crate::types::Error> {
18174        let request = json!({
18175            "@type": "closeWebApp",
18176            "web_app_launch_id": web_app_launch_id,
18177        });
18178        let response = send_request(client_id, request).await;
18179        if response["@type"] == "error" {
18180            return Err(serde_json::from_value(response).unwrap())
18181        }
18182        Ok(())
18183    }
18184    /// Sets the result of interaction with a Web App and sends corresponding message on behalf of the user to the chat from which the query originated; for bots only
18185    /// # Arguments
18186    /// * `web_app_query_id` - Identifier of the Web App query
18187    /// * `result` - The result of the query
18188    /// * `client_id` - The client id to send the request to
18189    #[allow(clippy::too_many_arguments)]
18190    pub async fn answer_web_app_query(web_app_query_id: String, result: crate::enums::InputInlineQueryResult, client_id: i32) -> Result<crate::enums::SentWebAppMessage, crate::types::Error> {
18191        let request = json!({
18192            "@type": "answerWebAppQuery",
18193            "web_app_query_id": web_app_query_id,
18194            "result": result,
18195        });
18196        let response = send_request(client_id, request).await;
18197        if response["@type"] == "error" {
18198            return Err(serde_json::from_value(response).unwrap())
18199        }
18200        Ok(serde_json::from_value(response).unwrap())
18201    }
18202    /// Sends a callback query to a bot and returns an answer. Returns an error with code 502 if the bot fails to answer the query before the query timeout expires
18203    /// # Arguments
18204    /// * `chat_id` - Identifier of the chat with the message
18205    /// * `message_id` - Identifier of the message from which the query originated
18206    /// * `payload` - Query payload
18207    /// * `client_id` - The client id to send the request to
18208    #[allow(clippy::too_many_arguments)]
18209    pub async fn get_callback_query_answer(chat_id: i64, message_id: i64, payload: crate::enums::CallbackQueryPayload, client_id: i32) -> Result<crate::enums::CallbackQueryAnswer, crate::types::Error> {
18210        let request = json!({
18211            "@type": "getCallbackQueryAnswer",
18212            "chat_id": chat_id,
18213            "message_id": message_id,
18214            "payload": payload,
18215        });
18216        let response = send_request(client_id, request).await;
18217        if response["@type"] == "error" {
18218            return Err(serde_json::from_value(response).unwrap())
18219        }
18220        Ok(serde_json::from_value(response).unwrap())
18221    }
18222    /// Sets the result of a callback query; for bots only
18223    /// # Arguments
18224    /// * `callback_query_id` - Identifier of the callback query
18225    /// * `text` - Text of the answer
18226    /// * `show_alert` - Pass true to show an alert to the user instead of a toast notification
18227    /// * `url` - URL to be opened
18228    /// * `cache_time` - Time during which the result of the query can be cached, in seconds
18229    /// * `client_id` - The client id to send the request to
18230    #[allow(clippy::too_many_arguments)]
18231    pub async fn answer_callback_query(callback_query_id: i64, text: String, show_alert: bool, url: String, cache_time: i32, client_id: i32) -> Result<(), crate::types::Error> {
18232        let request = json!({
18233            "@type": "answerCallbackQuery",
18234            "callback_query_id": callback_query_id,
18235            "text": text,
18236            "show_alert": show_alert,
18237            "url": url,
18238            "cache_time": cache_time,
18239        });
18240        let response = send_request(client_id, request).await;
18241        if response["@type"] == "error" {
18242            return Err(serde_json::from_value(response).unwrap())
18243        }
18244        Ok(())
18245    }
18246    /// Sets the result of a shipping query; for bots only
18247    /// # Arguments
18248    /// * `shipping_query_id` - Identifier of the shipping query
18249    /// * `shipping_options` - Available shipping options
18250    /// * `error_message` - An error message, empty on success
18251    /// * `client_id` - The client id to send the request to
18252    #[allow(clippy::too_many_arguments)]
18253    pub async fn answer_shipping_query(shipping_query_id: i64, shipping_options: Vec<crate::types::ShippingOption>, error_message: String, client_id: i32) -> Result<(), crate::types::Error> {
18254        let request = json!({
18255            "@type": "answerShippingQuery",
18256            "shipping_query_id": shipping_query_id,
18257            "shipping_options": shipping_options,
18258            "error_message": error_message,
18259        });
18260        let response = send_request(client_id, request).await;
18261        if response["@type"] == "error" {
18262            return Err(serde_json::from_value(response).unwrap())
18263        }
18264        Ok(())
18265    }
18266    /// Sets the result of a pre-checkout query; for bots only
18267    /// # Arguments
18268    /// * `pre_checkout_query_id` - Identifier of the pre-checkout query
18269    /// * `error_message` - An error message, empty on success
18270    /// * `client_id` - The client id to send the request to
18271    #[allow(clippy::too_many_arguments)]
18272    pub async fn answer_pre_checkout_query(pre_checkout_query_id: i64, error_message: String, client_id: i32) -> Result<(), crate::types::Error> {
18273        let request = json!({
18274            "@type": "answerPreCheckoutQuery",
18275            "pre_checkout_query_id": pre_checkout_query_id,
18276            "error_message": error_message,
18277        });
18278        let response = send_request(client_id, request).await;
18279        if response["@type"] == "error" {
18280            return Err(serde_json::from_value(response).unwrap())
18281        }
18282        Ok(())
18283    }
18284    /// Updates the game score of the specified user in the game; for bots only
18285    /// # Arguments
18286    /// * `chat_id` - The chat to which the message with the game belongs
18287    /// * `message_id` - Identifier of the message
18288    /// * `edit_message` - Pass true to edit the game message to include the current scoreboard
18289    /// * `user_id` - User identifier
18290    /// * `score` - The new score
18291    /// * `force` - Pass true to update the score even if it decreases. If the score is 0, the user will be deleted from the high score table
18292    /// * `client_id` - The client id to send the request to
18293    #[allow(clippy::too_many_arguments)]
18294    pub async fn set_game_score(chat_id: i64, message_id: i64, edit_message: bool, user_id: i64, score: i32, force: bool, client_id: i32) -> Result<crate::enums::Message, crate::types::Error> {
18295        let request = json!({
18296            "@type": "setGameScore",
18297            "chat_id": chat_id,
18298            "message_id": message_id,
18299            "edit_message": edit_message,
18300            "user_id": user_id,
18301            "score": score,
18302            "force": force,
18303        });
18304        let response = send_request(client_id, request).await;
18305        if response["@type"] == "error" {
18306            return Err(serde_json::from_value(response).unwrap())
18307        }
18308        Ok(serde_json::from_value(response).unwrap())
18309    }
18310    /// Updates the game score of the specified user in a game; for bots only
18311    /// # Arguments
18312    /// * `inline_message_id` - Inline message identifier
18313    /// * `edit_message` - Pass true to edit the game message to include the current scoreboard
18314    /// * `user_id` - User identifier
18315    /// * `score` - The new score
18316    /// * `force` - Pass true to update the score even if it decreases. If the score is 0, the user will be deleted from the high score table
18317    /// * `client_id` - The client id to send the request to
18318    #[allow(clippy::too_many_arguments)]
18319    pub async fn set_inline_game_score(inline_message_id: String, edit_message: bool, user_id: i64, score: i32, force: bool, client_id: i32) -> Result<(), crate::types::Error> {
18320        let request = json!({
18321            "@type": "setInlineGameScore",
18322            "inline_message_id": inline_message_id,
18323            "edit_message": edit_message,
18324            "user_id": user_id,
18325            "score": score,
18326            "force": force,
18327        });
18328        let response = send_request(client_id, request).await;
18329        if response["@type"] == "error" {
18330            return Err(serde_json::from_value(response).unwrap())
18331        }
18332        Ok(())
18333    }
18334    /// Returns the high scores for a game and some part of the high score table in the range of the specified user; for bots only
18335    /// # Arguments
18336    /// * `chat_id` - The chat that contains the message with the game
18337    /// * `message_id` - Identifier of the message
18338    /// * `user_id` - User identifier
18339    /// * `client_id` - The client id to send the request to
18340    #[allow(clippy::too_many_arguments)]
18341    pub async fn get_game_high_scores(chat_id: i64, message_id: i64, user_id: i64, client_id: i32) -> Result<crate::enums::GameHighScores, crate::types::Error> {
18342        let request = json!({
18343            "@type": "getGameHighScores",
18344            "chat_id": chat_id,
18345            "message_id": message_id,
18346            "user_id": user_id,
18347        });
18348        let response = send_request(client_id, request).await;
18349        if response["@type"] == "error" {
18350            return Err(serde_json::from_value(response).unwrap())
18351        }
18352        Ok(serde_json::from_value(response).unwrap())
18353    }
18354    /// Returns game high scores and some part of the high score table in the range of the specified user; for bots only
18355    /// # Arguments
18356    /// * `inline_message_id` - Inline message identifier
18357    /// * `user_id` - User identifier
18358    /// * `client_id` - The client id to send the request to
18359    #[allow(clippy::too_many_arguments)]
18360    pub async fn get_inline_game_high_scores(inline_message_id: String, user_id: i64, client_id: i32) -> Result<crate::enums::GameHighScores, crate::types::Error> {
18361        let request = json!({
18362            "@type": "getInlineGameHighScores",
18363            "inline_message_id": inline_message_id,
18364            "user_id": user_id,
18365        });
18366        let response = send_request(client_id, request).await;
18367        if response["@type"] == "error" {
18368            return Err(serde_json::from_value(response).unwrap())
18369        }
18370        Ok(serde_json::from_value(response).unwrap())
18371    }
18372    /// Deletes the default reply markup from a chat. Must be called after a one-time keyboard or a replyMarkupForceReply reply markup has been used. An updateChatReplyMarkup update will be sent if the reply markup is changed
18373    /// # Arguments
18374    /// * `chat_id` - Chat identifier
18375    /// * `message_id` - The message identifier of the used keyboard
18376    /// * `client_id` - The client id to send the request to
18377    #[allow(clippy::too_many_arguments)]
18378    pub async fn delete_chat_reply_markup(chat_id: i64, message_id: i64, client_id: i32) -> Result<(), crate::types::Error> {
18379        let request = json!({
18380            "@type": "deleteChatReplyMarkup",
18381            "chat_id": chat_id,
18382            "message_id": message_id,
18383        });
18384        let response = send_request(client_id, request).await;
18385        if response["@type"] == "error" {
18386            return Err(serde_json::from_value(response).unwrap())
18387        }
18388        Ok(())
18389    }
18390    /// Sends a notification about user activity in a chat
18391    /// # Arguments
18392    /// * `chat_id` - Chat identifier
18393    /// * `message_thread_id` - If not 0, a message thread identifier in which the action was performed
18394    /// * `action` - The action description; pass null to cancel the currently active action
18395    /// * `client_id` - The client id to send the request to
18396    #[allow(clippy::too_many_arguments)]
18397    pub async fn send_chat_action(chat_id: i64, message_thread_id: i64, action: Option<crate::enums::ChatAction>, client_id: i32) -> Result<(), crate::types::Error> {
18398        let request = json!({
18399            "@type": "sendChatAction",
18400            "chat_id": chat_id,
18401            "message_thread_id": message_thread_id,
18402            "action": action,
18403        });
18404        let response = send_request(client_id, request).await;
18405        if response["@type"] == "error" {
18406            return Err(serde_json::from_value(response).unwrap())
18407        }
18408        Ok(())
18409    }
18410    /// Informs TDLib that the chat is opened by the user. Many useful activities depend on the chat being opened or closed (e.g., in supergroups and channels all updates are received only for opened chats)
18411    /// # Arguments
18412    /// * `chat_id` - Chat identifier
18413    /// * `client_id` - The client id to send the request to
18414    #[allow(clippy::too_many_arguments)]
18415    pub async fn open_chat(chat_id: i64, client_id: i32) -> Result<(), crate::types::Error> {
18416        let request = json!({
18417            "@type": "openChat",
18418            "chat_id": chat_id,
18419        });
18420        let response = send_request(client_id, request).await;
18421        if response["@type"] == "error" {
18422            return Err(serde_json::from_value(response).unwrap())
18423        }
18424        Ok(())
18425    }
18426    /// Informs TDLib that the chat is closed by the user. Many useful activities depend on the chat being opened or closed
18427    /// # Arguments
18428    /// * `chat_id` - Chat identifier
18429    /// * `client_id` - The client id to send the request to
18430    #[allow(clippy::too_many_arguments)]
18431    pub async fn close_chat(chat_id: i64, client_id: i32) -> Result<(), crate::types::Error> {
18432        let request = json!({
18433            "@type": "closeChat",
18434            "chat_id": chat_id,
18435        });
18436        let response = send_request(client_id, request).await;
18437        if response["@type"] == "error" {
18438            return Err(serde_json::from_value(response).unwrap())
18439        }
18440        Ok(())
18441    }
18442    /// Informs TDLib that messages are being viewed by the user. Sponsored messages must be marked as viewed only when the entire text of the message is shown on the screen (excluding the button).
18443    /// Many useful activities depend on whether the messages are currently being viewed or not (e.g., marking messages as read, incrementing a view counter, updating a view counter, removing deleted messages in supergroups and channels)
18444    /// # Arguments
18445    /// * `chat_id` - Chat identifier
18446    /// * `message_ids` - The identifiers of the messages being viewed
18447    /// * `source` - Source of the message view; pass null to guess the source based on chat open state
18448    /// * `force_read` - Pass true to mark as read the specified messages even the chat is closed
18449    /// * `client_id` - The client id to send the request to
18450    #[allow(clippy::too_many_arguments)]
18451    pub async fn view_messages(chat_id: i64, message_ids: Vec<i64>, source: Option<crate::enums::MessageSource>, force_read: bool, client_id: i32) -> Result<(), crate::types::Error> {
18452        let request = json!({
18453            "@type": "viewMessages",
18454            "chat_id": chat_id,
18455            "message_ids": message_ids,
18456            "source": source,
18457            "force_read": force_read,
18458        });
18459        let response = send_request(client_id, request).await;
18460        if response["@type"] == "error" {
18461            return Err(serde_json::from_value(response).unwrap())
18462        }
18463        Ok(())
18464    }
18465    /// Informs TDLib that the message content has been opened (e.g., the user has opened a photo, video, document, location or venue, or has listened to an audio file or voice note message).
18466    /// An updateMessageContentOpened update will be generated if something has changed
18467    /// # Arguments
18468    /// * `chat_id` - Chat identifier of the message
18469    /// * `message_id` - Identifier of the message with the opened content
18470    /// * `client_id` - The client id to send the request to
18471    #[allow(clippy::too_many_arguments)]
18472    pub async fn open_message_content(chat_id: i64, message_id: i64, client_id: i32) -> Result<(), crate::types::Error> {
18473        let request = json!({
18474            "@type": "openMessageContent",
18475            "chat_id": chat_id,
18476            "message_id": message_id,
18477        });
18478        let response = send_request(client_id, request).await;
18479        if response["@type"] == "error" {
18480            return Err(serde_json::from_value(response).unwrap())
18481        }
18482        Ok(())
18483    }
18484    /// Informs TDLib that a message with an animated emoji was clicked by the user. Returns a big animated sticker to be played or a 404 error if usual animation needs to be played
18485    /// # Arguments
18486    /// * `chat_id` - Chat identifier of the message
18487    /// * `message_id` - Identifier of the clicked message
18488    /// * `client_id` - The client id to send the request to
18489    #[allow(clippy::too_many_arguments)]
18490    pub async fn click_animated_emoji_message(chat_id: i64, message_id: i64, client_id: i32) -> Result<crate::enums::Sticker, crate::types::Error> {
18491        let request = json!({
18492            "@type": "clickAnimatedEmojiMessage",
18493            "chat_id": chat_id,
18494            "message_id": message_id,
18495        });
18496        let response = send_request(client_id, request).await;
18497        if response["@type"] == "error" {
18498            return Err(serde_json::from_value(response).unwrap())
18499        }
18500        Ok(serde_json::from_value(response).unwrap())
18501    }
18502    /// Returns an HTTPS or a tg: link with the given type. Can be called before authorization
18503    /// # Arguments
18504    /// * `r#type` - Expected type of the link
18505    /// * `is_http` - Pass true to create an HTTPS link (only available for some link types); pass false to create a tg: link
18506    /// * `client_id` - The client id to send the request to
18507    #[allow(clippy::too_many_arguments)]
18508    pub async fn get_internal_link(r#type: crate::enums::InternalLinkType, is_http: bool, client_id: i32) -> Result<crate::enums::HttpUrl, crate::types::Error> {
18509        let request = json!({
18510            "@type": "getInternalLink",
18511            "type": r#type,
18512            "is_http": is_http,
18513        });
18514        let response = send_request(client_id, request).await;
18515        if response["@type"] == "error" {
18516            return Err(serde_json::from_value(response).unwrap())
18517        }
18518        Ok(serde_json::from_value(response).unwrap())
18519    }
18520    /// Returns information about the type of an internal link. Returns a 404 error if the link is not internal. Can be called before authorization
18521    /// # Arguments
18522    /// * `link` - The link
18523    /// * `client_id` - The client id to send the request to
18524    #[allow(clippy::too_many_arguments)]
18525    pub async fn get_internal_link_type(link: String, client_id: i32) -> Result<crate::enums::InternalLinkType, crate::types::Error> {
18526        let request = json!({
18527            "@type": "getInternalLinkType",
18528            "link": link,
18529        });
18530        let response = send_request(client_id, request).await;
18531        if response["@type"] == "error" {
18532            return Err(serde_json::from_value(response).unwrap())
18533        }
18534        Ok(serde_json::from_value(response).unwrap())
18535    }
18536    /// Returns information about an action to be done when the current user clicks an external link. Don't use this method for links from secret chats if web page preview is disabled in secret chats
18537    /// # Arguments
18538    /// * `link` - The link
18539    /// * `client_id` - The client id to send the request to
18540    #[allow(clippy::too_many_arguments)]
18541    pub async fn get_external_link_info(link: String, client_id: i32) -> Result<crate::enums::LoginUrlInfo, crate::types::Error> {
18542        let request = json!({
18543            "@type": "getExternalLinkInfo",
18544            "link": link,
18545        });
18546        let response = send_request(client_id, request).await;
18547        if response["@type"] == "error" {
18548            return Err(serde_json::from_value(response).unwrap())
18549        }
18550        Ok(serde_json::from_value(response).unwrap())
18551    }
18552    /// Returns an HTTP URL which can be used to automatically authorize the current user on a website after clicking an HTTP link. Use the method getExternalLinkInfo to find whether a prior user confirmation is needed
18553    /// # Arguments
18554    /// * `link` - The HTTP link
18555    /// * `allow_write_access` - Pass true if the current user allowed the bot, returned in getExternalLinkInfo, to send them messages
18556    /// * `client_id` - The client id to send the request to
18557    #[allow(clippy::too_many_arguments)]
18558    pub async fn get_external_link(link: String, allow_write_access: bool, client_id: i32) -> Result<crate::enums::HttpUrl, crate::types::Error> {
18559        let request = json!({
18560            "@type": "getExternalLink",
18561            "link": link,
18562            "allow_write_access": allow_write_access,
18563        });
18564        let response = send_request(client_id, request).await;
18565        if response["@type"] == "error" {
18566            return Err(serde_json::from_value(response).unwrap())
18567        }
18568        Ok(serde_json::from_value(response).unwrap())
18569    }
18570    /// Marks all mentions in a chat as read
18571    /// # Arguments
18572    /// * `chat_id` - Chat identifier
18573    /// * `client_id` - The client id to send the request to
18574    #[allow(clippy::too_many_arguments)]
18575    pub async fn read_all_chat_mentions(chat_id: i64, client_id: i32) -> Result<(), crate::types::Error> {
18576        let request = json!({
18577            "@type": "readAllChatMentions",
18578            "chat_id": chat_id,
18579        });
18580        let response = send_request(client_id, request).await;
18581        if response["@type"] == "error" {
18582            return Err(serde_json::from_value(response).unwrap())
18583        }
18584        Ok(())
18585    }
18586    /// Marks all mentions in a forum topic as read
18587    /// # Arguments
18588    /// * `chat_id` - Chat identifier
18589    /// * `message_thread_id` - Message thread identifier in which mentions are marked as read
18590    /// * `client_id` - The client id to send the request to
18591    #[allow(clippy::too_many_arguments)]
18592    pub async fn read_all_message_thread_mentions(chat_id: i64, message_thread_id: i64, client_id: i32) -> Result<(), crate::types::Error> {
18593        let request = json!({
18594            "@type": "readAllMessageThreadMentions",
18595            "chat_id": chat_id,
18596            "message_thread_id": message_thread_id,
18597        });
18598        let response = send_request(client_id, request).await;
18599        if response["@type"] == "error" {
18600            return Err(serde_json::from_value(response).unwrap())
18601        }
18602        Ok(())
18603    }
18604    /// Marks all reactions in a chat or a forum topic as read
18605    /// # Arguments
18606    /// * `chat_id` - Chat identifier
18607    /// * `client_id` - The client id to send the request to
18608    #[allow(clippy::too_many_arguments)]
18609    pub async fn read_all_chat_reactions(chat_id: i64, client_id: i32) -> Result<(), crate::types::Error> {
18610        let request = json!({
18611            "@type": "readAllChatReactions",
18612            "chat_id": chat_id,
18613        });
18614        let response = send_request(client_id, request).await;
18615        if response["@type"] == "error" {
18616            return Err(serde_json::from_value(response).unwrap())
18617        }
18618        Ok(())
18619    }
18620    /// Marks all reactions in a forum topic as read
18621    /// # Arguments
18622    /// * `chat_id` - Chat identifier
18623    /// * `message_thread_id` - Message thread identifier in which reactions are marked as read
18624    /// * `client_id` - The client id to send the request to
18625    #[allow(clippy::too_many_arguments)]
18626    pub async fn read_all_message_thread_reactions(chat_id: i64, message_thread_id: i64, client_id: i32) -> Result<(), crate::types::Error> {
18627        let request = json!({
18628            "@type": "readAllMessageThreadReactions",
18629            "chat_id": chat_id,
18630            "message_thread_id": message_thread_id,
18631        });
18632        let response = send_request(client_id, request).await;
18633        if response["@type"] == "error" {
18634            return Err(serde_json::from_value(response).unwrap())
18635        }
18636        Ok(())
18637    }
18638    /// Returns an existing chat corresponding to a given user
18639    /// # Arguments
18640    /// * `user_id` - User identifier
18641    /// * `force` - Pass true to create the chat without a network request. In this case all information about the chat except its type, title and photo can be incorrect
18642    /// * `client_id` - The client id to send the request to
18643    #[allow(clippy::too_many_arguments)]
18644    pub async fn create_private_chat(user_id: i64, force: bool, client_id: i32) -> Result<crate::enums::Chat, crate::types::Error> {
18645        let request = json!({
18646            "@type": "createPrivateChat",
18647            "user_id": user_id,
18648            "force": force,
18649        });
18650        let response = send_request(client_id, request).await;
18651        if response["@type"] == "error" {
18652            return Err(serde_json::from_value(response).unwrap())
18653        }
18654        Ok(serde_json::from_value(response).unwrap())
18655    }
18656    /// Returns an existing chat corresponding to a known basic group
18657    /// # Arguments
18658    /// * `basic_group_id` - Basic group identifier
18659    /// * `force` - Pass true to create the chat without a network request. In this case all information about the chat except its type, title and photo can be incorrect
18660    /// * `client_id` - The client id to send the request to
18661    #[allow(clippy::too_many_arguments)]
18662    pub async fn create_basic_group_chat(basic_group_id: i64, force: bool, client_id: i32) -> Result<crate::enums::Chat, crate::types::Error> {
18663        let request = json!({
18664            "@type": "createBasicGroupChat",
18665            "basic_group_id": basic_group_id,
18666            "force": force,
18667        });
18668        let response = send_request(client_id, request).await;
18669        if response["@type"] == "error" {
18670            return Err(serde_json::from_value(response).unwrap())
18671        }
18672        Ok(serde_json::from_value(response).unwrap())
18673    }
18674    /// Returns an existing chat corresponding to a known supergroup or channel
18675    /// # Arguments
18676    /// * `supergroup_id` - Supergroup or channel identifier
18677    /// * `force` - Pass true to create the chat without a network request. In this case all information about the chat except its type, title and photo can be incorrect
18678    /// * `client_id` - The client id to send the request to
18679    #[allow(clippy::too_many_arguments)]
18680    pub async fn create_supergroup_chat(supergroup_id: i64, force: bool, client_id: i32) -> Result<crate::enums::Chat, crate::types::Error> {
18681        let request = json!({
18682            "@type": "createSupergroupChat",
18683            "supergroup_id": supergroup_id,
18684            "force": force,
18685        });
18686        let response = send_request(client_id, request).await;
18687        if response["@type"] == "error" {
18688            return Err(serde_json::from_value(response).unwrap())
18689        }
18690        Ok(serde_json::from_value(response).unwrap())
18691    }
18692    /// Returns an existing chat corresponding to a known secret chat
18693    /// # Arguments
18694    /// * `secret_chat_id` - Secret chat identifier
18695    /// * `client_id` - The client id to send the request to
18696    #[allow(clippy::too_many_arguments)]
18697    pub async fn create_secret_chat(secret_chat_id: i32, client_id: i32) -> Result<crate::enums::Chat, crate::types::Error> {
18698        let request = json!({
18699            "@type": "createSecretChat",
18700            "secret_chat_id": secret_chat_id,
18701        });
18702        let response = send_request(client_id, request).await;
18703        if response["@type"] == "error" {
18704            return Err(serde_json::from_value(response).unwrap())
18705        }
18706        Ok(serde_json::from_value(response).unwrap())
18707    }
18708    /// Creates a new basic group and sends a corresponding messageBasicGroupChatCreate. Returns the newly created chat
18709    /// # Arguments
18710    /// * `user_ids` - Identifiers of users to be added to the basic group; may be empty to create a basic group without other members
18711    /// * `title` - Title of the new basic group; 1-128 characters
18712    /// * `message_auto_delete_time` - Message auto-delete time value, in seconds; must be from 0 up to 365 * 86400 and be divisible by 86400. If 0, then messages aren't deleted automatically
18713    /// * `client_id` - The client id to send the request to
18714    #[allow(clippy::too_many_arguments)]
18715    pub async fn create_new_basic_group_chat(user_ids: Vec<i64>, title: String, message_auto_delete_time: i32, client_id: i32) -> Result<crate::enums::Chat, crate::types::Error> {
18716        let request = json!({
18717            "@type": "createNewBasicGroupChat",
18718            "user_ids": user_ids,
18719            "title": title,
18720            "message_auto_delete_time": message_auto_delete_time,
18721        });
18722        let response = send_request(client_id, request).await;
18723        if response["@type"] == "error" {
18724            return Err(serde_json::from_value(response).unwrap())
18725        }
18726        Ok(serde_json::from_value(response).unwrap())
18727    }
18728    /// Creates a new supergroup or channel and sends a corresponding messageSupergroupChatCreate. Returns the newly created chat
18729    /// # Arguments
18730    /// * `title` - Title of the new chat; 1-128 characters
18731    /// * `is_forum` - Pass true to create a forum supergroup chat
18732    /// * `is_channel` - Pass true to create a channel chat; ignored if a forum is created
18733    /// * `description` - Chat description; 0-255 characters
18734    /// * `location` - Chat location if a location-based supergroup is being created; pass null to create an ordinary supergroup chat
18735    /// * `message_auto_delete_time` - Message auto-delete time value, in seconds; must be from 0 up to 365 * 86400 and be divisible by 86400. If 0, then messages aren't deleted automatically
18736    /// * `for_import` - Pass true to create a supergroup for importing messages using importMessages
18737    /// * `client_id` - The client id to send the request to
18738    #[allow(clippy::too_many_arguments)]
18739    pub async fn create_new_supergroup_chat(title: String, is_forum: bool, is_channel: bool, description: String, location: Option<crate::types::ChatLocation>, message_auto_delete_time: i32, for_import: bool, client_id: i32) -> Result<crate::enums::Chat, crate::types::Error> {
18740        let request = json!({
18741            "@type": "createNewSupergroupChat",
18742            "title": title,
18743            "is_forum": is_forum,
18744            "is_channel": is_channel,
18745            "description": description,
18746            "location": location,
18747            "message_auto_delete_time": message_auto_delete_time,
18748            "for_import": for_import,
18749        });
18750        let response = send_request(client_id, request).await;
18751        if response["@type"] == "error" {
18752            return Err(serde_json::from_value(response).unwrap())
18753        }
18754        Ok(serde_json::from_value(response).unwrap())
18755    }
18756    /// Creates a new secret chat. Returns the newly created chat
18757    /// # Arguments
18758    /// * `user_id` - Identifier of the target user
18759    /// * `client_id` - The client id to send the request to
18760    #[allow(clippy::too_many_arguments)]
18761    pub async fn create_new_secret_chat(user_id: i64, client_id: i32) -> Result<crate::enums::Chat, crate::types::Error> {
18762        let request = json!({
18763            "@type": "createNewSecretChat",
18764            "user_id": user_id,
18765        });
18766        let response = send_request(client_id, request).await;
18767        if response["@type"] == "error" {
18768            return Err(serde_json::from_value(response).unwrap())
18769        }
18770        Ok(serde_json::from_value(response).unwrap())
18771    }
18772    /// Creates a new supergroup from an existing basic group and sends a corresponding messageChatUpgradeTo and messageChatUpgradeFrom; requires creator privileges. Deactivates the original basic group
18773    /// # Arguments
18774    /// * `chat_id` - Identifier of the chat to upgrade
18775    /// * `client_id` - The client id to send the request to
18776    #[allow(clippy::too_many_arguments)]
18777    pub async fn upgrade_basic_group_chat_to_supergroup_chat(chat_id: i64, client_id: i32) -> Result<crate::enums::Chat, crate::types::Error> {
18778        let request = json!({
18779            "@type": "upgradeBasicGroupChatToSupergroupChat",
18780            "chat_id": chat_id,
18781        });
18782        let response = send_request(client_id, request).await;
18783        if response["@type"] == "error" {
18784            return Err(serde_json::from_value(response).unwrap())
18785        }
18786        Ok(serde_json::from_value(response).unwrap())
18787    }
18788    /// Returns chat lists to which the chat can be added. This is an offline request
18789    /// # Arguments
18790    /// * `chat_id` - Chat identifier
18791    /// * `client_id` - The client id to send the request to
18792    #[allow(clippy::too_many_arguments)]
18793    pub async fn get_chat_lists_to_add_chat(chat_id: i64, client_id: i32) -> Result<crate::enums::ChatLists, crate::types::Error> {
18794        let request = json!({
18795            "@type": "getChatListsToAddChat",
18796            "chat_id": chat_id,
18797        });
18798        let response = send_request(client_id, request).await;
18799        if response["@type"] == "error" {
18800            return Err(serde_json::from_value(response).unwrap())
18801        }
18802        Ok(serde_json::from_value(response).unwrap())
18803    }
18804    /// Adds a chat to a chat list. A chat can't be simultaneously in Main and Archive chat lists, so it is automatically removed from another one if needed
18805    /// # Arguments
18806    /// * `chat_id` - Chat identifier
18807    /// * `chat_list` - The chat list. Use getChatListsToAddChat to get suitable chat lists
18808    /// * `client_id` - The client id to send the request to
18809    #[allow(clippy::too_many_arguments)]
18810    pub async fn add_chat_to_list(chat_id: i64, chat_list: crate::enums::ChatList, client_id: i32) -> Result<(), crate::types::Error> {
18811        let request = json!({
18812            "@type": "addChatToList",
18813            "chat_id": chat_id,
18814            "chat_list": chat_list,
18815        });
18816        let response = send_request(client_id, request).await;
18817        if response["@type"] == "error" {
18818            return Err(serde_json::from_value(response).unwrap())
18819        }
18820        Ok(())
18821    }
18822    /// Returns information about a chat folder by its identifier
18823    /// # Arguments
18824    /// * `chat_folder_id` - Chat folder identifier
18825    /// * `client_id` - The client id to send the request to
18826    #[allow(clippy::too_many_arguments)]
18827    pub async fn get_chat_folder(chat_folder_id: i32, client_id: i32) -> Result<crate::enums::ChatFolder, crate::types::Error> {
18828        let request = json!({
18829            "@type": "getChatFolder",
18830            "chat_folder_id": chat_folder_id,
18831        });
18832        let response = send_request(client_id, request).await;
18833        if response["@type"] == "error" {
18834            return Err(serde_json::from_value(response).unwrap())
18835        }
18836        Ok(serde_json::from_value(response).unwrap())
18837    }
18838    /// Creates new chat folder. Returns information about the created chat folder. There can be up to getOption("chat_folder_count_max") chat folders, but the limit can be increased with Telegram Premium
18839    /// # Arguments
18840    /// * `folder` - The new chat folder
18841    /// * `client_id` - The client id to send the request to
18842    #[allow(clippy::too_many_arguments)]
18843    pub async fn create_chat_folder(folder: crate::types::ChatFolder, client_id: i32) -> Result<crate::enums::ChatFolderInfo, crate::types::Error> {
18844        let request = json!({
18845            "@type": "createChatFolder",
18846            "folder": folder,
18847        });
18848        let response = send_request(client_id, request).await;
18849        if response["@type"] == "error" {
18850            return Err(serde_json::from_value(response).unwrap())
18851        }
18852        Ok(serde_json::from_value(response).unwrap())
18853    }
18854    /// Edits existing chat folder. Returns information about the edited chat folder
18855    /// # Arguments
18856    /// * `chat_folder_id` - Chat folder identifier
18857    /// * `folder` - The edited chat folder
18858    /// * `client_id` - The client id to send the request to
18859    #[allow(clippy::too_many_arguments)]
18860    pub async fn edit_chat_folder(chat_folder_id: i32, folder: crate::types::ChatFolder, client_id: i32) -> Result<crate::enums::ChatFolderInfo, crate::types::Error> {
18861        let request = json!({
18862            "@type": "editChatFolder",
18863            "chat_folder_id": chat_folder_id,
18864            "folder": folder,
18865        });
18866        let response = send_request(client_id, request).await;
18867        if response["@type"] == "error" {
18868            return Err(serde_json::from_value(response).unwrap())
18869        }
18870        Ok(serde_json::from_value(response).unwrap())
18871    }
18872    /// Deletes existing chat folder
18873    /// # Arguments
18874    /// * `chat_folder_id` - Chat folder identifier
18875    /// * `leave_chat_ids` - Identifiers of the chats to leave. The chats must be pinned or always included in the folder
18876    /// * `client_id` - The client id to send the request to
18877    #[allow(clippy::too_many_arguments)]
18878    pub async fn delete_chat_folder(chat_folder_id: i32, leave_chat_ids: Vec<i64>, client_id: i32) -> Result<(), crate::types::Error> {
18879        let request = json!({
18880            "@type": "deleteChatFolder",
18881            "chat_folder_id": chat_folder_id,
18882            "leave_chat_ids": leave_chat_ids,
18883        });
18884        let response = send_request(client_id, request).await;
18885        if response["@type"] == "error" {
18886            return Err(serde_json::from_value(response).unwrap())
18887        }
18888        Ok(())
18889    }
18890    /// Returns identifiers of pinned or always included chats from a chat folder, which are suggested to be left when the chat folder is deleted
18891    /// # Arguments
18892    /// * `chat_folder_id` - Chat folder identifier
18893    /// * `client_id` - The client id to send the request to
18894    #[allow(clippy::too_many_arguments)]
18895    pub async fn get_chat_folder_chats_to_leave(chat_folder_id: i32, client_id: i32) -> Result<crate::enums::Chats, crate::types::Error> {
18896        let request = json!({
18897            "@type": "getChatFolderChatsToLeave",
18898            "chat_folder_id": chat_folder_id,
18899        });
18900        let response = send_request(client_id, request).await;
18901        if response["@type"] == "error" {
18902            return Err(serde_json::from_value(response).unwrap())
18903        }
18904        Ok(serde_json::from_value(response).unwrap())
18905    }
18906    /// Returns approximate number of chats in a being created chat folder. Main and archive chat lists must be fully preloaded for this function to work correctly
18907    /// # Arguments
18908    /// * `folder` - The new chat folder
18909    /// * `client_id` - The client id to send the request to
18910    #[allow(clippy::too_many_arguments)]
18911    pub async fn get_chat_folder_chat_count(folder: crate::types::ChatFolder, client_id: i32) -> Result<crate::enums::Count, crate::types::Error> {
18912        let request = json!({
18913            "@type": "getChatFolderChatCount",
18914            "folder": folder,
18915        });
18916        let response = send_request(client_id, request).await;
18917        if response["@type"] == "error" {
18918            return Err(serde_json::from_value(response).unwrap())
18919        }
18920        Ok(serde_json::from_value(response).unwrap())
18921    }
18922    /// Changes the order of chat folders
18923    /// # Arguments
18924    /// * `chat_folder_ids` - Identifiers of chat folders in the new correct order
18925    /// * `main_chat_list_position` - Position of the main chat list among chat folders, 0-based. Can be non-zero only for Premium users
18926    /// * `client_id` - The client id to send the request to
18927    #[allow(clippy::too_many_arguments)]
18928    pub async fn reorder_chat_folders(chat_folder_ids: Vec<i32>, main_chat_list_position: i32, client_id: i32) -> Result<(), crate::types::Error> {
18929        let request = json!({
18930            "@type": "reorderChatFolders",
18931            "chat_folder_ids": chat_folder_ids,
18932            "main_chat_list_position": main_chat_list_position,
18933        });
18934        let response = send_request(client_id, request).await;
18935        if response["@type"] == "error" {
18936            return Err(serde_json::from_value(response).unwrap())
18937        }
18938        Ok(())
18939    }
18940    /// Returns recommended chat folders for the current user
18941    /// # Arguments
18942    /// * `client_id` - The client id to send the request to
18943    #[allow(clippy::too_many_arguments)]
18944    pub async fn get_recommended_chat_folders(client_id: i32) -> Result<crate::enums::RecommendedChatFolders, crate::types::Error> {
18945        let request = json!({
18946            "@type": "getRecommendedChatFolders",
18947        });
18948        let response = send_request(client_id, request).await;
18949        if response["@type"] == "error" {
18950            return Err(serde_json::from_value(response).unwrap())
18951        }
18952        Ok(serde_json::from_value(response).unwrap())
18953    }
18954    /// Returns default icon name for a folder. Can be called synchronously
18955    /// # Arguments
18956    /// * `folder` - Chat folder
18957    /// * `client_id` - The client id to send the request to
18958    #[allow(clippy::too_many_arguments)]
18959    pub async fn get_chat_folder_default_icon_name(folder: crate::types::ChatFolder, client_id: i32) -> Result<crate::enums::ChatFolderIcon, crate::types::Error> {
18960        let request = json!({
18961            "@type": "getChatFolderDefaultIconName",
18962            "folder": folder,
18963        });
18964        let response = send_request(client_id, request).await;
18965        if response["@type"] == "error" {
18966            return Err(serde_json::from_value(response).unwrap())
18967        }
18968        Ok(serde_json::from_value(response).unwrap())
18969    }
18970    /// Returns identifiers of chats from a chat folder, suitable for adding to a chat folder invite link
18971    /// # Arguments
18972    /// * `chat_folder_id` - Chat folder identifier
18973    /// * `client_id` - The client id to send the request to
18974    #[allow(clippy::too_many_arguments)]
18975    pub async fn get_chats_for_chat_folder_invite_link(chat_folder_id: i32, client_id: i32) -> Result<crate::enums::Chats, crate::types::Error> {
18976        let request = json!({
18977            "@type": "getChatsForChatFolderInviteLink",
18978            "chat_folder_id": chat_folder_id,
18979        });
18980        let response = send_request(client_id, request).await;
18981        if response["@type"] == "error" {
18982            return Err(serde_json::from_value(response).unwrap())
18983        }
18984        Ok(serde_json::from_value(response).unwrap())
18985    }
18986    /// Creates a new invite link for a chat folder. A link can be created for a chat folder if it has only pinned and included chats
18987    /// # Arguments
18988    /// * `chat_folder_id` - Chat folder identifier
18989    /// * `name` - Name of the link; 0-32 characters
18990    /// * `chat_ids` - Identifiers of chats to be accessible by the invite link. Use getChatsForChatFolderInviteLink to get suitable chats. Basic groups will be automatically converted to supergroups before link creation
18991    /// * `client_id` - The client id to send the request to
18992    #[allow(clippy::too_many_arguments)]
18993    pub async fn create_chat_folder_invite_link(chat_folder_id: i32, name: String, chat_ids: Vec<i64>, client_id: i32) -> Result<crate::enums::ChatFolderInviteLink, crate::types::Error> {
18994        let request = json!({
18995            "@type": "createChatFolderInviteLink",
18996            "chat_folder_id": chat_folder_id,
18997            "name": name,
18998            "chat_ids": chat_ids,
18999        });
19000        let response = send_request(client_id, request).await;
19001        if response["@type"] == "error" {
19002            return Err(serde_json::from_value(response).unwrap())
19003        }
19004        Ok(serde_json::from_value(response).unwrap())
19005    }
19006    /// Returns invite links created by the current user for a shareable chat folder
19007    /// # Arguments
19008    /// * `chat_folder_id` - Chat folder identifier
19009    /// * `client_id` - The client id to send the request to
19010    #[allow(clippy::too_many_arguments)]
19011    pub async fn get_chat_folder_invite_links(chat_folder_id: i32, client_id: i32) -> Result<crate::enums::ChatFolderInviteLinks, crate::types::Error> {
19012        let request = json!({
19013            "@type": "getChatFolderInviteLinks",
19014            "chat_folder_id": chat_folder_id,
19015        });
19016        let response = send_request(client_id, request).await;
19017        if response["@type"] == "error" {
19018            return Err(serde_json::from_value(response).unwrap())
19019        }
19020        Ok(serde_json::from_value(response).unwrap())
19021    }
19022    /// Edits an invite link for a chat folder
19023    /// # Arguments
19024    /// * `chat_folder_id` - Chat folder identifier
19025    /// * `invite_link` - Invite link to be edited
19026    /// * `name` - New name of the link; 0-32 characters
19027    /// * `chat_ids` - New identifiers of chats to be accessible by the invite link. Use getChatsForChatFolderInviteLink to get suitable chats. Basic groups will be automatically converted to supergroups before link editing
19028    /// * `client_id` - The client id to send the request to
19029    #[allow(clippy::too_many_arguments)]
19030    pub async fn edit_chat_folder_invite_link(chat_folder_id: i32, invite_link: String, name: String, chat_ids: Vec<i64>, client_id: i32) -> Result<crate::enums::ChatFolderInviteLink, crate::types::Error> {
19031        let request = json!({
19032            "@type": "editChatFolderInviteLink",
19033            "chat_folder_id": chat_folder_id,
19034            "invite_link": invite_link,
19035            "name": name,
19036            "chat_ids": chat_ids,
19037        });
19038        let response = send_request(client_id, request).await;
19039        if response["@type"] == "error" {
19040            return Err(serde_json::from_value(response).unwrap())
19041        }
19042        Ok(serde_json::from_value(response).unwrap())
19043    }
19044    /// Deletes an invite link for a chat folder
19045    /// # Arguments
19046    /// * `chat_folder_id` - Chat folder identifier
19047    /// * `invite_link` - Invite link to be deleted
19048    /// * `client_id` - The client id to send the request to
19049    #[allow(clippy::too_many_arguments)]
19050    pub async fn delete_chat_folder_invite_link(chat_folder_id: i32, invite_link: String, client_id: i32) -> Result<(), crate::types::Error> {
19051        let request = json!({
19052            "@type": "deleteChatFolderInviteLink",
19053            "chat_folder_id": chat_folder_id,
19054            "invite_link": invite_link,
19055        });
19056        let response = send_request(client_id, request).await;
19057        if response["@type"] == "error" {
19058            return Err(serde_json::from_value(response).unwrap())
19059        }
19060        Ok(())
19061    }
19062    /// Checks the validity of an invite link for a chat folder and returns information about the corresponding chat folder
19063    /// # Arguments
19064    /// * `invite_link` - Invite link to be checked
19065    /// * `client_id` - The client id to send the request to
19066    #[allow(clippy::too_many_arguments)]
19067    pub async fn check_chat_folder_invite_link(invite_link: String, client_id: i32) -> Result<crate::enums::ChatFolderInviteLinkInfo, crate::types::Error> {
19068        let request = json!({
19069            "@type": "checkChatFolderInviteLink",
19070            "invite_link": invite_link,
19071        });
19072        let response = send_request(client_id, request).await;
19073        if response["@type"] == "error" {
19074            return Err(serde_json::from_value(response).unwrap())
19075        }
19076        Ok(serde_json::from_value(response).unwrap())
19077    }
19078    /// Adds a chat folder by an invite link
19079    /// # Arguments
19080    /// * `invite_link` - Invite link for the chat folder
19081    /// * `chat_ids` - Identifiers of the chats added to the chat folder. The chats are automatically joined if they aren't joined yet
19082    /// * `client_id` - The client id to send the request to
19083    #[allow(clippy::too_many_arguments)]
19084    pub async fn add_chat_folder_by_invite_link(invite_link: String, chat_ids: Vec<i64>, client_id: i32) -> Result<(), crate::types::Error> {
19085        let request = json!({
19086            "@type": "addChatFolderByInviteLink",
19087            "invite_link": invite_link,
19088            "chat_ids": chat_ids,
19089        });
19090        let response = send_request(client_id, request).await;
19091        if response["@type"] == "error" {
19092            return Err(serde_json::from_value(response).unwrap())
19093        }
19094        Ok(())
19095    }
19096    /// Returns new chats added to a shareable chat folder by its owner. The method must be called at most once in getOption("chat_folder_new_chats_update_period") for the given chat folder
19097    /// # Arguments
19098    /// * `chat_folder_id` - Chat folder identifier
19099    /// * `client_id` - The client id to send the request to
19100    #[allow(clippy::too_many_arguments)]
19101    pub async fn get_chat_folder_new_chats(chat_folder_id: i32, client_id: i32) -> Result<crate::enums::Chats, crate::types::Error> {
19102        let request = json!({
19103            "@type": "getChatFolderNewChats",
19104            "chat_folder_id": chat_folder_id,
19105        });
19106        let response = send_request(client_id, request).await;
19107        if response["@type"] == "error" {
19108            return Err(serde_json::from_value(response).unwrap())
19109        }
19110        Ok(serde_json::from_value(response).unwrap())
19111    }
19112    /// Process new chats added to a shareable chat folder by its owner
19113    /// # Arguments
19114    /// * `chat_folder_id` - Chat folder identifier
19115    /// * `added_chat_ids` - Identifiers of the new chats, which are added to the chat folder. The chats are automatically joined if they aren't joined yet
19116    /// * `client_id` - The client id to send the request to
19117    #[allow(clippy::too_many_arguments)]
19118    pub async fn process_chat_folder_new_chats(chat_folder_id: i32, added_chat_ids: Vec<i64>, client_id: i32) -> Result<(), crate::types::Error> {
19119        let request = json!({
19120            "@type": "processChatFolderNewChats",
19121            "chat_folder_id": chat_folder_id,
19122            "added_chat_ids": added_chat_ids,
19123        });
19124        let response = send_request(client_id, request).await;
19125        if response["@type"] == "error" {
19126            return Err(serde_json::from_value(response).unwrap())
19127        }
19128        Ok(())
19129    }
19130    /// Returns settings for automatic moving of chats to and from the Archive chat lists
19131    /// # Arguments
19132    /// * `client_id` - The client id to send the request to
19133    #[allow(clippy::too_many_arguments)]
19134    pub async fn get_archive_chat_list_settings(client_id: i32) -> Result<crate::enums::ArchiveChatListSettings, crate::types::Error> {
19135        let request = json!({
19136            "@type": "getArchiveChatListSettings",
19137        });
19138        let response = send_request(client_id, request).await;
19139        if response["@type"] == "error" {
19140            return Err(serde_json::from_value(response).unwrap())
19141        }
19142        Ok(serde_json::from_value(response).unwrap())
19143    }
19144    /// Changes settings for automatic moving of chats to and from the Archive chat lists
19145    /// # Arguments
19146    /// * `settings` - New settings
19147    /// * `client_id` - The client id to send the request to
19148    #[allow(clippy::too_many_arguments)]
19149    pub async fn set_archive_chat_list_settings(settings: crate::types::ArchiveChatListSettings, client_id: i32) -> Result<(), crate::types::Error> {
19150        let request = json!({
19151            "@type": "setArchiveChatListSettings",
19152            "settings": settings,
19153        });
19154        let response = send_request(client_id, request).await;
19155        if response["@type"] == "error" {
19156            return Err(serde_json::from_value(response).unwrap())
19157        }
19158        Ok(())
19159    }
19160    /// Changes the chat title. Supported only for basic groups, supergroups and channels. Requires can_change_info administrator right
19161    /// # Arguments
19162    /// * `chat_id` - Chat identifier
19163    /// * `title` - New title of the chat; 1-128 characters
19164    /// * `client_id` - The client id to send the request to
19165    #[allow(clippy::too_many_arguments)]
19166    pub async fn set_chat_title(chat_id: i64, title: String, client_id: i32) -> Result<(), crate::types::Error> {
19167        let request = json!({
19168            "@type": "setChatTitle",
19169            "chat_id": chat_id,
19170            "title": title,
19171        });
19172        let response = send_request(client_id, request).await;
19173        if response["@type"] == "error" {
19174            return Err(serde_json::from_value(response).unwrap())
19175        }
19176        Ok(())
19177    }
19178    /// Changes the photo of a chat. Supported only for basic groups, supergroups and channels. Requires can_change_info administrator right
19179    /// # Arguments
19180    /// * `chat_id` - Chat identifier
19181    /// * `photo` - New chat photo; pass null to delete the chat photo
19182    /// * `client_id` - The client id to send the request to
19183    #[allow(clippy::too_many_arguments)]
19184    pub async fn set_chat_photo(chat_id: i64, photo: Option<crate::enums::InputChatPhoto>, client_id: i32) -> Result<(), crate::types::Error> {
19185        let request = json!({
19186            "@type": "setChatPhoto",
19187            "chat_id": chat_id,
19188            "photo": photo,
19189        });
19190        let response = send_request(client_id, request).await;
19191        if response["@type"] == "error" {
19192            return Err(serde_json::from_value(response).unwrap())
19193        }
19194        Ok(())
19195    }
19196    /// Changes the message auto-delete or self-destruct (for secret chats) time in a chat. Requires change_info administrator right in basic groups, supergroups and channels
19197    /// Message auto-delete time can't be changed in a chat with the current user (Saved Messages) and the chat 777000 (Telegram).
19198    /// # Arguments
19199    /// * `chat_id` - Chat identifier
19200    /// * `message_auto_delete_time` - New time value, in seconds; unless the chat is secret, it must be from 0 up to 365 * 86400 and be divisible by 86400. If 0, then messages aren't deleted automatically
19201    /// * `client_id` - The client id to send the request to
19202    #[allow(clippy::too_many_arguments)]
19203    pub async fn set_chat_message_auto_delete_time(chat_id: i64, message_auto_delete_time: i32, client_id: i32) -> Result<(), crate::types::Error> {
19204        let request = json!({
19205            "@type": "setChatMessageAutoDeleteTime",
19206            "chat_id": chat_id,
19207            "message_auto_delete_time": message_auto_delete_time,
19208        });
19209        let response = send_request(client_id, request).await;
19210        if response["@type"] == "error" {
19211            return Err(serde_json::from_value(response).unwrap())
19212        }
19213        Ok(())
19214    }
19215    /// Changes the chat members permissions. Supported only for basic groups and supergroups. Requires can_restrict_members administrator right
19216    /// # Arguments
19217    /// * `chat_id` - Chat identifier
19218    /// * `permissions` - New non-administrator members permissions in the chat
19219    /// * `client_id` - The client id to send the request to
19220    #[allow(clippy::too_many_arguments)]
19221    pub async fn set_chat_permissions(chat_id: i64, permissions: crate::types::ChatPermissions, client_id: i32) -> Result<(), crate::types::Error> {
19222        let request = json!({
19223            "@type": "setChatPermissions",
19224            "chat_id": chat_id,
19225            "permissions": permissions,
19226        });
19227        let response = send_request(client_id, request).await;
19228        if response["@type"] == "error" {
19229            return Err(serde_json::from_value(response).unwrap())
19230        }
19231        Ok(())
19232    }
19233    /// Changes the background in a specific chat. Supported only in private and secret chats with non-deleted users
19234    /// # Arguments
19235    /// * `chat_id` - Chat identifier
19236    /// * `background` - The input background to use; pass null to create a new filled background or to remove the current background
19237    /// * `r#type` - Background type; pass null to remove the current background
19238    /// * `dark_theme_dimming` - Dimming of the background in dark themes, as a percentage; 0-100
19239    /// * `client_id` - The client id to send the request to
19240    #[allow(clippy::too_many_arguments)]
19241    pub async fn set_chat_background(chat_id: i64, background: Option<crate::enums::InputBackground>, r#type: Option<crate::enums::BackgroundType>, dark_theme_dimming: i32, client_id: i32) -> Result<(), crate::types::Error> {
19242        let request = json!({
19243            "@type": "setChatBackground",
19244            "chat_id": chat_id,
19245            "background": background,
19246            "type": r#type,
19247            "dark_theme_dimming": dark_theme_dimming,
19248        });
19249        let response = send_request(client_id, request).await;
19250        if response["@type"] == "error" {
19251            return Err(serde_json::from_value(response).unwrap())
19252        }
19253        Ok(())
19254    }
19255    /// Changes the chat theme. Supported only in private and secret chats
19256    /// # Arguments
19257    /// * `chat_id` - Chat identifier
19258    /// * `theme_name` - Name of the new chat theme; pass an empty string to return the default theme
19259    /// * `client_id` - The client id to send the request to
19260    #[allow(clippy::too_many_arguments)]
19261    pub async fn set_chat_theme(chat_id: i64, theme_name: String, client_id: i32) -> Result<(), crate::types::Error> {
19262        let request = json!({
19263            "@type": "setChatTheme",
19264            "chat_id": chat_id,
19265            "theme_name": theme_name,
19266        });
19267        let response = send_request(client_id, request).await;
19268        if response["@type"] == "error" {
19269            return Err(serde_json::from_value(response).unwrap())
19270        }
19271        Ok(())
19272    }
19273    /// Changes the draft message in a chat
19274    /// # Arguments
19275    /// * `chat_id` - Chat identifier
19276    /// * `message_thread_id` - If not 0, a message thread identifier in which the draft was changed
19277    /// * `draft_message` - New draft message; pass null to remove the draft
19278    /// * `client_id` - The client id to send the request to
19279    #[allow(clippy::too_many_arguments)]
19280    pub async fn set_chat_draft_message(chat_id: i64, message_thread_id: i64, draft_message: Option<crate::types::DraftMessage>, client_id: i32) -> Result<(), crate::types::Error> {
19281        let request = json!({
19282            "@type": "setChatDraftMessage",
19283            "chat_id": chat_id,
19284            "message_thread_id": message_thread_id,
19285            "draft_message": draft_message,
19286        });
19287        let response = send_request(client_id, request).await;
19288        if response["@type"] == "error" {
19289            return Err(serde_json::from_value(response).unwrap())
19290        }
19291        Ok(())
19292    }
19293    /// Changes the notification settings of a chat. Notification settings of a chat with the current user (Saved Messages) can't be changed
19294    /// # Arguments
19295    /// * `chat_id` - Chat identifier
19296    /// * `notification_settings` - New notification settings for the chat. If the chat is muted for more than 366 days, it is considered to be muted forever
19297    /// * `client_id` - The client id to send the request to
19298    #[allow(clippy::too_many_arguments)]
19299    pub async fn set_chat_notification_settings(chat_id: i64, notification_settings: crate::types::ChatNotificationSettings, client_id: i32) -> Result<(), crate::types::Error> {
19300        let request = json!({
19301            "@type": "setChatNotificationSettings",
19302            "chat_id": chat_id,
19303            "notification_settings": notification_settings,
19304        });
19305        let response = send_request(client_id, request).await;
19306        if response["@type"] == "error" {
19307            return Err(serde_json::from_value(response).unwrap())
19308        }
19309        Ok(())
19310    }
19311    /// Changes the ability of users to save, forward, or copy chat content. Supported only for basic groups, supergroups and channels. Requires owner privileges
19312    /// # Arguments
19313    /// * `chat_id` - Chat identifier
19314    /// * `has_protected_content` - New value of has_protected_content
19315    /// * `client_id` - The client id to send the request to
19316    #[allow(clippy::too_many_arguments)]
19317    pub async fn toggle_chat_has_protected_content(chat_id: i64, has_protected_content: bool, client_id: i32) -> Result<(), crate::types::Error> {
19318        let request = json!({
19319            "@type": "toggleChatHasProtectedContent",
19320            "chat_id": chat_id,
19321            "has_protected_content": has_protected_content,
19322        });
19323        let response = send_request(client_id, request).await;
19324        if response["@type"] == "error" {
19325            return Err(serde_json::from_value(response).unwrap())
19326        }
19327        Ok(())
19328    }
19329    /// Changes the translatable state of a chat; for Telegram Premium users only
19330    /// # Arguments
19331    /// * `chat_id` - Chat identifier
19332    /// * `is_translatable` - New value of is_translatable
19333    /// * `client_id` - The client id to send the request to
19334    #[allow(clippy::too_many_arguments)]
19335    pub async fn toggle_chat_is_translatable(chat_id: i64, is_translatable: bool, client_id: i32) -> Result<(), crate::types::Error> {
19336        let request = json!({
19337            "@type": "toggleChatIsTranslatable",
19338            "chat_id": chat_id,
19339            "is_translatable": is_translatable,
19340        });
19341        let response = send_request(client_id, request).await;
19342        if response["@type"] == "error" {
19343            return Err(serde_json::from_value(response).unwrap())
19344        }
19345        Ok(())
19346    }
19347    /// Changes the marked as unread state of a chat
19348    /// # Arguments
19349    /// * `chat_id` - Chat identifier
19350    /// * `is_marked_as_unread` - New value of is_marked_as_unread
19351    /// * `client_id` - The client id to send the request to
19352    #[allow(clippy::too_many_arguments)]
19353    pub async fn toggle_chat_is_marked_as_unread(chat_id: i64, is_marked_as_unread: bool, client_id: i32) -> Result<(), crate::types::Error> {
19354        let request = json!({
19355            "@type": "toggleChatIsMarkedAsUnread",
19356            "chat_id": chat_id,
19357            "is_marked_as_unread": is_marked_as_unread,
19358        });
19359        let response = send_request(client_id, request).await;
19360        if response["@type"] == "error" {
19361            return Err(serde_json::from_value(response).unwrap())
19362        }
19363        Ok(())
19364    }
19365    /// Changes the value of the default disable_notification parameter, used when a message is sent to a chat
19366    /// # Arguments
19367    /// * `chat_id` - Chat identifier
19368    /// * `default_disable_notification` - New value of default_disable_notification
19369    /// * `client_id` - The client id to send the request to
19370    #[allow(clippy::too_many_arguments)]
19371    pub async fn toggle_chat_default_disable_notification(chat_id: i64, default_disable_notification: bool, client_id: i32) -> Result<(), crate::types::Error> {
19372        let request = json!({
19373            "@type": "toggleChatDefaultDisableNotification",
19374            "chat_id": chat_id,
19375            "default_disable_notification": default_disable_notification,
19376        });
19377        let response = send_request(client_id, request).await;
19378        if response["@type"] == "error" {
19379            return Err(serde_json::from_value(response).unwrap())
19380        }
19381        Ok(())
19382    }
19383    /// Changes reactions, available in a chat. Available for basic groups, supergroups, and channels. Requires can_change_info administrator right
19384    /// # Arguments
19385    /// * `chat_id` - Identifier of the chat
19386    /// * `available_reactions` - Reactions available in the chat. All emoji reactions must be active
19387    /// * `client_id` - The client id to send the request to
19388    #[allow(clippy::too_many_arguments)]
19389    pub async fn set_chat_available_reactions(chat_id: i64, available_reactions: crate::enums::ChatAvailableReactions, client_id: i32) -> Result<(), crate::types::Error> {
19390        let request = json!({
19391            "@type": "setChatAvailableReactions",
19392            "chat_id": chat_id,
19393            "available_reactions": available_reactions,
19394        });
19395        let response = send_request(client_id, request).await;
19396        if response["@type"] == "error" {
19397            return Err(serde_json::from_value(response).unwrap())
19398        }
19399        Ok(())
19400    }
19401    /// Changes application-specific data associated with a chat
19402    /// # Arguments
19403    /// * `chat_id` - Chat identifier
19404    /// * `client_data` - New value of client_data
19405    /// * `client_id` - The client id to send the request to
19406    #[allow(clippy::too_many_arguments)]
19407    pub async fn set_chat_client_data(chat_id: i64, client_data: String, client_id: i32) -> Result<(), crate::types::Error> {
19408        let request = json!({
19409            "@type": "setChatClientData",
19410            "chat_id": chat_id,
19411            "client_data": client_data,
19412        });
19413        let response = send_request(client_id, request).await;
19414        if response["@type"] == "error" {
19415            return Err(serde_json::from_value(response).unwrap())
19416        }
19417        Ok(())
19418    }
19419    /// Changes information about a chat. Available for basic groups, supergroups, and channels. Requires can_change_info administrator right
19420    /// # Arguments
19421    /// * `chat_id` - Identifier of the chat
19422    /// * `description` - New chat description; 0-255 characters
19423    /// * `client_id` - The client id to send the request to
19424    #[allow(clippy::too_many_arguments)]
19425    pub async fn set_chat_description(chat_id: i64, description: String, client_id: i32) -> Result<(), crate::types::Error> {
19426        let request = json!({
19427            "@type": "setChatDescription",
19428            "chat_id": chat_id,
19429            "description": description,
19430        });
19431        let response = send_request(client_id, request).await;
19432        if response["@type"] == "error" {
19433            return Err(serde_json::from_value(response).unwrap())
19434        }
19435        Ok(())
19436    }
19437    /// Changes the discussion group of a channel chat; requires can_change_info administrator right in the channel if it is specified
19438    /// # Arguments
19439    /// * `chat_id` - Identifier of the channel chat. Pass 0 to remove a link from the supergroup passed in the second argument to a linked channel chat (requires can_pin_messages rights in the supergroup)
19440    /// * `discussion_chat_id` - Identifier of a new channel's discussion group. Use 0 to remove the discussion group. Use the method getSuitableDiscussionChats to find all suitable groups.
19441    /// Basic group chats must be first upgraded to supergroup chats. If new chat members don't have access to old messages in the supergroup, then toggleSupergroupIsAllHistoryAvailable must be used first to change that
19442    /// * `client_id` - The client id to send the request to
19443    #[allow(clippy::too_many_arguments)]
19444    pub async fn set_chat_discussion_group(chat_id: i64, discussion_chat_id: i64, client_id: i32) -> Result<(), crate::types::Error> {
19445        let request = json!({
19446            "@type": "setChatDiscussionGroup",
19447            "chat_id": chat_id,
19448            "discussion_chat_id": discussion_chat_id,
19449        });
19450        let response = send_request(client_id, request).await;
19451        if response["@type"] == "error" {
19452            return Err(serde_json::from_value(response).unwrap())
19453        }
19454        Ok(())
19455    }
19456    /// Changes the location of a chat. Available only for some location-based supergroups, use supergroupFullInfo.can_set_location to check whether the method is allowed to use
19457    /// # Arguments
19458    /// * `chat_id` - Chat identifier
19459    /// * `location` - New location for the chat; must be valid and not null
19460    /// * `client_id` - The client id to send the request to
19461    #[allow(clippy::too_many_arguments)]
19462    pub async fn set_chat_location(chat_id: i64, location: crate::types::ChatLocation, client_id: i32) -> Result<(), crate::types::Error> {
19463        let request = json!({
19464            "@type": "setChatLocation",
19465            "chat_id": chat_id,
19466            "location": location,
19467        });
19468        let response = send_request(client_id, request).await;
19469        if response["@type"] == "error" {
19470            return Err(serde_json::from_value(response).unwrap())
19471        }
19472        Ok(())
19473    }
19474    /// Changes the slow mode delay of a chat. Available only for supergroups; requires can_restrict_members rights
19475    /// # Arguments
19476    /// * `chat_id` - Chat identifier
19477    /// * `slow_mode_delay` - New slow mode delay for the chat, in seconds; must be one of 0, 10, 30, 60, 300, 900, 3600
19478    /// * `client_id` - The client id to send the request to
19479    #[allow(clippy::too_many_arguments)]
19480    pub async fn set_chat_slow_mode_delay(chat_id: i64, slow_mode_delay: i32, client_id: i32) -> Result<(), crate::types::Error> {
19481        let request = json!({
19482            "@type": "setChatSlowModeDelay",
19483            "chat_id": chat_id,
19484            "slow_mode_delay": slow_mode_delay,
19485        });
19486        let response = send_request(client_id, request).await;
19487        if response["@type"] == "error" {
19488            return Err(serde_json::from_value(response).unwrap())
19489        }
19490        Ok(())
19491    }
19492    /// Pins a message in a chat; requires can_pin_messages rights or can_edit_messages rights in the channel
19493    /// # Arguments
19494    /// * `chat_id` - Identifier of the chat
19495    /// * `message_id` - Identifier of the new pinned message
19496    /// * `disable_notification` - Pass true to disable notification about the pinned message. Notifications are always disabled in channels and private chats
19497    /// * `only_for_self` - Pass true to pin the message only for self; private chats only
19498    /// * `client_id` - The client id to send the request to
19499    #[allow(clippy::too_many_arguments)]
19500    pub async fn pin_chat_message(chat_id: i64, message_id: i64, disable_notification: bool, only_for_self: bool, client_id: i32) -> Result<(), crate::types::Error> {
19501        let request = json!({
19502            "@type": "pinChatMessage",
19503            "chat_id": chat_id,
19504            "message_id": message_id,
19505            "disable_notification": disable_notification,
19506            "only_for_self": only_for_self,
19507        });
19508        let response = send_request(client_id, request).await;
19509        if response["@type"] == "error" {
19510            return Err(serde_json::from_value(response).unwrap())
19511        }
19512        Ok(())
19513    }
19514    /// Removes a pinned message from a chat; requires can_pin_messages rights in the group or can_edit_messages rights in the channel
19515    /// # Arguments
19516    /// * `chat_id` - Identifier of the chat
19517    /// * `message_id` - Identifier of the removed pinned message
19518    /// * `client_id` - The client id to send the request to
19519    #[allow(clippy::too_many_arguments)]
19520    pub async fn unpin_chat_message(chat_id: i64, message_id: i64, client_id: i32) -> Result<(), crate::types::Error> {
19521        let request = json!({
19522            "@type": "unpinChatMessage",
19523            "chat_id": chat_id,
19524            "message_id": message_id,
19525        });
19526        let response = send_request(client_id, request).await;
19527        if response["@type"] == "error" {
19528            return Err(serde_json::from_value(response).unwrap())
19529        }
19530        Ok(())
19531    }
19532    /// Removes all pinned messages from a chat; requires can_pin_messages rights in the group or can_edit_messages rights in the channel
19533    /// # Arguments
19534    /// * `chat_id` - Identifier of the chat
19535    /// * `client_id` - The client id to send the request to
19536    #[allow(clippy::too_many_arguments)]
19537    pub async fn unpin_all_chat_messages(chat_id: i64, client_id: i32) -> Result<(), crate::types::Error> {
19538        let request = json!({
19539            "@type": "unpinAllChatMessages",
19540            "chat_id": chat_id,
19541        });
19542        let response = send_request(client_id, request).await;
19543        if response["@type"] == "error" {
19544            return Err(serde_json::from_value(response).unwrap())
19545        }
19546        Ok(())
19547    }
19548    /// Removes all pinned messages from a forum topic; requires can_pin_messages rights in the supergroup
19549    /// # Arguments
19550    /// * `chat_id` - Identifier of the chat
19551    /// * `message_thread_id` - Message thread identifier in which messages will be unpinned
19552    /// * `client_id` - The client id to send the request to
19553    #[allow(clippy::too_many_arguments)]
19554    pub async fn unpin_all_message_thread_messages(chat_id: i64, message_thread_id: i64, client_id: i32) -> Result<(), crate::types::Error> {
19555        let request = json!({
19556            "@type": "unpinAllMessageThreadMessages",
19557            "chat_id": chat_id,
19558            "message_thread_id": message_thread_id,
19559        });
19560        let response = send_request(client_id, request).await;
19561        if response["@type"] == "error" {
19562            return Err(serde_json::from_value(response).unwrap())
19563        }
19564        Ok(())
19565    }
19566    /// Adds the current user as a new member to a chat. Private and secret chats can't be joined using this method. May return an error with a message "INVITE_REQUEST_SENT" if only a join request was created
19567    /// # Arguments
19568    /// * `chat_id` - Chat identifier
19569    /// * `client_id` - The client id to send the request to
19570    #[allow(clippy::too_many_arguments)]
19571    pub async fn join_chat(chat_id: i64, client_id: i32) -> Result<(), crate::types::Error> {
19572        let request = json!({
19573            "@type": "joinChat",
19574            "chat_id": chat_id,
19575        });
19576        let response = send_request(client_id, request).await;
19577        if response["@type"] == "error" {
19578            return Err(serde_json::from_value(response).unwrap())
19579        }
19580        Ok(())
19581    }
19582    /// Removes the current user from chat members. Private and secret chats can't be left using this method
19583    /// # Arguments
19584    /// * `chat_id` - Chat identifier
19585    /// * `client_id` - The client id to send the request to
19586    #[allow(clippy::too_many_arguments)]
19587    pub async fn leave_chat(chat_id: i64, client_id: i32) -> Result<(), crate::types::Error> {
19588        let request = json!({
19589            "@type": "leaveChat",
19590            "chat_id": chat_id,
19591        });
19592        let response = send_request(client_id, request).await;
19593        if response["@type"] == "error" {
19594            return Err(serde_json::from_value(response).unwrap())
19595        }
19596        Ok(())
19597    }
19598    /// Adds a new member to a chat. Members can't be added to private or secret chats
19599    /// # Arguments
19600    /// * `chat_id` - Chat identifier
19601    /// * `user_id` - Identifier of the user
19602    /// * `forward_limit` - The number of earlier messages from the chat to be forwarded to the new member; up to 100. Ignored for supergroups and channels, or if the added user is a bot
19603    /// * `client_id` - The client id to send the request to
19604    #[allow(clippy::too_many_arguments)]
19605    pub async fn add_chat_member(chat_id: i64, user_id: i64, forward_limit: i32, client_id: i32) -> Result<(), crate::types::Error> {
19606        let request = json!({
19607            "@type": "addChatMember",
19608            "chat_id": chat_id,
19609            "user_id": user_id,
19610            "forward_limit": forward_limit,
19611        });
19612        let response = send_request(client_id, request).await;
19613        if response["@type"] == "error" {
19614            return Err(serde_json::from_value(response).unwrap())
19615        }
19616        Ok(())
19617    }
19618    /// Adds multiple new members to a chat. Currently, this method is only available for supergroups and channels. This method can't be used to join a chat. Members can't be added to a channel if it has more than 200 members
19619    /// # Arguments
19620    /// * `chat_id` - Chat identifier
19621    /// * `user_ids` - Identifiers of the users to be added to the chat. The maximum number of added users is 20 for supergroups and 100 for channels
19622    /// * `client_id` - The client id to send the request to
19623    #[allow(clippy::too_many_arguments)]
19624    pub async fn add_chat_members(chat_id: i64, user_ids: Vec<i64>, client_id: i32) -> Result<(), crate::types::Error> {
19625        let request = json!({
19626            "@type": "addChatMembers",
19627            "chat_id": chat_id,
19628            "user_ids": user_ids,
19629        });
19630        let response = send_request(client_id, request).await;
19631        if response["@type"] == "error" {
19632            return Err(serde_json::from_value(response).unwrap())
19633        }
19634        Ok(())
19635    }
19636    /// Changes the status of a chat member, needs appropriate privileges. This function is currently not suitable for transferring chat ownership; use transferChatOwnership instead. Use addChatMember or banChatMember if some additional parameters needs to be passed
19637    /// # Arguments
19638    /// * `chat_id` - Chat identifier
19639    /// * `member_id` - Member identifier. Chats can be only banned and unbanned in supergroups and channels
19640    /// * `status` - The new status of the member in the chat
19641    /// * `client_id` - The client id to send the request to
19642    #[allow(clippy::too_many_arguments)]
19643    pub async fn set_chat_member_status(chat_id: i64, member_id: crate::enums::MessageSender, status: crate::enums::ChatMemberStatus, client_id: i32) -> Result<(), crate::types::Error> {
19644        let request = json!({
19645            "@type": "setChatMemberStatus",
19646            "chat_id": chat_id,
19647            "member_id": member_id,
19648            "status": status,
19649        });
19650        let response = send_request(client_id, request).await;
19651        if response["@type"] == "error" {
19652            return Err(serde_json::from_value(response).unwrap())
19653        }
19654        Ok(())
19655    }
19656    /// Bans a member in a chat. Members can't be banned in private or secret chats. In supergroups and channels, the user will not be able to return to the group on their own using invite links, etc., unless unbanned first
19657    /// # Arguments
19658    /// * `chat_id` - Chat identifier
19659    /// * `member_id` - Member identifier
19660    /// * `banned_until_date` - Point in time (Unix timestamp) when the user will be unbanned; 0 if never. If the user is banned for more than 366 days or for less than 30 seconds from the current time, the user is considered to be banned forever. Ignored in basic groups and if a chat is banned
19661    /// * `revoke_messages` - Pass true to delete all messages in the chat for the user that is being removed. Always true for supergroups and channels
19662    /// * `client_id` - The client id to send the request to
19663    #[allow(clippy::too_many_arguments)]
19664    pub async fn ban_chat_member(chat_id: i64, member_id: crate::enums::MessageSender, banned_until_date: i32, revoke_messages: bool, client_id: i32) -> Result<(), crate::types::Error> {
19665        let request = json!({
19666            "@type": "banChatMember",
19667            "chat_id": chat_id,
19668            "member_id": member_id,
19669            "banned_until_date": banned_until_date,
19670            "revoke_messages": revoke_messages,
19671        });
19672        let response = send_request(client_id, request).await;
19673        if response["@type"] == "error" {
19674            return Err(serde_json::from_value(response).unwrap())
19675        }
19676        Ok(())
19677    }
19678    /// Checks whether the current session can be used to transfer a chat ownership to another user
19679    /// # Arguments
19680    /// * `client_id` - The client id to send the request to
19681    #[allow(clippy::too_many_arguments)]
19682    pub async fn can_transfer_ownership(client_id: i32) -> Result<crate::enums::CanTransferOwnershipResult, crate::types::Error> {
19683        let request = json!({
19684            "@type": "canTransferOwnership",
19685        });
19686        let response = send_request(client_id, request).await;
19687        if response["@type"] == "error" {
19688            return Err(serde_json::from_value(response).unwrap())
19689        }
19690        Ok(serde_json::from_value(response).unwrap())
19691    }
19692    /// Changes the owner of a chat. The current user must be a current owner of the chat. Use the method canTransferOwnership to check whether the ownership can be transferred from the current session. Available only for supergroups and channel chats
19693    /// # Arguments
19694    /// * `chat_id` - Chat identifier
19695    /// * `user_id` - Identifier of the user to which transfer the ownership. The ownership can't be transferred to a bot or to a deleted user
19696    /// * `password` - The 2-step verification password of the current user
19697    /// * `client_id` - The client id to send the request to
19698    #[allow(clippy::too_many_arguments)]
19699    pub async fn transfer_chat_ownership(chat_id: i64, user_id: i64, password: String, client_id: i32) -> Result<(), crate::types::Error> {
19700        let request = json!({
19701            "@type": "transferChatOwnership",
19702            "chat_id": chat_id,
19703            "user_id": user_id,
19704            "password": password,
19705        });
19706        let response = send_request(client_id, request).await;
19707        if response["@type"] == "error" {
19708            return Err(serde_json::from_value(response).unwrap())
19709        }
19710        Ok(())
19711    }
19712    /// Returns information about a single member of a chat
19713    /// # Arguments
19714    /// * `chat_id` - Chat identifier
19715    /// * `member_id` - Member identifier
19716    /// * `client_id` - The client id to send the request to
19717    #[allow(clippy::too_many_arguments)]
19718    pub async fn get_chat_member(chat_id: i64, member_id: crate::enums::MessageSender, client_id: i32) -> Result<crate::enums::ChatMember, crate::types::Error> {
19719        let request = json!({
19720            "@type": "getChatMember",
19721            "chat_id": chat_id,
19722            "member_id": member_id,
19723        });
19724        let response = send_request(client_id, request).await;
19725        if response["@type"] == "error" {
19726            return Err(serde_json::from_value(response).unwrap())
19727        }
19728        Ok(serde_json::from_value(response).unwrap())
19729    }
19730    /// Searches for a specified query in the first name, last name and usernames of the members of a specified chat. Requires administrator rights in channels
19731    /// # Arguments
19732    /// * `chat_id` - Chat identifier
19733    /// * `query` - Query to search for
19734    /// * `limit` - The maximum number of users to be returned; up to 200
19735    /// * `filter` - The type of users to search for; pass null to search among all chat members
19736    /// * `client_id` - The client id to send the request to
19737    #[allow(clippy::too_many_arguments)]
19738    pub async fn search_chat_members(chat_id: i64, query: String, limit: i32, filter: Option<crate::enums::ChatMembersFilter>, client_id: i32) -> Result<crate::enums::ChatMembers, crate::types::Error> {
19739        let request = json!({
19740            "@type": "searchChatMembers",
19741            "chat_id": chat_id,
19742            "query": query,
19743            "limit": limit,
19744            "filter": filter,
19745        });
19746        let response = send_request(client_id, request).await;
19747        if response["@type"] == "error" {
19748            return Err(serde_json::from_value(response).unwrap())
19749        }
19750        Ok(serde_json::from_value(response).unwrap())
19751    }
19752    /// Returns a list of administrators of the chat with their custom titles
19753    /// # Arguments
19754    /// * `chat_id` - Chat identifier
19755    /// * `client_id` - The client id to send the request to
19756    #[allow(clippy::too_many_arguments)]
19757    pub async fn get_chat_administrators(chat_id: i64, client_id: i32) -> Result<crate::enums::ChatAdministrators, crate::types::Error> {
19758        let request = json!({
19759            "@type": "getChatAdministrators",
19760            "chat_id": chat_id,
19761        });
19762        let response = send_request(client_id, request).await;
19763        if response["@type"] == "error" {
19764            return Err(serde_json::from_value(response).unwrap())
19765        }
19766        Ok(serde_json::from_value(response).unwrap())
19767    }
19768    /// Clears message drafts in all chats
19769    /// # Arguments
19770    /// * `exclude_secret_chats` - Pass true to keep local message drafts in secret chats
19771    /// * `client_id` - The client id to send the request to
19772    #[allow(clippy::too_many_arguments)]
19773    pub async fn clear_all_draft_messages(exclude_secret_chats: bool, client_id: i32) -> Result<(), crate::types::Error> {
19774        let request = json!({
19775            "@type": "clearAllDraftMessages",
19776            "exclude_secret_chats": exclude_secret_chats,
19777        });
19778        let response = send_request(client_id, request).await;
19779        if response["@type"] == "error" {
19780            return Err(serde_json::from_value(response).unwrap())
19781        }
19782        Ok(())
19783    }
19784    /// Returns saved notification sound by its identifier. Returns a 404 error if there is no saved notification sound with the specified identifier
19785    /// # Arguments
19786    /// * `notification_sound_id` - Identifier of the notification sound
19787    /// * `client_id` - The client id to send the request to
19788    #[allow(clippy::too_many_arguments)]
19789    pub async fn get_saved_notification_sound(notification_sound_id: i64, client_id: i32) -> Result<crate::enums::NotificationSounds, crate::types::Error> {
19790        let request = json!({
19791            "@type": "getSavedNotificationSound",
19792            "notification_sound_id": notification_sound_id,
19793        });
19794        let response = send_request(client_id, request).await;
19795        if response["@type"] == "error" {
19796            return Err(serde_json::from_value(response).unwrap())
19797        }
19798        Ok(serde_json::from_value(response).unwrap())
19799    }
19800    /// Returns list of saved notification sounds. If a sound isn't in the list, then default sound needs to be used
19801    /// # Arguments
19802    /// * `client_id` - The client id to send the request to
19803    #[allow(clippy::too_many_arguments)]
19804    pub async fn get_saved_notification_sounds(client_id: i32) -> Result<crate::enums::NotificationSounds, crate::types::Error> {
19805        let request = json!({
19806            "@type": "getSavedNotificationSounds",
19807        });
19808        let response = send_request(client_id, request).await;
19809        if response["@type"] == "error" {
19810            return Err(serde_json::from_value(response).unwrap())
19811        }
19812        Ok(serde_json::from_value(response).unwrap())
19813    }
19814    /// Adds a new notification sound to the list of saved notification sounds. The new notification sound is added to the top of the list. If it is already in the list, its position isn't changed
19815    /// # Arguments
19816    /// * `sound` - Notification sound file to add
19817    /// * `client_id` - The client id to send the request to
19818    #[allow(clippy::too_many_arguments)]
19819    pub async fn add_saved_notification_sound(sound: crate::enums::InputFile, client_id: i32) -> Result<crate::enums::NotificationSound, crate::types::Error> {
19820        let request = json!({
19821            "@type": "addSavedNotificationSound",
19822            "sound": sound,
19823        });
19824        let response = send_request(client_id, request).await;
19825        if response["@type"] == "error" {
19826            return Err(serde_json::from_value(response).unwrap())
19827        }
19828        Ok(serde_json::from_value(response).unwrap())
19829    }
19830    /// Removes a notification sound from the list of saved notification sounds
19831    /// # Arguments
19832    /// * `notification_sound_id` - Identifier of the notification sound
19833    /// * `client_id` - The client id to send the request to
19834    #[allow(clippy::too_many_arguments)]
19835    pub async fn remove_saved_notification_sound(notification_sound_id: i64, client_id: i32) -> Result<(), crate::types::Error> {
19836        let request = json!({
19837            "@type": "removeSavedNotificationSound",
19838            "notification_sound_id": notification_sound_id,
19839        });
19840        let response = send_request(client_id, request).await;
19841        if response["@type"] == "error" {
19842            return Err(serde_json::from_value(response).unwrap())
19843        }
19844        Ok(())
19845    }
19846    /// Returns list of chats with non-default notification settings for new messages
19847    /// # Arguments
19848    /// * `scope` - If specified, only chats from the scope will be returned; pass null to return chats from all scopes
19849    /// * `compare_sound` - Pass true to include in the response chats with only non-default sound
19850    /// * `client_id` - The client id to send the request to
19851    #[allow(clippy::too_many_arguments)]
19852    pub async fn get_chat_notification_settings_exceptions(scope: Option<crate::enums::NotificationSettingsScope>, compare_sound: bool, client_id: i32) -> Result<crate::enums::Chats, crate::types::Error> {
19853        let request = json!({
19854            "@type": "getChatNotificationSettingsExceptions",
19855            "scope": scope,
19856            "compare_sound": compare_sound,
19857        });
19858        let response = send_request(client_id, request).await;
19859        if response["@type"] == "error" {
19860            return Err(serde_json::from_value(response).unwrap())
19861        }
19862        Ok(serde_json::from_value(response).unwrap())
19863    }
19864    /// Returns the notification settings for chats of a given type
19865    /// # Arguments
19866    /// * `scope` - Types of chats for which to return the notification settings information
19867    /// * `client_id` - The client id to send the request to
19868    #[allow(clippy::too_many_arguments)]
19869    pub async fn get_scope_notification_settings(scope: crate::enums::NotificationSettingsScope, client_id: i32) -> Result<crate::enums::ScopeNotificationSettings, crate::types::Error> {
19870        let request = json!({
19871            "@type": "getScopeNotificationSettings",
19872            "scope": scope,
19873        });
19874        let response = send_request(client_id, request).await;
19875        if response["@type"] == "error" {
19876            return Err(serde_json::from_value(response).unwrap())
19877        }
19878        Ok(serde_json::from_value(response).unwrap())
19879    }
19880    /// Changes notification settings for chats of a given type
19881    /// # Arguments
19882    /// * `scope` - Types of chats for which to change the notification settings
19883    /// * `notification_settings` - The new notification settings for the given scope
19884    /// * `client_id` - The client id to send the request to
19885    #[allow(clippy::too_many_arguments)]
19886    pub async fn set_scope_notification_settings(scope: crate::enums::NotificationSettingsScope, notification_settings: crate::types::ScopeNotificationSettings, client_id: i32) -> Result<(), crate::types::Error> {
19887        let request = json!({
19888            "@type": "setScopeNotificationSettings",
19889            "scope": scope,
19890            "notification_settings": notification_settings,
19891        });
19892        let response = send_request(client_id, request).await;
19893        if response["@type"] == "error" {
19894            return Err(serde_json::from_value(response).unwrap())
19895        }
19896        Ok(())
19897    }
19898    /// Resets all notification settings to their default values. By default, all chats are unmuted and message previews are shown
19899    /// # Arguments
19900    /// * `client_id` - The client id to send the request to
19901    #[allow(clippy::too_many_arguments)]
19902    pub async fn reset_all_notification_settings(client_id: i32) -> Result<(), crate::types::Error> {
19903        let request = json!({
19904            "@type": "resetAllNotificationSettings",
19905        });
19906        let response = send_request(client_id, request).await;
19907        if response["@type"] == "error" {
19908            return Err(serde_json::from_value(response).unwrap())
19909        }
19910        Ok(())
19911    }
19912    /// Changes the pinned state of a chat. There can be up to getOption("pinned_chat_count_max")/getOption("pinned_archived_chat_count_max") pinned non-secret chats and the same number of secret chats in the main/archive chat list. The limit can be increased with Telegram Premium
19913    /// # Arguments
19914    /// * `chat_list` - Chat list in which to change the pinned state of the chat
19915    /// * `chat_id` - Chat identifier
19916    /// * `is_pinned` - Pass true to pin the chat; pass false to unpin it
19917    /// * `client_id` - The client id to send the request to
19918    #[allow(clippy::too_many_arguments)]
19919    pub async fn toggle_chat_is_pinned(chat_list: crate::enums::ChatList, chat_id: i64, is_pinned: bool, client_id: i32) -> Result<(), crate::types::Error> {
19920        let request = json!({
19921            "@type": "toggleChatIsPinned",
19922            "chat_list": chat_list,
19923            "chat_id": chat_id,
19924            "is_pinned": is_pinned,
19925        });
19926        let response = send_request(client_id, request).await;
19927        if response["@type"] == "error" {
19928            return Err(serde_json::from_value(response).unwrap())
19929        }
19930        Ok(())
19931    }
19932    /// Changes the order of pinned chats
19933    /// # Arguments
19934    /// * `chat_list` - Chat list in which to change the order of pinned chats
19935    /// * `chat_ids` - The new list of pinned chats
19936    /// * `client_id` - The client id to send the request to
19937    #[allow(clippy::too_many_arguments)]
19938    pub async fn set_pinned_chats(chat_list: crate::enums::ChatList, chat_ids: Vec<i64>, client_id: i32) -> Result<(), crate::types::Error> {
19939        let request = json!({
19940            "@type": "setPinnedChats",
19941            "chat_list": chat_list,
19942            "chat_ids": chat_ids,
19943        });
19944        let response = send_request(client_id, request).await;
19945        if response["@type"] == "error" {
19946            return Err(serde_json::from_value(response).unwrap())
19947        }
19948        Ok(())
19949    }
19950    /// Traverse all chats in a chat list and marks all messages in the chats as read
19951    /// # Arguments
19952    /// * `chat_list` - Chat list in which to mark all chats as read
19953    /// * `client_id` - The client id to send the request to
19954    #[allow(clippy::too_many_arguments)]
19955    pub async fn read_chat_list(chat_list: crate::enums::ChatList, client_id: i32) -> Result<(), crate::types::Error> {
19956        let request = json!({
19957            "@type": "readChatList",
19958            "chat_list": chat_list,
19959        });
19960        let response = send_request(client_id, request).await;
19961        if response["@type"] == "error" {
19962            return Err(serde_json::from_value(response).unwrap())
19963        }
19964        Ok(())
19965    }
19966    /// Returns a story
19967    /// # Arguments
19968    /// * `story_sender_chat_id` - Identifier of the chat that posted the story
19969    /// * `story_id` - Story identifier
19970    /// * `only_local` - Pass true to get only locally available information without sending network requests
19971    /// * `client_id` - The client id to send the request to
19972    #[allow(clippy::too_many_arguments)]
19973    pub async fn get_story(story_sender_chat_id: i64, story_id: i32, only_local: bool, client_id: i32) -> Result<crate::enums::Story, crate::types::Error> {
19974        let request = json!({
19975            "@type": "getStory",
19976            "story_sender_chat_id": story_sender_chat_id,
19977            "story_id": story_id,
19978            "only_local": only_local,
19979        });
19980        let response = send_request(client_id, request).await;
19981        if response["@type"] == "error" {
19982            return Err(serde_json::from_value(response).unwrap())
19983        }
19984        Ok(serde_json::from_value(response).unwrap())
19985    }
19986    /// Returns channel chats in which the current user has the right to post stories. The chats must be rechecked with canSendStory before actually trying to post a story there
19987    /// # Arguments
19988    /// * `client_id` - The client id to send the request to
19989    #[allow(clippy::too_many_arguments)]
19990    pub async fn get_chats_to_send_stories(client_id: i32) -> Result<crate::enums::Chats, crate::types::Error> {
19991        let request = json!({
19992            "@type": "getChatsToSendStories",
19993        });
19994        let response = send_request(client_id, request).await;
19995        if response["@type"] == "error" {
19996            return Err(serde_json::from_value(response).unwrap())
19997        }
19998        Ok(serde_json::from_value(response).unwrap())
19999    }
20000    /// Checks whether the current user can send a story on behalf of a chat; requires can_post_stories rights for channel chats
20001    /// # Arguments
20002    /// * `chat_id` - Chat identifier
20003    /// * `client_id` - The client id to send the request to
20004    #[allow(clippy::too_many_arguments)]
20005    pub async fn can_send_story(chat_id: i64, client_id: i32) -> Result<crate::enums::CanSendStoryResult, crate::types::Error> {
20006        let request = json!({
20007            "@type": "canSendStory",
20008            "chat_id": chat_id,
20009        });
20010        let response = send_request(client_id, request).await;
20011        if response["@type"] == "error" {
20012            return Err(serde_json::from_value(response).unwrap())
20013        }
20014        Ok(serde_json::from_value(response).unwrap())
20015    }
20016    /// Sends a new story to a chat; requires can_post_stories rights for channel chats. Returns a temporary story
20017    /// # Arguments
20018    /// * `chat_id` - Identifier of the chat that will post the story
20019    /// * `content` - Content of the story
20020    /// * `areas` - Clickable rectangle areas to be shown on the story media; pass null if none
20021    /// * `caption` - Story caption; pass null to use an empty caption; 0-getOption("story_caption_length_max") characters
20022    /// * `privacy_settings` - The privacy settings for the story
20023    /// * `active_period` - Period after which the story is moved to archive, in seconds; must be one of 6 * 3600, 12 * 3600, 86400, or 2 * 86400 for Telegram Premium users, and 86400 otherwise
20024    /// * `is_pinned` - Pass true to keep the story accessible after expiration
20025    /// * `protect_content` - Pass true if the content of the story must be protected from forwarding and screenshotting
20026    /// * `client_id` - The client id to send the request to
20027    #[allow(clippy::too_many_arguments)]
20028    pub async fn send_story(chat_id: i64, content: crate::enums::InputStoryContent, areas: Option<crate::types::InputStoryAreas>, caption: Option<crate::types::FormattedText>, privacy_settings: crate::enums::StoryPrivacySettings, active_period: i32, is_pinned: bool, protect_content: bool, client_id: i32) -> Result<crate::enums::Story, crate::types::Error> {
20029        let request = json!({
20030            "@type": "sendStory",
20031            "chat_id": chat_id,
20032            "content": content,
20033            "areas": areas,
20034            "caption": caption,
20035            "privacy_settings": privacy_settings,
20036            "active_period": active_period,
20037            "is_pinned": is_pinned,
20038            "protect_content": protect_content,
20039        });
20040        let response = send_request(client_id, request).await;
20041        if response["@type"] == "error" {
20042            return Err(serde_json::from_value(response).unwrap())
20043        }
20044        Ok(serde_json::from_value(response).unwrap())
20045    }
20046    /// Changes content and caption of a story. Can be called only if story.can_be_edited == true
20047    /// # Arguments
20048    /// * `story_sender_chat_id` - Identifier of the chat that posted the story
20049    /// * `story_id` - Identifier of the story to edit
20050    /// * `content` - New content of the story; pass null to keep the current content
20051    /// * `areas` - New clickable rectangle areas to be shown on the story media; pass null to keep the current areas. Areas can't be edited if story content isn't changed
20052    /// * `caption` - New story caption; pass null to keep the current caption
20053    /// * `client_id` - The client id to send the request to
20054    #[allow(clippy::too_many_arguments)]
20055    pub async fn edit_story(story_sender_chat_id: i64, story_id: i32, content: Option<crate::enums::InputStoryContent>, areas: Option<crate::types::InputStoryAreas>, caption: Option<crate::types::FormattedText>, client_id: i32) -> Result<(), crate::types::Error> {
20056        let request = json!({
20057            "@type": "editStory",
20058            "story_sender_chat_id": story_sender_chat_id,
20059            "story_id": story_id,
20060            "content": content,
20061            "areas": areas,
20062            "caption": caption,
20063        });
20064        let response = send_request(client_id, request).await;
20065        if response["@type"] == "error" {
20066            return Err(serde_json::from_value(response).unwrap())
20067        }
20068        Ok(())
20069    }
20070    /// Changes privacy settings of a story. Can be called only if story.can_be_edited == true
20071    /// # Arguments
20072    /// * `story_sender_chat_id` - Identifier of the chat that posted the story
20073    /// * `story_id` - Identifier of the story
20074    /// * `privacy_settings` - The new privacy settigs for the story
20075    /// * `client_id` - The client id to send the request to
20076    #[allow(clippy::too_many_arguments)]
20077    pub async fn set_story_privacy_settings(story_sender_chat_id: i64, story_id: i32, privacy_settings: crate::enums::StoryPrivacySettings, client_id: i32) -> Result<(), crate::types::Error> {
20078        let request = json!({
20079            "@type": "setStoryPrivacySettings",
20080            "story_sender_chat_id": story_sender_chat_id,
20081            "story_id": story_id,
20082            "privacy_settings": privacy_settings,
20083        });
20084        let response = send_request(client_id, request).await;
20085        if response["@type"] == "error" {
20086            return Err(serde_json::from_value(response).unwrap())
20087        }
20088        Ok(())
20089    }
20090    /// Toggles whether a story is accessible after expiration. Can be called only if story.can_toggle_is_pinned == true
20091    /// # Arguments
20092    /// * `story_sender_chat_id` - Identifier of the chat that posted the story
20093    /// * `story_id` - Identifier of the story
20094    /// * `is_pinned` - Pass true to make the story accessible after expiration; pass false to make it private
20095    /// * `client_id` - The client id to send the request to
20096    #[allow(clippy::too_many_arguments)]
20097    pub async fn toggle_story_is_pinned(story_sender_chat_id: i64, story_id: i32, is_pinned: bool, client_id: i32) -> Result<(), crate::types::Error> {
20098        let request = json!({
20099            "@type": "toggleStoryIsPinned",
20100            "story_sender_chat_id": story_sender_chat_id,
20101            "story_id": story_id,
20102            "is_pinned": is_pinned,
20103        });
20104        let response = send_request(client_id, request).await;
20105        if response["@type"] == "error" {
20106            return Err(serde_json::from_value(response).unwrap())
20107        }
20108        Ok(())
20109    }
20110    /// Deletes a previously sent story. Can be called only if story.can_be_deleted == true
20111    /// # Arguments
20112    /// * `story_sender_chat_id` - Identifier of the chat that posted the story
20113    /// * `story_id` - Identifier of the story to delete
20114    /// * `client_id` - The client id to send the request to
20115    #[allow(clippy::too_many_arguments)]
20116    pub async fn delete_story(story_sender_chat_id: i64, story_id: i32, client_id: i32) -> Result<(), crate::types::Error> {
20117        let request = json!({
20118            "@type": "deleteStory",
20119            "story_sender_chat_id": story_sender_chat_id,
20120            "story_id": story_id,
20121        });
20122        let response = send_request(client_id, request).await;
20123        if response["@type"] == "error" {
20124            return Err(serde_json::from_value(response).unwrap())
20125        }
20126        Ok(())
20127    }
20128    /// Returns list of chats with non-default notification settings for stories
20129    /// # Arguments
20130    /// * `client_id` - The client id to send the request to
20131    #[allow(clippy::too_many_arguments)]
20132    pub async fn get_story_notification_settings_exceptions(client_id: i32) -> Result<crate::enums::Chats, crate::types::Error> {
20133        let request = json!({
20134            "@type": "getStoryNotificationSettingsExceptions",
20135        });
20136        let response = send_request(client_id, request).await;
20137        if response["@type"] == "error" {
20138            return Err(serde_json::from_value(response).unwrap())
20139        }
20140        Ok(serde_json::from_value(response).unwrap())
20141    }
20142    /// Loads more active stories from a story list. The loaded stories will be sent through updates. Active stories are sorted by
20143    /// the pair (active_stories.order, active_stories.story_sender_chat_id) in descending order. Returns a 404 error if all active stories have been loaded
20144    /// # Arguments
20145    /// * `story_list` - The story list in which to load active stories
20146    /// * `client_id` - The client id to send the request to
20147    #[allow(clippy::too_many_arguments)]
20148    pub async fn load_active_stories(story_list: crate::enums::StoryList, client_id: i32) -> Result<(), crate::types::Error> {
20149        let request = json!({
20150            "@type": "loadActiveStories",
20151            "story_list": story_list,
20152        });
20153        let response = send_request(client_id, request).await;
20154        if response["@type"] == "error" {
20155            return Err(serde_json::from_value(response).unwrap())
20156        }
20157        Ok(())
20158    }
20159    /// Changes story list in which stories from the chat are shown
20160    /// # Arguments
20161    /// * `chat_id` - Identifier of the chat that posted stories
20162    /// * `story_list` - New list for active stories posted by the chat
20163    /// * `client_id` - The client id to send the request to
20164    #[allow(clippy::too_many_arguments)]
20165    pub async fn set_chat_active_stories_list(chat_id: i64, story_list: crate::enums::StoryList, client_id: i32) -> Result<(), crate::types::Error> {
20166        let request = json!({
20167            "@type": "setChatActiveStoriesList",
20168            "chat_id": chat_id,
20169            "story_list": story_list,
20170        });
20171        let response = send_request(client_id, request).await;
20172        if response["@type"] == "error" {
20173            return Err(serde_json::from_value(response).unwrap())
20174        }
20175        Ok(())
20176    }
20177    /// Returns the list of active stories posted by the given chat
20178    /// # Arguments
20179    /// * `chat_id` - Chat identifier
20180    /// * `client_id` - The client id to send the request to
20181    #[allow(clippy::too_many_arguments)]
20182    pub async fn get_chat_active_stories(chat_id: i64, client_id: i32) -> Result<crate::enums::ChatActiveStories, crate::types::Error> {
20183        let request = json!({
20184            "@type": "getChatActiveStories",
20185            "chat_id": chat_id,
20186        });
20187        let response = send_request(client_id, request).await;
20188        if response["@type"] == "error" {
20189            return Err(serde_json::from_value(response).unwrap())
20190        }
20191        Ok(serde_json::from_value(response).unwrap())
20192    }
20193    /// Returns the list of pinned stories posted by the given chat. The stories are returned in a reverse chronological order (i.e., in order of decreasing story_id).
20194    /// For optimal performance, the number of returned stories is chosen by TDLib
20195    /// # Arguments
20196    /// * `chat_id` - Chat identifier
20197    /// * `from_story_id` - Identifier of the story starting from which stories must be returned; use 0 to get results from the last story
20198    /// * `limit` - The maximum number of stories to be returned
20199    /// For optimal performance, the number of returned stories is chosen by TDLib and can be smaller than the specified limit
20200    /// * `client_id` - The client id to send the request to
20201    #[allow(clippy::too_many_arguments)]
20202    pub async fn get_chat_pinned_stories(chat_id: i64, from_story_id: i32, limit: i32, client_id: i32) -> Result<crate::enums::Stories, crate::types::Error> {
20203        let request = json!({
20204            "@type": "getChatPinnedStories",
20205            "chat_id": chat_id,
20206            "from_story_id": from_story_id,
20207            "limit": limit,
20208        });
20209        let response = send_request(client_id, request).await;
20210        if response["@type"] == "error" {
20211            return Err(serde_json::from_value(response).unwrap())
20212        }
20213        Ok(serde_json::from_value(response).unwrap())
20214    }
20215    /// Returns the list of all stories posted by the given chat; requires can_edit_stories rights for channel chats.
20216    /// The stories are returned in a reverse chronological order (i.e., in order of decreasing story_id). For optimal performance, the number of returned stories is chosen by TDLib
20217    /// # Arguments
20218    /// * `chat_id` - Chat identifier
20219    /// * `from_story_id` - Identifier of the story starting from which stories must be returned; use 0 to get results from the last story
20220    /// * `limit` - The maximum number of stories to be returned
20221    /// For optimal performance, the number of returned stories is chosen by TDLib and can be smaller than the specified limit
20222    /// * `client_id` - The client id to send the request to
20223    #[allow(clippy::too_many_arguments)]
20224    pub async fn get_chat_archived_stories(chat_id: i64, from_story_id: i32, limit: i32, client_id: i32) -> Result<crate::enums::Stories, crate::types::Error> {
20225        let request = json!({
20226            "@type": "getChatArchivedStories",
20227            "chat_id": chat_id,
20228            "from_story_id": from_story_id,
20229            "limit": limit,
20230        });
20231        let response = send_request(client_id, request).await;
20232        if response["@type"] == "error" {
20233            return Err(serde_json::from_value(response).unwrap())
20234        }
20235        Ok(serde_json::from_value(response).unwrap())
20236    }
20237    /// Informs TDLib that a story is opened and is being viewed by the user
20238    /// # Arguments
20239    /// * `story_sender_chat_id` - The identifier of the sender of the opened story
20240    /// * `story_id` - The identifier of the story
20241    /// * `client_id` - The client id to send the request to
20242    #[allow(clippy::too_many_arguments)]
20243    pub async fn open_story(story_sender_chat_id: i64, story_id: i32, client_id: i32) -> Result<(), crate::types::Error> {
20244        let request = json!({
20245            "@type": "openStory",
20246            "story_sender_chat_id": story_sender_chat_id,
20247            "story_id": story_id,
20248        });
20249        let response = send_request(client_id, request).await;
20250        if response["@type"] == "error" {
20251            return Err(serde_json::from_value(response).unwrap())
20252        }
20253        Ok(())
20254    }
20255    /// Informs TDLib that a story is closed by the user
20256    /// # Arguments
20257    /// * `story_sender_chat_id` - The identifier of the sender of the story to close
20258    /// * `story_id` - The identifier of the story
20259    /// * `client_id` - The client id to send the request to
20260    #[allow(clippy::too_many_arguments)]
20261    pub async fn close_story(story_sender_chat_id: i64, story_id: i32, client_id: i32) -> Result<(), crate::types::Error> {
20262        let request = json!({
20263            "@type": "closeStory",
20264            "story_sender_chat_id": story_sender_chat_id,
20265            "story_id": story_id,
20266        });
20267        let response = send_request(client_id, request).await;
20268        if response["@type"] == "error" {
20269            return Err(serde_json::from_value(response).unwrap())
20270        }
20271        Ok(())
20272    }
20273    /// Returns reactions, which can be chosen for a story
20274    /// # Arguments
20275    /// * `row_size` - Number of reaction per row, 5-25
20276    /// * `client_id` - The client id to send the request to
20277    #[allow(clippy::too_many_arguments)]
20278    pub async fn get_story_available_reactions(row_size: i32, client_id: i32) -> Result<crate::enums::AvailableReactions, crate::types::Error> {
20279        let request = json!({
20280            "@type": "getStoryAvailableReactions",
20281            "row_size": row_size,
20282        });
20283        let response = send_request(client_id, request).await;
20284        if response["@type"] == "error" {
20285            return Err(serde_json::from_value(response).unwrap())
20286        }
20287        Ok(serde_json::from_value(response).unwrap())
20288    }
20289    /// Changes chosen reaction on a story
20290    /// # Arguments
20291    /// * `story_sender_chat_id` - The identifier of the sender of the story
20292    /// * `story_id` - The identifier of the story
20293    /// * `reaction_type` - Type of the reaction to set; pass null to remove the reaction. `reactionTypeCustomEmoji` reactions can be used only by Telegram Premium users
20294    /// * `update_recent_reactions` - Pass true if the reaction needs to be added to recent reactions
20295    /// * `client_id` - The client id to send the request to
20296    #[allow(clippy::too_many_arguments)]
20297    pub async fn set_story_reaction(story_sender_chat_id: i64, story_id: i32, reaction_type: Option<crate::enums::ReactionType>, update_recent_reactions: bool, client_id: i32) -> Result<(), crate::types::Error> {
20298        let request = json!({
20299            "@type": "setStoryReaction",
20300            "story_sender_chat_id": story_sender_chat_id,
20301            "story_id": story_id,
20302            "reaction_type": reaction_type,
20303            "update_recent_reactions": update_recent_reactions,
20304        });
20305        let response = send_request(client_id, request).await;
20306        if response["@type"] == "error" {
20307            return Err(serde_json::from_value(response).unwrap())
20308        }
20309        Ok(())
20310    }
20311    /// Returns viewers of a story. The method can be called only for stories posted on behalf of the current user
20312    /// # Arguments
20313    /// * `story_id` - Story identifier
20314    /// * `query` - Query to search for in names and usernames of the viewers; may be empty to get all relevant viewers
20315    /// * `only_contacts` - Pass true to get only contacts; pass false to get all relevant viewers
20316    /// * `prefer_with_reaction` - Pass true to get viewers with reaction first; pass false to get viewers sorted just by view_date
20317    /// * `offset` - Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results
20318    /// * `limit` - The maximum number of story viewers to return
20319    /// * `client_id` - The client id to send the request to
20320    #[allow(clippy::too_many_arguments)]
20321    pub async fn get_story_viewers(story_id: i32, query: String, only_contacts: bool, prefer_with_reaction: bool, offset: String, limit: i32, client_id: i32) -> Result<crate::enums::StoryViewers, crate::types::Error> {
20322        let request = json!({
20323            "@type": "getStoryViewers",
20324            "story_id": story_id,
20325            "query": query,
20326            "only_contacts": only_contacts,
20327            "prefer_with_reaction": prefer_with_reaction,
20328            "offset": offset,
20329            "limit": limit,
20330        });
20331        let response = send_request(client_id, request).await;
20332        if response["@type"] == "error" {
20333            return Err(serde_json::from_value(response).unwrap())
20334        }
20335        Ok(serde_json::from_value(response).unwrap())
20336    }
20337    /// Reports a story to the Telegram moderators
20338    /// # Arguments
20339    /// * `story_sender_chat_id` - The identifier of the sender of the story to report
20340    /// * `story_id` - The identifier of the story to report
20341    /// * `reason` - The reason for reporting the story
20342    /// * `text` - Additional report details; 0-1024 characters
20343    /// * `client_id` - The client id to send the request to
20344    #[allow(clippy::too_many_arguments)]
20345    pub async fn report_story(story_sender_chat_id: i64, story_id: i32, reason: crate::enums::ReportReason, text: String, client_id: i32) -> Result<(), crate::types::Error> {
20346        let request = json!({
20347            "@type": "reportStory",
20348            "story_sender_chat_id": story_sender_chat_id,
20349            "story_id": story_id,
20350            "reason": reason,
20351            "text": text,
20352        });
20353        let response = send_request(client_id, request).await;
20354        if response["@type"] == "error" {
20355            return Err(serde_json::from_value(response).unwrap())
20356        }
20357        Ok(())
20358    }
20359    /// Activates stealth mode for stories, which hides all views of stories from the current user in the last "story_stealth_mode_past_period" seconds
20360    /// and for the next "story_stealth_mode_future_period" seconds; for Telegram Premium users only
20361    /// # Arguments
20362    /// * `client_id` - The client id to send the request to
20363    #[allow(clippy::too_many_arguments)]
20364    pub async fn activate_story_stealth_mode(client_id: i32) -> Result<(), crate::types::Error> {
20365        let request = json!({
20366            "@type": "activateStoryStealthMode",
20367        });
20368        let response = send_request(client_id, request).await;
20369        if response["@type"] == "error" {
20370            return Err(serde_json::from_value(response).unwrap())
20371        }
20372        Ok(())
20373    }
20374    /// Returns the current boost status for a channel chat
20375    /// # Arguments
20376    /// * `chat_id` - Identifier of the channel chat
20377    /// * `client_id` - The client id to send the request to
20378    #[allow(clippy::too_many_arguments)]
20379    pub async fn get_chat_boost_status(chat_id: i64, client_id: i32) -> Result<crate::enums::ChatBoostStatus, crate::types::Error> {
20380        let request = json!({
20381            "@type": "getChatBoostStatus",
20382            "chat_id": chat_id,
20383        });
20384        let response = send_request(client_id, request).await;
20385        if response["@type"] == "error" {
20386            return Err(serde_json::from_value(response).unwrap())
20387        }
20388        Ok(serde_json::from_value(response).unwrap())
20389    }
20390    /// Checks whether the current user can boost a chat
20391    /// # Arguments
20392    /// * `chat_id` - Identifier of the chat
20393    /// * `client_id` - The client id to send the request to
20394    #[allow(clippy::too_many_arguments)]
20395    pub async fn can_boost_chat(chat_id: i64, client_id: i32) -> Result<crate::enums::CanBoostChatResult, crate::types::Error> {
20396        let request = json!({
20397            "@type": "canBoostChat",
20398            "chat_id": chat_id,
20399        });
20400        let response = send_request(client_id, request).await;
20401        if response["@type"] == "error" {
20402            return Err(serde_json::from_value(response).unwrap())
20403        }
20404        Ok(serde_json::from_value(response).unwrap())
20405    }
20406    /// Boosts a chat
20407    /// # Arguments
20408    /// * `chat_id` - Identifier of the chat
20409    /// * `client_id` - The client id to send the request to
20410    #[allow(clippy::too_many_arguments)]
20411    pub async fn boost_chat(chat_id: i64, client_id: i32) -> Result<(), crate::types::Error> {
20412        let request = json!({
20413            "@type": "boostChat",
20414            "chat_id": chat_id,
20415        });
20416        let response = send_request(client_id, request).await;
20417        if response["@type"] == "error" {
20418            return Err(serde_json::from_value(response).unwrap())
20419        }
20420        Ok(())
20421    }
20422    /// Returns an HTTPS link to boost the specified channel chat
20423    /// # Arguments
20424    /// * `chat_id` - Identifier of the chat
20425    /// * `client_id` - The client id to send the request to
20426    #[allow(clippy::too_many_arguments)]
20427    pub async fn get_chat_boost_link(chat_id: i64, client_id: i32) -> Result<crate::enums::ChatBoostLink, crate::types::Error> {
20428        let request = json!({
20429            "@type": "getChatBoostLink",
20430            "chat_id": chat_id,
20431        });
20432        let response = send_request(client_id, request).await;
20433        if response["@type"] == "error" {
20434            return Err(serde_json::from_value(response).unwrap())
20435        }
20436        Ok(serde_json::from_value(response).unwrap())
20437    }
20438    /// Returns information about a link to boost a chat. Can be called for any internal link of the type internalLinkTypeChatBoost
20439    /// # Arguments
20440    /// * `url` - The link to boost a chat
20441    /// * `client_id` - The client id to send the request to
20442    #[allow(clippy::too_many_arguments)]
20443    pub async fn get_chat_boost_link_info(url: String, client_id: i32) -> Result<crate::enums::ChatBoostLinkInfo, crate::types::Error> {
20444        let request = json!({
20445            "@type": "getChatBoostLinkInfo",
20446            "url": url,
20447        });
20448        let response = send_request(client_id, request).await;
20449        if response["@type"] == "error" {
20450            return Err(serde_json::from_value(response).unwrap())
20451        }
20452        Ok(serde_json::from_value(response).unwrap())
20453    }
20454    /// Returns list of boosts applied to a chat. The user must be an administrator in the channel chat to get the list of boosts
20455    /// # Arguments
20456    /// * `chat_id` - Identifier of the chat
20457    /// * `offset` - Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results
20458    /// * `limit` - The maximum number of boosts to be returned; up to 100. For optimal performance, the number of returned boosts can be smaller than the specified limit
20459    /// * `client_id` - The client id to send the request to
20460    #[allow(clippy::too_many_arguments)]
20461    pub async fn get_chat_boosts(chat_id: i64, offset: String, limit: i32, client_id: i32) -> Result<crate::enums::FoundChatBoosts, crate::types::Error> {
20462        let request = json!({
20463            "@type": "getChatBoosts",
20464            "chat_id": chat_id,
20465            "offset": offset,
20466            "limit": limit,
20467        });
20468        let response = send_request(client_id, request).await;
20469        if response["@type"] == "error" {
20470            return Err(serde_json::from_value(response).unwrap())
20471        }
20472        Ok(serde_json::from_value(response).unwrap())
20473    }
20474    /// Returns information about a bot that can be added to attachment or side menu
20475    /// # Arguments
20476    /// * `bot_user_id` - Bot's user identifier
20477    /// * `client_id` - The client id to send the request to
20478    #[allow(clippy::too_many_arguments)]
20479    pub async fn get_attachment_menu_bot(bot_user_id: i64, client_id: i32) -> Result<crate::enums::AttachmentMenuBot, crate::types::Error> {
20480        let request = json!({
20481            "@type": "getAttachmentMenuBot",
20482            "bot_user_id": bot_user_id,
20483        });
20484        let response = send_request(client_id, request).await;
20485        if response["@type"] == "error" {
20486            return Err(serde_json::from_value(response).unwrap())
20487        }
20488        Ok(serde_json::from_value(response).unwrap())
20489    }
20490    /// Adds or removes a bot to attachment and side menu. Bot can be added to the menu, only if userTypeBot.can_be_added_to_attachment_menu == true
20491    /// # Arguments
20492    /// * `bot_user_id` - Bot's user identifier
20493    /// * `is_added` - Pass true to add the bot to attachment menu; pass false to remove the bot from attachment menu
20494    /// * `allow_write_access` - Pass true if the current user allowed the bot to send them messages. Ignored if is_added is false
20495    /// * `client_id` - The client id to send the request to
20496    #[allow(clippy::too_many_arguments)]
20497    pub async fn toggle_bot_is_added_to_attachment_menu(bot_user_id: i64, is_added: bool, allow_write_access: bool, client_id: i32) -> Result<(), crate::types::Error> {
20498        let request = json!({
20499            "@type": "toggleBotIsAddedToAttachmentMenu",
20500            "bot_user_id": bot_user_id,
20501            "is_added": is_added,
20502            "allow_write_access": allow_write_access,
20503        });
20504        let response = send_request(client_id, request).await;
20505        if response["@type"] == "error" {
20506            return Err(serde_json::from_value(response).unwrap())
20507        }
20508        Ok(())
20509    }
20510    /// Returns up to 8 emoji statuses, which must be shown right after the default Premium Badge in the emoji status list
20511    /// # Arguments
20512    /// * `client_id` - The client id to send the request to
20513    #[allow(clippy::too_many_arguments)]
20514    pub async fn get_themed_emoji_statuses(client_id: i32) -> Result<crate::enums::EmojiStatuses, crate::types::Error> {
20515        let request = json!({
20516            "@type": "getThemedEmojiStatuses",
20517        });
20518        let response = send_request(client_id, request).await;
20519        if response["@type"] == "error" {
20520            return Err(serde_json::from_value(response).unwrap())
20521        }
20522        Ok(serde_json::from_value(response).unwrap())
20523    }
20524    /// Returns recent emoji statuses
20525    /// # Arguments
20526    /// * `client_id` - The client id to send the request to
20527    #[allow(clippy::too_many_arguments)]
20528    pub async fn get_recent_emoji_statuses(client_id: i32) -> Result<crate::enums::EmojiStatuses, crate::types::Error> {
20529        let request = json!({
20530            "@type": "getRecentEmojiStatuses",
20531        });
20532        let response = send_request(client_id, request).await;
20533        if response["@type"] == "error" {
20534            return Err(serde_json::from_value(response).unwrap())
20535        }
20536        Ok(serde_json::from_value(response).unwrap())
20537    }
20538    /// Returns default emoji statuses
20539    /// # Arguments
20540    /// * `client_id` - The client id to send the request to
20541    #[allow(clippy::too_many_arguments)]
20542    pub async fn get_default_emoji_statuses(client_id: i32) -> Result<crate::enums::EmojiStatuses, crate::types::Error> {
20543        let request = json!({
20544            "@type": "getDefaultEmojiStatuses",
20545        });
20546        let response = send_request(client_id, request).await;
20547        if response["@type"] == "error" {
20548            return Err(serde_json::from_value(response).unwrap())
20549        }
20550        Ok(serde_json::from_value(response).unwrap())
20551    }
20552    /// Clears the list of recently used emoji statuses
20553    /// # Arguments
20554    /// * `client_id` - The client id to send the request to
20555    #[allow(clippy::too_many_arguments)]
20556    pub async fn clear_recent_emoji_statuses(client_id: i32) -> Result<(), crate::types::Error> {
20557        let request = json!({
20558            "@type": "clearRecentEmojiStatuses",
20559        });
20560        let response = send_request(client_id, request).await;
20561        if response["@type"] == "error" {
20562            return Err(serde_json::from_value(response).unwrap())
20563        }
20564        Ok(())
20565    }
20566    /// Downloads a file from the cloud. Download progress and completion of the download will be notified through updateFile updates
20567    /// # Arguments
20568    /// * `file_id` - Identifier of the file to download
20569    /// * `priority` - Priority of the download (1-32). The higher the priority, the earlier the file will be downloaded. If the priorities of two files are equal, then the last one for which downloadFile/addFileToDownloads was called will be downloaded first
20570    /// * `offset` - The starting position from which the file needs to be downloaded
20571    /// * `limit` - Number of bytes which need to be downloaded starting from the "offset" position before the download will automatically be canceled; use 0 to download without a limit
20572    /// * `synchronous` - Pass true to return response only after the file download has succeeded, has failed, has been canceled, or a new downloadFile request with different offset/limit parameters was sent; pass false to return file state immediately, just after the download has been started
20573    /// * `client_id` - The client id to send the request to
20574    #[allow(clippy::too_many_arguments)]
20575    pub async fn download_file(file_id: i32, priority: i32, offset: i64, limit: i64, synchronous: bool, client_id: i32) -> Result<crate::enums::File, crate::types::Error> {
20576        let request = json!({
20577            "@type": "downloadFile",
20578            "file_id": file_id,
20579            "priority": priority,
20580            "offset": offset,
20581            "limit": limit,
20582            "synchronous": synchronous,
20583        });
20584        let response = send_request(client_id, request).await;
20585        if response["@type"] == "error" {
20586            return Err(serde_json::from_value(response).unwrap())
20587        }
20588        Ok(serde_json::from_value(response).unwrap())
20589    }
20590    /// Returns file downloaded prefix size from a given offset, in bytes
20591    /// # Arguments
20592    /// * `file_id` - Identifier of the file
20593    /// * `offset` - Offset from which downloaded prefix size needs to be calculated
20594    /// * `client_id` - The client id to send the request to
20595    #[allow(clippy::too_many_arguments)]
20596    pub async fn get_file_downloaded_prefix_size(file_id: i32, offset: i64, client_id: i32) -> Result<crate::enums::FileDownloadedPrefixSize, crate::types::Error> {
20597        let request = json!({
20598            "@type": "getFileDownloadedPrefixSize",
20599            "file_id": file_id,
20600            "offset": offset,
20601        });
20602        let response = send_request(client_id, request).await;
20603        if response["@type"] == "error" {
20604            return Err(serde_json::from_value(response).unwrap())
20605        }
20606        Ok(serde_json::from_value(response).unwrap())
20607    }
20608    /// Stops the downloading of a file. If a file has already been downloaded, does nothing
20609    /// # Arguments
20610    /// * `file_id` - Identifier of a file to stop downloading
20611    /// * `only_if_pending` - Pass true to stop downloading only if it hasn't been started, i.e. request hasn't been sent to server
20612    /// * `client_id` - The client id to send the request to
20613    #[allow(clippy::too_many_arguments)]
20614    pub async fn cancel_download_file(file_id: i32, only_if_pending: bool, client_id: i32) -> Result<(), crate::types::Error> {
20615        let request = json!({
20616            "@type": "cancelDownloadFile",
20617            "file_id": file_id,
20618            "only_if_pending": only_if_pending,
20619        });
20620        let response = send_request(client_id, request).await;
20621        if response["@type"] == "error" {
20622            return Err(serde_json::from_value(response).unwrap())
20623        }
20624        Ok(())
20625    }
20626    /// Returns suggested name for saving a file in a given directory
20627    /// # Arguments
20628    /// * `file_id` - Identifier of the file
20629    /// * `directory` - Directory in which the file is supposed to be saved
20630    /// * `client_id` - The client id to send the request to
20631    #[allow(clippy::too_many_arguments)]
20632    pub async fn get_suggested_file_name(file_id: i32, directory: String, client_id: i32) -> Result<crate::enums::Text, crate::types::Error> {
20633        let request = json!({
20634            "@type": "getSuggestedFileName",
20635            "file_id": file_id,
20636            "directory": directory,
20637        });
20638        let response = send_request(client_id, request).await;
20639        if response["@type"] == "error" {
20640            return Err(serde_json::from_value(response).unwrap())
20641        }
20642        Ok(serde_json::from_value(response).unwrap())
20643    }
20644    /// Preliminary uploads a file to the cloud before sending it in a message, which can be useful for uploading of being recorded voice and video notes. Updates updateFile will be used
20645    /// to notify about upload progress and successful completion of the upload. The file will not have a persistent remote identifier until it will be sent in a message
20646    /// # Arguments
20647    /// * `file` - File to upload
20648    /// * `file_type` - File type; pass null if unknown
20649    /// * `priority` - Priority of the upload (1-32). The higher the priority, the earlier the file will be uploaded. If the priorities of two files are equal, then the first one for which preliminaryUploadFile was called will be uploaded first
20650    /// * `client_id` - The client id to send the request to
20651    #[allow(clippy::too_many_arguments)]
20652    pub async fn preliminary_upload_file(file: crate::enums::InputFile, file_type: Option<crate::enums::FileType>, priority: i32, client_id: i32) -> Result<crate::enums::File, crate::types::Error> {
20653        let request = json!({
20654            "@type": "preliminaryUploadFile",
20655            "file": file,
20656            "file_type": file_type,
20657            "priority": priority,
20658        });
20659        let response = send_request(client_id, request).await;
20660        if response["@type"] == "error" {
20661            return Err(serde_json::from_value(response).unwrap())
20662        }
20663        Ok(serde_json::from_value(response).unwrap())
20664    }
20665    /// Stops the preliminary uploading of a file. Supported only for files uploaded by using preliminaryUploadFile. For other files the behavior is undefined
20666    /// # Arguments
20667    /// * `file_id` - Identifier of the file to stop uploading
20668    /// * `client_id` - The client id to send the request to
20669    #[allow(clippy::too_many_arguments)]
20670    pub async fn cancel_preliminary_upload_file(file_id: i32, client_id: i32) -> Result<(), crate::types::Error> {
20671        let request = json!({
20672            "@type": "cancelPreliminaryUploadFile",
20673            "file_id": file_id,
20674        });
20675        let response = send_request(client_id, request).await;
20676        if response["@type"] == "error" {
20677            return Err(serde_json::from_value(response).unwrap())
20678        }
20679        Ok(())
20680    }
20681    /// Writes a part of a generated file. This method is intended to be used only if the application has no direct access to TDLib's file system, because it is usually slower than a direct write to the destination file
20682    /// # Arguments
20683    /// * `generation_id` - The identifier of the generation process
20684    /// * `offset` - The offset from which to write the data to the file
20685    /// * `data` - The data to write
20686    /// * `client_id` - The client id to send the request to
20687    #[allow(clippy::too_many_arguments)]
20688    pub async fn write_generated_file_part(generation_id: i64, offset: i64, data: String, client_id: i32) -> Result<(), crate::types::Error> {
20689        let request = json!({
20690            "@type": "writeGeneratedFilePart",
20691            "generation_id": generation_id,
20692            "offset": offset,
20693            "data": data,
20694        });
20695        let response = send_request(client_id, request).await;
20696        if response["@type"] == "error" {
20697            return Err(serde_json::from_value(response).unwrap())
20698        }
20699        Ok(())
20700    }
20701    /// Informs TDLib on a file generation progress
20702    /// # Arguments
20703    /// * `generation_id` - The identifier of the generation process
20704    /// * `expected_size` - Expected size of the generated file, in bytes; 0 if unknown
20705    /// * `local_prefix_size` - The number of bytes already generated
20706    /// * `client_id` - The client id to send the request to
20707    #[allow(clippy::too_many_arguments)]
20708    pub async fn set_file_generation_progress(generation_id: i64, expected_size: i64, local_prefix_size: i64, client_id: i32) -> Result<(), crate::types::Error> {
20709        let request = json!({
20710            "@type": "setFileGenerationProgress",
20711            "generation_id": generation_id,
20712            "expected_size": expected_size,
20713            "local_prefix_size": local_prefix_size,
20714        });
20715        let response = send_request(client_id, request).await;
20716        if response["@type"] == "error" {
20717            return Err(serde_json::from_value(response).unwrap())
20718        }
20719        Ok(())
20720    }
20721    /// Finishes the file generation
20722    /// # Arguments
20723    /// * `generation_id` - The identifier of the generation process
20724    /// * `error` - If passed, the file generation has failed and must be terminated; pass null if the file generation succeeded
20725    /// * `client_id` - The client id to send the request to
20726    #[allow(clippy::too_many_arguments)]
20727    pub async fn finish_file_generation(generation_id: i64, error: Option<crate::types::Error>, client_id: i32) -> Result<(), crate::types::Error> {
20728        let request = json!({
20729            "@type": "finishFileGeneration",
20730            "generation_id": generation_id,
20731            "error": error,
20732        });
20733        let response = send_request(client_id, request).await;
20734        if response["@type"] == "error" {
20735            return Err(serde_json::from_value(response).unwrap())
20736        }
20737        Ok(())
20738    }
20739    /// Reads a part of a file from the TDLib file cache and returns read bytes. This method is intended to be used only if the application has no direct access to TDLib's file system, because it is usually slower than a direct read from the file
20740    /// # Arguments
20741    /// * `file_id` - Identifier of the file. The file must be located in the TDLib file cache
20742    /// * `offset` - The offset from which to read the file
20743    /// * `count` - Number of bytes to read. An error will be returned if there are not enough bytes available in the file from the specified position. Pass 0 to read all available data from the specified position
20744    /// * `client_id` - The client id to send the request to
20745    #[allow(clippy::too_many_arguments)]
20746    pub async fn read_file_part(file_id: i32, offset: i64, count: i64, client_id: i32) -> Result<crate::enums::FilePart, crate::types::Error> {
20747        let request = json!({
20748            "@type": "readFilePart",
20749            "file_id": file_id,
20750            "offset": offset,
20751            "count": count,
20752        });
20753        let response = send_request(client_id, request).await;
20754        if response["@type"] == "error" {
20755            return Err(serde_json::from_value(response).unwrap())
20756        }
20757        Ok(serde_json::from_value(response).unwrap())
20758    }
20759    /// Deletes a file from the TDLib file cache
20760    /// # Arguments
20761    /// * `file_id` - Identifier of the file to delete
20762    /// * `client_id` - The client id to send the request to
20763    #[allow(clippy::too_many_arguments)]
20764    pub async fn delete_file(file_id: i32, client_id: i32) -> Result<(), crate::types::Error> {
20765        let request = json!({
20766            "@type": "deleteFile",
20767            "file_id": file_id,
20768        });
20769        let response = send_request(client_id, request).await;
20770        if response["@type"] == "error" {
20771            return Err(serde_json::from_value(response).unwrap())
20772        }
20773        Ok(())
20774    }
20775    /// Adds a file from a message to the list of file downloads. Download progress and completion of the download will be notified through updateFile updates.
20776    /// If message database is used, the list of file downloads is persistent across application restarts. The downloading is independent from download using downloadFile, i.e. it continues if downloadFile is canceled or is used to download a part of the file
20777    /// # Arguments
20778    /// * `file_id` - Identifier of the file to download
20779    /// * `chat_id` - Chat identifier of the message with the file
20780    /// * `message_id` - Message identifier
20781    /// * `priority` - Priority of the download (1-32). The higher the priority, the earlier the file will be downloaded. If the priorities of two files are equal, then the last one for which downloadFile/addFileToDownloads was called will be downloaded first
20782    /// * `client_id` - The client id to send the request to
20783    #[allow(clippy::too_many_arguments)]
20784    pub async fn add_file_to_downloads(file_id: i32, chat_id: i64, message_id: i64, priority: i32, client_id: i32) -> Result<crate::enums::File, crate::types::Error> {
20785        let request = json!({
20786            "@type": "addFileToDownloads",
20787            "file_id": file_id,
20788            "chat_id": chat_id,
20789            "message_id": message_id,
20790            "priority": priority,
20791        });
20792        let response = send_request(client_id, request).await;
20793        if response["@type"] == "error" {
20794            return Err(serde_json::from_value(response).unwrap())
20795        }
20796        Ok(serde_json::from_value(response).unwrap())
20797    }
20798    /// Changes pause state of a file in the file download list
20799    /// # Arguments
20800    /// * `file_id` - Identifier of the downloaded file
20801    /// * `is_paused` - Pass true if the download is paused
20802    /// * `client_id` - The client id to send the request to
20803    #[allow(clippy::too_many_arguments)]
20804    pub async fn toggle_download_is_paused(file_id: i32, is_paused: bool, client_id: i32) -> Result<(), crate::types::Error> {
20805        let request = json!({
20806            "@type": "toggleDownloadIsPaused",
20807            "file_id": file_id,
20808            "is_paused": is_paused,
20809        });
20810        let response = send_request(client_id, request).await;
20811        if response["@type"] == "error" {
20812            return Err(serde_json::from_value(response).unwrap())
20813        }
20814        Ok(())
20815    }
20816    /// Changes pause state of all files in the file download list
20817    /// # Arguments
20818    /// * `are_paused` - Pass true to pause all downloads; pass false to unpause them
20819    /// * `client_id` - The client id to send the request to
20820    #[allow(clippy::too_many_arguments)]
20821    pub async fn toggle_all_downloads_are_paused(are_paused: bool, client_id: i32) -> Result<(), crate::types::Error> {
20822        let request = json!({
20823            "@type": "toggleAllDownloadsArePaused",
20824            "are_paused": are_paused,
20825        });
20826        let response = send_request(client_id, request).await;
20827        if response["@type"] == "error" {
20828            return Err(serde_json::from_value(response).unwrap())
20829        }
20830        Ok(())
20831    }
20832    /// Removes a file from the file download list
20833    /// # Arguments
20834    /// * `file_id` - Identifier of the downloaded file
20835    /// * `delete_from_cache` - Pass true to delete the file from the TDLib file cache
20836    /// * `client_id` - The client id to send the request to
20837    #[allow(clippy::too_many_arguments)]
20838    pub async fn remove_file_from_downloads(file_id: i32, delete_from_cache: bool, client_id: i32) -> Result<(), crate::types::Error> {
20839        let request = json!({
20840            "@type": "removeFileFromDownloads",
20841            "file_id": file_id,
20842            "delete_from_cache": delete_from_cache,
20843        });
20844        let response = send_request(client_id, request).await;
20845        if response["@type"] == "error" {
20846            return Err(serde_json::from_value(response).unwrap())
20847        }
20848        Ok(())
20849    }
20850    /// Removes all files from the file download list
20851    /// # Arguments
20852    /// * `only_active` - Pass true to remove only active downloads, including paused
20853    /// * `only_completed` - Pass true to remove only completed downloads
20854    /// * `delete_from_cache` - Pass true to delete the file from the TDLib file cache
20855    /// * `client_id` - The client id to send the request to
20856    #[allow(clippy::too_many_arguments)]
20857    pub async fn remove_all_files_from_downloads(only_active: bool, only_completed: bool, delete_from_cache: bool, client_id: i32) -> Result<(), crate::types::Error> {
20858        let request = json!({
20859            "@type": "removeAllFilesFromDownloads",
20860            "only_active": only_active,
20861            "only_completed": only_completed,
20862            "delete_from_cache": delete_from_cache,
20863        });
20864        let response = send_request(client_id, request).await;
20865        if response["@type"] == "error" {
20866            return Err(serde_json::from_value(response).unwrap())
20867        }
20868        Ok(())
20869    }
20870    /// Searches for files in the file download list or recently downloaded files from the list
20871    /// # Arguments
20872    /// * `query` - Query to search for; may be empty to return all downloaded files
20873    /// * `only_active` - Pass true to search only for active downloads, including paused
20874    /// * `only_completed` - Pass true to search only for completed downloads
20875    /// * `offset` - Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results
20876    /// * `limit` - The maximum number of files to be returned
20877    /// * `client_id` - The client id to send the request to
20878    #[allow(clippy::too_many_arguments)]
20879    pub async fn search_file_downloads(query: String, only_active: bool, only_completed: bool, offset: String, limit: i32, client_id: i32) -> Result<crate::enums::FoundFileDownloads, crate::types::Error> {
20880        let request = json!({
20881            "@type": "searchFileDownloads",
20882            "query": query,
20883            "only_active": only_active,
20884            "only_completed": only_completed,
20885            "offset": offset,
20886            "limit": limit,
20887        });
20888        let response = send_request(client_id, request).await;
20889        if response["@type"] == "error" {
20890            return Err(serde_json::from_value(response).unwrap())
20891        }
20892        Ok(serde_json::from_value(response).unwrap())
20893    }
20894    /// Returns information about a file with messages exported from another application
20895    /// # Arguments
20896    /// * `message_file_head` - Beginning of the message file; up to 100 first lines
20897    /// * `client_id` - The client id to send the request to
20898    #[allow(clippy::too_many_arguments)]
20899    pub async fn get_message_file_type(message_file_head: String, client_id: i32) -> Result<crate::enums::MessageFileType, crate::types::Error> {
20900        let request = json!({
20901            "@type": "getMessageFileType",
20902            "message_file_head": message_file_head,
20903        });
20904        let response = send_request(client_id, request).await;
20905        if response["@type"] == "error" {
20906            return Err(serde_json::from_value(response).unwrap())
20907        }
20908        Ok(serde_json::from_value(response).unwrap())
20909    }
20910    /// Returns a confirmation text to be shown to the user before starting message import
20911    /// # Arguments
20912    /// * `chat_id` - Identifier of a chat to which the messages will be imported. It must be an identifier of a private chat with a mutual contact or an identifier of a supergroup chat with can_change_info administrator right
20913    /// * `client_id` - The client id to send the request to
20914    #[allow(clippy::too_many_arguments)]
20915    pub async fn get_message_import_confirmation_text(chat_id: i64, client_id: i32) -> Result<crate::enums::Text, crate::types::Error> {
20916        let request = json!({
20917            "@type": "getMessageImportConfirmationText",
20918            "chat_id": chat_id,
20919        });
20920        let response = send_request(client_id, request).await;
20921        if response["@type"] == "error" {
20922            return Err(serde_json::from_value(response).unwrap())
20923        }
20924        Ok(serde_json::from_value(response).unwrap())
20925    }
20926    /// Imports messages exported from another app
20927    /// # Arguments
20928    /// * `chat_id` - Identifier of a chat to which the messages will be imported. It must be an identifier of a private chat with a mutual contact or an identifier of a supergroup chat with can_change_info administrator right
20929    /// * `message_file` - File with messages to import. Only inputFileLocal and inputFileGenerated are supported. The file must not be previously uploaded
20930    /// * `attached_files` - Files used in the imported messages. Only inputFileLocal and inputFileGenerated are supported. The files must not be previously uploaded
20931    /// * `client_id` - The client id to send the request to
20932    #[allow(clippy::too_many_arguments)]
20933    pub async fn import_messages(chat_id: i64, message_file: crate::enums::InputFile, attached_files: Vec<crate::enums::InputFile>, client_id: i32) -> Result<(), crate::types::Error> {
20934        let request = json!({
20935            "@type": "importMessages",
20936            "chat_id": chat_id,
20937            "message_file": message_file,
20938            "attached_files": attached_files,
20939        });
20940        let response = send_request(client_id, request).await;
20941        if response["@type"] == "error" {
20942            return Err(serde_json::from_value(response).unwrap())
20943        }
20944        Ok(())
20945    }
20946    /// Replaces current primary invite link for a chat with a new primary invite link. Available for basic groups, supergroups, and channels. Requires administrator privileges and can_invite_users right
20947    /// # Arguments
20948    /// * `chat_id` - Chat identifier
20949    /// * `client_id` - The client id to send the request to
20950    #[allow(clippy::too_many_arguments)]
20951    pub async fn replace_primary_chat_invite_link(chat_id: i64, client_id: i32) -> Result<crate::enums::ChatInviteLink, crate::types::Error> {
20952        let request = json!({
20953            "@type": "replacePrimaryChatInviteLink",
20954            "chat_id": chat_id,
20955        });
20956        let response = send_request(client_id, request).await;
20957        if response["@type"] == "error" {
20958            return Err(serde_json::from_value(response).unwrap())
20959        }
20960        Ok(serde_json::from_value(response).unwrap())
20961    }
20962    /// Creates a new invite link for a chat. Available for basic groups, supergroups, and channels. Requires administrator privileges and can_invite_users right in the chat
20963    /// # Arguments
20964    /// * `chat_id` - Chat identifier
20965    /// * `name` - Invite link name; 0-32 characters
20966    /// * `expiration_date` - Point in time (Unix timestamp) when the link will expire; pass 0 if never
20967    /// * `member_limit` - The maximum number of chat members that can join the chat via the link simultaneously; 0-99999; pass 0 if not limited
20968    /// * `creates_join_request` - Pass true if users joining the chat via the link need to be approved by chat administrators. In this case, member_limit must be 0
20969    /// * `client_id` - The client id to send the request to
20970    #[allow(clippy::too_many_arguments)]
20971    pub async fn create_chat_invite_link(chat_id: i64, name: String, expiration_date: i32, member_limit: i32, creates_join_request: bool, client_id: i32) -> Result<crate::enums::ChatInviteLink, crate::types::Error> {
20972        let request = json!({
20973            "@type": "createChatInviteLink",
20974            "chat_id": chat_id,
20975            "name": name,
20976            "expiration_date": expiration_date,
20977            "member_limit": member_limit,
20978            "creates_join_request": creates_join_request,
20979        });
20980        let response = send_request(client_id, request).await;
20981        if response["@type"] == "error" {
20982            return Err(serde_json::from_value(response).unwrap())
20983        }
20984        Ok(serde_json::from_value(response).unwrap())
20985    }
20986    /// Edits a non-primary invite link for a chat. Available for basic groups, supergroups, and channels. Requires administrator privileges and can_invite_users right in the chat for own links and owner privileges for other links
20987    /// # Arguments
20988    /// * `chat_id` - Chat identifier
20989    /// * `invite_link` - Invite link to be edited
20990    /// * `name` - Invite link name; 0-32 characters
20991    /// * `expiration_date` - Point in time (Unix timestamp) when the link will expire; pass 0 if never
20992    /// * `member_limit` - The maximum number of chat members that can join the chat via the link simultaneously; 0-99999; pass 0 if not limited
20993    /// * `creates_join_request` - Pass true if users joining the chat via the link need to be approved by chat administrators. In this case, member_limit must be 0
20994    /// * `client_id` - The client id to send the request to
20995    #[allow(clippy::too_many_arguments)]
20996    pub async fn edit_chat_invite_link(chat_id: i64, invite_link: String, name: String, expiration_date: i32, member_limit: i32, creates_join_request: bool, client_id: i32) -> Result<crate::enums::ChatInviteLink, crate::types::Error> {
20997        let request = json!({
20998            "@type": "editChatInviteLink",
20999            "chat_id": chat_id,
21000            "invite_link": invite_link,
21001            "name": name,
21002            "expiration_date": expiration_date,
21003            "member_limit": member_limit,
21004            "creates_join_request": creates_join_request,
21005        });
21006        let response = send_request(client_id, request).await;
21007        if response["@type"] == "error" {
21008            return Err(serde_json::from_value(response).unwrap())
21009        }
21010        Ok(serde_json::from_value(response).unwrap())
21011    }
21012    /// Returns information about an invite link. Requires administrator privileges and can_invite_users right in the chat to get own links and owner privileges to get other links
21013    /// # Arguments
21014    /// * `chat_id` - Chat identifier
21015    /// * `invite_link` - Invite link to get
21016    /// * `client_id` - The client id to send the request to
21017    #[allow(clippy::too_many_arguments)]
21018    pub async fn get_chat_invite_link(chat_id: i64, invite_link: String, client_id: i32) -> Result<crate::enums::ChatInviteLink, crate::types::Error> {
21019        let request = json!({
21020            "@type": "getChatInviteLink",
21021            "chat_id": chat_id,
21022            "invite_link": invite_link,
21023        });
21024        let response = send_request(client_id, request).await;
21025        if response["@type"] == "error" {
21026            return Err(serde_json::from_value(response).unwrap())
21027        }
21028        Ok(serde_json::from_value(response).unwrap())
21029    }
21030    /// Returns list of chat administrators with number of their invite links. Requires owner privileges in the chat
21031    /// # Arguments
21032    /// * `chat_id` - Chat identifier
21033    /// * `client_id` - The client id to send the request to
21034    #[allow(clippy::too_many_arguments)]
21035    pub async fn get_chat_invite_link_counts(chat_id: i64, client_id: i32) -> Result<crate::enums::ChatInviteLinkCounts, crate::types::Error> {
21036        let request = json!({
21037            "@type": "getChatInviteLinkCounts",
21038            "chat_id": chat_id,
21039        });
21040        let response = send_request(client_id, request).await;
21041        if response["@type"] == "error" {
21042            return Err(serde_json::from_value(response).unwrap())
21043        }
21044        Ok(serde_json::from_value(response).unwrap())
21045    }
21046    /// Returns invite links for a chat created by specified administrator. Requires administrator privileges and can_invite_users right in the chat to get own links and owner privileges to get other links
21047    /// # Arguments
21048    /// * `chat_id` - Chat identifier
21049    /// * `creator_user_id` - User identifier of a chat administrator. Must be an identifier of the current user for non-owner
21050    /// * `is_revoked` - Pass true if revoked links needs to be returned instead of active or expired
21051    /// * `offset_date` - Creation date of an invite link starting after which to return invite links; use 0 to get results from the beginning
21052    /// * `offset_invite_link` - Invite link starting after which to return invite links; use empty string to get results from the beginning
21053    /// * `limit` - The maximum number of invite links to return; up to 100
21054    /// * `client_id` - The client id to send the request to
21055    #[allow(clippy::too_many_arguments)]
21056    pub async fn get_chat_invite_links(chat_id: i64, creator_user_id: i64, is_revoked: bool, offset_date: i32, offset_invite_link: String, limit: i32, client_id: i32) -> Result<crate::enums::ChatInviteLinks, crate::types::Error> {
21057        let request = json!({
21058            "@type": "getChatInviteLinks",
21059            "chat_id": chat_id,
21060            "creator_user_id": creator_user_id,
21061            "is_revoked": is_revoked,
21062            "offset_date": offset_date,
21063            "offset_invite_link": offset_invite_link,
21064            "limit": limit,
21065        });
21066        let response = send_request(client_id, request).await;
21067        if response["@type"] == "error" {
21068            return Err(serde_json::from_value(response).unwrap())
21069        }
21070        Ok(serde_json::from_value(response).unwrap())
21071    }
21072    /// Returns chat members joined a chat via an invite link. Requires administrator privileges and can_invite_users right in the chat for own links and owner privileges for other links
21073    /// # Arguments
21074    /// * `chat_id` - Chat identifier
21075    /// * `invite_link` - Invite link for which to return chat members
21076    /// * `offset_member` - A chat member from which to return next chat members; pass null to get results from the beginning
21077    /// * `limit` - The maximum number of chat members to return; up to 100
21078    /// * `client_id` - The client id to send the request to
21079    #[allow(clippy::too_many_arguments)]
21080    pub async fn get_chat_invite_link_members(chat_id: i64, invite_link: String, offset_member: Option<crate::types::ChatInviteLinkMember>, limit: i32, client_id: i32) -> Result<crate::enums::ChatInviteLinkMembers, crate::types::Error> {
21081        let request = json!({
21082            "@type": "getChatInviteLinkMembers",
21083            "chat_id": chat_id,
21084            "invite_link": invite_link,
21085            "offset_member": offset_member,
21086            "limit": limit,
21087        });
21088        let response = send_request(client_id, request).await;
21089        if response["@type"] == "error" {
21090            return Err(serde_json::from_value(response).unwrap())
21091        }
21092        Ok(serde_json::from_value(response).unwrap())
21093    }
21094    /// Revokes invite link for a chat. Available for basic groups, supergroups, and channels. Requires administrator privileges and can_invite_users right in the chat for own links and owner privileges for other links.
21095    /// If a primary link is revoked, then additionally to the revoked link returns new primary link
21096    /// # Arguments
21097    /// * `chat_id` - Chat identifier
21098    /// * `invite_link` - Invite link to be revoked
21099    /// * `client_id` - The client id to send the request to
21100    #[allow(clippy::too_many_arguments)]
21101    pub async fn revoke_chat_invite_link(chat_id: i64, invite_link: String, client_id: i32) -> Result<crate::enums::ChatInviteLinks, crate::types::Error> {
21102        let request = json!({
21103            "@type": "revokeChatInviteLink",
21104            "chat_id": chat_id,
21105            "invite_link": invite_link,
21106        });
21107        let response = send_request(client_id, request).await;
21108        if response["@type"] == "error" {
21109            return Err(serde_json::from_value(response).unwrap())
21110        }
21111        Ok(serde_json::from_value(response).unwrap())
21112    }
21113    /// Deletes revoked chat invite links. Requires administrator privileges and can_invite_users right in the chat for own links and owner privileges for other links
21114    /// # Arguments
21115    /// * `chat_id` - Chat identifier
21116    /// * `invite_link` - Invite link to revoke
21117    /// * `client_id` - The client id to send the request to
21118    #[allow(clippy::too_many_arguments)]
21119    pub async fn delete_revoked_chat_invite_link(chat_id: i64, invite_link: String, client_id: i32) -> Result<(), crate::types::Error> {
21120        let request = json!({
21121            "@type": "deleteRevokedChatInviteLink",
21122            "chat_id": chat_id,
21123            "invite_link": invite_link,
21124        });
21125        let response = send_request(client_id, request).await;
21126        if response["@type"] == "error" {
21127            return Err(serde_json::from_value(response).unwrap())
21128        }
21129        Ok(())
21130    }
21131    /// Deletes all revoked chat invite links created by a given chat administrator. Requires administrator privileges and can_invite_users right in the chat for own links and owner privileges for other links
21132    /// # Arguments
21133    /// * `chat_id` - Chat identifier
21134    /// * `creator_user_id` - User identifier of a chat administrator, which links will be deleted. Must be an identifier of the current user for non-owner
21135    /// * `client_id` - The client id to send the request to
21136    #[allow(clippy::too_many_arguments)]
21137    pub async fn delete_all_revoked_chat_invite_links(chat_id: i64, creator_user_id: i64, client_id: i32) -> Result<(), crate::types::Error> {
21138        let request = json!({
21139            "@type": "deleteAllRevokedChatInviteLinks",
21140            "chat_id": chat_id,
21141            "creator_user_id": creator_user_id,
21142        });
21143        let response = send_request(client_id, request).await;
21144        if response["@type"] == "error" {
21145            return Err(serde_json::from_value(response).unwrap())
21146        }
21147        Ok(())
21148    }
21149    /// Checks the validity of an invite link for a chat and returns information about the corresponding chat
21150    /// # Arguments
21151    /// * `invite_link` - Invite link to be checked
21152    /// * `client_id` - The client id to send the request to
21153    #[allow(clippy::too_many_arguments)]
21154    pub async fn check_chat_invite_link(invite_link: String, client_id: i32) -> Result<crate::enums::ChatInviteLinkInfo, crate::types::Error> {
21155        let request = json!({
21156            "@type": "checkChatInviteLink",
21157            "invite_link": invite_link,
21158        });
21159        let response = send_request(client_id, request).await;
21160        if response["@type"] == "error" {
21161            return Err(serde_json::from_value(response).unwrap())
21162        }
21163        Ok(serde_json::from_value(response).unwrap())
21164    }
21165    /// Uses an invite link to add the current user to the chat if possible. May return an error with a message "INVITE_REQUEST_SENT" if only a join request was created
21166    /// # Arguments
21167    /// * `invite_link` - Invite link to use
21168    /// * `client_id` - The client id to send the request to
21169    #[allow(clippy::too_many_arguments)]
21170    pub async fn join_chat_by_invite_link(invite_link: String, client_id: i32) -> Result<crate::enums::Chat, crate::types::Error> {
21171        let request = json!({
21172            "@type": "joinChatByInviteLink",
21173            "invite_link": invite_link,
21174        });
21175        let response = send_request(client_id, request).await;
21176        if response["@type"] == "error" {
21177            return Err(serde_json::from_value(response).unwrap())
21178        }
21179        Ok(serde_json::from_value(response).unwrap())
21180    }
21181    /// Returns pending join requests in a chat
21182    /// # Arguments
21183    /// * `chat_id` - Chat identifier
21184    /// * `invite_link` - Invite link for which to return join requests. If empty, all join requests will be returned. Requires administrator privileges and can_invite_users right in the chat for own links and owner privileges for other links
21185    /// * `query` - A query to search for in the first names, last names and usernames of the users to return
21186    /// * `offset_request` - A chat join request from which to return next requests; pass null to get results from the beginning
21187    /// * `limit` - The maximum number of requests to join the chat to return
21188    /// * `client_id` - The client id to send the request to
21189    #[allow(clippy::too_many_arguments)]
21190    pub async fn get_chat_join_requests(chat_id: i64, invite_link: String, query: String, offset_request: Option<crate::types::ChatJoinRequest>, limit: i32, client_id: i32) -> Result<crate::enums::ChatJoinRequests, crate::types::Error> {
21191        let request = json!({
21192            "@type": "getChatJoinRequests",
21193            "chat_id": chat_id,
21194            "invite_link": invite_link,
21195            "query": query,
21196            "offset_request": offset_request,
21197            "limit": limit,
21198        });
21199        let response = send_request(client_id, request).await;
21200        if response["@type"] == "error" {
21201            return Err(serde_json::from_value(response).unwrap())
21202        }
21203        Ok(serde_json::from_value(response).unwrap())
21204    }
21205    /// Handles a pending join request in a chat
21206    /// # Arguments
21207    /// * `chat_id` - Chat identifier
21208    /// * `user_id` - Identifier of the user that sent the request
21209    /// * `approve` - Pass true to approve the request; pass false to decline it
21210    /// * `client_id` - The client id to send the request to
21211    #[allow(clippy::too_many_arguments)]
21212    pub async fn process_chat_join_request(chat_id: i64, user_id: i64, approve: bool, client_id: i32) -> Result<(), crate::types::Error> {
21213        let request = json!({
21214            "@type": "processChatJoinRequest",
21215            "chat_id": chat_id,
21216            "user_id": user_id,
21217            "approve": approve,
21218        });
21219        let response = send_request(client_id, request).await;
21220        if response["@type"] == "error" {
21221            return Err(serde_json::from_value(response).unwrap())
21222        }
21223        Ok(())
21224    }
21225    /// Handles all pending join requests for a given link in a chat
21226    /// # Arguments
21227    /// * `chat_id` - Chat identifier
21228    /// * `invite_link` - Invite link for which to process join requests. If empty, all join requests will be processed. Requires administrator privileges and can_invite_users right in the chat for own links and owner privileges for other links
21229    /// * `approve` - Pass true to approve all requests; pass false to decline them
21230    /// * `client_id` - The client id to send the request to
21231    #[allow(clippy::too_many_arguments)]
21232    pub async fn process_chat_join_requests(chat_id: i64, invite_link: String, approve: bool, client_id: i32) -> Result<(), crate::types::Error> {
21233        let request = json!({
21234            "@type": "processChatJoinRequests",
21235            "chat_id": chat_id,
21236            "invite_link": invite_link,
21237            "approve": approve,
21238        });
21239        let response = send_request(client_id, request).await;
21240        if response["@type"] == "error" {
21241            return Err(serde_json::from_value(response).unwrap())
21242        }
21243        Ok(())
21244    }
21245    /// Creates a new call
21246    /// # Arguments
21247    /// * `user_id` - Identifier of the user to be called
21248    /// * `protocol` - The call protocols supported by the application
21249    /// * `is_video` - Pass true to create a video call
21250    /// * `client_id` - The client id to send the request to
21251    #[allow(clippy::too_many_arguments)]
21252    pub async fn create_call(user_id: i64, protocol: crate::types::CallProtocol, is_video: bool, client_id: i32) -> Result<crate::enums::CallId, crate::types::Error> {
21253        let request = json!({
21254            "@type": "createCall",
21255            "user_id": user_id,
21256            "protocol": protocol,
21257            "is_video": is_video,
21258        });
21259        let response = send_request(client_id, request).await;
21260        if response["@type"] == "error" {
21261            return Err(serde_json::from_value(response).unwrap())
21262        }
21263        Ok(serde_json::from_value(response).unwrap())
21264    }
21265    /// Accepts an incoming call
21266    /// # Arguments
21267    /// * `call_id` - Call identifier
21268    /// * `protocol` - The call protocols supported by the application
21269    /// * `client_id` - The client id to send the request to
21270    #[allow(clippy::too_many_arguments)]
21271    pub async fn accept_call(call_id: i32, protocol: crate::types::CallProtocol, client_id: i32) -> Result<(), crate::types::Error> {
21272        let request = json!({
21273            "@type": "acceptCall",
21274            "call_id": call_id,
21275            "protocol": protocol,
21276        });
21277        let response = send_request(client_id, request).await;
21278        if response["@type"] == "error" {
21279            return Err(serde_json::from_value(response).unwrap())
21280        }
21281        Ok(())
21282    }
21283    /// Sends call signaling data
21284    /// # Arguments
21285    /// * `call_id` - Call identifier
21286    /// * `data` - The data
21287    /// * `client_id` - The client id to send the request to
21288    #[allow(clippy::too_many_arguments)]
21289    pub async fn send_call_signaling_data(call_id: i32, data: String, client_id: i32) -> Result<(), crate::types::Error> {
21290        let request = json!({
21291            "@type": "sendCallSignalingData",
21292            "call_id": call_id,
21293            "data": data,
21294        });
21295        let response = send_request(client_id, request).await;
21296        if response["@type"] == "error" {
21297            return Err(serde_json::from_value(response).unwrap())
21298        }
21299        Ok(())
21300    }
21301    /// Discards a call
21302    /// # Arguments
21303    /// * `call_id` - Call identifier
21304    /// * `is_disconnected` - Pass true if the user was disconnected
21305    /// * `duration` - The call duration, in seconds
21306    /// * `is_video` - Pass true if the call was a video call
21307    /// * `connection_id` - Identifier of the connection used during the call
21308    /// * `client_id` - The client id to send the request to
21309    #[allow(clippy::too_many_arguments)]
21310    pub async fn discard_call(call_id: i32, is_disconnected: bool, duration: i32, is_video: bool, connection_id: i64, client_id: i32) -> Result<(), crate::types::Error> {
21311        let request = json!({
21312            "@type": "discardCall",
21313            "call_id": call_id,
21314            "is_disconnected": is_disconnected,
21315            "duration": duration,
21316            "is_video": is_video,
21317            "connection_id": connection_id,
21318        });
21319        let response = send_request(client_id, request).await;
21320        if response["@type"] == "error" {
21321            return Err(serde_json::from_value(response).unwrap())
21322        }
21323        Ok(())
21324    }
21325    /// Sends a call rating
21326    /// # Arguments
21327    /// * `call_id` - Call identifier
21328    /// * `rating` - Call rating; 1-5
21329    /// * `comment` - An optional user comment if the rating is less than 5
21330    /// * `problems` - List of the exact types of problems with the call, specified by the user
21331    /// * `client_id` - The client id to send the request to
21332    #[allow(clippy::too_many_arguments)]
21333    pub async fn send_call_rating(call_id: i32, rating: i32, comment: String, problems: Vec<crate::enums::CallProblem>, client_id: i32) -> Result<(), crate::types::Error> {
21334        let request = json!({
21335            "@type": "sendCallRating",
21336            "call_id": call_id,
21337            "rating": rating,
21338            "comment": comment,
21339            "problems": problems,
21340        });
21341        let response = send_request(client_id, request).await;
21342        if response["@type"] == "error" {
21343            return Err(serde_json::from_value(response).unwrap())
21344        }
21345        Ok(())
21346    }
21347    /// Sends debug information for a call to Telegram servers
21348    /// # Arguments
21349    /// * `call_id` - Call identifier
21350    /// * `debug_information` - Debug information in application-specific format
21351    /// * `client_id` - The client id to send the request to
21352    #[allow(clippy::too_many_arguments)]
21353    pub async fn send_call_debug_information(call_id: i32, debug_information: String, client_id: i32) -> Result<(), crate::types::Error> {
21354        let request = json!({
21355            "@type": "sendCallDebugInformation",
21356            "call_id": call_id,
21357            "debug_information": debug_information,
21358        });
21359        let response = send_request(client_id, request).await;
21360        if response["@type"] == "error" {
21361            return Err(serde_json::from_value(response).unwrap())
21362        }
21363        Ok(())
21364    }
21365    /// Sends log file for a call to Telegram servers
21366    /// # Arguments
21367    /// * `call_id` - Call identifier
21368    /// * `log_file` - Call log file. Only inputFileLocal and inputFileGenerated are supported
21369    /// * `client_id` - The client id to send the request to
21370    #[allow(clippy::too_many_arguments)]
21371    pub async fn send_call_log(call_id: i32, log_file: crate::enums::InputFile, client_id: i32) -> Result<(), crate::types::Error> {
21372        let request = json!({
21373            "@type": "sendCallLog",
21374            "call_id": call_id,
21375            "log_file": log_file,
21376        });
21377        let response = send_request(client_id, request).await;
21378        if response["@type"] == "error" {
21379            return Err(serde_json::from_value(response).unwrap())
21380        }
21381        Ok(())
21382    }
21383    /// Returns list of participant identifiers, on whose behalf a video chat in the chat can be joined
21384    /// # Arguments
21385    /// * `chat_id` - Chat identifier
21386    /// * `client_id` - The client id to send the request to
21387    #[allow(clippy::too_many_arguments)]
21388    pub async fn get_video_chat_available_participants(chat_id: i64, client_id: i32) -> Result<crate::enums::MessageSenders, crate::types::Error> {
21389        let request = json!({
21390            "@type": "getVideoChatAvailableParticipants",
21391            "chat_id": chat_id,
21392        });
21393        let response = send_request(client_id, request).await;
21394        if response["@type"] == "error" {
21395            return Err(serde_json::from_value(response).unwrap())
21396        }
21397        Ok(serde_json::from_value(response).unwrap())
21398    }
21399    /// Changes default participant identifier, on whose behalf a video chat in the chat will be joined
21400    /// # Arguments
21401    /// * `chat_id` - Chat identifier
21402    /// * `default_participant_id` - Default group call participant identifier to join the video chats
21403    /// * `client_id` - The client id to send the request to
21404    #[allow(clippy::too_many_arguments)]
21405    pub async fn set_video_chat_default_participant(chat_id: i64, default_participant_id: crate::enums::MessageSender, client_id: i32) -> Result<(), crate::types::Error> {
21406        let request = json!({
21407            "@type": "setVideoChatDefaultParticipant",
21408            "chat_id": chat_id,
21409            "default_participant_id": default_participant_id,
21410        });
21411        let response = send_request(client_id, request).await;
21412        if response["@type"] == "error" {
21413            return Err(serde_json::from_value(response).unwrap())
21414        }
21415        Ok(())
21416    }
21417    /// Creates a video chat (a group call bound to a chat). Available only for basic groups, supergroups and channels; requires can_manage_video_chats rights
21418    /// # Arguments
21419    /// * `chat_id` - Identifier of a chat in which the video chat will be created
21420    /// * `title` - Group call title; if empty, chat title will be used
21421    /// * `start_date` - Point in time (Unix timestamp) when the group call is supposed to be started by an administrator; 0 to start the video chat immediately. The date must be at least 10 seconds and at most 8 days in the future
21422    /// * `is_rtmp_stream` - Pass true to create an RTMP stream instead of an ordinary video chat; requires creator privileges
21423    /// * `client_id` - The client id to send the request to
21424    #[allow(clippy::too_many_arguments)]
21425    pub async fn create_video_chat(chat_id: i64, title: String, start_date: i32, is_rtmp_stream: bool, client_id: i32) -> Result<crate::enums::GroupCallId, crate::types::Error> {
21426        let request = json!({
21427            "@type": "createVideoChat",
21428            "chat_id": chat_id,
21429            "title": title,
21430            "start_date": start_date,
21431            "is_rtmp_stream": is_rtmp_stream,
21432        });
21433        let response = send_request(client_id, request).await;
21434        if response["@type"] == "error" {
21435            return Err(serde_json::from_value(response).unwrap())
21436        }
21437        Ok(serde_json::from_value(response).unwrap())
21438    }
21439    /// Returns RTMP URL for streaming to the chat; requires creator privileges
21440    /// # Arguments
21441    /// * `chat_id` - Chat identifier
21442    /// * `client_id` - The client id to send the request to
21443    #[allow(clippy::too_many_arguments)]
21444    pub async fn get_video_chat_rtmp_url(chat_id: i64, client_id: i32) -> Result<crate::enums::RtmpUrl, crate::types::Error> {
21445        let request = json!({
21446            "@type": "getVideoChatRtmpUrl",
21447            "chat_id": chat_id,
21448        });
21449        let response = send_request(client_id, request).await;
21450        if response["@type"] == "error" {
21451            return Err(serde_json::from_value(response).unwrap())
21452        }
21453        Ok(serde_json::from_value(response).unwrap())
21454    }
21455    /// Replaces the current RTMP URL for streaming to the chat; requires creator privileges
21456    /// # Arguments
21457    /// * `chat_id` - Chat identifier
21458    /// * `client_id` - The client id to send the request to
21459    #[allow(clippy::too_many_arguments)]
21460    pub async fn replace_video_chat_rtmp_url(chat_id: i64, client_id: i32) -> Result<crate::enums::RtmpUrl, crate::types::Error> {
21461        let request = json!({
21462            "@type": "replaceVideoChatRtmpUrl",
21463            "chat_id": chat_id,
21464        });
21465        let response = send_request(client_id, request).await;
21466        if response["@type"] == "error" {
21467            return Err(serde_json::from_value(response).unwrap())
21468        }
21469        Ok(serde_json::from_value(response).unwrap())
21470    }
21471    /// Returns information about a group call
21472    /// # Arguments
21473    /// * `group_call_id` - Group call identifier
21474    /// * `client_id` - The client id to send the request to
21475    #[allow(clippy::too_many_arguments)]
21476    pub async fn get_group_call(group_call_id: i32, client_id: i32) -> Result<crate::enums::GroupCall, crate::types::Error> {
21477        let request = json!({
21478            "@type": "getGroupCall",
21479            "group_call_id": group_call_id,
21480        });
21481        let response = send_request(client_id, request).await;
21482        if response["@type"] == "error" {
21483            return Err(serde_json::from_value(response).unwrap())
21484        }
21485        Ok(serde_json::from_value(response).unwrap())
21486    }
21487    /// Starts a scheduled group call
21488    /// # Arguments
21489    /// * `group_call_id` - Group call identifier
21490    /// * `client_id` - The client id to send the request to
21491    #[allow(clippy::too_many_arguments)]
21492    pub async fn start_scheduled_group_call(group_call_id: i32, client_id: i32) -> Result<(), crate::types::Error> {
21493        let request = json!({
21494            "@type": "startScheduledGroupCall",
21495            "group_call_id": group_call_id,
21496        });
21497        let response = send_request(client_id, request).await;
21498        if response["@type"] == "error" {
21499            return Err(serde_json::from_value(response).unwrap())
21500        }
21501        Ok(())
21502    }
21503    /// Toggles whether the current user will receive a notification when the group call will start; scheduled group calls only
21504    /// # Arguments
21505    /// * `group_call_id` - Group call identifier
21506    /// * `enabled_start_notification` - New value of the enabled_start_notification setting
21507    /// * `client_id` - The client id to send the request to
21508    #[allow(clippy::too_many_arguments)]
21509    pub async fn toggle_group_call_enabled_start_notification(group_call_id: i32, enabled_start_notification: bool, client_id: i32) -> Result<(), crate::types::Error> {
21510        let request = json!({
21511            "@type": "toggleGroupCallEnabledStartNotification",
21512            "group_call_id": group_call_id,
21513            "enabled_start_notification": enabled_start_notification,
21514        });
21515        let response = send_request(client_id, request).await;
21516        if response["@type"] == "error" {
21517            return Err(serde_json::from_value(response).unwrap())
21518        }
21519        Ok(())
21520    }
21521    /// Joins an active group call. Returns join response payload for tgcalls
21522    /// # Arguments
21523    /// * `group_call_id` - Group call identifier
21524    /// * `participant_id` - Identifier of a group call participant, which will be used to join the call; pass null to join as self; video chats only
21525    /// * `audio_source_id` - Caller audio channel synchronization source identifier; received from tgcalls
21526    /// * `payload` - Group call join payload; received from tgcalls
21527    /// * `is_muted` - Pass true to join the call with muted microphone
21528    /// * `is_my_video_enabled` - Pass true if the user's video is enabled
21529    /// * `invite_hash` - If non-empty, invite hash to be used to join the group call without being muted by administrators
21530    /// * `client_id` - The client id to send the request to
21531    #[allow(clippy::too_many_arguments)]
21532    pub async fn join_group_call(group_call_id: i32, participant_id: Option<crate::enums::MessageSender>, audio_source_id: i32, payload: String, is_muted: bool, is_my_video_enabled: bool, invite_hash: String, client_id: i32) -> Result<crate::enums::Text, crate::types::Error> {
21533        let request = json!({
21534            "@type": "joinGroupCall",
21535            "group_call_id": group_call_id,
21536            "participant_id": participant_id,
21537            "audio_source_id": audio_source_id,
21538            "payload": payload,
21539            "is_muted": is_muted,
21540            "is_my_video_enabled": is_my_video_enabled,
21541            "invite_hash": invite_hash,
21542        });
21543        let response = send_request(client_id, request).await;
21544        if response["@type"] == "error" {
21545            return Err(serde_json::from_value(response).unwrap())
21546        }
21547        Ok(serde_json::from_value(response).unwrap())
21548    }
21549    /// Starts screen sharing in a joined group call. Returns join response payload for tgcalls
21550    /// # Arguments
21551    /// * `group_call_id` - Group call identifier
21552    /// * `audio_source_id` - Screen sharing audio channel synchronization source identifier; received from tgcalls
21553    /// * `payload` - Group call join payload; received from tgcalls
21554    /// * `client_id` - The client id to send the request to
21555    #[allow(clippy::too_many_arguments)]
21556    pub async fn start_group_call_screen_sharing(group_call_id: i32, audio_source_id: i32, payload: String, client_id: i32) -> Result<crate::enums::Text, crate::types::Error> {
21557        let request = json!({
21558            "@type": "startGroupCallScreenSharing",
21559            "group_call_id": group_call_id,
21560            "audio_source_id": audio_source_id,
21561            "payload": payload,
21562        });
21563        let response = send_request(client_id, request).await;
21564        if response["@type"] == "error" {
21565            return Err(serde_json::from_value(response).unwrap())
21566        }
21567        Ok(serde_json::from_value(response).unwrap())
21568    }
21569    /// Pauses or unpauses screen sharing in a joined group call
21570    /// # Arguments
21571    /// * `group_call_id` - Group call identifier
21572    /// * `is_paused` - Pass true to pause screen sharing; pass false to unpause it
21573    /// * `client_id` - The client id to send the request to
21574    #[allow(clippy::too_many_arguments)]
21575    pub async fn toggle_group_call_screen_sharing_is_paused(group_call_id: i32, is_paused: bool, client_id: i32) -> Result<(), crate::types::Error> {
21576        let request = json!({
21577            "@type": "toggleGroupCallScreenSharingIsPaused",
21578            "group_call_id": group_call_id,
21579            "is_paused": is_paused,
21580        });
21581        let response = send_request(client_id, request).await;
21582        if response["@type"] == "error" {
21583            return Err(serde_json::from_value(response).unwrap())
21584        }
21585        Ok(())
21586    }
21587    /// Ends screen sharing in a joined group call
21588    /// # Arguments
21589    /// * `group_call_id` - Group call identifier
21590    /// * `client_id` - The client id to send the request to
21591    #[allow(clippy::too_many_arguments)]
21592    pub async fn end_group_call_screen_sharing(group_call_id: i32, client_id: i32) -> Result<(), crate::types::Error> {
21593        let request = json!({
21594            "@type": "endGroupCallScreenSharing",
21595            "group_call_id": group_call_id,
21596        });
21597        let response = send_request(client_id, request).await;
21598        if response["@type"] == "error" {
21599            return Err(serde_json::from_value(response).unwrap())
21600        }
21601        Ok(())
21602    }
21603    /// Sets group call title. Requires groupCall.can_be_managed group call flag
21604    /// # Arguments
21605    /// * `group_call_id` - Group call identifier
21606    /// * `title` - New group call title; 1-64 characters
21607    /// * `client_id` - The client id to send the request to
21608    #[allow(clippy::too_many_arguments)]
21609    pub async fn set_group_call_title(group_call_id: i32, title: String, client_id: i32) -> Result<(), crate::types::Error> {
21610        let request = json!({
21611            "@type": "setGroupCallTitle",
21612            "group_call_id": group_call_id,
21613            "title": title,
21614        });
21615        let response = send_request(client_id, request).await;
21616        if response["@type"] == "error" {
21617            return Err(serde_json::from_value(response).unwrap())
21618        }
21619        Ok(())
21620    }
21621    /// Toggles whether new participants of a group call can be unmuted only by administrators of the group call. Requires groupCall.can_toggle_mute_new_participants group call flag
21622    /// # Arguments
21623    /// * `group_call_id` - Group call identifier
21624    /// * `mute_new_participants` - New value of the mute_new_participants setting
21625    /// * `client_id` - The client id to send the request to
21626    #[allow(clippy::too_many_arguments)]
21627    pub async fn toggle_group_call_mute_new_participants(group_call_id: i32, mute_new_participants: bool, client_id: i32) -> Result<(), crate::types::Error> {
21628        let request = json!({
21629            "@type": "toggleGroupCallMuteNewParticipants",
21630            "group_call_id": group_call_id,
21631            "mute_new_participants": mute_new_participants,
21632        });
21633        let response = send_request(client_id, request).await;
21634        if response["@type"] == "error" {
21635            return Err(serde_json::from_value(response).unwrap())
21636        }
21637        Ok(())
21638    }
21639    /// Invites users to an active group call. Sends a service message of type messageInviteVideoChatParticipants for video chats
21640    /// # Arguments
21641    /// * `group_call_id` - Group call identifier
21642    /// * `user_ids` - User identifiers. At most 10 users can be invited simultaneously
21643    /// * `client_id` - The client id to send the request to
21644    #[allow(clippy::too_many_arguments)]
21645    pub async fn invite_group_call_participants(group_call_id: i32, user_ids: Vec<i64>, client_id: i32) -> Result<(), crate::types::Error> {
21646        let request = json!({
21647            "@type": "inviteGroupCallParticipants",
21648            "group_call_id": group_call_id,
21649            "user_ids": user_ids,
21650        });
21651        let response = send_request(client_id, request).await;
21652        if response["@type"] == "error" {
21653            return Err(serde_json::from_value(response).unwrap())
21654        }
21655        Ok(())
21656    }
21657    /// Returns invite link to a video chat in a public chat
21658    /// # Arguments
21659    /// * `group_call_id` - Group call identifier
21660    /// * `can_self_unmute` - Pass true if the invite link needs to contain an invite hash, passing which to joinGroupCall would allow the invited user to unmute themselves. Requires groupCall.can_be_managed group call flag
21661    /// * `client_id` - The client id to send the request to
21662    #[allow(clippy::too_many_arguments)]
21663    pub async fn get_group_call_invite_link(group_call_id: i32, can_self_unmute: bool, client_id: i32) -> Result<crate::enums::HttpUrl, crate::types::Error> {
21664        let request = json!({
21665            "@type": "getGroupCallInviteLink",
21666            "group_call_id": group_call_id,
21667            "can_self_unmute": can_self_unmute,
21668        });
21669        let response = send_request(client_id, request).await;
21670        if response["@type"] == "error" {
21671            return Err(serde_json::from_value(response).unwrap())
21672        }
21673        Ok(serde_json::from_value(response).unwrap())
21674    }
21675    /// Revokes invite link for a group call. Requires groupCall.can_be_managed group call flag
21676    /// # Arguments
21677    /// * `group_call_id` - Group call identifier
21678    /// * `client_id` - The client id to send the request to
21679    #[allow(clippy::too_many_arguments)]
21680    pub async fn revoke_group_call_invite_link(group_call_id: i32, client_id: i32) -> Result<(), crate::types::Error> {
21681        let request = json!({
21682            "@type": "revokeGroupCallInviteLink",
21683            "group_call_id": group_call_id,
21684        });
21685        let response = send_request(client_id, request).await;
21686        if response["@type"] == "error" {
21687            return Err(serde_json::from_value(response).unwrap())
21688        }
21689        Ok(())
21690    }
21691    /// Starts recording of an active group call. Requires groupCall.can_be_managed group call flag
21692    /// # Arguments
21693    /// * `group_call_id` - Group call identifier
21694    /// * `title` - Group call recording title; 0-64 characters
21695    /// * `record_video` - Pass true to record a video file instead of an audio file
21696    /// * `use_portrait_orientation` - Pass true to use portrait orientation for video instead of landscape one
21697    /// * `client_id` - The client id to send the request to
21698    #[allow(clippy::too_many_arguments)]
21699    pub async fn start_group_call_recording(group_call_id: i32, title: String, record_video: bool, use_portrait_orientation: bool, client_id: i32) -> Result<(), crate::types::Error> {
21700        let request = json!({
21701            "@type": "startGroupCallRecording",
21702            "group_call_id": group_call_id,
21703            "title": title,
21704            "record_video": record_video,
21705            "use_portrait_orientation": use_portrait_orientation,
21706        });
21707        let response = send_request(client_id, request).await;
21708        if response["@type"] == "error" {
21709            return Err(serde_json::from_value(response).unwrap())
21710        }
21711        Ok(())
21712    }
21713    /// Ends recording of an active group call. Requires groupCall.can_be_managed group call flag
21714    /// # Arguments
21715    /// * `group_call_id` - Group call identifier
21716    /// * `client_id` - The client id to send the request to
21717    #[allow(clippy::too_many_arguments)]
21718    pub async fn end_group_call_recording(group_call_id: i32, client_id: i32) -> Result<(), crate::types::Error> {
21719        let request = json!({
21720            "@type": "endGroupCallRecording",
21721            "group_call_id": group_call_id,
21722        });
21723        let response = send_request(client_id, request).await;
21724        if response["@type"] == "error" {
21725            return Err(serde_json::from_value(response).unwrap())
21726        }
21727        Ok(())
21728    }
21729    /// Toggles whether current user's video is paused
21730    /// # Arguments
21731    /// * `group_call_id` - Group call identifier
21732    /// * `is_my_video_paused` - Pass true if the current user's video is paused
21733    /// * `client_id` - The client id to send the request to
21734    #[allow(clippy::too_many_arguments)]
21735    pub async fn toggle_group_call_is_my_video_paused(group_call_id: i32, is_my_video_paused: bool, client_id: i32) -> Result<(), crate::types::Error> {
21736        let request = json!({
21737            "@type": "toggleGroupCallIsMyVideoPaused",
21738            "group_call_id": group_call_id,
21739            "is_my_video_paused": is_my_video_paused,
21740        });
21741        let response = send_request(client_id, request).await;
21742        if response["@type"] == "error" {
21743            return Err(serde_json::from_value(response).unwrap())
21744        }
21745        Ok(())
21746    }
21747    /// Toggles whether current user's video is enabled
21748    /// # Arguments
21749    /// * `group_call_id` - Group call identifier
21750    /// * `is_my_video_enabled` - Pass true if the current user's video is enabled
21751    /// * `client_id` - The client id to send the request to
21752    #[allow(clippy::too_many_arguments)]
21753    pub async fn toggle_group_call_is_my_video_enabled(group_call_id: i32, is_my_video_enabled: bool, client_id: i32) -> Result<(), crate::types::Error> {
21754        let request = json!({
21755            "@type": "toggleGroupCallIsMyVideoEnabled",
21756            "group_call_id": group_call_id,
21757            "is_my_video_enabled": is_my_video_enabled,
21758        });
21759        let response = send_request(client_id, request).await;
21760        if response["@type"] == "error" {
21761            return Err(serde_json::from_value(response).unwrap())
21762        }
21763        Ok(())
21764    }
21765    /// Informs TDLib that speaking state of a participant of an active group has changed
21766    /// # Arguments
21767    /// * `group_call_id` - Group call identifier
21768    /// * `audio_source` - Group call participant's synchronization audio source identifier, or 0 for the current user
21769    /// * `is_speaking` - Pass true if the user is speaking
21770    /// * `client_id` - The client id to send the request to
21771    #[allow(clippy::too_many_arguments)]
21772    pub async fn set_group_call_participant_is_speaking(group_call_id: i32, audio_source: i32, is_speaking: bool, client_id: i32) -> Result<(), crate::types::Error> {
21773        let request = json!({
21774            "@type": "setGroupCallParticipantIsSpeaking",
21775            "group_call_id": group_call_id,
21776            "audio_source": audio_source,
21777            "is_speaking": is_speaking,
21778        });
21779        let response = send_request(client_id, request).await;
21780        if response["@type"] == "error" {
21781            return Err(serde_json::from_value(response).unwrap())
21782        }
21783        Ok(())
21784    }
21785    /// Toggles whether a participant of an active group call is muted, unmuted, or allowed to unmute themselves
21786    /// # Arguments
21787    /// * `group_call_id` - Group call identifier
21788    /// * `participant_id` - Participant identifier
21789    /// * `is_muted` - Pass true to mute the user; pass false to unmute them
21790    /// * `client_id` - The client id to send the request to
21791    #[allow(clippy::too_many_arguments)]
21792    pub async fn toggle_group_call_participant_is_muted(group_call_id: i32, participant_id: crate::enums::MessageSender, is_muted: bool, client_id: i32) -> Result<(), crate::types::Error> {
21793        let request = json!({
21794            "@type": "toggleGroupCallParticipantIsMuted",
21795            "group_call_id": group_call_id,
21796            "participant_id": participant_id,
21797            "is_muted": is_muted,
21798        });
21799        let response = send_request(client_id, request).await;
21800        if response["@type"] == "error" {
21801            return Err(serde_json::from_value(response).unwrap())
21802        }
21803        Ok(())
21804    }
21805    /// Changes volume level of a participant of an active group call. If the current user can manage the group call, then the participant's volume level will be changed for all users with the default volume level
21806    /// # Arguments
21807    /// * `group_call_id` - Group call identifier
21808    /// * `participant_id` - Participant identifier
21809    /// * `volume_level` - New participant's volume level; 1-20000 in hundreds of percents
21810    /// * `client_id` - The client id to send the request to
21811    #[allow(clippy::too_many_arguments)]
21812    pub async fn set_group_call_participant_volume_level(group_call_id: i32, participant_id: crate::enums::MessageSender, volume_level: i32, client_id: i32) -> Result<(), crate::types::Error> {
21813        let request = json!({
21814            "@type": "setGroupCallParticipantVolumeLevel",
21815            "group_call_id": group_call_id,
21816            "participant_id": participant_id,
21817            "volume_level": volume_level,
21818        });
21819        let response = send_request(client_id, request).await;
21820        if response["@type"] == "error" {
21821            return Err(serde_json::from_value(response).unwrap())
21822        }
21823        Ok(())
21824    }
21825    /// Toggles whether a group call participant hand is rased
21826    /// # Arguments
21827    /// * `group_call_id` - Group call identifier
21828    /// * `participant_id` - Participant identifier
21829    /// * `is_hand_raised` - Pass true if the user's hand needs to be raised. Only self hand can be raised. Requires groupCall.can_be_managed group call flag to lower other's hand
21830    /// * `client_id` - The client id to send the request to
21831    #[allow(clippy::too_many_arguments)]
21832    pub async fn toggle_group_call_participant_is_hand_raised(group_call_id: i32, participant_id: crate::enums::MessageSender, is_hand_raised: bool, client_id: i32) -> Result<(), crate::types::Error> {
21833        let request = json!({
21834            "@type": "toggleGroupCallParticipantIsHandRaised",
21835            "group_call_id": group_call_id,
21836            "participant_id": participant_id,
21837            "is_hand_raised": is_hand_raised,
21838        });
21839        let response = send_request(client_id, request).await;
21840        if response["@type"] == "error" {
21841            return Err(serde_json::from_value(response).unwrap())
21842        }
21843        Ok(())
21844    }
21845    /// Loads more participants of a group call. The loaded participants will be received through updates. Use the field groupCall.loaded_all_participants to check whether all participants have already been loaded
21846    /// # Arguments
21847    /// * `group_call_id` - Group call identifier. The group call must be previously received through getGroupCall and must be joined or being joined
21848    /// * `limit` - The maximum number of participants to load; up to 100
21849    /// * `client_id` - The client id to send the request to
21850    #[allow(clippy::too_many_arguments)]
21851    pub async fn load_group_call_participants(group_call_id: i32, limit: i32, client_id: i32) -> Result<(), crate::types::Error> {
21852        let request = json!({
21853            "@type": "loadGroupCallParticipants",
21854            "group_call_id": group_call_id,
21855            "limit": limit,
21856        });
21857        let response = send_request(client_id, request).await;
21858        if response["@type"] == "error" {
21859            return Err(serde_json::from_value(response).unwrap())
21860        }
21861        Ok(())
21862    }
21863    /// Leaves a group call
21864    /// # Arguments
21865    /// * `group_call_id` - Group call identifier
21866    /// * `client_id` - The client id to send the request to
21867    #[allow(clippy::too_many_arguments)]
21868    pub async fn leave_group_call(group_call_id: i32, client_id: i32) -> Result<(), crate::types::Error> {
21869        let request = json!({
21870            "@type": "leaveGroupCall",
21871            "group_call_id": group_call_id,
21872        });
21873        let response = send_request(client_id, request).await;
21874        if response["@type"] == "error" {
21875            return Err(serde_json::from_value(response).unwrap())
21876        }
21877        Ok(())
21878    }
21879    /// Ends a group call. Requires groupCall.can_be_managed
21880    /// # Arguments
21881    /// * `group_call_id` - Group call identifier
21882    /// * `client_id` - The client id to send the request to
21883    #[allow(clippy::too_many_arguments)]
21884    pub async fn end_group_call(group_call_id: i32, client_id: i32) -> Result<(), crate::types::Error> {
21885        let request = json!({
21886            "@type": "endGroupCall",
21887            "group_call_id": group_call_id,
21888        });
21889        let response = send_request(client_id, request).await;
21890        if response["@type"] == "error" {
21891            return Err(serde_json::from_value(response).unwrap())
21892        }
21893        Ok(())
21894    }
21895    /// Returns information about available group call streams
21896    /// # Arguments
21897    /// * `group_call_id` - Group call identifier
21898    /// * `client_id` - The client id to send the request to
21899    #[allow(clippy::too_many_arguments)]
21900    pub async fn get_group_call_streams(group_call_id: i32, client_id: i32) -> Result<crate::enums::GroupCallStreams, crate::types::Error> {
21901        let request = json!({
21902            "@type": "getGroupCallStreams",
21903            "group_call_id": group_call_id,
21904        });
21905        let response = send_request(client_id, request).await;
21906        if response["@type"] == "error" {
21907            return Err(serde_json::from_value(response).unwrap())
21908        }
21909        Ok(serde_json::from_value(response).unwrap())
21910    }
21911    /// Returns a file with a segment of a group call stream in a modified OGG format for audio or MPEG-4 format for video
21912    /// # Arguments
21913    /// * `group_call_id` - Group call identifier
21914    /// * `time_offset` - Point in time when the stream segment begins; Unix timestamp in milliseconds
21915    /// * `scale` - Segment duration scale; 0-1. Segment's duration is 1000/(2**scale) milliseconds
21916    /// * `channel_id` - Identifier of an audio/video channel to get as received from tgcalls
21917    /// * `video_quality` - Video quality as received from tgcalls; pass null to get the worst available quality
21918    /// * `client_id` - The client id to send the request to
21919    #[allow(clippy::too_many_arguments)]
21920    pub async fn get_group_call_stream_segment(group_call_id: i32, time_offset: i64, scale: i32, channel_id: i32, video_quality: Option<crate::enums::GroupCallVideoQuality>, client_id: i32) -> Result<crate::enums::FilePart, crate::types::Error> {
21921        let request = json!({
21922            "@type": "getGroupCallStreamSegment",
21923            "group_call_id": group_call_id,
21924            "time_offset": time_offset,
21925            "scale": scale,
21926            "channel_id": channel_id,
21927            "video_quality": video_quality,
21928        });
21929        let response = send_request(client_id, request).await;
21930        if response["@type"] == "error" {
21931            return Err(serde_json::from_value(response).unwrap())
21932        }
21933        Ok(serde_json::from_value(response).unwrap())
21934    }
21935    /// Changes the block list of a message sender. Currently, only users and supergroup chats can be blocked
21936    /// # Arguments
21937    /// * `sender_id` - Identifier of a message sender to block/unblock
21938    /// * `block_list` - New block list for the message sender; pass null to unblock the message sender
21939    /// * `client_id` - The client id to send the request to
21940    #[allow(clippy::too_many_arguments)]
21941    pub async fn set_message_sender_block_list(sender_id: crate::enums::MessageSender, block_list: Option<crate::enums::BlockList>, client_id: i32) -> Result<(), crate::types::Error> {
21942        let request = json!({
21943            "@type": "setMessageSenderBlockList",
21944            "sender_id": sender_id,
21945            "block_list": block_list,
21946        });
21947        let response = send_request(client_id, request).await;
21948        if response["@type"] == "error" {
21949            return Err(serde_json::from_value(response).unwrap())
21950        }
21951        Ok(())
21952    }
21953    /// Blocks an original sender of a message in the Replies chat
21954    /// # Arguments
21955    /// * `message_id` - The identifier of an incoming message in the Replies chat
21956    /// * `delete_message` - Pass true to delete the message
21957    /// * `delete_all_messages` - Pass true to delete all messages from the same sender
21958    /// * `report_spam` - Pass true to report the sender to the Telegram moderators
21959    /// * `client_id` - The client id to send the request to
21960    #[allow(clippy::too_many_arguments)]
21961    pub async fn block_message_sender_from_replies(message_id: i64, delete_message: bool, delete_all_messages: bool, report_spam: bool, client_id: i32) -> Result<(), crate::types::Error> {
21962        let request = json!({
21963            "@type": "blockMessageSenderFromReplies",
21964            "message_id": message_id,
21965            "delete_message": delete_message,
21966            "delete_all_messages": delete_all_messages,
21967            "report_spam": report_spam,
21968        });
21969        let response = send_request(client_id, request).await;
21970        if response["@type"] == "error" {
21971            return Err(serde_json::from_value(response).unwrap())
21972        }
21973        Ok(())
21974    }
21975    /// Returns users and chats that were blocked by the current user
21976    /// # Arguments
21977    /// * `block_list` - Block list from which to return users
21978    /// * `offset` - Number of users and chats to skip in the result; must be non-negative
21979    /// * `limit` - The maximum number of users and chats to return; up to 100
21980    /// * `client_id` - The client id to send the request to
21981    #[allow(clippy::too_many_arguments)]
21982    pub async fn get_blocked_message_senders(block_list: crate::enums::BlockList, offset: i32, limit: i32, client_id: i32) -> Result<crate::enums::MessageSenders, crate::types::Error> {
21983        let request = json!({
21984            "@type": "getBlockedMessageSenders",
21985            "block_list": block_list,
21986            "offset": offset,
21987            "limit": limit,
21988        });
21989        let response = send_request(client_id, request).await;
21990        if response["@type"] == "error" {
21991            return Err(serde_json::from_value(response).unwrap())
21992        }
21993        Ok(serde_json::from_value(response).unwrap())
21994    }
21995    /// Adds a user to the contact list or edits an existing contact by their user identifier
21996    /// # Arguments
21997    /// * `contact` - The contact to add or edit; phone number may be empty and needs to be specified only if known, vCard is ignored
21998    /// * `share_phone_number` - Pass true to share the current user's phone number with the new contact. A corresponding rule to userPrivacySettingShowPhoneNumber will be added if needed.
21999    /// Use the field userFullInfo.need_phone_number_privacy_exception to check whether the current user needs to be asked to share their phone number
22000    /// * `client_id` - The client id to send the request to
22001    #[allow(clippy::too_many_arguments)]
22002    pub async fn add_contact(contact: crate::types::Contact, share_phone_number: bool, client_id: i32) -> Result<(), crate::types::Error> {
22003        let request = json!({
22004            "@type": "addContact",
22005            "contact": contact,
22006            "share_phone_number": share_phone_number,
22007        });
22008        let response = send_request(client_id, request).await;
22009        if response["@type"] == "error" {
22010            return Err(serde_json::from_value(response).unwrap())
22011        }
22012        Ok(())
22013    }
22014    /// Adds new contacts or edits existing contacts by their phone numbers; contacts' user identifiers are ignored
22015    /// # Arguments
22016    /// * `contacts` - The list of contacts to import or edit; contacts' vCard are ignored and are not imported
22017    /// * `client_id` - The client id to send the request to
22018    #[allow(clippy::too_many_arguments)]
22019    pub async fn import_contacts(contacts: Vec<crate::types::Contact>, client_id: i32) -> Result<crate::enums::ImportedContacts, crate::types::Error> {
22020        let request = json!({
22021            "@type": "importContacts",
22022            "contacts": contacts,
22023        });
22024        let response = send_request(client_id, request).await;
22025        if response["@type"] == "error" {
22026            return Err(serde_json::from_value(response).unwrap())
22027        }
22028        Ok(serde_json::from_value(response).unwrap())
22029    }
22030    /// Returns all contacts of the user
22031    /// # Arguments
22032    /// * `client_id` - The client id to send the request to
22033    #[allow(clippy::too_many_arguments)]
22034    pub async fn get_contacts(client_id: i32) -> Result<crate::enums::Users, crate::types::Error> {
22035        let request = json!({
22036            "@type": "getContacts",
22037        });
22038        let response = send_request(client_id, request).await;
22039        if response["@type"] == "error" {
22040            return Err(serde_json::from_value(response).unwrap())
22041        }
22042        Ok(serde_json::from_value(response).unwrap())
22043    }
22044    /// Searches for the specified query in the first names, last names and usernames of the known user contacts
22045    /// # Arguments
22046    /// * `query` - Query to search for; may be empty to return all contacts
22047    /// * `limit` - The maximum number of users to be returned
22048    /// * `client_id` - The client id to send the request to
22049    #[allow(clippy::too_many_arguments)]
22050    pub async fn search_contacts(query: String, limit: i32, client_id: i32) -> Result<crate::enums::Users, crate::types::Error> {
22051        let request = json!({
22052            "@type": "searchContacts",
22053            "query": query,
22054            "limit": limit,
22055        });
22056        let response = send_request(client_id, request).await;
22057        if response["@type"] == "error" {
22058            return Err(serde_json::from_value(response).unwrap())
22059        }
22060        Ok(serde_json::from_value(response).unwrap())
22061    }
22062    /// Removes users from the contact list
22063    /// # Arguments
22064    /// * `user_ids` - Identifiers of users to be deleted
22065    /// * `client_id` - The client id to send the request to
22066    #[allow(clippy::too_many_arguments)]
22067    pub async fn remove_contacts(user_ids: Vec<i64>, client_id: i32) -> Result<(), crate::types::Error> {
22068        let request = json!({
22069            "@type": "removeContacts",
22070            "user_ids": user_ids,
22071        });
22072        let response = send_request(client_id, request).await;
22073        if response["@type"] == "error" {
22074            return Err(serde_json::from_value(response).unwrap())
22075        }
22076        Ok(())
22077    }
22078    /// Returns the total number of imported contacts
22079    /// # Arguments
22080    /// * `client_id` - The client id to send the request to
22081    #[allow(clippy::too_many_arguments)]
22082    pub async fn get_imported_contact_count(client_id: i32) -> Result<crate::enums::Count, crate::types::Error> {
22083        let request = json!({
22084            "@type": "getImportedContactCount",
22085        });
22086        let response = send_request(client_id, request).await;
22087        if response["@type"] == "error" {
22088            return Err(serde_json::from_value(response).unwrap())
22089        }
22090        Ok(serde_json::from_value(response).unwrap())
22091    }
22092    /// Changes imported contacts using the list of contacts saved on the device. Imports newly added contacts and, if at least the file database is enabled, deletes recently deleted contacts.
22093    /// Query result depends on the result of the previous query, so only one query is possible at the same time
22094    /// # Arguments
22095    /// * `contacts` - The new list of contacts, contact's vCard are ignored and are not imported
22096    /// * `client_id` - The client id to send the request to
22097    #[allow(clippy::too_many_arguments)]
22098    pub async fn change_imported_contacts(contacts: Vec<crate::types::Contact>, client_id: i32) -> Result<crate::enums::ImportedContacts, crate::types::Error> {
22099        let request = json!({
22100            "@type": "changeImportedContacts",
22101            "contacts": contacts,
22102        });
22103        let response = send_request(client_id, request).await;
22104        if response["@type"] == "error" {
22105            return Err(serde_json::from_value(response).unwrap())
22106        }
22107        Ok(serde_json::from_value(response).unwrap())
22108    }
22109    /// Clears all imported contacts, contact list remains unchanged
22110    /// # Arguments
22111    /// * `client_id` - The client id to send the request to
22112    #[allow(clippy::too_many_arguments)]
22113    pub async fn clear_imported_contacts(client_id: i32) -> Result<(), crate::types::Error> {
22114        let request = json!({
22115            "@type": "clearImportedContacts",
22116        });
22117        let response = send_request(client_id, request).await;
22118        if response["@type"] == "error" {
22119            return Err(serde_json::from_value(response).unwrap())
22120        }
22121        Ok(())
22122    }
22123    /// Changes the list of close friends of the current user
22124    /// # Arguments
22125    /// * `user_ids` - User identifiers of close friends; the users must be contacts of the current user
22126    /// * `client_id` - The client id to send the request to
22127    #[allow(clippy::too_many_arguments)]
22128    pub async fn set_close_friends(user_ids: Vec<i64>, client_id: i32) -> Result<(), crate::types::Error> {
22129        let request = json!({
22130            "@type": "setCloseFriends",
22131            "user_ids": user_ids,
22132        });
22133        let response = send_request(client_id, request).await;
22134        if response["@type"] == "error" {
22135            return Err(serde_json::from_value(response).unwrap())
22136        }
22137        Ok(())
22138    }
22139    /// Returns all close friends of the current user
22140    /// # Arguments
22141    /// * `client_id` - The client id to send the request to
22142    #[allow(clippy::too_many_arguments)]
22143    pub async fn get_close_friends(client_id: i32) -> Result<crate::enums::Users, crate::types::Error> {
22144        let request = json!({
22145            "@type": "getCloseFriends",
22146        });
22147        let response = send_request(client_id, request).await;
22148        if response["@type"] == "error" {
22149            return Err(serde_json::from_value(response).unwrap())
22150        }
22151        Ok(serde_json::from_value(response).unwrap())
22152    }
22153    /// Changes a personal profile photo of a contact user
22154    /// # Arguments
22155    /// * `user_id` - User identifier
22156    /// * `photo` - Profile photo to set; pass null to delete the photo; inputChatPhotoPrevious isn't supported in this function
22157    /// * `client_id` - The client id to send the request to
22158    #[allow(clippy::too_many_arguments)]
22159    pub async fn set_user_personal_profile_photo(user_id: i64, photo: Option<crate::enums::InputChatPhoto>, client_id: i32) -> Result<(), crate::types::Error> {
22160        let request = json!({
22161            "@type": "setUserPersonalProfilePhoto",
22162            "user_id": user_id,
22163            "photo": photo,
22164        });
22165        let response = send_request(client_id, request).await;
22166        if response["@type"] == "error" {
22167            return Err(serde_json::from_value(response).unwrap())
22168        }
22169        Ok(())
22170    }
22171    /// Suggests a profile photo to another regular user with common messages
22172    /// # Arguments
22173    /// * `user_id` - User identifier
22174    /// * `photo` - Profile photo to suggest; inputChatPhotoPrevious isn't supported in this function
22175    /// * `client_id` - The client id to send the request to
22176    #[allow(clippy::too_many_arguments)]
22177    pub async fn suggest_user_profile_photo(user_id: i64, photo: crate::enums::InputChatPhoto, client_id: i32) -> Result<(), crate::types::Error> {
22178        let request = json!({
22179            "@type": "suggestUserProfilePhoto",
22180            "user_id": user_id,
22181            "photo": photo,
22182        });
22183        let response = send_request(client_id, request).await;
22184        if response["@type"] == "error" {
22185            return Err(serde_json::from_value(response).unwrap())
22186        }
22187        Ok(())
22188    }
22189    /// Searches a user by their phone number. Returns a 404 error if the user can't be found
22190    /// # Arguments
22191    /// * `phone_number` - Phone number to search for
22192    /// * `client_id` - The client id to send the request to
22193    #[allow(clippy::too_many_arguments)]
22194    pub async fn search_user_by_phone_number(phone_number: String, client_id: i32) -> Result<crate::enums::User, crate::types::Error> {
22195        let request = json!({
22196            "@type": "searchUserByPhoneNumber",
22197            "phone_number": phone_number,
22198        });
22199        let response = send_request(client_id, request).await;
22200        if response["@type"] == "error" {
22201            return Err(serde_json::from_value(response).unwrap())
22202        }
22203        Ok(serde_json::from_value(response).unwrap())
22204    }
22205    /// Shares the phone number of the current user with a mutual contact. Supposed to be called when the user clicks on chatActionBarSharePhoneNumber
22206    /// # Arguments
22207    /// * `user_id` - Identifier of the user with whom to share the phone number. The user must be a mutual contact
22208    /// * `client_id` - The client id to send the request to
22209    #[allow(clippy::too_many_arguments)]
22210    pub async fn share_phone_number(user_id: i64, client_id: i32) -> Result<(), crate::types::Error> {
22211        let request = json!({
22212            "@type": "sharePhoneNumber",
22213            "user_id": user_id,
22214        });
22215        let response = send_request(client_id, request).await;
22216        if response["@type"] == "error" {
22217            return Err(serde_json::from_value(response).unwrap())
22218        }
22219        Ok(())
22220    }
22221    /// Returns the profile photos of a user. Personal and public photo aren't returned
22222    /// # Arguments
22223    /// * `user_id` - User identifier
22224    /// * `offset` - The number of photos to skip; must be non-negative
22225    /// * `limit` - The maximum number of photos to be returned; up to 100
22226    /// * `client_id` - The client id to send the request to
22227    #[allow(clippy::too_many_arguments)]
22228    pub async fn get_user_profile_photos(user_id: i64, offset: i32, limit: i32, client_id: i32) -> Result<crate::enums::ChatPhotos, crate::types::Error> {
22229        let request = json!({
22230            "@type": "getUserProfilePhotos",
22231            "user_id": user_id,
22232            "offset": offset,
22233            "limit": limit,
22234        });
22235        let response = send_request(client_id, request).await;
22236        if response["@type"] == "error" {
22237            return Err(serde_json::from_value(response).unwrap())
22238        }
22239        Ok(serde_json::from_value(response).unwrap())
22240    }
22241    /// Returns stickers from the installed sticker sets that correspond to any of the given emoji or can be found by sticker-specific keywords. If the query is non-empty, then favorite, recently used or trending stickers may also be returned
22242    /// # Arguments
22243    /// * `sticker_type` - Type of the stickers to return
22244    /// * `query` - Search query; a space-separated list of emoji or a keyword prefix. If empty, returns all known installed stickers
22245    /// * `limit` - The maximum number of stickers to be returned
22246    /// * `chat_id` - Chat identifier for which to return stickers. Available custom emoji stickers may be different for different chats
22247    /// * `client_id` - The client id to send the request to
22248    #[allow(clippy::too_many_arguments)]
22249    pub async fn get_stickers(sticker_type: crate::enums::StickerType, query: String, limit: i32, chat_id: i64, client_id: i32) -> Result<crate::enums::Stickers, crate::types::Error> {
22250        let request = json!({
22251            "@type": "getStickers",
22252            "sticker_type": sticker_type,
22253            "query": query,
22254            "limit": limit,
22255            "chat_id": chat_id,
22256        });
22257        let response = send_request(client_id, request).await;
22258        if response["@type"] == "error" {
22259            return Err(serde_json::from_value(response).unwrap())
22260        }
22261        Ok(serde_json::from_value(response).unwrap())
22262    }
22263    /// Returns unique emoji that correspond to stickers to be found by the getStickers(sticker_type, query, 1000000, chat_id)
22264    /// # Arguments
22265    /// * `sticker_type` - Type of the stickers to search for
22266    /// * `query` - Search query
22267    /// * `chat_id` - Chat identifier for which to find stickers
22268    /// * `return_only_main_emoji` - Pass true if only main emoji for each found sticker must be included in the result
22269    /// * `client_id` - The client id to send the request to
22270    #[allow(clippy::too_many_arguments)]
22271    pub async fn get_all_sticker_emojis(sticker_type: crate::enums::StickerType, query: String, chat_id: i64, return_only_main_emoji: bool, client_id: i32) -> Result<crate::enums::Emojis, crate::types::Error> {
22272        let request = json!({
22273            "@type": "getAllStickerEmojis",
22274            "sticker_type": sticker_type,
22275            "query": query,
22276            "chat_id": chat_id,
22277            "return_only_main_emoji": return_only_main_emoji,
22278        });
22279        let response = send_request(client_id, request).await;
22280        if response["@type"] == "error" {
22281            return Err(serde_json::from_value(response).unwrap())
22282        }
22283        Ok(serde_json::from_value(response).unwrap())
22284    }
22285    /// Searches for stickers from public sticker sets that correspond to any of the given emoji
22286    /// # Arguments
22287    /// * `sticker_type` - Type of the stickers to return
22288    /// * `emojis` - Space-separated list of emoji to search for; must be non-empty
22289    /// * `limit` - The maximum number of stickers to be returned; 0-100
22290    /// * `client_id` - The client id to send the request to
22291    #[allow(clippy::too_many_arguments)]
22292    pub async fn search_stickers(sticker_type: crate::enums::StickerType, emojis: String, limit: i32, client_id: i32) -> Result<crate::enums::Stickers, crate::types::Error> {
22293        let request = json!({
22294            "@type": "searchStickers",
22295            "sticker_type": sticker_type,
22296            "emojis": emojis,
22297            "limit": limit,
22298        });
22299        let response = send_request(client_id, request).await;
22300        if response["@type"] == "error" {
22301            return Err(serde_json::from_value(response).unwrap())
22302        }
22303        Ok(serde_json::from_value(response).unwrap())
22304    }
22305    /// Returns premium stickers from regular sticker sets
22306    /// # Arguments
22307    /// * `limit` - The maximum number of stickers to be returned; 0-100
22308    /// * `client_id` - The client id to send the request to
22309    #[allow(clippy::too_many_arguments)]
22310    pub async fn get_premium_stickers(limit: i32, client_id: i32) -> Result<crate::enums::Stickers, crate::types::Error> {
22311        let request = json!({
22312            "@type": "getPremiumStickers",
22313            "limit": limit,
22314        });
22315        let response = send_request(client_id, request).await;
22316        if response["@type"] == "error" {
22317            return Err(serde_json::from_value(response).unwrap())
22318        }
22319        Ok(serde_json::from_value(response).unwrap())
22320    }
22321    /// Returns a list of installed sticker sets
22322    /// # Arguments
22323    /// * `sticker_type` - Type of the sticker sets to return
22324    /// * `client_id` - The client id to send the request to
22325    #[allow(clippy::too_many_arguments)]
22326    pub async fn get_installed_sticker_sets(sticker_type: crate::enums::StickerType, client_id: i32) -> Result<crate::enums::StickerSets, crate::types::Error> {
22327        let request = json!({
22328            "@type": "getInstalledStickerSets",
22329            "sticker_type": sticker_type,
22330        });
22331        let response = send_request(client_id, request).await;
22332        if response["@type"] == "error" {
22333            return Err(serde_json::from_value(response).unwrap())
22334        }
22335        Ok(serde_json::from_value(response).unwrap())
22336    }
22337    /// Returns a list of archived sticker sets
22338    /// # Arguments
22339    /// * `sticker_type` - Type of the sticker sets to return
22340    /// * `offset_sticker_set_id` - Identifier of the sticker set from which to return the result
22341    /// * `limit` - The maximum number of sticker sets to return; up to 100
22342    /// * `client_id` - The client id to send the request to
22343    #[allow(clippy::too_many_arguments)]
22344    pub async fn get_archived_sticker_sets(sticker_type: crate::enums::StickerType, offset_sticker_set_id: i64, limit: i32, client_id: i32) -> Result<crate::enums::StickerSets, crate::types::Error> {
22345        let request = json!({
22346            "@type": "getArchivedStickerSets",
22347            "sticker_type": sticker_type,
22348            "offset_sticker_set_id": offset_sticker_set_id,
22349            "limit": limit,
22350        });
22351        let response = send_request(client_id, request).await;
22352        if response["@type"] == "error" {
22353            return Err(serde_json::from_value(response).unwrap())
22354        }
22355        Ok(serde_json::from_value(response).unwrap())
22356    }
22357    /// Returns a list of trending sticker sets. For optimal performance, the number of returned sticker sets is chosen by TDLib
22358    /// # Arguments
22359    /// * `sticker_type` - Type of the sticker sets to return
22360    /// * `offset` - The offset from which to return the sticker sets; must be non-negative
22361    /// * `limit` - The maximum number of sticker sets to be returned; up to 100. For optimal performance, the number of returned sticker sets is chosen by TDLib and can be smaller than the specified limit, even if the end of the list has not been reached
22362    /// * `client_id` - The client id to send the request to
22363    #[allow(clippy::too_many_arguments)]
22364    pub async fn get_trending_sticker_sets(sticker_type: crate::enums::StickerType, offset: i32, limit: i32, client_id: i32) -> Result<crate::enums::TrendingStickerSets, crate::types::Error> {
22365        let request = json!({
22366            "@type": "getTrendingStickerSets",
22367            "sticker_type": sticker_type,
22368            "offset": offset,
22369            "limit": limit,
22370        });
22371        let response = send_request(client_id, request).await;
22372        if response["@type"] == "error" {
22373            return Err(serde_json::from_value(response).unwrap())
22374        }
22375        Ok(serde_json::from_value(response).unwrap())
22376    }
22377    /// Returns a list of sticker sets attached to a file, including regular, mask, and emoji sticker sets. Currently, only animations, photos, and videos can have attached sticker sets
22378    /// # Arguments
22379    /// * `file_id` - File identifier
22380    /// * `client_id` - The client id to send the request to
22381    #[allow(clippy::too_many_arguments)]
22382    pub async fn get_attached_sticker_sets(file_id: i32, client_id: i32) -> Result<crate::enums::StickerSets, crate::types::Error> {
22383        let request = json!({
22384            "@type": "getAttachedStickerSets",
22385            "file_id": file_id,
22386        });
22387        let response = send_request(client_id, request).await;
22388        if response["@type"] == "error" {
22389            return Err(serde_json::from_value(response).unwrap())
22390        }
22391        Ok(serde_json::from_value(response).unwrap())
22392    }
22393    /// Returns information about a sticker set by its identifier
22394    /// # Arguments
22395    /// * `set_id` - Identifier of the sticker set
22396    /// * `client_id` - The client id to send the request to
22397    #[allow(clippy::too_many_arguments)]
22398    pub async fn get_sticker_set(set_id: i64, client_id: i32) -> Result<crate::enums::StickerSet, crate::types::Error> {
22399        let request = json!({
22400            "@type": "getStickerSet",
22401            "set_id": set_id,
22402        });
22403        let response = send_request(client_id, request).await;
22404        if response["@type"] == "error" {
22405            return Err(serde_json::from_value(response).unwrap())
22406        }
22407        Ok(serde_json::from_value(response).unwrap())
22408    }
22409    /// Searches for a sticker set by its name
22410    /// # Arguments
22411    /// * `name` - Name of the sticker set
22412    /// * `client_id` - The client id to send the request to
22413    #[allow(clippy::too_many_arguments)]
22414    pub async fn search_sticker_set(name: String, client_id: i32) -> Result<crate::enums::StickerSet, crate::types::Error> {
22415        let request = json!({
22416            "@type": "searchStickerSet",
22417            "name": name,
22418        });
22419        let response = send_request(client_id, request).await;
22420        if response["@type"] == "error" {
22421            return Err(serde_json::from_value(response).unwrap())
22422        }
22423        Ok(serde_json::from_value(response).unwrap())
22424    }
22425    /// Searches for installed sticker sets by looking for specified query in their title and name
22426    /// # Arguments
22427    /// * `sticker_type` - Type of the sticker sets to search for
22428    /// * `query` - Query to search for
22429    /// * `limit` - The maximum number of sticker sets to return
22430    /// * `client_id` - The client id to send the request to
22431    #[allow(clippy::too_many_arguments)]
22432    pub async fn search_installed_sticker_sets(sticker_type: crate::enums::StickerType, query: String, limit: i32, client_id: i32) -> Result<crate::enums::StickerSets, crate::types::Error> {
22433        let request = json!({
22434            "@type": "searchInstalledStickerSets",
22435            "sticker_type": sticker_type,
22436            "query": query,
22437            "limit": limit,
22438        });
22439        let response = send_request(client_id, request).await;
22440        if response["@type"] == "error" {
22441            return Err(serde_json::from_value(response).unwrap())
22442        }
22443        Ok(serde_json::from_value(response).unwrap())
22444    }
22445    /// Searches for ordinary sticker sets by looking for specified query in their title and name. Excludes installed sticker sets from the results
22446    /// # Arguments
22447    /// * `query` - Query to search for
22448    /// * `client_id` - The client id to send the request to
22449    #[allow(clippy::too_many_arguments)]
22450    pub async fn search_sticker_sets(query: String, client_id: i32) -> Result<crate::enums::StickerSets, crate::types::Error> {
22451        let request = json!({
22452            "@type": "searchStickerSets",
22453            "query": query,
22454        });
22455        let response = send_request(client_id, request).await;
22456        if response["@type"] == "error" {
22457            return Err(serde_json::from_value(response).unwrap())
22458        }
22459        Ok(serde_json::from_value(response).unwrap())
22460    }
22461    /// Installs/uninstalls or activates/archives a sticker set
22462    /// # Arguments
22463    /// * `set_id` - Identifier of the sticker set
22464    /// * `is_installed` - The new value of is_installed
22465    /// * `is_archived` - The new value of is_archived. A sticker set can't be installed and archived simultaneously
22466    /// * `client_id` - The client id to send the request to
22467    #[allow(clippy::too_many_arguments)]
22468    pub async fn change_sticker_set(set_id: i64, is_installed: bool, is_archived: bool, client_id: i32) -> Result<(), crate::types::Error> {
22469        let request = json!({
22470            "@type": "changeStickerSet",
22471            "set_id": set_id,
22472            "is_installed": is_installed,
22473            "is_archived": is_archived,
22474        });
22475        let response = send_request(client_id, request).await;
22476        if response["@type"] == "error" {
22477            return Err(serde_json::from_value(response).unwrap())
22478        }
22479        Ok(())
22480    }
22481    /// Informs the server that some trending sticker sets have been viewed by the user
22482    /// # Arguments
22483    /// * `sticker_set_ids` - Identifiers of viewed trending sticker sets
22484    /// * `client_id` - The client id to send the request to
22485    #[allow(clippy::too_many_arguments)]
22486    pub async fn view_trending_sticker_sets(sticker_set_ids: Vec<i64>, client_id: i32) -> Result<(), crate::types::Error> {
22487        let request = json!({
22488            "@type": "viewTrendingStickerSets",
22489            "sticker_set_ids": sticker_set_ids,
22490        });
22491        let response = send_request(client_id, request).await;
22492        if response["@type"] == "error" {
22493            return Err(serde_json::from_value(response).unwrap())
22494        }
22495        Ok(())
22496    }
22497    /// Changes the order of installed sticker sets
22498    /// # Arguments
22499    /// * `sticker_type` - Type of the sticker sets to reorder
22500    /// * `sticker_set_ids` - Identifiers of installed sticker sets in the new correct order
22501    /// * `client_id` - The client id to send the request to
22502    #[allow(clippy::too_many_arguments)]
22503    pub async fn reorder_installed_sticker_sets(sticker_type: crate::enums::StickerType, sticker_set_ids: Vec<i64>, client_id: i32) -> Result<(), crate::types::Error> {
22504        let request = json!({
22505            "@type": "reorderInstalledStickerSets",
22506            "sticker_type": sticker_type,
22507            "sticker_set_ids": sticker_set_ids,
22508        });
22509        let response = send_request(client_id, request).await;
22510        if response["@type"] == "error" {
22511            return Err(serde_json::from_value(response).unwrap())
22512        }
22513        Ok(())
22514    }
22515    /// Returns a list of recently used stickers
22516    /// # Arguments
22517    /// * `is_attached` - Pass true to return stickers and masks that were recently attached to photos or video files; pass false to return recently sent stickers
22518    /// * `client_id` - The client id to send the request to
22519    #[allow(clippy::too_many_arguments)]
22520    pub async fn get_recent_stickers(is_attached: bool, client_id: i32) -> Result<crate::enums::Stickers, crate::types::Error> {
22521        let request = json!({
22522            "@type": "getRecentStickers",
22523            "is_attached": is_attached,
22524        });
22525        let response = send_request(client_id, request).await;
22526        if response["@type"] == "error" {
22527            return Err(serde_json::from_value(response).unwrap())
22528        }
22529        Ok(serde_json::from_value(response).unwrap())
22530    }
22531    /// Manually adds a new sticker to the list of recently used stickers. The new sticker is added to the top of the list. If the sticker was already in the list, it is removed from the list first.
22532    /// Only stickers belonging to a sticker set can be added to this list. Emoji stickers can't be added to recent stickers
22533    /// # Arguments
22534    /// * `is_attached` - Pass true to add the sticker to the list of stickers recently attached to photo or video files; pass false to add the sticker to the list of recently sent stickers
22535    /// * `sticker` - Sticker file to add
22536    /// * `client_id` - The client id to send the request to
22537    #[allow(clippy::too_many_arguments)]
22538    pub async fn add_recent_sticker(is_attached: bool, sticker: crate::enums::InputFile, client_id: i32) -> Result<crate::enums::Stickers, crate::types::Error> {
22539        let request = json!({
22540            "@type": "addRecentSticker",
22541            "is_attached": is_attached,
22542            "sticker": sticker,
22543        });
22544        let response = send_request(client_id, request).await;
22545        if response["@type"] == "error" {
22546            return Err(serde_json::from_value(response).unwrap())
22547        }
22548        Ok(serde_json::from_value(response).unwrap())
22549    }
22550    /// Removes a sticker from the list of recently used stickers
22551    /// # Arguments
22552    /// * `is_attached` - Pass true to remove the sticker from the list of stickers recently attached to photo or video files; pass false to remove the sticker from the list of recently sent stickers
22553    /// * `sticker` - Sticker file to delete
22554    /// * `client_id` - The client id to send the request to
22555    #[allow(clippy::too_many_arguments)]
22556    pub async fn remove_recent_sticker(is_attached: bool, sticker: crate::enums::InputFile, client_id: i32) -> Result<(), crate::types::Error> {
22557        let request = json!({
22558            "@type": "removeRecentSticker",
22559            "is_attached": is_attached,
22560            "sticker": sticker,
22561        });
22562        let response = send_request(client_id, request).await;
22563        if response["@type"] == "error" {
22564            return Err(serde_json::from_value(response).unwrap())
22565        }
22566        Ok(())
22567    }
22568    /// Clears the list of recently used stickers
22569    /// # Arguments
22570    /// * `is_attached` - Pass true to clear the list of stickers recently attached to photo or video files; pass false to clear the list of recently sent stickers
22571    /// * `client_id` - The client id to send the request to
22572    #[allow(clippy::too_many_arguments)]
22573    pub async fn clear_recent_stickers(is_attached: bool, client_id: i32) -> Result<(), crate::types::Error> {
22574        let request = json!({
22575            "@type": "clearRecentStickers",
22576            "is_attached": is_attached,
22577        });
22578        let response = send_request(client_id, request).await;
22579        if response["@type"] == "error" {
22580            return Err(serde_json::from_value(response).unwrap())
22581        }
22582        Ok(())
22583    }
22584    /// Returns favorite stickers
22585    /// # Arguments
22586    /// * `client_id` - The client id to send the request to
22587    #[allow(clippy::too_many_arguments)]
22588    pub async fn get_favorite_stickers(client_id: i32) -> Result<crate::enums::Stickers, crate::types::Error> {
22589        let request = json!({
22590            "@type": "getFavoriteStickers",
22591        });
22592        let response = send_request(client_id, request).await;
22593        if response["@type"] == "error" {
22594            return Err(serde_json::from_value(response).unwrap())
22595        }
22596        Ok(serde_json::from_value(response).unwrap())
22597    }
22598    /// Adds a new sticker to the list of favorite stickers. The new sticker is added to the top of the list. If the sticker was already in the list, it is removed from the list first.
22599    /// Only stickers belonging to a sticker set can be added to this list. Emoji stickers can't be added to favorite stickers
22600    /// # Arguments
22601    /// * `sticker` - Sticker file to add
22602    /// * `client_id` - The client id to send the request to
22603    #[allow(clippy::too_many_arguments)]
22604    pub async fn add_favorite_sticker(sticker: crate::enums::InputFile, client_id: i32) -> Result<(), crate::types::Error> {
22605        let request = json!({
22606            "@type": "addFavoriteSticker",
22607            "sticker": sticker,
22608        });
22609        let response = send_request(client_id, request).await;
22610        if response["@type"] == "error" {
22611            return Err(serde_json::from_value(response).unwrap())
22612        }
22613        Ok(())
22614    }
22615    /// Removes a sticker from the list of favorite stickers
22616    /// # Arguments
22617    /// * `sticker` - Sticker file to delete from the list
22618    /// * `client_id` - The client id to send the request to
22619    #[allow(clippy::too_many_arguments)]
22620    pub async fn remove_favorite_sticker(sticker: crate::enums::InputFile, client_id: i32) -> Result<(), crate::types::Error> {
22621        let request = json!({
22622            "@type": "removeFavoriteSticker",
22623            "sticker": sticker,
22624        });
22625        let response = send_request(client_id, request).await;
22626        if response["@type"] == "error" {
22627            return Err(serde_json::from_value(response).unwrap())
22628        }
22629        Ok(())
22630    }
22631    /// Returns emoji corresponding to a sticker. The list is only for informational purposes, because a sticker is always sent with a fixed emoji from the corresponding Sticker object
22632    /// # Arguments
22633    /// * `sticker` - Sticker file identifier
22634    /// * `client_id` - The client id to send the request to
22635    #[allow(clippy::too_many_arguments)]
22636    pub async fn get_sticker_emojis(sticker: crate::enums::InputFile, client_id: i32) -> Result<crate::enums::Emojis, crate::types::Error> {
22637        let request = json!({
22638            "@type": "getStickerEmojis",
22639            "sticker": sticker,
22640        });
22641        let response = send_request(client_id, request).await;
22642        if response["@type"] == "error" {
22643            return Err(serde_json::from_value(response).unwrap())
22644        }
22645        Ok(serde_json::from_value(response).unwrap())
22646    }
22647    /// Searches for emojis by keywords. Supported only if the file database is enabled
22648    /// # Arguments
22649    /// * `text` - Text to search for
22650    /// * `exact_match` - Pass true if only emojis, which exactly match the text, needs to be returned
22651    /// * `input_language_codes` - List of possible IETF language tags of the user's input language; may be empty if unknown
22652    /// * `client_id` - The client id to send the request to
22653    #[allow(clippy::too_many_arguments)]
22654    pub async fn search_emojis(text: String, exact_match: bool, input_language_codes: Vec<String>, client_id: i32) -> Result<crate::enums::Emojis, crate::types::Error> {
22655        let request = json!({
22656            "@type": "searchEmojis",
22657            "text": text,
22658            "exact_match": exact_match,
22659            "input_language_codes": input_language_codes,
22660        });
22661        let response = send_request(client_id, request).await;
22662        if response["@type"] == "error" {
22663            return Err(serde_json::from_value(response).unwrap())
22664        }
22665        Ok(serde_json::from_value(response).unwrap())
22666    }
22667    /// Returns available emojis categories
22668    /// # Arguments
22669    /// * `r#type` - Type of emoji categories to return; pass null to get default emoji categories
22670    /// * `client_id` - The client id to send the request to
22671    #[allow(clippy::too_many_arguments)]
22672    pub async fn get_emoji_categories(r#type: Option<crate::enums::EmojiCategoryType>, client_id: i32) -> Result<crate::enums::EmojiCategories, crate::types::Error> {
22673        let request = json!({
22674            "@type": "getEmojiCategories",
22675            "type": r#type,
22676        });
22677        let response = send_request(client_id, request).await;
22678        if response["@type"] == "error" {
22679            return Err(serde_json::from_value(response).unwrap())
22680        }
22681        Ok(serde_json::from_value(response).unwrap())
22682    }
22683    /// Returns an animated emoji corresponding to a given emoji. Returns a 404 error if the emoji has no animated emoji
22684    /// # Arguments
22685    /// * `emoji` - The emoji
22686    /// * `client_id` - The client id to send the request to
22687    #[allow(clippy::too_many_arguments)]
22688    pub async fn get_animated_emoji(emoji: String, client_id: i32) -> Result<crate::enums::AnimatedEmoji, crate::types::Error> {
22689        let request = json!({
22690            "@type": "getAnimatedEmoji",
22691            "emoji": emoji,
22692        });
22693        let response = send_request(client_id, request).await;
22694        if response["@type"] == "error" {
22695            return Err(serde_json::from_value(response).unwrap())
22696        }
22697        Ok(serde_json::from_value(response).unwrap())
22698    }
22699    /// Returns an HTTP URL which can be used to automatically log in to the translation platform and suggest new emoji replacements. The URL will be valid for 30 seconds after generation
22700    /// # Arguments
22701    /// * `language_code` - Language code for which the emoji replacements will be suggested
22702    /// * `client_id` - The client id to send the request to
22703    #[allow(clippy::too_many_arguments)]
22704    pub async fn get_emoji_suggestions_url(language_code: String, client_id: i32) -> Result<crate::enums::HttpUrl, crate::types::Error> {
22705        let request = json!({
22706            "@type": "getEmojiSuggestionsUrl",
22707            "language_code": language_code,
22708        });
22709        let response = send_request(client_id, request).await;
22710        if response["@type"] == "error" {
22711            return Err(serde_json::from_value(response).unwrap())
22712        }
22713        Ok(serde_json::from_value(response).unwrap())
22714    }
22715    /// Returns list of custom emoji stickers by their identifiers. Stickers are returned in arbitrary order. Only found stickers are returned
22716    /// # Arguments
22717    /// * `custom_emoji_ids` - Identifiers of custom emoji stickers. At most 200 custom emoji stickers can be received simultaneously
22718    /// * `client_id` - The client id to send the request to
22719    #[allow(clippy::too_many_arguments)]
22720    pub async fn get_custom_emoji_stickers(custom_emoji_ids: Vec<i64>, client_id: i32) -> Result<crate::enums::Stickers, crate::types::Error> {
22721        let request = json!({
22722            "@type": "getCustomEmojiStickers",
22723            "custom_emoji_ids": custom_emoji_ids,
22724        });
22725        let response = send_request(client_id, request).await;
22726        if response["@type"] == "error" {
22727            return Err(serde_json::from_value(response).unwrap())
22728        }
22729        Ok(serde_json::from_value(response).unwrap())
22730    }
22731    /// Returns default list of custom emoji stickers for placing on a chat photo
22732    /// # Arguments
22733    /// * `client_id` - The client id to send the request to
22734    #[allow(clippy::too_many_arguments)]
22735    pub async fn get_default_chat_photo_custom_emoji_stickers(client_id: i32) -> Result<crate::enums::Stickers, crate::types::Error> {
22736        let request = json!({
22737            "@type": "getDefaultChatPhotoCustomEmojiStickers",
22738        });
22739        let response = send_request(client_id, request).await;
22740        if response["@type"] == "error" {
22741            return Err(serde_json::from_value(response).unwrap())
22742        }
22743        Ok(serde_json::from_value(response).unwrap())
22744    }
22745    /// Returns default list of custom emoji stickers for placing on a profile photo
22746    /// # Arguments
22747    /// * `client_id` - The client id to send the request to
22748    #[allow(clippy::too_many_arguments)]
22749    pub async fn get_default_profile_photo_custom_emoji_stickers(client_id: i32) -> Result<crate::enums::Stickers, crate::types::Error> {
22750        let request = json!({
22751            "@type": "getDefaultProfilePhotoCustomEmojiStickers",
22752        });
22753        let response = send_request(client_id, request).await;
22754        if response["@type"] == "error" {
22755            return Err(serde_json::from_value(response).unwrap())
22756        }
22757        Ok(serde_json::from_value(response).unwrap())
22758    }
22759    /// Returns saved animations
22760    /// # Arguments
22761    /// * `client_id` - The client id to send the request to
22762    #[allow(clippy::too_many_arguments)]
22763    pub async fn get_saved_animations(client_id: i32) -> Result<crate::enums::Animations, crate::types::Error> {
22764        let request = json!({
22765            "@type": "getSavedAnimations",
22766        });
22767        let response = send_request(client_id, request).await;
22768        if response["@type"] == "error" {
22769            return Err(serde_json::from_value(response).unwrap())
22770        }
22771        Ok(serde_json::from_value(response).unwrap())
22772    }
22773    /// Manually adds a new animation to the list of saved animations. The new animation is added to the beginning of the list. If the animation was already in the list, it is removed first. Only non-secret video animations with MIME type "video/mp4" can be added to the list
22774    /// # Arguments
22775    /// * `animation` - The animation file to be added. Only animations known to the server (i.e., successfully sent via a message) can be added to the list
22776    /// * `client_id` - The client id to send the request to
22777    #[allow(clippy::too_many_arguments)]
22778    pub async fn add_saved_animation(animation: crate::enums::InputFile, client_id: i32) -> Result<(), crate::types::Error> {
22779        let request = json!({
22780            "@type": "addSavedAnimation",
22781            "animation": animation,
22782        });
22783        let response = send_request(client_id, request).await;
22784        if response["@type"] == "error" {
22785            return Err(serde_json::from_value(response).unwrap())
22786        }
22787        Ok(())
22788    }
22789    /// Removes an animation from the list of saved animations
22790    /// # Arguments
22791    /// * `animation` - Animation file to be removed
22792    /// * `client_id` - The client id to send the request to
22793    #[allow(clippy::too_many_arguments)]
22794    pub async fn remove_saved_animation(animation: crate::enums::InputFile, client_id: i32) -> Result<(), crate::types::Error> {
22795        let request = json!({
22796            "@type": "removeSavedAnimation",
22797            "animation": animation,
22798        });
22799        let response = send_request(client_id, request).await;
22800        if response["@type"] == "error" {
22801            return Err(serde_json::from_value(response).unwrap())
22802        }
22803        Ok(())
22804    }
22805    /// Returns up to 20 recently used inline bots in the order of their last usage
22806    /// # Arguments
22807    /// * `client_id` - The client id to send the request to
22808    #[allow(clippy::too_many_arguments)]
22809    pub async fn get_recent_inline_bots(client_id: i32) -> Result<crate::enums::Users, crate::types::Error> {
22810        let request = json!({
22811            "@type": "getRecentInlineBots",
22812        });
22813        let response = send_request(client_id, request).await;
22814        if response["@type"] == "error" {
22815            return Err(serde_json::from_value(response).unwrap())
22816        }
22817        Ok(serde_json::from_value(response).unwrap())
22818    }
22819    /// Searches for recently used hashtags by their prefix
22820    /// # Arguments
22821    /// * `prefix` - Hashtag prefix to search for
22822    /// * `limit` - The maximum number of hashtags to be returned
22823    /// * `client_id` - The client id to send the request to
22824    #[allow(clippy::too_many_arguments)]
22825    pub async fn search_hashtags(prefix: String, limit: i32, client_id: i32) -> Result<crate::enums::Hashtags, crate::types::Error> {
22826        let request = json!({
22827            "@type": "searchHashtags",
22828            "prefix": prefix,
22829            "limit": limit,
22830        });
22831        let response = send_request(client_id, request).await;
22832        if response["@type"] == "error" {
22833            return Err(serde_json::from_value(response).unwrap())
22834        }
22835        Ok(serde_json::from_value(response).unwrap())
22836    }
22837    /// Removes a hashtag from the list of recently used hashtags
22838    /// # Arguments
22839    /// * `hashtag` - Hashtag to delete
22840    /// * `client_id` - The client id to send the request to
22841    #[allow(clippy::too_many_arguments)]
22842    pub async fn remove_recent_hashtag(hashtag: String, client_id: i32) -> Result<(), crate::types::Error> {
22843        let request = json!({
22844            "@type": "removeRecentHashtag",
22845            "hashtag": hashtag,
22846        });
22847        let response = send_request(client_id, request).await;
22848        if response["@type"] == "error" {
22849            return Err(serde_json::from_value(response).unwrap())
22850        }
22851        Ok(())
22852    }
22853    /// Returns a web page preview by the text of the message. Do not call this function too often. Returns a 404 error if the web page has no preview
22854    /// # Arguments
22855    /// * `text` - Message text with formatting
22856    /// * `client_id` - The client id to send the request to
22857    #[allow(clippy::too_many_arguments)]
22858    pub async fn get_web_page_preview(text: crate::types::FormattedText, client_id: i32) -> Result<crate::enums::WebPage, crate::types::Error> {
22859        let request = json!({
22860            "@type": "getWebPagePreview",
22861            "text": text,
22862        });
22863        let response = send_request(client_id, request).await;
22864        if response["@type"] == "error" {
22865            return Err(serde_json::from_value(response).unwrap())
22866        }
22867        Ok(serde_json::from_value(response).unwrap())
22868    }
22869    /// Returns an instant view version of a web page if available. Returns a 404 error if the web page has no instant view page
22870    /// # Arguments
22871    /// * `url` - The web page URL
22872    /// * `force_full` - Pass true to get full instant view for the web page
22873    /// * `client_id` - The client id to send the request to
22874    #[allow(clippy::too_many_arguments)]
22875    pub async fn get_web_page_instant_view(url: String, force_full: bool, client_id: i32) -> Result<crate::enums::WebPageInstantView, crate::types::Error> {
22876        let request = json!({
22877            "@type": "getWebPageInstantView",
22878            "url": url,
22879            "force_full": force_full,
22880        });
22881        let response = send_request(client_id, request).await;
22882        if response["@type"] == "error" {
22883            return Err(serde_json::from_value(response).unwrap())
22884        }
22885        Ok(serde_json::from_value(response).unwrap())
22886    }
22887    /// Changes a profile photo for the current user
22888    /// # Arguments
22889    /// * `photo` - Profile photo to set
22890    /// * `is_public` - Pass true to set a public photo, which will be visible even the main photo is hidden by privacy settings
22891    /// * `client_id` - The client id to send the request to
22892    #[allow(clippy::too_many_arguments)]
22893    pub async fn set_profile_photo(photo: crate::enums::InputChatPhoto, is_public: bool, client_id: i32) -> Result<(), crate::types::Error> {
22894        let request = json!({
22895            "@type": "setProfilePhoto",
22896            "photo": photo,
22897            "is_public": is_public,
22898        });
22899        let response = send_request(client_id, request).await;
22900        if response["@type"] == "error" {
22901            return Err(serde_json::from_value(response).unwrap())
22902        }
22903        Ok(())
22904    }
22905    /// Deletes a profile photo
22906    /// # Arguments
22907    /// * `profile_photo_id` - Identifier of the profile photo to delete
22908    /// * `client_id` - The client id to send the request to
22909    #[allow(clippy::too_many_arguments)]
22910    pub async fn delete_profile_photo(profile_photo_id: i64, client_id: i32) -> Result<(), crate::types::Error> {
22911        let request = json!({
22912            "@type": "deleteProfilePhoto",
22913            "profile_photo_id": profile_photo_id,
22914        });
22915        let response = send_request(client_id, request).await;
22916        if response["@type"] == "error" {
22917            return Err(serde_json::from_value(response).unwrap())
22918        }
22919        Ok(())
22920    }
22921    /// Changes the first and last name of the current user
22922    /// # Arguments
22923    /// * `first_name` - The new value of the first name for the current user; 1-64 characters
22924    /// * `last_name` - The new value of the optional last name for the current user; 0-64 characters
22925    /// * `client_id` - The client id to send the request to
22926    #[allow(clippy::too_many_arguments)]
22927    pub async fn set_name(first_name: String, last_name: String, client_id: i32) -> Result<(), crate::types::Error> {
22928        let request = json!({
22929            "@type": "setName",
22930            "first_name": first_name,
22931            "last_name": last_name,
22932        });
22933        let response = send_request(client_id, request).await;
22934        if response["@type"] == "error" {
22935            return Err(serde_json::from_value(response).unwrap())
22936        }
22937        Ok(())
22938    }
22939    /// Changes the bio of the current user
22940    /// # Arguments
22941    /// * `bio` - The new value of the user bio; 0-getOption("bio_length_max") characters without line feeds
22942    /// * `client_id` - The client id to send the request to
22943    #[allow(clippy::too_many_arguments)]
22944    pub async fn set_bio(bio: String, client_id: i32) -> Result<(), crate::types::Error> {
22945        let request = json!({
22946            "@type": "setBio",
22947            "bio": bio,
22948        });
22949        let response = send_request(client_id, request).await;
22950        if response["@type"] == "error" {
22951            return Err(serde_json::from_value(response).unwrap())
22952        }
22953        Ok(())
22954    }
22955    /// Changes the editable username of the current user
22956    /// # Arguments
22957    /// * `username` - The new value of the username. Use an empty string to remove the username. The username can't be completely removed if there is another active or disabled username
22958    /// * `client_id` - The client id to send the request to
22959    #[allow(clippy::too_many_arguments)]
22960    pub async fn set_username(username: String, client_id: i32) -> Result<(), crate::types::Error> {
22961        let request = json!({
22962            "@type": "setUsername",
22963            "username": username,
22964        });
22965        let response = send_request(client_id, request).await;
22966        if response["@type"] == "error" {
22967            return Err(serde_json::from_value(response).unwrap())
22968        }
22969        Ok(())
22970    }
22971    /// Changes active state for a username of the current user. The editable username can't be disabled. May return an error with a message "USERNAMES_ACTIVE_TOO_MUCH" if the maximum number of active usernames has been reached
22972    /// # Arguments
22973    /// * `username` - The username to change
22974    /// * `is_active` - Pass true to activate the username; pass false to disable it
22975    /// * `client_id` - The client id to send the request to
22976    #[allow(clippy::too_many_arguments)]
22977    pub async fn toggle_username_is_active(username: String, is_active: bool, client_id: i32) -> Result<(), crate::types::Error> {
22978        let request = json!({
22979            "@type": "toggleUsernameIsActive",
22980            "username": username,
22981            "is_active": is_active,
22982        });
22983        let response = send_request(client_id, request).await;
22984        if response["@type"] == "error" {
22985            return Err(serde_json::from_value(response).unwrap())
22986        }
22987        Ok(())
22988    }
22989    /// Changes order of active usernames of the current user
22990    /// # Arguments
22991    /// * `usernames` - The new order of active usernames. All currently active usernames must be specified
22992    /// * `client_id` - The client id to send the request to
22993    #[allow(clippy::too_many_arguments)]
22994    pub async fn reorder_active_usernames(usernames: Vec<String>, client_id: i32) -> Result<(), crate::types::Error> {
22995        let request = json!({
22996            "@type": "reorderActiveUsernames",
22997            "usernames": usernames,
22998        });
22999        let response = send_request(client_id, request).await;
23000        if response["@type"] == "error" {
23001            return Err(serde_json::from_value(response).unwrap())
23002        }
23003        Ok(())
23004    }
23005    /// Changes the emoji status of the current user; for Telegram Premium users only
23006    /// # Arguments
23007    /// * `emoji_status` - New emoji status; pass null to switch to the default badge
23008    /// * `client_id` - The client id to send the request to
23009    #[allow(clippy::too_many_arguments)]
23010    pub async fn set_emoji_status(emoji_status: Option<crate::types::EmojiStatus>, client_id: i32) -> Result<(), crate::types::Error> {
23011        let request = json!({
23012            "@type": "setEmojiStatus",
23013            "emoji_status": emoji_status,
23014        });
23015        let response = send_request(client_id, request).await;
23016        if response["@type"] == "error" {
23017            return Err(serde_json::from_value(response).unwrap())
23018        }
23019        Ok(())
23020    }
23021    /// Changes the location of the current user. Needs to be called if getOption("is_location_visible") is true and location changes for more than 1 kilometer
23022    /// # Arguments
23023    /// * `location` - The new location of the user
23024    /// * `client_id` - The client id to send the request to
23025    #[allow(clippy::too_many_arguments)]
23026    pub async fn set_location(location: crate::types::Location, client_id: i32) -> Result<(), crate::types::Error> {
23027        let request = json!({
23028            "@type": "setLocation",
23029            "location": location,
23030        });
23031        let response = send_request(client_id, request).await;
23032        if response["@type"] == "error" {
23033            return Err(serde_json::from_value(response).unwrap())
23034        }
23035        Ok(())
23036    }
23037    /// Changes the phone number of the user and sends an authentication code to the user's new phone number; for official Android and iOS applications only. On success, returns information about the sent code
23038    /// # Arguments
23039    /// * `phone_number` - The new phone number of the user in international format
23040    /// * `settings` - Settings for the authentication of the user's phone number; pass null to use default settings
23041    /// * `client_id` - The client id to send the request to
23042    #[allow(clippy::too_many_arguments)]
23043    pub async fn change_phone_number(phone_number: String, settings: Option<crate::types::PhoneNumberAuthenticationSettings>, client_id: i32) -> Result<crate::enums::AuthenticationCodeInfo, crate::types::Error> {
23044        let request = json!({
23045            "@type": "changePhoneNumber",
23046            "phone_number": phone_number,
23047            "settings": settings,
23048        });
23049        let response = send_request(client_id, request).await;
23050        if response["@type"] == "error" {
23051            return Err(serde_json::from_value(response).unwrap())
23052        }
23053        Ok(serde_json::from_value(response).unwrap())
23054    }
23055    /// Resends the authentication code sent to confirm a new phone number for the current user. Works only if the previously received authenticationCodeInfo next_code_type was not null and the server-specified timeout has passed
23056    /// # Arguments
23057    /// * `client_id` - The client id to send the request to
23058    #[allow(clippy::too_many_arguments)]
23059    pub async fn resend_change_phone_number_code(client_id: i32) -> Result<crate::enums::AuthenticationCodeInfo, crate::types::Error> {
23060        let request = json!({
23061            "@type": "resendChangePhoneNumberCode",
23062        });
23063        let response = send_request(client_id, request).await;
23064        if response["@type"] == "error" {
23065            return Err(serde_json::from_value(response).unwrap())
23066        }
23067        Ok(serde_json::from_value(response).unwrap())
23068    }
23069    /// Checks the authentication code sent to confirm a new phone number of the user
23070    /// # Arguments
23071    /// * `code` - Authentication code to check
23072    /// * `client_id` - The client id to send the request to
23073    #[allow(clippy::too_many_arguments)]
23074    pub async fn check_change_phone_number_code(code: String, client_id: i32) -> Result<(), crate::types::Error> {
23075        let request = json!({
23076            "@type": "checkChangePhoneNumberCode",
23077            "code": code,
23078        });
23079        let response = send_request(client_id, request).await;
23080        if response["@type"] == "error" {
23081            return Err(serde_json::from_value(response).unwrap())
23082        }
23083        Ok(())
23084    }
23085    /// Returns an HTTPS link, which can be used to get information about the current user
23086    /// # Arguments
23087    /// * `client_id` - The client id to send the request to
23088    #[allow(clippy::too_many_arguments)]
23089    pub async fn get_user_link(client_id: i32) -> Result<crate::enums::UserLink, crate::types::Error> {
23090        let request = json!({
23091            "@type": "getUserLink",
23092        });
23093        let response = send_request(client_id, request).await;
23094        if response["@type"] == "error" {
23095            return Err(serde_json::from_value(response).unwrap())
23096        }
23097        Ok(serde_json::from_value(response).unwrap())
23098    }
23099    /// Searches a user by a token from the user's link
23100    /// # Arguments
23101    /// * `token` - Token to search for
23102    /// * `client_id` - The client id to send the request to
23103    #[allow(clippy::too_many_arguments)]
23104    pub async fn search_user_by_token(token: String, client_id: i32) -> Result<crate::enums::User, crate::types::Error> {
23105        let request = json!({
23106            "@type": "searchUserByToken",
23107            "token": token,
23108        });
23109        let response = send_request(client_id, request).await;
23110        if response["@type"] == "error" {
23111            return Err(serde_json::from_value(response).unwrap())
23112        }
23113        Ok(serde_json::from_value(response).unwrap())
23114    }
23115    /// Sets the list of commands supported by the bot for the given user scope and language; for bots only
23116    /// # Arguments
23117    /// * `scope` - The scope to which the commands are relevant; pass null to change commands in the default bot command scope
23118    /// * `language_code` - A two-letter ISO 639-1 language code. If empty, the commands will be applied to all users from the given scope, for which language there are no dedicated commands
23119    /// * `commands` - List of the bot's commands
23120    /// * `client_id` - The client id to send the request to
23121    #[allow(clippy::too_many_arguments)]
23122    pub async fn set_commands(scope: Option<crate::enums::BotCommandScope>, language_code: String, commands: Vec<crate::types::BotCommand>, client_id: i32) -> Result<(), crate::types::Error> {
23123        let request = json!({
23124            "@type": "setCommands",
23125            "scope": scope,
23126            "language_code": language_code,
23127            "commands": commands,
23128        });
23129        let response = send_request(client_id, request).await;
23130        if response["@type"] == "error" {
23131            return Err(serde_json::from_value(response).unwrap())
23132        }
23133        Ok(())
23134    }
23135    /// Deletes commands supported by the bot for the given user scope and language; for bots only
23136    /// # Arguments
23137    /// * `scope` - The scope to which the commands are relevant; pass null to delete commands in the default bot command scope
23138    /// * `language_code` - A two-letter ISO 639-1 language code or an empty string
23139    /// * `client_id` - The client id to send the request to
23140    #[allow(clippy::too_many_arguments)]
23141    pub async fn delete_commands(scope: Option<crate::enums::BotCommandScope>, language_code: String, client_id: i32) -> Result<(), crate::types::Error> {
23142        let request = json!({
23143            "@type": "deleteCommands",
23144            "scope": scope,
23145            "language_code": language_code,
23146        });
23147        let response = send_request(client_id, request).await;
23148        if response["@type"] == "error" {
23149            return Err(serde_json::from_value(response).unwrap())
23150        }
23151        Ok(())
23152    }
23153    /// Returns list of commands supported by the bot for the given user scope and language; for bots only
23154    /// # Arguments
23155    /// * `scope` - The scope to which the commands are relevant; pass null to get commands in the default bot command scope
23156    /// * `language_code` - A two-letter ISO 639-1 language code or an empty string
23157    /// * `client_id` - The client id to send the request to
23158    #[allow(clippy::too_many_arguments)]
23159    pub async fn get_commands(scope: Option<crate::enums::BotCommandScope>, language_code: String, client_id: i32) -> Result<crate::enums::BotCommands, crate::types::Error> {
23160        let request = json!({
23161            "@type": "getCommands",
23162            "scope": scope,
23163            "language_code": language_code,
23164        });
23165        let response = send_request(client_id, request).await;
23166        if response["@type"] == "error" {
23167            return Err(serde_json::from_value(response).unwrap())
23168        }
23169        Ok(serde_json::from_value(response).unwrap())
23170    }
23171    /// Sets menu button for the given user or for all users; for bots only
23172    /// # Arguments
23173    /// * `user_id` - Identifier of the user or 0 to set menu button for all users
23174    /// * `menu_button` - New menu button
23175    /// * `client_id` - The client id to send the request to
23176    #[allow(clippy::too_many_arguments)]
23177    pub async fn set_menu_button(user_id: i64, menu_button: crate::types::BotMenuButton, client_id: i32) -> Result<(), crate::types::Error> {
23178        let request = json!({
23179            "@type": "setMenuButton",
23180            "user_id": user_id,
23181            "menu_button": menu_button,
23182        });
23183        let response = send_request(client_id, request).await;
23184        if response["@type"] == "error" {
23185            return Err(serde_json::from_value(response).unwrap())
23186        }
23187        Ok(())
23188    }
23189    /// Returns menu button set by the bot for the given user; for bots only
23190    /// # Arguments
23191    /// * `user_id` - Identifier of the user or 0 to get the default menu button
23192    /// * `client_id` - The client id to send the request to
23193    #[allow(clippy::too_many_arguments)]
23194    pub async fn get_menu_button(user_id: i64, client_id: i32) -> Result<crate::enums::BotMenuButton, crate::types::Error> {
23195        let request = json!({
23196            "@type": "getMenuButton",
23197            "user_id": user_id,
23198        });
23199        let response = send_request(client_id, request).await;
23200        if response["@type"] == "error" {
23201            return Err(serde_json::from_value(response).unwrap())
23202        }
23203        Ok(serde_json::from_value(response).unwrap())
23204    }
23205    /// Sets default administrator rights for adding the bot to basic group and supergroup chats; for bots only
23206    /// # Arguments
23207    /// * `default_group_administrator_rights` - Default administrator rights for adding the bot to basic group and supergroup chats; pass null to remove default rights
23208    /// * `client_id` - The client id to send the request to
23209    #[allow(clippy::too_many_arguments)]
23210    pub async fn set_default_group_administrator_rights(default_group_administrator_rights: Option<crate::types::ChatAdministratorRights>, client_id: i32) -> Result<(), crate::types::Error> {
23211        let request = json!({
23212            "@type": "setDefaultGroupAdministratorRights",
23213            "default_group_administrator_rights": default_group_administrator_rights,
23214        });
23215        let response = send_request(client_id, request).await;
23216        if response["@type"] == "error" {
23217            return Err(serde_json::from_value(response).unwrap())
23218        }
23219        Ok(())
23220    }
23221    /// Sets default administrator rights for adding the bot to channel chats; for bots only
23222    /// # Arguments
23223    /// * `default_channel_administrator_rights` - Default administrator rights for adding the bot to channels; pass null to remove default rights
23224    /// * `client_id` - The client id to send the request to
23225    #[allow(clippy::too_many_arguments)]
23226    pub async fn set_default_channel_administrator_rights(default_channel_administrator_rights: Option<crate::types::ChatAdministratorRights>, client_id: i32) -> Result<(), crate::types::Error> {
23227        let request = json!({
23228            "@type": "setDefaultChannelAdministratorRights",
23229            "default_channel_administrator_rights": default_channel_administrator_rights,
23230        });
23231        let response = send_request(client_id, request).await;
23232        if response["@type"] == "error" {
23233            return Err(serde_json::from_value(response).unwrap())
23234        }
23235        Ok(())
23236    }
23237    /// Checks whether the specified bot can send messages to the user. Returns a 404 error if can't and the access can be granted by call to allowBotToSendMessages
23238    /// # Arguments
23239    /// * `bot_user_id` - Identifier of the target bot
23240    /// * `client_id` - The client id to send the request to
23241    #[allow(clippy::too_many_arguments)]
23242    pub async fn can_bot_send_messages(bot_user_id: i64, client_id: i32) -> Result<(), crate::types::Error> {
23243        let request = json!({
23244            "@type": "canBotSendMessages",
23245            "bot_user_id": bot_user_id,
23246        });
23247        let response = send_request(client_id, request).await;
23248        if response["@type"] == "error" {
23249            return Err(serde_json::from_value(response).unwrap())
23250        }
23251        Ok(())
23252    }
23253    /// Allows the specified bot to send messages to the user
23254    /// # Arguments
23255    /// * `bot_user_id` - Identifier of the target bot
23256    /// * `client_id` - The client id to send the request to
23257    #[allow(clippy::too_many_arguments)]
23258    pub async fn allow_bot_to_send_messages(bot_user_id: i64, client_id: i32) -> Result<(), crate::types::Error> {
23259        let request = json!({
23260            "@type": "allowBotToSendMessages",
23261            "bot_user_id": bot_user_id,
23262        });
23263        let response = send_request(client_id, request).await;
23264        if response["@type"] == "error" {
23265            return Err(serde_json::from_value(response).unwrap())
23266        }
23267        Ok(())
23268    }
23269    /// Sends a custom request from a Web App
23270    /// # Arguments
23271    /// * `bot_user_id` - Identifier of the bot
23272    /// * `method` - The method name
23273    /// * `parameters` - JSON-serialized method parameters
23274    /// * `client_id` - The client id to send the request to
23275    #[allow(clippy::too_many_arguments)]
23276    pub async fn send_web_app_custom_request(bot_user_id: i64, method: String, parameters: String, client_id: i32) -> Result<crate::enums::CustomRequestResult, crate::types::Error> {
23277        let request = json!({
23278            "@type": "sendWebAppCustomRequest",
23279            "bot_user_id": bot_user_id,
23280            "method": method,
23281            "parameters": parameters,
23282        });
23283        let response = send_request(client_id, request).await;
23284        if response["@type"] == "error" {
23285            return Err(serde_json::from_value(response).unwrap())
23286        }
23287        Ok(serde_json::from_value(response).unwrap())
23288    }
23289    /// Sets the name of a bot. Can be called only if userTypeBot.can_be_edited == true
23290    /// # Arguments
23291    /// * `bot_user_id` - Identifier of the target bot
23292    /// * `language_code` - A two-letter ISO 639-1 language code. If empty, the name will be shown to all users for whose languages there is no dedicated name
23293    /// * `name` - New bot's name on the specified language; 0-64 characters; must be non-empty if language code is empty
23294    /// * `client_id` - The client id to send the request to
23295    #[allow(clippy::too_many_arguments)]
23296    pub async fn set_bot_name(bot_user_id: i64, language_code: String, name: String, client_id: i32) -> Result<(), crate::types::Error> {
23297        let request = json!({
23298            "@type": "setBotName",
23299            "bot_user_id": bot_user_id,
23300            "language_code": language_code,
23301            "name": name,
23302        });
23303        let response = send_request(client_id, request).await;
23304        if response["@type"] == "error" {
23305            return Err(serde_json::from_value(response).unwrap())
23306        }
23307        Ok(())
23308    }
23309    /// Returns the name of a bot in the given language. Can be called only if userTypeBot.can_be_edited == true
23310    /// # Arguments
23311    /// * `bot_user_id` - Identifier of the target bot
23312    /// * `language_code` - A two-letter ISO 639-1 language code or an empty string
23313    /// * `client_id` - The client id to send the request to
23314    #[allow(clippy::too_many_arguments)]
23315    pub async fn get_bot_name(bot_user_id: i64, language_code: String, client_id: i32) -> Result<crate::enums::Text, crate::types::Error> {
23316        let request = json!({
23317            "@type": "getBotName",
23318            "bot_user_id": bot_user_id,
23319            "language_code": language_code,
23320        });
23321        let response = send_request(client_id, request).await;
23322        if response["@type"] == "error" {
23323            return Err(serde_json::from_value(response).unwrap())
23324        }
23325        Ok(serde_json::from_value(response).unwrap())
23326    }
23327    /// Changes a profile photo for a bot
23328    /// # Arguments
23329    /// * `bot_user_id` - Identifier of the target bot
23330    /// * `photo` - Profile photo to set; pass null to delete the chat photo
23331    /// * `client_id` - The client id to send the request to
23332    #[allow(clippy::too_many_arguments)]
23333    pub async fn set_bot_profile_photo(bot_user_id: i64, photo: Option<crate::enums::InputChatPhoto>, client_id: i32) -> Result<(), crate::types::Error> {
23334        let request = json!({
23335            "@type": "setBotProfilePhoto",
23336            "bot_user_id": bot_user_id,
23337            "photo": photo,
23338        });
23339        let response = send_request(client_id, request).await;
23340        if response["@type"] == "error" {
23341            return Err(serde_json::from_value(response).unwrap())
23342        }
23343        Ok(())
23344    }
23345    /// Changes active state for a username of a bot. The editable username can't be disabled. May return an error with a message "USERNAMES_ACTIVE_TOO_MUCH" if the maximum number of active usernames has been reached. Can be called only if userTypeBot.can_be_edited == true
23346    /// # Arguments
23347    /// * `bot_user_id` - Identifier of the target bot
23348    /// * `username` - The username to change
23349    /// * `is_active` - Pass true to activate the username; pass false to disable it
23350    /// * `client_id` - The client id to send the request to
23351    #[allow(clippy::too_many_arguments)]
23352    pub async fn toggle_bot_username_is_active(bot_user_id: i64, username: String, is_active: bool, client_id: i32) -> Result<(), crate::types::Error> {
23353        let request = json!({
23354            "@type": "toggleBotUsernameIsActive",
23355            "bot_user_id": bot_user_id,
23356            "username": username,
23357            "is_active": is_active,
23358        });
23359        let response = send_request(client_id, request).await;
23360        if response["@type"] == "error" {
23361            return Err(serde_json::from_value(response).unwrap())
23362        }
23363        Ok(())
23364    }
23365    /// Changes order of active usernames of a bot. Can be called only if userTypeBot.can_be_edited == true
23366    /// # Arguments
23367    /// * `bot_user_id` - Identifier of the target bot
23368    /// * `usernames` - The new order of active usernames. All currently active usernames must be specified
23369    /// * `client_id` - The client id to send the request to
23370    #[allow(clippy::too_many_arguments)]
23371    pub async fn reorder_bot_active_usernames(bot_user_id: i64, usernames: Vec<String>, client_id: i32) -> Result<(), crate::types::Error> {
23372        let request = json!({
23373            "@type": "reorderBotActiveUsernames",
23374            "bot_user_id": bot_user_id,
23375            "usernames": usernames,
23376        });
23377        let response = send_request(client_id, request).await;
23378        if response["@type"] == "error" {
23379            return Err(serde_json::from_value(response).unwrap())
23380        }
23381        Ok(())
23382    }
23383    /// Sets the text shown in the chat with a bot if the chat is empty. Can be called only if userTypeBot.can_be_edited == true
23384    /// # Arguments
23385    /// * `bot_user_id` - Identifier of the target bot
23386    /// * `language_code` - A two-letter ISO 639-1 language code. If empty, the description will be shown to all users for whose languages there is no dedicated description
23387    /// * `description` - New bot's description on the specified language
23388    /// * `client_id` - The client id to send the request to
23389    #[allow(clippy::too_many_arguments)]
23390    pub async fn set_bot_info_description(bot_user_id: i64, language_code: String, description: String, client_id: i32) -> Result<(), crate::types::Error> {
23391        let request = json!({
23392            "@type": "setBotInfoDescription",
23393            "bot_user_id": bot_user_id,
23394            "language_code": language_code,
23395            "description": description,
23396        });
23397        let response = send_request(client_id, request).await;
23398        if response["@type"] == "error" {
23399            return Err(serde_json::from_value(response).unwrap())
23400        }
23401        Ok(())
23402    }
23403    /// Returns the text shown in the chat with a bot if the chat is empty in the given language. Can be called only if userTypeBot.can_be_edited == true
23404    /// # Arguments
23405    /// * `bot_user_id` - Identifier of the target bot
23406    /// * `language_code` - A two-letter ISO 639-1 language code or an empty string
23407    /// * `client_id` - The client id to send the request to
23408    #[allow(clippy::too_many_arguments)]
23409    pub async fn get_bot_info_description(bot_user_id: i64, language_code: String, client_id: i32) -> Result<crate::enums::Text, crate::types::Error> {
23410        let request = json!({
23411            "@type": "getBotInfoDescription",
23412            "bot_user_id": bot_user_id,
23413            "language_code": language_code,
23414        });
23415        let response = send_request(client_id, request).await;
23416        if response["@type"] == "error" {
23417            return Err(serde_json::from_value(response).unwrap())
23418        }
23419        Ok(serde_json::from_value(response).unwrap())
23420    }
23421    /// Sets the text shown on a bot's profile page and sent together with the link when users share the bot. Can be called only if userTypeBot.can_be_edited == true
23422    /// # Arguments
23423    /// * `bot_user_id` - Identifier of the target bot
23424    /// * `language_code` - A two-letter ISO 639-1 language code. If empty, the short description will be shown to all users for whose languages there is no dedicated description
23425    /// * `short_description` - New bot's short description on the specified language
23426    /// * `client_id` - The client id to send the request to
23427    #[allow(clippy::too_many_arguments)]
23428    pub async fn set_bot_info_short_description(bot_user_id: i64, language_code: String, short_description: String, client_id: i32) -> Result<(), crate::types::Error> {
23429        let request = json!({
23430            "@type": "setBotInfoShortDescription",
23431            "bot_user_id": bot_user_id,
23432            "language_code": language_code,
23433            "short_description": short_description,
23434        });
23435        let response = send_request(client_id, request).await;
23436        if response["@type"] == "error" {
23437            return Err(serde_json::from_value(response).unwrap())
23438        }
23439        Ok(())
23440    }
23441    /// Returns the text shown on a bot's profile page and sent together with the link when users share the bot in the given language. Can be called only if userTypeBot.can_be_edited == true
23442    /// # Arguments
23443    /// * `bot_user_id` - Identifier of the target bot
23444    /// * `language_code` - A two-letter ISO 639-1 language code or an empty string
23445    /// * `client_id` - The client id to send the request to
23446    #[allow(clippy::too_many_arguments)]
23447    pub async fn get_bot_info_short_description(bot_user_id: i64, language_code: String, client_id: i32) -> Result<crate::enums::Text, crate::types::Error> {
23448        let request = json!({
23449            "@type": "getBotInfoShortDescription",
23450            "bot_user_id": bot_user_id,
23451            "language_code": language_code,
23452        });
23453        let response = send_request(client_id, request).await;
23454        if response["@type"] == "error" {
23455            return Err(serde_json::from_value(response).unwrap())
23456        }
23457        Ok(serde_json::from_value(response).unwrap())
23458    }
23459    /// Returns all active sessions of the current user
23460    /// # Arguments
23461    /// * `client_id` - The client id to send the request to
23462    #[allow(clippy::too_many_arguments)]
23463    pub async fn get_active_sessions(client_id: i32) -> Result<crate::enums::Sessions, crate::types::Error> {
23464        let request = json!({
23465            "@type": "getActiveSessions",
23466        });
23467        let response = send_request(client_id, request).await;
23468        if response["@type"] == "error" {
23469            return Err(serde_json::from_value(response).unwrap())
23470        }
23471        Ok(serde_json::from_value(response).unwrap())
23472    }
23473    /// Terminates a session of the current user
23474    /// # Arguments
23475    /// * `session_id` - Session identifier
23476    /// * `client_id` - The client id to send the request to
23477    #[allow(clippy::too_many_arguments)]
23478    pub async fn terminate_session(session_id: i64, client_id: i32) -> Result<(), crate::types::Error> {
23479        let request = json!({
23480            "@type": "terminateSession",
23481            "session_id": session_id,
23482        });
23483        let response = send_request(client_id, request).await;
23484        if response["@type"] == "error" {
23485            return Err(serde_json::from_value(response).unwrap())
23486        }
23487        Ok(())
23488    }
23489    /// Terminates all other sessions of the current user
23490    /// # Arguments
23491    /// * `client_id` - The client id to send the request to
23492    #[allow(clippy::too_many_arguments)]
23493    pub async fn terminate_all_other_sessions(client_id: i32) -> Result<(), crate::types::Error> {
23494        let request = json!({
23495            "@type": "terminateAllOtherSessions",
23496        });
23497        let response = send_request(client_id, request).await;
23498        if response["@type"] == "error" {
23499            return Err(serde_json::from_value(response).unwrap())
23500        }
23501        Ok(())
23502    }
23503    /// Confirms an unconfirmed session of the current user from another device
23504    /// # Arguments
23505    /// * `session_id` - Session identifier
23506    /// * `client_id` - The client id to send the request to
23507    #[allow(clippy::too_many_arguments)]
23508    pub async fn confirm_session(session_id: i64, client_id: i32) -> Result<(), crate::types::Error> {
23509        let request = json!({
23510            "@type": "confirmSession",
23511            "session_id": session_id,
23512        });
23513        let response = send_request(client_id, request).await;
23514        if response["@type"] == "error" {
23515            return Err(serde_json::from_value(response).unwrap())
23516        }
23517        Ok(())
23518    }
23519    /// Toggles whether a session can accept incoming calls
23520    /// # Arguments
23521    /// * `session_id` - Session identifier
23522    /// * `can_accept_calls` - Pass true to allow accepting incoming calls by the session; pass false otherwise
23523    /// * `client_id` - The client id to send the request to
23524    #[allow(clippy::too_many_arguments)]
23525    pub async fn toggle_session_can_accept_calls(session_id: i64, can_accept_calls: bool, client_id: i32) -> Result<(), crate::types::Error> {
23526        let request = json!({
23527            "@type": "toggleSessionCanAcceptCalls",
23528            "session_id": session_id,
23529            "can_accept_calls": can_accept_calls,
23530        });
23531        let response = send_request(client_id, request).await;
23532        if response["@type"] == "error" {
23533            return Err(serde_json::from_value(response).unwrap())
23534        }
23535        Ok(())
23536    }
23537    /// Toggles whether a session can accept incoming secret chats
23538    /// # Arguments
23539    /// * `session_id` - Session identifier
23540    /// * `can_accept_secret_chats` - Pass true to allow accepting secret chats by the session; pass false otherwise
23541    /// * `client_id` - The client id to send the request to
23542    #[allow(clippy::too_many_arguments)]
23543    pub async fn toggle_session_can_accept_secret_chats(session_id: i64, can_accept_secret_chats: bool, client_id: i32) -> Result<(), crate::types::Error> {
23544        let request = json!({
23545            "@type": "toggleSessionCanAcceptSecretChats",
23546            "session_id": session_id,
23547            "can_accept_secret_chats": can_accept_secret_chats,
23548        });
23549        let response = send_request(client_id, request).await;
23550        if response["@type"] == "error" {
23551            return Err(serde_json::from_value(response).unwrap())
23552        }
23553        Ok(())
23554    }
23555    /// Changes the period of inactivity after which sessions will automatically be terminated
23556    /// # Arguments
23557    /// * `inactive_session_ttl_days` - New number of days of inactivity before sessions will be automatically terminated; 1-366 days
23558    /// * `client_id` - The client id to send the request to
23559    #[allow(clippy::too_many_arguments)]
23560    pub async fn set_inactive_session_ttl(inactive_session_ttl_days: i32, client_id: i32) -> Result<(), crate::types::Error> {
23561        let request = json!({
23562            "@type": "setInactiveSessionTtl",
23563            "inactive_session_ttl_days": inactive_session_ttl_days,
23564        });
23565        let response = send_request(client_id, request).await;
23566        if response["@type"] == "error" {
23567            return Err(serde_json::from_value(response).unwrap())
23568        }
23569        Ok(())
23570    }
23571    /// Returns all website where the current user used Telegram to log in
23572    /// # Arguments
23573    /// * `client_id` - The client id to send the request to
23574    #[allow(clippy::too_many_arguments)]
23575    pub async fn get_connected_websites(client_id: i32) -> Result<crate::enums::ConnectedWebsites, crate::types::Error> {
23576        let request = json!({
23577            "@type": "getConnectedWebsites",
23578        });
23579        let response = send_request(client_id, request).await;
23580        if response["@type"] == "error" {
23581            return Err(serde_json::from_value(response).unwrap())
23582        }
23583        Ok(serde_json::from_value(response).unwrap())
23584    }
23585    /// Disconnects website from the current user's Telegram account
23586    /// # Arguments
23587    /// * `website_id` - Website identifier
23588    /// * `client_id` - The client id to send the request to
23589    #[allow(clippy::too_many_arguments)]
23590    pub async fn disconnect_website(website_id: i64, client_id: i32) -> Result<(), crate::types::Error> {
23591        let request = json!({
23592            "@type": "disconnectWebsite",
23593            "website_id": website_id,
23594        });
23595        let response = send_request(client_id, request).await;
23596        if response["@type"] == "error" {
23597            return Err(serde_json::from_value(response).unwrap())
23598        }
23599        Ok(())
23600    }
23601    /// Disconnects all websites from the current user's Telegram account
23602    /// # Arguments
23603    /// * `client_id` - The client id to send the request to
23604    #[allow(clippy::too_many_arguments)]
23605    pub async fn disconnect_all_websites(client_id: i32) -> Result<(), crate::types::Error> {
23606        let request = json!({
23607            "@type": "disconnectAllWebsites",
23608        });
23609        let response = send_request(client_id, request).await;
23610        if response["@type"] == "error" {
23611            return Err(serde_json::from_value(response).unwrap())
23612        }
23613        Ok(())
23614    }
23615    /// Changes the editable username of a supergroup or channel, requires owner privileges in the supergroup or channel
23616    /// # Arguments
23617    /// * `supergroup_id` - Identifier of the supergroup or channel
23618    /// * `username` - New value of the username. Use an empty string to remove the username. The username can't be completely removed if there is another active or disabled username
23619    /// * `client_id` - The client id to send the request to
23620    #[allow(clippy::too_many_arguments)]
23621    pub async fn set_supergroup_username(supergroup_id: i64, username: String, client_id: i32) -> Result<(), crate::types::Error> {
23622        let request = json!({
23623            "@type": "setSupergroupUsername",
23624            "supergroup_id": supergroup_id,
23625            "username": username,
23626        });
23627        let response = send_request(client_id, request).await;
23628        if response["@type"] == "error" {
23629            return Err(serde_json::from_value(response).unwrap())
23630        }
23631        Ok(())
23632    }
23633    /// Changes active state for a username of a supergroup or channel, requires owner privileges in the supergroup or channel. The editable username can't be disabled.
23634    /// May return an error with a message "USERNAMES_ACTIVE_TOO_MUCH" if the maximum number of active usernames has been reached
23635    /// # Arguments
23636    /// * `supergroup_id` - Identifier of the supergroup or channel
23637    /// * `username` - The username to change
23638    /// * `is_active` - Pass true to activate the username; pass false to disable it
23639    /// * `client_id` - The client id to send the request to
23640    #[allow(clippy::too_many_arguments)]
23641    pub async fn toggle_supergroup_username_is_active(supergroup_id: i64, username: String, is_active: bool, client_id: i32) -> Result<(), crate::types::Error> {
23642        let request = json!({
23643            "@type": "toggleSupergroupUsernameIsActive",
23644            "supergroup_id": supergroup_id,
23645            "username": username,
23646            "is_active": is_active,
23647        });
23648        let response = send_request(client_id, request).await;
23649        if response["@type"] == "error" {
23650            return Err(serde_json::from_value(response).unwrap())
23651        }
23652        Ok(())
23653    }
23654    /// Disables all active non-editable usernames of a supergroup or channel, requires owner privileges in the supergroup or channel
23655    /// # Arguments
23656    /// * `supergroup_id` - Identifier of the supergroup or channel
23657    /// * `client_id` - The client id to send the request to
23658    #[allow(clippy::too_many_arguments)]
23659    pub async fn disable_all_supergroup_usernames(supergroup_id: i64, client_id: i32) -> Result<(), crate::types::Error> {
23660        let request = json!({
23661            "@type": "disableAllSupergroupUsernames",
23662            "supergroup_id": supergroup_id,
23663        });
23664        let response = send_request(client_id, request).await;
23665        if response["@type"] == "error" {
23666            return Err(serde_json::from_value(response).unwrap())
23667        }
23668        Ok(())
23669    }
23670    /// Changes order of active usernames of a supergroup or channel, requires owner privileges in the supergroup or channel
23671    /// # Arguments
23672    /// * `supergroup_id` - Identifier of the supergroup or channel
23673    /// * `usernames` - The new order of active usernames. All currently active usernames must be specified
23674    /// * `client_id` - The client id to send the request to
23675    #[allow(clippy::too_many_arguments)]
23676    pub async fn reorder_supergroup_active_usernames(supergroup_id: i64, usernames: Vec<String>, client_id: i32) -> Result<(), crate::types::Error> {
23677        let request = json!({
23678            "@type": "reorderSupergroupActiveUsernames",
23679            "supergroup_id": supergroup_id,
23680            "usernames": usernames,
23681        });
23682        let response = send_request(client_id, request).await;
23683        if response["@type"] == "error" {
23684            return Err(serde_json::from_value(response).unwrap())
23685        }
23686        Ok(())
23687    }
23688    /// Changes the sticker set of a supergroup; requires can_change_info administrator right
23689    /// # Arguments
23690    /// * `supergroup_id` - Identifier of the supergroup
23691    /// * `sticker_set_id` - New value of the supergroup sticker set identifier. Use 0 to remove the supergroup sticker set
23692    /// * `client_id` - The client id to send the request to
23693    #[allow(clippy::too_many_arguments)]
23694    pub async fn set_supergroup_sticker_set(supergroup_id: i64, sticker_set_id: i64, client_id: i32) -> Result<(), crate::types::Error> {
23695        let request = json!({
23696            "@type": "setSupergroupStickerSet",
23697            "supergroup_id": supergroup_id,
23698            "sticker_set_id": sticker_set_id,
23699        });
23700        let response = send_request(client_id, request).await;
23701        if response["@type"] == "error" {
23702            return Err(serde_json::from_value(response).unwrap())
23703        }
23704        Ok(())
23705    }
23706    /// Toggles whether sender signature is added to sent messages in a channel; requires can_change_info administrator right
23707    /// # Arguments
23708    /// * `supergroup_id` - Identifier of the channel
23709    /// * `sign_messages` - New value of sign_messages
23710    /// * `client_id` - The client id to send the request to
23711    #[allow(clippy::too_many_arguments)]
23712    pub async fn toggle_supergroup_sign_messages(supergroup_id: i64, sign_messages: bool, client_id: i32) -> Result<(), crate::types::Error> {
23713        let request = json!({
23714            "@type": "toggleSupergroupSignMessages",
23715            "supergroup_id": supergroup_id,
23716            "sign_messages": sign_messages,
23717        });
23718        let response = send_request(client_id, request).await;
23719        if response["@type"] == "error" {
23720            return Err(serde_json::from_value(response).unwrap())
23721        }
23722        Ok(())
23723    }
23724    /// Toggles whether joining is mandatory to send messages to a discussion supergroup; requires can_restrict_members administrator right
23725    /// # Arguments
23726    /// * `supergroup_id` - Identifier of the supergroup
23727    /// * `join_to_send_messages` - New value of join_to_send_messages
23728    /// * `client_id` - The client id to send the request to
23729    #[allow(clippy::too_many_arguments)]
23730    pub async fn toggle_supergroup_join_to_send_messages(supergroup_id: i64, join_to_send_messages: bool, client_id: i32) -> Result<(), crate::types::Error> {
23731        let request = json!({
23732            "@type": "toggleSupergroupJoinToSendMessages",
23733            "supergroup_id": supergroup_id,
23734            "join_to_send_messages": join_to_send_messages,
23735        });
23736        let response = send_request(client_id, request).await;
23737        if response["@type"] == "error" {
23738            return Err(serde_json::from_value(response).unwrap())
23739        }
23740        Ok(())
23741    }
23742    /// Toggles whether all users directly joining the supergroup need to be approved by supergroup administrators; requires can_restrict_members administrator right
23743    /// # Arguments
23744    /// * `supergroup_id` - Identifier of the channel
23745    /// * `join_by_request` - New value of join_by_request
23746    /// * `client_id` - The client id to send the request to
23747    #[allow(clippy::too_many_arguments)]
23748    pub async fn toggle_supergroup_join_by_request(supergroup_id: i64, join_by_request: bool, client_id: i32) -> Result<(), crate::types::Error> {
23749        let request = json!({
23750            "@type": "toggleSupergroupJoinByRequest",
23751            "supergroup_id": supergroup_id,
23752            "join_by_request": join_by_request,
23753        });
23754        let response = send_request(client_id, request).await;
23755        if response["@type"] == "error" {
23756            return Err(serde_json::from_value(response).unwrap())
23757        }
23758        Ok(())
23759    }
23760    /// Toggles whether the message history of a supergroup is available to new members; requires can_change_info administrator right
23761    /// # Arguments
23762    /// * `supergroup_id` - The identifier of the supergroup
23763    /// * `is_all_history_available` - The new value of is_all_history_available
23764    /// * `client_id` - The client id to send the request to
23765    #[allow(clippy::too_many_arguments)]
23766    pub async fn toggle_supergroup_is_all_history_available(supergroup_id: i64, is_all_history_available: bool, client_id: i32) -> Result<(), crate::types::Error> {
23767        let request = json!({
23768            "@type": "toggleSupergroupIsAllHistoryAvailable",
23769            "supergroup_id": supergroup_id,
23770            "is_all_history_available": is_all_history_available,
23771        });
23772        let response = send_request(client_id, request).await;
23773        if response["@type"] == "error" {
23774            return Err(serde_json::from_value(response).unwrap())
23775        }
23776        Ok(())
23777    }
23778    /// Toggles whether non-administrators can receive only administrators and bots using getSupergroupMembers or searchChatMembers. Can be called only if supergroupFullInfo.can_hide_members == true
23779    /// # Arguments
23780    /// * `supergroup_id` - Identifier of the supergroup
23781    /// * `has_hidden_members` - New value of has_hidden_members
23782    /// * `client_id` - The client id to send the request to
23783    #[allow(clippy::too_many_arguments)]
23784    pub async fn toggle_supergroup_has_hidden_members(supergroup_id: i64, has_hidden_members: bool, client_id: i32) -> Result<(), crate::types::Error> {
23785        let request = json!({
23786            "@type": "toggleSupergroupHasHiddenMembers",
23787            "supergroup_id": supergroup_id,
23788            "has_hidden_members": has_hidden_members,
23789        });
23790        let response = send_request(client_id, request).await;
23791        if response["@type"] == "error" {
23792            return Err(serde_json::from_value(response).unwrap())
23793        }
23794        Ok(())
23795    }
23796    /// Toggles whether aggressive anti-spam checks are enabled in the supergroup. Can be called only if supergroupFullInfo.can_toggle_aggressive_anti_spam == true
23797    /// # Arguments
23798    /// * `supergroup_id` - The identifier of the supergroup, which isn't a broadcast group
23799    /// * `has_aggressive_anti_spam_enabled` - The new value of has_aggressive_anti_spam_enabled
23800    /// * `client_id` - The client id to send the request to
23801    #[allow(clippy::too_many_arguments)]
23802    pub async fn toggle_supergroup_has_aggressive_anti_spam_enabled(supergroup_id: i64, has_aggressive_anti_spam_enabled: bool, client_id: i32) -> Result<(), crate::types::Error> {
23803        let request = json!({
23804            "@type": "toggleSupergroupHasAggressiveAntiSpamEnabled",
23805            "supergroup_id": supergroup_id,
23806            "has_aggressive_anti_spam_enabled": has_aggressive_anti_spam_enabled,
23807        });
23808        let response = send_request(client_id, request).await;
23809        if response["@type"] == "error" {
23810            return Err(serde_json::from_value(response).unwrap())
23811        }
23812        Ok(())
23813    }
23814    /// Toggles whether the supergroup is a forum; requires owner privileges in the supergroup. Discussion supergroups can't be converted to forums
23815    /// # Arguments
23816    /// * `supergroup_id` - Identifier of the supergroup
23817    /// * `is_forum` - New value of is_forum
23818    /// * `client_id` - The client id to send the request to
23819    #[allow(clippy::too_many_arguments)]
23820    pub async fn toggle_supergroup_is_forum(supergroup_id: i64, is_forum: bool, client_id: i32) -> Result<(), crate::types::Error> {
23821        let request = json!({
23822            "@type": "toggleSupergroupIsForum",
23823            "supergroup_id": supergroup_id,
23824            "is_forum": is_forum,
23825        });
23826        let response = send_request(client_id, request).await;
23827        if response["@type"] == "error" {
23828            return Err(serde_json::from_value(response).unwrap())
23829        }
23830        Ok(())
23831    }
23832    /// Upgrades supergroup to a broadcast group; requires owner privileges in the supergroup
23833    /// # Arguments
23834    /// * `supergroup_id` - Identifier of the supergroup
23835    /// * `client_id` - The client id to send the request to
23836    #[allow(clippy::too_many_arguments)]
23837    pub async fn toggle_supergroup_is_broadcast_group(supergroup_id: i64, client_id: i32) -> Result<(), crate::types::Error> {
23838        let request = json!({
23839            "@type": "toggleSupergroupIsBroadcastGroup",
23840            "supergroup_id": supergroup_id,
23841        });
23842        let response = send_request(client_id, request).await;
23843        if response["@type"] == "error" {
23844            return Err(serde_json::from_value(response).unwrap())
23845        }
23846        Ok(())
23847    }
23848    /// Reports messages in a supergroup as spam; requires administrator rights in the supergroup
23849    /// # Arguments
23850    /// * `supergroup_id` - Supergroup identifier
23851    /// * `message_ids` - Identifiers of messages to report
23852    /// * `client_id` - The client id to send the request to
23853    #[allow(clippy::too_many_arguments)]
23854    pub async fn report_supergroup_spam(supergroup_id: i64, message_ids: Vec<i64>, client_id: i32) -> Result<(), crate::types::Error> {
23855        let request = json!({
23856            "@type": "reportSupergroupSpam",
23857            "supergroup_id": supergroup_id,
23858            "message_ids": message_ids,
23859        });
23860        let response = send_request(client_id, request).await;
23861        if response["@type"] == "error" {
23862            return Err(serde_json::from_value(response).unwrap())
23863        }
23864        Ok(())
23865    }
23866    /// Reports a false deletion of a message by aggressive anti-spam checks; requires administrator rights in the supergroup. Can be called only for messages from chatEventMessageDeleted with can_report_anti_spam_false_positive == true
23867    /// # Arguments
23868    /// * `supergroup_id` - Supergroup identifier
23869    /// * `message_id` - Identifier of the erroneously deleted message
23870    /// * `client_id` - The client id to send the request to
23871    #[allow(clippy::too_many_arguments)]
23872    pub async fn report_supergroup_anti_spam_false_positive(supergroup_id: i64, message_id: i64, client_id: i32) -> Result<(), crate::types::Error> {
23873        let request = json!({
23874            "@type": "reportSupergroupAntiSpamFalsePositive",
23875            "supergroup_id": supergroup_id,
23876            "message_id": message_id,
23877        });
23878        let response = send_request(client_id, request).await;
23879        if response["@type"] == "error" {
23880            return Err(serde_json::from_value(response).unwrap())
23881        }
23882        Ok(())
23883    }
23884    /// Returns information about members or banned users in a supergroup or channel. Can be used only if supergroupFullInfo.can_get_members == true; additionally, administrator privileges may be required for some filters
23885    /// # Arguments
23886    /// * `supergroup_id` - Identifier of the supergroup or channel
23887    /// * `filter` - The type of users to return; pass null to use supergroupMembersFilterRecent
23888    /// * `offset` - Number of users to skip
23889    /// * `limit` - The maximum number of users be returned; up to 200
23890    /// * `client_id` - The client id to send the request to
23891    #[allow(clippy::too_many_arguments)]
23892    pub async fn get_supergroup_members(supergroup_id: i64, filter: Option<crate::enums::SupergroupMembersFilter>, offset: i32, limit: i32, client_id: i32) -> Result<crate::enums::ChatMembers, crate::types::Error> {
23893        let request = json!({
23894            "@type": "getSupergroupMembers",
23895            "supergroup_id": supergroup_id,
23896            "filter": filter,
23897            "offset": offset,
23898            "limit": limit,
23899        });
23900        let response = send_request(client_id, request).await;
23901        if response["@type"] == "error" {
23902            return Err(serde_json::from_value(response).unwrap())
23903        }
23904        Ok(serde_json::from_value(response).unwrap())
23905    }
23906    /// Closes a secret chat, effectively transferring its state to secretChatStateClosed
23907    /// # Arguments
23908    /// * `secret_chat_id` - Secret chat identifier
23909    /// * `client_id` - The client id to send the request to
23910    #[allow(clippy::too_many_arguments)]
23911    pub async fn close_secret_chat(secret_chat_id: i32, client_id: i32) -> Result<(), crate::types::Error> {
23912        let request = json!({
23913            "@type": "closeSecretChat",
23914            "secret_chat_id": secret_chat_id,
23915        });
23916        let response = send_request(client_id, request).await;
23917        if response["@type"] == "error" {
23918            return Err(serde_json::from_value(response).unwrap())
23919        }
23920        Ok(())
23921    }
23922    /// Returns a list of service actions taken by chat members and administrators in the last 48 hours. Available only for supergroups and channels. Requires administrator rights. Returns results in reverse chronological order (i.e., in order of decreasing event_id)
23923    /// # Arguments
23924    /// * `chat_id` - Chat identifier
23925    /// * `query` - Search query by which to filter events
23926    /// * `from_event_id` - Identifier of an event from which to return results. Use 0 to get results from the latest events
23927    /// * `limit` - The maximum number of events to return; up to 100
23928    /// * `filters` - The types of events to return; pass null to get chat events of all types
23929    /// * `user_ids` - User identifiers by which to filter events. By default, events relating to all users will be returned
23930    /// * `client_id` - The client id to send the request to
23931    #[allow(clippy::too_many_arguments)]
23932    pub async fn get_chat_event_log(chat_id: i64, query: String, from_event_id: i64, limit: i32, filters: Option<crate::types::ChatEventLogFilters>, user_ids: Vec<i64>, client_id: i32) -> Result<crate::enums::ChatEvents, crate::types::Error> {
23933        let request = json!({
23934            "@type": "getChatEventLog",
23935            "chat_id": chat_id,
23936            "query": query,
23937            "from_event_id": from_event_id,
23938            "limit": limit,
23939            "filters": filters,
23940            "user_ids": user_ids,
23941        });
23942        let response = send_request(client_id, request).await;
23943        if response["@type"] == "error" {
23944            return Err(serde_json::from_value(response).unwrap())
23945        }
23946        Ok(serde_json::from_value(response).unwrap())
23947    }
23948    /// Returns an invoice payment form. This method must be called when the user presses inline button of the type inlineKeyboardButtonTypeBuy
23949    /// # Arguments
23950    /// * `input_invoice` - The invoice
23951    /// * `theme` - Preferred payment form theme; pass null to use the default theme
23952    /// * `client_id` - The client id to send the request to
23953    #[allow(clippy::too_many_arguments)]
23954    pub async fn get_payment_form(input_invoice: crate::enums::InputInvoice, theme: Option<crate::types::ThemeParameters>, client_id: i32) -> Result<crate::enums::PaymentForm, crate::types::Error> {
23955        let request = json!({
23956            "@type": "getPaymentForm",
23957            "input_invoice": input_invoice,
23958            "theme": theme,
23959        });
23960        let response = send_request(client_id, request).await;
23961        if response["@type"] == "error" {
23962            return Err(serde_json::from_value(response).unwrap())
23963        }
23964        Ok(serde_json::from_value(response).unwrap())
23965    }
23966    /// Validates the order information provided by a user and returns the available shipping options for a flexible invoice
23967    /// # Arguments
23968    /// * `input_invoice` - The invoice
23969    /// * `order_info` - The order information, provided by the user; pass null if empty
23970    /// * `allow_save` - Pass true to save the order information
23971    /// * `client_id` - The client id to send the request to
23972    #[allow(clippy::too_many_arguments)]
23973    pub async fn validate_order_info(input_invoice: crate::enums::InputInvoice, order_info: Option<crate::types::OrderInfo>, allow_save: bool, client_id: i32) -> Result<crate::enums::ValidatedOrderInfo, crate::types::Error> {
23974        let request = json!({
23975            "@type": "validateOrderInfo",
23976            "input_invoice": input_invoice,
23977            "order_info": order_info,
23978            "allow_save": allow_save,
23979        });
23980        let response = send_request(client_id, request).await;
23981        if response["@type"] == "error" {
23982            return Err(serde_json::from_value(response).unwrap())
23983        }
23984        Ok(serde_json::from_value(response).unwrap())
23985    }
23986    /// Sends a filled-out payment form to the bot for final verification
23987    /// # Arguments
23988    /// * `input_invoice` - The invoice
23989    /// * `payment_form_id` - Payment form identifier returned by getPaymentForm
23990    /// * `order_info_id` - Identifier returned by validateOrderInfo, or an empty string
23991    /// * `shipping_option_id` - Identifier of a chosen shipping option, if applicable
23992    /// * `credentials` - The credentials chosen by user for payment
23993    /// * `tip_amount` - Chosen by the user amount of tip in the smallest units of the currency
23994    /// * `client_id` - The client id to send the request to
23995    #[allow(clippy::too_many_arguments)]
23996    pub async fn send_payment_form(input_invoice: crate::enums::InputInvoice, payment_form_id: i64, order_info_id: String, shipping_option_id: String, credentials: crate::enums::InputCredentials, tip_amount: i64, client_id: i32) -> Result<crate::enums::PaymentResult, crate::types::Error> {
23997        let request = json!({
23998            "@type": "sendPaymentForm",
23999            "input_invoice": input_invoice,
24000            "payment_form_id": payment_form_id,
24001            "order_info_id": order_info_id,
24002            "shipping_option_id": shipping_option_id,
24003            "credentials": credentials,
24004            "tip_amount": tip_amount,
24005        });
24006        let response = send_request(client_id, request).await;
24007        if response["@type"] == "error" {
24008            return Err(serde_json::from_value(response).unwrap())
24009        }
24010        Ok(serde_json::from_value(response).unwrap())
24011    }
24012    /// Returns information about a successful payment
24013    /// # Arguments
24014    /// * `chat_id` - Chat identifier of the messagePaymentSuccessful message
24015    /// * `message_id` - Message identifier
24016    /// * `client_id` - The client id to send the request to
24017    #[allow(clippy::too_many_arguments)]
24018    pub async fn get_payment_receipt(chat_id: i64, message_id: i64, client_id: i32) -> Result<crate::enums::PaymentReceipt, crate::types::Error> {
24019        let request = json!({
24020            "@type": "getPaymentReceipt",
24021            "chat_id": chat_id,
24022            "message_id": message_id,
24023        });
24024        let response = send_request(client_id, request).await;
24025        if response["@type"] == "error" {
24026            return Err(serde_json::from_value(response).unwrap())
24027        }
24028        Ok(serde_json::from_value(response).unwrap())
24029    }
24030    /// Returns saved order information. Returns a 404 error if there is no saved order information
24031    /// # Arguments
24032    /// * `client_id` - The client id to send the request to
24033    #[allow(clippy::too_many_arguments)]
24034    pub async fn get_saved_order_info(client_id: i32) -> Result<crate::enums::OrderInfo, crate::types::Error> {
24035        let request = json!({
24036            "@type": "getSavedOrderInfo",
24037        });
24038        let response = send_request(client_id, request).await;
24039        if response["@type"] == "error" {
24040            return Err(serde_json::from_value(response).unwrap())
24041        }
24042        Ok(serde_json::from_value(response).unwrap())
24043    }
24044    /// Deletes saved order information
24045    /// # Arguments
24046    /// * `client_id` - The client id to send the request to
24047    #[allow(clippy::too_many_arguments)]
24048    pub async fn delete_saved_order_info(client_id: i32) -> Result<(), crate::types::Error> {
24049        let request = json!({
24050            "@type": "deleteSavedOrderInfo",
24051        });
24052        let response = send_request(client_id, request).await;
24053        if response["@type"] == "error" {
24054            return Err(serde_json::from_value(response).unwrap())
24055        }
24056        Ok(())
24057    }
24058    /// Deletes saved credentials for all payment provider bots
24059    /// # Arguments
24060    /// * `client_id` - The client id to send the request to
24061    #[allow(clippy::too_many_arguments)]
24062    pub async fn delete_saved_credentials(client_id: i32) -> Result<(), crate::types::Error> {
24063        let request = json!({
24064            "@type": "deleteSavedCredentials",
24065        });
24066        let response = send_request(client_id, request).await;
24067        if response["@type"] == "error" {
24068            return Err(serde_json::from_value(response).unwrap())
24069        }
24070        Ok(())
24071    }
24072    /// Creates a link for the given invoice; for bots only
24073    /// # Arguments
24074    /// * `invoice` - Information about the invoice of the type inputMessageInvoice
24075    /// * `client_id` - The client id to send the request to
24076    #[allow(clippy::too_many_arguments)]
24077    pub async fn create_invoice_link(invoice: crate::enums::InputMessageContent, client_id: i32) -> Result<crate::enums::HttpUrl, crate::types::Error> {
24078        let request = json!({
24079            "@type": "createInvoiceLink",
24080            "invoice": invoice,
24081        });
24082        let response = send_request(client_id, request).await;
24083        if response["@type"] == "error" {
24084            return Err(serde_json::from_value(response).unwrap())
24085        }
24086        Ok(serde_json::from_value(response).unwrap())
24087    }
24088    /// Returns a user that can be contacted to get support
24089    /// # Arguments
24090    /// * `client_id` - The client id to send the request to
24091    #[allow(clippy::too_many_arguments)]
24092    pub async fn get_support_user(client_id: i32) -> Result<crate::enums::User, crate::types::Error> {
24093        let request = json!({
24094            "@type": "getSupportUser",
24095        });
24096        let response = send_request(client_id, request).await;
24097        if response["@type"] == "error" {
24098            return Err(serde_json::from_value(response).unwrap())
24099        }
24100        Ok(serde_json::from_value(response).unwrap())
24101    }
24102    /// Returns backgrounds installed by the user
24103    /// # Arguments
24104    /// * `for_dark_theme` - Pass true to order returned backgrounds for a dark theme
24105    /// * `client_id` - The client id to send the request to
24106    #[allow(clippy::too_many_arguments)]
24107    pub async fn get_backgrounds(for_dark_theme: bool, client_id: i32) -> Result<crate::enums::Backgrounds, crate::types::Error> {
24108        let request = json!({
24109            "@type": "getBackgrounds",
24110            "for_dark_theme": for_dark_theme,
24111        });
24112        let response = send_request(client_id, request).await;
24113        if response["@type"] == "error" {
24114            return Err(serde_json::from_value(response).unwrap())
24115        }
24116        Ok(serde_json::from_value(response).unwrap())
24117    }
24118    /// Constructs a persistent HTTP URL for a background
24119    /// # Arguments
24120    /// * `name` - Background name
24121    /// * `r#type` - Background type
24122    /// * `client_id` - The client id to send the request to
24123    #[allow(clippy::too_many_arguments)]
24124    pub async fn get_background_url(name: String, r#type: crate::enums::BackgroundType, client_id: i32) -> Result<crate::enums::HttpUrl, crate::types::Error> {
24125        let request = json!({
24126            "@type": "getBackgroundUrl",
24127            "name": name,
24128            "type": r#type,
24129        });
24130        let response = send_request(client_id, request).await;
24131        if response["@type"] == "error" {
24132            return Err(serde_json::from_value(response).unwrap())
24133        }
24134        Ok(serde_json::from_value(response).unwrap())
24135    }
24136    /// Searches for a background by its name
24137    /// # Arguments
24138    /// * `name` - The name of the background
24139    /// * `client_id` - The client id to send the request to
24140    #[allow(clippy::too_many_arguments)]
24141    pub async fn search_background(name: String, client_id: i32) -> Result<crate::enums::Background, crate::types::Error> {
24142        let request = json!({
24143            "@type": "searchBackground",
24144            "name": name,
24145        });
24146        let response = send_request(client_id, request).await;
24147        if response["@type"] == "error" {
24148            return Err(serde_json::from_value(response).unwrap())
24149        }
24150        Ok(serde_json::from_value(response).unwrap())
24151    }
24152    /// Changes the background selected by the user; adds background to the list of installed backgrounds
24153    /// # Arguments
24154    /// * `background` - The input background to use; pass null to create a new filled background or to remove the current background
24155    /// * `r#type` - Background type; pass null to use the default type of the remote background or to remove the current background
24156    /// * `for_dark_theme` - Pass true if the background is changed for a dark theme
24157    /// * `client_id` - The client id to send the request to
24158    #[allow(clippy::too_many_arguments)]
24159    pub async fn set_background(background: Option<crate::enums::InputBackground>, r#type: Option<crate::enums::BackgroundType>, for_dark_theme: bool, client_id: i32) -> Result<crate::enums::Background, crate::types::Error> {
24160        let request = json!({
24161            "@type": "setBackground",
24162            "background": background,
24163            "type": r#type,
24164            "for_dark_theme": for_dark_theme,
24165        });
24166        let response = send_request(client_id, request).await;
24167        if response["@type"] == "error" {
24168            return Err(serde_json::from_value(response).unwrap())
24169        }
24170        Ok(serde_json::from_value(response).unwrap())
24171    }
24172    /// Removes background from the list of installed backgrounds
24173    /// # Arguments
24174    /// * `background_id` - The background identifier
24175    /// * `client_id` - The client id to send the request to
24176    #[allow(clippy::too_many_arguments)]
24177    pub async fn remove_background(background_id: i64, client_id: i32) -> Result<(), crate::types::Error> {
24178        let request = json!({
24179            "@type": "removeBackground",
24180            "background_id": background_id,
24181        });
24182        let response = send_request(client_id, request).await;
24183        if response["@type"] == "error" {
24184            return Err(serde_json::from_value(response).unwrap())
24185        }
24186        Ok(())
24187    }
24188    /// Resets list of installed backgrounds to its default value
24189    /// # Arguments
24190    /// * `client_id` - The client id to send the request to
24191    #[allow(clippy::too_many_arguments)]
24192    pub async fn reset_backgrounds(client_id: i32) -> Result<(), crate::types::Error> {
24193        let request = json!({
24194            "@type": "resetBackgrounds",
24195        });
24196        let response = send_request(client_id, request).await;
24197        if response["@type"] == "error" {
24198            return Err(serde_json::from_value(response).unwrap())
24199        }
24200        Ok(())
24201    }
24202    /// Returns information about the current localization target. This is an offline request if only_local is true. Can be called before authorization
24203    /// # Arguments
24204    /// * `only_local` - Pass true to get only locally available information without sending network requests
24205    /// * `client_id` - The client id to send the request to
24206    #[allow(clippy::too_many_arguments)]
24207    pub async fn get_localization_target_info(only_local: bool, client_id: i32) -> Result<crate::enums::LocalizationTargetInfo, crate::types::Error> {
24208        let request = json!({
24209            "@type": "getLocalizationTargetInfo",
24210            "only_local": only_local,
24211        });
24212        let response = send_request(client_id, request).await;
24213        if response["@type"] == "error" {
24214            return Err(serde_json::from_value(response).unwrap())
24215        }
24216        Ok(serde_json::from_value(response).unwrap())
24217    }
24218    /// Returns information about a language pack. Returned language pack identifier may be different from a provided one. Can be called before authorization
24219    /// # Arguments
24220    /// * `language_pack_id` - Language pack identifier
24221    /// * `client_id` - The client id to send the request to
24222    #[allow(clippy::too_many_arguments)]
24223    pub async fn get_language_pack_info(language_pack_id: String, client_id: i32) -> Result<crate::enums::LanguagePackInfo, crate::types::Error> {
24224        let request = json!({
24225            "@type": "getLanguagePackInfo",
24226            "language_pack_id": language_pack_id,
24227        });
24228        let response = send_request(client_id, request).await;
24229        if response["@type"] == "error" {
24230            return Err(serde_json::from_value(response).unwrap())
24231        }
24232        Ok(serde_json::from_value(response).unwrap())
24233    }
24234    /// Returns strings from a language pack in the current localization target by their keys. Can be called before authorization
24235    /// # Arguments
24236    /// * `language_pack_id` - Language pack identifier of the strings to be returned
24237    /// * `keys` - Language pack keys of the strings to be returned; leave empty to request all available strings
24238    /// * `client_id` - The client id to send the request to
24239    #[allow(clippy::too_many_arguments)]
24240    pub async fn get_language_pack_strings(language_pack_id: String, keys: Vec<String>, client_id: i32) -> Result<crate::enums::LanguagePackStrings, crate::types::Error> {
24241        let request = json!({
24242            "@type": "getLanguagePackStrings",
24243            "language_pack_id": language_pack_id,
24244            "keys": keys,
24245        });
24246        let response = send_request(client_id, request).await;
24247        if response["@type"] == "error" {
24248            return Err(serde_json::from_value(response).unwrap())
24249        }
24250        Ok(serde_json::from_value(response).unwrap())
24251    }
24252    /// Fetches the latest versions of all strings from a language pack in the current localization target from the server.
24253    /// This method doesn't need to be called explicitly for the current used/base language packs. Can be called before authorization
24254    /// # Arguments
24255    /// * `language_pack_id` - Language pack identifier
24256    /// * `client_id` - The client id to send the request to
24257    #[allow(clippy::too_many_arguments)]
24258    pub async fn synchronize_language_pack(language_pack_id: String, client_id: i32) -> Result<(), crate::types::Error> {
24259        let request = json!({
24260            "@type": "synchronizeLanguagePack",
24261            "language_pack_id": language_pack_id,
24262        });
24263        let response = send_request(client_id, request).await;
24264        if response["@type"] == "error" {
24265            return Err(serde_json::from_value(response).unwrap())
24266        }
24267        Ok(())
24268    }
24269    /// Adds a custom server language pack to the list of installed language packs in current localization target. Can be called before authorization
24270    /// # Arguments
24271    /// * `language_pack_id` - Identifier of a language pack to be added
24272    /// * `client_id` - The client id to send the request to
24273    #[allow(clippy::too_many_arguments)]
24274    pub async fn add_custom_server_language_pack(language_pack_id: String, client_id: i32) -> Result<(), crate::types::Error> {
24275        let request = json!({
24276            "@type": "addCustomServerLanguagePack",
24277            "language_pack_id": language_pack_id,
24278        });
24279        let response = send_request(client_id, request).await;
24280        if response["@type"] == "error" {
24281            return Err(serde_json::from_value(response).unwrap())
24282        }
24283        Ok(())
24284    }
24285    /// Adds or changes a custom local language pack to the current localization target
24286    /// # Arguments
24287    /// * `info` - Information about the language pack. Language pack identifier must start with 'X', consist only of English letters, digits and hyphens, and must not exceed 64 characters. Can be called before authorization
24288    /// * `strings` - Strings of the new language pack
24289    /// * `client_id` - The client id to send the request to
24290    #[allow(clippy::too_many_arguments)]
24291    pub async fn set_custom_language_pack(info: crate::types::LanguagePackInfo, strings: Vec<crate::types::LanguagePackString>, client_id: i32) -> Result<(), crate::types::Error> {
24292        let request = json!({
24293            "@type": "setCustomLanguagePack",
24294            "info": info,
24295            "strings": strings,
24296        });
24297        let response = send_request(client_id, request).await;
24298        if response["@type"] == "error" {
24299            return Err(serde_json::from_value(response).unwrap())
24300        }
24301        Ok(())
24302    }
24303    /// Edits information about a custom local language pack in the current localization target. Can be called before authorization
24304    /// # Arguments
24305    /// * `info` - New information about the custom local language pack
24306    /// * `client_id` - The client id to send the request to
24307    #[allow(clippy::too_many_arguments)]
24308    pub async fn edit_custom_language_pack_info(info: crate::types::LanguagePackInfo, client_id: i32) -> Result<(), crate::types::Error> {
24309        let request = json!({
24310            "@type": "editCustomLanguagePackInfo",
24311            "info": info,
24312        });
24313        let response = send_request(client_id, request).await;
24314        if response["@type"] == "error" {
24315            return Err(serde_json::from_value(response).unwrap())
24316        }
24317        Ok(())
24318    }
24319    /// Adds, edits or deletes a string in a custom local language pack. Can be called before authorization
24320    /// # Arguments
24321    /// * `language_pack_id` - Identifier of a previously added custom local language pack in the current localization target
24322    /// * `new_string` - New language pack string
24323    /// * `client_id` - The client id to send the request to
24324    #[allow(clippy::too_many_arguments)]
24325    pub async fn set_custom_language_pack_string(language_pack_id: String, new_string: crate::types::LanguagePackString, client_id: i32) -> Result<(), crate::types::Error> {
24326        let request = json!({
24327            "@type": "setCustomLanguagePackString",
24328            "language_pack_id": language_pack_id,
24329            "new_string": new_string,
24330        });
24331        let response = send_request(client_id, request).await;
24332        if response["@type"] == "error" {
24333            return Err(serde_json::from_value(response).unwrap())
24334        }
24335        Ok(())
24336    }
24337    /// Deletes all information about a language pack in the current localization target. The language pack which is currently in use (including base language pack) or is being synchronized can't be deleted.
24338    /// Can be called before authorization
24339    /// # Arguments
24340    /// * `language_pack_id` - Identifier of the language pack to delete
24341    /// * `client_id` - The client id to send the request to
24342    #[allow(clippy::too_many_arguments)]
24343    pub async fn delete_language_pack(language_pack_id: String, client_id: i32) -> Result<(), crate::types::Error> {
24344        let request = json!({
24345            "@type": "deleteLanguagePack",
24346            "language_pack_id": language_pack_id,
24347        });
24348        let response = send_request(client_id, request).await;
24349        if response["@type"] == "error" {
24350            return Err(serde_json::from_value(response).unwrap())
24351        }
24352        Ok(())
24353    }
24354    /// Registers the currently used device for receiving push notifications. Returns a globally unique identifier of the push notification subscription
24355    /// # Arguments
24356    /// * `device_token` - Device token
24357    /// * `other_user_ids` - List of user identifiers of other users currently using the application
24358    /// * `client_id` - The client id to send the request to
24359    #[allow(clippy::too_many_arguments)]
24360    pub async fn register_device(device_token: crate::enums::DeviceToken, other_user_ids: Vec<i64>, client_id: i32) -> Result<crate::enums::PushReceiverId, crate::types::Error> {
24361        let request = json!({
24362            "@type": "registerDevice",
24363            "device_token": device_token,
24364            "other_user_ids": other_user_ids,
24365        });
24366        let response = send_request(client_id, request).await;
24367        if response["@type"] == "error" {
24368            return Err(serde_json::from_value(response).unwrap())
24369        }
24370        Ok(serde_json::from_value(response).unwrap())
24371    }
24372    /// Handles a push notification. Returns error with code 406 if the push notification is not supported and connection to the server is required to fetch new data. Can be called before authorization
24373    /// # Arguments
24374    /// * `payload` - JSON-encoded push notification payload with all fields sent by the server, and "google.sent_time" and "google.notification.sound" fields added
24375    /// * `client_id` - The client id to send the request to
24376    #[allow(clippy::too_many_arguments)]
24377    pub async fn process_push_notification(payload: String, client_id: i32) -> Result<(), crate::types::Error> {
24378        let request = json!({
24379            "@type": "processPushNotification",
24380            "payload": payload,
24381        });
24382        let response = send_request(client_id, request).await;
24383        if response["@type"] == "error" {
24384            return Err(serde_json::from_value(response).unwrap())
24385        }
24386        Ok(())
24387    }
24388    /// Returns a globally unique push notification subscription identifier for identification of an account, which has received a push notification. Can be called synchronously
24389    /// # Arguments
24390    /// * `payload` - JSON-encoded push notification payload
24391    /// * `client_id` - The client id to send the request to
24392    #[allow(clippy::too_many_arguments)]
24393    pub async fn get_push_receiver_id(payload: String, client_id: i32) -> Result<crate::enums::PushReceiverId, crate::types::Error> {
24394        let request = json!({
24395            "@type": "getPushReceiverId",
24396            "payload": payload,
24397        });
24398        let response = send_request(client_id, request).await;
24399        if response["@type"] == "error" {
24400            return Err(serde_json::from_value(response).unwrap())
24401        }
24402        Ok(serde_json::from_value(response).unwrap())
24403    }
24404    /// Returns t.me URLs recently visited by a newly registered user
24405    /// # Arguments
24406    /// * `referrer` - Google Play referrer to identify the user
24407    /// * `client_id` - The client id to send the request to
24408    #[allow(clippy::too_many_arguments)]
24409    pub async fn get_recently_visited_t_me_urls(referrer: String, client_id: i32) -> Result<crate::enums::TmeUrls, crate::types::Error> {
24410        let request = json!({
24411            "@type": "getRecentlyVisitedTMeUrls",
24412            "referrer": referrer,
24413        });
24414        let response = send_request(client_id, request).await;
24415        if response["@type"] == "error" {
24416            return Err(serde_json::from_value(response).unwrap())
24417        }
24418        Ok(serde_json::from_value(response).unwrap())
24419    }
24420    /// Changes user privacy settings
24421    /// # Arguments
24422    /// * `setting` - The privacy setting
24423    /// * `rules` - The new privacy rules
24424    /// * `client_id` - The client id to send the request to
24425    #[allow(clippy::too_many_arguments)]
24426    pub async fn set_user_privacy_setting_rules(setting: crate::enums::UserPrivacySetting, rules: crate::types::UserPrivacySettingRules, client_id: i32) -> Result<(), crate::types::Error> {
24427        let request = json!({
24428            "@type": "setUserPrivacySettingRules",
24429            "setting": setting,
24430            "rules": rules,
24431        });
24432        let response = send_request(client_id, request).await;
24433        if response["@type"] == "error" {
24434            return Err(serde_json::from_value(response).unwrap())
24435        }
24436        Ok(())
24437    }
24438    /// Returns the current privacy settings
24439    /// # Arguments
24440    /// * `setting` - The privacy setting
24441    /// * `client_id` - The client id to send the request to
24442    #[allow(clippy::too_many_arguments)]
24443    pub async fn get_user_privacy_setting_rules(setting: crate::enums::UserPrivacySetting, client_id: i32) -> Result<crate::enums::UserPrivacySettingRules, crate::types::Error> {
24444        let request = json!({
24445            "@type": "getUserPrivacySettingRules",
24446            "setting": setting,
24447        });
24448        let response = send_request(client_id, request).await;
24449        if response["@type"] == "error" {
24450            return Err(serde_json::from_value(response).unwrap())
24451        }
24452        Ok(serde_json::from_value(response).unwrap())
24453    }
24454    /// Returns the value of an option by its name. (Check the list of available options on https:core.telegram.org/tdlib/options.) Can be called before authorization. Can be called synchronously for options "version" and "commit_hash"
24455    /// # Arguments
24456    /// * `name` - The name of the option
24457    /// * `client_id` - The client id to send the request to
24458    #[allow(clippy::too_many_arguments)]
24459    pub async fn get_option(name: String, client_id: i32) -> Result<crate::enums::OptionValue, crate::types::Error> {
24460        let request = json!({
24461            "@type": "getOption",
24462            "name": name,
24463        });
24464        let response = send_request(client_id, request).await;
24465        if response["@type"] == "error" {
24466            return Err(serde_json::from_value(response).unwrap())
24467        }
24468        Ok(serde_json::from_value(response).unwrap())
24469    }
24470    /// Sets the value of an option. (Check the list of available options on https:core.telegram.org/tdlib/options.) Only writable options can be set. Can be called before authorization
24471    /// # Arguments
24472    /// * `name` - The name of the option
24473    /// * `value` - The new value of the option; pass null to reset option value to a default value
24474    /// * `client_id` - The client id to send the request to
24475    #[allow(clippy::too_many_arguments)]
24476    pub async fn set_option(name: String, value: Option<crate::enums::OptionValue>, client_id: i32) -> Result<(), crate::types::Error> {
24477        let request = json!({
24478            "@type": "setOption",
24479            "name": name,
24480            "value": value,
24481        });
24482        let response = send_request(client_id, request).await;
24483        if response["@type"] == "error" {
24484            return Err(serde_json::from_value(response).unwrap())
24485        }
24486        Ok(())
24487    }
24488    /// Changes the period of inactivity after which the account of the current user will automatically be deleted
24489    /// # Arguments
24490    /// * `ttl` - New account TTL
24491    /// * `client_id` - The client id to send the request to
24492    #[allow(clippy::too_many_arguments)]
24493    pub async fn set_account_ttl(ttl: crate::types::AccountTtl, client_id: i32) -> Result<(), crate::types::Error> {
24494        let request = json!({
24495            "@type": "setAccountTtl",
24496            "ttl": ttl,
24497        });
24498        let response = send_request(client_id, request).await;
24499        if response["@type"] == "error" {
24500            return Err(serde_json::from_value(response).unwrap())
24501        }
24502        Ok(())
24503    }
24504    /// Returns the period of inactivity after which the account of the current user will automatically be deleted
24505    /// # Arguments
24506    /// * `client_id` - The client id to send the request to
24507    #[allow(clippy::too_many_arguments)]
24508    pub async fn get_account_ttl(client_id: i32) -> Result<crate::enums::AccountTtl, crate::types::Error> {
24509        let request = json!({
24510            "@type": "getAccountTtl",
24511        });
24512        let response = send_request(client_id, request).await;
24513        if response["@type"] == "error" {
24514            return Err(serde_json::from_value(response).unwrap())
24515        }
24516        Ok(serde_json::from_value(response).unwrap())
24517    }
24518    /// Deletes the account of the current user, deleting all information associated with the user from the server. The phone number of the account can be used to create a new account.
24519    /// Can be called before authorization when the current authorization state is authorizationStateWaitPassword
24520    /// # Arguments
24521    /// * `reason` - The reason why the account was deleted; optional
24522    /// * `password` - The 2-step verification password of the current user. If not specified, account deletion can be canceled within one week
24523    /// * `client_id` - The client id to send the request to
24524    #[allow(clippy::too_many_arguments)]
24525    pub async fn delete_account(reason: String, password: String, client_id: i32) -> Result<(), crate::types::Error> {
24526        let request = json!({
24527            "@type": "deleteAccount",
24528            "reason": reason,
24529            "password": password,
24530        });
24531        let response = send_request(client_id, request).await;
24532        if response["@type"] == "error" {
24533            return Err(serde_json::from_value(response).unwrap())
24534        }
24535        Ok(())
24536    }
24537    /// Changes the default message auto-delete time for new chats
24538    /// # Arguments
24539    /// * `message_auto_delete_time` - New default message auto-delete time; must be from 0 up to 365 * 86400 and be divisible by 86400. If 0, then messages aren't deleted automatically
24540    /// * `client_id` - The client id to send the request to
24541    #[allow(clippy::too_many_arguments)]
24542    pub async fn set_default_message_auto_delete_time(message_auto_delete_time: crate::types::MessageAutoDeleteTime, client_id: i32) -> Result<(), crate::types::Error> {
24543        let request = json!({
24544            "@type": "setDefaultMessageAutoDeleteTime",
24545            "message_auto_delete_time": message_auto_delete_time,
24546        });
24547        let response = send_request(client_id, request).await;
24548        if response["@type"] == "error" {
24549            return Err(serde_json::from_value(response).unwrap())
24550        }
24551        Ok(())
24552    }
24553    /// Returns default message auto-delete time setting for new chats
24554    /// # Arguments
24555    /// * `client_id` - The client id to send the request to
24556    #[allow(clippy::too_many_arguments)]
24557    pub async fn get_default_message_auto_delete_time(client_id: i32) -> Result<crate::enums::MessageAutoDeleteTime, crate::types::Error> {
24558        let request = json!({
24559            "@type": "getDefaultMessageAutoDeleteTime",
24560        });
24561        let response = send_request(client_id, request).await;
24562        if response["@type"] == "error" {
24563            return Err(serde_json::from_value(response).unwrap())
24564        }
24565        Ok(serde_json::from_value(response).unwrap())
24566    }
24567    /// Removes a chat action bar without any other action
24568    /// # Arguments
24569    /// * `chat_id` - Chat identifier
24570    /// * `client_id` - The client id to send the request to
24571    #[allow(clippy::too_many_arguments)]
24572    pub async fn remove_chat_action_bar(chat_id: i64, client_id: i32) -> Result<(), crate::types::Error> {
24573        let request = json!({
24574            "@type": "removeChatActionBar",
24575            "chat_id": chat_id,
24576        });
24577        let response = send_request(client_id, request).await;
24578        if response["@type"] == "error" {
24579            return Err(serde_json::from_value(response).unwrap())
24580        }
24581        Ok(())
24582    }
24583    /// Reports a chat to the Telegram moderators. A chat can be reported only from the chat action bar, or if chat.can_be_reported
24584    /// # Arguments
24585    /// * `chat_id` - Chat identifier
24586    /// * `message_ids` - Identifiers of reported messages; may be empty to report the whole chat
24587    /// * `reason` - The reason for reporting the chat
24588    /// * `text` - Additional report details; 0-1024 characters
24589    /// * `client_id` - The client id to send the request to
24590    #[allow(clippy::too_many_arguments)]
24591    pub async fn report_chat(chat_id: i64, message_ids: Vec<i64>, reason: crate::enums::ReportReason, text: String, client_id: i32) -> Result<(), crate::types::Error> {
24592        let request = json!({
24593            "@type": "reportChat",
24594            "chat_id": chat_id,
24595            "message_ids": message_ids,
24596            "reason": reason,
24597            "text": text,
24598        });
24599        let response = send_request(client_id, request).await;
24600        if response["@type"] == "error" {
24601            return Err(serde_json::from_value(response).unwrap())
24602        }
24603        Ok(())
24604    }
24605    /// Reports a chat photo to the Telegram moderators. A chat photo can be reported only if chat.can_be_reported
24606    /// # Arguments
24607    /// * `chat_id` - Chat identifier
24608    /// * `file_id` - Identifier of the photo to report. Only full photos from chatPhoto can be reported
24609    /// * `reason` - The reason for reporting the chat photo
24610    /// * `text` - Additional report details; 0-1024 characters
24611    /// * `client_id` - The client id to send the request to
24612    #[allow(clippy::too_many_arguments)]
24613    pub async fn report_chat_photo(chat_id: i64, file_id: i32, reason: crate::enums::ReportReason, text: String, client_id: i32) -> Result<(), crate::types::Error> {
24614        let request = json!({
24615            "@type": "reportChatPhoto",
24616            "chat_id": chat_id,
24617            "file_id": file_id,
24618            "reason": reason,
24619            "text": text,
24620        });
24621        let response = send_request(client_id, request).await;
24622        if response["@type"] == "error" {
24623            return Err(serde_json::from_value(response).unwrap())
24624        }
24625        Ok(())
24626    }
24627    /// Reports reactions set on a message to the Telegram moderators. Reactions on a message can be reported only if message.can_report_reactions
24628    /// # Arguments
24629    /// * `chat_id` - Chat identifier
24630    /// * `message_id` - Message identifier
24631    /// * `sender_id` - Identifier of the sender, which added the reaction
24632    /// * `client_id` - The client id to send the request to
24633    #[allow(clippy::too_many_arguments)]
24634    pub async fn report_message_reactions(chat_id: i64, message_id: i64, sender_id: crate::enums::MessageSender, client_id: i32) -> Result<(), crate::types::Error> {
24635        let request = json!({
24636            "@type": "reportMessageReactions",
24637            "chat_id": chat_id,
24638            "message_id": message_id,
24639            "sender_id": sender_id,
24640        });
24641        let response = send_request(client_id, request).await;
24642        if response["@type"] == "error" {
24643            return Err(serde_json::from_value(response).unwrap())
24644        }
24645        Ok(())
24646    }
24647    /// Returns detailed statistics about a chat. Currently, this method can be used only for supergroups and channels. Can be used only if supergroupFullInfo.can_get_statistics == true
24648    /// # Arguments
24649    /// * `chat_id` - Chat identifier
24650    /// * `is_dark` - Pass true if a dark theme is used by the application
24651    /// * `client_id` - The client id to send the request to
24652    #[allow(clippy::too_many_arguments)]
24653    pub async fn get_chat_statistics(chat_id: i64, is_dark: bool, client_id: i32) -> Result<crate::enums::ChatStatistics, crate::types::Error> {
24654        let request = json!({
24655            "@type": "getChatStatistics",
24656            "chat_id": chat_id,
24657            "is_dark": is_dark,
24658        });
24659        let response = send_request(client_id, request).await;
24660        if response["@type"] == "error" {
24661            return Err(serde_json::from_value(response).unwrap())
24662        }
24663        Ok(serde_json::from_value(response).unwrap())
24664    }
24665    /// Returns detailed statistics about a message. Can be used only if message.can_get_statistics == true
24666    /// # Arguments
24667    /// * `chat_id` - Chat identifier
24668    /// * `message_id` - Message identifier
24669    /// * `is_dark` - Pass true if a dark theme is used by the application
24670    /// * `client_id` - The client id to send the request to
24671    #[allow(clippy::too_many_arguments)]
24672    pub async fn get_message_statistics(chat_id: i64, message_id: i64, is_dark: bool, client_id: i32) -> Result<crate::enums::MessageStatistics, crate::types::Error> {
24673        let request = json!({
24674            "@type": "getMessageStatistics",
24675            "chat_id": chat_id,
24676            "message_id": message_id,
24677            "is_dark": is_dark,
24678        });
24679        let response = send_request(client_id, request).await;
24680        if response["@type"] == "error" {
24681            return Err(serde_json::from_value(response).unwrap())
24682        }
24683        Ok(serde_json::from_value(response).unwrap())
24684    }
24685    /// Loads an asynchronous or a zoomed in statistical graph
24686    /// # Arguments
24687    /// * `chat_id` - Chat identifier
24688    /// * `token` - The token for graph loading
24689    /// * `x` - X-value for zoomed in graph or 0 otherwise
24690    /// * `client_id` - The client id to send the request to
24691    #[allow(clippy::too_many_arguments)]
24692    pub async fn get_statistical_graph(chat_id: i64, token: String, x: i64, client_id: i32) -> Result<crate::enums::StatisticalGraph, crate::types::Error> {
24693        let request = json!({
24694            "@type": "getStatisticalGraph",
24695            "chat_id": chat_id,
24696            "token": token,
24697            "x": x,
24698        });
24699        let response = send_request(client_id, request).await;
24700        if response["@type"] == "error" {
24701            return Err(serde_json::from_value(response).unwrap())
24702        }
24703        Ok(serde_json::from_value(response).unwrap())
24704    }
24705    /// Returns storage usage statistics. Can be called before authorization
24706    /// # Arguments
24707    /// * `chat_limit` - The maximum number of chats with the largest storage usage for which separate statistics need to be returned. All other chats will be grouped in entries with chat_id == 0. If the chat info database is not used, the chat_limit is ignored and is always set to 0
24708    /// * `client_id` - The client id to send the request to
24709    #[allow(clippy::too_many_arguments)]
24710    pub async fn get_storage_statistics(chat_limit: i32, client_id: i32) -> Result<crate::enums::StorageStatistics, crate::types::Error> {
24711        let request = json!({
24712            "@type": "getStorageStatistics",
24713            "chat_limit": chat_limit,
24714        });
24715        let response = send_request(client_id, request).await;
24716        if response["@type"] == "error" {
24717            return Err(serde_json::from_value(response).unwrap())
24718        }
24719        Ok(serde_json::from_value(response).unwrap())
24720    }
24721    /// Quickly returns approximate storage usage statistics. Can be called before authorization
24722    /// # Arguments
24723    /// * `client_id` - The client id to send the request to
24724    #[allow(clippy::too_many_arguments)]
24725    pub async fn get_storage_statistics_fast(client_id: i32) -> Result<crate::enums::StorageStatisticsFast, crate::types::Error> {
24726        let request = json!({
24727            "@type": "getStorageStatisticsFast",
24728        });
24729        let response = send_request(client_id, request).await;
24730        if response["@type"] == "error" {
24731            return Err(serde_json::from_value(response).unwrap())
24732        }
24733        Ok(serde_json::from_value(response).unwrap())
24734    }
24735    /// Returns database statistics
24736    /// # Arguments
24737    /// * `client_id` - The client id to send the request to
24738    #[allow(clippy::too_many_arguments)]
24739    pub async fn get_database_statistics(client_id: i32) -> Result<crate::enums::DatabaseStatistics, crate::types::Error> {
24740        let request = json!({
24741            "@type": "getDatabaseStatistics",
24742        });
24743        let response = send_request(client_id, request).await;
24744        if response["@type"] == "error" {
24745            return Err(serde_json::from_value(response).unwrap())
24746        }
24747        Ok(serde_json::from_value(response).unwrap())
24748    }
24749    /// Optimizes storage usage, i.e. deletes some files and returns new storage usage statistics. Secret thumbnails can't be deleted
24750    /// # Arguments
24751    /// * `size` - Limit on the total size of files after deletion, in bytes. Pass -1 to use the default limit
24752    /// * `ttl` - Limit on the time that has passed since the last time a file was accessed (or creation time for some filesystems). Pass -1 to use the default limit
24753    /// * `count` - Limit on the total number of files after deletion. Pass -1 to use the default limit
24754    /// * `immunity_delay` - The amount of time after the creation of a file during which it can't be deleted, in seconds. Pass -1 to use the default value
24755    /// * `file_types` - If non-empty, only files with the given types are considered. By default, all types except thumbnails, profile photos, stickers and wallpapers are deleted
24756    /// * `chat_ids` - If non-empty, only files from the given chats are considered. Use 0 as chat identifier to delete files not belonging to any chat (e.g., profile photos)
24757    /// * `exclude_chat_ids` - If non-empty, files from the given chats are excluded. Use 0 as chat identifier to exclude all files not belonging to any chat (e.g., profile photos)
24758    /// * `return_deleted_file_statistics` - Pass true if statistics about the files that were deleted must be returned instead of the whole storage usage statistics. Affects only returned statistics
24759    /// * `chat_limit` - Same as in getStorageStatistics. Affects only returned statistics
24760    /// * `client_id` - The client id to send the request to
24761    #[allow(clippy::too_many_arguments)]
24762    pub async fn optimize_storage(size: i64, ttl: i32, count: i32, immunity_delay: i32, file_types: Vec<crate::enums::FileType>, chat_ids: Vec<i64>, exclude_chat_ids: Vec<i64>, return_deleted_file_statistics: bool, chat_limit: i32, client_id: i32) -> Result<crate::enums::StorageStatistics, crate::types::Error> {
24763        let request = json!({
24764            "@type": "optimizeStorage",
24765            "size": size,
24766            "ttl": ttl,
24767            "count": count,
24768            "immunity_delay": immunity_delay,
24769            "file_types": file_types,
24770            "chat_ids": chat_ids,
24771            "exclude_chat_ids": exclude_chat_ids,
24772            "return_deleted_file_statistics": return_deleted_file_statistics,
24773            "chat_limit": chat_limit,
24774        });
24775        let response = send_request(client_id, request).await;
24776        if response["@type"] == "error" {
24777            return Err(serde_json::from_value(response).unwrap())
24778        }
24779        Ok(serde_json::from_value(response).unwrap())
24780    }
24781    /// Sets the current network type. Can be called before authorization. Calling this method forces all network connections to reopen, mitigating the delay in switching between different networks,
24782    /// so it must be called whenever the network is changed, even if the network type remains the same. Network type is used to check whether the library can use the network at all and also for collecting detailed network data usage statistics
24783    /// # Arguments
24784    /// * `r#type` - The new network type; pass null to set network type to networkTypeOther
24785    /// * `client_id` - The client id to send the request to
24786    #[allow(clippy::too_many_arguments)]
24787    pub async fn set_network_type(r#type: Option<crate::enums::NetworkType>, client_id: i32) -> Result<(), crate::types::Error> {
24788        let request = json!({
24789            "@type": "setNetworkType",
24790            "type": r#type,
24791        });
24792        let response = send_request(client_id, request).await;
24793        if response["@type"] == "error" {
24794            return Err(serde_json::from_value(response).unwrap())
24795        }
24796        Ok(())
24797    }
24798    /// Returns network data usage statistics. Can be called before authorization
24799    /// # Arguments
24800    /// * `only_current` - Pass true to get statistics only for the current library launch
24801    /// * `client_id` - The client id to send the request to
24802    #[allow(clippy::too_many_arguments)]
24803    pub async fn get_network_statistics(only_current: bool, client_id: i32) -> Result<crate::enums::NetworkStatistics, crate::types::Error> {
24804        let request = json!({
24805            "@type": "getNetworkStatistics",
24806            "only_current": only_current,
24807        });
24808        let response = send_request(client_id, request).await;
24809        if response["@type"] == "error" {
24810            return Err(serde_json::from_value(response).unwrap())
24811        }
24812        Ok(serde_json::from_value(response).unwrap())
24813    }
24814    /// Adds the specified data to data usage statistics. Can be called before authorization
24815    /// # Arguments
24816    /// * `entry` - The network statistics entry with the data to be added to statistics
24817    /// * `client_id` - The client id to send the request to
24818    #[allow(clippy::too_many_arguments)]
24819    pub async fn add_network_statistics(entry: crate::enums::NetworkStatisticsEntry, client_id: i32) -> Result<(), crate::types::Error> {
24820        let request = json!({
24821            "@type": "addNetworkStatistics",
24822            "entry": entry,
24823        });
24824        let response = send_request(client_id, request).await;
24825        if response["@type"] == "error" {
24826            return Err(serde_json::from_value(response).unwrap())
24827        }
24828        Ok(())
24829    }
24830    /// Resets all network data usage statistics to zero. Can be called before authorization
24831    /// # Arguments
24832    /// * `client_id` - The client id to send the request to
24833    #[allow(clippy::too_many_arguments)]
24834    pub async fn reset_network_statistics(client_id: i32) -> Result<(), crate::types::Error> {
24835        let request = json!({
24836            "@type": "resetNetworkStatistics",
24837        });
24838        let response = send_request(client_id, request).await;
24839        if response["@type"] == "error" {
24840            return Err(serde_json::from_value(response).unwrap())
24841        }
24842        Ok(())
24843    }
24844    /// Returns auto-download settings presets for the current user
24845    /// # Arguments
24846    /// * `client_id` - The client id to send the request to
24847    #[allow(clippy::too_many_arguments)]
24848    pub async fn get_auto_download_settings_presets(client_id: i32) -> Result<crate::enums::AutoDownloadSettingsPresets, crate::types::Error> {
24849        let request = json!({
24850            "@type": "getAutoDownloadSettingsPresets",
24851        });
24852        let response = send_request(client_id, request).await;
24853        if response["@type"] == "error" {
24854            return Err(serde_json::from_value(response).unwrap())
24855        }
24856        Ok(serde_json::from_value(response).unwrap())
24857    }
24858    /// Sets auto-download settings
24859    /// # Arguments
24860    /// * `settings` - New user auto-download settings
24861    /// * `r#type` - Type of the network for which the new settings are relevant
24862    /// * `client_id` - The client id to send the request to
24863    #[allow(clippy::too_many_arguments)]
24864    pub async fn set_auto_download_settings(settings: crate::types::AutoDownloadSettings, r#type: crate::enums::NetworkType, client_id: i32) -> Result<(), crate::types::Error> {
24865        let request = json!({
24866            "@type": "setAutoDownloadSettings",
24867            "settings": settings,
24868            "type": r#type,
24869        });
24870        let response = send_request(client_id, request).await;
24871        if response["@type"] == "error" {
24872            return Err(serde_json::from_value(response).unwrap())
24873        }
24874        Ok(())
24875    }
24876    /// Returns autosave settings for the current user
24877    /// # Arguments
24878    /// * `client_id` - The client id to send the request to
24879    #[allow(clippy::too_many_arguments)]
24880    pub async fn get_autosave_settings(client_id: i32) -> Result<crate::enums::AutosaveSettings, crate::types::Error> {
24881        let request = json!({
24882            "@type": "getAutosaveSettings",
24883        });
24884        let response = send_request(client_id, request).await;
24885        if response["@type"] == "error" {
24886            return Err(serde_json::from_value(response).unwrap())
24887        }
24888        Ok(serde_json::from_value(response).unwrap())
24889    }
24890    /// Sets autosave settings for the given scope. The method is guaranteed to work only after at least one call to getAutosaveSettings
24891    /// # Arguments
24892    /// * `scope` - Autosave settings scope
24893    /// * `settings` - New autosave settings for the scope; pass null to set autosave settings to default
24894    /// * `client_id` - The client id to send the request to
24895    #[allow(clippy::too_many_arguments)]
24896    pub async fn set_autosave_settings(scope: crate::enums::AutosaveSettingsScope, settings: Option<crate::types::ScopeAutosaveSettings>, client_id: i32) -> Result<(), crate::types::Error> {
24897        let request = json!({
24898            "@type": "setAutosaveSettings",
24899            "scope": scope,
24900            "settings": settings,
24901        });
24902        let response = send_request(client_id, request).await;
24903        if response["@type"] == "error" {
24904            return Err(serde_json::from_value(response).unwrap())
24905        }
24906        Ok(())
24907    }
24908    /// Clears the list of all autosave settings exceptions. The method is guaranteed to work only after at least one call to getAutosaveSettings
24909    /// # Arguments
24910    /// * `client_id` - The client id to send the request to
24911    #[allow(clippy::too_many_arguments)]
24912    pub async fn clear_autosave_settings_exceptions(client_id: i32) -> Result<(), crate::types::Error> {
24913        let request = json!({
24914            "@type": "clearAutosaveSettingsExceptions",
24915        });
24916        let response = send_request(client_id, request).await;
24917        if response["@type"] == "error" {
24918            return Err(serde_json::from_value(response).unwrap())
24919        }
24920        Ok(())
24921    }
24922    /// Returns information about a bank card
24923    /// # Arguments
24924    /// * `bank_card_number` - The bank card number
24925    /// * `client_id` - The client id to send the request to
24926    #[allow(clippy::too_many_arguments)]
24927    pub async fn get_bank_card_info(bank_card_number: String, client_id: i32) -> Result<crate::enums::BankCardInfo, crate::types::Error> {
24928        let request = json!({
24929            "@type": "getBankCardInfo",
24930            "bank_card_number": bank_card_number,
24931        });
24932        let response = send_request(client_id, request).await;
24933        if response["@type"] == "error" {
24934            return Err(serde_json::from_value(response).unwrap())
24935        }
24936        Ok(serde_json::from_value(response).unwrap())
24937    }
24938    /// Returns one of the available Telegram Passport elements
24939    /// # Arguments
24940    /// * `r#type` - Telegram Passport element type
24941    /// * `password` - The 2-step verification password of the current user
24942    /// * `client_id` - The client id to send the request to
24943    #[allow(clippy::too_many_arguments)]
24944    pub async fn get_passport_element(r#type: crate::enums::PassportElementType, password: String, client_id: i32) -> Result<crate::enums::PassportElement, crate::types::Error> {
24945        let request = json!({
24946            "@type": "getPassportElement",
24947            "type": r#type,
24948            "password": password,
24949        });
24950        let response = send_request(client_id, request).await;
24951        if response["@type"] == "error" {
24952            return Err(serde_json::from_value(response).unwrap())
24953        }
24954        Ok(serde_json::from_value(response).unwrap())
24955    }
24956    /// Returns all available Telegram Passport elements
24957    /// # Arguments
24958    /// * `password` - The 2-step verification password of the current user
24959    /// * `client_id` - The client id to send the request to
24960    #[allow(clippy::too_many_arguments)]
24961    pub async fn get_all_passport_elements(password: String, client_id: i32) -> Result<crate::enums::PassportElements, crate::types::Error> {
24962        let request = json!({
24963            "@type": "getAllPassportElements",
24964            "password": password,
24965        });
24966        let response = send_request(client_id, request).await;
24967        if response["@type"] == "error" {
24968            return Err(serde_json::from_value(response).unwrap())
24969        }
24970        Ok(serde_json::from_value(response).unwrap())
24971    }
24972    /// Adds an element to the user's Telegram Passport. May return an error with a message "PHONE_VERIFICATION_NEEDED" or "EMAIL_VERIFICATION_NEEDED" if the chosen phone number or the chosen email address must be verified first
24973    /// # Arguments
24974    /// * `element` - Input Telegram Passport element
24975    /// * `password` - The 2-step verification password of the current user
24976    /// * `client_id` - The client id to send the request to
24977    #[allow(clippy::too_many_arguments)]
24978    pub async fn set_passport_element(element: crate::enums::InputPassportElement, password: String, client_id: i32) -> Result<crate::enums::PassportElement, crate::types::Error> {
24979        let request = json!({
24980            "@type": "setPassportElement",
24981            "element": element,
24982            "password": password,
24983        });
24984        let response = send_request(client_id, request).await;
24985        if response["@type"] == "error" {
24986            return Err(serde_json::from_value(response).unwrap())
24987        }
24988        Ok(serde_json::from_value(response).unwrap())
24989    }
24990    /// Deletes a Telegram Passport element
24991    /// # Arguments
24992    /// * `r#type` - Element type
24993    /// * `client_id` - The client id to send the request to
24994    #[allow(clippy::too_many_arguments)]
24995    pub async fn delete_passport_element(r#type: crate::enums::PassportElementType, client_id: i32) -> Result<(), crate::types::Error> {
24996        let request = json!({
24997            "@type": "deletePassportElement",
24998            "type": r#type,
24999        });
25000        let response = send_request(client_id, request).await;
25001        if response["@type"] == "error" {
25002            return Err(serde_json::from_value(response).unwrap())
25003        }
25004        Ok(())
25005    }
25006    /// Informs the user that some of the elements in their Telegram Passport contain errors; for bots only. The user will not be able to resend the elements, until the errors are fixed
25007    /// # Arguments
25008    /// * `user_id` - User identifier
25009    /// * `errors` - The errors
25010    /// * `client_id` - The client id to send the request to
25011    #[allow(clippy::too_many_arguments)]
25012    pub async fn set_passport_element_errors(user_id: i64, errors: Vec<crate::types::InputPassportElementError>, client_id: i32) -> Result<(), crate::types::Error> {
25013        let request = json!({
25014            "@type": "setPassportElementErrors",
25015            "user_id": user_id,
25016            "errors": errors,
25017        });
25018        let response = send_request(client_id, request).await;
25019        if response["@type"] == "error" {
25020            return Err(serde_json::from_value(response).unwrap())
25021        }
25022        Ok(())
25023    }
25024    /// Returns an IETF language tag of the language preferred in the country, which must be used to fill native fields in Telegram Passport personal details. Returns a 404 error if unknown
25025    /// # Arguments
25026    /// * `country_code` - A two-letter ISO 3166-1 alpha-2 country code
25027    /// * `client_id` - The client id to send the request to
25028    #[allow(clippy::too_many_arguments)]
25029    pub async fn get_preferred_country_language(country_code: String, client_id: i32) -> Result<crate::enums::Text, crate::types::Error> {
25030        let request = json!({
25031            "@type": "getPreferredCountryLanguage",
25032            "country_code": country_code,
25033        });
25034        let response = send_request(client_id, request).await;
25035        if response["@type"] == "error" {
25036            return Err(serde_json::from_value(response).unwrap())
25037        }
25038        Ok(serde_json::from_value(response).unwrap())
25039    }
25040    /// Sends a code to verify a phone number to be added to a user's Telegram Passport
25041    /// # Arguments
25042    /// * `phone_number` - The phone number of the user, in international format
25043    /// * `settings` - Settings for the authentication of the user's phone number; pass null to use default settings
25044    /// * `client_id` - The client id to send the request to
25045    #[allow(clippy::too_many_arguments)]
25046    pub async fn send_phone_number_verification_code(phone_number: String, settings: Option<crate::types::PhoneNumberAuthenticationSettings>, client_id: i32) -> Result<crate::enums::AuthenticationCodeInfo, crate::types::Error> {
25047        let request = json!({
25048            "@type": "sendPhoneNumberVerificationCode",
25049            "phone_number": phone_number,
25050            "settings": settings,
25051        });
25052        let response = send_request(client_id, request).await;
25053        if response["@type"] == "error" {
25054            return Err(serde_json::from_value(response).unwrap())
25055        }
25056        Ok(serde_json::from_value(response).unwrap())
25057    }
25058    /// Resends the code to verify a phone number to be added to a user's Telegram Passport
25059    /// # Arguments
25060    /// * `client_id` - The client id to send the request to
25061    #[allow(clippy::too_many_arguments)]
25062    pub async fn resend_phone_number_verification_code(client_id: i32) -> Result<crate::enums::AuthenticationCodeInfo, crate::types::Error> {
25063        let request = json!({
25064            "@type": "resendPhoneNumberVerificationCode",
25065        });
25066        let response = send_request(client_id, request).await;
25067        if response["@type"] == "error" {
25068            return Err(serde_json::from_value(response).unwrap())
25069        }
25070        Ok(serde_json::from_value(response).unwrap())
25071    }
25072    /// Checks the phone number verification code for Telegram Passport
25073    /// # Arguments
25074    /// * `code` - Verification code to check
25075    /// * `client_id` - The client id to send the request to
25076    #[allow(clippy::too_many_arguments)]
25077    pub async fn check_phone_number_verification_code(code: String, client_id: i32) -> Result<(), crate::types::Error> {
25078        let request = json!({
25079            "@type": "checkPhoneNumberVerificationCode",
25080            "code": code,
25081        });
25082        let response = send_request(client_id, request).await;
25083        if response["@type"] == "error" {
25084            return Err(serde_json::from_value(response).unwrap())
25085        }
25086        Ok(())
25087    }
25088    /// Sends a code to verify an email address to be added to a user's Telegram Passport
25089    /// # Arguments
25090    /// * `email_address` - Email address
25091    /// * `client_id` - The client id to send the request to
25092    #[allow(clippy::too_many_arguments)]
25093    pub async fn send_email_address_verification_code(email_address: String, client_id: i32) -> Result<crate::enums::EmailAddressAuthenticationCodeInfo, crate::types::Error> {
25094        let request = json!({
25095            "@type": "sendEmailAddressVerificationCode",
25096            "email_address": email_address,
25097        });
25098        let response = send_request(client_id, request).await;
25099        if response["@type"] == "error" {
25100            return Err(serde_json::from_value(response).unwrap())
25101        }
25102        Ok(serde_json::from_value(response).unwrap())
25103    }
25104    /// Resends the code to verify an email address to be added to a user's Telegram Passport
25105    /// # Arguments
25106    /// * `client_id` - The client id to send the request to
25107    #[allow(clippy::too_many_arguments)]
25108    pub async fn resend_email_address_verification_code(client_id: i32) -> Result<crate::enums::EmailAddressAuthenticationCodeInfo, crate::types::Error> {
25109        let request = json!({
25110            "@type": "resendEmailAddressVerificationCode",
25111        });
25112        let response = send_request(client_id, request).await;
25113        if response["@type"] == "error" {
25114            return Err(serde_json::from_value(response).unwrap())
25115        }
25116        Ok(serde_json::from_value(response).unwrap())
25117    }
25118    /// Checks the email address verification code for Telegram Passport
25119    /// # Arguments
25120    /// * `code` - Verification code to check
25121    /// * `client_id` - The client id to send the request to
25122    #[allow(clippy::too_many_arguments)]
25123    pub async fn check_email_address_verification_code(code: String, client_id: i32) -> Result<(), crate::types::Error> {
25124        let request = json!({
25125            "@type": "checkEmailAddressVerificationCode",
25126            "code": code,
25127        });
25128        let response = send_request(client_id, request).await;
25129        if response["@type"] == "error" {
25130            return Err(serde_json::from_value(response).unwrap())
25131        }
25132        Ok(())
25133    }
25134    /// Returns a Telegram Passport authorization form for sharing data with a service
25135    /// # Arguments
25136    /// * `bot_user_id` - User identifier of the service's bot
25137    /// * `scope` - Telegram Passport element types requested by the service
25138    /// * `public_key` - Service's public key
25139    /// * `nonce` - Unique request identifier provided by the service
25140    /// * `client_id` - The client id to send the request to
25141    #[allow(clippy::too_many_arguments)]
25142    pub async fn get_passport_authorization_form(bot_user_id: i64, scope: String, public_key: String, nonce: String, client_id: i32) -> Result<crate::enums::PassportAuthorizationForm, crate::types::Error> {
25143        let request = json!({
25144            "@type": "getPassportAuthorizationForm",
25145            "bot_user_id": bot_user_id,
25146            "scope": scope,
25147            "public_key": public_key,
25148            "nonce": nonce,
25149        });
25150        let response = send_request(client_id, request).await;
25151        if response["@type"] == "error" {
25152            return Err(serde_json::from_value(response).unwrap())
25153        }
25154        Ok(serde_json::from_value(response).unwrap())
25155    }
25156    /// Returns already available Telegram Passport elements suitable for completing a Telegram Passport authorization form. Result can be received only once for each authorization form
25157    /// # Arguments
25158    /// * `authorization_form_id` - Authorization form identifier
25159    /// * `password` - The 2-step verification password of the current user
25160    /// * `client_id` - The client id to send the request to
25161    #[allow(clippy::too_many_arguments)]
25162    pub async fn get_passport_authorization_form_available_elements(authorization_form_id: i32, password: String, client_id: i32) -> Result<crate::enums::PassportElementsWithErrors, crate::types::Error> {
25163        let request = json!({
25164            "@type": "getPassportAuthorizationFormAvailableElements",
25165            "authorization_form_id": authorization_form_id,
25166            "password": password,
25167        });
25168        let response = send_request(client_id, request).await;
25169        if response["@type"] == "error" {
25170            return Err(serde_json::from_value(response).unwrap())
25171        }
25172        Ok(serde_json::from_value(response).unwrap())
25173    }
25174    /// Sends a Telegram Passport authorization form, effectively sharing data with the service. This method must be called after getPassportAuthorizationFormAvailableElements if some previously available elements are going to be reused
25175    /// # Arguments
25176    /// * `authorization_form_id` - Authorization form identifier
25177    /// * `types` - Types of Telegram Passport elements chosen by user to complete the authorization form
25178    /// * `client_id` - The client id to send the request to
25179    #[allow(clippy::too_many_arguments)]
25180    pub async fn send_passport_authorization_form(authorization_form_id: i32, types: Vec<crate::enums::PassportElementType>, client_id: i32) -> Result<(), crate::types::Error> {
25181        let request = json!({
25182            "@type": "sendPassportAuthorizationForm",
25183            "authorization_form_id": authorization_form_id,
25184            "types": types,
25185        });
25186        let response = send_request(client_id, request).await;
25187        if response["@type"] == "error" {
25188            return Err(serde_json::from_value(response).unwrap())
25189        }
25190        Ok(())
25191    }
25192    /// Sends phone number confirmation code to handle links of the type internalLinkTypePhoneNumberConfirmation
25193    /// # Arguments
25194    /// * `hash` - Hash value from the link
25195    /// * `phone_number` - Phone number value from the link
25196    /// * `settings` - Settings for the authentication of the user's phone number; pass null to use default settings
25197    /// * `client_id` - The client id to send the request to
25198    #[allow(clippy::too_many_arguments)]
25199    pub async fn send_phone_number_confirmation_code(hash: String, phone_number: String, settings: Option<crate::types::PhoneNumberAuthenticationSettings>, client_id: i32) -> Result<crate::enums::AuthenticationCodeInfo, crate::types::Error> {
25200        let request = json!({
25201            "@type": "sendPhoneNumberConfirmationCode",
25202            "hash": hash,
25203            "phone_number": phone_number,
25204            "settings": settings,
25205        });
25206        let response = send_request(client_id, request).await;
25207        if response["@type"] == "error" {
25208            return Err(serde_json::from_value(response).unwrap())
25209        }
25210        Ok(serde_json::from_value(response).unwrap())
25211    }
25212    /// Resends phone number confirmation code
25213    /// # Arguments
25214    /// * `client_id` - The client id to send the request to
25215    #[allow(clippy::too_many_arguments)]
25216    pub async fn resend_phone_number_confirmation_code(client_id: i32) -> Result<crate::enums::AuthenticationCodeInfo, crate::types::Error> {
25217        let request = json!({
25218            "@type": "resendPhoneNumberConfirmationCode",
25219        });
25220        let response = send_request(client_id, request).await;
25221        if response["@type"] == "error" {
25222            return Err(serde_json::from_value(response).unwrap())
25223        }
25224        Ok(serde_json::from_value(response).unwrap())
25225    }
25226    /// Checks phone number confirmation code
25227    /// # Arguments
25228    /// * `code` - Confirmation code to check
25229    /// * `client_id` - The client id to send the request to
25230    #[allow(clippy::too_many_arguments)]
25231    pub async fn check_phone_number_confirmation_code(code: String, client_id: i32) -> Result<(), crate::types::Error> {
25232        let request = json!({
25233            "@type": "checkPhoneNumberConfirmationCode",
25234            "code": code,
25235        });
25236        let response = send_request(client_id, request).await;
25237        if response["@type"] == "error" {
25238            return Err(serde_json::from_value(response).unwrap())
25239        }
25240        Ok(())
25241    }
25242    /// Informs the server about the number of pending bot updates if they haven't been processed for a long time; for bots only
25243    /// # Arguments
25244    /// * `pending_update_count` - The number of pending updates
25245    /// * `error_message` - The last error message
25246    /// * `client_id` - The client id to send the request to
25247    #[allow(clippy::too_many_arguments)]
25248    pub async fn set_bot_updates_status(pending_update_count: i32, error_message: String, client_id: i32) -> Result<(), crate::types::Error> {
25249        let request = json!({
25250            "@type": "setBotUpdatesStatus",
25251            "pending_update_count": pending_update_count,
25252            "error_message": error_message,
25253        });
25254        let response = send_request(client_id, request).await;
25255        if response["@type"] == "error" {
25256            return Err(serde_json::from_value(response).unwrap())
25257        }
25258        Ok(())
25259    }
25260    /// Uploads a file with a sticker; returns the uploaded file
25261    /// # Arguments
25262    /// * `user_id` - Sticker file owner; ignored for regular users
25263    /// * `sticker_format` - Sticker format
25264    /// * `sticker` - File file to upload; must fit in a 512x512 square. For WEBP stickers the file must be in WEBP or PNG format, which will be converted to WEBP server-side.
25265    /// See https:core.telegram.org/animated_stickers#technical-requirements for technical requirements
25266    /// * `client_id` - The client id to send the request to
25267    #[allow(clippy::too_many_arguments)]
25268    pub async fn upload_sticker_file(user_id: i64, sticker_format: crate::enums::StickerFormat, sticker: crate::enums::InputFile, client_id: i32) -> Result<crate::enums::File, crate::types::Error> {
25269        let request = json!({
25270            "@type": "uploadStickerFile",
25271            "user_id": user_id,
25272            "sticker_format": sticker_format,
25273            "sticker": sticker,
25274        });
25275        let response = send_request(client_id, request).await;
25276        if response["@type"] == "error" {
25277            return Err(serde_json::from_value(response).unwrap())
25278        }
25279        Ok(serde_json::from_value(response).unwrap())
25280    }
25281    /// Returns a suggested name for a new sticker set with a given title
25282    /// # Arguments
25283    /// * `title` - Sticker set title; 1-64 characters
25284    /// * `client_id` - The client id to send the request to
25285    #[allow(clippy::too_many_arguments)]
25286    pub async fn get_suggested_sticker_set_name(title: String, client_id: i32) -> Result<crate::enums::Text, crate::types::Error> {
25287        let request = json!({
25288            "@type": "getSuggestedStickerSetName",
25289            "title": title,
25290        });
25291        let response = send_request(client_id, request).await;
25292        if response["@type"] == "error" {
25293            return Err(serde_json::from_value(response).unwrap())
25294        }
25295        Ok(serde_json::from_value(response).unwrap())
25296    }
25297    /// Checks whether a name can be used for a new sticker set
25298    /// # Arguments
25299    /// * `name` - Name to be checked
25300    /// * `client_id` - The client id to send the request to
25301    #[allow(clippy::too_many_arguments)]
25302    pub async fn check_sticker_set_name(name: String, client_id: i32) -> Result<crate::enums::CheckStickerSetNameResult, crate::types::Error> {
25303        let request = json!({
25304            "@type": "checkStickerSetName",
25305            "name": name,
25306        });
25307        let response = send_request(client_id, request).await;
25308        if response["@type"] == "error" {
25309            return Err(serde_json::from_value(response).unwrap())
25310        }
25311        Ok(serde_json::from_value(response).unwrap())
25312    }
25313    /// Creates a new sticker set. Returns the newly created sticker set
25314    /// # Arguments
25315    /// * `user_id` - Sticker set owner; ignored for regular users
25316    /// * `title` - Sticker set title; 1-64 characters
25317    /// * `name` - Sticker set name. Can contain only English letters, digits and underscores. Must end with *"_by_<bot username>"* (*<bot_username>* is case insensitive) for bots; 1-64 characters
25318    /// * `sticker_format` - Format of the stickers in the set
25319    /// * `sticker_type` - Type of the stickers in the set
25320    /// * `needs_repainting` - Pass true if stickers in the sticker set must be repainted; for custom emoji sticker sets only
25321    /// * `stickers` - List of stickers to be added to the set; must be non-empty. All stickers must have the same format. For TGS stickers, uploadStickerFile must be used before the sticker is shown
25322    /// * `source` - Source of the sticker set; may be empty if unknown
25323    /// * `client_id` - The client id to send the request to
25324    #[allow(clippy::too_many_arguments)]
25325    pub async fn create_new_sticker_set(user_id: i64, title: String, name: String, sticker_format: crate::enums::StickerFormat, sticker_type: crate::enums::StickerType, needs_repainting: bool, stickers: Vec<crate::types::InputSticker>, source: String, client_id: i32) -> Result<crate::enums::StickerSet, crate::types::Error> {
25326        let request = json!({
25327            "@type": "createNewStickerSet",
25328            "user_id": user_id,
25329            "title": title,
25330            "name": name,
25331            "sticker_format": sticker_format,
25332            "sticker_type": sticker_type,
25333            "needs_repainting": needs_repainting,
25334            "stickers": stickers,
25335            "source": source,
25336        });
25337        let response = send_request(client_id, request).await;
25338        if response["@type"] == "error" {
25339            return Err(serde_json::from_value(response).unwrap())
25340        }
25341        Ok(serde_json::from_value(response).unwrap())
25342    }
25343    /// Adds a new sticker to a set; for bots only
25344    /// # Arguments
25345    /// * `user_id` - Sticker set owner
25346    /// * `name` - Sticker set name
25347    /// * `sticker` - Sticker to add to the set
25348    /// * `client_id` - The client id to send the request to
25349    #[allow(clippy::too_many_arguments)]
25350    pub async fn add_sticker_to_set(user_id: i64, name: String, sticker: crate::types::InputSticker, client_id: i32) -> Result<(), crate::types::Error> {
25351        let request = json!({
25352            "@type": "addStickerToSet",
25353            "user_id": user_id,
25354            "name": name,
25355            "sticker": sticker,
25356        });
25357        let response = send_request(client_id, request).await;
25358        if response["@type"] == "error" {
25359            return Err(serde_json::from_value(response).unwrap())
25360        }
25361        Ok(())
25362    }
25363    /// Sets a sticker set thumbnail; for bots only
25364    /// # Arguments
25365    /// * `user_id` - Sticker set owner
25366    /// * `name` - Sticker set name
25367    /// * `thumbnail` - Thumbnail to set in PNG, TGS, or WEBM format; pass null to remove the sticker set thumbnail. Thumbnail format must match the format of stickers in the set
25368    /// * `client_id` - The client id to send the request to
25369    #[allow(clippy::too_many_arguments)]
25370    pub async fn set_sticker_set_thumbnail(user_id: i64, name: String, thumbnail: Option<crate::enums::InputFile>, client_id: i32) -> Result<(), crate::types::Error> {
25371        let request = json!({
25372            "@type": "setStickerSetThumbnail",
25373            "user_id": user_id,
25374            "name": name,
25375            "thumbnail": thumbnail,
25376        });
25377        let response = send_request(client_id, request).await;
25378        if response["@type"] == "error" {
25379            return Err(serde_json::from_value(response).unwrap())
25380        }
25381        Ok(())
25382    }
25383    /// Sets a custom emoji sticker set thumbnail; for bots only
25384    /// # Arguments
25385    /// * `name` - Sticker set name
25386    /// * `custom_emoji_id` - Identifier of the custom emoji from the sticker set, which will be set as sticker set thumbnail; pass 0 to remove the sticker set thumbnail
25387    /// * `client_id` - The client id to send the request to
25388    #[allow(clippy::too_many_arguments)]
25389    pub async fn set_custom_emoji_sticker_set_thumbnail(name: String, custom_emoji_id: i64, client_id: i32) -> Result<(), crate::types::Error> {
25390        let request = json!({
25391            "@type": "setCustomEmojiStickerSetThumbnail",
25392            "name": name,
25393            "custom_emoji_id": custom_emoji_id,
25394        });
25395        let response = send_request(client_id, request).await;
25396        if response["@type"] == "error" {
25397            return Err(serde_json::from_value(response).unwrap())
25398        }
25399        Ok(())
25400    }
25401    /// Sets a sticker set title; for bots only
25402    /// # Arguments
25403    /// * `name` - Sticker set name
25404    /// * `title` - New sticker set title
25405    /// * `client_id` - The client id to send the request to
25406    #[allow(clippy::too_many_arguments)]
25407    pub async fn set_sticker_set_title(name: String, title: String, client_id: i32) -> Result<(), crate::types::Error> {
25408        let request = json!({
25409            "@type": "setStickerSetTitle",
25410            "name": name,
25411            "title": title,
25412        });
25413        let response = send_request(client_id, request).await;
25414        if response["@type"] == "error" {
25415            return Err(serde_json::from_value(response).unwrap())
25416        }
25417        Ok(())
25418    }
25419    /// Deleted a sticker set; for bots only
25420    /// # Arguments
25421    /// * `name` - Sticker set name
25422    /// * `client_id` - The client id to send the request to
25423    #[allow(clippy::too_many_arguments)]
25424    pub async fn delete_sticker_set(name: String, client_id: i32) -> Result<(), crate::types::Error> {
25425        let request = json!({
25426            "@type": "deleteStickerSet",
25427            "name": name,
25428        });
25429        let response = send_request(client_id, request).await;
25430        if response["@type"] == "error" {
25431            return Err(serde_json::from_value(response).unwrap())
25432        }
25433        Ok(())
25434    }
25435    /// Changes the position of a sticker in the set to which it belongs; for bots only. The sticker set must have been created by the bot
25436    /// # Arguments
25437    /// * `sticker` - Sticker
25438    /// * `position` - New position of the sticker in the set, 0-based
25439    /// * `client_id` - The client id to send the request to
25440    #[allow(clippy::too_many_arguments)]
25441    pub async fn set_sticker_position_in_set(sticker: crate::enums::InputFile, position: i32, client_id: i32) -> Result<(), crate::types::Error> {
25442        let request = json!({
25443            "@type": "setStickerPositionInSet",
25444            "sticker": sticker,
25445            "position": position,
25446        });
25447        let response = send_request(client_id, request).await;
25448        if response["@type"] == "error" {
25449            return Err(serde_json::from_value(response).unwrap())
25450        }
25451        Ok(())
25452    }
25453    /// Removes a sticker from the set to which it belongs; for bots only. The sticker set must have been created by the bot
25454    /// # Arguments
25455    /// * `sticker` - Sticker
25456    /// * `client_id` - The client id to send the request to
25457    #[allow(clippy::too_many_arguments)]
25458    pub async fn remove_sticker_from_set(sticker: crate::enums::InputFile, client_id: i32) -> Result<(), crate::types::Error> {
25459        let request = json!({
25460            "@type": "removeStickerFromSet",
25461            "sticker": sticker,
25462        });
25463        let response = send_request(client_id, request).await;
25464        if response["@type"] == "error" {
25465            return Err(serde_json::from_value(response).unwrap())
25466        }
25467        Ok(())
25468    }
25469    /// Changes the list of emoji corresponding to a sticker; for bots only. The sticker must belong to a regular or custom emoji sticker set created by the bot
25470    /// # Arguments
25471    /// * `sticker` - Sticker
25472    /// * `emojis` - New string with 1-20 emoji corresponding to the sticker
25473    /// * `client_id` - The client id to send the request to
25474    #[allow(clippy::too_many_arguments)]
25475    pub async fn set_sticker_emojis(sticker: crate::enums::InputFile, emojis: String, client_id: i32) -> Result<(), crate::types::Error> {
25476        let request = json!({
25477            "@type": "setStickerEmojis",
25478            "sticker": sticker,
25479            "emojis": emojis,
25480        });
25481        let response = send_request(client_id, request).await;
25482        if response["@type"] == "error" {
25483            return Err(serde_json::from_value(response).unwrap())
25484        }
25485        Ok(())
25486    }
25487    /// Changes the list of keywords of a sticker; for bots only. The sticker must belong to a regular or custom emoji sticker set created by the bot
25488    /// # Arguments
25489    /// * `sticker` - Sticker
25490    /// * `keywords` - List of up to 20 keywords with total length up to 64 characters, which can be used to find the sticker
25491    /// * `client_id` - The client id to send the request to
25492    #[allow(clippy::too_many_arguments)]
25493    pub async fn set_sticker_keywords(sticker: crate::enums::InputFile, keywords: Vec<String>, client_id: i32) -> Result<(), crate::types::Error> {
25494        let request = json!({
25495            "@type": "setStickerKeywords",
25496            "sticker": sticker,
25497            "keywords": keywords,
25498        });
25499        let response = send_request(client_id, request).await;
25500        if response["@type"] == "error" {
25501            return Err(serde_json::from_value(response).unwrap())
25502        }
25503        Ok(())
25504    }
25505    /// Changes the mask position of a mask sticker; for bots only. The sticker must belong to a mask sticker set created by the bot
25506    /// # Arguments
25507    /// * `sticker` - Sticker
25508    /// * `mask_position` - Position where the mask is placed; pass null to remove mask position
25509    /// * `client_id` - The client id to send the request to
25510    #[allow(clippy::too_many_arguments)]
25511    pub async fn set_sticker_mask_position(sticker: crate::enums::InputFile, mask_position: Option<crate::types::MaskPosition>, client_id: i32) -> Result<(), crate::types::Error> {
25512        let request = json!({
25513            "@type": "setStickerMaskPosition",
25514            "sticker": sticker,
25515            "mask_position": mask_position,
25516        });
25517        let response = send_request(client_id, request).await;
25518        if response["@type"] == "error" {
25519            return Err(serde_json::from_value(response).unwrap())
25520        }
25521        Ok(())
25522    }
25523    /// Returns information about a file with a map thumbnail in PNG format. Only map thumbnail files with size less than 1MB can be downloaded
25524    /// # Arguments
25525    /// * `location` - Location of the map center
25526    /// * `zoom` - Map zoom level; 13-20
25527    /// * `width` - Map width in pixels before applying scale; 16-1024
25528    /// * `height` - Map height in pixels before applying scale; 16-1024
25529    /// * `scale` - Map scale; 1-3
25530    /// * `chat_id` - Identifier of a chat in which the thumbnail will be shown. Use 0 if unknown
25531    /// * `client_id` - The client id to send the request to
25532    #[allow(clippy::too_many_arguments)]
25533    pub async fn get_map_thumbnail_file(location: crate::types::Location, zoom: i32, width: i32, height: i32, scale: i32, chat_id: i64, client_id: i32) -> Result<crate::enums::File, crate::types::Error> {
25534        let request = json!({
25535            "@type": "getMapThumbnailFile",
25536            "location": location,
25537            "zoom": zoom,
25538            "width": width,
25539            "height": height,
25540            "scale": scale,
25541            "chat_id": chat_id,
25542        });
25543        let response = send_request(client_id, request).await;
25544        if response["@type"] == "error" {
25545            return Err(serde_json::from_value(response).unwrap())
25546        }
25547        Ok(serde_json::from_value(response).unwrap())
25548    }
25549    /// Returns information about a limit, increased for Premium users. Returns a 404 error if the limit is unknown
25550    /// # Arguments
25551    /// * `limit_type` - Type of the limit
25552    /// * `client_id` - The client id to send the request to
25553    #[allow(clippy::too_many_arguments)]
25554    pub async fn get_premium_limit(limit_type: crate::enums::PremiumLimitType, client_id: i32) -> Result<crate::enums::PremiumLimit, crate::types::Error> {
25555        let request = json!({
25556            "@type": "getPremiumLimit",
25557            "limit_type": limit_type,
25558        });
25559        let response = send_request(client_id, request).await;
25560        if response["@type"] == "error" {
25561            return Err(serde_json::from_value(response).unwrap())
25562        }
25563        Ok(serde_json::from_value(response).unwrap())
25564    }
25565    /// Returns information about features, available to Premium users
25566    /// # Arguments
25567    /// * `source` - Source of the request; pass null if the method is called from some non-standard source
25568    /// * `client_id` - The client id to send the request to
25569    #[allow(clippy::too_many_arguments)]
25570    pub async fn get_premium_features(source: Option<crate::enums::PremiumSource>, client_id: i32) -> Result<crate::enums::PremiumFeatures, crate::types::Error> {
25571        let request = json!({
25572            "@type": "getPremiumFeatures",
25573            "source": source,
25574        });
25575        let response = send_request(client_id, request).await;
25576        if response["@type"] == "error" {
25577            return Err(serde_json::from_value(response).unwrap())
25578        }
25579        Ok(serde_json::from_value(response).unwrap())
25580    }
25581    /// Returns examples of premium stickers for demonstration purposes
25582    /// # Arguments
25583    /// * `client_id` - The client id to send the request to
25584    #[allow(clippy::too_many_arguments)]
25585    pub async fn get_premium_sticker_examples(client_id: i32) -> Result<crate::enums::Stickers, crate::types::Error> {
25586        let request = json!({
25587            "@type": "getPremiumStickerExamples",
25588        });
25589        let response = send_request(client_id, request).await;
25590        if response["@type"] == "error" {
25591            return Err(serde_json::from_value(response).unwrap())
25592        }
25593        Ok(serde_json::from_value(response).unwrap())
25594    }
25595    /// Informs TDLib that the user viewed detailed information about a Premium feature on the Premium features screen
25596    /// # Arguments
25597    /// * `feature` - The viewed premium feature
25598    /// * `client_id` - The client id to send the request to
25599    #[allow(clippy::too_many_arguments)]
25600    pub async fn view_premium_feature(feature: crate::enums::PremiumFeature, client_id: i32) -> Result<(), crate::types::Error> {
25601        let request = json!({
25602            "@type": "viewPremiumFeature",
25603            "feature": feature,
25604        });
25605        let response = send_request(client_id, request).await;
25606        if response["@type"] == "error" {
25607            return Err(serde_json::from_value(response).unwrap())
25608        }
25609        Ok(())
25610    }
25611    /// Informs TDLib that the user clicked Premium subscription button on the Premium features screen
25612    /// # Arguments
25613    /// * `client_id` - The client id to send the request to
25614    #[allow(clippy::too_many_arguments)]
25615    pub async fn click_premium_subscription_button(client_id: i32) -> Result<(), crate::types::Error> {
25616        let request = json!({
25617            "@type": "clickPremiumSubscriptionButton",
25618        });
25619        let response = send_request(client_id, request).await;
25620        if response["@type"] == "error" {
25621            return Err(serde_json::from_value(response).unwrap())
25622        }
25623        Ok(())
25624    }
25625    /// Returns state of Telegram Premium subscription and promotion videos for Premium features
25626    /// # Arguments
25627    /// * `client_id` - The client id to send the request to
25628    #[allow(clippy::too_many_arguments)]
25629    pub async fn get_premium_state(client_id: i32) -> Result<crate::enums::PremiumState, crate::types::Error> {
25630        let request = json!({
25631            "@type": "getPremiumState",
25632        });
25633        let response = send_request(client_id, request).await;
25634        if response["@type"] == "error" {
25635            return Err(serde_json::from_value(response).unwrap())
25636        }
25637        Ok(serde_json::from_value(response).unwrap())
25638    }
25639    /// Checks whether Telegram Premium purchase is possible. Must be called before in-store Premium purchase
25640    /// # Arguments
25641    /// * `purpose` - Transaction purpose
25642    /// * `client_id` - The client id to send the request to
25643    #[allow(clippy::too_many_arguments)]
25644    pub async fn can_purchase_premium(purpose: crate::enums::StorePaymentPurpose, client_id: i32) -> Result<(), crate::types::Error> {
25645        let request = json!({
25646            "@type": "canPurchasePremium",
25647            "purpose": purpose,
25648        });
25649        let response = send_request(client_id, request).await;
25650        if response["@type"] == "error" {
25651            return Err(serde_json::from_value(response).unwrap())
25652        }
25653        Ok(())
25654    }
25655    /// Informs server about a purchase through App Store. For official applications only
25656    /// # Arguments
25657    /// * `receipt` - App Store receipt
25658    /// * `purpose` - Transaction purpose
25659    /// * `client_id` - The client id to send the request to
25660    #[allow(clippy::too_many_arguments)]
25661    pub async fn assign_app_store_transaction(receipt: String, purpose: crate::enums::StorePaymentPurpose, client_id: i32) -> Result<(), crate::types::Error> {
25662        let request = json!({
25663            "@type": "assignAppStoreTransaction",
25664            "receipt": receipt,
25665            "purpose": purpose,
25666        });
25667        let response = send_request(client_id, request).await;
25668        if response["@type"] == "error" {
25669            return Err(serde_json::from_value(response).unwrap())
25670        }
25671        Ok(())
25672    }
25673    /// Informs server about a purchase through Google Play. For official applications only
25674    /// # Arguments
25675    /// * `package_name` - Application package name
25676    /// * `store_product_id` - Identifier of the purchased store product
25677    /// * `purchase_token` - Google Play purchase token
25678    /// * `purpose` - Transaction purpose
25679    /// * `client_id` - The client id to send the request to
25680    #[allow(clippy::too_many_arguments)]
25681    pub async fn assign_google_play_transaction(package_name: String, store_product_id: String, purchase_token: String, purpose: crate::enums::StorePaymentPurpose, client_id: i32) -> Result<(), crate::types::Error> {
25682        let request = json!({
25683            "@type": "assignGooglePlayTransaction",
25684            "package_name": package_name,
25685            "store_product_id": store_product_id,
25686            "purchase_token": purchase_token,
25687            "purpose": purpose,
25688        });
25689        let response = send_request(client_id, request).await;
25690        if response["@type"] == "error" {
25691            return Err(serde_json::from_value(response).unwrap())
25692        }
25693        Ok(())
25694    }
25695    /// Accepts Telegram terms of services
25696    /// # Arguments
25697    /// * `terms_of_service_id` - Terms of service identifier
25698    /// * `client_id` - The client id to send the request to
25699    #[allow(clippy::too_many_arguments)]
25700    pub async fn accept_terms_of_service(terms_of_service_id: String, client_id: i32) -> Result<(), crate::types::Error> {
25701        let request = json!({
25702            "@type": "acceptTermsOfService",
25703            "terms_of_service_id": terms_of_service_id,
25704        });
25705        let response = send_request(client_id, request).await;
25706        if response["@type"] == "error" {
25707            return Err(serde_json::from_value(response).unwrap())
25708        }
25709        Ok(())
25710    }
25711    /// Searches specified query by word prefixes in the provided strings. Returns 0-based positions of strings that matched. Can be called synchronously
25712    /// # Arguments
25713    /// * `strings` - The strings to search in for the query
25714    /// * `query` - Query to search for
25715    /// * `limit` - The maximum number of objects to return
25716    /// * `return_none_for_empty_query` - Pass true to receive no results for an empty query
25717    /// * `client_id` - The client id to send the request to
25718    #[allow(clippy::too_many_arguments)]
25719    pub async fn search_strings_by_prefix(strings: Vec<String>, query: String, limit: i32, return_none_for_empty_query: bool, client_id: i32) -> Result<crate::enums::FoundPositions, crate::types::Error> {
25720        let request = json!({
25721            "@type": "searchStringsByPrefix",
25722            "strings": strings,
25723            "query": query,
25724            "limit": limit,
25725            "return_none_for_empty_query": return_none_for_empty_query,
25726        });
25727        let response = send_request(client_id, request).await;
25728        if response["@type"] == "error" {
25729            return Err(serde_json::from_value(response).unwrap())
25730        }
25731        Ok(serde_json::from_value(response).unwrap())
25732    }
25733    /// Sends a custom request; for bots only
25734    /// # Arguments
25735    /// * `method` - The method name
25736    /// * `parameters` - JSON-serialized method parameters
25737    /// * `client_id` - The client id to send the request to
25738    #[allow(clippy::too_many_arguments)]
25739    pub async fn send_custom_request(method: String, parameters: String, client_id: i32) -> Result<crate::enums::CustomRequestResult, crate::types::Error> {
25740        let request = json!({
25741            "@type": "sendCustomRequest",
25742            "method": method,
25743            "parameters": parameters,
25744        });
25745        let response = send_request(client_id, request).await;
25746        if response["@type"] == "error" {
25747            return Err(serde_json::from_value(response).unwrap())
25748        }
25749        Ok(serde_json::from_value(response).unwrap())
25750    }
25751    /// Answers a custom query; for bots only
25752    /// # Arguments
25753    /// * `custom_query_id` - Identifier of a custom query
25754    /// * `data` - JSON-serialized answer to the query
25755    /// * `client_id` - The client id to send the request to
25756    #[allow(clippy::too_many_arguments)]
25757    pub async fn answer_custom_query(custom_query_id: i64, data: String, client_id: i32) -> Result<(), crate::types::Error> {
25758        let request = json!({
25759            "@type": "answerCustomQuery",
25760            "custom_query_id": custom_query_id,
25761            "data": data,
25762        });
25763        let response = send_request(client_id, request).await;
25764        if response["@type"] == "error" {
25765            return Err(serde_json::from_value(response).unwrap())
25766        }
25767        Ok(())
25768    }
25769    /// Succeeds after a specified amount of time has passed. Can be called before initialization
25770    /// # Arguments
25771    /// * `seconds` - Number of seconds before the function returns
25772    /// * `client_id` - The client id to send the request to
25773    #[allow(clippy::too_many_arguments)]
25774    pub async fn set_alarm(seconds: f64, client_id: i32) -> Result<(), crate::types::Error> {
25775        let request = json!({
25776            "@type": "setAlarm",
25777            "seconds": seconds,
25778        });
25779        let response = send_request(client_id, request).await;
25780        if response["@type"] == "error" {
25781            return Err(serde_json::from_value(response).unwrap())
25782        }
25783        Ok(())
25784    }
25785    /// Returns information about existing countries. Can be called before authorization
25786    /// # Arguments
25787    /// * `client_id` - The client id to send the request to
25788    #[allow(clippy::too_many_arguments)]
25789    pub async fn get_countries(client_id: i32) -> Result<crate::enums::Countries, crate::types::Error> {
25790        let request = json!({
25791            "@type": "getCountries",
25792        });
25793        let response = send_request(client_id, request).await;
25794        if response["@type"] == "error" {
25795            return Err(serde_json::from_value(response).unwrap())
25796        }
25797        Ok(serde_json::from_value(response).unwrap())
25798    }
25799    /// Uses the current IP address to find the current country. Returns two-letter ISO 3166-1 alpha-2 country code. Can be called before authorization
25800    /// # Arguments
25801    /// * `client_id` - The client id to send the request to
25802    #[allow(clippy::too_many_arguments)]
25803    pub async fn get_country_code(client_id: i32) -> Result<crate::enums::Text, crate::types::Error> {
25804        let request = json!({
25805            "@type": "getCountryCode",
25806        });
25807        let response = send_request(client_id, request).await;
25808        if response["@type"] == "error" {
25809            return Err(serde_json::from_value(response).unwrap())
25810        }
25811        Ok(serde_json::from_value(response).unwrap())
25812    }
25813    /// Returns information about a phone number by its prefix. Can be called before authorization
25814    /// # Arguments
25815    /// * `phone_number_prefix` - The phone number prefix
25816    /// * `client_id` - The client id to send the request to
25817    #[allow(clippy::too_many_arguments)]
25818    pub async fn get_phone_number_info(phone_number_prefix: String, client_id: i32) -> Result<crate::enums::PhoneNumberInfo, crate::types::Error> {
25819        let request = json!({
25820            "@type": "getPhoneNumberInfo",
25821            "phone_number_prefix": phone_number_prefix,
25822        });
25823        let response = send_request(client_id, request).await;
25824        if response["@type"] == "error" {
25825            return Err(serde_json::from_value(response).unwrap())
25826        }
25827        Ok(serde_json::from_value(response).unwrap())
25828    }
25829    /// Returns information about a phone number by its prefix synchronously. getCountries must be called at least once after changing localization to the specified language if properly localized country information is expected. Can be called synchronously
25830    /// # Arguments
25831    /// * `language_code` - A two-letter ISO 639-1 language code for country information localization
25832    /// * `phone_number_prefix` - The phone number prefix
25833    /// * `client_id` - The client id to send the request to
25834    #[allow(clippy::too_many_arguments)]
25835    pub async fn get_phone_number_info_sync(language_code: String, phone_number_prefix: String, client_id: i32) -> Result<crate::enums::PhoneNumberInfo, crate::types::Error> {
25836        let request = json!({
25837            "@type": "getPhoneNumberInfoSync",
25838            "language_code": language_code,
25839            "phone_number_prefix": phone_number_prefix,
25840        });
25841        let response = send_request(client_id, request).await;
25842        if response["@type"] == "error" {
25843            return Err(serde_json::from_value(response).unwrap())
25844        }
25845        Ok(serde_json::from_value(response).unwrap())
25846    }
25847    /// Returns information about a tg: deep link. Use "tg:need_update_for_some_feature" or "tg:some_unsupported_feature" for testing. Returns a 404 error for unknown links. Can be called before authorization
25848    /// # Arguments
25849    /// * `link` - The link
25850    /// * `client_id` - The client id to send the request to
25851    #[allow(clippy::too_many_arguments)]
25852    pub async fn get_deep_link_info(link: String, client_id: i32) -> Result<crate::enums::DeepLinkInfo, crate::types::Error> {
25853        let request = json!({
25854            "@type": "getDeepLinkInfo",
25855            "link": link,
25856        });
25857        let response = send_request(client_id, request).await;
25858        if response["@type"] == "error" {
25859            return Err(serde_json::from_value(response).unwrap())
25860        }
25861        Ok(serde_json::from_value(response).unwrap())
25862    }
25863    /// Returns application config, provided by the server. Can be called before authorization
25864    /// # Arguments
25865    /// * `client_id` - The client id to send the request to
25866    #[allow(clippy::too_many_arguments)]
25867    pub async fn get_application_config(client_id: i32) -> Result<crate::enums::JsonValue, crate::types::Error> {
25868        let request = json!({
25869            "@type": "getApplicationConfig",
25870        });
25871        let response = send_request(client_id, request).await;
25872        if response["@type"] == "error" {
25873            return Err(serde_json::from_value(response).unwrap())
25874        }
25875        Ok(serde_json::from_value(response).unwrap())
25876    }
25877    /// Adds server-provided application changelog as messages to the chat 777000 (Telegram) or as a stories; for official applications only. Returns a 404 error if nothing changed
25878    /// # Arguments
25879    /// * `previous_application_version` - The previous application version
25880    /// * `client_id` - The client id to send the request to
25881    #[allow(clippy::too_many_arguments)]
25882    pub async fn add_application_changelog(previous_application_version: String, client_id: i32) -> Result<(), crate::types::Error> {
25883        let request = json!({
25884            "@type": "addApplicationChangelog",
25885            "previous_application_version": previous_application_version,
25886        });
25887        let response = send_request(client_id, request).await;
25888        if response["@type"] == "error" {
25889            return Err(serde_json::from_value(response).unwrap())
25890        }
25891        Ok(())
25892    }
25893    /// Saves application log event on the server. Can be called before authorization
25894    /// # Arguments
25895    /// * `r#type` - Event type
25896    /// * `chat_id` - Optional chat identifier, associated with the event
25897    /// * `data` - The log event data
25898    /// * `client_id` - The client id to send the request to
25899    #[allow(clippy::too_many_arguments)]
25900    pub async fn save_application_log_event(r#type: String, chat_id: i64, data: crate::enums::JsonValue, client_id: i32) -> Result<(), crate::types::Error> {
25901        let request = json!({
25902            "@type": "saveApplicationLogEvent",
25903            "type": r#type,
25904            "chat_id": chat_id,
25905            "data": data,
25906        });
25907        let response = send_request(client_id, request).await;
25908        if response["@type"] == "error" {
25909            return Err(serde_json::from_value(response).unwrap())
25910        }
25911        Ok(())
25912    }
25913    /// Returns the link for downloading official Telegram application to be used when the current user invites friends to Telegram
25914    /// # Arguments
25915    /// * `client_id` - The client id to send the request to
25916    #[allow(clippy::too_many_arguments)]
25917    pub async fn get_application_download_link(client_id: i32) -> Result<crate::enums::HttpUrl, crate::types::Error> {
25918        let request = json!({
25919            "@type": "getApplicationDownloadLink",
25920        });
25921        let response = send_request(client_id, request).await;
25922        if response["@type"] == "error" {
25923            return Err(serde_json::from_value(response).unwrap())
25924        }
25925        Ok(serde_json::from_value(response).unwrap())
25926    }
25927    /// Adds a proxy server for network requests. Can be called before authorization
25928    /// # Arguments
25929    /// * `server` - Proxy server domain or IP address
25930    /// * `port` - Proxy server port
25931    /// * `enable` - Pass true to immediately enable the proxy
25932    /// * `r#type` - Proxy type
25933    /// * `client_id` - The client id to send the request to
25934    #[allow(clippy::too_many_arguments)]
25935    pub async fn add_proxy(server: String, port: i32, enable: bool, r#type: crate::enums::ProxyType, client_id: i32) -> Result<crate::enums::Proxy, crate::types::Error> {
25936        let request = json!({
25937            "@type": "addProxy",
25938            "server": server,
25939            "port": port,
25940            "enable": enable,
25941            "type": r#type,
25942        });
25943        let response = send_request(client_id, request).await;
25944        if response["@type"] == "error" {
25945            return Err(serde_json::from_value(response).unwrap())
25946        }
25947        Ok(serde_json::from_value(response).unwrap())
25948    }
25949    /// Edits an existing proxy server for network requests. Can be called before authorization
25950    /// # Arguments
25951    /// * `proxy_id` - Proxy identifier
25952    /// * `server` - Proxy server domain or IP address
25953    /// * `port` - Proxy server port
25954    /// * `enable` - Pass true to immediately enable the proxy
25955    /// * `r#type` - Proxy type
25956    /// * `client_id` - The client id to send the request to
25957    #[allow(clippy::too_many_arguments)]
25958    pub async fn edit_proxy(proxy_id: i32, server: String, port: i32, enable: bool, r#type: crate::enums::ProxyType, client_id: i32) -> Result<crate::enums::Proxy, crate::types::Error> {
25959        let request = json!({
25960            "@type": "editProxy",
25961            "proxy_id": proxy_id,
25962            "server": server,
25963            "port": port,
25964            "enable": enable,
25965            "type": r#type,
25966        });
25967        let response = send_request(client_id, request).await;
25968        if response["@type"] == "error" {
25969            return Err(serde_json::from_value(response).unwrap())
25970        }
25971        Ok(serde_json::from_value(response).unwrap())
25972    }
25973    /// Enables a proxy. Only one proxy can be enabled at a time. Can be called before authorization
25974    /// # Arguments
25975    /// * `proxy_id` - Proxy identifier
25976    /// * `client_id` - The client id to send the request to
25977    #[allow(clippy::too_many_arguments)]
25978    pub async fn enable_proxy(proxy_id: i32, client_id: i32) -> Result<(), crate::types::Error> {
25979        let request = json!({
25980            "@type": "enableProxy",
25981            "proxy_id": proxy_id,
25982        });
25983        let response = send_request(client_id, request).await;
25984        if response["@type"] == "error" {
25985            return Err(serde_json::from_value(response).unwrap())
25986        }
25987        Ok(())
25988    }
25989    /// Disables the currently enabled proxy. Can be called before authorization
25990    /// # Arguments
25991    /// * `client_id` - The client id to send the request to
25992    #[allow(clippy::too_many_arguments)]
25993    pub async fn disable_proxy(client_id: i32) -> Result<(), crate::types::Error> {
25994        let request = json!({
25995            "@type": "disableProxy",
25996        });
25997        let response = send_request(client_id, request).await;
25998        if response["@type"] == "error" {
25999            return Err(serde_json::from_value(response).unwrap())
26000        }
26001        Ok(())
26002    }
26003    /// Removes a proxy server. Can be called before authorization
26004    /// # Arguments
26005    /// * `proxy_id` - Proxy identifier
26006    /// * `client_id` - The client id to send the request to
26007    #[allow(clippy::too_many_arguments)]
26008    pub async fn remove_proxy(proxy_id: i32, client_id: i32) -> Result<(), crate::types::Error> {
26009        let request = json!({
26010            "@type": "removeProxy",
26011            "proxy_id": proxy_id,
26012        });
26013        let response = send_request(client_id, request).await;
26014        if response["@type"] == "error" {
26015            return Err(serde_json::from_value(response).unwrap())
26016        }
26017        Ok(())
26018    }
26019    /// Returns list of proxies that are currently set up. Can be called before authorization
26020    /// # Arguments
26021    /// * `client_id` - The client id to send the request to
26022    #[allow(clippy::too_many_arguments)]
26023    pub async fn get_proxies(client_id: i32) -> Result<crate::enums::Proxies, crate::types::Error> {
26024        let request = json!({
26025            "@type": "getProxies",
26026        });
26027        let response = send_request(client_id, request).await;
26028        if response["@type"] == "error" {
26029            return Err(serde_json::from_value(response).unwrap())
26030        }
26031        Ok(serde_json::from_value(response).unwrap())
26032    }
26033    /// Returns an HTTPS link, which can be used to add a proxy. Available only for SOCKS5 and MTProto proxies. Can be called before authorization
26034    /// # Arguments
26035    /// * `proxy_id` - Proxy identifier
26036    /// * `client_id` - The client id to send the request to
26037    #[allow(clippy::too_many_arguments)]
26038    pub async fn get_proxy_link(proxy_id: i32, client_id: i32) -> Result<crate::enums::HttpUrl, crate::types::Error> {
26039        let request = json!({
26040            "@type": "getProxyLink",
26041            "proxy_id": proxy_id,
26042        });
26043        let response = send_request(client_id, request).await;
26044        if response["@type"] == "error" {
26045            return Err(serde_json::from_value(response).unwrap())
26046        }
26047        Ok(serde_json::from_value(response).unwrap())
26048    }
26049    /// Computes time needed to receive a response from a Telegram server through a proxy. Can be called before authorization
26050    /// # Arguments
26051    /// * `proxy_id` - Proxy identifier. Use 0 to ping a Telegram server without a proxy
26052    /// * `client_id` - The client id to send the request to
26053    #[allow(clippy::too_many_arguments)]
26054    pub async fn ping_proxy(proxy_id: i32, client_id: i32) -> Result<crate::enums::Seconds, crate::types::Error> {
26055        let request = json!({
26056            "@type": "pingProxy",
26057            "proxy_id": proxy_id,
26058        });
26059        let response = send_request(client_id, request).await;
26060        if response["@type"] == "error" {
26061            return Err(serde_json::from_value(response).unwrap())
26062        }
26063        Ok(serde_json::from_value(response).unwrap())
26064    }
26065    /// Sets new log stream for internal logging of TDLib. Can be called synchronously
26066    /// # Arguments
26067    /// * `log_stream` - New log stream
26068    /// * `client_id` - The client id to send the request to
26069    #[allow(clippy::too_many_arguments)]
26070    pub async fn set_log_stream(log_stream: crate::enums::LogStream, client_id: i32) -> Result<(), crate::types::Error> {
26071        let request = json!({
26072            "@type": "setLogStream",
26073            "log_stream": log_stream,
26074        });
26075        let response = send_request(client_id, request).await;
26076        if response["@type"] == "error" {
26077            return Err(serde_json::from_value(response).unwrap())
26078        }
26079        Ok(())
26080    }
26081    /// Returns information about currently used log stream for internal logging of TDLib. Can be called synchronously
26082    /// # Arguments
26083    /// * `client_id` - The client id to send the request to
26084    #[allow(clippy::too_many_arguments)]
26085    pub async fn get_log_stream(client_id: i32) -> Result<crate::enums::LogStream, crate::types::Error> {
26086        let request = json!({
26087            "@type": "getLogStream",
26088        });
26089        let response = send_request(client_id, request).await;
26090        if response["@type"] == "error" {
26091            return Err(serde_json::from_value(response).unwrap())
26092        }
26093        Ok(serde_json::from_value(response).unwrap())
26094    }
26095    /// Sets the verbosity level of the internal logging of TDLib. Can be called synchronously
26096    /// # Arguments
26097    /// * `new_verbosity_level` - New value of the verbosity level for logging. Value 0 corresponds to fatal errors, value 1 corresponds to errors, value 2 corresponds to warnings and debug warnings,
26098    /// value 3 corresponds to informational, value 4 corresponds to debug, value 5 corresponds to verbose debug, value greater than 5 and up to 1023 can be used to enable even more logging
26099    /// * `client_id` - The client id to send the request to
26100    #[allow(clippy::too_many_arguments)]
26101    pub async fn set_log_verbosity_level(new_verbosity_level: i32, client_id: i32) -> Result<(), crate::types::Error> {
26102        let request = json!({
26103            "@type": "setLogVerbosityLevel",
26104            "new_verbosity_level": new_verbosity_level,
26105        });
26106        let response = send_request(client_id, request).await;
26107        if response["@type"] == "error" {
26108            return Err(serde_json::from_value(response).unwrap())
26109        }
26110        Ok(())
26111    }
26112    /// Returns current verbosity level of the internal logging of TDLib. Can be called synchronously
26113    /// # Arguments
26114    /// * `client_id` - The client id to send the request to
26115    #[allow(clippy::too_many_arguments)]
26116    pub async fn get_log_verbosity_level(client_id: i32) -> Result<crate::enums::LogVerbosityLevel, crate::types::Error> {
26117        let request = json!({
26118            "@type": "getLogVerbosityLevel",
26119        });
26120        let response = send_request(client_id, request).await;
26121        if response["@type"] == "error" {
26122            return Err(serde_json::from_value(response).unwrap())
26123        }
26124        Ok(serde_json::from_value(response).unwrap())
26125    }
26126    /// Returns list of available TDLib internal log tags, for example, ["actor", "binlog", "connections", "notifications", "proxy"]. Can be called synchronously
26127    /// # Arguments
26128    /// * `client_id` - The client id to send the request to
26129    #[allow(clippy::too_many_arguments)]
26130    pub async fn get_log_tags(client_id: i32) -> Result<crate::enums::LogTags, crate::types::Error> {
26131        let request = json!({
26132            "@type": "getLogTags",
26133        });
26134        let response = send_request(client_id, request).await;
26135        if response["@type"] == "error" {
26136            return Err(serde_json::from_value(response).unwrap())
26137        }
26138        Ok(serde_json::from_value(response).unwrap())
26139    }
26140    /// Sets the verbosity level for a specified TDLib internal log tag. Can be called synchronously
26141    /// # Arguments
26142    /// * `tag` - Logging tag to change verbosity level
26143    /// * `new_verbosity_level` - New verbosity level; 1-1024
26144    /// * `client_id` - The client id to send the request to
26145    #[allow(clippy::too_many_arguments)]
26146    pub async fn set_log_tag_verbosity_level(tag: String, new_verbosity_level: i32, client_id: i32) -> Result<(), crate::types::Error> {
26147        let request = json!({
26148            "@type": "setLogTagVerbosityLevel",
26149            "tag": tag,
26150            "new_verbosity_level": new_verbosity_level,
26151        });
26152        let response = send_request(client_id, request).await;
26153        if response["@type"] == "error" {
26154            return Err(serde_json::from_value(response).unwrap())
26155        }
26156        Ok(())
26157    }
26158    /// Returns current verbosity level for a specified TDLib internal log tag. Can be called synchronously
26159    /// # Arguments
26160    /// * `tag` - Logging tag to change verbosity level
26161    /// * `client_id` - The client id to send the request to
26162    #[allow(clippy::too_many_arguments)]
26163    pub async fn get_log_tag_verbosity_level(tag: String, client_id: i32) -> Result<crate::enums::LogVerbosityLevel, crate::types::Error> {
26164        let request = json!({
26165            "@type": "getLogTagVerbosityLevel",
26166            "tag": tag,
26167        });
26168        let response = send_request(client_id, request).await;
26169        if response["@type"] == "error" {
26170            return Err(serde_json::from_value(response).unwrap())
26171        }
26172        Ok(serde_json::from_value(response).unwrap())
26173    }
26174    /// Adds a message to TDLib internal log. Can be called synchronously
26175    /// # Arguments
26176    /// * `verbosity_level` - The minimum verbosity level needed for the message to be logged; 0-1023
26177    /// * `text` - Text of a message to log
26178    /// * `client_id` - The client id to send the request to
26179    #[allow(clippy::too_many_arguments)]
26180    pub async fn add_log_message(verbosity_level: i32, text: String, client_id: i32) -> Result<(), crate::types::Error> {
26181        let request = json!({
26182            "@type": "addLogMessage",
26183            "verbosity_level": verbosity_level,
26184            "text": text,
26185        });
26186        let response = send_request(client_id, request).await;
26187        if response["@type"] == "error" {
26188            return Err(serde_json::from_value(response).unwrap())
26189        }
26190        Ok(())
26191    }
26192    /// Returns support information for the given user; for Telegram support only
26193    /// # Arguments
26194    /// * `user_id` - User identifier
26195    /// * `client_id` - The client id to send the request to
26196    #[allow(clippy::too_many_arguments)]
26197    pub async fn get_user_support_info(user_id: i64, client_id: i32) -> Result<crate::enums::UserSupportInfo, crate::types::Error> {
26198        let request = json!({
26199            "@type": "getUserSupportInfo",
26200            "user_id": user_id,
26201        });
26202        let response = send_request(client_id, request).await;
26203        if response["@type"] == "error" {
26204            return Err(serde_json::from_value(response).unwrap())
26205        }
26206        Ok(serde_json::from_value(response).unwrap())
26207    }
26208    /// Sets support information for the given user; for Telegram support only
26209    /// # Arguments
26210    /// * `user_id` - User identifier
26211    /// * `message` - New information message
26212    /// * `client_id` - The client id to send the request to
26213    #[allow(clippy::too_many_arguments)]
26214    pub async fn set_user_support_info(user_id: i64, message: crate::types::FormattedText, client_id: i32) -> Result<crate::enums::UserSupportInfo, crate::types::Error> {
26215        let request = json!({
26216            "@type": "setUserSupportInfo",
26217            "user_id": user_id,
26218            "message": message,
26219        });
26220        let response = send_request(client_id, request).await;
26221        if response["@type"] == "error" {
26222            return Err(serde_json::from_value(response).unwrap())
26223        }
26224        Ok(serde_json::from_value(response).unwrap())
26225    }
26226    /// Returns localized name of the Telegram support user; for Telegram support only
26227    /// # Arguments
26228    /// * `client_id` - The client id to send the request to
26229    #[allow(clippy::too_many_arguments)]
26230    pub async fn get_support_name(client_id: i32) -> Result<crate::enums::Text, crate::types::Error> {
26231        let request = json!({
26232            "@type": "getSupportName",
26233        });
26234        let response = send_request(client_id, request).await;
26235        if response["@type"] == "error" {
26236            return Err(serde_json::from_value(response).unwrap())
26237        }
26238        Ok(serde_json::from_value(response).unwrap())
26239    }
26240    /// Does nothing; for testing only. This is an offline method. Can be called before authorization
26241    /// # Arguments
26242    /// * `client_id` - The client id to send the request to
26243    #[allow(clippy::too_many_arguments)]
26244    pub async fn test_call_empty(client_id: i32) -> Result<(), crate::types::Error> {
26245        let request = json!({
26246            "@type": "testCallEmpty",
26247        });
26248        let response = send_request(client_id, request).await;
26249        if response["@type"] == "error" {
26250            return Err(serde_json::from_value(response).unwrap())
26251        }
26252        Ok(())
26253    }
26254    /// Returns the received string; for testing only. This is an offline method. Can be called before authorization
26255    /// # Arguments
26256    /// * `x` - String to return
26257    /// * `client_id` - The client id to send the request to
26258    #[allow(clippy::too_many_arguments)]
26259    pub async fn test_call_string(x: String, client_id: i32) -> Result<crate::enums::TestString, crate::types::Error> {
26260        let request = json!({
26261            "@type": "testCallString",
26262            "x": x,
26263        });
26264        let response = send_request(client_id, request).await;
26265        if response["@type"] == "error" {
26266            return Err(serde_json::from_value(response).unwrap())
26267        }
26268        Ok(serde_json::from_value(response).unwrap())
26269    }
26270    /// Returns the received bytes; for testing only. This is an offline method. Can be called before authorization
26271    /// # Arguments
26272    /// * `x` - Bytes to return
26273    /// * `client_id` - The client id to send the request to
26274    #[allow(clippy::too_many_arguments)]
26275    pub async fn test_call_bytes(x: String, client_id: i32) -> Result<crate::enums::TestBytes, crate::types::Error> {
26276        let request = json!({
26277            "@type": "testCallBytes",
26278            "x": x,
26279        });
26280        let response = send_request(client_id, request).await;
26281        if response["@type"] == "error" {
26282            return Err(serde_json::from_value(response).unwrap())
26283        }
26284        Ok(serde_json::from_value(response).unwrap())
26285    }
26286    /// Returns the received vector of numbers; for testing only. This is an offline method. Can be called before authorization
26287    /// # Arguments
26288    /// * `x` - Vector of numbers to return
26289    /// * `client_id` - The client id to send the request to
26290    #[allow(clippy::too_many_arguments)]
26291    pub async fn test_call_vector_int(x: Vec<i32>, client_id: i32) -> Result<crate::enums::TestVectorInt, crate::types::Error> {
26292        let request = json!({
26293            "@type": "testCallVectorInt",
26294            "x": x,
26295        });
26296        let response = send_request(client_id, request).await;
26297        if response["@type"] == "error" {
26298            return Err(serde_json::from_value(response).unwrap())
26299        }
26300        Ok(serde_json::from_value(response).unwrap())
26301    }
26302    /// Returns the received vector of objects containing a number; for testing only. This is an offline method. Can be called before authorization
26303    /// # Arguments
26304    /// * `x` - Vector of objects to return
26305    /// * `client_id` - The client id to send the request to
26306    #[allow(clippy::too_many_arguments)]
26307    pub async fn test_call_vector_int_object(x: Vec<crate::types::TestInt>, client_id: i32) -> Result<crate::enums::TestVectorIntObject, crate::types::Error> {
26308        let request = json!({
26309            "@type": "testCallVectorIntObject",
26310            "x": x,
26311        });
26312        let response = send_request(client_id, request).await;
26313        if response["@type"] == "error" {
26314            return Err(serde_json::from_value(response).unwrap())
26315        }
26316        Ok(serde_json::from_value(response).unwrap())
26317    }
26318    /// Returns the received vector of strings; for testing only. This is an offline method. Can be called before authorization
26319    /// # Arguments
26320    /// * `x` - Vector of strings to return
26321    /// * `client_id` - The client id to send the request to
26322    #[allow(clippy::too_many_arguments)]
26323    pub async fn test_call_vector_string(x: Vec<String>, client_id: i32) -> Result<crate::enums::TestVectorString, crate::types::Error> {
26324        let request = json!({
26325            "@type": "testCallVectorString",
26326            "x": x,
26327        });
26328        let response = send_request(client_id, request).await;
26329        if response["@type"] == "error" {
26330            return Err(serde_json::from_value(response).unwrap())
26331        }
26332        Ok(serde_json::from_value(response).unwrap())
26333    }
26334    /// Returns the received vector of objects containing a string; for testing only. This is an offline method. Can be called before authorization
26335    /// # Arguments
26336    /// * `x` - Vector of objects to return
26337    /// * `client_id` - The client id to send the request to
26338    #[allow(clippy::too_many_arguments)]
26339    pub async fn test_call_vector_string_object(x: Vec<crate::types::TestString>, client_id: i32) -> Result<crate::enums::TestVectorStringObject, crate::types::Error> {
26340        let request = json!({
26341            "@type": "testCallVectorStringObject",
26342            "x": x,
26343        });
26344        let response = send_request(client_id, request).await;
26345        if response["@type"] == "error" {
26346            return Err(serde_json::from_value(response).unwrap())
26347        }
26348        Ok(serde_json::from_value(response).unwrap())
26349    }
26350    /// Returns the squared received number; for testing only. This is an offline method. Can be called before authorization
26351    /// # Arguments
26352    /// * `x` - Number to square
26353    /// * `client_id` - The client id to send the request to
26354    #[allow(clippy::too_many_arguments)]
26355    pub async fn test_square_int(x: i32, client_id: i32) -> Result<crate::enums::TestInt, crate::types::Error> {
26356        let request = json!({
26357            "@type": "testSquareInt",
26358            "x": x,
26359        });
26360        let response = send_request(client_id, request).await;
26361        if response["@type"] == "error" {
26362            return Err(serde_json::from_value(response).unwrap())
26363        }
26364        Ok(serde_json::from_value(response).unwrap())
26365    }
26366    /// Sends a simple network request to the Telegram servers; for testing only. Can be called before authorization
26367    /// # Arguments
26368    /// * `client_id` - The client id to send the request to
26369    #[allow(clippy::too_many_arguments)]
26370    pub async fn test_network(client_id: i32) -> Result<(), crate::types::Error> {
26371        let request = json!({
26372            "@type": "testNetwork",
26373        });
26374        let response = send_request(client_id, request).await;
26375        if response["@type"] == "error" {
26376            return Err(serde_json::from_value(response).unwrap())
26377        }
26378        Ok(())
26379    }
26380    /// Sends a simple network request to the Telegram servers via proxy; for testing only. Can be called before authorization
26381    /// # Arguments
26382    /// * `server` - Proxy server domain or IP address
26383    /// * `port` - Proxy server port
26384    /// * `r#type` - Proxy type
26385    /// * `dc_id` - Identifier of a datacenter with which to test connection
26386    /// * `timeout` - The maximum overall timeout for the request
26387    /// * `client_id` - The client id to send the request to
26388    #[allow(clippy::too_many_arguments)]
26389    pub async fn test_proxy(server: String, port: i32, r#type: crate::enums::ProxyType, dc_id: i32, timeout: f64, client_id: i32) -> Result<(), crate::types::Error> {
26390        let request = json!({
26391            "@type": "testProxy",
26392            "server": server,
26393            "port": port,
26394            "type": r#type,
26395            "dc_id": dc_id,
26396            "timeout": timeout,
26397        });
26398        let response = send_request(client_id, request).await;
26399        if response["@type"] == "error" {
26400            return Err(serde_json::from_value(response).unwrap())
26401        }
26402        Ok(())
26403    }
26404    /// Forces an updates.getDifference call to the Telegram servers; for testing only
26405    /// # Arguments
26406    /// * `client_id` - The client id to send the request to
26407    #[allow(clippy::too_many_arguments)]
26408    pub async fn test_get_difference(client_id: i32) -> Result<(), crate::types::Error> {
26409        let request = json!({
26410            "@type": "testGetDifference",
26411        });
26412        let response = send_request(client_id, request).await;
26413        if response["@type"] == "error" {
26414            return Err(serde_json::from_value(response).unwrap())
26415        }
26416        Ok(())
26417    }
26418    /// Does nothing and ensures that the Update object is used; for testing only. This is an offline method. Can be called before authorization
26419    /// # Arguments
26420    /// * `client_id` - The client id to send the request to
26421    #[allow(clippy::too_many_arguments)]
26422    pub async fn test_use_update(client_id: i32) -> Result<crate::enums::Update, crate::types::Error> {
26423        let request = json!({
26424            "@type": "testUseUpdate",
26425        });
26426        let response = send_request(client_id, request).await;
26427        if response["@type"] == "error" {
26428            return Err(serde_json::from_value(response).unwrap())
26429        }
26430        Ok(serde_json::from_value(response).unwrap())
26431    }
26432    /// Returns the specified error and ensures that the Error object is used; for testing only. Can be called synchronously
26433    /// # Arguments
26434    /// * `error` - The error to be returned
26435    /// * `client_id` - The client id to send the request to
26436    #[allow(clippy::too_many_arguments)]
26437    pub async fn test_return_error(error: crate::types::Error, client_id: i32) -> Result<crate::enums::Error, crate::types::Error> {
26438        let request = json!({
26439            "@type": "testReturnError",
26440            "error": error,
26441        });
26442        let response = send_request(client_id, request).await;
26443        if response["@type"] == "error" {
26444            return Err(serde_json::from_value(response).unwrap())
26445        }
26446        Ok(serde_json::from_value(response).unwrap())
26447    }
26448}