rust_tdlib/client/
api.rs

1use super::tdlib_client::TdLibClient;
2use super::Client;
3use crate::{errors::Result, types::*};
4
5impl<R> Client<R>
6where
7    R: TdLibClient + Clone,
8{
9    // Accepts an incoming call
10    pub async fn accept_call<C: AsRef<AcceptCall>>(&self, accept_call: C) -> Result<Ok> {
11        self.make_request(accept_call).await
12    }
13
14    // Accepts Telegram terms of services
15    pub async fn accept_terms_of_service<C: AsRef<AcceptTermsOfService>>(
16        &self,
17        accept_terms_of_service: C,
18    ) -> Result<Ok> {
19        self.make_request(accept_terms_of_service).await
20    }
21
22    // Adds a new member to a chat. Members can't be added to private or secret chats
23    pub async fn add_chat_member<C: AsRef<AddChatMember>>(&self, add_chat_member: C) -> Result<Ok> {
24        self.make_request(add_chat_member).await
25    }
26
27    // 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
28    pub async fn add_chat_members<C: AsRef<AddChatMembers>>(
29        &self,
30        add_chat_members: C,
31    ) -> Result<Ok> {
32        self.make_request(add_chat_members).await
33    }
34
35    // 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
36    pub async fn add_chat_to_list<C: AsRef<AddChatToList>>(
37        &self,
38        add_chat_to_list: C,
39    ) -> Result<Ok> {
40        self.make_request(add_chat_to_list).await
41    }
42
43    // Adds a user to the contact list or edits an existing contact by their user identifier
44    pub async fn add_contact<C: AsRef<AddContact>>(&self, add_contact: C) -> Result<Ok> {
45        self.make_request(add_contact).await
46    }
47
48    // Adds a custom server language pack to the list of installed language packs in current localization target. Can be called before authorization
49    pub async fn add_custom_server_language_pack<C: AsRef<AddCustomServerLanguagePack>>(
50        &self,
51        add_custom_server_language_pack: C,
52    ) -> Result<Ok> {
53        self.make_request(add_custom_server_language_pack).await
54    }
55
56    // 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. Only stickers belonging to a sticker set can be added to this list
57    pub async fn add_favorite_sticker<C: AsRef<AddFavoriteSticker>>(
58        &self,
59        add_favorite_sticker: C,
60    ) -> Result<Ok> {
61        self.make_request(add_favorite_sticker).await
62    }
63
64    // 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
65    pub async fn add_local_message<C: AsRef<AddLocalMessage>>(
66        &self,
67        add_local_message: C,
68    ) -> Result<Message> {
69        self.make_request(add_local_message).await
70    }
71
72    // Adds a message to TDLib internal log. Can be called synchronously
73    pub async fn add_log_message<C: AsRef<AddLogMessage>>(&self, add_log_message: C) -> Result<Ok> {
74        self.make_request(add_log_message).await
75    }
76
77    // Adds the specified data to data usage statistics. Can be called before authorization
78    pub async fn add_network_statistics<C: AsRef<AddNetworkStatistics>>(
79        &self,
80        add_network_statistics: C,
81    ) -> Result<Ok> {
82        self.make_request(add_network_statistics).await
83    }
84
85    // Adds a proxy server for network requests. Can be called before authorization
86    pub async fn add_proxy<C: AsRef<AddProxy>>(&self, add_proxy: C) -> Result<Proxy> {
87        self.make_request(add_proxy).await
88    }
89
90    // 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. Only stickers belonging to a sticker set can be added to this list
91    pub async fn add_recent_sticker<C: AsRef<AddRecentSticker>>(
92        &self,
93        add_recent_sticker: C,
94    ) -> Result<Stickers> {
95        self.make_request(add_recent_sticker).await
96    }
97
98    // 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
99    pub async fn add_recently_found_chat<C: AsRef<AddRecentlyFoundChat>>(
100        &self,
101        add_recently_found_chat: C,
102    ) -> Result<Ok> {
103        self.make_request(add_recently_found_chat).await
104    }
105
106    // 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
107    pub async fn add_saved_animation<C: AsRef<AddSavedAnimation>>(
108        &self,
109        add_saved_animation: C,
110    ) -> Result<Ok> {
111        self.make_request(add_saved_animation).await
112    }
113
114    // Adds a new sticker to a set; for bots only. Returns the sticker set
115    pub async fn add_sticker_to_set<C: AsRef<AddStickerToSet>>(
116        &self,
117        add_sticker_to_set: C,
118    ) -> Result<StickerSet> {
119        self.make_request(add_sticker_to_set).await
120    }
121
122    // Sets the result of a callback query; for bots only
123    pub async fn answer_callback_query<C: AsRef<AnswerCallbackQuery>>(
124        &self,
125        answer_callback_query: C,
126    ) -> Result<Ok> {
127        self.make_request(answer_callback_query).await
128    }
129
130    // Answers a custom query; for bots only
131    pub async fn answer_custom_query<C: AsRef<AnswerCustomQuery>>(
132        &self,
133        answer_custom_query: C,
134    ) -> Result<Ok> {
135        self.make_request(answer_custom_query).await
136    }
137
138    // Sets the result of an inline query; for bots only
139    pub async fn answer_inline_query<C: AsRef<AnswerInlineQuery>>(
140        &self,
141        answer_inline_query: C,
142    ) -> Result<Ok> {
143        self.make_request(answer_inline_query).await
144    }
145
146    // Sets the result of a pre-checkout query; for bots only
147    pub async fn answer_pre_checkout_query<C: AsRef<AnswerPreCheckoutQuery>>(
148        &self,
149        answer_pre_checkout_query: C,
150    ) -> Result<Ok> {
151        self.make_request(answer_pre_checkout_query).await
152    }
153
154    // Sets the result of a shipping query; for bots only
155    pub async fn answer_shipping_query<C: AsRef<AnswerShippingQuery>>(
156        &self,
157        answer_shipping_query: C,
158    ) -> Result<Ok> {
159        self.make_request(answer_shipping_query).await
160    }
161
162    // 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
163    pub async fn ban_chat_member<C: AsRef<BanChatMember>>(&self, ban_chat_member: C) -> Result<Ok> {
164        self.make_request(ban_chat_member).await
165    }
166
167    // Blocks an original sender of a message in the Replies chat
168    pub async fn block_message_sender_from_replies<C: AsRef<BlockMessageSenderFromReplies>>(
169        &self,
170        block_message_sender_from_replies: C,
171    ) -> Result<Ok> {
172        self.make_request(block_message_sender_from_replies).await
173    }
174
175    // Checks whether the current session can be used to transfer a chat ownership to another user
176    pub async fn can_transfer_ownership<C: AsRef<CanTransferOwnership>>(
177        &self,
178        can_transfer_ownership: C,
179    ) -> Result<CanTransferOwnershipResult> {
180        self.make_request(can_transfer_ownership).await
181    }
182
183    // Stops the downloading of a file. If a file has already been downloaded, does nothing
184    pub async fn cancel_download_file<C: AsRef<CancelDownloadFile>>(
185        &self,
186        cancel_download_file: C,
187    ) -> Result<Ok> {
188        self.make_request(cancel_download_file).await
189    }
190
191    // Cancels reset of 2-step verification password. The method can be called if passwordState.pending_reset_date > 0
192    pub async fn cancel_password_reset<C: AsRef<CancelPasswordReset>>(
193        &self,
194        cancel_password_reset: C,
195    ) -> Result<Ok> {
196        self.make_request(cancel_password_reset).await
197    }
198
199    // Stops the uploading of a file. Supported only for files uploaded by using uploadFile. For other files the behavior is undefined
200    pub async fn cancel_upload_file<C: AsRef<CancelUploadFile>>(
201        &self,
202        cancel_upload_file: C,
203    ) -> Result<Ok> {
204        self.make_request(cancel_upload_file).await
205    }
206
207    // 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. Query result depends on the result of the previous query, so only one query is possible at the same time
208    pub async fn change_imported_contacts<C: AsRef<ChangeImportedContacts>>(
209        &self,
210        change_imported_contacts: C,
211    ) -> Result<ImportedContacts> {
212        self.make_request(change_imported_contacts).await
213    }
214
215    // Changes the phone number of the user and sends an authentication code to the user's new phone number. On success, returns information about the sent code
216    pub async fn change_phone_number<C: AsRef<ChangePhoneNumber>>(
217        &self,
218        change_phone_number: C,
219    ) -> Result<AuthenticationCodeInfo> {
220        self.make_request(change_phone_number).await
221    }
222
223    // Installs/uninstalls or activates/archives a sticker set
224    pub async fn change_sticker_set<C: AsRef<ChangeStickerSet>>(
225        &self,
226        change_sticker_set: C,
227    ) -> Result<Ok> {
228        self.make_request(change_sticker_set).await
229    }
230
231    // 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
232    pub async fn check_authentication_bot_token<C: AsRef<CheckAuthenticationBotToken>>(
233        &self,
234        check_authentication_bot_token: C,
235    ) -> Result<Ok> {
236        self.make_request(check_authentication_bot_token).await
237    }
238
239    // Checks the authentication code. Works only when the current authorization state is authorizationStateWaitCode
240    pub async fn check_authentication_code<C: AsRef<CheckAuthenticationCode>>(
241        &self,
242        check_authentication_code: C,
243    ) -> Result<Ok> {
244        self.make_request(check_authentication_code).await
245    }
246
247    // Checks the authentication password for correctness. Works only when the current authorization state is authorizationStateWaitPassword
248    pub async fn check_authentication_password<C: AsRef<CheckAuthenticationPassword>>(
249        &self,
250        check_authentication_password: C,
251    ) -> Result<Ok> {
252        self.make_request(check_authentication_password).await
253    }
254
255    // Checks whether a password recovery code sent to an email address is valid. Works only when the current authorization state is authorizationStateWaitPassword
256    pub async fn check_authentication_password_recovery_code<
257        C: AsRef<CheckAuthenticationPasswordRecoveryCode>,
258    >(
259        &self,
260        check_authentication_password_recovery_code: C,
261    ) -> Result<Ok> {
262        self.make_request(check_authentication_password_recovery_code)
263            .await
264    }
265
266    // Checks the authentication code sent to confirm a new phone number of the user
267    pub async fn check_change_phone_number_code<C: AsRef<CheckChangePhoneNumberCode>>(
268        &self,
269        check_change_phone_number_code: C,
270    ) -> Result<Ok> {
271        self.make_request(check_change_phone_number_code).await
272    }
273
274    // Checks the validity of an invite link for a chat and returns information about the corresponding chat
275    pub async fn check_chat_invite_link<C: AsRef<CheckChatInviteLink>>(
276        &self,
277        check_chat_invite_link: C,
278    ) -> Result<ChatInviteLinkInfo> {
279        self.make_request(check_chat_invite_link).await
280    }
281
282    // Checks whether a username can be set for a chat
283    pub async fn check_chat_username<C: AsRef<CheckChatUsername>>(
284        &self,
285        check_chat_username: C,
286    ) -> Result<CheckChatUsernameResult> {
287        self.make_request(check_chat_username).await
288    }
289
290    // Checks whether the maximum number of owned public chats has been reached. Returns corresponding error if the limit was reached
291    pub async fn check_created_public_chats_limit<C: AsRef<CheckCreatedPublicChatsLimit>>(
292        &self,
293        check_created_public_chats_limit: C,
294    ) -> Result<Ok> {
295        self.make_request(check_created_public_chats_limit).await
296    }
297
298    // Checks the database encryption key for correctness. Works only when the current authorization state is authorizationStateWaitEncryptionKey
299    pub async fn check_database_encryption_key<C: AsRef<CheckDatabaseEncryptionKey>>(
300        &self,
301        check_database_encryption_key: C,
302    ) -> Result<Ok> {
303        self.make_request(check_database_encryption_key).await
304    }
305
306    // Checks the email address verification code for Telegram Passport
307    pub async fn check_email_address_verification_code<
308        C: AsRef<CheckEmailAddressVerificationCode>,
309    >(
310        &self,
311        check_email_address_verification_code: C,
312    ) -> Result<Ok> {
313        self.make_request(check_email_address_verification_code)
314            .await
315    }
316
317    // Checks whether a 2-step verification password recovery code sent to an email address is valid
318    pub async fn check_password_recovery_code<C: AsRef<CheckPasswordRecoveryCode>>(
319        &self,
320        check_password_recovery_code: C,
321    ) -> Result<Ok> {
322        self.make_request(check_password_recovery_code).await
323    }
324
325    // Checks phone number confirmation code
326    pub async fn check_phone_number_confirmation_code<
327        C: AsRef<CheckPhoneNumberConfirmationCode>,
328    >(
329        &self,
330        check_phone_number_confirmation_code: C,
331    ) -> Result<Ok> {
332        self.make_request(check_phone_number_confirmation_code)
333            .await
334    }
335
336    // Checks the phone number verification code for Telegram Passport
337    pub async fn check_phone_number_verification_code<
338        C: AsRef<CheckPhoneNumberVerificationCode>,
339    >(
340        &self,
341        check_phone_number_verification_code: C,
342    ) -> Result<Ok> {
343        self.make_request(check_phone_number_verification_code)
344            .await
345    }
346
347    // Checks the 2-step verification recovery email address verification code
348    pub async fn check_recovery_email_address_code<C: AsRef<CheckRecoveryEmailAddressCode>>(
349        &self,
350        check_recovery_email_address_code: C,
351    ) -> Result<PasswordState> {
352        self.make_request(check_recovery_email_address_code).await
353    }
354
355    // Checks whether a name can be used for a new sticker set
356    pub async fn check_sticker_set_name<C: AsRef<CheckStickerSetName>>(
357        &self,
358        check_sticker_set_name: C,
359    ) -> Result<CheckStickerSetNameResult> {
360        self.make_request(check_sticker_set_name).await
361    }
362
363    // 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
364    pub async fn clean_file_name<C: AsRef<CleanFileName>>(
365        &self,
366        clean_file_name: C,
367    ) -> Result<Text> {
368        self.make_request(clean_file_name).await
369    }
370
371    // Clears draft messages in all chats
372    pub async fn clear_all_draft_messages<C: AsRef<ClearAllDraftMessages>>(
373        &self,
374        clear_all_draft_messages: C,
375    ) -> Result<Ok> {
376        self.make_request(clear_all_draft_messages).await
377    }
378
379    // Clears all imported contacts, contact list remains unchanged
380    pub async fn clear_imported_contacts<C: AsRef<ClearImportedContacts>>(
381        &self,
382        clear_imported_contacts: C,
383    ) -> Result<Ok> {
384        self.make_request(clear_imported_contacts).await
385    }
386
387    // Clears the list of recently used stickers
388    pub async fn clear_recent_stickers<C: AsRef<ClearRecentStickers>>(
389        &self,
390        clear_recent_stickers: C,
391    ) -> Result<Ok> {
392        self.make_request(clear_recent_stickers).await
393    }
394
395    // Clears the list of recently found chats
396    pub async fn clear_recently_found_chats<C: AsRef<ClearRecentlyFoundChats>>(
397        &self,
398        clear_recently_found_chats: C,
399    ) -> Result<Ok> {
400        self.make_request(clear_recently_found_chats).await
401    }
402
403    // 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
404    pub async fn click_animated_emoji_message<C: AsRef<ClickAnimatedEmojiMessage>>(
405        &self,
406        click_animated_emoji_message: C,
407    ) -> Result<Sticker> {
408        self.make_request(click_animated_emoji_message).await
409    }
410
411    // 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
412    pub async fn close<C: AsRef<Close>>(&self, close: C) -> Result<Ok> {
413        self.make_request(close).await
414    }
415
416    // Informs TDLib that the chat is closed by the user. Many useful activities depend on the chat being opened or closed
417    pub async fn close_chat<C: AsRef<CloseChat>>(&self, close_chat: C) -> Result<Ok> {
418        self.make_request(close_chat).await
419    }
420
421    // Closes a secret chat, effectively transferring its state to secretChatStateClosed
422    pub async fn close_secret_chat<C: AsRef<CloseSecretChat>>(
423        &self,
424        close_secret_chat: C,
425    ) -> Result<Ok> {
426        self.make_request(close_secret_chat).await
427    }
428
429    // Confirms QR code authentication on another device. Returns created session on success
430    pub async fn confirm_qr_code_authentication<C: AsRef<ConfirmQrCodeAuthentication>>(
431        &self,
432        confirm_qr_code_authentication: C,
433    ) -> Result<Session> {
434        self.make_request(confirm_qr_code_authentication).await
435    }
436
437    // Returns an existing chat corresponding to a known basic group
438    pub async fn create_basic_group_chat<C: AsRef<CreateBasicGroupChat>>(
439        &self,
440        create_basic_group_chat: C,
441    ) -> Result<Chat> {
442        self.make_request(create_basic_group_chat).await
443    }
444
445    // Creates a new call
446    pub async fn create_call<C: AsRef<CreateCall>>(&self, create_call: C) -> Result<CallId> {
447        self.make_request(create_call).await
448    }
449
450    // Creates new chat filter. Returns information about the created chat filter
451    pub async fn create_chat_filter<C: AsRef<CreateChatFilter>>(
452        &self,
453        create_chat_filter: C,
454    ) -> Result<ChatFilterInfo> {
455        self.make_request(create_chat_filter).await
456    }
457
458    // 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
459    pub async fn create_chat_invite_link<C: AsRef<CreateChatInviteLink>>(
460        &self,
461        create_chat_invite_link: C,
462    ) -> Result<ChatInviteLink> {
463        self.make_request(create_chat_invite_link).await
464    }
465
466    // Creates a new basic group and sends a corresponding messageBasicGroupChatCreate. Returns the newly created chat
467    pub async fn create_new_basic_group_chat<C: AsRef<CreateNewBasicGroupChat>>(
468        &self,
469        create_new_basic_group_chat: C,
470    ) -> Result<Chat> {
471        self.make_request(create_new_basic_group_chat).await
472    }
473
474    // Creates a new secret chat. Returns the newly created chat
475    pub async fn create_new_secret_chat<C: AsRef<CreateNewSecretChat>>(
476        &self,
477        create_new_secret_chat: C,
478    ) -> Result<Chat> {
479        self.make_request(create_new_secret_chat).await
480    }
481
482    // Creates a new sticker set. Returns the newly created sticker set
483    pub async fn create_new_sticker_set<C: AsRef<CreateNewStickerSet>>(
484        &self,
485        create_new_sticker_set: C,
486    ) -> Result<StickerSet> {
487        self.make_request(create_new_sticker_set).await
488    }
489
490    // Creates a new supergroup or channel and sends a corresponding messageSupergroupChatCreate. Returns the newly created chat
491    pub async fn create_new_supergroup_chat<C: AsRef<CreateNewSupergroupChat>>(
492        &self,
493        create_new_supergroup_chat: C,
494    ) -> Result<Chat> {
495        self.make_request(create_new_supergroup_chat).await
496    }
497
498    // Returns an existing chat corresponding to a given user
499    pub async fn create_private_chat<C: AsRef<CreatePrivateChat>>(
500        &self,
501        create_private_chat: C,
502    ) -> Result<Chat> {
503        self.make_request(create_private_chat).await
504    }
505
506    // Returns an existing chat corresponding to a known secret chat
507    pub async fn create_secret_chat<C: AsRef<CreateSecretChat>>(
508        &self,
509        create_secret_chat: C,
510    ) -> Result<Chat> {
511        self.make_request(create_secret_chat).await
512    }
513
514    // Returns an existing chat corresponding to a known supergroup or channel
515    pub async fn create_supergroup_chat<C: AsRef<CreateSupergroupChat>>(
516        &self,
517        create_supergroup_chat: C,
518    ) -> Result<Chat> {
519        self.make_request(create_supergroup_chat).await
520    }
521
522    // Creates a new temporary password for processing payments
523    pub async fn create_temporary_password<C: AsRef<CreateTemporaryPassword>>(
524        &self,
525        create_temporary_password: C,
526    ) -> Result<TemporaryPasswordState> {
527        self.make_request(create_temporary_password).await
528    }
529
530    // 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
531    pub async fn create_video_chat<C: AsRef<CreateVideoChat>>(
532        &self,
533        create_video_chat: C,
534    ) -> Result<GroupCallId> {
535        self.make_request(create_video_chat).await
536    }
537
538    // 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. Can be called before authorization when the current authorization state is authorizationStateWaitPassword
539    pub async fn delete_account<C: AsRef<DeleteAccount>>(&self, delete_account: C) -> Result<Ok> {
540        self.make_request(delete_account).await
541    }
542
543    // Deletes all call messages
544    pub async fn delete_all_call_messages<C: AsRef<DeleteAllCallMessages>>(
545        &self,
546        delete_all_call_messages: C,
547    ) -> Result<Ok> {
548        self.make_request(delete_all_call_messages).await
549    }
550
551    // 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
552    pub async fn delete_all_revoked_chat_invite_links<C: AsRef<DeleteAllRevokedChatInviteLinks>>(
553        &self,
554        delete_all_revoked_chat_invite_links: C,
555    ) -> Result<Ok> {
556        self.make_request(delete_all_revoked_chat_invite_links)
557            .await
558    }
559
560    // Deletes a chat along with all messages in the corresponding chat for all chat members; requires owner privileges. For group chats this will release the username and remove all members. Chats with more than 1000 members can't be deleted using this method
561    pub async fn delete_chat<C: AsRef<DeleteChat>>(&self, delete_chat: C) -> Result<Ok> {
562        self.make_request(delete_chat).await
563    }
564
565    // Deletes existing chat filter
566    pub async fn delete_chat_filter<C: AsRef<DeleteChatFilter>>(
567        &self,
568        delete_chat_filter: C,
569    ) -> Result<Ok> {
570        self.make_request(delete_chat_filter).await
571    }
572
573    // 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
574    pub async fn delete_chat_history<C: AsRef<DeleteChatHistory>>(
575        &self,
576        delete_chat_history: C,
577    ) -> Result<Ok> {
578        self.make_request(delete_chat_history).await
579    }
580
581    // 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
582    pub async fn delete_chat_messages_by_date<C: AsRef<DeleteChatMessagesByDate>>(
583        &self,
584        delete_chat_messages_by_date: C,
585    ) -> Result<Ok> {
586        self.make_request(delete_chat_messages_by_date).await
587    }
588
589    // Deletes all messages sent by the specified message sender in a chat. Supported only for supergroups; requires can_delete_messages administrator privileges
590    pub async fn delete_chat_messages_by_sender<C: AsRef<DeleteChatMessagesBySender>>(
591        &self,
592        delete_chat_messages_by_sender: C,
593    ) -> Result<Ok> {
594        self.make_request(delete_chat_messages_by_sender).await
595    }
596
597    // Deletes the default reply markup from a chat. Must be called after a one-time keyboard or a ForceReply reply markup has been used. UpdateChatReplyMarkup will be sent if the reply markup is changed
598    pub async fn delete_chat_reply_markup<C: AsRef<DeleteChatReplyMarkup>>(
599        &self,
600        delete_chat_reply_markup: C,
601    ) -> Result<Ok> {
602        self.make_request(delete_chat_reply_markup).await
603    }
604
605    // Deletes commands supported by the bot for the given user scope and language; for bots only
606    pub async fn delete_commands<C: AsRef<DeleteCommands>>(
607        &self,
608        delete_commands: C,
609    ) -> Result<Ok> {
610        self.make_request(delete_commands).await
611    }
612
613    // Deletes a file from the TDLib file cache
614    pub async fn delete_file<C: AsRef<DeleteFile>>(&self, delete_file: C) -> Result<Ok> {
615        self.make_request(delete_file).await
616    }
617
618    // 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. Can be called before authorization
619    pub async fn delete_language_pack<C: AsRef<DeleteLanguagePack>>(
620        &self,
621        delete_language_pack: C,
622    ) -> Result<Ok> {
623        self.make_request(delete_language_pack).await
624    }
625
626    // Deletes messages
627    pub async fn delete_messages<C: AsRef<DeleteMessages>>(
628        &self,
629        delete_messages: C,
630    ) -> Result<Ok> {
631        self.make_request(delete_messages).await
632    }
633
634    // Deletes a Telegram Passport element
635    pub async fn delete_passport_element<C: AsRef<DeletePassportElement>>(
636        &self,
637        delete_passport_element: C,
638    ) -> Result<Ok> {
639        self.make_request(delete_passport_element).await
640    }
641
642    // Deletes a profile photo
643    pub async fn delete_profile_photo<C: AsRef<DeleteProfilePhoto>>(
644        &self,
645        delete_profile_photo: C,
646    ) -> Result<Ok> {
647        self.make_request(delete_profile_photo).await
648    }
649
650    // 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
651    pub async fn delete_revoked_chat_invite_link<C: AsRef<DeleteRevokedChatInviteLink>>(
652        &self,
653        delete_revoked_chat_invite_link: C,
654    ) -> Result<Ok> {
655        self.make_request(delete_revoked_chat_invite_link).await
656    }
657
658    // Deletes saved credentials for all payment provider bots
659    pub async fn delete_saved_credentials<C: AsRef<DeleteSavedCredentials>>(
660        &self,
661        delete_saved_credentials: C,
662    ) -> Result<Ok> {
663        self.make_request(delete_saved_credentials).await
664    }
665
666    // Deletes saved order info
667    pub async fn delete_saved_order_info<C: AsRef<DeleteSavedOrderInfo>>(
668        &self,
669        delete_saved_order_info: C,
670    ) -> Result<Ok> {
671        self.make_request(delete_saved_order_info).await
672    }
673
674    // 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. After the destruction completes updateAuthorizationState with authorizationStateClosed will be sent. Can be called before authorization
675    pub async fn destroy<C: AsRef<Destroy>>(&self, destroy: C) -> Result<Ok> {
676        self.make_request(destroy).await
677    }
678
679    // Disables the currently enabled proxy. Can be called before authorization
680    pub async fn disable_proxy<C: AsRef<DisableProxy>>(&self, disable_proxy: C) -> Result<Ok> {
681        self.make_request(disable_proxy).await
682    }
683
684    // Discards a call
685    pub async fn discard_call<C: AsRef<DiscardCall>>(&self, discard_call: C) -> Result<Ok> {
686        self.make_request(discard_call).await
687    }
688
689    // Disconnects all websites from the current user's Telegram account
690    pub async fn disconnect_all_websites<C: AsRef<DisconnectAllWebsites>>(
691        &self,
692        disconnect_all_websites: C,
693    ) -> Result<Ok> {
694        self.make_request(disconnect_all_websites).await
695    }
696
697    // Disconnects website from the current user's Telegram account
698    pub async fn disconnect_website<C: AsRef<DisconnectWebsite>>(
699        &self,
700        disconnect_website: C,
701    ) -> Result<Ok> {
702        self.make_request(disconnect_website).await
703    }
704
705    // Downloads a file from the cloud. Download progress and completion of the download will be notified through updateFile updates
706    pub async fn download_file<C: AsRef<DownloadFile>>(&self, download_file: C) -> Result<File> {
707        self.make_request(download_file).await
708    }
709
710    // Edits existing chat filter. Returns information about the edited chat filter
711    pub async fn edit_chat_filter<C: AsRef<EditChatFilter>>(
712        &self,
713        edit_chat_filter: C,
714    ) -> Result<ChatFilterInfo> {
715        self.make_request(edit_chat_filter).await
716    }
717
718    // 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
719    pub async fn edit_chat_invite_link<C: AsRef<EditChatInviteLink>>(
720        &self,
721        edit_chat_invite_link: C,
722    ) -> Result<ChatInviteLink> {
723        self.make_request(edit_chat_invite_link).await
724    }
725
726    // Edits information about a custom local language pack in the current localization target. Can be called before authorization
727    pub async fn edit_custom_language_pack_info<C: AsRef<EditCustomLanguagePackInfo>>(
728        &self,
729        edit_custom_language_pack_info: C,
730    ) -> Result<Ok> {
731        self.make_request(edit_custom_language_pack_info).await
732    }
733
734    // Edits the caption of an inline message sent via a bot; for bots only
735    pub async fn edit_inline_message_caption<C: AsRef<EditInlineMessageCaption>>(
736        &self,
737        edit_inline_message_caption: C,
738    ) -> Result<Ok> {
739        self.make_request(edit_inline_message_caption).await
740    }
741
742    // Edits the content of a live location in an inline message sent via a bot; for bots only
743    pub async fn edit_inline_message_live_location<C: AsRef<EditInlineMessageLiveLocation>>(
744        &self,
745        edit_inline_message_live_location: C,
746    ) -> Result<Ok> {
747        self.make_request(edit_inline_message_live_location).await
748    }
749
750    // 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
751    pub async fn edit_inline_message_media<C: AsRef<EditInlineMessageMedia>>(
752        &self,
753        edit_inline_message_media: C,
754    ) -> Result<Ok> {
755        self.make_request(edit_inline_message_media).await
756    }
757
758    // Edits the reply markup of an inline message sent via a bot; for bots only
759    pub async fn edit_inline_message_reply_markup<C: AsRef<EditInlineMessageReplyMarkup>>(
760        &self,
761        edit_inline_message_reply_markup: C,
762    ) -> Result<Ok> {
763        self.make_request(edit_inline_message_reply_markup).await
764    }
765
766    // Edits the text of an inline text or game message sent via a bot; for bots only
767    pub async fn edit_inline_message_text<C: AsRef<EditInlineMessageText>>(
768        &self,
769        edit_inline_message_text: C,
770    ) -> Result<Ok> {
771        self.make_request(edit_inline_message_text).await
772    }
773
774    // Edits the message content caption. Returns the edited message after the edit is completed on the server side
775    pub async fn edit_message_caption<C: AsRef<EditMessageCaption>>(
776        &self,
777        edit_message_caption: C,
778    ) -> Result<Message> {
779        self.make_request(edit_message_caption).await
780    }
781
782    // 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
783    pub async fn edit_message_live_location<C: AsRef<EditMessageLiveLocation>>(
784        &self,
785        edit_message_live_location: C,
786    ) -> Result<Message> {
787        self.make_request(edit_message_live_location).await
788    }
789
790    // 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. 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
791    pub async fn edit_message_media<C: AsRef<EditMessageMedia>>(
792        &self,
793        edit_message_media: C,
794    ) -> Result<Message> {
795        self.make_request(edit_message_media).await
796    }
797
798    // Edits the message reply markup; for bots only. Returns the edited message after the edit is completed on the server side
799    pub async fn edit_message_reply_markup<C: AsRef<EditMessageReplyMarkup>>(
800        &self,
801        edit_message_reply_markup: C,
802    ) -> Result<Message> {
803        self.make_request(edit_message_reply_markup).await
804    }
805
806    // 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
807    pub async fn edit_message_scheduling_state<C: AsRef<EditMessageSchedulingState>>(
808        &self,
809        edit_message_scheduling_state: C,
810    ) -> Result<Ok> {
811        self.make_request(edit_message_scheduling_state).await
812    }
813
814    // 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
815    pub async fn edit_message_text<C: AsRef<EditMessageText>>(
816        &self,
817        edit_message_text: C,
818    ) -> Result<Message> {
819        self.make_request(edit_message_text).await
820    }
821
822    // Edits an existing proxy server for network requests. Can be called before authorization
823    pub async fn edit_proxy<C: AsRef<EditProxy>>(&self, edit_proxy: C) -> Result<Proxy> {
824        self.make_request(edit_proxy).await
825    }
826
827    // Enables a proxy. Only one proxy can be enabled at a time. Can be called before authorization
828    pub async fn enable_proxy<C: AsRef<EnableProxy>>(&self, enable_proxy: C) -> Result<Ok> {
829        self.make_request(enable_proxy).await
830    }
831
832    // Ends a group call. Requires groupCall.can_be_managed
833    pub async fn end_group_call<C: AsRef<EndGroupCall>>(&self, end_group_call: C) -> Result<Ok> {
834        self.make_request(end_group_call).await
835    }
836
837    // Ends recording of an active group call. Requires groupCall.can_be_managed group call flag
838    pub async fn end_group_call_recording<C: AsRef<EndGroupCallRecording>>(
839        &self,
840        end_group_call_recording: C,
841    ) -> Result<Ok> {
842        self.make_request(end_group_call_recording).await
843    }
844
845    // Ends screen sharing in a joined group call
846    pub async fn end_group_call_screen_sharing<C: AsRef<EndGroupCallScreenSharing>>(
847        &self,
848        end_group_call_screen_sharing: C,
849    ) -> Result<Ok> {
850        self.make_request(end_group_call_screen_sharing).await
851    }
852
853    // Finishes the file generation
854    pub async fn finish_file_generation<C: AsRef<FinishFileGeneration>>(
855        &self,
856        finish_file_generation: C,
857    ) -> Result<Ok> {
858        self.make_request(finish_file_generation).await
859    }
860
861    // 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
862    pub async fn forward_messages<C: AsRef<ForwardMessages>>(
863        &self,
864        forward_messages: C,
865    ) -> Result<Messages> {
866        self.make_request(forward_messages).await
867    }
868
869    // Returns the period of inactivity after which the account of the current user will automatically be deleted
870    pub async fn get_account_ttl<C: AsRef<GetAccountTtl>>(
871        &self,
872        get_account_ttl: C,
873    ) -> Result<AccountTtl> {
874        self.make_request(get_account_ttl).await
875    }
876
877    // 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
878    pub async fn get_active_live_location_messages<C: AsRef<GetActiveLiveLocationMessages>>(
879        &self,
880        get_active_live_location_messages: C,
881    ) -> Result<Messages> {
882        self.make_request(get_active_live_location_messages).await
883    }
884
885    // Returns all active sessions of the current user
886    pub async fn get_active_sessions<C: AsRef<GetActiveSessions>>(
887        &self,
888        get_active_sessions: C,
889    ) -> Result<Sessions> {
890        self.make_request(get_active_sessions).await
891    }
892
893    // Returns all available Telegram Passport elements
894    pub async fn get_all_passport_elements<C: AsRef<GetAllPassportElements>>(
895        &self,
896        get_all_passport_elements: C,
897    ) -> Result<PassportElements> {
898        self.make_request(get_all_passport_elements).await
899    }
900
901    // Returns an animated emoji corresponding to a given emoji. Returns a 404 error if the emoji has no animated emoji
902    pub async fn get_animated_emoji<C: AsRef<GetAnimatedEmoji>>(
903        &self,
904        get_animated_emoji: C,
905    ) -> Result<AnimatedEmoji> {
906        self.make_request(get_animated_emoji).await
907    }
908
909    // Returns application config, provided by the server. Can be called before authorization
910    pub async fn get_application_config<C: AsRef<GetApplicationConfig>>(
911        &self,
912        get_application_config: C,
913    ) -> Result<JsonValue> {
914        self.make_request(get_application_config).await
915    }
916
917    // Returns the link for downloading official Telegram application to be used when the current user invites friends to Telegram
918    pub async fn get_application_download_link<C: AsRef<GetApplicationDownloadLink>>(
919        &self,
920        get_application_download_link: C,
921    ) -> Result<HttpUrl> {
922        self.make_request(get_application_download_link).await
923    }
924
925    // Returns a list of archived sticker sets
926    pub async fn get_archived_sticker_sets<C: AsRef<GetArchivedStickerSets>>(
927        &self,
928        get_archived_sticker_sets: C,
929    ) -> Result<StickerSets> {
930        self.make_request(get_archived_sticker_sets).await
931    }
932
933    // Returns a list of sticker sets attached to a file. Currently, only photos and videos can have attached sticker sets
934    pub async fn get_attached_sticker_sets<C: AsRef<GetAttachedStickerSets>>(
935        &self,
936        get_attached_sticker_sets: C,
937    ) -> Result<StickerSets> {
938        self.make_request(get_attached_sticker_sets).await
939    }
940
941    // 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
942    pub async fn get_authorization_state<C: AsRef<GetAuthorizationState>>(
943        &self,
944        get_authorization_state: C,
945    ) -> Result<AuthorizationState> {
946        self.make_request(get_authorization_state).await
947    }
948
949    // Returns auto-download settings presets for the current user
950    pub async fn get_auto_download_settings_presets<C: AsRef<GetAutoDownloadSettingsPresets>>(
951        &self,
952        get_auto_download_settings_presets: C,
953    ) -> Result<AutoDownloadSettingsPresets> {
954        self.make_request(get_auto_download_settings_presets).await
955    }
956
957    // Constructs a persistent HTTP URL for a background
958    pub async fn get_background_url<C: AsRef<GetBackgroundUrl>>(
959        &self,
960        get_background_url: C,
961    ) -> Result<HttpUrl> {
962        self.make_request(get_background_url).await
963    }
964
965    // Returns backgrounds installed by the user
966    pub async fn get_backgrounds<C: AsRef<GetBackgrounds>>(
967        &self,
968        get_backgrounds: C,
969    ) -> Result<Backgrounds> {
970        self.make_request(get_backgrounds).await
971    }
972
973    // Returns information about a bank card
974    pub async fn get_bank_card_info<C: AsRef<GetBankCardInfo>>(
975        &self,
976        get_bank_card_info: C,
977    ) -> Result<BankCardInfo> {
978        self.make_request(get_bank_card_info).await
979    }
980
981    // Returns information about a basic group by its identifier. This is an offline request if the current user is not a bot
982    pub async fn get_basic_group<C: AsRef<GetBasicGroup>>(
983        &self,
984        get_basic_group: C,
985    ) -> Result<BasicGroup> {
986        self.make_request(get_basic_group).await
987    }
988
989    // Returns full information about a basic group by its identifier
990    pub async fn get_basic_group_full_info<C: AsRef<GetBasicGroupFullInfo>>(
991        &self,
992        get_basic_group_full_info: C,
993    ) -> Result<BasicGroupFullInfo> {
994        self.make_request(get_basic_group_full_info).await
995    }
996
997    // Returns users and chats that were blocked by the current user
998    pub async fn get_blocked_message_senders<C: AsRef<GetBlockedMessageSenders>>(
999        &self,
1000        get_blocked_message_senders: C,
1001    ) -> Result<MessageSenders> {
1002        self.make_request(get_blocked_message_senders).await
1003    }
1004
1005    // 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
1006    pub async fn get_callback_query_answer<C: AsRef<GetCallbackQueryAnswer>>(
1007        &self,
1008        get_callback_query_answer: C,
1009    ) -> Result<CallbackQueryAnswer> {
1010        self.make_request(get_callback_query_answer).await
1011    }
1012
1013    // Returns information about a message with the callback button that originated a callback query; for bots only
1014    pub async fn get_callback_query_message<C: AsRef<GetCallbackQueryMessage>>(
1015        &self,
1016        get_callback_query_message: C,
1017    ) -> Result<Message> {
1018        self.make_request(get_callback_query_message).await
1019    }
1020
1021    // Returns information about a chat by its identifier, this is an offline request if the current user is not a bot
1022    pub async fn get_chat<C: AsRef<GetChat>>(&self, get_chat: C) -> Result<Chat> {
1023        self.make_request(get_chat).await
1024    }
1025
1026    // Returns a list of administrators of the chat with their custom titles
1027    pub async fn get_chat_administrators<C: AsRef<GetChatAdministrators>>(
1028        &self,
1029        get_chat_administrators: C,
1030    ) -> Result<ChatAdministrators> {
1031        self.make_request(get_chat_administrators).await
1032    }
1033
1034    // Returns list of message sender identifiers, which can be used to send messages in a chat
1035    pub async fn get_chat_available_message_senders<C: AsRef<GetChatAvailableMessageSenders>>(
1036        &self,
1037        get_chat_available_message_senders: C,
1038    ) -> Result<MessageSenders> {
1039        self.make_request(get_chat_available_message_senders).await
1040    }
1041
1042    // 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)
1043    pub async fn get_chat_event_log<C: AsRef<GetChatEventLog>>(
1044        &self,
1045        get_chat_event_log: C,
1046    ) -> Result<ChatEvents> {
1047        self.make_request(get_chat_event_log).await
1048    }
1049
1050    // Returns information about a chat filter by its identifier
1051    pub async fn get_chat_filter<C: AsRef<GetChatFilter>>(
1052        &self,
1053        get_chat_filter: C,
1054    ) -> Result<ChatFilter> {
1055        self.make_request(get_chat_filter).await
1056    }
1057
1058    // Returns default icon name for a filter. Can be called synchronously
1059    pub async fn get_chat_filter_default_icon_name<C: AsRef<GetChatFilterDefaultIconName>>(
1060        &self,
1061        get_chat_filter_default_icon_name: C,
1062    ) -> Result<Text> {
1063        self.make_request(get_chat_filter_default_icon_name).await
1064    }
1065
1066    // Returns messages in a chat. 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. This is an offline request if only_local is true
1067    pub async fn get_chat_history<C: AsRef<GetChatHistory>>(
1068        &self,
1069        get_chat_history: C,
1070    ) -> Result<Messages> {
1071        self.make_request(get_chat_history).await
1072    }
1073
1074    // 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
1075    pub async fn get_chat_invite_link<C: AsRef<GetChatInviteLink>>(
1076        &self,
1077        get_chat_invite_link: C,
1078    ) -> Result<ChatInviteLink> {
1079        self.make_request(get_chat_invite_link).await
1080    }
1081
1082    // Returns list of chat administrators with number of their invite links. Requires owner privileges in the chat
1083    pub async fn get_chat_invite_link_counts<C: AsRef<GetChatInviteLinkCounts>>(
1084        &self,
1085        get_chat_invite_link_counts: C,
1086    ) -> Result<ChatInviteLinkCounts> {
1087        self.make_request(get_chat_invite_link_counts).await
1088    }
1089
1090    // 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
1091    pub async fn get_chat_invite_link_members<C: AsRef<GetChatInviteLinkMembers>>(
1092        &self,
1093        get_chat_invite_link_members: C,
1094    ) -> Result<ChatInviteLinkMembers> {
1095        self.make_request(get_chat_invite_link_members).await
1096    }
1097
1098    // 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
1099    pub async fn get_chat_invite_links<C: AsRef<GetChatInviteLinks>>(
1100        &self,
1101        get_chat_invite_links: C,
1102    ) -> Result<ChatInviteLinks> {
1103        self.make_request(get_chat_invite_links).await
1104    }
1105
1106    // Returns pending join requests in a chat
1107    pub async fn get_chat_join_requests<C: AsRef<GetChatJoinRequests>>(
1108        &self,
1109        get_chat_join_requests: C,
1110    ) -> Result<ChatJoinRequests> {
1111        self.make_request(get_chat_join_requests).await
1112    }
1113
1114    // Returns chat lists to which the chat can be added. This is an offline request
1115    pub async fn get_chat_lists_to_add_chat<C: AsRef<GetChatListsToAddChat>>(
1116        &self,
1117        get_chat_lists_to_add_chat: C,
1118    ) -> Result<ChatLists> {
1119        self.make_request(get_chat_lists_to_add_chat).await
1120    }
1121
1122    // Returns information about a single member of a chat
1123    pub async fn get_chat_member<C: AsRef<GetChatMember>>(
1124        &self,
1125        get_chat_member: C,
1126    ) -> Result<ChatMember> {
1127        self.make_request(get_chat_member).await
1128    }
1129
1130    // Returns the last message sent in a chat no later than the specified date
1131    pub async fn get_chat_message_by_date<C: AsRef<GetChatMessageByDate>>(
1132        &self,
1133        get_chat_message_by_date: C,
1134    ) -> Result<Message> {
1135        self.make_request(get_chat_message_by_date).await
1136    }
1137
1138    // 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"
1139    pub async fn get_chat_message_calendar<C: AsRef<GetChatMessageCalendar>>(
1140        &self,
1141        get_chat_message_calendar: C,
1142    ) -> Result<MessageCalendar> {
1143        self.make_request(get_chat_message_calendar).await
1144    }
1145
1146    // Returns approximate number of messages of the specified type in the chat
1147    pub async fn get_chat_message_count<C: AsRef<GetChatMessageCount>>(
1148        &self,
1149        get_chat_message_count: C,
1150    ) -> Result<Count> {
1151        self.make_request(get_chat_message_count).await
1152    }
1153
1154    // Returns list of chats with non-default notification settings
1155    pub async fn get_chat_notification_settings_exceptions<
1156        C: AsRef<GetChatNotificationSettingsExceptions>,
1157    >(
1158        &self,
1159        get_chat_notification_settings_exceptions: C,
1160    ) -> Result<Chats> {
1161        self.make_request(get_chat_notification_settings_exceptions)
1162            .await
1163    }
1164
1165    // Returns information about a newest pinned message in the chat
1166    pub async fn get_chat_pinned_message<C: AsRef<GetChatPinnedMessage>>(
1167        &self,
1168        get_chat_pinned_message: C,
1169    ) -> Result<Message> {
1170        self.make_request(get_chat_pinned_message).await
1171    }
1172
1173    // Returns all scheduled messages in a chat. The messages are returned in a reverse chronological order (i.e., in order of decreasing message_id)
1174    pub async fn get_chat_scheduled_messages<C: AsRef<GetChatScheduledMessages>>(
1175        &self,
1176        get_chat_scheduled_messages: C,
1177    ) -> Result<Messages> {
1178        self.make_request(get_chat_scheduled_messages).await
1179    }
1180
1181    // 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). Cannot be used in secret chats or with searchMessagesFilterFailedToSend filter without an enabled message database
1182    pub async fn get_chat_sparse_message_positions<C: AsRef<GetChatSparseMessagePositions>>(
1183        &self,
1184        get_chat_sparse_message_positions: C,
1185    ) -> Result<MessagePositions> {
1186        self.make_request(get_chat_sparse_message_positions).await
1187    }
1188
1189    // Returns sponsored message to be shown in a chat; for channel chats only. Returns a 404 error if there is no sponsored message in the chat
1190    pub async fn get_chat_sponsored_message<C: AsRef<GetChatSponsoredMessage>>(
1191        &self,
1192        get_chat_sponsored_message: C,
1193    ) -> Result<SponsoredMessage> {
1194        self.make_request(get_chat_sponsored_message).await
1195    }
1196
1197    // 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
1198    pub async fn get_chat_statistics<C: AsRef<GetChatStatistics>>(
1199        &self,
1200        get_chat_statistics: C,
1201    ) -> Result<ChatStatistics> {
1202        self.make_request(get_chat_statistics).await
1203    }
1204
1205    // 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
1206    pub async fn get_chats<C: AsRef<GetChats>>(&self, get_chats: C) -> Result<Chats> {
1207        self.make_request(get_chats).await
1208    }
1209
1210    // Returns the list of commands supported by the bot for the given user scope and language; for bots only
1211    pub async fn get_commands<C: AsRef<GetCommands>>(
1212        &self,
1213        get_commands: C,
1214    ) -> Result<BotCommands> {
1215        self.make_request(get_commands).await
1216    }
1217
1218    // Returns all website where the current user used Telegram to log in
1219    pub async fn get_connected_websites<C: AsRef<GetConnectedWebsites>>(
1220        &self,
1221        get_connected_websites: C,
1222    ) -> Result<ConnectedWebsites> {
1223        self.make_request(get_connected_websites).await
1224    }
1225
1226    // Returns all user contacts
1227    pub async fn get_contacts<C: AsRef<GetContacts>>(&self, get_contacts: C) -> Result<Users> {
1228        self.make_request(get_contacts).await
1229    }
1230
1231    // Returns information about existing countries. Can be called before authorization
1232    pub async fn get_countries<C: AsRef<GetCountries>>(
1233        &self,
1234        get_countries: C,
1235    ) -> Result<Countries> {
1236        self.make_request(get_countries).await
1237    }
1238
1239    // 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
1240    pub async fn get_country_code<C: AsRef<GetCountryCode>>(
1241        &self,
1242        get_country_code: C,
1243    ) -> Result<Text> {
1244        self.make_request(get_country_code).await
1245    }
1246
1247    // Returns a list of public chats of the specified type, owned by the user
1248    pub async fn get_created_public_chats<C: AsRef<GetCreatedPublicChats>>(
1249        &self,
1250        get_created_public_chats: C,
1251    ) -> Result<Chats> {
1252        self.make_request(get_created_public_chats).await
1253    }
1254
1255    // 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
1256    pub async fn get_current_state<C: AsRef<GetCurrentState>>(
1257        &self,
1258        get_current_state: C,
1259    ) -> Result<Updates> {
1260        self.make_request(get_current_state).await
1261    }
1262
1263    // Returns database statistics
1264    pub async fn get_database_statistics<C: AsRef<GetDatabaseStatistics>>(
1265        &self,
1266        get_database_statistics: C,
1267    ) -> Result<DatabaseStatistics> {
1268        self.make_request(get_database_statistics).await
1269    }
1270
1271    // 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
1272    pub async fn get_deep_link_info<C: AsRef<GetDeepLinkInfo>>(
1273        &self,
1274        get_deep_link_info: C,
1275    ) -> Result<DeepLinkInfo> {
1276        self.make_request(get_deep_link_info).await
1277    }
1278
1279    // 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
1280    pub async fn get_emoji_suggestions_url<C: AsRef<GetEmojiSuggestionsUrl>>(
1281        &self,
1282        get_emoji_suggestions_url: C,
1283    ) -> Result<HttpUrl> {
1284        self.make_request(get_emoji_suggestions_url).await
1285    }
1286
1287    // 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
1288    pub async fn get_external_link<C: AsRef<GetExternalLink>>(
1289        &self,
1290        get_external_link: C,
1291    ) -> Result<HttpUrl> {
1292        self.make_request(get_external_link).await
1293    }
1294
1295    // 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
1296    pub async fn get_external_link_info<C: AsRef<GetExternalLinkInfo>>(
1297        &self,
1298        get_external_link_info: C,
1299    ) -> Result<LoginUrlInfo> {
1300        self.make_request(get_external_link_info).await
1301    }
1302
1303    // Returns favorite stickers
1304    pub async fn get_favorite_stickers<C: AsRef<GetFavoriteStickers>>(
1305        &self,
1306        get_favorite_stickers: C,
1307    ) -> Result<Stickers> {
1308        self.make_request(get_favorite_stickers).await
1309    }
1310
1311    // Returns information about a file; this is an offline request
1312    pub async fn get_file<C: AsRef<GetFile>>(&self, get_file: C) -> Result<File> {
1313        self.make_request(get_file).await
1314    }
1315
1316    // Returns file downloaded prefix size from a given offset, in bytes
1317    pub async fn get_file_downloaded_prefix_size<C: AsRef<GetFileDownloadedPrefixSize>>(
1318        &self,
1319        get_file_downloaded_prefix_size: C,
1320    ) -> Result<Count> {
1321        self.make_request(get_file_downloaded_prefix_size).await
1322    }
1323
1324    // Returns the extension of a file, guessed by its MIME type. Returns an empty string on failure. Can be called synchronously
1325    pub async fn get_file_extension<C: AsRef<GetFileExtension>>(
1326        &self,
1327        get_file_extension: C,
1328    ) -> Result<Text> {
1329        self.make_request(get_file_extension).await
1330    }
1331
1332    // Returns the MIME type of a file, guessed by its extension. Returns an empty string on failure. Can be called synchronously
1333    pub async fn get_file_mime_type<C: AsRef<GetFileMimeType>>(
1334        &self,
1335        get_file_mime_type: C,
1336    ) -> Result<Text> {
1337        self.make_request(get_file_mime_type).await
1338    }
1339
1340    // 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
1341    pub async fn get_game_high_scores<C: AsRef<GetGameHighScores>>(
1342        &self,
1343        get_game_high_scores: C,
1344    ) -> Result<GameHighScores> {
1345        self.make_request(get_game_high_scores).await
1346    }
1347
1348    // Returns information about a group call
1349    pub async fn get_group_call<C: AsRef<GetGroupCall>>(
1350        &self,
1351        get_group_call: C,
1352    ) -> Result<GroupCall> {
1353        self.make_request(get_group_call).await
1354    }
1355
1356    // Returns invite link to a video chat in a public chat
1357    pub async fn get_group_call_invite_link<C: AsRef<GetGroupCallInviteLink>>(
1358        &self,
1359        get_group_call_invite_link: C,
1360    ) -> Result<HttpUrl> {
1361        self.make_request(get_group_call_invite_link).await
1362    }
1363
1364    // Returns a file with a segment of a group call stream in a modified OGG format for audio or MPEG-4 format for video
1365    pub async fn get_group_call_stream_segment<C: AsRef<GetGroupCallStreamSegment>>(
1366        &self,
1367        get_group_call_stream_segment: C,
1368    ) -> Result<FilePart> {
1369        self.make_request(get_group_call_stream_segment).await
1370    }
1371
1372    // Returns a list of common group chats with a given user. Chats are sorted by their type and creation date
1373    pub async fn get_groups_in_common<C: AsRef<GetGroupsInCommon>>(
1374        &self,
1375        get_groups_in_common: C,
1376    ) -> Result<Chats> {
1377        self.make_request(get_groups_in_common).await
1378    }
1379
1380    // Returns the total number of imported contacts
1381    pub async fn get_imported_contact_count<C: AsRef<GetImportedContactCount>>(
1382        &self,
1383        get_imported_contact_count: C,
1384    ) -> Result<Count> {
1385        self.make_request(get_imported_contact_count).await
1386    }
1387
1388    // 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
1389    pub async fn get_inactive_supergroup_chats<C: AsRef<GetInactiveSupergroupChats>>(
1390        &self,
1391        get_inactive_supergroup_chats: C,
1392    ) -> Result<Chats> {
1393        self.make_request(get_inactive_supergroup_chats).await
1394    }
1395
1396    // Returns game high scores and some part of the high score table in the range of the specified user; for bots only
1397    pub async fn get_inline_game_high_scores<C: AsRef<GetInlineGameHighScores>>(
1398        &self,
1399        get_inline_game_high_scores: C,
1400    ) -> Result<GameHighScores> {
1401        self.make_request(get_inline_game_high_scores).await
1402    }
1403
1404    // 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
1405    pub async fn get_inline_query_results<C: AsRef<GetInlineQueryResults>>(
1406        &self,
1407        get_inline_query_results: C,
1408    ) -> Result<InlineQueryResults> {
1409        self.make_request(get_inline_query_results).await
1410    }
1411
1412    // Returns a list of installed sticker sets
1413    pub async fn get_installed_sticker_sets<C: AsRef<GetInstalledStickerSets>>(
1414        &self,
1415        get_installed_sticker_sets: C,
1416    ) -> Result<StickerSets> {
1417        self.make_request(get_installed_sticker_sets).await
1418    }
1419
1420    // Returns information about the type of an internal link. Returns a 404 error if the link is not internal. Can be called before authorization
1421    pub async fn get_internal_link_type<C: AsRef<GetInternalLinkType>>(
1422        &self,
1423        get_internal_link_type: C,
1424    ) -> Result<InternalLinkType> {
1425        self.make_request(get_internal_link_type).await
1426    }
1427
1428    // Converts a JsonValue object to corresponding JSON-serialized string. Can be called synchronously
1429    pub async fn get_json_string<C: AsRef<GetJsonString>>(
1430        &self,
1431        get_json_string: C,
1432    ) -> Result<Text> {
1433        self.make_request(get_json_string).await
1434    }
1435
1436    // Converts a JSON-serialized string to corresponding JsonValue object. Can be called synchronously
1437    pub async fn get_json_value<C: AsRef<GetJsonValue>>(
1438        &self,
1439        get_json_value: C,
1440    ) -> Result<JsonValue> {
1441        self.make_request(get_json_value).await
1442    }
1443
1444    // Returns information about a language pack. Returned language pack identifier may be different from a provided one. Can be called before authorization
1445    pub async fn get_language_pack_info<C: AsRef<GetLanguagePackInfo>>(
1446        &self,
1447        get_language_pack_info: C,
1448    ) -> Result<LanguagePackInfo> {
1449        self.make_request(get_language_pack_info).await
1450    }
1451
1452    // 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
1453    pub async fn get_language_pack_string<C: AsRef<GetLanguagePackString>>(
1454        &self,
1455        get_language_pack_string: C,
1456    ) -> Result<LanguagePackStringValue> {
1457        self.make_request(get_language_pack_string).await
1458    }
1459
1460    // Returns strings from a language pack in the current localization target by their keys. Can be called before authorization
1461    pub async fn get_language_pack_strings<C: AsRef<GetLanguagePackStrings>>(
1462        &self,
1463        get_language_pack_strings: C,
1464    ) -> Result<LanguagePackStrings> {
1465        self.make_request(get_language_pack_strings).await
1466    }
1467
1468    // Returns information about the current localization target. This is an offline request if only_local is true. Can be called before authorization
1469    pub async fn get_localization_target_info<C: AsRef<GetLocalizationTargetInfo>>(
1470        &self,
1471        get_localization_target_info: C,
1472    ) -> Result<LocalizationTargetInfo> {
1473        self.make_request(get_localization_target_info).await
1474    }
1475
1476    // Returns information about currently used log stream for internal logging of TDLib. Can be called synchronously
1477    pub async fn get_log_stream<C: AsRef<GetLogStream>>(
1478        &self,
1479        get_log_stream: C,
1480    ) -> Result<LogStream> {
1481        self.make_request(get_log_stream).await
1482    }
1483
1484    // Returns current verbosity level for a specified TDLib internal log tag. Can be called synchronously
1485    pub async fn get_log_tag_verbosity_level<C: AsRef<GetLogTagVerbosityLevel>>(
1486        &self,
1487        get_log_tag_verbosity_level: C,
1488    ) -> Result<LogVerbosityLevel> {
1489        self.make_request(get_log_tag_verbosity_level).await
1490    }
1491
1492    // Returns list of available TDLib internal log tags, for example, ["actor", "binlog", "connections", "notifications", "proxy"]. Can be called synchronously
1493    pub async fn get_log_tags<C: AsRef<GetLogTags>>(&self, get_log_tags: C) -> Result<LogTags> {
1494        self.make_request(get_log_tags).await
1495    }
1496
1497    // Returns current verbosity level of the internal logging of TDLib. Can be called synchronously
1498    pub async fn get_log_verbosity_level<C: AsRef<GetLogVerbosityLevel>>(
1499        &self,
1500        get_log_verbosity_level: C,
1501    ) -> Result<LogVerbosityLevel> {
1502        self.make_request(get_log_verbosity_level).await
1503    }
1504
1505    // Returns an HTTP URL which can be used to automatically authorize the user on a website after clicking an inline button of type inlineKeyboardButtonTypeLoginUrl. 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
1506    pub async fn get_login_url<C: AsRef<GetLoginUrl>>(&self, get_login_url: C) -> Result<HttpUrl> {
1507        self.make_request(get_login_url).await
1508    }
1509
1510    // Returns information about a button of type inlineKeyboardButtonTypeLoginUrl. The method needs to be called when the user presses the button
1511    pub async fn get_login_url_info<C: AsRef<GetLoginUrlInfo>>(
1512        &self,
1513        get_login_url_info: C,
1514    ) -> Result<LoginUrlInfo> {
1515        self.make_request(get_login_url_info).await
1516    }
1517
1518    // Returns information about a file with a map thumbnail in PNG format. Only map thumbnail files with size less than 1MB can be downloaded
1519    pub async fn get_map_thumbnail_file<C: AsRef<GetMapThumbnailFile>>(
1520        &self,
1521        get_map_thumbnail_file: C,
1522    ) -> Result<File> {
1523        self.make_request(get_map_thumbnail_file).await
1524    }
1525
1526    // 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
1527    pub async fn get_markdown_text<C: AsRef<GetMarkdownText>>(
1528        &self,
1529        get_markdown_text: C,
1530    ) -> Result<FormattedText> {
1531        self.make_request(get_markdown_text).await
1532    }
1533
1534    // Returns the current user
1535    pub async fn get_me<C: AsRef<GetMe>>(&self, get_me: C) -> Result<User> {
1536        self.make_request(get_me).await
1537    }
1538
1539    // Returns information about a message
1540    pub async fn get_message<C: AsRef<GetMessage>>(&self, get_message: C) -> Result<Message> {
1541        self.make_request(get_message).await
1542    }
1543
1544    // Returns an HTML code for embedding the message. Available only for messages in supergroups and channels with a username
1545    pub async fn get_message_embedding_code<C: AsRef<GetMessageEmbeddingCode>>(
1546        &self,
1547        get_message_embedding_code: C,
1548    ) -> Result<Text> {
1549        self.make_request(get_message_embedding_code).await
1550    }
1551
1552    // Returns information about a file with messages exported from another app
1553    pub async fn get_message_file_type<C: AsRef<GetMessageFileType>>(
1554        &self,
1555        get_message_file_type: C,
1556    ) -> Result<MessageFileType> {
1557        self.make_request(get_message_file_type).await
1558    }
1559
1560    // Returns a confirmation text to be shown to the user before starting message import
1561    pub async fn get_message_import_confirmation_text<
1562        C: AsRef<GetMessageImportConfirmationText>,
1563    >(
1564        &self,
1565        get_message_import_confirmation_text: C,
1566    ) -> Result<Text> {
1567        self.make_request(get_message_import_confirmation_text)
1568            .await
1569    }
1570
1571    // 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
1572    pub async fn get_message_link<C: AsRef<GetMessageLink>>(
1573        &self,
1574        get_message_link: C,
1575    ) -> Result<MessageLink> {
1576        self.make_request(get_message_link).await
1577    }
1578
1579    // Returns information about a public or private message link. Can be called for any internal link of the type internalLinkTypeMessage
1580    pub async fn get_message_link_info<C: AsRef<GetMessageLinkInfo>>(
1581        &self,
1582        get_message_link_info: C,
1583    ) -> Result<MessageLinkInfo> {
1584        self.make_request(get_message_link_info).await
1585    }
1586
1587    // Returns information about a message, if it is available locally without sending network request. This is an offline request
1588    pub async fn get_message_locally<C: AsRef<GetMessageLocally>>(
1589        &self,
1590        get_message_locally: C,
1591    ) -> Result<Message> {
1592        self.make_request(get_message_locally).await
1593    }
1594
1595    // Returns forwarded copies of a channel message to different public channels. For optimal performance, the number of returned messages is chosen by TDLib
1596    pub async fn get_message_public_forwards<C: AsRef<GetMessagePublicForwards>>(
1597        &self,
1598        get_message_public_forwards: C,
1599    ) -> Result<FoundMessages> {
1600        self.make_request(get_message_public_forwards).await
1601    }
1602
1603    // Returns detailed statistics about a message. Can be used only if message.can_get_statistics == true
1604    pub async fn get_message_statistics<C: AsRef<GetMessageStatistics>>(
1605        &self,
1606        get_message_statistics: C,
1607    ) -> Result<MessageStatistics> {
1608        self.make_request(get_message_statistics).await
1609    }
1610
1611    // Returns information about a message thread. Can be used only if message.can_get_message_thread == true
1612    pub async fn get_message_thread<C: AsRef<GetMessageThread>>(
1613        &self,
1614        get_message_thread: C,
1615    ) -> Result<MessageThreadInfo> {
1616        self.make_request(get_message_thread).await
1617    }
1618
1619    // 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. 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
1620    pub async fn get_message_thread_history<C: AsRef<GetMessageThreadHistory>>(
1621        &self,
1622        get_message_thread_history: C,
1623    ) -> Result<Messages> {
1624        self.make_request(get_message_thread_history).await
1625    }
1626
1627    // 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
1628    pub async fn get_message_viewers<C: AsRef<GetMessageViewers>>(
1629        &self,
1630        get_message_viewers: C,
1631    ) -> Result<Users> {
1632        self.make_request(get_message_viewers).await
1633    }
1634
1635    // Returns information about messages. If a message is not found, returns null on the corresponding position of the result
1636    pub async fn get_messages<C: AsRef<GetMessages>>(&self, get_messages: C) -> Result<Messages> {
1637        self.make_request(get_messages).await
1638    }
1639
1640    // Returns network data usage statistics. Can be called before authorization
1641    pub async fn get_network_statistics<C: AsRef<GetNetworkStatistics>>(
1642        &self,
1643        get_network_statistics: C,
1644    ) -> Result<NetworkStatistics> {
1645        self.make_request(get_network_statistics).await
1646    }
1647
1648    // 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
1649    pub async fn get_option<C: AsRef<GetOption>>(&self, get_option: C) -> Result<OptionValue> {
1650        self.make_request(get_option).await
1651    }
1652
1653    // Returns a Telegram Passport authorization form for sharing data with a service
1654    pub async fn get_passport_authorization_form<C: AsRef<GetPassportAuthorizationForm>>(
1655        &self,
1656        get_passport_authorization_form: C,
1657    ) -> Result<PassportAuthorizationForm> {
1658        self.make_request(get_passport_authorization_form).await
1659    }
1660
1661    // Returns already available Telegram Passport elements suitable for completing a Telegram Passport authorization form. Result can be received only once for each authorization form
1662    pub async fn get_passport_authorization_form_available_elements<
1663        C: AsRef<GetPassportAuthorizationFormAvailableElements>,
1664    >(
1665        &self,
1666        get_passport_authorization_form_available_elements: C,
1667    ) -> Result<PassportElementsWithErrors> {
1668        self.make_request(get_passport_authorization_form_available_elements)
1669            .await
1670    }
1671
1672    // Returns one of the available Telegram Passport elements
1673    pub async fn get_passport_element<C: AsRef<GetPassportElement>>(
1674        &self,
1675        get_passport_element: C,
1676    ) -> Result<PassportElement> {
1677        self.make_request(get_passport_element).await
1678    }
1679
1680    // Returns the current state of 2-step verification
1681    pub async fn get_password_state<C: AsRef<GetPasswordState>>(
1682        &self,
1683        get_password_state: C,
1684    ) -> Result<PasswordState> {
1685        self.make_request(get_password_state).await
1686    }
1687
1688    // Returns an invoice payment form. This method must be called when the user presses inlineKeyboardButtonBuy
1689    pub async fn get_payment_form<C: AsRef<GetPaymentForm>>(
1690        &self,
1691        get_payment_form: C,
1692    ) -> Result<PaymentForm> {
1693        self.make_request(get_payment_form).await
1694    }
1695
1696    // Returns information about a successful payment
1697    pub async fn get_payment_receipt<C: AsRef<GetPaymentReceipt>>(
1698        &self,
1699        get_payment_receipt: C,
1700    ) -> Result<PaymentReceipt> {
1701        self.make_request(get_payment_receipt).await
1702    }
1703
1704    // Returns information about a phone number by its prefix. Can be called before authorization
1705    pub async fn get_phone_number_info<C: AsRef<GetPhoneNumberInfo>>(
1706        &self,
1707        get_phone_number_info: C,
1708    ) -> Result<PhoneNumberInfo> {
1709        self.make_request(get_phone_number_info).await
1710    }
1711
1712    // 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
1713    pub async fn get_phone_number_info_sync<C: AsRef<GetPhoneNumberInfoSync>>(
1714        &self,
1715        get_phone_number_info_sync: C,
1716    ) -> Result<PhoneNumberInfo> {
1717        self.make_request(get_phone_number_info_sync).await
1718    }
1719
1720    // Returns users voted for the specified option in a non-anonymous polls. For optimal performance, the number of returned users is chosen by TDLib
1721    pub async fn get_poll_voters<C: AsRef<GetPollVoters>>(
1722        &self,
1723        get_poll_voters: C,
1724    ) -> Result<Users> {
1725        self.make_request(get_poll_voters).await
1726    }
1727
1728    // 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
1729    pub async fn get_preferred_country_language<C: AsRef<GetPreferredCountryLanguage>>(
1730        &self,
1731        get_preferred_country_language: C,
1732    ) -> Result<Text> {
1733        self.make_request(get_preferred_country_language).await
1734    }
1735
1736    // Returns list of proxies that are currently set up. Can be called before authorization
1737    pub async fn get_proxies<C: AsRef<GetProxies>>(&self, get_proxies: C) -> Result<Proxies> {
1738        self.make_request(get_proxies).await
1739    }
1740
1741    // Returns an HTTPS link, which can be used to add a proxy. Available only for SOCKS5 and MTProto proxies. Can be called before authorization
1742    pub async fn get_proxy_link<C: AsRef<GetProxyLink>>(
1743        &self,
1744        get_proxy_link: C,
1745    ) -> Result<HttpUrl> {
1746        self.make_request(get_proxy_link).await
1747    }
1748
1749    // Returns a globally unique push notification subscription identifier for identification of an account, which has received a push notification. Can be called synchronously
1750    pub async fn get_push_receiver_id<C: AsRef<GetPushReceiverId>>(
1751        &self,
1752        get_push_receiver_id: C,
1753    ) -> Result<PushReceiverId> {
1754        self.make_request(get_push_receiver_id).await
1755    }
1756
1757    // Returns up to 20 recently used inline bots in the order of their last usage
1758    pub async fn get_recent_inline_bots<C: AsRef<GetRecentInlineBots>>(
1759        &self,
1760        get_recent_inline_bots: C,
1761    ) -> Result<Users> {
1762        self.make_request(get_recent_inline_bots).await
1763    }
1764
1765    // Returns a list of recently used stickers
1766    pub async fn get_recent_stickers<C: AsRef<GetRecentStickers>>(
1767        &self,
1768        get_recent_stickers: C,
1769    ) -> Result<Stickers> {
1770        self.make_request(get_recent_stickers).await
1771    }
1772
1773    // Returns recently opened chats, this is an offline request. Returns chats in the order of last opening
1774    pub async fn get_recently_opened_chats<C: AsRef<GetRecentlyOpenedChats>>(
1775        &self,
1776        get_recently_opened_chats: C,
1777    ) -> Result<Chats> {
1778        self.make_request(get_recently_opened_chats).await
1779    }
1780
1781    // Returns t.me URLs recently visited by a newly registered user
1782    pub async fn get_recently_visited_t_me_urls<C: AsRef<GetRecentlyVisitedTMeUrls>>(
1783        &self,
1784        get_recently_visited_t_me_urls: C,
1785    ) -> Result<TMeUrls> {
1786        self.make_request(get_recently_visited_t_me_urls).await
1787    }
1788
1789    // Returns recommended chat filters for the current user
1790    pub async fn get_recommended_chat_filters<C: AsRef<GetRecommendedChatFilters>>(
1791        &self,
1792        get_recommended_chat_filters: C,
1793    ) -> Result<RecommendedChatFilters> {
1794        self.make_request(get_recommended_chat_filters).await
1795    }
1796
1797    // 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
1798    pub async fn get_recovery_email_address<C: AsRef<GetRecoveryEmailAddress>>(
1799        &self,
1800        get_recovery_email_address: C,
1801    ) -> Result<RecoveryEmailAddress> {
1802        self.make_request(get_recovery_email_address).await
1803    }
1804
1805    // Returns information about a file by its remote ID; 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. 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
1806    pub async fn get_remote_file<C: AsRef<GetRemoteFile>>(
1807        &self,
1808        get_remote_file: C,
1809    ) -> Result<File> {
1810        self.make_request(get_remote_file).await
1811    }
1812
1813    // Returns information about a message that is replied by a given message. Also returns the pinned message, the game message, and the invoice message for messages of the types messagePinMessage, messageGameScore, and messagePaymentSuccessful respectively
1814    pub async fn get_replied_message<C: AsRef<GetRepliedMessage>>(
1815        &self,
1816        get_replied_message: C,
1817    ) -> Result<Message> {
1818        self.make_request(get_replied_message).await
1819    }
1820
1821    // Returns saved animations
1822    pub async fn get_saved_animations<C: AsRef<GetSavedAnimations>>(
1823        &self,
1824        get_saved_animations: C,
1825    ) -> Result<Animations> {
1826        self.make_request(get_saved_animations).await
1827    }
1828
1829    // Returns saved order info, if any
1830    pub async fn get_saved_order_info<C: AsRef<GetSavedOrderInfo>>(
1831        &self,
1832        get_saved_order_info: C,
1833    ) -> Result<OrderInfo> {
1834        self.make_request(get_saved_order_info).await
1835    }
1836
1837    // Returns the notification settings for chats of a given type
1838    pub async fn get_scope_notification_settings<C: AsRef<GetScopeNotificationSettings>>(
1839        &self,
1840        get_scope_notification_settings: C,
1841    ) -> Result<ScopeNotificationSettings> {
1842        self.make_request(get_scope_notification_settings).await
1843    }
1844
1845    // Returns information about a secret chat by its identifier. This is an offline request
1846    pub async fn get_secret_chat<C: AsRef<GetSecretChat>>(
1847        &self,
1848        get_secret_chat: C,
1849    ) -> Result<SecretChat> {
1850        self.make_request(get_secret_chat).await
1851    }
1852
1853    // Loads an asynchronous or a zoomed in statistical graph
1854    pub async fn get_statistical_graph<C: AsRef<GetStatisticalGraph>>(
1855        &self,
1856        get_statistical_graph: C,
1857    ) -> Result<StatisticalGraph> {
1858        self.make_request(get_statistical_graph).await
1859    }
1860
1861    // 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
1862    pub async fn get_sticker_emojis<C: AsRef<GetStickerEmojis>>(
1863        &self,
1864        get_sticker_emojis: C,
1865    ) -> Result<Emojis> {
1866        self.make_request(get_sticker_emojis).await
1867    }
1868
1869    // Returns information about a sticker set by its identifier
1870    pub async fn get_sticker_set<C: AsRef<GetStickerSet>>(
1871        &self,
1872        get_sticker_set: C,
1873    ) -> Result<StickerSet> {
1874        self.make_request(get_sticker_set).await
1875    }
1876
1877    // Returns stickers from the installed sticker sets that correspond to a given emoji. If the emoji is non-empty, favorite and recently used stickers may also be returned
1878    pub async fn get_stickers<C: AsRef<GetStickers>>(&self, get_stickers: C) -> Result<Stickers> {
1879        self.make_request(get_stickers).await
1880    }
1881
1882    // Returns storage usage statistics. Can be called before authorization
1883    pub async fn get_storage_statistics<C: AsRef<GetStorageStatistics>>(
1884        &self,
1885        get_storage_statistics: C,
1886    ) -> Result<StorageStatistics> {
1887        self.make_request(get_storage_statistics).await
1888    }
1889
1890    // Quickly returns approximate storage usage statistics. Can be called before authorization
1891    pub async fn get_storage_statistics_fast<C: AsRef<GetStorageStatisticsFast>>(
1892        &self,
1893        get_storage_statistics_fast: C,
1894    ) -> Result<StorageStatisticsFast> {
1895        self.make_request(get_storage_statistics_fast).await
1896    }
1897
1898    // Returns suggested name for saving a file in a given directory
1899    pub async fn get_suggested_file_name<C: AsRef<GetSuggestedFileName>>(
1900        &self,
1901        get_suggested_file_name: C,
1902    ) -> Result<Text> {
1903        self.make_request(get_suggested_file_name).await
1904    }
1905
1906    // Returns a suggested name for a new sticker set with a given title
1907    pub async fn get_suggested_sticker_set_name<C: AsRef<GetSuggestedStickerSetName>>(
1908        &self,
1909        get_suggested_sticker_set_name: C,
1910    ) -> Result<Text> {
1911        self.make_request(get_suggested_sticker_set_name).await
1912    }
1913
1914    // 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. To set a returned supergroup as a discussion group, access to its old messages must be enabled using toggleSupergroupIsAllHistoryAvailable first
1915    pub async fn get_suitable_discussion_chats<C: AsRef<GetSuitableDiscussionChats>>(
1916        &self,
1917        get_suitable_discussion_chats: C,
1918    ) -> Result<Chats> {
1919        self.make_request(get_suitable_discussion_chats).await
1920    }
1921
1922    // Returns information about a supergroup or a channel by its identifier. This is an offline request if the current user is not a bot
1923    pub async fn get_supergroup<C: AsRef<GetSupergroup>>(
1924        &self,
1925        get_supergroup: C,
1926    ) -> Result<Supergroup> {
1927        self.make_request(get_supergroup).await
1928    }
1929
1930    // Returns full information about a supergroup or a channel by its identifier, cached for up to 1 minute
1931    pub async fn get_supergroup_full_info<C: AsRef<GetSupergroupFullInfo>>(
1932        &self,
1933        get_supergroup_full_info: C,
1934    ) -> Result<SupergroupFullInfo> {
1935        self.make_request(get_supergroup_full_info).await
1936    }
1937
1938    // 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
1939    pub async fn get_supergroup_members<C: AsRef<GetSupergroupMembers>>(
1940        &self,
1941        get_supergroup_members: C,
1942    ) -> Result<ChatMembers> {
1943        self.make_request(get_supergroup_members).await
1944    }
1945
1946    // Returns a user that can be contacted to get support
1947    pub async fn get_support_user<C: AsRef<GetSupportUser>>(
1948        &self,
1949        get_support_user: C,
1950    ) -> Result<User> {
1951        self.make_request(get_support_user).await
1952    }
1953
1954    // Returns information about the current temporary password
1955    pub async fn get_temporary_password_state<C: AsRef<GetTemporaryPasswordState>>(
1956        &self,
1957        get_temporary_password_state: C,
1958    ) -> Result<TemporaryPasswordState> {
1959        self.make_request(get_temporary_password_state).await
1960    }
1961
1962    // Returns all entities (mentions, hashtags, cashtags, bot commands, bank card numbers, URLs, and email addresses) contained in the text. Can be called synchronously
1963    pub async fn get_text_entities<C: AsRef<GetTextEntities>>(
1964        &self,
1965        get_text_entities: C,
1966    ) -> Result<TextEntities> {
1967        self.make_request(get_text_entities).await
1968    }
1969
1970    // Returns a list of frequently used chats. Supported only if the chat info database is enabled
1971    pub async fn get_top_chats<C: AsRef<GetTopChats>>(&self, get_top_chats: C) -> Result<Chats> {
1972        self.make_request(get_top_chats).await
1973    }
1974
1975    // Returns a list of trending sticker sets. For optimal performance, the number of returned sticker sets is chosen by TDLib
1976    pub async fn get_trending_sticker_sets<C: AsRef<GetTrendingStickerSets>>(
1977        &self,
1978        get_trending_sticker_sets: C,
1979    ) -> Result<StickerSets> {
1980        self.make_request(get_trending_sticker_sets).await
1981    }
1982
1983    // Returns information about a user by their identifier. This is an offline request if the current user is not a bot
1984    pub async fn get_user<C: AsRef<GetUser>>(&self, get_user: C) -> Result<User> {
1985        self.make_request(get_user).await
1986    }
1987
1988    // Returns full information about a user by their identifier
1989    pub async fn get_user_full_info<C: AsRef<GetUserFullInfo>>(
1990        &self,
1991        get_user_full_info: C,
1992    ) -> Result<UserFullInfo> {
1993        self.make_request(get_user_full_info).await
1994    }
1995
1996    // Returns the current privacy settings
1997    pub async fn get_user_privacy_setting_rules<C: AsRef<GetUserPrivacySettingRules>>(
1998        &self,
1999        get_user_privacy_setting_rules: C,
2000    ) -> Result<UserPrivacySettingRules> {
2001        self.make_request(get_user_privacy_setting_rules).await
2002    }
2003
2004    // Returns the profile photos of a user. The result of this query may be outdated: some photos might have been deleted already
2005    pub async fn get_user_profile_photos<C: AsRef<GetUserProfilePhotos>>(
2006        &self,
2007        get_user_profile_photos: C,
2008    ) -> Result<ChatPhotos> {
2009        self.make_request(get_user_profile_photos).await
2010    }
2011
2012    // Returns list of participant identifiers, on whose behalf a video chat in the chat can be joined
2013    pub async fn get_video_chat_available_participants<
2014        C: AsRef<GetVideoChatAvailableParticipants>,
2015    >(
2016        &self,
2017        get_video_chat_available_participants: C,
2018    ) -> Result<MessageSenders> {
2019        self.make_request(get_video_chat_available_participants)
2020            .await
2021    }
2022
2023    // Returns an instant view version of a web page if available. Returns a 404 error if the web page has no instant view page
2024    pub async fn get_web_page_instant_view<C: AsRef<GetWebPageInstantView>>(
2025        &self,
2026        get_web_page_instant_view: C,
2027    ) -> Result<WebPageInstantView> {
2028        self.make_request(get_web_page_instant_view).await
2029    }
2030
2031    // 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
2032    pub async fn get_web_page_preview<C: AsRef<GetWebPagePreview>>(
2033        &self,
2034        get_web_page_preview: C,
2035    ) -> Result<WebPage> {
2036        self.make_request(get_web_page_preview).await
2037    }
2038
2039    // Hides a suggested action
2040    pub async fn hide_suggested_action<C: AsRef<HideSuggestedAction>>(
2041        &self,
2042        hide_suggested_action: C,
2043    ) -> Result<Ok> {
2044        self.make_request(hide_suggested_action).await
2045    }
2046
2047    // Adds new contacts or edits existing contacts by their phone numbers; contacts' user identifiers are ignored
2048    pub async fn import_contacts<C: AsRef<ImportContacts>>(
2049        &self,
2050        import_contacts: C,
2051    ) -> Result<ImportedContacts> {
2052        self.make_request(import_contacts).await
2053    }
2054
2055    // Imports messages exported from another app
2056    pub async fn import_messages<C: AsRef<ImportMessages>>(
2057        &self,
2058        import_messages: C,
2059    ) -> Result<Ok> {
2060        self.make_request(import_messages).await
2061    }
2062
2063    // Invites users to an active group call. Sends a service message of type messageInviteToGroupCall for video chats
2064    pub async fn invite_group_call_participants<C: AsRef<InviteGroupCallParticipants>>(
2065        &self,
2066        invite_group_call_participants: C,
2067    ) -> Result<Ok> {
2068        self.make_request(invite_group_call_participants).await
2069    }
2070
2071    // Adds the current user as a new member to a chat. Private and secret chats can't be joined using this method
2072    pub async fn join_chat<C: AsRef<JoinChat>>(&self, join_chat: C) -> Result<Ok> {
2073        self.make_request(join_chat).await
2074    }
2075
2076    // Uses an invite link to add the current user to the chat if possible
2077    pub async fn join_chat_by_invite_link<C: AsRef<JoinChatByInviteLink>>(
2078        &self,
2079        join_chat_by_invite_link: C,
2080    ) -> Result<Chat> {
2081        self.make_request(join_chat_by_invite_link).await
2082    }
2083
2084    // Joins an active group call. Returns join response payload for tgcalls
2085    pub async fn join_group_call<C: AsRef<JoinGroupCall>>(
2086        &self,
2087        join_group_call: C,
2088    ) -> Result<Text> {
2089        self.make_request(join_group_call).await
2090    }
2091
2092    // Removes the current user from chat members. Private and secret chats can't be left using this method
2093    pub async fn leave_chat<C: AsRef<LeaveChat>>(&self, leave_chat: C) -> Result<Ok> {
2094        self.make_request(leave_chat).await
2095    }
2096
2097    // Leaves a group call
2098    pub async fn leave_group_call<C: AsRef<LeaveGroupCall>>(
2099        &self,
2100        leave_group_call: C,
2101    ) -> Result<Ok> {
2102        self.make_request(leave_group_call).await
2103    }
2104
2105    // 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
2106    pub async fn load_chats<C: AsRef<LoadChats>>(&self, load_chats: C) -> Result<Ok> {
2107        self.make_request(load_chats).await
2108    }
2109
2110    // 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
2111    pub async fn load_group_call_participants<C: AsRef<LoadGroupCallParticipants>>(
2112        &self,
2113        load_group_call_participants: C,
2114    ) -> Result<Ok> {
2115        self.make_request(load_group_call_participants).await
2116    }
2117
2118    // 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
2119    pub async fn log_out<C: AsRef<LogOut>>(&self, log_out: C) -> Result<Ok> {
2120        self.make_request(log_out).await
2121    }
2122
2123    // 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)
2124    pub async fn open_chat<C: AsRef<OpenChat>>(&self, open_chat: C) -> Result<Ok> {
2125        self.make_request(open_chat).await
2126    }
2127
2128    // 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). An updateMessageContentOpened update will be generated if something has changed
2129    pub async fn open_message_content<C: AsRef<OpenMessageContent>>(
2130        &self,
2131        open_message_content: C,
2132    ) -> Result<Ok> {
2133        self.make_request(open_message_content).await
2134    }
2135
2136    // Optimizes storage usage, i.e. deletes some files and returns new storage usage statistics. Secret thumbnails can't be deleted
2137    pub async fn optimize_storage<C: AsRef<OptimizeStorage>>(
2138        &self,
2139        optimize_storage: C,
2140    ) -> Result<StorageStatistics> {
2141        self.make_request(optimize_storage).await
2142    }
2143
2144    // Parses Markdown entities in a human-friendly format, ignoring markup errors. Can be called synchronously
2145    pub async fn parse_markdown<C: AsRef<ParseMarkdown>>(
2146        &self,
2147        parse_markdown: C,
2148    ) -> Result<FormattedText> {
2149        self.make_request(parse_markdown).await
2150    }
2151
2152    // Parses Bold, Italic, Underline, Strikethrough, Code, Pre, PreCode, TextUrl and MentionName entities contained in the text. Can be called synchronously
2153    pub async fn parse_text_entities<C: AsRef<ParseTextEntities>>(
2154        &self,
2155        parse_text_entities: C,
2156    ) -> Result<FormattedText> {
2157        self.make_request(parse_text_entities).await
2158    }
2159
2160    // Pins a message in a chat; requires can_pin_messages rights or can_edit_messages rights in the channel
2161    pub async fn pin_chat_message<C: AsRef<PinChatMessage>>(
2162        &self,
2163        pin_chat_message: C,
2164    ) -> Result<Ok> {
2165        self.make_request(pin_chat_message).await
2166    }
2167
2168    // Computes time needed to receive a response from a Telegram server through a proxy. Can be called before authorization
2169    pub async fn ping_proxy<C: AsRef<PingProxy>>(&self, ping_proxy: C) -> Result<Seconds> {
2170        self.make_request(ping_proxy).await
2171    }
2172
2173    // Handles a pending join request in a chat
2174    pub async fn process_chat_join_request<C: AsRef<ProcessChatJoinRequest>>(
2175        &self,
2176        process_chat_join_request: C,
2177    ) -> Result<Ok> {
2178        self.make_request(process_chat_join_request).await
2179    }
2180
2181    // Handles all pending join requests for a given link in a chat
2182    pub async fn process_chat_join_requests<C: AsRef<ProcessChatJoinRequests>>(
2183        &self,
2184        process_chat_join_requests: C,
2185    ) -> Result<Ok> {
2186        self.make_request(process_chat_join_requests).await
2187    }
2188
2189    // 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
2190    pub async fn process_push_notification<C: AsRef<ProcessPushNotification>>(
2191        &self,
2192        process_push_notification: C,
2193    ) -> Result<Ok> {
2194        self.make_request(process_push_notification).await
2195    }
2196
2197    // Marks all mentions in a chat as read
2198    pub async fn read_all_chat_mentions<C: AsRef<ReadAllChatMentions>>(
2199        &self,
2200        read_all_chat_mentions: C,
2201    ) -> Result<Ok> {
2202        self.make_request(read_all_chat_mentions).await
2203    }
2204
2205    // 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
2206    pub async fn read_file_part<C: AsRef<ReadFilePart>>(
2207        &self,
2208        read_file_part: C,
2209    ) -> Result<FilePart> {
2210        self.make_request(read_file_part).await
2211    }
2212
2213    // Recovers the 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
2214    pub async fn recover_authentication_password<C: AsRef<RecoverAuthenticationPassword>>(
2215        &self,
2216        recover_authentication_password: C,
2217    ) -> Result<Ok> {
2218        self.make_request(recover_authentication_password).await
2219    }
2220
2221    // Recovers the 2-step verification password using a recovery code sent to an email address that was previously set up
2222    pub async fn recover_password<C: AsRef<RecoverPassword>>(
2223        &self,
2224        recover_password: C,
2225    ) -> Result<PasswordState> {
2226        self.make_request(recover_password).await
2227    }
2228
2229    // Registers the currently used device for receiving push notifications. Returns a globally unique identifier of the push notification subscription
2230    pub async fn register_device<C: AsRef<RegisterDevice>>(
2231        &self,
2232        register_device: C,
2233    ) -> Result<PushReceiverId> {
2234        self.make_request(register_device).await
2235    }
2236
2237    // Finishes user registration. Works only when the current authorization state is authorizationStateWaitRegistration
2238    pub async fn register_user<C: AsRef<RegisterUser>>(&self, register_user: C) -> Result<Ok> {
2239        self.make_request(register_user).await
2240    }
2241
2242    // Removes background from the list of installed backgrounds
2243    pub async fn remove_background<C: AsRef<RemoveBackground>>(
2244        &self,
2245        remove_background: C,
2246    ) -> Result<Ok> {
2247        self.make_request(remove_background).await
2248    }
2249
2250    // Removes a chat action bar without any other action
2251    pub async fn remove_chat_action_bar<C: AsRef<RemoveChatActionBar>>(
2252        &self,
2253        remove_chat_action_bar: C,
2254    ) -> Result<Ok> {
2255        self.make_request(remove_chat_action_bar).await
2256    }
2257
2258    // Removes users from the contact list
2259    pub async fn remove_contacts<C: AsRef<RemoveContacts>>(
2260        &self,
2261        remove_contacts: C,
2262    ) -> Result<Ok> {
2263        self.make_request(remove_contacts).await
2264    }
2265
2266    // Removes a sticker from the list of favorite stickers
2267    pub async fn remove_favorite_sticker<C: AsRef<RemoveFavoriteSticker>>(
2268        &self,
2269        remove_favorite_sticker: C,
2270    ) -> Result<Ok> {
2271        self.make_request(remove_favorite_sticker).await
2272    }
2273
2274    // Removes an active notification from notification list. Needs to be called only if the notification is removed by the current user
2275    pub async fn remove_notification<C: AsRef<RemoveNotification>>(
2276        &self,
2277        remove_notification: C,
2278    ) -> Result<Ok> {
2279        self.make_request(remove_notification).await
2280    }
2281
2282    // Removes a group of active notifications. Needs to be called only if the notification group is removed by the current user
2283    pub async fn remove_notification_group<C: AsRef<RemoveNotificationGroup>>(
2284        &self,
2285        remove_notification_group: C,
2286    ) -> Result<Ok> {
2287        self.make_request(remove_notification_group).await
2288    }
2289
2290    // Removes a proxy server. Can be called before authorization
2291    pub async fn remove_proxy<C: AsRef<RemoveProxy>>(&self, remove_proxy: C) -> Result<Ok> {
2292        self.make_request(remove_proxy).await
2293    }
2294
2295    // Removes a hashtag from the list of recently used hashtags
2296    pub async fn remove_recent_hashtag<C: AsRef<RemoveRecentHashtag>>(
2297        &self,
2298        remove_recent_hashtag: C,
2299    ) -> Result<Ok> {
2300        self.make_request(remove_recent_hashtag).await
2301    }
2302
2303    // Removes a sticker from the list of recently used stickers
2304    pub async fn remove_recent_sticker<C: AsRef<RemoveRecentSticker>>(
2305        &self,
2306        remove_recent_sticker: C,
2307    ) -> Result<Ok> {
2308        self.make_request(remove_recent_sticker).await
2309    }
2310
2311    // Removes a chat from the list of recently found chats
2312    pub async fn remove_recently_found_chat<C: AsRef<RemoveRecentlyFoundChat>>(
2313        &self,
2314        remove_recently_found_chat: C,
2315    ) -> Result<Ok> {
2316        self.make_request(remove_recently_found_chat).await
2317    }
2318
2319    // Removes an animation from the list of saved animations
2320    pub async fn remove_saved_animation<C: AsRef<RemoveSavedAnimation>>(
2321        &self,
2322        remove_saved_animation: C,
2323    ) -> Result<Ok> {
2324        self.make_request(remove_saved_animation).await
2325    }
2326
2327    // Removes a sticker from the set to which it belongs; for bots only. The sticker set must have been created by the bot
2328    pub async fn remove_sticker_from_set<C: AsRef<RemoveStickerFromSet>>(
2329        &self,
2330        remove_sticker_from_set: C,
2331    ) -> Result<Ok> {
2332        self.make_request(remove_sticker_from_set).await
2333    }
2334
2335    // Removes a chat from the list of frequently used chats. Supported only if the chat info database is enabled
2336    pub async fn remove_top_chat<C: AsRef<RemoveTopChat>>(&self, remove_top_chat: C) -> Result<Ok> {
2337        self.make_request(remove_top_chat).await
2338    }
2339
2340    // Changes the order of chat filters
2341    pub async fn reorder_chat_filters<C: AsRef<ReorderChatFilters>>(
2342        &self,
2343        reorder_chat_filters: C,
2344    ) -> Result<Ok> {
2345        self.make_request(reorder_chat_filters).await
2346    }
2347
2348    // Changes the order of installed sticker sets
2349    pub async fn reorder_installed_sticker_sets<C: AsRef<ReorderInstalledStickerSets>>(
2350        &self,
2351        reorder_installed_sticker_sets: C,
2352    ) -> Result<Ok> {
2353        self.make_request(reorder_installed_sticker_sets).await
2354    }
2355
2356    // 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
2357    pub async fn replace_primary_chat_invite_link<C: AsRef<ReplacePrimaryChatInviteLink>>(
2358        &self,
2359        replace_primary_chat_invite_link: C,
2360    ) -> Result<ChatInviteLink> {
2361        self.make_request(replace_primary_chat_invite_link).await
2362    }
2363
2364    // Reports a chat to the Telegram moderators. A chat can be reported only from the chat action bar, or if chat.can_be_reported
2365    pub async fn report_chat<C: AsRef<ReportChat>>(&self, report_chat: C) -> Result<Ok> {
2366        self.make_request(report_chat).await
2367    }
2368
2369    // Reports a chat photo to the Telegram moderators. A chat photo can be reported only if chat.can_be_reported
2370    pub async fn report_chat_photo<C: AsRef<ReportChatPhoto>>(
2371        &self,
2372        report_chat_photo: C,
2373    ) -> Result<Ok> {
2374        self.make_request(report_chat_photo).await
2375    }
2376
2377    // Reports messages in a supergroup as spam; requires administrator rights in the supergroup
2378    pub async fn report_supergroup_spam<C: AsRef<ReportSupergroupSpam>>(
2379        &self,
2380        report_supergroup_spam: C,
2381    ) -> Result<Ok> {
2382        self.make_request(report_supergroup_spam).await
2383    }
2384
2385    // Requests to send a password recovery code to an email address that was previously set up. Works only when the current authorization state is authorizationStateWaitPassword
2386    pub async fn request_authentication_password_recovery<
2387        C: AsRef<RequestAuthenticationPasswordRecovery>,
2388    >(
2389        &self,
2390        request_authentication_password_recovery: C,
2391    ) -> Result<Ok> {
2392        self.make_request(request_authentication_password_recovery)
2393            .await
2394    }
2395
2396    // Requests to send a 2-step verification password recovery code to an email address that was previously set up
2397    pub async fn request_password_recovery<C: AsRef<RequestPasswordRecovery>>(
2398        &self,
2399        request_password_recovery: C,
2400    ) -> Result<EmailAddressAuthenticationCodeInfo> {
2401        self.make_request(request_password_recovery).await
2402    }
2403
2404    // Requests QR code authentication by scanning a QR code on another logged in device. Works only when the current authorization state is authorizationStateWaitPhoneNumber, or if there is no pending authentication query and the current authorization state is authorizationStateWaitCode, authorizationStateWaitRegistration, or authorizationStateWaitPassword
2405    pub async fn request_qr_code_authentication<C: AsRef<RequestQrCodeAuthentication>>(
2406        &self,
2407        request_qr_code_authentication: C,
2408    ) -> Result<Ok> {
2409        self.make_request(request_qr_code_authentication).await
2410    }
2411
2412    // Re-sends 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
2413    pub async fn resend_authentication_code<C: AsRef<ResendAuthenticationCode>>(
2414        &self,
2415        resend_authentication_code: C,
2416    ) -> Result<Ok> {
2417        self.make_request(resend_authentication_code).await
2418    }
2419
2420    // Re-sends 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
2421    pub async fn resend_change_phone_number_code<C: AsRef<ResendChangePhoneNumberCode>>(
2422        &self,
2423        resend_change_phone_number_code: C,
2424    ) -> Result<AuthenticationCodeInfo> {
2425        self.make_request(resend_change_phone_number_code).await
2426    }
2427
2428    // Re-sends the code to verify an email address to be added to a user's Telegram Passport
2429    pub async fn resend_email_address_verification_code<
2430        C: AsRef<ResendEmailAddressVerificationCode>,
2431    >(
2432        &self,
2433        resend_email_address_verification_code: C,
2434    ) -> Result<EmailAddressAuthenticationCodeInfo> {
2435        self.make_request(resend_email_address_verification_code)
2436            .await
2437    }
2438
2439    // 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. 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
2440    pub async fn resend_messages<C: AsRef<ResendMessages>>(
2441        &self,
2442        resend_messages: C,
2443    ) -> Result<Messages> {
2444        self.make_request(resend_messages).await
2445    }
2446
2447    // Resends phone number confirmation code
2448    pub async fn resend_phone_number_confirmation_code<
2449        C: AsRef<ResendPhoneNumberConfirmationCode>,
2450    >(
2451        &self,
2452        resend_phone_number_confirmation_code: C,
2453    ) -> Result<AuthenticationCodeInfo> {
2454        self.make_request(resend_phone_number_confirmation_code)
2455            .await
2456    }
2457
2458    // Re-sends the code to verify a phone number to be added to a user's Telegram Passport
2459    pub async fn resend_phone_number_verification_code<
2460        C: AsRef<ResendPhoneNumberVerificationCode>,
2461    >(
2462        &self,
2463        resend_phone_number_verification_code: C,
2464    ) -> Result<AuthenticationCodeInfo> {
2465        self.make_request(resend_phone_number_verification_code)
2466            .await
2467    }
2468
2469    // Resends the 2-step verification recovery email address verification code
2470    pub async fn resend_recovery_email_address_code<C: AsRef<ResendRecoveryEmailAddressCode>>(
2471        &self,
2472        resend_recovery_email_address_code: C,
2473    ) -> Result<PasswordState> {
2474        self.make_request(resend_recovery_email_address_code).await
2475    }
2476
2477    // Resets all notification settings to their default values. By default, all chats are unmuted, the sound is set to "default" and message previews are shown
2478    pub async fn reset_all_notification_settings<C: AsRef<ResetAllNotificationSettings>>(
2479        &self,
2480        reset_all_notification_settings: C,
2481    ) -> Result<Ok> {
2482        self.make_request(reset_all_notification_settings).await
2483    }
2484
2485    // Resets list of installed backgrounds to its default value
2486    pub async fn reset_backgrounds<C: AsRef<ResetBackgrounds>>(
2487        &self,
2488        reset_backgrounds: C,
2489    ) -> Result<Ok> {
2490        self.make_request(reset_backgrounds).await
2491    }
2492
2493    // Resets all network data usage statistics to zero. Can be called before authorization
2494    pub async fn reset_network_statistics<C: AsRef<ResetNetworkStatistics>>(
2495        &self,
2496        reset_network_statistics: C,
2497    ) -> Result<Ok> {
2498        self.make_request(reset_network_statistics).await
2499    }
2500
2501    // 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
2502    pub async fn reset_password<C: AsRef<ResetPassword>>(
2503        &self,
2504        reset_password: C,
2505    ) -> Result<ResetPasswordResult> {
2506        self.make_request(reset_password).await
2507    }
2508
2509    // 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. If a primary link is revoked, then additionally to the revoked link returns new primary link
2510    pub async fn revoke_chat_invite_link<C: AsRef<RevokeChatInviteLink>>(
2511        &self,
2512        revoke_chat_invite_link: C,
2513    ) -> Result<ChatInviteLinks> {
2514        self.make_request(revoke_chat_invite_link).await
2515    }
2516
2517    // Revokes invite link for a group call. Requires groupCall.can_be_managed group call flag
2518    pub async fn revoke_group_call_invite_link<C: AsRef<RevokeGroupCallInviteLink>>(
2519        &self,
2520        revoke_group_call_invite_link: C,
2521    ) -> Result<Ok> {
2522        self.make_request(revoke_group_call_invite_link).await
2523    }
2524
2525    // Saves application log event on the server. Can be called before authorization
2526    pub async fn save_application_log_event<C: AsRef<SaveApplicationLogEvent>>(
2527        &self,
2528        save_application_log_event: C,
2529    ) -> Result<Ok> {
2530        self.make_request(save_application_log_event).await
2531    }
2532
2533    // Searches for a background by its name
2534    pub async fn search_background<C: AsRef<SearchBackground>>(
2535        &self,
2536        search_background: C,
2537    ) -> Result<Background> {
2538        self.make_request(search_background).await
2539    }
2540
2541    // 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
2542    pub async fn search_call_messages<C: AsRef<SearchCallMessages>>(
2543        &self,
2544        search_call_messages: C,
2545    ) -> Result<Messages> {
2546        self.make_request(search_call_messages).await
2547    }
2548
2549    // Searches for a specified query in the first name, last name and username of the members of a specified chat. Requires administrator rights in channels
2550    pub async fn search_chat_members<C: AsRef<SearchChatMembers>>(
2551        &self,
2552        search_chat_members: C,
2553    ) -> Result<ChatMembers> {
2554        self.make_request(search_chat_members).await
2555    }
2556
2557    // 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 (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
2558    pub async fn search_chat_messages<C: AsRef<SearchChatMessages>>(
2559        &self,
2560        search_chat_messages: C,
2561    ) -> Result<Messages> {
2562        self.make_request(search_chat_messages).await
2563    }
2564
2565    // Returns information about the recent locations of chat members that were sent to the chat. Returns up to 1 location message per user
2566    pub async fn search_chat_recent_location_messages<
2567        C: AsRef<SearchChatRecentLocationMessages>,
2568    >(
2569        &self,
2570        search_chat_recent_location_messages: C,
2571    ) -> Result<Messages> {
2572        self.make_request(search_chat_recent_location_messages)
2573            .await
2574    }
2575
2576    // 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
2577    pub async fn search_chats<C: AsRef<SearchChats>>(&self, search_chats: C) -> Result<Chats> {
2578        self.make_request(search_chats).await
2579    }
2580
2581    // 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. The request must be sent again every 25 seconds with adjusted location to not miss new chats
2582    pub async fn search_chats_nearby<C: AsRef<SearchChatsNearby>>(
2583        &self,
2584        search_chats_nearby: C,
2585    ) -> Result<ChatsNearby> {
2586        self.make_request(search_chats_nearby).await
2587    }
2588
2589    // 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
2590    pub async fn search_chats_on_server<C: AsRef<SearchChatsOnServer>>(
2591        &self,
2592        search_chats_on_server: C,
2593    ) -> Result<Chats> {
2594        self.make_request(search_chats_on_server).await
2595    }
2596
2597    // Searches for the specified query in the first names, last names and usernames of the known user contacts
2598    pub async fn search_contacts<C: AsRef<SearchContacts>>(
2599        &self,
2600        search_contacts: C,
2601    ) -> Result<Users> {
2602        self.make_request(search_contacts).await
2603    }
2604
2605    // Searches for emojis by keywords. Supported only if the file database is enabled
2606    pub async fn search_emojis<C: AsRef<SearchEmojis>>(&self, search_emojis: C) -> Result<Emojis> {
2607        self.make_request(search_emojis).await
2608    }
2609
2610    // Searches for recently used hashtags by their prefix
2611    pub async fn search_hashtags<C: AsRef<SearchHashtags>>(
2612        &self,
2613        search_hashtags: C,
2614    ) -> Result<Hashtags> {
2615        self.make_request(search_hashtags).await
2616    }
2617
2618    // Searches for installed sticker sets by looking for specified query in their title and name
2619    pub async fn search_installed_sticker_sets<C: AsRef<SearchInstalledStickerSets>>(
2620        &self,
2621        search_installed_sticker_sets: C,
2622    ) -> Result<StickerSets> {
2623        self.make_request(search_installed_sticker_sets).await
2624    }
2625
2626    // 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)). For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit
2627    pub async fn search_messages<C: AsRef<SearchMessages>>(
2628        &self,
2629        search_messages: C,
2630    ) -> Result<Messages> {
2631        self.make_request(search_messages).await
2632    }
2633
2634    // 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
2635    pub async fn search_public_chat<C: AsRef<SearchPublicChat>>(
2636        &self,
2637        search_public_chat: C,
2638    ) -> Result<Chat> {
2639        self.make_request(search_public_chat).await
2640    }
2641
2642    // 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. Excludes private chats with contacts and chats from the chat list from the results
2643    pub async fn search_public_chats<C: AsRef<SearchPublicChats>>(
2644        &self,
2645        search_public_chats: C,
2646    ) -> Result<Chats> {
2647        self.make_request(search_public_chats).await
2648    }
2649
2650    // 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
2651    pub async fn search_secret_messages<C: AsRef<SearchSecretMessages>>(
2652        &self,
2653        search_secret_messages: C,
2654    ) -> Result<FoundMessages> {
2655        self.make_request(search_secret_messages).await
2656    }
2657
2658    // Searches for a sticker set by its name
2659    pub async fn search_sticker_set<C: AsRef<SearchStickerSet>>(
2660        &self,
2661        search_sticker_set: C,
2662    ) -> Result<StickerSet> {
2663        self.make_request(search_sticker_set).await
2664    }
2665
2666    // Searches for ordinary sticker sets by looking for specified query in their title and name. Excludes installed sticker sets from the results
2667    pub async fn search_sticker_sets<C: AsRef<SearchStickerSets>>(
2668        &self,
2669        search_sticker_sets: C,
2670    ) -> Result<StickerSets> {
2671        self.make_request(search_sticker_sets).await
2672    }
2673
2674    // Searches for stickers from public sticker sets that correspond to a given emoji
2675    pub async fn search_stickers<C: AsRef<SearchStickers>>(
2676        &self,
2677        search_stickers: C,
2678    ) -> Result<Stickers> {
2679        self.make_request(search_stickers).await
2680    }
2681
2682    // 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
2683    pub async fn send_bot_start_message<C: AsRef<SendBotStartMessage>>(
2684        &self,
2685        send_bot_start_message: C,
2686    ) -> Result<Message> {
2687        self.make_request(send_bot_start_message).await
2688    }
2689
2690    // Sends debug information for a call
2691    pub async fn send_call_debug_information<C: AsRef<SendCallDebugInformation>>(
2692        &self,
2693        send_call_debug_information: C,
2694    ) -> Result<Ok> {
2695        self.make_request(send_call_debug_information).await
2696    }
2697
2698    // Sends a call rating
2699    pub async fn send_call_rating<C: AsRef<SendCallRating>>(
2700        &self,
2701        send_call_rating: C,
2702    ) -> Result<Ok> {
2703        self.make_request(send_call_rating).await
2704    }
2705
2706    // Sends call signaling data
2707    pub async fn send_call_signaling_data<C: AsRef<SendCallSignalingData>>(
2708        &self,
2709        send_call_signaling_data: C,
2710    ) -> Result<Ok> {
2711        self.make_request(send_call_signaling_data).await
2712    }
2713
2714    // Sends a notification about user activity in a chat
2715    pub async fn send_chat_action<C: AsRef<SendChatAction>>(
2716        &self,
2717        send_chat_action: C,
2718    ) -> Result<Ok> {
2719        self.make_request(send_chat_action).await
2720    }
2721
2722    // Sends a notification about a screenshot taken in a chat. Supported only in private and secret chats
2723    pub async fn send_chat_screenshot_taken_notification<
2724        C: AsRef<SendChatScreenshotTakenNotification>,
2725    >(
2726        &self,
2727        send_chat_screenshot_taken_notification: C,
2728    ) -> Result<Ok> {
2729        self.make_request(send_chat_screenshot_taken_notification)
2730            .await
2731    }
2732
2733    // Sends a custom request; for bots only
2734    pub async fn send_custom_request<C: AsRef<SendCustomRequest>>(
2735        &self,
2736        send_custom_request: C,
2737    ) -> Result<CustomRequestResult> {
2738        self.make_request(send_custom_request).await
2739    }
2740
2741    // Sends a code to verify an email address to be added to a user's Telegram Passport
2742    pub async fn send_email_address_verification_code<
2743        C: AsRef<SendEmailAddressVerificationCode>,
2744    >(
2745        &self,
2746        send_email_address_verification_code: C,
2747    ) -> Result<EmailAddressAuthenticationCodeInfo> {
2748        self.make_request(send_email_address_verification_code)
2749            .await
2750    }
2751
2752    // Sends the result of an inline query as a message. Returns the sent message. Always clears a chat draft message
2753    pub async fn send_inline_query_result_message<C: AsRef<SendInlineQueryResultMessage>>(
2754        &self,
2755        send_inline_query_result_message: C,
2756    ) -> Result<Message> {
2757        self.make_request(send_inline_query_result_message).await
2758    }
2759
2760    // Sends a message. Returns the sent message
2761    pub async fn send_message<C: AsRef<SendMessage>>(&self, send_message: C) -> Result<Message> {
2762        self.make_request(send_message).await
2763    }
2764
2765    // 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
2766    pub async fn send_message_album<C: AsRef<SendMessageAlbum>>(
2767        &self,
2768        send_message_album: C,
2769    ) -> Result<Messages> {
2770        self.make_request(send_message_album).await
2771    }
2772
2773    // 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
2774    pub async fn send_passport_authorization_form<C: AsRef<SendPassportAuthorizationForm>>(
2775        &self,
2776        send_passport_authorization_form: C,
2777    ) -> Result<Ok> {
2778        self.make_request(send_passport_authorization_form).await
2779    }
2780
2781    // Sends a filled-out payment form to the bot for final verification
2782    pub async fn send_payment_form<C: AsRef<SendPaymentForm>>(
2783        &self,
2784        send_payment_form: C,
2785    ) -> Result<PaymentResult> {
2786        self.make_request(send_payment_form).await
2787    }
2788
2789    // Sends phone number confirmation code to handle links of the type internalLinkTypePhoneNumberConfirmation
2790    pub async fn send_phone_number_confirmation_code<C: AsRef<SendPhoneNumberConfirmationCode>>(
2791        &self,
2792        send_phone_number_confirmation_code: C,
2793    ) -> Result<AuthenticationCodeInfo> {
2794        self.make_request(send_phone_number_confirmation_code).await
2795    }
2796
2797    // Sends a code to verify a phone number to be added to a user's Telegram Passport
2798    pub async fn send_phone_number_verification_code<C: AsRef<SendPhoneNumberVerificationCode>>(
2799        &self,
2800        send_phone_number_verification_code: C,
2801    ) -> Result<AuthenticationCodeInfo> {
2802        self.make_request(send_phone_number_verification_code).await
2803    }
2804
2805    // Changes the period of inactivity after which the account of the current user will automatically be deleted
2806    pub async fn set_account_ttl<C: AsRef<SetAccountTtl>>(&self, set_account_ttl: C) -> Result<Ok> {
2807        self.make_request(set_account_ttl).await
2808    }
2809
2810    // Succeeds after a specified amount of time has passed. Can be called before initialization
2811    pub async fn set_alarm<C: AsRef<SetAlarm>>(&self, set_alarm: C) -> Result<Ok> {
2812        self.make_request(set_alarm).await
2813    }
2814
2815    // Sets the phone number of the user and sends an authentication code to the user. Works only when the current authorization state is authorizationStateWaitPhoneNumber, or if there is no pending authentication query and the current authorization state is authorizationStateWaitCode, authorizationStateWaitRegistration, or authorizationStateWaitPassword
2816    pub async fn set_authentication_phone_number<C: AsRef<SetAuthenticationPhoneNumber>>(
2817        &self,
2818        set_authentication_phone_number: C,
2819    ) -> Result<Ok> {
2820        self.make_request(set_authentication_phone_number).await
2821    }
2822
2823    // Sets auto-download settings
2824    pub async fn set_auto_download_settings<C: AsRef<SetAutoDownloadSettings>>(
2825        &self,
2826        set_auto_download_settings: C,
2827    ) -> Result<Ok> {
2828        self.make_request(set_auto_download_settings).await
2829    }
2830
2831    // Changes the background selected by the user; adds background to the list of installed backgrounds
2832    pub async fn set_background<C: AsRef<SetBackground>>(
2833        &self,
2834        set_background: C,
2835    ) -> Result<Background> {
2836        self.make_request(set_background).await
2837    }
2838
2839    // Changes the bio of the current user
2840    pub async fn set_bio<C: AsRef<SetBio>>(&self, set_bio: C) -> Result<Ok> {
2841        self.make_request(set_bio).await
2842    }
2843
2844    // Informs the server about the number of pending bot updates if they haven't been processed for a long time; for bots only
2845    pub async fn set_bot_updates_status<C: AsRef<SetBotUpdatesStatus>>(
2846        &self,
2847        set_bot_updates_status: C,
2848    ) -> Result<Ok> {
2849        self.make_request(set_bot_updates_status).await
2850    }
2851
2852    // Changes application-specific data associated with a chat
2853    pub async fn set_chat_client_data<C: AsRef<SetChatClientData>>(
2854        &self,
2855        set_chat_client_data: C,
2856    ) -> Result<Ok> {
2857        self.make_request(set_chat_client_data).await
2858    }
2859
2860    // Changes information about a chat. Available for basic groups, supergroups, and channels. Requires can_change_info administrator right
2861    pub async fn set_chat_description<C: AsRef<SetChatDescription>>(
2862        &self,
2863        set_chat_description: C,
2864    ) -> Result<Ok> {
2865        self.make_request(set_chat_description).await
2866    }
2867
2868    // Changes the discussion group of a channel chat; requires can_change_info administrator right in the channel if it is specified
2869    pub async fn set_chat_discussion_group<C: AsRef<SetChatDiscussionGroup>>(
2870        &self,
2871        set_chat_discussion_group: C,
2872    ) -> Result<Ok> {
2873        self.make_request(set_chat_discussion_group).await
2874    }
2875
2876    // Changes the draft message in a chat
2877    pub async fn set_chat_draft_message<C: AsRef<SetChatDraftMessage>>(
2878        &self,
2879        set_chat_draft_message: C,
2880    ) -> Result<Ok> {
2881        self.make_request(set_chat_draft_message).await
2882    }
2883
2884    // 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
2885    pub async fn set_chat_location<C: AsRef<SetChatLocation>>(
2886        &self,
2887        set_chat_location: C,
2888    ) -> Result<Ok> {
2889        self.make_request(set_chat_location).await
2890    }
2891
2892    // 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
2893    pub async fn set_chat_member_status<C: AsRef<SetChatMemberStatus>>(
2894        &self,
2895        set_chat_member_status: C,
2896    ) -> Result<Ok> {
2897        self.make_request(set_chat_member_status).await
2898    }
2899
2900    // Selects a message sender to send messages in a chat
2901    pub async fn set_chat_message_sender<C: AsRef<SetChatMessageSender>>(
2902        &self,
2903        set_chat_message_sender: C,
2904    ) -> Result<Ok> {
2905        self.make_request(set_chat_message_sender).await
2906    }
2907
2908    // Changes the message TTL in a chat. Requires can_delete_messages administrator right in basic groups, supergroups and channels Message TTL can't be changed in a chat with the current user (Saved Messages) and the chat 777000 (Telegram)
2909    pub async fn set_chat_message_ttl<C: AsRef<SetChatMessageTtl>>(
2910        &self,
2911        set_chat_message_ttl: C,
2912    ) -> Result<Ok> {
2913        self.make_request(set_chat_message_ttl).await
2914    }
2915
2916    // Changes the notification settings of a chat. Notification settings of a chat with the current user (Saved Messages) can't be changed
2917    pub async fn set_chat_notification_settings<C: AsRef<SetChatNotificationSettings>>(
2918        &self,
2919        set_chat_notification_settings: C,
2920    ) -> Result<Ok> {
2921        self.make_request(set_chat_notification_settings).await
2922    }
2923
2924    // Changes the chat members permissions. Supported only for basic groups and supergroups. Requires can_restrict_members administrator right
2925    pub async fn set_chat_permissions<C: AsRef<SetChatPermissions>>(
2926        &self,
2927        set_chat_permissions: C,
2928    ) -> Result<Ok> {
2929        self.make_request(set_chat_permissions).await
2930    }
2931
2932    // Changes the photo of a chat. Supported only for basic groups, supergroups and channels. Requires can_change_info administrator right
2933    pub async fn set_chat_photo<C: AsRef<SetChatPhoto>>(&self, set_chat_photo: C) -> Result<Ok> {
2934        self.make_request(set_chat_photo).await
2935    }
2936
2937    // Changes the slow mode delay of a chat. Available only for supergroups; requires can_restrict_members rights
2938    pub async fn set_chat_slow_mode_delay<C: AsRef<SetChatSlowModeDelay>>(
2939        &self,
2940        set_chat_slow_mode_delay: C,
2941    ) -> Result<Ok> {
2942        self.make_request(set_chat_slow_mode_delay).await
2943    }
2944
2945    // Changes the chat theme. Supported only in private and secret chats
2946    pub async fn set_chat_theme<C: AsRef<SetChatTheme>>(&self, set_chat_theme: C) -> Result<Ok> {
2947        self.make_request(set_chat_theme).await
2948    }
2949
2950    // Changes the chat title. Supported only for basic groups, supergroups and channels. Requires can_change_info administrator right
2951    pub async fn set_chat_title<C: AsRef<SetChatTitle>>(&self, set_chat_title: C) -> Result<Ok> {
2952        self.make_request(set_chat_title).await
2953    }
2954
2955    // Sets the list of commands supported by the bot for the given user scope and language; for bots only
2956    pub async fn set_commands<C: AsRef<SetCommands>>(&self, set_commands: C) -> Result<Ok> {
2957        self.make_request(set_commands).await
2958    }
2959
2960    // Adds or changes a custom local language pack to the current localization target
2961    pub async fn set_custom_language_pack<C: AsRef<SetCustomLanguagePack>>(
2962        &self,
2963        set_custom_language_pack: C,
2964    ) -> Result<Ok> {
2965        self.make_request(set_custom_language_pack).await
2966    }
2967
2968    // Adds, edits or deletes a string in a custom local language pack. Can be called before authorization
2969    pub async fn set_custom_language_pack_string<C: AsRef<SetCustomLanguagePackString>>(
2970        &self,
2971        set_custom_language_pack_string: C,
2972    ) -> Result<Ok> {
2973        self.make_request(set_custom_language_pack_string).await
2974    }
2975
2976    // Changes the database encryption key. Usually the encryption key is never changed and is stored in some OS keychain
2977    pub async fn set_database_encryption_key<C: AsRef<SetDatabaseEncryptionKey>>(
2978        &self,
2979        set_database_encryption_key: C,
2980    ) -> Result<Ok> {
2981        self.make_request(set_database_encryption_key).await
2982    }
2983
2984    // Informs TDLib on a file generation progress
2985    pub async fn set_file_generation_progress<C: AsRef<SetFileGenerationProgress>>(
2986        &self,
2987        set_file_generation_progress: C,
2988    ) -> Result<Ok> {
2989        self.make_request(set_file_generation_progress).await
2990    }
2991
2992    // Updates the game score of the specified user in the game; for bots only
2993    pub async fn set_game_score<C: AsRef<SetGameScore>>(
2994        &self,
2995        set_game_score: C,
2996    ) -> Result<Message> {
2997        self.make_request(set_game_score).await
2998    }
2999
3000    // Informs TDLib that speaking state of a participant of an active group has changed
3001    pub async fn set_group_call_participant_is_speaking<
3002        C: AsRef<SetGroupCallParticipantIsSpeaking>,
3003    >(
3004        &self,
3005        set_group_call_participant_is_speaking: C,
3006    ) -> Result<Ok> {
3007        self.make_request(set_group_call_participant_is_speaking)
3008            .await
3009    }
3010
3011    // 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
3012    pub async fn set_group_call_participant_volume_level<
3013        C: AsRef<SetGroupCallParticipantVolumeLevel>,
3014    >(
3015        &self,
3016        set_group_call_participant_volume_level: C,
3017    ) -> Result<Ok> {
3018        self.make_request(set_group_call_participant_volume_level)
3019            .await
3020    }
3021
3022    // Sets group call title. Requires groupCall.can_be_managed group call flag
3023    pub async fn set_group_call_title<C: AsRef<SetGroupCallTitle>>(
3024        &self,
3025        set_group_call_title: C,
3026    ) -> Result<Ok> {
3027        self.make_request(set_group_call_title).await
3028    }
3029
3030    // Changes the period of inactivity after which sessions will automatically be terminated
3031    pub async fn set_inactive_session_ttl<C: AsRef<SetInactiveSessionTtl>>(
3032        &self,
3033        set_inactive_session_ttl: C,
3034    ) -> Result<Ok> {
3035        self.make_request(set_inactive_session_ttl).await
3036    }
3037
3038    // Updates the game score of the specified user in a game; for bots only
3039    pub async fn set_inline_game_score<C: AsRef<SetInlineGameScore>>(
3040        &self,
3041        set_inline_game_score: C,
3042    ) -> Result<Ok> {
3043        self.make_request(set_inline_game_score).await
3044    }
3045
3046    // 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
3047    pub async fn set_location<C: AsRef<SetLocation>>(&self, set_location: C) -> Result<Ok> {
3048        self.make_request(set_location).await
3049    }
3050
3051    // Sets new log stream for internal logging of TDLib. Can be called synchronously
3052    pub async fn set_log_stream<C: AsRef<SetLogStream>>(&self, set_log_stream: C) -> Result<Ok> {
3053        self.make_request(set_log_stream).await
3054    }
3055
3056    // Sets the verbosity level for a specified TDLib internal log tag. Can be called synchronously
3057    pub async fn set_log_tag_verbosity_level<C: AsRef<SetLogTagVerbosityLevel>>(
3058        &self,
3059        set_log_tag_verbosity_level: C,
3060    ) -> Result<Ok> {
3061        self.make_request(set_log_tag_verbosity_level).await
3062    }
3063
3064    // Sets the verbosity level of the internal logging of TDLib. Can be called synchronously
3065    pub async fn set_log_verbosity_level<C: AsRef<SetLogVerbosityLevel>>(
3066        &self,
3067        set_log_verbosity_level: C,
3068    ) -> Result<Ok> {
3069        self.make_request(set_log_verbosity_level).await
3070    }
3071
3072    // Changes the first and last name of the current user
3073    pub async fn set_name<C: AsRef<SetName>>(&self, set_name: C) -> Result<Ok> {
3074        self.make_request(set_name).await
3075    }
3076
3077    // 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, 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
3078    pub async fn set_network_type<C: AsRef<SetNetworkType>>(
3079        &self,
3080        set_network_type: C,
3081    ) -> Result<Ok> {
3082        self.make_request(set_network_type).await
3083    }
3084
3085    // 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
3086    pub async fn set_option<C: AsRef<SetOption>>(&self, set_option: C) -> Result<Ok> {
3087        self.make_request(set_option).await
3088    }
3089
3090    // 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
3091    pub async fn set_passport_element<C: AsRef<SetPassportElement>>(
3092        &self,
3093        set_passport_element: C,
3094    ) -> Result<PassportElement> {
3095        self.make_request(set_passport_element).await
3096    }
3097
3098    // 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
3099    pub async fn set_passport_element_errors<C: AsRef<SetPassportElementErrors>>(
3100        &self,
3101        set_passport_element_errors: C,
3102    ) -> Result<Ok> {
3103        self.make_request(set_passport_element_errors).await
3104    }
3105
3106    // Changes the 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
3107    pub async fn set_password<C: AsRef<SetPassword>>(
3108        &self,
3109        set_password: C,
3110    ) -> Result<PasswordState> {
3111        self.make_request(set_password).await
3112    }
3113
3114    // Changes the order of pinned chats
3115    pub async fn set_pinned_chats<C: AsRef<SetPinnedChats>>(
3116        &self,
3117        set_pinned_chats: C,
3118    ) -> Result<Ok> {
3119        self.make_request(set_pinned_chats).await
3120    }
3121
3122    // Changes the user answer to a poll. A poll in quiz mode can be answered only once
3123    pub async fn set_poll_answer<C: AsRef<SetPollAnswer>>(&self, set_poll_answer: C) -> Result<Ok> {
3124        self.make_request(set_poll_answer).await
3125    }
3126
3127    // Changes a profile photo for the current user
3128    pub async fn set_profile_photo<C: AsRef<SetProfilePhoto>>(
3129        &self,
3130        set_profile_photo: C,
3131    ) -> Result<Ok> {
3132        self.make_request(set_profile_photo).await
3133    }
3134
3135    // 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. 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
3136    pub async fn set_recovery_email_address<C: AsRef<SetRecoveryEmailAddress>>(
3137        &self,
3138        set_recovery_email_address: C,
3139    ) -> Result<PasswordState> {
3140        self.make_request(set_recovery_email_address).await
3141    }
3142
3143    // Changes notification settings for chats of a given type
3144    pub async fn set_scope_notification_settings<C: AsRef<SetScopeNotificationSettings>>(
3145        &self,
3146        set_scope_notification_settings: C,
3147    ) -> Result<Ok> {
3148        self.make_request(set_scope_notification_settings).await
3149    }
3150
3151    // 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
3152    pub async fn set_sticker_position_in_set<C: AsRef<SetStickerPositionInSet>>(
3153        &self,
3154        set_sticker_position_in_set: C,
3155    ) -> Result<Ok> {
3156        self.make_request(set_sticker_position_in_set).await
3157    }
3158
3159    // Sets a sticker set thumbnail; for bots only. Returns the sticker set
3160    pub async fn set_sticker_set_thumbnail<C: AsRef<SetStickerSetThumbnail>>(
3161        &self,
3162        set_sticker_set_thumbnail: C,
3163    ) -> Result<StickerSet> {
3164        self.make_request(set_sticker_set_thumbnail).await
3165    }
3166
3167    // Changes the sticker set of a supergroup; requires can_change_info administrator right
3168    pub async fn set_supergroup_sticker_set<C: AsRef<SetSupergroupStickerSet>>(
3169        &self,
3170        set_supergroup_sticker_set: C,
3171    ) -> Result<Ok> {
3172        self.make_request(set_supergroup_sticker_set).await
3173    }
3174
3175    // Changes the username of a supergroup or channel, requires owner privileges in the supergroup or channel
3176    pub async fn set_supergroup_username<C: AsRef<SetSupergroupUsername>>(
3177        &self,
3178        set_supergroup_username: C,
3179    ) -> Result<Ok> {
3180        self.make_request(set_supergroup_username).await
3181    }
3182
3183    // Sets the parameters for TDLib initialization. Works only when the current authorization state is authorizationStateWaitTdlibParameters
3184    pub async fn set_tdlib_parameters<C: AsRef<SetTdlibParameters>>(
3185        &self,
3186        set_tdlib_parameters: C,
3187    ) -> Result<Ok> {
3188        self.make_request(set_tdlib_parameters).await
3189    }
3190
3191    // Changes user privacy settings
3192    pub async fn set_user_privacy_setting_rules<C: AsRef<SetUserPrivacySettingRules>>(
3193        &self,
3194        set_user_privacy_setting_rules: C,
3195    ) -> Result<Ok> {
3196        self.make_request(set_user_privacy_setting_rules).await
3197    }
3198
3199    // Changes the username of the current user
3200    pub async fn set_username<C: AsRef<SetUsername>>(&self, set_username: C) -> Result<Ok> {
3201        self.make_request(set_username).await
3202    }
3203
3204    // Changes default participant identifier, on whose behalf a video chat in the chat will be joined
3205    pub async fn set_video_chat_default_participant<C: AsRef<SetVideoChatDefaultParticipant>>(
3206        &self,
3207        set_video_chat_default_participant: C,
3208    ) -> Result<Ok> {
3209        self.make_request(set_video_chat_default_participant).await
3210    }
3211
3212    // Shares the phone number of the current user with a mutual contact. Supposed to be called when the user clicks on chatActionBarSharePhoneNumber
3213    pub async fn share_phone_number<C: AsRef<SharePhoneNumber>>(
3214        &self,
3215        share_phone_number: C,
3216    ) -> Result<Ok> {
3217        self.make_request(share_phone_number).await
3218    }
3219
3220    // Starts recording of an active group call. Requires groupCall.can_be_managed group call flag
3221    pub async fn start_group_call_recording<C: AsRef<StartGroupCallRecording>>(
3222        &self,
3223        start_group_call_recording: C,
3224    ) -> Result<Ok> {
3225        self.make_request(start_group_call_recording).await
3226    }
3227
3228    // Starts screen sharing in a joined group call. Returns join response payload for tgcalls
3229    pub async fn start_group_call_screen_sharing<C: AsRef<StartGroupCallScreenSharing>>(
3230        &self,
3231        start_group_call_screen_sharing: C,
3232    ) -> Result<Text> {
3233        self.make_request(start_group_call_screen_sharing).await
3234    }
3235
3236    // Starts a scheduled group call
3237    pub async fn start_scheduled_group_call<C: AsRef<StartScheduledGroupCall>>(
3238        &self,
3239        start_scheduled_group_call: C,
3240    ) -> Result<Ok> {
3241        self.make_request(start_scheduled_group_call).await
3242    }
3243
3244    // Stops a poll. A poll in a message can be stopped when the message has can_be_edited flag set
3245    pub async fn stop_poll<C: AsRef<StopPoll>>(&self, stop_poll: C) -> Result<Ok> {
3246        self.make_request(stop_poll).await
3247    }
3248
3249    // Fetches the latest versions of all strings from a language pack in the current localization target from the server. This method doesn't need to be called explicitly for the current used/base language packs. Can be called before authorization
3250    pub async fn synchronize_language_pack<C: AsRef<SynchronizeLanguagePack>>(
3251        &self,
3252        synchronize_language_pack: C,
3253    ) -> Result<Ok> {
3254        self.make_request(synchronize_language_pack).await
3255    }
3256
3257    // Terminates all other sessions of the current user
3258    pub async fn terminate_all_other_sessions<C: AsRef<TerminateAllOtherSessions>>(
3259        &self,
3260        terminate_all_other_sessions: C,
3261    ) -> Result<Ok> {
3262        self.make_request(terminate_all_other_sessions).await
3263    }
3264
3265    // Terminates a session of the current user
3266    pub async fn terminate_session<C: AsRef<TerminateSession>>(
3267        &self,
3268        terminate_session: C,
3269    ) -> Result<Ok> {
3270        self.make_request(terminate_session).await
3271    }
3272
3273    // Returns the received bytes; for testing only. This is an offline method. Can be called before authorization
3274    pub async fn test_call_bytes<C: AsRef<TestCallBytes>>(
3275        &self,
3276        test_call_bytes: C,
3277    ) -> Result<TestBytes> {
3278        self.make_request(test_call_bytes).await
3279    }
3280
3281    // Does nothing; for testing only. This is an offline method. Can be called before authorization
3282    pub async fn test_call_empty<C: AsRef<TestCallEmpty>>(&self, test_call_empty: C) -> Result<Ok> {
3283        self.make_request(test_call_empty).await
3284    }
3285
3286    // Returns the received string; for testing only. This is an offline method. Can be called before authorization
3287    pub async fn test_call_string<C: AsRef<TestCallString>>(
3288        &self,
3289        test_call_string: C,
3290    ) -> Result<TestString> {
3291        self.make_request(test_call_string).await
3292    }
3293
3294    // Returns the received vector of numbers; for testing only. This is an offline method. Can be called before authorization
3295    pub async fn test_call_vector_int<C: AsRef<TestCallVectorInt>>(
3296        &self,
3297        test_call_vector_int: C,
3298    ) -> Result<TestVectorInt> {
3299        self.make_request(test_call_vector_int).await
3300    }
3301
3302    // Returns the received vector of objects containing a number; for testing only. This is an offline method. Can be called before authorization
3303    pub async fn test_call_vector_int_object<C: AsRef<TestCallVectorIntObject>>(
3304        &self,
3305        test_call_vector_int_object: C,
3306    ) -> Result<TestVectorIntObject> {
3307        self.make_request(test_call_vector_int_object).await
3308    }
3309
3310    // Returns the received vector of strings; for testing only. This is an offline method. Can be called before authorization
3311    pub async fn test_call_vector_string<C: AsRef<TestCallVectorString>>(
3312        &self,
3313        test_call_vector_string: C,
3314    ) -> Result<TestVectorString> {
3315        self.make_request(test_call_vector_string).await
3316    }
3317
3318    // Returns the received vector of objects containing a string; for testing only. This is an offline method. Can be called before authorization
3319    pub async fn test_call_vector_string_object<C: AsRef<TestCallVectorStringObject>>(
3320        &self,
3321        test_call_vector_string_object: C,
3322    ) -> Result<TestVectorStringObject> {
3323        self.make_request(test_call_vector_string_object).await
3324    }
3325
3326    // Forces an updates.getDifference call to the Telegram servers; for testing only
3327    pub async fn test_get_difference<C: AsRef<TestGetDifference>>(
3328        &self,
3329        test_get_difference: C,
3330    ) -> Result<Ok> {
3331        self.make_request(test_get_difference).await
3332    }
3333
3334    // Sends a simple network request to the Telegram servers; for testing only. Can be called before authorization
3335    pub async fn test_network<C: AsRef<TestNetwork>>(&self, test_network: C) -> Result<Ok> {
3336        self.make_request(test_network).await
3337    }
3338
3339    // Sends a simple network request to the Telegram servers via proxy; for testing only. Can be called before authorization
3340    pub async fn test_proxy<C: AsRef<TestProxy>>(&self, test_proxy: C) -> Result<Ok> {
3341        self.make_request(test_proxy).await
3342    }
3343
3344    // Returns the specified error and ensures that the Error object is used; for testing only. Can be called synchronously
3345    pub async fn test_return_error<C: AsRef<TestReturnError>>(
3346        &self,
3347        test_return_error: C,
3348    ) -> Result<Error> {
3349        self.make_request(test_return_error).await
3350    }
3351
3352    // Returns the squared received number; for testing only. This is an offline method. Can be called before authorization
3353    pub async fn test_square_int<C: AsRef<TestSquareInt>>(
3354        &self,
3355        test_square_int: C,
3356    ) -> Result<TestInt> {
3357        self.make_request(test_square_int).await
3358    }
3359
3360    // Does nothing and ensures that the Update object is used; for testing only. This is an offline method. Can be called before authorization
3361    pub async fn test_use_update<C: AsRef<TestUseUpdate>>(
3362        &self,
3363        test_use_update: C,
3364    ) -> Result<Update> {
3365        self.make_request(test_use_update).await
3366    }
3367
3368    // Changes the value of the default disable_notification parameter, used when a message is sent to a chat
3369    pub async fn toggle_chat_default_disable_notification<
3370        C: AsRef<ToggleChatDefaultDisableNotification>,
3371    >(
3372        &self,
3373        toggle_chat_default_disable_notification: C,
3374    ) -> Result<Ok> {
3375        self.make_request(toggle_chat_default_disable_notification)
3376            .await
3377    }
3378
3379    // Changes the ability of users to save, forward, or copy chat content. Supported only for basic groups, supergroups and channels. Requires owner privileges
3380    pub async fn toggle_chat_has_protected_content<C: AsRef<ToggleChatHasProtectedContent>>(
3381        &self,
3382        toggle_chat_has_protected_content: C,
3383    ) -> Result<Ok> {
3384        self.make_request(toggle_chat_has_protected_content).await
3385    }
3386
3387    // Changes the marked as unread state of a chat
3388    pub async fn toggle_chat_is_marked_as_unread<C: AsRef<ToggleChatIsMarkedAsUnread>>(
3389        &self,
3390        toggle_chat_is_marked_as_unread: C,
3391    ) -> Result<Ok> {
3392        self.make_request(toggle_chat_is_marked_as_unread).await
3393    }
3394
3395    // 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/arhive chat list
3396    pub async fn toggle_chat_is_pinned<C: AsRef<ToggleChatIsPinned>>(
3397        &self,
3398        toggle_chat_is_pinned: C,
3399    ) -> Result<Ok> {
3400        self.make_request(toggle_chat_is_pinned).await
3401    }
3402
3403    // Toggles whether the current user will receive a notification when the group call will start; scheduled group calls only
3404    pub async fn toggle_group_call_enabled_start_notification<
3405        C: AsRef<ToggleGroupCallEnabledStartNotification>,
3406    >(
3407        &self,
3408        toggle_group_call_enabled_start_notification: C,
3409    ) -> Result<Ok> {
3410        self.make_request(toggle_group_call_enabled_start_notification)
3411            .await
3412    }
3413
3414    // Toggles whether current user's video is enabled
3415    pub async fn toggle_group_call_is_my_video_enabled<
3416        C: AsRef<ToggleGroupCallIsMyVideoEnabled>,
3417    >(
3418        &self,
3419        toggle_group_call_is_my_video_enabled: C,
3420    ) -> Result<Ok> {
3421        self.make_request(toggle_group_call_is_my_video_enabled)
3422            .await
3423    }
3424
3425    // Toggles whether current user's video is paused
3426    pub async fn toggle_group_call_is_my_video_paused<C: AsRef<ToggleGroupCallIsMyVideoPaused>>(
3427        &self,
3428        toggle_group_call_is_my_video_paused: C,
3429    ) -> Result<Ok> {
3430        self.make_request(toggle_group_call_is_my_video_paused)
3431            .await
3432    }
3433
3434    // 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
3435    pub async fn toggle_group_call_mute_new_participants<
3436        C: AsRef<ToggleGroupCallMuteNewParticipants>,
3437    >(
3438        &self,
3439        toggle_group_call_mute_new_participants: C,
3440    ) -> Result<Ok> {
3441        self.make_request(toggle_group_call_mute_new_participants)
3442            .await
3443    }
3444
3445    // Toggles whether a group call participant hand is rased
3446    pub async fn toggle_group_call_participant_is_hand_raised<
3447        C: AsRef<ToggleGroupCallParticipantIsHandRaised>,
3448    >(
3449        &self,
3450        toggle_group_call_participant_is_hand_raised: C,
3451    ) -> Result<Ok> {
3452        self.make_request(toggle_group_call_participant_is_hand_raised)
3453            .await
3454    }
3455
3456    // Toggles whether a participant of an active group call is muted, unmuted, or allowed to unmute themselves
3457    pub async fn toggle_group_call_participant_is_muted<
3458        C: AsRef<ToggleGroupCallParticipantIsMuted>,
3459    >(
3460        &self,
3461        toggle_group_call_participant_is_muted: C,
3462    ) -> Result<Ok> {
3463        self.make_request(toggle_group_call_participant_is_muted)
3464            .await
3465    }
3466
3467    // Pauses or unpauses screen sharing in a joined group call
3468    pub async fn toggle_group_call_screen_sharing_is_paused<
3469        C: AsRef<ToggleGroupCallScreenSharingIsPaused>,
3470    >(
3471        &self,
3472        toggle_group_call_screen_sharing_is_paused: C,
3473    ) -> Result<Ok> {
3474        self.make_request(toggle_group_call_screen_sharing_is_paused)
3475            .await
3476    }
3477
3478    // Changes the block state of a message sender. Currently, only users and supergroup chats can be blocked
3479    pub async fn toggle_message_sender_is_blocked<C: AsRef<ToggleMessageSenderIsBlocked>>(
3480        &self,
3481        toggle_message_sender_is_blocked: C,
3482    ) -> Result<Ok> {
3483        self.make_request(toggle_message_sender_is_blocked).await
3484    }
3485
3486    // Toggles whether a session can accept incoming calls
3487    pub async fn toggle_session_can_accept_calls<C: AsRef<ToggleSessionCanAcceptCalls>>(
3488        &self,
3489        toggle_session_can_accept_calls: C,
3490    ) -> Result<Ok> {
3491        self.make_request(toggle_session_can_accept_calls).await
3492    }
3493
3494    // Toggles whether a session can accept incoming secret chats
3495    pub async fn toggle_session_can_accept_secret_chats<
3496        C: AsRef<ToggleSessionCanAcceptSecretChats>,
3497    >(
3498        &self,
3499        toggle_session_can_accept_secret_chats: C,
3500    ) -> Result<Ok> {
3501        self.make_request(toggle_session_can_accept_secret_chats)
3502            .await
3503    }
3504
3505    // Toggles whether the message history of a supergroup is available to new members; requires can_change_info administrator right
3506    pub async fn toggle_supergroup_is_all_history_available<
3507        C: AsRef<ToggleSupergroupIsAllHistoryAvailable>,
3508    >(
3509        &self,
3510        toggle_supergroup_is_all_history_available: C,
3511    ) -> Result<Ok> {
3512        self.make_request(toggle_supergroup_is_all_history_available)
3513            .await
3514    }
3515
3516    // Upgrades supergroup to a broadcast group; requires owner privileges in the supergroup
3517    pub async fn toggle_supergroup_is_broadcast_group<
3518        C: AsRef<ToggleSupergroupIsBroadcastGroup>,
3519    >(
3520        &self,
3521        toggle_supergroup_is_broadcast_group: C,
3522    ) -> Result<Ok> {
3523        self.make_request(toggle_supergroup_is_broadcast_group)
3524            .await
3525    }
3526
3527    // Toggles whether sender signature is added to sent messages in a channel; requires can_change_info administrator right
3528    pub async fn toggle_supergroup_sign_messages<C: AsRef<ToggleSupergroupSignMessages>>(
3529        &self,
3530        toggle_supergroup_sign_messages: C,
3531    ) -> Result<Ok> {
3532        self.make_request(toggle_supergroup_sign_messages).await
3533    }
3534
3535    // 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
3536    pub async fn transfer_chat_ownership<C: AsRef<TransferChatOwnership>>(
3537        &self,
3538        transfer_chat_ownership: C,
3539    ) -> Result<Ok> {
3540        self.make_request(transfer_chat_ownership).await
3541    }
3542
3543    // Removes all pinned messages from a chat; requires can_pin_messages rights in the group or can_edit_messages rights in the channel
3544    pub async fn unpin_all_chat_messages<C: AsRef<UnpinAllChatMessages>>(
3545        &self,
3546        unpin_all_chat_messages: C,
3547    ) -> Result<Ok> {
3548        self.make_request(unpin_all_chat_messages).await
3549    }
3550
3551    // Removes a pinned message from a chat; requires can_pin_messages rights in the group or can_edit_messages rights in the channel
3552    pub async fn unpin_chat_message<C: AsRef<UnpinChatMessage>>(
3553        &self,
3554        unpin_chat_message: C,
3555    ) -> Result<Ok> {
3556        self.make_request(unpin_chat_message).await
3557    }
3558
3559    // Creates a new supergroup from an existing basic group and sends a corresponding messageChatUpgradeTo and messageChatUpgradeFrom; requires creator privileges. Deactivates the original basic group
3560    pub async fn upgrade_basic_group_chat_to_supergroup_chat<
3561        C: AsRef<UpgradeBasicGroupChatToSupergroupChat>,
3562    >(
3563        &self,
3564        upgrade_basic_group_chat_to_supergroup_chat: C,
3565    ) -> Result<Chat> {
3566        self.make_request(upgrade_basic_group_chat_to_supergroup_chat)
3567            .await
3568    }
3569
3570    // Asynchronously uploads a file to the cloud without sending it in a message. updateFile will be used 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
3571    pub async fn upload_file<C: AsRef<UploadFile>>(&self, upload_file: C) -> Result<File> {
3572        self.make_request(upload_file).await
3573    }
3574
3575    // Uploads a file with a sticker; returns the uploaded file
3576    pub async fn upload_sticker_file<C: AsRef<UploadStickerFile>>(
3577        &self,
3578        upload_sticker_file: C,
3579    ) -> Result<File> {
3580        self.make_request(upload_sticker_file).await
3581    }
3582
3583    // Validates the order information provided by a user and returns the available shipping options for a flexible invoice
3584    pub async fn validate_order_info<C: AsRef<ValidateOrderInfo>>(
3585        &self,
3586        validate_order_info: C,
3587    ) -> Result<ValidatedOrderInfo> {
3588        self.make_request(validate_order_info).await
3589    }
3590
3591    // 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). 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)
3592    pub async fn view_messages<C: AsRef<ViewMessages>>(&self, view_messages: C) -> Result<Ok> {
3593        self.make_request(view_messages).await
3594    }
3595
3596    // Informs the server that some trending sticker sets have been viewed by the user
3597    pub async fn view_trending_sticker_sets<C: AsRef<ViewTrendingStickerSets>>(
3598        &self,
3599        view_trending_sticker_sets: C,
3600    ) -> Result<Ok> {
3601        self.make_request(view_trending_sticker_sets).await
3602    }
3603
3604    // 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
3605    pub async fn write_generated_file_part<C: AsRef<WriteGeneratedFilePart>>(
3606        &self,
3607        write_generated_file_part: C,
3608    ) -> Result<Ok> {
3609        self.make_request(write_generated_file_part).await
3610    }
3611}