Skip to main content

ronami_core/bot/
api.rs

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