Skip to main content

ronami_core/bot/
api.rs

1use url::Url;
2
3use crate::{
4    Bot, payloads,
5    prelude::Requester,
6    requests::{JsonRequest, MultipartRequest},
7    types::{
8        AcceptedGiftTypes, BotCommand, BusinessConnectionId, CallbackQueryId, ChatId,
9        ChatPermissions, CustomEmojiId, DraftId, FileId, GiftId, GuestQueryId, InlineQueryId,
10        InlineQueryResult, InputChecklist, InputFile, InputMedia, InputPaidMedia, InputPollOption,
11        InputProfilePhoto, InputRichMessage, InputSticker, InputStoryContent, KeyboardButton,
12        LabeledPrice, MessageId, OwnedGiftId, PreCheckoutQueryId, Recipient, Seconds,
13        ShippingQueryId, StickerFormat, StoryId, TelegramTransactionId, ThreadId, UserId,
14    },
15};
16
17impl Requester for Bot {
18    type Err = crate::errors::RequestError;
19
20    type GetUpdates = JsonRequest<payloads::GetUpdates>;
21
22    fn get_updates(&self) -> Self::GetUpdates {
23        Self::GetUpdates::new(self.clone(), payloads::GetUpdates::new())
24    }
25
26    type SetWebhook = MultipartRequest<payloads::SetWebhook>;
27
28    fn set_webhook(&self, url: Url) -> Self::SetWebhook {
29        Self::SetWebhook::new(self.clone(), payloads::SetWebhook::new(url))
30    }
31
32    type DeleteWebhook = JsonRequest<payloads::DeleteWebhook>;
33
34    fn delete_webhook(&self) -> Self::DeleteWebhook {
35        Self::DeleteWebhook::new(self.clone(), payloads::DeleteWebhook::new())
36    }
37
38    type GetWebhookInfo = JsonRequest<payloads::GetWebhookInfo>;
39
40    fn get_webhook_info(&self) -> Self::GetWebhookInfo {
41        Self::GetWebhookInfo::new(self.clone(), payloads::GetWebhookInfo::new())
42    }
43
44    type GetMe = JsonRequest<payloads::GetMe>;
45
46    fn get_me(&self) -> Self::GetMe {
47        Self::GetMe::new(self.clone(), payloads::GetMe::new())
48    }
49
50    type SendMessage = JsonRequest<payloads::SendMessage>;
51
52    fn send_message<C, T>(&self, chat_id: C, text: T) -> Self::SendMessage
53    where
54        C: Into<Recipient>,
55        T: Into<String>,
56    {
57        Self::SendMessage::new(self.clone(), payloads::SendMessage::new(chat_id, text))
58    }
59
60    type SendMessageDraft = JsonRequest<payloads::SendMessageDraft>;
61
62    fn send_message_draft<C, T>(
63        &self,
64        chat_id: C,
65        draft_id: DraftId,
66        text: T,
67    ) -> Self::SendMessageDraft
68    where
69        C: Into<Recipient>,
70        T: Into<String>,
71    {
72        Self::SendMessageDraft::new(
73            self.clone(),
74            payloads::SendMessageDraft::new(chat_id, draft_id, text),
75        )
76    }
77
78    type SendRichMessage = JsonRequest<payloads::SendRichMessage>;
79
80    fn send_rich_message<C>(
81        &self,
82        chat_id: C,
83        rich_message: InputRichMessage,
84    ) -> Self::SendRichMessage
85    where
86        C: Into<Recipient>,
87    {
88        Self::SendRichMessage::new(
89            self.clone(),
90            payloads::SendRichMessage::new(chat_id, rich_message),
91        )
92    }
93
94    type SendRichMessageDraft = JsonRequest<payloads::SendRichMessageDraft>;
95
96    fn send_rich_message_draft<C>(
97        &self,
98        chat_id: C,
99        draft_id: DraftId,
100        rich_message: InputRichMessage,
101    ) -> Self::SendRichMessageDraft
102    where
103        C: Into<Recipient>,
104    {
105        Self::SendRichMessageDraft::new(
106            self.clone(),
107            payloads::SendRichMessageDraft::new(chat_id, draft_id, rich_message),
108        )
109    }
110
111    type ForwardMessage = JsonRequest<payloads::ForwardMessage>;
112
113    fn forward_message<C, F>(
114        &self,
115        chat_id: C,
116        from_chat_id: F,
117        message_id: MessageId,
118    ) -> Self::ForwardMessage
119    where
120        C: Into<Recipient>,
121        F: Into<Recipient>,
122    {
123        Self::ForwardMessage::new(
124            self.clone(),
125            payloads::ForwardMessage::new(chat_id, from_chat_id, message_id),
126        )
127    }
128
129    type ForwardMessages = JsonRequest<payloads::ForwardMessages>;
130    fn forward_messages<C, F, M>(
131        &self,
132        chat_id: C,
133        from_chat_id: F,
134        message_ids: M,
135    ) -> Self::ForwardMessages
136    where
137        C: Into<Recipient>,
138        F: Into<Recipient>,
139        M: IntoIterator<Item = MessageId>,
140    {
141        Self::ForwardMessages::new(
142            self.clone(),
143            payloads::ForwardMessages::new(chat_id, from_chat_id, message_ids),
144        )
145    }
146
147    type SendPhoto = MultipartRequest<payloads::SendPhoto>;
148
149    fn send_photo<C>(&self, chat_id: C, photo: InputFile) -> Self::SendPhoto
150    where
151        C: Into<Recipient>,
152    {
153        Self::SendPhoto::new(self.clone(), payloads::SendPhoto::new(chat_id, photo))
154    }
155
156    type SendAudio = MultipartRequest<payloads::SendAudio>;
157
158    fn send_audio<C>(&self, chat_id: C, audio: InputFile) -> Self::SendAudio
159    where
160        C: Into<Recipient>,
161    {
162        Self::SendAudio::new(self.clone(), payloads::SendAudio::new(chat_id, audio))
163    }
164
165    type SendDocument = MultipartRequest<payloads::SendDocument>;
166
167    fn send_document<C>(&self, chat_id: C, document: InputFile) -> Self::SendDocument
168    where
169        C: Into<Recipient>,
170    {
171        Self::SendDocument::new(self.clone(), payloads::SendDocument::new(chat_id, document))
172    }
173
174    type SendVideo = MultipartRequest<payloads::SendVideo>;
175
176    fn send_video<C>(&self, chat_id: C, video: InputFile) -> Self::SendVideo
177    where
178        C: Into<Recipient>,
179    {
180        Self::SendVideo::new(self.clone(), payloads::SendVideo::new(chat_id, video))
181    }
182
183    type SendAnimation = MultipartRequest<payloads::SendAnimation>;
184
185    fn send_animation<C>(&self, chat_id: C, animation: InputFile) -> Self::SendAnimation
186    where
187        C: Into<Recipient>,
188    {
189        Self::SendAnimation::new(self.clone(), payloads::SendAnimation::new(chat_id, animation))
190    }
191
192    type SendVoice = MultipartRequest<payloads::SendVoice>;
193
194    fn send_voice<C>(&self, chat_id: C, voice: InputFile) -> Self::SendVoice
195    where
196        C: Into<Recipient>,
197    {
198        Self::SendVoice::new(self.clone(), payloads::SendVoice::new(chat_id, voice))
199    }
200
201    type SendVideoNote = MultipartRequest<payloads::SendVideoNote>;
202
203    fn send_video_note<C>(&self, chat_id: C, video_note: InputFile) -> Self::SendVideoNote
204    where
205        C: Into<Recipient>,
206    {
207        Self::SendVideoNote::new(self.clone(), payloads::SendVideoNote::new(chat_id, video_note))
208    }
209
210    type SendLivePhoto = MultipartRequest<payloads::SendLivePhoto>;
211
212    fn send_live_photo<C>(
213        &self,
214        chat_id: C,
215        live_photo: InputFile,
216        photo: InputFile,
217    ) -> Self::SendLivePhoto
218    where
219        C: Into<Recipient>,
220    {
221        Self::SendLivePhoto::new(
222            self.clone(),
223            payloads::SendLivePhoto::new(chat_id, live_photo, photo),
224        )
225    }
226
227    type SendPaidMedia = MultipartRequest<payloads::SendPaidMedia>;
228
229    fn send_paid_media<C, M>(&self, chat_id: C, star_count: u32, media: M) -> Self::SendPaidMedia
230    where
231        C: Into<Recipient>,
232        M: IntoIterator<Item = InputPaidMedia>,
233    {
234        Self::SendPaidMedia::new(
235            self.clone(),
236            payloads::SendPaidMedia::new(chat_id, star_count, media),
237        )
238    }
239
240    type SendMediaGroup = MultipartRequest<payloads::SendMediaGroup>;
241
242    fn send_media_group<C, M>(&self, chat_id: C, media: M) -> Self::SendMediaGroup
243    where
244        C: Into<Recipient>,
245        M: IntoIterator<Item = InputMedia>,
246    {
247        Self::SendMediaGroup::new(self.clone(), payloads::SendMediaGroup::new(chat_id, media))
248    }
249
250    type SendLocation = JsonRequest<payloads::SendLocation>;
251
252    fn send_location<C>(&self, chat_id: C, latitude: f64, longitude: f64) -> Self::SendLocation
253    where
254        C: Into<Recipient>,
255    {
256        Self::SendLocation::new(
257            self.clone(),
258            payloads::SendLocation::new(chat_id, latitude, longitude),
259        )
260    }
261
262    type EditMessageLiveLocation = JsonRequest<payloads::EditMessageLiveLocation>;
263
264    fn edit_message_live_location<C>(
265        &self,
266        chat_id: C,
267        message_id: MessageId,
268        latitude: f64,
269        longitude: f64,
270    ) -> Self::EditMessageLiveLocation
271    where
272        C: Into<Recipient>,
273    {
274        Self::EditMessageLiveLocation::new(
275            self.clone(),
276            payloads::EditMessageLiveLocation::new(chat_id, message_id, latitude, longitude),
277        )
278    }
279
280    type EditMessageLiveLocationInline = JsonRequest<payloads::EditMessageLiveLocationInline>;
281
282    fn edit_message_live_location_inline<I>(
283        &self,
284        inline_message_id: I,
285        latitude: f64,
286        longitude: f64,
287    ) -> Self::EditMessageLiveLocationInline
288    where
289        I: Into<String>,
290    {
291        Self::EditMessageLiveLocationInline::new(
292            self.clone(),
293            payloads::EditMessageLiveLocationInline::new(inline_message_id, latitude, longitude),
294        )
295    }
296
297    type StopMessageLiveLocation = JsonRequest<payloads::StopMessageLiveLocation>;
298
299    fn stop_message_live_location<C>(
300        &self,
301        chat_id: C,
302        message_id: MessageId,
303    ) -> Self::StopMessageLiveLocation
304    where
305        C: Into<Recipient>,
306    {
307        Self::StopMessageLiveLocation::new(
308            self.clone(),
309            payloads::StopMessageLiveLocation::new(chat_id, message_id),
310        )
311    }
312
313    type StopMessageLiveLocationInline = JsonRequest<payloads::StopMessageLiveLocationInline>;
314
315    fn stop_message_live_location_inline<I>(
316        &self,
317        inline_message_id: I,
318    ) -> Self::StopMessageLiveLocationInline
319    where
320        I: Into<String>,
321    {
322        Self::StopMessageLiveLocationInline::new(
323            self.clone(),
324            payloads::StopMessageLiveLocationInline::new(inline_message_id),
325        )
326    }
327
328    type EditMessageChecklist = JsonRequest<payloads::EditMessageChecklist>;
329
330    fn edit_message_checklist<C>(
331        &self,
332        business_connection_id: BusinessConnectionId,
333        chat_id: C,
334        message_id: MessageId,
335        checklist: InputChecklist,
336    ) -> Self::EditMessageChecklist
337    where
338        C: Into<ChatId>,
339    {
340        Self::EditMessageChecklist::new(
341            self.clone(),
342            payloads::EditMessageChecklist::new(
343                business_connection_id,
344                chat_id,
345                message_id,
346                checklist,
347            ),
348        )
349    }
350
351    type SendVenue = JsonRequest<payloads::SendVenue>;
352
353    fn send_venue<C, T, A>(
354        &self,
355        chat_id: C,
356        latitude: f64,
357        longitude: f64,
358        title: T,
359        address: A,
360    ) -> Self::SendVenue
361    where
362        C: Into<Recipient>,
363        T: Into<String>,
364        A: Into<String>,
365    {
366        Self::SendVenue::new(
367            self.clone(),
368            payloads::SendVenue::new(chat_id, latitude, longitude, title, address),
369        )
370    }
371
372    type SendContact = JsonRequest<payloads::SendContact>;
373
374    fn send_contact<C, P, F>(&self, chat_id: C, phone_number: P, first_name: F) -> Self::SendContact
375    where
376        C: Into<Recipient>,
377        P: Into<String>,
378        F: Into<String>,
379    {
380        Self::SendContact::new(
381            self.clone(),
382            payloads::SendContact::new(chat_id, phone_number, first_name),
383        )
384    }
385
386    type SendPoll = JsonRequest<payloads::SendPoll>;
387
388    fn send_poll<C, Q, O>(&self, chat_id: C, question: Q, options: O) -> Self::SendPoll
389    where
390        C: Into<Recipient>,
391        Q: Into<String>,
392        O: IntoIterator<Item = InputPollOption>,
393    {
394        Self::SendPoll::new(self.clone(), payloads::SendPoll::new(chat_id, question, options))
395    }
396
397    type SendChecklist = JsonRequest<payloads::SendChecklist>;
398
399    fn send_checklist<C>(
400        &self,
401        business_connection_id: BusinessConnectionId,
402        chat_id: C,
403        checklist: InputChecklist,
404    ) -> Self::SendChecklist
405    where
406        C: Into<ChatId>,
407    {
408        Self::SendChecklist::new(
409            self.clone(),
410            payloads::SendChecklist::new(business_connection_id, chat_id, checklist),
411        )
412    }
413
414    type SendDice = JsonRequest<payloads::SendDice>;
415
416    fn send_dice<C>(&self, chat_id: C) -> Self::SendDice
417    where
418        C: Into<Recipient>,
419    {
420        Self::SendDice::new(self.clone(), payloads::SendDice::new(chat_id))
421    }
422
423    type SendChatAction = JsonRequest<payloads::SendChatAction>;
424
425    fn send_chat_action<C>(
426        &self,
427        chat_id: C,
428        action: crate::types::ChatAction,
429    ) -> Self::SendChatAction
430    where
431        C: Into<Recipient>,
432    {
433        Self::SendChatAction::new(self.clone(), payloads::SendChatAction::new(chat_id, action))
434    }
435
436    type SetMessageReaction = JsonRequest<payloads::SetMessageReaction>;
437
438    fn set_message_reaction<C>(&self, chat_id: C, message_id: MessageId) -> Self::SetMessageReaction
439    where
440        C: Into<Recipient>,
441    {
442        Self::SetMessageReaction::new(
443            self.clone(),
444            payloads::SetMessageReaction::new(chat_id, message_id),
445        )
446    }
447
448    type GetUserProfilePhotos = JsonRequest<payloads::GetUserProfilePhotos>;
449
450    fn get_user_profile_photos(&self, user_id: UserId) -> Self::GetUserProfilePhotos {
451        Self::GetUserProfilePhotos::new(self.clone(), payloads::GetUserProfilePhotos::new(user_id))
452    }
453
454    type GetUserProfileAudios = JsonRequest<payloads::GetUserProfileAudios>;
455
456    fn get_user_profile_audios(&self, user_id: UserId) -> Self::GetUserProfileAudios {
457        Self::GetUserProfileAudios::new(self.clone(), payloads::GetUserProfileAudios::new(user_id))
458    }
459
460    type SetUserEmojiStatus = JsonRequest<payloads::SetUserEmojiStatus>;
461
462    fn set_user_emoji_status(&self, user_id: UserId) -> Self::SetUserEmojiStatus {
463        Self::SetUserEmojiStatus::new(self.clone(), payloads::SetUserEmojiStatus::new(user_id))
464    }
465
466    type GetFile = JsonRequest<payloads::GetFile>;
467
468    fn get_file(&self, file_id: FileId) -> Self::GetFile {
469        Self::GetFile::new(self.clone(), payloads::GetFile::new(file_id))
470    }
471
472    type KickChatMember = JsonRequest<payloads::KickChatMember>;
473
474    fn kick_chat_member<C>(&self, chat_id: C, user_id: UserId) -> Self::KickChatMember
475    where
476        C: Into<Recipient>,
477    {
478        Self::KickChatMember::new(self.clone(), payloads::KickChatMember::new(chat_id, user_id))
479    }
480
481    type BanChatMember = JsonRequest<payloads::BanChatMember>;
482
483    fn ban_chat_member<C>(&self, chat_id: C, user_id: UserId) -> Self::BanChatMember
484    where
485        C: Into<Recipient>,
486    {
487        Self::BanChatMember::new(self.clone(), payloads::BanChatMember::new(chat_id, user_id))
488    }
489
490    type UnbanChatMember = JsonRequest<payloads::UnbanChatMember>;
491
492    fn unban_chat_member<C>(&self, chat_id: C, user_id: UserId) -> Self::UnbanChatMember
493    where
494        C: Into<Recipient>,
495    {
496        Self::UnbanChatMember::new(self.clone(), payloads::UnbanChatMember::new(chat_id, user_id))
497    }
498
499    type RestrictChatMember = JsonRequest<payloads::RestrictChatMember>;
500
501    fn restrict_chat_member<C>(
502        &self,
503        chat_id: C,
504        user_id: UserId,
505        permissions: ChatPermissions,
506    ) -> Self::RestrictChatMember
507    where
508        C: Into<Recipient>,
509    {
510        Self::RestrictChatMember::new(
511            self.clone(),
512            payloads::RestrictChatMember::new(chat_id, user_id, permissions),
513        )
514    }
515
516    type PromoteChatMember = JsonRequest<payloads::PromoteChatMember>;
517
518    fn promote_chat_member<C>(&self, chat_id: C, user_id: UserId) -> Self::PromoteChatMember
519    where
520        C: Into<Recipient>,
521    {
522        Self::PromoteChatMember::new(
523            self.clone(),
524            payloads::PromoteChatMember::new(chat_id, user_id),
525        )
526    }
527
528    type SetChatAdministratorCustomTitle = JsonRequest<payloads::SetChatAdministratorCustomTitle>;
529
530    fn set_chat_administrator_custom_title<Ch, Cu>(
531        &self,
532        chat_id: Ch,
533        user_id: UserId,
534        custom_title: Cu,
535    ) -> Self::SetChatAdministratorCustomTitle
536    where
537        Ch: Into<Recipient>,
538        Cu: Into<String>,
539    {
540        Self::SetChatAdministratorCustomTitle::new(
541            self.clone(),
542            payloads::SetChatAdministratorCustomTitle::new(chat_id, user_id, custom_title),
543        )
544    }
545
546    type SetChatMemberTag = JsonRequest<payloads::SetChatMemberTag>;
547
548    fn set_chat_member_tag<C>(&self, chat_id: C, user_id: UserId) -> Self::SetChatMemberTag
549    where
550        C: Into<Recipient>,
551    {
552        Self::SetChatMemberTag::new(self.clone(), payloads::SetChatMemberTag::new(chat_id, user_id))
553    }
554
555    type BanChatSenderChat = JsonRequest<payloads::BanChatSenderChat>;
556
557    fn ban_chat_sender_chat<C, S>(&self, chat_id: C, sender_chat_id: S) -> Self::BanChatSenderChat
558    where
559        C: Into<Recipient>,
560        S: Into<ChatId>,
561    {
562        Self::BanChatSenderChat::new(
563            self.clone(),
564            payloads::BanChatSenderChat::new(chat_id, sender_chat_id),
565        )
566    }
567
568    type UnbanChatSenderChat = JsonRequest<payloads::UnbanChatSenderChat>;
569
570    fn unban_chat_sender_chat<C, S>(
571        &self,
572        chat_id: C,
573        sender_chat_id: S,
574    ) -> Self::UnbanChatSenderChat
575    where
576        C: Into<Recipient>,
577        S: Into<ChatId>,
578    {
579        Self::UnbanChatSenderChat::new(
580            self.clone(),
581            payloads::UnbanChatSenderChat::new(chat_id, sender_chat_id),
582        )
583    }
584
585    type SetChatPermissions = JsonRequest<payloads::SetChatPermissions>;
586
587    fn set_chat_permissions<C>(
588        &self,
589        chat_id: C,
590        permissions: ChatPermissions,
591    ) -> Self::SetChatPermissions
592    where
593        C: Into<Recipient>,
594    {
595        Self::SetChatPermissions::new(
596            self.clone(),
597            payloads::SetChatPermissions::new(chat_id, permissions),
598        )
599    }
600
601    type ExportChatInviteLink = JsonRequest<payloads::ExportChatInviteLink>;
602
603    fn export_chat_invite_link<C>(&self, chat_id: C) -> Self::ExportChatInviteLink
604    where
605        C: Into<Recipient>,
606    {
607        Self::ExportChatInviteLink::new(self.clone(), payloads::ExportChatInviteLink::new(chat_id))
608    }
609
610    type CreateChatInviteLink = JsonRequest<payloads::CreateChatInviteLink>;
611
612    fn create_chat_invite_link<C>(&self, chat_id: C) -> Self::CreateChatInviteLink
613    where
614        C: Into<Recipient>,
615    {
616        Self::CreateChatInviteLink::new(self.clone(), payloads::CreateChatInviteLink::new(chat_id))
617    }
618
619    type EditChatInviteLink = JsonRequest<payloads::EditChatInviteLink>;
620
621    fn edit_chat_invite_link<C, I>(&self, chat_id: C, invite_link: I) -> Self::EditChatInviteLink
622    where
623        C: Into<Recipient>,
624        I: Into<String>,
625    {
626        Self::EditChatInviteLink::new(
627            self.clone(),
628            payloads::EditChatInviteLink::new(chat_id, invite_link),
629        )
630    }
631
632    type CreateChatSubscriptionInviteLink = JsonRequest<payloads::CreateChatSubscriptionInviteLink>;
633
634    fn create_chat_subscription_invite_link<C>(
635        &self,
636        chat_id: C,
637        subscription_period: Seconds,
638        subscription_price: u32,
639    ) -> Self::CreateChatSubscriptionInviteLink
640    where
641        C: Into<Recipient>,
642    {
643        Self::CreateChatSubscriptionInviteLink::new(
644            self.clone(),
645            payloads::CreateChatSubscriptionInviteLink::new(
646                chat_id,
647                subscription_period,
648                subscription_price,
649            ),
650        )
651    }
652
653    type EditChatSubscriptionInviteLink = JsonRequest<payloads::EditChatSubscriptionInviteLink>;
654
655    fn edit_chat_subscription_invite_link<C, I>(
656        &self,
657        chat_id: C,
658        invite_link: I,
659    ) -> Self::EditChatSubscriptionInviteLink
660    where
661        C: Into<Recipient>,
662        I: Into<String>,
663    {
664        Self::EditChatSubscriptionInviteLink::new(
665            self.clone(),
666            payloads::EditChatSubscriptionInviteLink::new(chat_id, invite_link),
667        )
668    }
669
670    type RevokeChatInviteLink = JsonRequest<payloads::RevokeChatInviteLink>;
671
672    fn revoke_chat_invite_link<C, I>(
673        &self,
674        chat_id: C,
675        invite_link: I,
676    ) -> Self::RevokeChatInviteLink
677    where
678        C: Into<Recipient>,
679        I: Into<String>,
680    {
681        Self::RevokeChatInviteLink::new(
682            self.clone(),
683            payloads::RevokeChatInviteLink::new(chat_id, invite_link),
684        )
685    }
686
687    type ApproveChatJoinRequest = JsonRequest<payloads::ApproveChatJoinRequest>;
688
689    fn approve_chat_join_request<C>(
690        &self,
691        chat_id: C,
692        user_id: UserId,
693    ) -> Self::ApproveChatJoinRequest
694    where
695        C: Into<Recipient>,
696    {
697        Self::ApproveChatJoinRequest::new(
698            self.clone(),
699            payloads::ApproveChatJoinRequest::new(chat_id, user_id),
700        )
701    }
702
703    type DeclineChatJoinRequest = JsonRequest<payloads::DeclineChatJoinRequest>;
704
705    fn decline_chat_join_request<C>(
706        &self,
707        chat_id: C,
708        user_id: UserId,
709    ) -> Self::DeclineChatJoinRequest
710    where
711        C: Into<Recipient>,
712    {
713        Self::DeclineChatJoinRequest::new(
714            self.clone(),
715            payloads::DeclineChatJoinRequest::new(chat_id, user_id),
716        )
717    }
718
719    type AnswerChatJoinRequestQuery = JsonRequest<payloads::AnswerChatJoinRequestQuery>;
720
721    fn answer_chat_join_request_query<C, R>(
722        &self,
723        chat_join_request_query_id: C,
724        result: R,
725    ) -> Self::AnswerChatJoinRequestQuery
726    where
727        C: Into<String>,
728        R: Into<String>,
729    {
730        Self::AnswerChatJoinRequestQuery::new(
731            self.clone(),
732            payloads::AnswerChatJoinRequestQuery::new(chat_join_request_query_id, result),
733        )
734    }
735
736    type SendChatJoinRequestWebApp = JsonRequest<payloads::SendChatJoinRequestWebApp>;
737
738    fn send_chat_join_request_web_app<C, W>(
739        &self,
740        chat_join_request_query_id: C,
741        web_app_url: W,
742    ) -> Self::SendChatJoinRequestWebApp
743    where
744        C: Into<String>,
745        W: Into<String>,
746    {
747        Self::SendChatJoinRequestWebApp::new(
748            self.clone(),
749            payloads::SendChatJoinRequestWebApp::new(chat_join_request_query_id, web_app_url),
750        )
751    }
752
753    type SetChatPhoto = MultipartRequest<payloads::SetChatPhoto>;
754
755    fn set_chat_photo<C>(&self, chat_id: C, photo: InputFile) -> Self::SetChatPhoto
756    where
757        C: Into<Recipient>,
758    {
759        Self::SetChatPhoto::new(self.clone(), payloads::SetChatPhoto::new(chat_id, photo))
760    }
761
762    type DeleteChatPhoto = JsonRequest<payloads::DeleteChatPhoto>;
763
764    fn delete_chat_photo<C>(&self, chat_id: C) -> Self::DeleteChatPhoto
765    where
766        C: Into<Recipient>,
767    {
768        Self::DeleteChatPhoto::new(self.clone(), payloads::DeleteChatPhoto::new(chat_id))
769    }
770
771    type SetChatTitle = JsonRequest<payloads::SetChatTitle>;
772
773    fn set_chat_title<C, T>(&self, chat_id: C, title: T) -> Self::SetChatTitle
774    where
775        C: Into<Recipient>,
776        T: Into<String>,
777    {
778        Self::SetChatTitle::new(self.clone(), payloads::SetChatTitle::new(chat_id, title))
779    }
780
781    type SetChatDescription = JsonRequest<payloads::SetChatDescription>;
782
783    fn set_chat_description<C>(&self, chat_id: C) -> Self::SetChatDescription
784    where
785        C: Into<Recipient>,
786    {
787        Self::SetChatDescription::new(self.clone(), payloads::SetChatDescription::new(chat_id))
788    }
789
790    type PinChatMessage = JsonRequest<payloads::PinChatMessage>;
791
792    fn pin_chat_message<C>(&self, chat_id: C, message_id: MessageId) -> Self::PinChatMessage
793    where
794        C: Into<Recipient>,
795    {
796        Self::PinChatMessage::new(self.clone(), payloads::PinChatMessage::new(chat_id, message_id))
797    }
798
799    type UnpinChatMessage = JsonRequest<payloads::UnpinChatMessage>;
800
801    fn unpin_chat_message<C>(&self, chat_id: C) -> Self::UnpinChatMessage
802    where
803        C: Into<Recipient>,
804    {
805        Self::UnpinChatMessage::new(self.clone(), payloads::UnpinChatMessage::new(chat_id))
806    }
807
808    type LeaveChat = JsonRequest<payloads::LeaveChat>;
809
810    fn leave_chat<C>(&self, chat_id: C) -> Self::LeaveChat
811    where
812        C: Into<Recipient>,
813    {
814        Self::LeaveChat::new(self.clone(), payloads::LeaveChat::new(chat_id))
815    }
816
817    type GetChat = JsonRequest<payloads::GetChat>;
818
819    fn get_chat<C>(&self, chat_id: C) -> Self::GetChat
820    where
821        C: Into<Recipient>,
822    {
823        Self::GetChat::new(self.clone(), payloads::GetChat::new(chat_id))
824    }
825
826    type GetChatAdministrators = JsonRequest<payloads::GetChatAdministrators>;
827
828    fn get_chat_administrators<C>(&self, chat_id: C) -> Self::GetChatAdministrators
829    where
830        C: Into<Recipient>,
831    {
832        Self::GetChatAdministrators::new(
833            self.clone(),
834            payloads::GetChatAdministrators::new(chat_id),
835        )
836    }
837
838    type GetChatMembersCount = JsonRequest<payloads::GetChatMembersCount>;
839
840    fn get_chat_members_count<C>(&self, chat_id: C) -> Self::GetChatMembersCount
841    where
842        C: Into<Recipient>,
843    {
844        Self::GetChatMembersCount::new(self.clone(), payloads::GetChatMembersCount::new(chat_id))
845    }
846
847    type GetChatMemberCount = JsonRequest<payloads::GetChatMemberCount>;
848
849    fn get_chat_member_count<C>(&self, chat_id: C) -> Self::GetChatMemberCount
850    where
851        C: Into<Recipient>,
852    {
853        Self::GetChatMemberCount::new(self.clone(), payloads::GetChatMemberCount::new(chat_id))
854    }
855
856    type GetChatMember = JsonRequest<payloads::GetChatMember>;
857
858    fn get_chat_member<C>(&self, chat_id: C, user_id: UserId) -> Self::GetChatMember
859    where
860        C: Into<Recipient>,
861    {
862        Self::GetChatMember::new(self.clone(), payloads::GetChatMember::new(chat_id, user_id))
863    }
864
865    type SetChatStickerSet = JsonRequest<payloads::SetChatStickerSet>;
866
867    fn set_chat_sticker_set<C, S>(&self, chat_id: C, sticker_set_name: S) -> Self::SetChatStickerSet
868    where
869        C: Into<Recipient>,
870        S: Into<String>,
871    {
872        Self::SetChatStickerSet::new(
873            self.clone(),
874            payloads::SetChatStickerSet::new(chat_id, sticker_set_name),
875        )
876    }
877
878    type DeleteChatStickerSet = JsonRequest<payloads::DeleteChatStickerSet>;
879
880    fn delete_chat_sticker_set<C>(&self, chat_id: C) -> Self::DeleteChatStickerSet
881    where
882        C: Into<Recipient>,
883    {
884        Self::DeleteChatStickerSet::new(self.clone(), payloads::DeleteChatStickerSet::new(chat_id))
885    }
886
887    type GetForumTopicIconStickers = JsonRequest<payloads::GetForumTopicIconStickers>;
888
889    fn get_forum_topic_icon_stickers(&self) -> Self::GetForumTopicIconStickers {
890        Self::GetForumTopicIconStickers::new(
891            self.clone(),
892            payloads::GetForumTopicIconStickers::new(),
893        )
894    }
895
896    type CreateForumTopic = JsonRequest<payloads::CreateForumTopic>;
897
898    fn create_forum_topic<C, N>(&self, chat_id: C, name: N) -> Self::CreateForumTopic
899    where
900        C: Into<Recipient>,
901        N: Into<String>,
902    {
903        Self::CreateForumTopic::new(self.clone(), payloads::CreateForumTopic::new(chat_id, name))
904    }
905
906    type EditForumTopic = JsonRequest<payloads::EditForumTopic>;
907
908    fn edit_forum_topic<C>(&self, chat_id: C, message_thread_id: ThreadId) -> Self::EditForumTopic
909    where
910        C: Into<Recipient>,
911    {
912        Self::EditForumTopic::new(
913            self.clone(),
914            payloads::EditForumTopic::new(chat_id, message_thread_id),
915        )
916    }
917
918    type CloseForumTopic = JsonRequest<payloads::CloseForumTopic>;
919
920    fn close_forum_topic<C>(&self, chat_id: C, message_thread_id: ThreadId) -> Self::CloseForumTopic
921    where
922        C: Into<Recipient>,
923    {
924        Self::CloseForumTopic::new(
925            self.clone(),
926            payloads::CloseForumTopic::new(chat_id, message_thread_id),
927        )
928    }
929
930    type ReopenForumTopic = JsonRequest<payloads::ReopenForumTopic>;
931
932    fn reopen_forum_topic<C>(
933        &self,
934        chat_id: C,
935        message_thread_id: ThreadId,
936    ) -> Self::ReopenForumTopic
937    where
938        C: Into<Recipient>,
939    {
940        Self::ReopenForumTopic::new(
941            self.clone(),
942            payloads::ReopenForumTopic::new(chat_id, message_thread_id),
943        )
944    }
945
946    type DeleteForumTopic = JsonRequest<payloads::DeleteForumTopic>;
947
948    fn delete_forum_topic<C>(
949        &self,
950        chat_id: C,
951        message_thread_id: ThreadId,
952    ) -> Self::DeleteForumTopic
953    where
954        C: Into<Recipient>,
955    {
956        Self::DeleteForumTopic::new(
957            self.clone(),
958            payloads::DeleteForumTopic::new(chat_id, message_thread_id),
959        )
960    }
961
962    type UnpinAllForumTopicMessages = JsonRequest<payloads::UnpinAllForumTopicMessages>;
963
964    fn unpin_all_forum_topic_messages<C>(
965        &self,
966        chat_id: C,
967        message_thread_id: ThreadId,
968    ) -> Self::UnpinAllForumTopicMessages
969    where
970        C: Into<Recipient>,
971    {
972        Self::UnpinAllForumTopicMessages::new(
973            self.clone(),
974            payloads::UnpinAllForumTopicMessages::new(chat_id, message_thread_id),
975        )
976    }
977
978    type EditGeneralForumTopic = JsonRequest<payloads::EditGeneralForumTopic>;
979
980    fn edit_general_forum_topic<C, N>(&self, chat_id: C, name: N) -> Self::EditGeneralForumTopic
981    where
982        C: Into<Recipient>,
983        N: Into<String>,
984    {
985        Self::EditGeneralForumTopic::new(
986            self.clone(),
987            payloads::EditGeneralForumTopic::new(chat_id, name),
988        )
989    }
990
991    type CloseGeneralForumTopic = JsonRequest<payloads::CloseGeneralForumTopic>;
992
993    fn close_general_forum_topic<C>(&self, chat_id: C) -> Self::CloseGeneralForumTopic
994    where
995        C: Into<Recipient>,
996    {
997        Self::CloseGeneralForumTopic::new(
998            self.clone(),
999            payloads::CloseGeneralForumTopic::new(chat_id),
1000        )
1001    }
1002
1003    type ReopenGeneralForumTopic = JsonRequest<payloads::ReopenGeneralForumTopic>;
1004
1005    fn reopen_general_forum_topic<C>(&self, chat_id: C) -> Self::ReopenGeneralForumTopic
1006    where
1007        C: Into<Recipient>,
1008    {
1009        Self::ReopenGeneralForumTopic::new(
1010            self.clone(),
1011            payloads::ReopenGeneralForumTopic::new(chat_id),
1012        )
1013    }
1014
1015    type HideGeneralForumTopic = JsonRequest<payloads::HideGeneralForumTopic>;
1016
1017    fn hide_general_forum_topic<C>(&self, chat_id: C) -> Self::HideGeneralForumTopic
1018    where
1019        C: Into<Recipient>,
1020    {
1021        Self::HideGeneralForumTopic::new(
1022            self.clone(),
1023            payloads::HideGeneralForumTopic::new(chat_id),
1024        )
1025    }
1026
1027    type UnhideGeneralForumTopic = JsonRequest<payloads::UnhideGeneralForumTopic>;
1028
1029    fn unhide_general_forum_topic<C>(&self, chat_id: C) -> Self::UnhideGeneralForumTopic
1030    where
1031        C: Into<Recipient>,
1032    {
1033        Self::UnhideGeneralForumTopic::new(
1034            self.clone(),
1035            payloads::UnhideGeneralForumTopic::new(chat_id),
1036        )
1037    }
1038
1039    type UnpinAllGeneralForumTopicMessages =
1040        JsonRequest<payloads::UnpinAllGeneralForumTopicMessages>;
1041
1042    fn unpin_all_general_forum_topic_messages<C>(
1043        &self,
1044        chat_id: C,
1045    ) -> Self::UnpinAllGeneralForumTopicMessages
1046    where
1047        C: Into<Recipient>,
1048    {
1049        Self::UnpinAllGeneralForumTopicMessages::new(
1050            self.clone(),
1051            payloads::UnpinAllGeneralForumTopicMessages::new(chat_id),
1052        )
1053    }
1054
1055    type AnswerCallbackQuery = JsonRequest<payloads::AnswerCallbackQuery>;
1056
1057    fn answer_callback_query(
1058        &self,
1059        callback_query_id: CallbackQueryId,
1060    ) -> Self::AnswerCallbackQuery {
1061        Self::AnswerCallbackQuery::new(
1062            self.clone(),
1063            payloads::AnswerCallbackQuery::new(callback_query_id),
1064        )
1065    }
1066
1067    type GetUserChatBoosts = JsonRequest<payloads::GetUserChatBoosts>;
1068
1069    fn get_user_chat_boosts<C>(&self, chat_id: C, user_id: UserId) -> Self::GetUserChatBoosts
1070    where
1071        C: Into<Recipient>,
1072    {
1073        Self::GetUserChatBoosts::new(
1074            self.clone(),
1075            payloads::GetUserChatBoosts::new(chat_id, user_id),
1076        )
1077    }
1078
1079    type SetMyCommands = JsonRequest<payloads::SetMyCommands>;
1080
1081    fn set_my_commands<C>(&self, commands: C) -> Self::SetMyCommands
1082    where
1083        C: IntoIterator<Item = BotCommand>,
1084    {
1085        Self::SetMyCommands::new(self.clone(), payloads::SetMyCommands::new(commands))
1086    }
1087
1088    type GetBusinessConnection = JsonRequest<payloads::GetBusinessConnection>;
1089
1090    fn get_business_connection(
1091        &self,
1092        business_connection_id: BusinessConnectionId,
1093    ) -> Self::GetBusinessConnection {
1094        Self::GetBusinessConnection::new(
1095            self.clone(),
1096            payloads::GetBusinessConnection::new(business_connection_id),
1097        )
1098    }
1099
1100    type GetMyCommands = JsonRequest<payloads::GetMyCommands>;
1101
1102    fn get_my_commands(&self) -> Self::GetMyCommands {
1103        Self::GetMyCommands::new(self.clone(), payloads::GetMyCommands::new())
1104    }
1105
1106    type SetMyName = JsonRequest<payloads::SetMyName>;
1107
1108    fn set_my_name(&self) -> Self::SetMyName {
1109        Self::SetMyName::new(self.clone(), payloads::SetMyName::new())
1110    }
1111
1112    type GetMyName = JsonRequest<payloads::GetMyName>;
1113
1114    fn get_my_name(&self) -> Self::GetMyName {
1115        Self::GetMyName::new(self.clone(), payloads::GetMyName::new())
1116    }
1117
1118    type SetMyDescription = JsonRequest<payloads::SetMyDescription>;
1119
1120    fn set_my_description(&self) -> Self::SetMyDescription {
1121        Self::SetMyDescription::new(self.clone(), payloads::SetMyDescription::new())
1122    }
1123
1124    type GetMyDescription = JsonRequest<payloads::GetMyDescription>;
1125
1126    fn get_my_description(&self) -> Self::GetMyDescription {
1127        Self::GetMyDescription::new(self.clone(), payloads::GetMyDescription::new())
1128    }
1129
1130    type SetMyShortDescription = JsonRequest<payloads::SetMyShortDescription>;
1131
1132    fn set_my_short_description(&self) -> Self::SetMyShortDescription {
1133        Self::SetMyShortDescription::new(self.clone(), payloads::SetMyShortDescription::new())
1134    }
1135
1136    type GetMyShortDescription = JsonRequest<payloads::GetMyShortDescription>;
1137    fn get_my_short_description(&self) -> Self::GetMyShortDescription {
1138        Self::GetMyShortDescription::new(self.clone(), payloads::GetMyShortDescription::new())
1139    }
1140
1141    type SetMyProfilePhoto = JsonRequest<payloads::SetMyProfilePhoto>;
1142
1143    fn set_my_profile_photo(&self, photo: InputProfilePhoto) -> Self::SetMyProfilePhoto {
1144        Self::SetMyProfilePhoto::new(self.clone(), payloads::SetMyProfilePhoto::new(photo))
1145    }
1146
1147    type RemoveMyProfilePhoto = JsonRequest<payloads::RemoveMyProfilePhoto>;
1148
1149    fn remove_my_profile_photo(&self) -> Self::RemoveMyProfilePhoto {
1150        Self::RemoveMyProfilePhoto::new(self.clone(), payloads::RemoveMyProfilePhoto::new())
1151    }
1152
1153    type GetManagedBotToken = JsonRequest<payloads::GetManagedBotToken>;
1154
1155    fn get_managed_bot_token(&self, user_id: UserId) -> Self::GetManagedBotToken {
1156        Self::GetManagedBotToken::new(self.clone(), payloads::GetManagedBotToken::new(user_id))
1157    }
1158
1159    type ReplaceManagedBotToken = JsonRequest<payloads::ReplaceManagedBotToken>;
1160
1161    fn replace_managed_bot_token(&self, user_id: UserId) -> Self::ReplaceManagedBotToken {
1162        Self::ReplaceManagedBotToken::new(
1163            self.clone(),
1164            payloads::ReplaceManagedBotToken::new(user_id),
1165        )
1166    }
1167
1168    type SavePreparedKeyboardButton = JsonRequest<payloads::SavePreparedKeyboardButton>;
1169
1170    fn save_prepared_keyboard_button(
1171        &self,
1172        user_id: UserId,
1173        button: KeyboardButton,
1174    ) -> Self::SavePreparedKeyboardButton {
1175        Self::SavePreparedKeyboardButton::new(
1176            self.clone(),
1177            payloads::SavePreparedKeyboardButton::new(user_id, button),
1178        )
1179    }
1180
1181    type GetManagedBotAccessSettings = JsonRequest<payloads::GetManagedBotAccessSettings>;
1182
1183    fn get_managed_bot_access_settings(
1184        &self,
1185        user_id: UserId,
1186    ) -> Self::GetManagedBotAccessSettings {
1187        Self::GetManagedBotAccessSettings::new(
1188            self.clone(),
1189            payloads::GetManagedBotAccessSettings::new(user_id),
1190        )
1191    }
1192
1193    type SetManagedBotAccessSettings = JsonRequest<payloads::SetManagedBotAccessSettings>;
1194
1195    fn set_managed_bot_access_settings(
1196        &self,
1197        user_id: UserId,
1198        is_access_restricted: bool,
1199    ) -> Self::SetManagedBotAccessSettings {
1200        Self::SetManagedBotAccessSettings::new(
1201            self.clone(),
1202            payloads::SetManagedBotAccessSettings::new(user_id, is_access_restricted),
1203        )
1204    }
1205
1206    type GetUserPersonalChatMessages = JsonRequest<payloads::GetUserPersonalChatMessages>;
1207
1208    fn get_user_personal_chat_messages(
1209        &self,
1210        user_id: UserId,
1211        limit: u8,
1212    ) -> Self::GetUserPersonalChatMessages {
1213        Self::GetUserPersonalChatMessages::new(
1214            self.clone(),
1215            payloads::GetUserPersonalChatMessages::new(user_id, limit),
1216        )
1217    }
1218
1219    type AnswerGuestQuery = JsonRequest<payloads::AnswerGuestQuery>;
1220
1221    fn answer_guest_query(
1222        &self,
1223        guest_query_id: GuestQueryId,
1224        result: InlineQueryResult,
1225    ) -> Self::AnswerGuestQuery {
1226        Self::AnswerGuestQuery::new(
1227            self.clone(),
1228            payloads::AnswerGuestQuery::new(guest_query_id, result),
1229        )
1230    }
1231
1232    type DeleteMessageReaction = JsonRequest<payloads::DeleteMessageReaction>;
1233
1234    fn delete_message_reaction<C>(&self, chat_id: C, message_id: i32) -> Self::DeleteMessageReaction
1235    where
1236        C: Into<Recipient>,
1237    {
1238        Self::DeleteMessageReaction::new(
1239            self.clone(),
1240            payloads::DeleteMessageReaction::new(chat_id, message_id),
1241        )
1242    }
1243
1244    type DeleteAllMessageReactions = JsonRequest<payloads::DeleteAllMessageReactions>;
1245
1246    fn delete_all_message_reactions<C>(&self, chat_id: C) -> Self::DeleteAllMessageReactions
1247    where
1248        C: Into<Recipient>,
1249    {
1250        Self::DeleteAllMessageReactions::new(
1251            self.clone(),
1252            payloads::DeleteAllMessageReactions::new(chat_id),
1253        )
1254    }
1255
1256    type SetChatMenuButton = JsonRequest<payloads::SetChatMenuButton>;
1257
1258    fn set_chat_menu_button(&self) -> Self::SetChatMenuButton {
1259        Self::SetChatMenuButton::new(self.clone(), payloads::SetChatMenuButton::new())
1260    }
1261
1262    type GetChatMenuButton = JsonRequest<payloads::GetChatMenuButton>;
1263
1264    fn get_chat_menu_button(&self) -> Self::GetChatMenuButton {
1265        Self::GetChatMenuButton::new(self.clone(), payloads::GetChatMenuButton::new())
1266    }
1267
1268    type SetMyDefaultAdministratorRights = JsonRequest<payloads::SetMyDefaultAdministratorRights>;
1269
1270    fn set_my_default_administrator_rights(&self) -> Self::SetMyDefaultAdministratorRights {
1271        Self::SetMyDefaultAdministratorRights::new(
1272            self.clone(),
1273            payloads::SetMyDefaultAdministratorRights::new(),
1274        )
1275    }
1276
1277    type GetMyDefaultAdministratorRights = JsonRequest<payloads::GetMyDefaultAdministratorRights>;
1278
1279    fn get_my_default_administrator_rights(&self) -> Self::GetMyDefaultAdministratorRights {
1280        Self::GetMyDefaultAdministratorRights::new(
1281            self.clone(),
1282            payloads::GetMyDefaultAdministratorRights::new(),
1283        )
1284    }
1285
1286    type DeleteMyCommands = JsonRequest<payloads::DeleteMyCommands>;
1287
1288    fn delete_my_commands(&self) -> Self::DeleteMyCommands {
1289        Self::DeleteMyCommands::new(self.clone(), payloads::DeleteMyCommands::new())
1290    }
1291
1292    type AnswerInlineQuery = JsonRequest<payloads::AnswerInlineQuery>;
1293
1294    fn answer_inline_query<R>(
1295        &self,
1296        inline_query_id: InlineQueryId,
1297        results: R,
1298    ) -> Self::AnswerInlineQuery
1299    where
1300        R: IntoIterator<Item = InlineQueryResult>,
1301    {
1302        Self::AnswerInlineQuery::new(
1303            self.clone(),
1304            payloads::AnswerInlineQuery::new(inline_query_id, results),
1305        )
1306    }
1307
1308    type AnswerWebAppQuery = JsonRequest<payloads::AnswerWebAppQuery>;
1309
1310    fn answer_web_app_query<W>(
1311        &self,
1312        web_app_query_id: W,
1313        result: InlineQueryResult,
1314    ) -> Self::AnswerWebAppQuery
1315    where
1316        W: Into<String>,
1317    {
1318        Self::AnswerWebAppQuery::new(
1319            self.clone(),
1320            payloads::AnswerWebAppQuery::new(web_app_query_id, result),
1321        )
1322    }
1323
1324    type SavePreparedInlineMessage = JsonRequest<payloads::SavePreparedInlineMessage>;
1325
1326    fn save_prepared_inline_message(
1327        &self,
1328        user_id: UserId,
1329        result: InlineQueryResult,
1330    ) -> Self::SavePreparedInlineMessage {
1331        Self::SavePreparedInlineMessage::new(
1332            self.clone(),
1333            payloads::SavePreparedInlineMessage::new(user_id, result),
1334        )
1335    }
1336
1337    type EditMessageText = JsonRequest<payloads::EditMessageText>;
1338
1339    fn edit_message_text<C, T>(
1340        &self,
1341        chat_id: C,
1342        message_id: MessageId,
1343        text: T,
1344    ) -> Self::EditMessageText
1345    where
1346        C: Into<Recipient>,
1347        T: Into<String>,
1348    {
1349        Self::EditMessageText::new(
1350            self.clone(),
1351            payloads::EditMessageText::new(chat_id, message_id, text),
1352        )
1353    }
1354
1355    type EditMessageTextInline = JsonRequest<payloads::EditMessageTextInline>;
1356
1357    fn edit_message_text_inline<I, T>(
1358        &self,
1359        inline_message_id: I,
1360        text: T,
1361    ) -> Self::EditMessageTextInline
1362    where
1363        I: Into<String>,
1364        T: Into<String>,
1365    {
1366        Self::EditMessageTextInline::new(
1367            self.clone(),
1368            payloads::EditMessageTextInline::new(inline_message_id, text),
1369        )
1370    }
1371
1372    type EditMessageCaption = JsonRequest<payloads::EditMessageCaption>;
1373
1374    fn edit_message_caption<C>(&self, chat_id: C, message_id: MessageId) -> Self::EditMessageCaption
1375    where
1376        C: Into<Recipient>,
1377    {
1378        Self::EditMessageCaption::new(
1379            self.clone(),
1380            payloads::EditMessageCaption::new(chat_id, message_id),
1381        )
1382    }
1383
1384    type EditMessageCaptionInline = JsonRequest<payloads::EditMessageCaptionInline>;
1385
1386    fn edit_message_caption_inline<I>(&self, inline_message_id: I) -> Self::EditMessageCaptionInline
1387    where
1388        I: Into<String>,
1389    {
1390        Self::EditMessageCaptionInline::new(
1391            self.clone(),
1392            payloads::EditMessageCaptionInline::new(inline_message_id),
1393        )
1394    }
1395
1396    type EditMessageMedia = MultipartRequest<payloads::EditMessageMedia>;
1397
1398    fn edit_message_media<C>(
1399        &self,
1400        chat_id: C,
1401        message_id: MessageId,
1402        media: InputMedia,
1403    ) -> Self::EditMessageMedia
1404    where
1405        C: Into<Recipient>,
1406    {
1407        Self::EditMessageMedia::new(
1408            self.clone(),
1409            payloads::EditMessageMedia::new(chat_id, message_id, media),
1410        )
1411    }
1412
1413    type EditMessageMediaInline = MultipartRequest<payloads::EditMessageMediaInline>;
1414
1415    fn edit_message_media_inline<I>(
1416        &self,
1417        inline_message_id: I,
1418        media: InputMedia,
1419    ) -> Self::EditMessageMediaInline
1420    where
1421        I: Into<String>,
1422    {
1423        Self::EditMessageMediaInline::new(
1424            self.clone(),
1425            payloads::EditMessageMediaInline::new(inline_message_id, media),
1426        )
1427    }
1428
1429    type EditMessageReplyMarkup = JsonRequest<payloads::EditMessageReplyMarkup>;
1430
1431    fn edit_message_reply_markup<C>(
1432        &self,
1433        chat_id: C,
1434        message_id: MessageId,
1435    ) -> Self::EditMessageReplyMarkup
1436    where
1437        C: Into<Recipient>,
1438    {
1439        Self::EditMessageReplyMarkup::new(
1440            self.clone(),
1441            payloads::EditMessageReplyMarkup::new(chat_id, message_id),
1442        )
1443    }
1444
1445    type EditMessageReplyMarkupInline = JsonRequest<payloads::EditMessageReplyMarkupInline>;
1446
1447    fn edit_message_reply_markup_inline<I>(
1448        &self,
1449        inline_message_id: I,
1450    ) -> Self::EditMessageReplyMarkupInline
1451    where
1452        I: Into<String>,
1453    {
1454        Self::EditMessageReplyMarkupInline::new(
1455            self.clone(),
1456            payloads::EditMessageReplyMarkupInline::new(inline_message_id),
1457        )
1458    }
1459
1460    type StopPoll = JsonRequest<payloads::StopPoll>;
1461
1462    fn stop_poll<C>(&self, chat_id: C, message_id: MessageId) -> Self::StopPoll
1463    where
1464        C: Into<Recipient>,
1465    {
1466        Self::StopPoll::new(self.clone(), payloads::StopPoll::new(chat_id, message_id))
1467    }
1468
1469    type ApproveSuggestedPost = JsonRequest<payloads::ApproveSuggestedPost>;
1470
1471    fn approve_suggested_post<C>(
1472        &self,
1473        chat_id: C,
1474        message_id: MessageId,
1475    ) -> Self::ApproveSuggestedPost
1476    where
1477        C: Into<ChatId>,
1478    {
1479        Self::ApproveSuggestedPost::new(
1480            self.clone(),
1481            payloads::ApproveSuggestedPost::new(chat_id, message_id),
1482        )
1483    }
1484
1485    type DeclineSuggestedPost = JsonRequest<payloads::DeclineSuggestedPost>;
1486
1487    fn decline_suggested_post<C>(
1488        &self,
1489        chat_id: C,
1490        message_id: MessageId,
1491    ) -> Self::DeclineSuggestedPost
1492    where
1493        C: Into<ChatId>,
1494    {
1495        Self::DeclineSuggestedPost::new(
1496            self.clone(),
1497            payloads::DeclineSuggestedPost::new(chat_id, message_id),
1498        )
1499    }
1500
1501    type DeleteMessage = JsonRequest<payloads::DeleteMessage>;
1502
1503    fn delete_message<C>(&self, chat_id: C, message_id: MessageId) -> Self::DeleteMessage
1504    where
1505        C: Into<Recipient>,
1506    {
1507        Self::DeleteMessage::new(self.clone(), payloads::DeleteMessage::new(chat_id, message_id))
1508    }
1509
1510    type DeleteMessages = JsonRequest<payloads::DeleteMessages>;
1511    fn delete_messages<C, M>(&self, chat_id: C, message_ids: M) -> Self::DeleteMessages
1512    where
1513        C: Into<Recipient>,
1514        M: IntoIterator<Item = MessageId>,
1515    {
1516        Self::DeleteMessages::new(self.clone(), payloads::DeleteMessages::new(chat_id, message_ids))
1517    }
1518
1519    type SendSticker = MultipartRequest<payloads::SendSticker>;
1520
1521    fn send_sticker<C>(&self, chat_id: C, sticker: InputFile) -> Self::SendSticker
1522    where
1523        C: Into<Recipient>,
1524    {
1525        Self::SendSticker::new(self.clone(), payloads::SendSticker::new(chat_id, sticker))
1526    }
1527
1528    type GetStickerSet = JsonRequest<payloads::GetStickerSet>;
1529
1530    fn get_sticker_set<N>(&self, name: N) -> Self::GetStickerSet
1531    where
1532        N: Into<String>,
1533    {
1534        Self::GetStickerSet::new(self.clone(), payloads::GetStickerSet::new(name))
1535    }
1536
1537    type GetCustomEmojiStickers = JsonRequest<payloads::GetCustomEmojiStickers>;
1538
1539    fn get_custom_emoji_stickers<C>(&self, custom_emoji_ids: C) -> Self::GetCustomEmojiStickers
1540    where
1541        C: IntoIterator<Item = CustomEmojiId>,
1542    {
1543        Self::GetCustomEmojiStickers::new(
1544            self.clone(),
1545            payloads::GetCustomEmojiStickers::new(custom_emoji_ids),
1546        )
1547    }
1548
1549    type UploadStickerFile = MultipartRequest<payloads::UploadStickerFile>;
1550
1551    fn upload_sticker_file(
1552        &self,
1553        user_id: UserId,
1554        sticker: InputFile,
1555        sticker_format: StickerFormat,
1556    ) -> Self::UploadStickerFile {
1557        Self::UploadStickerFile::new(
1558            self.clone(),
1559            payloads::UploadStickerFile::new(user_id, sticker, sticker_format),
1560        )
1561    }
1562
1563    type CreateNewStickerSet = MultipartRequest<payloads::CreateNewStickerSet>;
1564
1565    fn create_new_sticker_set<N, T, S>(
1566        &self,
1567        user_id: UserId,
1568        name: N,
1569        title: T,
1570        stickers: S,
1571    ) -> Self::CreateNewStickerSet
1572    where
1573        N: Into<String>,
1574        T: Into<String>,
1575        S: IntoIterator<Item = InputSticker>,
1576    {
1577        Self::CreateNewStickerSet::new(
1578            self.clone(),
1579            payloads::CreateNewStickerSet::new(user_id, name, title, stickers),
1580        )
1581    }
1582
1583    type AddStickerToSet = MultipartRequest<payloads::AddStickerToSet>;
1584
1585    fn add_sticker_to_set<N>(
1586        &self,
1587        user_id: UserId,
1588        name: N,
1589        sticker: InputSticker,
1590    ) -> Self::AddStickerToSet
1591    where
1592        N: Into<String>,
1593    {
1594        Self::AddStickerToSet::new(
1595            self.clone(),
1596            payloads::AddStickerToSet::new(user_id, name, sticker),
1597        )
1598    }
1599
1600    type SetStickerPositionInSet = JsonRequest<payloads::SetStickerPositionInSet>;
1601
1602    fn set_sticker_position_in_set<S>(
1603        &self,
1604        sticker: S,
1605        position: u32,
1606    ) -> Self::SetStickerPositionInSet
1607    where
1608        S: Into<String>,
1609    {
1610        Self::SetStickerPositionInSet::new(
1611            self.clone(),
1612            payloads::SetStickerPositionInSet::new(sticker, position),
1613        )
1614    }
1615
1616    type DeleteStickerFromSet = JsonRequest<payloads::DeleteStickerFromSet>;
1617
1618    fn delete_sticker_from_set<S>(&self, sticker: S) -> Self::DeleteStickerFromSet
1619    where
1620        S: Into<String>,
1621    {
1622        Self::DeleteStickerFromSet::new(self.clone(), payloads::DeleteStickerFromSet::new(sticker))
1623    }
1624
1625    type ReplaceStickerInSet = JsonRequest<payloads::ReplaceStickerInSet>;
1626
1627    fn replace_sticker_in_set<N, O>(
1628        &self,
1629        user_id: UserId,
1630        name: N,
1631        old_sticker: O,
1632        sticker: InputSticker,
1633    ) -> Self::ReplaceStickerInSet
1634    where
1635        N: Into<String>,
1636        O: Into<String>,
1637    {
1638        Self::ReplaceStickerInSet::new(
1639            self.clone(),
1640            payloads::ReplaceStickerInSet {
1641                user_id,
1642                name: name.into(),
1643                old_sticker: old_sticker.into(),
1644                sticker,
1645            },
1646        )
1647    }
1648
1649    type SetStickerSetThumbnail = MultipartRequest<payloads::SetStickerSetThumbnail>;
1650
1651    fn set_sticker_set_thumbnail<N>(
1652        &self,
1653        name: N,
1654        user_id: UserId,
1655        format: StickerFormat,
1656    ) -> Self::SetStickerSetThumbnail
1657    where
1658        N: Into<String>,
1659    {
1660        Self::SetStickerSetThumbnail::new(
1661            self.clone(),
1662            payloads::SetStickerSetThumbnail::new(name, user_id, format),
1663        )
1664    }
1665
1666    type SetCustomEmojiStickerSetThumbnail =
1667        JsonRequest<payloads::SetCustomEmojiStickerSetThumbnail>;
1668
1669    fn set_custom_emoji_sticker_set_thumbnail<N>(
1670        &self,
1671        name: N,
1672    ) -> Self::SetCustomEmojiStickerSetThumbnail
1673    where
1674        N: Into<String>,
1675    {
1676        Self::SetCustomEmojiStickerSetThumbnail::new(
1677            self.clone(),
1678            payloads::SetCustomEmojiStickerSetThumbnail::new(name),
1679        )
1680    }
1681
1682    type SetStickerSetTitle = JsonRequest<payloads::SetStickerSetTitle>;
1683
1684    fn set_sticker_set_title<N, T>(&self, name: N, title: T) -> Self::SetStickerSetTitle
1685    where
1686        N: Into<String>,
1687        T: Into<String>,
1688    {
1689        Self::SetStickerSetTitle::new(self.clone(), payloads::SetStickerSetTitle::new(name, title))
1690    }
1691
1692    type DeleteStickerSet = JsonRequest<payloads::DeleteStickerSet>;
1693
1694    fn delete_sticker_set<N>(&self, name: N) -> Self::DeleteStickerSet
1695    where
1696        N: Into<String>,
1697    {
1698        Self::DeleteStickerSet::new(self.clone(), payloads::DeleteStickerSet::new(name))
1699    }
1700
1701    type SetStickerEmojiList = JsonRequest<payloads::SetStickerEmojiList>;
1702
1703    fn set_sticker_emoji_list<S, E>(&self, sticker: S, emoji_list: E) -> Self::SetStickerEmojiList
1704    where
1705        S: Into<String>,
1706        E: IntoIterator<Item = String>,
1707    {
1708        Self::SetStickerEmojiList::new(
1709            self.clone(),
1710            payloads::SetStickerEmojiList::new(sticker, emoji_list),
1711        )
1712    }
1713
1714    type SetStickerKeywords = JsonRequest<payloads::SetStickerKeywords>;
1715
1716    fn set_sticker_keywords<S>(&self, sticker: S) -> Self::SetStickerKeywords
1717    where
1718        S: Into<String>,
1719    {
1720        Self::SetStickerKeywords::new(self.clone(), payloads::SetStickerKeywords::new(sticker))
1721    }
1722
1723    type SetStickerMaskPosition = JsonRequest<payloads::SetStickerMaskPosition>;
1724
1725    fn set_sticker_mask_position<S>(&self, sticker: S) -> Self::SetStickerMaskPosition
1726    where
1727        S: Into<String>,
1728    {
1729        Self::SetStickerMaskPosition::new(
1730            self.clone(),
1731            payloads::SetStickerMaskPosition::new(sticker),
1732        )
1733    }
1734
1735    type GetAvailableGifts = JsonRequest<payloads::GetAvailableGifts>;
1736
1737    fn get_available_gifts(&self) -> Self::GetAvailableGifts {
1738        Self::GetAvailableGifts::new(self.clone(), payloads::GetAvailableGifts::new())
1739    }
1740
1741    type SendGift = JsonRequest<payloads::SendGift>;
1742
1743    fn send_gift(&self, user_id: UserId, gift_id: GiftId) -> Self::SendGift {
1744        Self::SendGift::new(self.clone(), payloads::SendGift::new(user_id, gift_id))
1745    }
1746
1747    type SendGiftChat = JsonRequest<payloads::SendGiftChat>;
1748
1749    fn send_gift_chat<C>(&self, chat_id: C, gift_id: GiftId) -> Self::SendGiftChat
1750    where
1751        C: Into<Recipient>,
1752    {
1753        Self::SendGiftChat::new(self.clone(), payloads::SendGiftChat::new(chat_id, gift_id))
1754    }
1755
1756    type GiftPremiumSubscription = JsonRequest<payloads::GiftPremiumSubscription>;
1757
1758    fn gift_premium_subscription(
1759        &self,
1760        user_id: UserId,
1761        month_count: u8,
1762        star_count: u32,
1763    ) -> Self::GiftPremiumSubscription {
1764        Self::GiftPremiumSubscription::new(
1765            self.clone(),
1766            payloads::GiftPremiumSubscription::new(user_id, month_count, star_count),
1767        )
1768    }
1769
1770    type VerifyUser = JsonRequest<payloads::VerifyUser>;
1771
1772    fn verify_user(&self, user_id: UserId) -> Self::VerifyUser {
1773        Self::VerifyUser::new(self.clone(), payloads::VerifyUser::new(user_id))
1774    }
1775
1776    type VerifyChat = JsonRequest<payloads::VerifyChat>;
1777
1778    fn verify_chat<C>(&self, chat_id: C) -> Self::VerifyChat
1779    where
1780        C: Into<Recipient>,
1781    {
1782        Self::VerifyChat::new(self.clone(), payloads::VerifyChat::new(chat_id))
1783    }
1784
1785    type RemoveUserVerification = JsonRequest<payloads::RemoveUserVerification>;
1786
1787    fn remove_user_verification(&self, user_id: UserId) -> Self::RemoveUserVerification {
1788        Self::RemoveUserVerification::new(
1789            self.clone(),
1790            payloads::RemoveUserVerification::new(user_id),
1791        )
1792    }
1793
1794    type RemoveChatVerification = JsonRequest<payloads::RemoveChatVerification>;
1795
1796    fn remove_chat_verification<C>(&self, chat_id: C) -> Self::RemoveChatVerification
1797    where
1798        C: Into<Recipient>,
1799    {
1800        Self::RemoveChatVerification::new(
1801            self.clone(),
1802            payloads::RemoveChatVerification::new(chat_id),
1803        )
1804    }
1805
1806    type ReadBusinessMessage = JsonRequest<payloads::ReadBusinessMessage>;
1807
1808    fn read_business_message<C>(
1809        &self,
1810        business_connection_id: BusinessConnectionId,
1811        chat_id: C,
1812        message_id: MessageId,
1813    ) -> Self::ReadBusinessMessage
1814    where
1815        C: Into<ChatId>,
1816    {
1817        Self::ReadBusinessMessage::new(
1818            self.clone(),
1819            payloads::ReadBusinessMessage::new(business_connection_id, chat_id, message_id),
1820        )
1821    }
1822
1823    type DeleteBusinessMessages = JsonRequest<payloads::DeleteBusinessMessages>;
1824
1825    fn delete_business_messages<M>(
1826        &self,
1827        business_connection_id: BusinessConnectionId,
1828        message_ids: M,
1829    ) -> Self::DeleteBusinessMessages
1830    where
1831        M: IntoIterator<Item = MessageId>,
1832    {
1833        Self::DeleteBusinessMessages::new(
1834            self.clone(),
1835            payloads::DeleteBusinessMessages::new(business_connection_id, message_ids),
1836        )
1837    }
1838
1839    type SetBusinessAccountName = JsonRequest<payloads::SetBusinessAccountName>;
1840
1841    fn set_business_account_name<F>(
1842        &self,
1843        business_connection_id: BusinessConnectionId,
1844        first_name: F,
1845    ) -> Self::SetBusinessAccountName
1846    where
1847        F: Into<String>,
1848    {
1849        Self::SetBusinessAccountName::new(
1850            self.clone(),
1851            payloads::SetBusinessAccountName::new(business_connection_id, first_name),
1852        )
1853    }
1854
1855    type SetBusinessAccountUsername = JsonRequest<payloads::SetBusinessAccountUsername>;
1856
1857    fn set_business_account_username(
1858        &self,
1859        business_connection_id: BusinessConnectionId,
1860    ) -> Self::SetBusinessAccountUsername {
1861        Self::SetBusinessAccountUsername::new(
1862            self.clone(),
1863            payloads::SetBusinessAccountUsername::new(business_connection_id),
1864        )
1865    }
1866
1867    type SetBusinessAccountBio = JsonRequest<payloads::SetBusinessAccountBio>;
1868
1869    fn set_business_account_bio(
1870        &self,
1871        business_connection_id: BusinessConnectionId,
1872    ) -> Self::SetBusinessAccountBio {
1873        Self::SetBusinessAccountBio::new(
1874            self.clone(),
1875            payloads::SetBusinessAccountBio::new(business_connection_id),
1876        )
1877    }
1878
1879    type SetBusinessAccountProfilePhoto = JsonRequest<payloads::SetBusinessAccountProfilePhoto>;
1880
1881    fn set_business_account_profile_photo(
1882        &self,
1883        business_connection_id: BusinessConnectionId,
1884        photo: InputProfilePhoto,
1885    ) -> Self::SetBusinessAccountProfilePhoto {
1886        Self::SetBusinessAccountProfilePhoto::new(
1887            self.clone(),
1888            payloads::SetBusinessAccountProfilePhoto::new(business_connection_id, photo),
1889        )
1890    }
1891
1892    type RemoveBusinessAccountProfilePhoto =
1893        JsonRequest<payloads::RemoveBusinessAccountProfilePhoto>;
1894
1895    fn remove_business_account_profile_photo(
1896        &self,
1897        business_connection_id: BusinessConnectionId,
1898    ) -> Self::RemoveBusinessAccountProfilePhoto {
1899        Self::RemoveBusinessAccountProfilePhoto::new(
1900            self.clone(),
1901            payloads::RemoveBusinessAccountProfilePhoto::new(business_connection_id),
1902        )
1903    }
1904
1905    type SetBusinessAccountGiftSettings = JsonRequest<payloads::SetBusinessAccountGiftSettings>;
1906
1907    fn set_business_account_gift_settings(
1908        &self,
1909        business_connection_id: BusinessConnectionId,
1910        show_gift_button: bool,
1911        accepted_gift_types: AcceptedGiftTypes,
1912    ) -> Self::SetBusinessAccountGiftSettings {
1913        Self::SetBusinessAccountGiftSettings::new(
1914            self.clone(),
1915            payloads::SetBusinessAccountGiftSettings::new(
1916                business_connection_id,
1917                show_gift_button,
1918                accepted_gift_types,
1919            ),
1920        )
1921    }
1922
1923    type GetBusinessAccountStarBalance = JsonRequest<payloads::GetBusinessAccountStarBalance>;
1924
1925    fn get_business_account_star_balance(
1926        &self,
1927        business_connection_id: BusinessConnectionId,
1928    ) -> Self::GetBusinessAccountStarBalance {
1929        Self::GetBusinessAccountStarBalance::new(
1930            self.clone(),
1931            payloads::GetBusinessAccountStarBalance::new(business_connection_id),
1932        )
1933    }
1934
1935    type TransferBusinessAccountStars = JsonRequest<payloads::TransferBusinessAccountStars>;
1936
1937    fn transfer_business_account_stars(
1938        &self,
1939        business_connection_id: BusinessConnectionId,
1940        star_count: u32,
1941    ) -> Self::TransferBusinessAccountStars {
1942        Self::TransferBusinessAccountStars::new(
1943            self.clone(),
1944            payloads::TransferBusinessAccountStars::new(business_connection_id, star_count),
1945        )
1946    }
1947
1948    type GetBusinessAccountGifts = JsonRequest<payloads::GetBusinessAccountGifts>;
1949
1950    fn get_business_account_gifts(
1951        &self,
1952        business_connection_id: BusinessConnectionId,
1953    ) -> Self::GetBusinessAccountGifts {
1954        Self::GetBusinessAccountGifts::new(
1955            self.clone(),
1956            payloads::GetBusinessAccountGifts::new(business_connection_id),
1957        )
1958    }
1959
1960    type GetUserGifts = JsonRequest<payloads::GetUserGifts>;
1961
1962    fn get_user_gifts(&self, user_id: UserId) -> Self::GetUserGifts {
1963        Self::GetUserGifts::new(self.clone(), payloads::GetUserGifts::new(user_id))
1964    }
1965
1966    type GetChatGifts = JsonRequest<payloads::GetChatGifts>;
1967
1968    fn get_chat_gifts<C>(&self, chat_id: C) -> Self::GetChatGifts
1969    where
1970        C: Into<Recipient>,
1971    {
1972        Self::GetChatGifts::new(self.clone(), payloads::GetChatGifts::new(chat_id))
1973    }
1974
1975    type RepostStory = JsonRequest<payloads::RepostStory>;
1976
1977    fn repost_story<F>(
1978        &self,
1979        business_connection_id: BusinessConnectionId,
1980        from_chat_id: F,
1981        from_story_id: StoryId,
1982        active_period: Seconds,
1983    ) -> Self::RepostStory
1984    where
1985        F: Into<ChatId>,
1986    {
1987        Self::RepostStory::new(
1988            self.clone(),
1989            payloads::RepostStory::new(
1990                business_connection_id,
1991                from_chat_id,
1992                from_story_id,
1993                active_period,
1994            ),
1995        )
1996    }
1997
1998    type ConvertGiftToStars = JsonRequest<payloads::ConvertGiftToStars>;
1999
2000    fn convert_gift_to_stars(
2001        &self,
2002        business_connection_id: BusinessConnectionId,
2003        owned_gift_id: OwnedGiftId,
2004    ) -> Self::ConvertGiftToStars {
2005        Self::ConvertGiftToStars::new(
2006            self.clone(),
2007            payloads::ConvertGiftToStars::new(business_connection_id, owned_gift_id),
2008        )
2009    }
2010
2011    type UpgradeGift = JsonRequest<payloads::UpgradeGift>;
2012
2013    fn upgrade_gift(
2014        &self,
2015        business_connection_id: BusinessConnectionId,
2016        owned_gift_id: OwnedGiftId,
2017    ) -> Self::UpgradeGift {
2018        Self::UpgradeGift::new(
2019            self.clone(),
2020            payloads::UpgradeGift::new(business_connection_id, owned_gift_id),
2021        )
2022    }
2023
2024    type TransferGift = JsonRequest<payloads::TransferGift>;
2025
2026    fn transfer_gift<C>(
2027        &self,
2028        business_connection_id: BusinessConnectionId,
2029        owned_gift_id: OwnedGiftId,
2030        new_owner_chat_id: C,
2031    ) -> Self::TransferGift
2032    where
2033        C: Into<ChatId>,
2034    {
2035        Self::TransferGift::new(
2036            self.clone(),
2037            payloads::TransferGift::new(business_connection_id, owned_gift_id, new_owner_chat_id),
2038        )
2039    }
2040
2041    type PostStory = JsonRequest<payloads::PostStory>;
2042
2043    fn post_story(
2044        &self,
2045        business_connection_id: BusinessConnectionId,
2046        content: InputStoryContent,
2047        active_period: Seconds,
2048    ) -> Self::PostStory {
2049        Self::PostStory::new(
2050            self.clone(),
2051            payloads::PostStory::new(business_connection_id, content, active_period),
2052        )
2053    }
2054
2055    type EditStory = JsonRequest<payloads::EditStory>;
2056
2057    fn edit_story(
2058        &self,
2059        business_connection_id: BusinessConnectionId,
2060        story_id: StoryId,
2061        content: InputStoryContent,
2062    ) -> Self::EditStory {
2063        Self::EditStory::new(
2064            self.clone(),
2065            payloads::EditStory::new(business_connection_id, story_id, content),
2066        )
2067    }
2068
2069    type DeleteStory = JsonRequest<payloads::DeleteStory>;
2070
2071    fn delete_story(
2072        &self,
2073        business_connection_id: BusinessConnectionId,
2074        story_id: StoryId,
2075    ) -> Self::DeleteStory {
2076        Self::DeleteStory::new(
2077            self.clone(),
2078            payloads::DeleteStory::new(business_connection_id, story_id),
2079        )
2080    }
2081
2082    type SendInvoice = JsonRequest<payloads::SendInvoice>;
2083
2084    fn send_invoice<Ch, T, D, Pa, C, Pri>(
2085        &self,
2086        chat_id: Ch,
2087        title: T,
2088        description: D,
2089        payload: Pa,
2090        currency: C,
2091        prices: Pri,
2092    ) -> Self::SendInvoice
2093    where
2094        Ch: Into<Recipient>,
2095        T: Into<String>,
2096        D: Into<String>,
2097        Pa: Into<String>,
2098        C: Into<String>,
2099        Pri: IntoIterator<Item = LabeledPrice>,
2100    {
2101        Self::SendInvoice::new(
2102            self.clone(),
2103            payloads::SendInvoice::new(chat_id, title, description, payload, currency, prices),
2104        )
2105    }
2106
2107    type CreateInvoiceLink = JsonRequest<payloads::CreateInvoiceLink>;
2108
2109    fn create_invoice_link<T, D, Pa, C, Pri>(
2110        &self,
2111        title: T,
2112        description: D,
2113        payload: Pa,
2114        currency: C,
2115        prices: Pri,
2116    ) -> Self::CreateInvoiceLink
2117    where
2118        T: Into<String>,
2119        D: Into<String>,
2120        Pa: Into<String>,
2121        C: Into<String>,
2122        Pri: IntoIterator<Item = LabeledPrice>,
2123    {
2124        Self::CreateInvoiceLink::new(
2125            self.clone(),
2126            payloads::CreateInvoiceLink::new(title, description, payload, currency, prices),
2127        )
2128    }
2129
2130    type AnswerShippingQuery = JsonRequest<payloads::AnswerShippingQuery>;
2131
2132    fn answer_shipping_query(
2133        &self,
2134        shipping_query_id: ShippingQueryId,
2135        ok: bool,
2136    ) -> Self::AnswerShippingQuery {
2137        Self::AnswerShippingQuery::new(
2138            self.clone(),
2139            payloads::AnswerShippingQuery::new(shipping_query_id, ok),
2140        )
2141    }
2142
2143    type AnswerPreCheckoutQuery = JsonRequest<payloads::AnswerPreCheckoutQuery>;
2144
2145    fn answer_pre_checkout_query(
2146        &self,
2147        pre_checkout_query_id: PreCheckoutQueryId,
2148        ok: bool,
2149    ) -> Self::AnswerPreCheckoutQuery {
2150        Self::AnswerPreCheckoutQuery::new(
2151            self.clone(),
2152            payloads::AnswerPreCheckoutQuery::new(pre_checkout_query_id, ok),
2153        )
2154    }
2155
2156    type GetMyStarBalance = JsonRequest<payloads::GetMyStarBalance>;
2157
2158    fn get_my_star_balance(&self) -> Self::GetMyStarBalance {
2159        Self::GetMyStarBalance::new(self.clone(), payloads::GetMyStarBalance::new())
2160    }
2161
2162    type GetStarTransactions = JsonRequest<payloads::GetStarTransactions>;
2163
2164    fn get_star_transactions(&self) -> Self::GetStarTransactions {
2165        Self::GetStarTransactions::new(self.clone(), payloads::GetStarTransactions::new())
2166    }
2167
2168    type RefundStarPayment = JsonRequest<payloads::RefundStarPayment>;
2169
2170    fn refund_star_payment(
2171        &self,
2172        user_id: UserId,
2173        telegram_payment_charge_id: TelegramTransactionId,
2174    ) -> Self::RefundStarPayment {
2175        Self::RefundStarPayment::new(
2176            self.clone(),
2177            payloads::RefundStarPayment::new(user_id, telegram_payment_charge_id),
2178        )
2179    }
2180
2181    type EditUserStarSubscription = JsonRequest<payloads::EditUserStarSubscription>;
2182
2183    fn edit_user_star_subscription(
2184        &self,
2185        user_id: UserId,
2186        telegram_payment_charge_id: TelegramTransactionId,
2187        is_canceled: bool,
2188    ) -> Self::EditUserStarSubscription {
2189        Self::EditUserStarSubscription::new(
2190            self.clone(),
2191            payloads::EditUserStarSubscription::new(
2192                user_id,
2193                telegram_payment_charge_id,
2194                is_canceled,
2195            ),
2196        )
2197    }
2198
2199    type SetPassportDataErrors = JsonRequest<payloads::SetPassportDataErrors>;
2200
2201    fn set_passport_data_errors<E>(&self, user_id: UserId, errors: E) -> Self::SetPassportDataErrors
2202    where
2203        E: IntoIterator<Item = crate::types::PassportElementError>,
2204    {
2205        Self::SetPassportDataErrors::new(
2206            self.clone(),
2207            payloads::SetPassportDataErrors::new(user_id, errors),
2208        )
2209    }
2210
2211    type SendGame = JsonRequest<payloads::SendGame>;
2212
2213    fn send_game<C, G>(&self, chat_id: C, game_short_name: G) -> Self::SendGame
2214    where
2215        C: Into<ChatId>,
2216        G: Into<String>,
2217    {
2218        Self::SendGame::new(self.clone(), payloads::SendGame::new(chat_id, game_short_name))
2219    }
2220
2221    type SetGameScore = JsonRequest<payloads::SetGameScore>;
2222
2223    fn set_game_score(
2224        &self,
2225        user_id: UserId,
2226        score: u64,
2227        chat_id: u32,
2228        message_id: MessageId,
2229    ) -> Self::SetGameScore {
2230        Self::SetGameScore::new(
2231            self.clone(),
2232            payloads::SetGameScore::new(user_id, score, chat_id, message_id),
2233        )
2234    }
2235
2236    type SetGameScoreInline = JsonRequest<payloads::SetGameScoreInline>;
2237
2238    fn set_game_score_inline<I>(
2239        &self,
2240        user_id: UserId,
2241        score: u64,
2242        inline_message_id: I,
2243    ) -> Self::SetGameScoreInline
2244    where
2245        I: Into<String>,
2246    {
2247        Self::SetGameScoreInline::new(
2248            self.clone(),
2249            payloads::SetGameScoreInline::new(user_id, score, inline_message_id),
2250        )
2251    }
2252
2253    type GetGameHighScores = JsonRequest<payloads::GetGameHighScores>;
2254
2255    fn get_game_high_scores<T>(&self, user_id: UserId, target: T) -> Self::GetGameHighScores
2256    where
2257        T: Into<crate::types::TargetMessage>,
2258    {
2259        Self::GetGameHighScores::new(
2260            self.clone(),
2261            payloads::GetGameHighScores::new(user_id, target),
2262        )
2263    }
2264
2265    type LogOut = JsonRequest<payloads::LogOut>;
2266
2267    fn log_out(&self) -> Self::LogOut {
2268        Self::LogOut::new(self.clone(), payloads::LogOut::new())
2269    }
2270
2271    type Close = JsonRequest<payloads::Close>;
2272
2273    fn close(&self) -> Self::Close {
2274        Self::Close::new(self.clone(), payloads::Close::new())
2275    }
2276
2277    type CopyMessage = JsonRequest<payloads::CopyMessage>;
2278
2279    fn copy_message<C, F>(
2280        &self,
2281        chat_id: C,
2282        from_chat_id: F,
2283        message_id: MessageId,
2284    ) -> Self::CopyMessage
2285    where
2286        C: Into<Recipient>,
2287        F: Into<Recipient>,
2288    {
2289        Self::CopyMessage::new(
2290            self.clone(),
2291            payloads::CopyMessage::new(chat_id, from_chat_id, message_id),
2292        )
2293    }
2294
2295    type CopyMessages = JsonRequest<payloads::CopyMessages>;
2296    fn copy_messages<C, F, M>(
2297        &self,
2298        chat_id: C,
2299        from_chat_id: F,
2300        message_ids: M,
2301    ) -> Self::CopyMessages
2302    where
2303        C: Into<Recipient>,
2304        F: Into<Recipient>,
2305        M: IntoIterator<Item = MessageId>,
2306    {
2307        Self::CopyMessages::new(
2308            self.clone(),
2309            payloads::CopyMessages::new(chat_id, from_chat_id, message_ids),
2310        )
2311    }
2312
2313    type UnpinAllChatMessages = JsonRequest<payloads::UnpinAllChatMessages>;
2314
2315    fn unpin_all_chat_messages<C>(&self, chat_id: C) -> Self::UnpinAllChatMessages
2316    where
2317        C: Into<Recipient>,
2318    {
2319        Self::UnpinAllChatMessages::new(self.clone(), payloads::UnpinAllChatMessages::new(chat_id))
2320    }
2321
2322    type EditEphemeralMessageText = JsonRequest<payloads::EditEphemeralMessageText>;
2323
2324    fn edit_ephemeral_message_text<C>(
2325        &self,
2326        chat_id: C,
2327        receiver_user_id: UserId,
2328        ephemeral_message_id: MessageId,
2329    ) -> Self::EditEphemeralMessageText
2330    where
2331        C: Into<Recipient>,
2332    {
2333        Self::EditEphemeralMessageText::new(
2334            self.clone(),
2335            payloads::EditEphemeralMessageText::new(
2336                chat_id,
2337                receiver_user_id,
2338                ephemeral_message_id,
2339            ),
2340        )
2341    }
2342
2343    type EditEphemeralMessageMedia = MultipartRequest<payloads::EditEphemeralMessageMedia>;
2344
2345    fn edit_ephemeral_message_media<C>(
2346        &self,
2347        chat_id: C,
2348        receiver_user_id: UserId,
2349        ephemeral_message_id: MessageId,
2350        media: InputMedia,
2351    ) -> Self::EditEphemeralMessageMedia
2352    where
2353        C: Into<Recipient>,
2354    {
2355        Self::EditEphemeralMessageMedia::new(
2356            self.clone(),
2357            payloads::EditEphemeralMessageMedia::new(
2358                chat_id,
2359                receiver_user_id,
2360                ephemeral_message_id,
2361                media,
2362            ),
2363        )
2364    }
2365
2366    type EditEphemeralMessageCaption = JsonRequest<payloads::EditEphemeralMessageCaption>;
2367
2368    fn edit_ephemeral_message_caption<C>(
2369        &self,
2370        chat_id: C,
2371        receiver_user_id: UserId,
2372        ephemeral_message_id: MessageId,
2373    ) -> Self::EditEphemeralMessageCaption
2374    where
2375        C: Into<Recipient>,
2376    {
2377        Self::EditEphemeralMessageCaption::new(
2378            self.clone(),
2379            payloads::EditEphemeralMessageCaption::new(
2380                chat_id,
2381                receiver_user_id,
2382                ephemeral_message_id,
2383            ),
2384        )
2385    }
2386
2387    type EditEphemeralMessageReplyMarkup = JsonRequest<payloads::EditEphemeralMessageReplyMarkup>;
2388
2389    fn edit_ephemeral_message_reply_markup<C>(
2390        &self,
2391        chat_id: C,
2392        receiver_user_id: UserId,
2393        ephemeral_message_id: MessageId,
2394    ) -> Self::EditEphemeralMessageReplyMarkup
2395    where
2396        C: Into<Recipient>,
2397    {
2398        Self::EditEphemeralMessageReplyMarkup::new(
2399            self.clone(),
2400            payloads::EditEphemeralMessageReplyMarkup::new(
2401                chat_id,
2402                receiver_user_id,
2403                ephemeral_message_id,
2404            ),
2405        )
2406    }
2407
2408    type DeleteEphemeralMessage = JsonRequest<payloads::DeleteEphemeralMessage>;
2409
2410    fn delete_ephemeral_message<C>(
2411        &self,
2412        chat_id: C,
2413        receiver_user_id: UserId,
2414        ephemeral_message_id: MessageId,
2415    ) -> Self::DeleteEphemeralMessage
2416    where
2417        C: Into<Recipient>,
2418    {
2419        Self::DeleteEphemeralMessage::new(
2420            self.clone(),
2421            payloads::DeleteEphemeralMessage::new(chat_id, receiver_user_id, ephemeral_message_id),
2422        )
2423    }
2424}