1
2use crate::types::*;
3use crate::errors::*;
4use uuid::Uuid;
5
6
7
8
9use std::fmt::Debug;
10use serde::de::{Deserialize, Deserializer};
11
12
13
14pub trait TDUpdate: Debug + RObject {}
16
17#[derive(Debug, Clone, Serialize)]
19#[serde(untagged)]
20pub enum Update {
21 #[doc(hidden)] _Default(()),
22 TestUseUpdate(TestUseUpdate),
24 ActiveNotifications(UpdateActiveNotifications),
26 AnimatedEmojiMessageClicked(UpdateAnimatedEmojiMessageClicked),
28 AnimationSearchParameters(UpdateAnimationSearchParameters),
30 AuthorizationState(UpdateAuthorizationState),
32 BasicGroup(UpdateBasicGroup),
34 BasicGroupFullInfo(UpdateBasicGroupFullInfo),
36 Call(UpdateCall),
38 ChatAction(UpdateChatAction),
40 ChatActionBar(UpdateChatActionBar),
42 ChatDefaultDisableNotification(UpdateChatDefaultDisableNotification),
44 ChatDraftMessage(UpdateChatDraftMessage),
46 ChatFilters(UpdateChatFilters),
48 ChatHasProtectedContent(UpdateChatHasProtectedContent),
50 ChatHasScheduledMessages(UpdateChatHasScheduledMessages),
52 ChatIsBlocked(UpdateChatIsBlocked),
54 ChatIsMarkedAsUnread(UpdateChatIsMarkedAsUnread),
56 ChatLastMessage(UpdateChatLastMessage),
58 ChatMember(UpdateChatMember),
60 ChatMessageSender(UpdateChatMessageSender),
62 ChatMessageTtl(UpdateChatMessageTtl),
64 ChatNotificationSettings(UpdateChatNotificationSettings),
66 ChatOnlineMemberCount(UpdateChatOnlineMemberCount),
68 ChatPendingJoinRequests(UpdateChatPendingJoinRequests),
70 ChatPermissions(UpdateChatPermissions),
72 ChatPhoto(UpdateChatPhoto),
74 ChatPosition(UpdateChatPosition),
76 ChatReadInbox(UpdateChatReadInbox),
78 ChatReadOutbox(UpdateChatReadOutbox),
80 ChatReplyMarkup(UpdateChatReplyMarkup),
82 ChatTheme(UpdateChatTheme),
84 ChatThemes(UpdateChatThemes),
86 ChatTitle(UpdateChatTitle),
88 ChatUnreadMentionCount(UpdateChatUnreadMentionCount),
90 ChatVideoChat(UpdateChatVideoChat),
92 ConnectionState(UpdateConnectionState),
94 DeleteMessages(UpdateDeleteMessages),
96 DiceEmojis(UpdateDiceEmojis),
98 FavoriteStickers(UpdateFavoriteStickers),
100 File(UpdateFile),
102 FileGenerationStart(UpdateFileGenerationStart),
104 FileGenerationStop(UpdateFileGenerationStop),
106 GroupCall(UpdateGroupCall),
108 GroupCallParticipant(UpdateGroupCallParticipant),
110 HavePendingNotifications(UpdateHavePendingNotifications),
112 InstalledStickerSets(UpdateInstalledStickerSets),
114 LanguagePackStrings(UpdateLanguagePackStrings),
116 MessageContent(UpdateMessageContent),
118 MessageContentOpened(UpdateMessageContentOpened),
120 MessageEdited(UpdateMessageEdited),
122 MessageInteractionInfo(UpdateMessageInteractionInfo),
124 MessageIsPinned(UpdateMessageIsPinned),
126 MessageLiveLocationViewed(UpdateMessageLiveLocationViewed),
128 MessageMentionRead(UpdateMessageMentionRead),
130 MessageSendAcknowledged(UpdateMessageSendAcknowledged),
132 MessageSendFailed(UpdateMessageSendFailed),
134 MessageSendSucceeded(UpdateMessageSendSucceeded),
136 NewCallSignalingData(UpdateNewCallSignalingData),
138 NewCallbackQuery(UpdateNewCallbackQuery),
140 NewChat(UpdateNewChat),
142 NewChatJoinRequest(UpdateNewChatJoinRequest),
144 NewChosenInlineResult(UpdateNewChosenInlineResult),
146 NewCustomEvent(UpdateNewCustomEvent),
148 NewCustomQuery(UpdateNewCustomQuery),
150 NewInlineCallbackQuery(UpdateNewInlineCallbackQuery),
152 NewInlineQuery(UpdateNewInlineQuery),
154 NewMessage(UpdateNewMessage),
156 NewPreCheckoutQuery(UpdateNewPreCheckoutQuery),
158 NewShippingQuery(UpdateNewShippingQuery),
160 Notification(UpdateNotification),
162 NotificationGroup(UpdateNotificationGroup),
164 Option(UpdateOption),
166 Poll(UpdatePoll),
168 PollAnswer(UpdatePollAnswer),
170 RecentStickers(UpdateRecentStickers),
172 SavedAnimations(UpdateSavedAnimations),
174 ScopeNotificationSettings(UpdateScopeNotificationSettings),
176 SecretChat(UpdateSecretChat),
178 SelectedBackground(UpdateSelectedBackground),
180 ServiceNotification(UpdateServiceNotification),
182 StickerSet(UpdateStickerSet),
184 SuggestedActions(UpdateSuggestedActions),
186 Supergroup(UpdateSupergroup),
188 SupergroupFullInfo(UpdateSupergroupFullInfo),
190 TermsOfService(UpdateTermsOfService),
192 TrendingStickerSets(UpdateTrendingStickerSets),
194 UnreadChatCount(UpdateUnreadChatCount),
196 UnreadMessageCount(UpdateUnreadMessageCount),
198 User(UpdateUser),
200 UserFullInfo(UpdateUserFullInfo),
202 UserPrivacySettingRules(UpdateUserPrivacySettingRules),
204 UserStatus(UpdateUserStatus),
206 UsersNearby(UpdateUsersNearby),
208
209}
210
211impl Default for Update {
212 fn default() -> Self { Update::_Default(()) }
213}
214
215impl<'de> Deserialize<'de> for Update {
216 fn deserialize<D>(deserializer: D) -> Result<Update, D::Error> where D: Deserializer<'de> {
217 use serde::de::Error;
218 rtd_enum_deserialize!(
219 Update,
220 (testUseUpdate, TestUseUpdate);
221 (updateActiveNotifications, ActiveNotifications);
222 (updateAnimatedEmojiMessageClicked, AnimatedEmojiMessageClicked);
223 (updateAnimationSearchParameters, AnimationSearchParameters);
224 (updateAuthorizationState, AuthorizationState);
225 (updateBasicGroup, BasicGroup);
226 (updateBasicGroupFullInfo, BasicGroupFullInfo);
227 (updateCall, Call);
228 (updateChatAction, ChatAction);
229 (updateChatActionBar, ChatActionBar);
230 (updateChatDefaultDisableNotification, ChatDefaultDisableNotification);
231 (updateChatDraftMessage, ChatDraftMessage);
232 (updateChatFilters, ChatFilters);
233 (updateChatHasProtectedContent, ChatHasProtectedContent);
234 (updateChatHasScheduledMessages, ChatHasScheduledMessages);
235 (updateChatIsBlocked, ChatIsBlocked);
236 (updateChatIsMarkedAsUnread, ChatIsMarkedAsUnread);
237 (updateChatLastMessage, ChatLastMessage);
238 (updateChatMember, ChatMember);
239 (updateChatMessageSender, ChatMessageSender);
240 (updateChatMessageTtl, ChatMessageTtl);
241 (updateChatNotificationSettings, ChatNotificationSettings);
242 (updateChatOnlineMemberCount, ChatOnlineMemberCount);
243 (updateChatPendingJoinRequests, ChatPendingJoinRequests);
244 (updateChatPermissions, ChatPermissions);
245 (updateChatPhoto, ChatPhoto);
246 (updateChatPosition, ChatPosition);
247 (updateChatReadInbox, ChatReadInbox);
248 (updateChatReadOutbox, ChatReadOutbox);
249 (updateChatReplyMarkup, ChatReplyMarkup);
250 (updateChatTheme, ChatTheme);
251 (updateChatThemes, ChatThemes);
252 (updateChatTitle, ChatTitle);
253 (updateChatUnreadMentionCount, ChatUnreadMentionCount);
254 (updateChatVideoChat, ChatVideoChat);
255 (updateConnectionState, ConnectionState);
256 (updateDeleteMessages, DeleteMessages);
257 (updateDiceEmojis, DiceEmojis);
258 (updateFavoriteStickers, FavoriteStickers);
259 (updateFile, File);
260 (updateFileGenerationStart, FileGenerationStart);
261 (updateFileGenerationStop, FileGenerationStop);
262 (updateGroupCall, GroupCall);
263 (updateGroupCallParticipant, GroupCallParticipant);
264 (updateHavePendingNotifications, HavePendingNotifications);
265 (updateInstalledStickerSets, InstalledStickerSets);
266 (updateLanguagePackStrings, LanguagePackStrings);
267 (updateMessageContent, MessageContent);
268 (updateMessageContentOpened, MessageContentOpened);
269 (updateMessageEdited, MessageEdited);
270 (updateMessageInteractionInfo, MessageInteractionInfo);
271 (updateMessageIsPinned, MessageIsPinned);
272 (updateMessageLiveLocationViewed, MessageLiveLocationViewed);
273 (updateMessageMentionRead, MessageMentionRead);
274 (updateMessageSendAcknowledged, MessageSendAcknowledged);
275 (updateMessageSendFailed, MessageSendFailed);
276 (updateMessageSendSucceeded, MessageSendSucceeded);
277 (updateNewCallSignalingData, NewCallSignalingData);
278 (updateNewCallbackQuery, NewCallbackQuery);
279 (updateNewChat, NewChat);
280 (updateNewChatJoinRequest, NewChatJoinRequest);
281 (updateNewChosenInlineResult, NewChosenInlineResult);
282 (updateNewCustomEvent, NewCustomEvent);
283 (updateNewCustomQuery, NewCustomQuery);
284 (updateNewInlineCallbackQuery, NewInlineCallbackQuery);
285 (updateNewInlineQuery, NewInlineQuery);
286 (updateNewMessage, NewMessage);
287 (updateNewPreCheckoutQuery, NewPreCheckoutQuery);
288 (updateNewShippingQuery, NewShippingQuery);
289 (updateNotification, Notification);
290 (updateNotificationGroup, NotificationGroup);
291 (updateOption, Option);
292 (updatePoll, Poll);
293 (updatePollAnswer, PollAnswer);
294 (updateRecentStickers, RecentStickers);
295 (updateSavedAnimations, SavedAnimations);
296 (updateScopeNotificationSettings, ScopeNotificationSettings);
297 (updateSecretChat, SecretChat);
298 (updateSelectedBackground, SelectedBackground);
299 (updateServiceNotification, ServiceNotification);
300 (updateStickerSet, StickerSet);
301 (updateSuggestedActions, SuggestedActions);
302 (updateSupergroup, Supergroup);
303 (updateSupergroupFullInfo, SupergroupFullInfo);
304 (updateTermsOfService, TermsOfService);
305 (updateTrendingStickerSets, TrendingStickerSets);
306 (updateUnreadChatCount, UnreadChatCount);
307 (updateUnreadMessageCount, UnreadMessageCount);
308 (updateUser, User);
309 (updateUserFullInfo, UserFullInfo);
310 (updateUserPrivacySettingRules, UserPrivacySettingRules);
311 (updateUserStatus, UserStatus);
312 (updateUsersNearby, UsersNearby);
313
314 )(deserializer)
315 }
316}
317
318impl RObject for Update {
319 #[doc(hidden)] fn td_name(&self) -> &'static str {
320 match self {
321 Update::TestUseUpdate(t) => t.td_name(),
322 Update::ActiveNotifications(t) => t.td_name(),
323 Update::AnimatedEmojiMessageClicked(t) => t.td_name(),
324 Update::AnimationSearchParameters(t) => t.td_name(),
325 Update::AuthorizationState(t) => t.td_name(),
326 Update::BasicGroup(t) => t.td_name(),
327 Update::BasicGroupFullInfo(t) => t.td_name(),
328 Update::Call(t) => t.td_name(),
329 Update::ChatAction(t) => t.td_name(),
330 Update::ChatActionBar(t) => t.td_name(),
331 Update::ChatDefaultDisableNotification(t) => t.td_name(),
332 Update::ChatDraftMessage(t) => t.td_name(),
333 Update::ChatFilters(t) => t.td_name(),
334 Update::ChatHasProtectedContent(t) => t.td_name(),
335 Update::ChatHasScheduledMessages(t) => t.td_name(),
336 Update::ChatIsBlocked(t) => t.td_name(),
337 Update::ChatIsMarkedAsUnread(t) => t.td_name(),
338 Update::ChatLastMessage(t) => t.td_name(),
339 Update::ChatMember(t) => t.td_name(),
340 Update::ChatMessageSender(t) => t.td_name(),
341 Update::ChatMessageTtl(t) => t.td_name(),
342 Update::ChatNotificationSettings(t) => t.td_name(),
343 Update::ChatOnlineMemberCount(t) => t.td_name(),
344 Update::ChatPendingJoinRequests(t) => t.td_name(),
345 Update::ChatPermissions(t) => t.td_name(),
346 Update::ChatPhoto(t) => t.td_name(),
347 Update::ChatPosition(t) => t.td_name(),
348 Update::ChatReadInbox(t) => t.td_name(),
349 Update::ChatReadOutbox(t) => t.td_name(),
350 Update::ChatReplyMarkup(t) => t.td_name(),
351 Update::ChatTheme(t) => t.td_name(),
352 Update::ChatThemes(t) => t.td_name(),
353 Update::ChatTitle(t) => t.td_name(),
354 Update::ChatUnreadMentionCount(t) => t.td_name(),
355 Update::ChatVideoChat(t) => t.td_name(),
356 Update::ConnectionState(t) => t.td_name(),
357 Update::DeleteMessages(t) => t.td_name(),
358 Update::DiceEmojis(t) => t.td_name(),
359 Update::FavoriteStickers(t) => t.td_name(),
360 Update::File(t) => t.td_name(),
361 Update::FileGenerationStart(t) => t.td_name(),
362 Update::FileGenerationStop(t) => t.td_name(),
363 Update::GroupCall(t) => t.td_name(),
364 Update::GroupCallParticipant(t) => t.td_name(),
365 Update::HavePendingNotifications(t) => t.td_name(),
366 Update::InstalledStickerSets(t) => t.td_name(),
367 Update::LanguagePackStrings(t) => t.td_name(),
368 Update::MessageContent(t) => t.td_name(),
369 Update::MessageContentOpened(t) => t.td_name(),
370 Update::MessageEdited(t) => t.td_name(),
371 Update::MessageInteractionInfo(t) => t.td_name(),
372 Update::MessageIsPinned(t) => t.td_name(),
373 Update::MessageLiveLocationViewed(t) => t.td_name(),
374 Update::MessageMentionRead(t) => t.td_name(),
375 Update::MessageSendAcknowledged(t) => t.td_name(),
376 Update::MessageSendFailed(t) => t.td_name(),
377 Update::MessageSendSucceeded(t) => t.td_name(),
378 Update::NewCallSignalingData(t) => t.td_name(),
379 Update::NewCallbackQuery(t) => t.td_name(),
380 Update::NewChat(t) => t.td_name(),
381 Update::NewChatJoinRequest(t) => t.td_name(),
382 Update::NewChosenInlineResult(t) => t.td_name(),
383 Update::NewCustomEvent(t) => t.td_name(),
384 Update::NewCustomQuery(t) => t.td_name(),
385 Update::NewInlineCallbackQuery(t) => t.td_name(),
386 Update::NewInlineQuery(t) => t.td_name(),
387 Update::NewMessage(t) => t.td_name(),
388 Update::NewPreCheckoutQuery(t) => t.td_name(),
389 Update::NewShippingQuery(t) => t.td_name(),
390 Update::Notification(t) => t.td_name(),
391 Update::NotificationGroup(t) => t.td_name(),
392 Update::Option(t) => t.td_name(),
393 Update::Poll(t) => t.td_name(),
394 Update::PollAnswer(t) => t.td_name(),
395 Update::RecentStickers(t) => t.td_name(),
396 Update::SavedAnimations(t) => t.td_name(),
397 Update::ScopeNotificationSettings(t) => t.td_name(),
398 Update::SecretChat(t) => t.td_name(),
399 Update::SelectedBackground(t) => t.td_name(),
400 Update::ServiceNotification(t) => t.td_name(),
401 Update::StickerSet(t) => t.td_name(),
402 Update::SuggestedActions(t) => t.td_name(),
403 Update::Supergroup(t) => t.td_name(),
404 Update::SupergroupFullInfo(t) => t.td_name(),
405 Update::TermsOfService(t) => t.td_name(),
406 Update::TrendingStickerSets(t) => t.td_name(),
407 Update::UnreadChatCount(t) => t.td_name(),
408 Update::UnreadMessageCount(t) => t.td_name(),
409 Update::User(t) => t.td_name(),
410 Update::UserFullInfo(t) => t.td_name(),
411 Update::UserPrivacySettingRules(t) => t.td_name(),
412 Update::UserStatus(t) => t.td_name(),
413 Update::UsersNearby(t) => t.td_name(),
414
415 _ => "-1",
416 }
417 }
418 #[doc(hidden)] fn extra(&self) -> Option<String> {
419 match self {
420 Update::TestUseUpdate(t) => t.extra(),
421 Update::ActiveNotifications(t) => t.extra(),
422 Update::AnimatedEmojiMessageClicked(t) => t.extra(),
423 Update::AnimationSearchParameters(t) => t.extra(),
424 Update::AuthorizationState(t) => t.extra(),
425 Update::BasicGroup(t) => t.extra(),
426 Update::BasicGroupFullInfo(t) => t.extra(),
427 Update::Call(t) => t.extra(),
428 Update::ChatAction(t) => t.extra(),
429 Update::ChatActionBar(t) => t.extra(),
430 Update::ChatDefaultDisableNotification(t) => t.extra(),
431 Update::ChatDraftMessage(t) => t.extra(),
432 Update::ChatFilters(t) => t.extra(),
433 Update::ChatHasProtectedContent(t) => t.extra(),
434 Update::ChatHasScheduledMessages(t) => t.extra(),
435 Update::ChatIsBlocked(t) => t.extra(),
436 Update::ChatIsMarkedAsUnread(t) => t.extra(),
437 Update::ChatLastMessage(t) => t.extra(),
438 Update::ChatMember(t) => t.extra(),
439 Update::ChatMessageSender(t) => t.extra(),
440 Update::ChatMessageTtl(t) => t.extra(),
441 Update::ChatNotificationSettings(t) => t.extra(),
442 Update::ChatOnlineMemberCount(t) => t.extra(),
443 Update::ChatPendingJoinRequests(t) => t.extra(),
444 Update::ChatPermissions(t) => t.extra(),
445 Update::ChatPhoto(t) => t.extra(),
446 Update::ChatPosition(t) => t.extra(),
447 Update::ChatReadInbox(t) => t.extra(),
448 Update::ChatReadOutbox(t) => t.extra(),
449 Update::ChatReplyMarkup(t) => t.extra(),
450 Update::ChatTheme(t) => t.extra(),
451 Update::ChatThemes(t) => t.extra(),
452 Update::ChatTitle(t) => t.extra(),
453 Update::ChatUnreadMentionCount(t) => t.extra(),
454 Update::ChatVideoChat(t) => t.extra(),
455 Update::ConnectionState(t) => t.extra(),
456 Update::DeleteMessages(t) => t.extra(),
457 Update::DiceEmojis(t) => t.extra(),
458 Update::FavoriteStickers(t) => t.extra(),
459 Update::File(t) => t.extra(),
460 Update::FileGenerationStart(t) => t.extra(),
461 Update::FileGenerationStop(t) => t.extra(),
462 Update::GroupCall(t) => t.extra(),
463 Update::GroupCallParticipant(t) => t.extra(),
464 Update::HavePendingNotifications(t) => t.extra(),
465 Update::InstalledStickerSets(t) => t.extra(),
466 Update::LanguagePackStrings(t) => t.extra(),
467 Update::MessageContent(t) => t.extra(),
468 Update::MessageContentOpened(t) => t.extra(),
469 Update::MessageEdited(t) => t.extra(),
470 Update::MessageInteractionInfo(t) => t.extra(),
471 Update::MessageIsPinned(t) => t.extra(),
472 Update::MessageLiveLocationViewed(t) => t.extra(),
473 Update::MessageMentionRead(t) => t.extra(),
474 Update::MessageSendAcknowledged(t) => t.extra(),
475 Update::MessageSendFailed(t) => t.extra(),
476 Update::MessageSendSucceeded(t) => t.extra(),
477 Update::NewCallSignalingData(t) => t.extra(),
478 Update::NewCallbackQuery(t) => t.extra(),
479 Update::NewChat(t) => t.extra(),
480 Update::NewChatJoinRequest(t) => t.extra(),
481 Update::NewChosenInlineResult(t) => t.extra(),
482 Update::NewCustomEvent(t) => t.extra(),
483 Update::NewCustomQuery(t) => t.extra(),
484 Update::NewInlineCallbackQuery(t) => t.extra(),
485 Update::NewInlineQuery(t) => t.extra(),
486 Update::NewMessage(t) => t.extra(),
487 Update::NewPreCheckoutQuery(t) => t.extra(),
488 Update::NewShippingQuery(t) => t.extra(),
489 Update::Notification(t) => t.extra(),
490 Update::NotificationGroup(t) => t.extra(),
491 Update::Option(t) => t.extra(),
492 Update::Poll(t) => t.extra(),
493 Update::PollAnswer(t) => t.extra(),
494 Update::RecentStickers(t) => t.extra(),
495 Update::SavedAnimations(t) => t.extra(),
496 Update::ScopeNotificationSettings(t) => t.extra(),
497 Update::SecretChat(t) => t.extra(),
498 Update::SelectedBackground(t) => t.extra(),
499 Update::ServiceNotification(t) => t.extra(),
500 Update::StickerSet(t) => t.extra(),
501 Update::SuggestedActions(t) => t.extra(),
502 Update::Supergroup(t) => t.extra(),
503 Update::SupergroupFullInfo(t) => t.extra(),
504 Update::TermsOfService(t) => t.extra(),
505 Update::TrendingStickerSets(t) => t.extra(),
506 Update::UnreadChatCount(t) => t.extra(),
507 Update::UnreadMessageCount(t) => t.extra(),
508 Update::User(t) => t.extra(),
509 Update::UserFullInfo(t) => t.extra(),
510 Update::UserPrivacySettingRules(t) => t.extra(),
511 Update::UserStatus(t) => t.extra(),
512 Update::UsersNearby(t) => t.extra(),
513
514 _ => None,
515 }
516 }
517 fn to_json(&self) -> RTDResult<String> { Ok(serde_json::to_string(self)?) }
518}
519
520impl Update {
521 pub fn from_json<S: AsRef<str>>(json: S) -> RTDResult<Self> { Ok(serde_json::from_str(json.as_ref())?) }
522 #[doc(hidden)] pub fn _is_default(&self) -> bool { if let Update::_Default(_) = self { true } else { false } }
523
524 pub fn is_test_use_update(&self) -> bool { if let Update::TestUseUpdate(_) = self { true } else { false } }
525 pub fn is_active_notifications(&self) -> bool { if let Update::ActiveNotifications(_) = self { true } else { false } }
526 pub fn is_animated_emoji_message_clicked(&self) -> bool { if let Update::AnimatedEmojiMessageClicked(_) = self { true } else { false } }
527 pub fn is_animation_search_parameters(&self) -> bool { if let Update::AnimationSearchParameters(_) = self { true } else { false } }
528 pub fn is_authorization_state(&self) -> bool { if let Update::AuthorizationState(_) = self { true } else { false } }
529 pub fn is_basic_group(&self) -> bool { if let Update::BasicGroup(_) = self { true } else { false } }
530 pub fn is_basic_group_full_info(&self) -> bool { if let Update::BasicGroupFullInfo(_) = self { true } else { false } }
531 pub fn is_call(&self) -> bool { if let Update::Call(_) = self { true } else { false } }
532 pub fn is_chat_action(&self) -> bool { if let Update::ChatAction(_) = self { true } else { false } }
533 pub fn is_chat_action_bar(&self) -> bool { if let Update::ChatActionBar(_) = self { true } else { false } }
534 pub fn is_chat_default_disable_notification(&self) -> bool { if let Update::ChatDefaultDisableNotification(_) = self { true } else { false } }
535 pub fn is_chat_draft_message(&self) -> bool { if let Update::ChatDraftMessage(_) = self { true } else { false } }
536 pub fn is_chat_filters(&self) -> bool { if let Update::ChatFilters(_) = self { true } else { false } }
537 pub fn is_chat_has_protected_content(&self) -> bool { if let Update::ChatHasProtectedContent(_) = self { true } else { false } }
538 pub fn is_chat_has_scheduled_messages(&self) -> bool { if let Update::ChatHasScheduledMessages(_) = self { true } else { false } }
539 pub fn is_chat_is_blocked(&self) -> bool { if let Update::ChatIsBlocked(_) = self { true } else { false } }
540 pub fn is_chat_is_marked_as_unread(&self) -> bool { if let Update::ChatIsMarkedAsUnread(_) = self { true } else { false } }
541 pub fn is_chat_last_message(&self) -> bool { if let Update::ChatLastMessage(_) = self { true } else { false } }
542 pub fn is_chat_member(&self) -> bool { if let Update::ChatMember(_) = self { true } else { false } }
543 pub fn is_chat_message_sender(&self) -> bool { if let Update::ChatMessageSender(_) = self { true } else { false } }
544 pub fn is_chat_message_ttl(&self) -> bool { if let Update::ChatMessageTtl(_) = self { true } else { false } }
545 pub fn is_chat_notification_settings(&self) -> bool { if let Update::ChatNotificationSettings(_) = self { true } else { false } }
546 pub fn is_chat_online_member_count(&self) -> bool { if let Update::ChatOnlineMemberCount(_) = self { true } else { false } }
547 pub fn is_chat_pending_join_requests(&self) -> bool { if let Update::ChatPendingJoinRequests(_) = self { true } else { false } }
548 pub fn is_chat_permissions(&self) -> bool { if let Update::ChatPermissions(_) = self { true } else { false } }
549 pub fn is_chat_photo(&self) -> bool { if let Update::ChatPhoto(_) = self { true } else { false } }
550 pub fn is_chat_position(&self) -> bool { if let Update::ChatPosition(_) = self { true } else { false } }
551 pub fn is_chat_read_inbox(&self) -> bool { if let Update::ChatReadInbox(_) = self { true } else { false } }
552 pub fn is_chat_read_outbox(&self) -> bool { if let Update::ChatReadOutbox(_) = self { true } else { false } }
553 pub fn is_chat_reply_markup(&self) -> bool { if let Update::ChatReplyMarkup(_) = self { true } else { false } }
554 pub fn is_chat_theme(&self) -> bool { if let Update::ChatTheme(_) = self { true } else { false } }
555 pub fn is_chat_themes(&self) -> bool { if let Update::ChatThemes(_) = self { true } else { false } }
556 pub fn is_chat_title(&self) -> bool { if let Update::ChatTitle(_) = self { true } else { false } }
557 pub fn is_chat_unread_mention_count(&self) -> bool { if let Update::ChatUnreadMentionCount(_) = self { true } else { false } }
558 pub fn is_chat_video_chat(&self) -> bool { if let Update::ChatVideoChat(_) = self { true } else { false } }
559 pub fn is_connection_state(&self) -> bool { if let Update::ConnectionState(_) = self { true } else { false } }
560 pub fn is_delete_messages(&self) -> bool { if let Update::DeleteMessages(_) = self { true } else { false } }
561 pub fn is_dice_emojis(&self) -> bool { if let Update::DiceEmojis(_) = self { true } else { false } }
562 pub fn is_favorite_stickers(&self) -> bool { if let Update::FavoriteStickers(_) = self { true } else { false } }
563 pub fn is_file(&self) -> bool { if let Update::File(_) = self { true } else { false } }
564 pub fn is_file_generation_start(&self) -> bool { if let Update::FileGenerationStart(_) = self { true } else { false } }
565 pub fn is_file_generation_stop(&self) -> bool { if let Update::FileGenerationStop(_) = self { true } else { false } }
566 pub fn is_group_call(&self) -> bool { if let Update::GroupCall(_) = self { true } else { false } }
567 pub fn is_group_call_participant(&self) -> bool { if let Update::GroupCallParticipant(_) = self { true } else { false } }
568 pub fn is_have_pending_notifications(&self) -> bool { if let Update::HavePendingNotifications(_) = self { true } else { false } }
569 pub fn is_installed_sticker_sets(&self) -> bool { if let Update::InstalledStickerSets(_) = self { true } else { false } }
570 pub fn is_language_pack_strings(&self) -> bool { if let Update::LanguagePackStrings(_) = self { true } else { false } }
571 pub fn is_message_content(&self) -> bool { if let Update::MessageContent(_) = self { true } else { false } }
572 pub fn is_message_content_opened(&self) -> bool { if let Update::MessageContentOpened(_) = self { true } else { false } }
573 pub fn is_message_edited(&self) -> bool { if let Update::MessageEdited(_) = self { true } else { false } }
574 pub fn is_message_interaction_info(&self) -> bool { if let Update::MessageInteractionInfo(_) = self { true } else { false } }
575 pub fn is_message_is_pinned(&self) -> bool { if let Update::MessageIsPinned(_) = self { true } else { false } }
576 pub fn is_message_live_location_viewed(&self) -> bool { if let Update::MessageLiveLocationViewed(_) = self { true } else { false } }
577 pub fn is_message_mention_read(&self) -> bool { if let Update::MessageMentionRead(_) = self { true } else { false } }
578 pub fn is_message_send_acknowledged(&self) -> bool { if let Update::MessageSendAcknowledged(_) = self { true } else { false } }
579 pub fn is_message_send_failed(&self) -> bool { if let Update::MessageSendFailed(_) = self { true } else { false } }
580 pub fn is_message_send_succeeded(&self) -> bool { if let Update::MessageSendSucceeded(_) = self { true } else { false } }
581 pub fn is_new_call_signaling_data(&self) -> bool { if let Update::NewCallSignalingData(_) = self { true } else { false } }
582 pub fn is_new_callback_query(&self) -> bool { if let Update::NewCallbackQuery(_) = self { true } else { false } }
583 pub fn is_new_chat(&self) -> bool { if let Update::NewChat(_) = self { true } else { false } }
584 pub fn is_new_chat_join_request(&self) -> bool { if let Update::NewChatJoinRequest(_) = self { true } else { false } }
585 pub fn is_new_chosen_inline_result(&self) -> bool { if let Update::NewChosenInlineResult(_) = self { true } else { false } }
586 pub fn is_new_custom_event(&self) -> bool { if let Update::NewCustomEvent(_) = self { true } else { false } }
587 pub fn is_new_custom_query(&self) -> bool { if let Update::NewCustomQuery(_) = self { true } else { false } }
588 pub fn is_new_inline_callback_query(&self) -> bool { if let Update::NewInlineCallbackQuery(_) = self { true } else { false } }
589 pub fn is_new_inline_query(&self) -> bool { if let Update::NewInlineQuery(_) = self { true } else { false } }
590 pub fn is_new_message(&self) -> bool { if let Update::NewMessage(_) = self { true } else { false } }
591 pub fn is_new_pre_checkout_query(&self) -> bool { if let Update::NewPreCheckoutQuery(_) = self { true } else { false } }
592 pub fn is_new_shipping_query(&self) -> bool { if let Update::NewShippingQuery(_) = self { true } else { false } }
593 pub fn is_notification(&self) -> bool { if let Update::Notification(_) = self { true } else { false } }
594 pub fn is_notification_group(&self) -> bool { if let Update::NotificationGroup(_) = self { true } else { false } }
595 pub fn is_option(&self) -> bool { if let Update::Option(_) = self { true } else { false } }
596 pub fn is_poll(&self) -> bool { if let Update::Poll(_) = self { true } else { false } }
597 pub fn is_poll_answer(&self) -> bool { if let Update::PollAnswer(_) = self { true } else { false } }
598 pub fn is_recent_stickers(&self) -> bool { if let Update::RecentStickers(_) = self { true } else { false } }
599 pub fn is_saved_animations(&self) -> bool { if let Update::SavedAnimations(_) = self { true } else { false } }
600 pub fn is_scope_notification_settings(&self) -> bool { if let Update::ScopeNotificationSettings(_) = self { true } else { false } }
601 pub fn is_secret_chat(&self) -> bool { if let Update::SecretChat(_) = self { true } else { false } }
602 pub fn is_selected_background(&self) -> bool { if let Update::SelectedBackground(_) = self { true } else { false } }
603 pub fn is_service_notification(&self) -> bool { if let Update::ServiceNotification(_) = self { true } else { false } }
604 pub fn is_sticker_set(&self) -> bool { if let Update::StickerSet(_) = self { true } else { false } }
605 pub fn is_suggested_actions(&self) -> bool { if let Update::SuggestedActions(_) = self { true } else { false } }
606 pub fn is_supergroup(&self) -> bool { if let Update::Supergroup(_) = self { true } else { false } }
607 pub fn is_supergroup_full_info(&self) -> bool { if let Update::SupergroupFullInfo(_) = self { true } else { false } }
608 pub fn is_terms_of_service(&self) -> bool { if let Update::TermsOfService(_) = self { true } else { false } }
609 pub fn is_trending_sticker_sets(&self) -> bool { if let Update::TrendingStickerSets(_) = self { true } else { false } }
610 pub fn is_unread_chat_count(&self) -> bool { if let Update::UnreadChatCount(_) = self { true } else { false } }
611 pub fn is_unread_message_count(&self) -> bool { if let Update::UnreadMessageCount(_) = self { true } else { false } }
612 pub fn is_user(&self) -> bool { if let Update::User(_) = self { true } else { false } }
613 pub fn is_user_full_info(&self) -> bool { if let Update::UserFullInfo(_) = self { true } else { false } }
614 pub fn is_user_privacy_setting_rules(&self) -> bool { if let Update::UserPrivacySettingRules(_) = self { true } else { false } }
615 pub fn is_user_status(&self) -> bool { if let Update::UserStatus(_) = self { true } else { false } }
616 pub fn is_users_nearby(&self) -> bool { if let Update::UsersNearby(_) = self { true } else { false } }
617
618 pub fn on_test_use_update<F: FnOnce(&TestUseUpdate)>(&self, fnc: F) -> &Self { if let Update::TestUseUpdate(t) = self { fnc(t) }; self }
619 pub fn on_active_notifications<F: FnOnce(&UpdateActiveNotifications)>(&self, fnc: F) -> &Self { if let Update::ActiveNotifications(t) = self { fnc(t) }; self }
620 pub fn on_animated_emoji_message_clicked<F: FnOnce(&UpdateAnimatedEmojiMessageClicked)>(&self, fnc: F) -> &Self { if let Update::AnimatedEmojiMessageClicked(t) = self { fnc(t) }; self }
621 pub fn on_animation_search_parameters<F: FnOnce(&UpdateAnimationSearchParameters)>(&self, fnc: F) -> &Self { if let Update::AnimationSearchParameters(t) = self { fnc(t) }; self }
622 pub fn on_authorization_state<F: FnOnce(&UpdateAuthorizationState)>(&self, fnc: F) -> &Self { if let Update::AuthorizationState(t) = self { fnc(t) }; self }
623 pub fn on_basic_group<F: FnOnce(&UpdateBasicGroup)>(&self, fnc: F) -> &Self { if let Update::BasicGroup(t) = self { fnc(t) }; self }
624 pub fn on_basic_group_full_info<F: FnOnce(&UpdateBasicGroupFullInfo)>(&self, fnc: F) -> &Self { if let Update::BasicGroupFullInfo(t) = self { fnc(t) }; self }
625 pub fn on_call<F: FnOnce(&UpdateCall)>(&self, fnc: F) -> &Self { if let Update::Call(t) = self { fnc(t) }; self }
626 pub fn on_chat_action<F: FnOnce(&UpdateChatAction)>(&self, fnc: F) -> &Self { if let Update::ChatAction(t) = self { fnc(t) }; self }
627 pub fn on_chat_action_bar<F: FnOnce(&UpdateChatActionBar)>(&self, fnc: F) -> &Self { if let Update::ChatActionBar(t) = self { fnc(t) }; self }
628 pub fn on_chat_default_disable_notification<F: FnOnce(&UpdateChatDefaultDisableNotification)>(&self, fnc: F) -> &Self { if let Update::ChatDefaultDisableNotification(t) = self { fnc(t) }; self }
629 pub fn on_chat_draft_message<F: FnOnce(&UpdateChatDraftMessage)>(&self, fnc: F) -> &Self { if let Update::ChatDraftMessage(t) = self { fnc(t) }; self }
630 pub fn on_chat_filters<F: FnOnce(&UpdateChatFilters)>(&self, fnc: F) -> &Self { if let Update::ChatFilters(t) = self { fnc(t) }; self }
631 pub fn on_chat_has_protected_content<F: FnOnce(&UpdateChatHasProtectedContent)>(&self, fnc: F) -> &Self { if let Update::ChatHasProtectedContent(t) = self { fnc(t) }; self }
632 pub fn on_chat_has_scheduled_messages<F: FnOnce(&UpdateChatHasScheduledMessages)>(&self, fnc: F) -> &Self { if let Update::ChatHasScheduledMessages(t) = self { fnc(t) }; self }
633 pub fn on_chat_is_blocked<F: FnOnce(&UpdateChatIsBlocked)>(&self, fnc: F) -> &Self { if let Update::ChatIsBlocked(t) = self { fnc(t) }; self }
634 pub fn on_chat_is_marked_as_unread<F: FnOnce(&UpdateChatIsMarkedAsUnread)>(&self, fnc: F) -> &Self { if let Update::ChatIsMarkedAsUnread(t) = self { fnc(t) }; self }
635 pub fn on_chat_last_message<F: FnOnce(&UpdateChatLastMessage)>(&self, fnc: F) -> &Self { if let Update::ChatLastMessage(t) = self { fnc(t) }; self }
636 pub fn on_chat_member<F: FnOnce(&UpdateChatMember)>(&self, fnc: F) -> &Self { if let Update::ChatMember(t) = self { fnc(t) }; self }
637 pub fn on_chat_message_sender<F: FnOnce(&UpdateChatMessageSender)>(&self, fnc: F) -> &Self { if let Update::ChatMessageSender(t) = self { fnc(t) }; self }
638 pub fn on_chat_message_ttl<F: FnOnce(&UpdateChatMessageTtl)>(&self, fnc: F) -> &Self { if let Update::ChatMessageTtl(t) = self { fnc(t) }; self }
639 pub fn on_chat_notification_settings<F: FnOnce(&UpdateChatNotificationSettings)>(&self, fnc: F) -> &Self { if let Update::ChatNotificationSettings(t) = self { fnc(t) }; self }
640 pub fn on_chat_online_member_count<F: FnOnce(&UpdateChatOnlineMemberCount)>(&self, fnc: F) -> &Self { if let Update::ChatOnlineMemberCount(t) = self { fnc(t) }; self }
641 pub fn on_chat_pending_join_requests<F: FnOnce(&UpdateChatPendingJoinRequests)>(&self, fnc: F) -> &Self { if let Update::ChatPendingJoinRequests(t) = self { fnc(t) }; self }
642 pub fn on_chat_permissions<F: FnOnce(&UpdateChatPermissions)>(&self, fnc: F) -> &Self { if let Update::ChatPermissions(t) = self { fnc(t) }; self }
643 pub fn on_chat_photo<F: FnOnce(&UpdateChatPhoto)>(&self, fnc: F) -> &Self { if let Update::ChatPhoto(t) = self { fnc(t) }; self }
644 pub fn on_chat_position<F: FnOnce(&UpdateChatPosition)>(&self, fnc: F) -> &Self { if let Update::ChatPosition(t) = self { fnc(t) }; self }
645 pub fn on_chat_read_inbox<F: FnOnce(&UpdateChatReadInbox)>(&self, fnc: F) -> &Self { if let Update::ChatReadInbox(t) = self { fnc(t) }; self }
646 pub fn on_chat_read_outbox<F: FnOnce(&UpdateChatReadOutbox)>(&self, fnc: F) -> &Self { if let Update::ChatReadOutbox(t) = self { fnc(t) }; self }
647 pub fn on_chat_reply_markup<F: FnOnce(&UpdateChatReplyMarkup)>(&self, fnc: F) -> &Self { if let Update::ChatReplyMarkup(t) = self { fnc(t) }; self }
648 pub fn on_chat_theme<F: FnOnce(&UpdateChatTheme)>(&self, fnc: F) -> &Self { if let Update::ChatTheme(t) = self { fnc(t) }; self }
649 pub fn on_chat_themes<F: FnOnce(&UpdateChatThemes)>(&self, fnc: F) -> &Self { if let Update::ChatThemes(t) = self { fnc(t) }; self }
650 pub fn on_chat_title<F: FnOnce(&UpdateChatTitle)>(&self, fnc: F) -> &Self { if let Update::ChatTitle(t) = self { fnc(t) }; self }
651 pub fn on_chat_unread_mention_count<F: FnOnce(&UpdateChatUnreadMentionCount)>(&self, fnc: F) -> &Self { if let Update::ChatUnreadMentionCount(t) = self { fnc(t) }; self }
652 pub fn on_chat_video_chat<F: FnOnce(&UpdateChatVideoChat)>(&self, fnc: F) -> &Self { if let Update::ChatVideoChat(t) = self { fnc(t) }; self }
653 pub fn on_connection_state<F: FnOnce(&UpdateConnectionState)>(&self, fnc: F) -> &Self { if let Update::ConnectionState(t) = self { fnc(t) }; self }
654 pub fn on_delete_messages<F: FnOnce(&UpdateDeleteMessages)>(&self, fnc: F) -> &Self { if let Update::DeleteMessages(t) = self { fnc(t) }; self }
655 pub fn on_dice_emojis<F: FnOnce(&UpdateDiceEmojis)>(&self, fnc: F) -> &Self { if let Update::DiceEmojis(t) = self { fnc(t) }; self }
656 pub fn on_favorite_stickers<F: FnOnce(&UpdateFavoriteStickers)>(&self, fnc: F) -> &Self { if let Update::FavoriteStickers(t) = self { fnc(t) }; self }
657 pub fn on_file<F: FnOnce(&UpdateFile)>(&self, fnc: F) -> &Self { if let Update::File(t) = self { fnc(t) }; self }
658 pub fn on_file_generation_start<F: FnOnce(&UpdateFileGenerationStart)>(&self, fnc: F) -> &Self { if let Update::FileGenerationStart(t) = self { fnc(t) }; self }
659 pub fn on_file_generation_stop<F: FnOnce(&UpdateFileGenerationStop)>(&self, fnc: F) -> &Self { if let Update::FileGenerationStop(t) = self { fnc(t) }; self }
660 pub fn on_group_call<F: FnOnce(&UpdateGroupCall)>(&self, fnc: F) -> &Self { if let Update::GroupCall(t) = self { fnc(t) }; self }
661 pub fn on_group_call_participant<F: FnOnce(&UpdateGroupCallParticipant)>(&self, fnc: F) -> &Self { if let Update::GroupCallParticipant(t) = self { fnc(t) }; self }
662 pub fn on_have_pending_notifications<F: FnOnce(&UpdateHavePendingNotifications)>(&self, fnc: F) -> &Self { if let Update::HavePendingNotifications(t) = self { fnc(t) }; self }
663 pub fn on_installed_sticker_sets<F: FnOnce(&UpdateInstalledStickerSets)>(&self, fnc: F) -> &Self { if let Update::InstalledStickerSets(t) = self { fnc(t) }; self }
664 pub fn on_language_pack_strings<F: FnOnce(&UpdateLanguagePackStrings)>(&self, fnc: F) -> &Self { if let Update::LanguagePackStrings(t) = self { fnc(t) }; self }
665 pub fn on_message_content<F: FnOnce(&UpdateMessageContent)>(&self, fnc: F) -> &Self { if let Update::MessageContent(t) = self { fnc(t) }; self }
666 pub fn on_message_content_opened<F: FnOnce(&UpdateMessageContentOpened)>(&self, fnc: F) -> &Self { if let Update::MessageContentOpened(t) = self { fnc(t) }; self }
667 pub fn on_message_edited<F: FnOnce(&UpdateMessageEdited)>(&self, fnc: F) -> &Self { if let Update::MessageEdited(t) = self { fnc(t) }; self }
668 pub fn on_message_interaction_info<F: FnOnce(&UpdateMessageInteractionInfo)>(&self, fnc: F) -> &Self { if let Update::MessageInteractionInfo(t) = self { fnc(t) }; self }
669 pub fn on_message_is_pinned<F: FnOnce(&UpdateMessageIsPinned)>(&self, fnc: F) -> &Self { if let Update::MessageIsPinned(t) = self { fnc(t) }; self }
670 pub fn on_message_live_location_viewed<F: FnOnce(&UpdateMessageLiveLocationViewed)>(&self, fnc: F) -> &Self { if let Update::MessageLiveLocationViewed(t) = self { fnc(t) }; self }
671 pub fn on_message_mention_read<F: FnOnce(&UpdateMessageMentionRead)>(&self, fnc: F) -> &Self { if let Update::MessageMentionRead(t) = self { fnc(t) }; self }
672 pub fn on_message_send_acknowledged<F: FnOnce(&UpdateMessageSendAcknowledged)>(&self, fnc: F) -> &Self { if let Update::MessageSendAcknowledged(t) = self { fnc(t) }; self }
673 pub fn on_message_send_failed<F: FnOnce(&UpdateMessageSendFailed)>(&self, fnc: F) -> &Self { if let Update::MessageSendFailed(t) = self { fnc(t) }; self }
674 pub fn on_message_send_succeeded<F: FnOnce(&UpdateMessageSendSucceeded)>(&self, fnc: F) -> &Self { if let Update::MessageSendSucceeded(t) = self { fnc(t) }; self }
675 pub fn on_new_call_signaling_data<F: FnOnce(&UpdateNewCallSignalingData)>(&self, fnc: F) -> &Self { if let Update::NewCallSignalingData(t) = self { fnc(t) }; self }
676 pub fn on_new_callback_query<F: FnOnce(&UpdateNewCallbackQuery)>(&self, fnc: F) -> &Self { if let Update::NewCallbackQuery(t) = self { fnc(t) }; self }
677 pub fn on_new_chat<F: FnOnce(&UpdateNewChat)>(&self, fnc: F) -> &Self { if let Update::NewChat(t) = self { fnc(t) }; self }
678 pub fn on_new_chat_join_request<F: FnOnce(&UpdateNewChatJoinRequest)>(&self, fnc: F) -> &Self { if let Update::NewChatJoinRequest(t) = self { fnc(t) }; self }
679 pub fn on_new_chosen_inline_result<F: FnOnce(&UpdateNewChosenInlineResult)>(&self, fnc: F) -> &Self { if let Update::NewChosenInlineResult(t) = self { fnc(t) }; self }
680 pub fn on_new_custom_event<F: FnOnce(&UpdateNewCustomEvent)>(&self, fnc: F) -> &Self { if let Update::NewCustomEvent(t) = self { fnc(t) }; self }
681 pub fn on_new_custom_query<F: FnOnce(&UpdateNewCustomQuery)>(&self, fnc: F) -> &Self { if let Update::NewCustomQuery(t) = self { fnc(t) }; self }
682 pub fn on_new_inline_callback_query<F: FnOnce(&UpdateNewInlineCallbackQuery)>(&self, fnc: F) -> &Self { if let Update::NewInlineCallbackQuery(t) = self { fnc(t) }; self }
683 pub fn on_new_inline_query<F: FnOnce(&UpdateNewInlineQuery)>(&self, fnc: F) -> &Self { if let Update::NewInlineQuery(t) = self { fnc(t) }; self }
684 pub fn on_new_message<F: FnOnce(&UpdateNewMessage)>(&self, fnc: F) -> &Self { if let Update::NewMessage(t) = self { fnc(t) }; self }
685 pub fn on_new_pre_checkout_query<F: FnOnce(&UpdateNewPreCheckoutQuery)>(&self, fnc: F) -> &Self { if let Update::NewPreCheckoutQuery(t) = self { fnc(t) }; self }
686 pub fn on_new_shipping_query<F: FnOnce(&UpdateNewShippingQuery)>(&self, fnc: F) -> &Self { if let Update::NewShippingQuery(t) = self { fnc(t) }; self }
687 pub fn on_notification<F: FnOnce(&UpdateNotification)>(&self, fnc: F) -> &Self { if let Update::Notification(t) = self { fnc(t) }; self }
688 pub fn on_notification_group<F: FnOnce(&UpdateNotificationGroup)>(&self, fnc: F) -> &Self { if let Update::NotificationGroup(t) = self { fnc(t) }; self }
689 pub fn on_option<F: FnOnce(&UpdateOption)>(&self, fnc: F) -> &Self { if let Update::Option(t) = self { fnc(t) }; self }
690 pub fn on_poll<F: FnOnce(&UpdatePoll)>(&self, fnc: F) -> &Self { if let Update::Poll(t) = self { fnc(t) }; self }
691 pub fn on_poll_answer<F: FnOnce(&UpdatePollAnswer)>(&self, fnc: F) -> &Self { if let Update::PollAnswer(t) = self { fnc(t) }; self }
692 pub fn on_recent_stickers<F: FnOnce(&UpdateRecentStickers)>(&self, fnc: F) -> &Self { if let Update::RecentStickers(t) = self { fnc(t) }; self }
693 pub fn on_saved_animations<F: FnOnce(&UpdateSavedAnimations)>(&self, fnc: F) -> &Self { if let Update::SavedAnimations(t) = self { fnc(t) }; self }
694 pub fn on_scope_notification_settings<F: FnOnce(&UpdateScopeNotificationSettings)>(&self, fnc: F) -> &Self { if let Update::ScopeNotificationSettings(t) = self { fnc(t) }; self }
695 pub fn on_secret_chat<F: FnOnce(&UpdateSecretChat)>(&self, fnc: F) -> &Self { if let Update::SecretChat(t) = self { fnc(t) }; self }
696 pub fn on_selected_background<F: FnOnce(&UpdateSelectedBackground)>(&self, fnc: F) -> &Self { if let Update::SelectedBackground(t) = self { fnc(t) }; self }
697 pub fn on_service_notification<F: FnOnce(&UpdateServiceNotification)>(&self, fnc: F) -> &Self { if let Update::ServiceNotification(t) = self { fnc(t) }; self }
698 pub fn on_sticker_set<F: FnOnce(&UpdateStickerSet)>(&self, fnc: F) -> &Self { if let Update::StickerSet(t) = self { fnc(t) }; self }
699 pub fn on_suggested_actions<F: FnOnce(&UpdateSuggestedActions)>(&self, fnc: F) -> &Self { if let Update::SuggestedActions(t) = self { fnc(t) }; self }
700 pub fn on_supergroup<F: FnOnce(&UpdateSupergroup)>(&self, fnc: F) -> &Self { if let Update::Supergroup(t) = self { fnc(t) }; self }
701 pub fn on_supergroup_full_info<F: FnOnce(&UpdateSupergroupFullInfo)>(&self, fnc: F) -> &Self { if let Update::SupergroupFullInfo(t) = self { fnc(t) }; self }
702 pub fn on_terms_of_service<F: FnOnce(&UpdateTermsOfService)>(&self, fnc: F) -> &Self { if let Update::TermsOfService(t) = self { fnc(t) }; self }
703 pub fn on_trending_sticker_sets<F: FnOnce(&UpdateTrendingStickerSets)>(&self, fnc: F) -> &Self { if let Update::TrendingStickerSets(t) = self { fnc(t) }; self }
704 pub fn on_unread_chat_count<F: FnOnce(&UpdateUnreadChatCount)>(&self, fnc: F) -> &Self { if let Update::UnreadChatCount(t) = self { fnc(t) }; self }
705 pub fn on_unread_message_count<F: FnOnce(&UpdateUnreadMessageCount)>(&self, fnc: F) -> &Self { if let Update::UnreadMessageCount(t) = self { fnc(t) }; self }
706 pub fn on_user<F: FnOnce(&UpdateUser)>(&self, fnc: F) -> &Self { if let Update::User(t) = self { fnc(t) }; self }
707 pub fn on_user_full_info<F: FnOnce(&UpdateUserFullInfo)>(&self, fnc: F) -> &Self { if let Update::UserFullInfo(t) = self { fnc(t) }; self }
708 pub fn on_user_privacy_setting_rules<F: FnOnce(&UpdateUserPrivacySettingRules)>(&self, fnc: F) -> &Self { if let Update::UserPrivacySettingRules(t) = self { fnc(t) }; self }
709 pub fn on_user_status<F: FnOnce(&UpdateUserStatus)>(&self, fnc: F) -> &Self { if let Update::UserStatus(t) = self { fnc(t) }; self }
710 pub fn on_users_nearby<F: FnOnce(&UpdateUsersNearby)>(&self, fnc: F) -> &Self { if let Update::UsersNearby(t) = self { fnc(t) }; self }
711
712 pub fn as_test_use_update(&self) -> Option<&TestUseUpdate> { if let Update::TestUseUpdate(t) = self { return Some(t) } None }
713 pub fn as_active_notifications(&self) -> Option<&UpdateActiveNotifications> { if let Update::ActiveNotifications(t) = self { return Some(t) } None }
714 pub fn as_animated_emoji_message_clicked(&self) -> Option<&UpdateAnimatedEmojiMessageClicked> { if let Update::AnimatedEmojiMessageClicked(t) = self { return Some(t) } None }
715 pub fn as_animation_search_parameters(&self) -> Option<&UpdateAnimationSearchParameters> { if let Update::AnimationSearchParameters(t) = self { return Some(t) } None }
716 pub fn as_authorization_state(&self) -> Option<&UpdateAuthorizationState> { if let Update::AuthorizationState(t) = self { return Some(t) } None }
717 pub fn as_basic_group(&self) -> Option<&UpdateBasicGroup> { if let Update::BasicGroup(t) = self { return Some(t) } None }
718 pub fn as_basic_group_full_info(&self) -> Option<&UpdateBasicGroupFullInfo> { if let Update::BasicGroupFullInfo(t) = self { return Some(t) } None }
719 pub fn as_call(&self) -> Option<&UpdateCall> { if let Update::Call(t) = self { return Some(t) } None }
720 pub fn as_chat_action(&self) -> Option<&UpdateChatAction> { if let Update::ChatAction(t) = self { return Some(t) } None }
721 pub fn as_chat_action_bar(&self) -> Option<&UpdateChatActionBar> { if let Update::ChatActionBar(t) = self { return Some(t) } None }
722 pub fn as_chat_default_disable_notification(&self) -> Option<&UpdateChatDefaultDisableNotification> { if let Update::ChatDefaultDisableNotification(t) = self { return Some(t) } None }
723 pub fn as_chat_draft_message(&self) -> Option<&UpdateChatDraftMessage> { if let Update::ChatDraftMessage(t) = self { return Some(t) } None }
724 pub fn as_chat_filters(&self) -> Option<&UpdateChatFilters> { if let Update::ChatFilters(t) = self { return Some(t) } None }
725 pub fn as_chat_has_protected_content(&self) -> Option<&UpdateChatHasProtectedContent> { if let Update::ChatHasProtectedContent(t) = self { return Some(t) } None }
726 pub fn as_chat_has_scheduled_messages(&self) -> Option<&UpdateChatHasScheduledMessages> { if let Update::ChatHasScheduledMessages(t) = self { return Some(t) } None }
727 pub fn as_chat_is_blocked(&self) -> Option<&UpdateChatIsBlocked> { if let Update::ChatIsBlocked(t) = self { return Some(t) } None }
728 pub fn as_chat_is_marked_as_unread(&self) -> Option<&UpdateChatIsMarkedAsUnread> { if let Update::ChatIsMarkedAsUnread(t) = self { return Some(t) } None }
729 pub fn as_chat_last_message(&self) -> Option<&UpdateChatLastMessage> { if let Update::ChatLastMessage(t) = self { return Some(t) } None }
730 pub fn as_chat_member(&self) -> Option<&UpdateChatMember> { if let Update::ChatMember(t) = self { return Some(t) } None }
731 pub fn as_chat_message_sender(&self) -> Option<&UpdateChatMessageSender> { if let Update::ChatMessageSender(t) = self { return Some(t) } None }
732 pub fn as_chat_message_ttl(&self) -> Option<&UpdateChatMessageTtl> { if let Update::ChatMessageTtl(t) = self { return Some(t) } None }
733 pub fn as_chat_notification_settings(&self) -> Option<&UpdateChatNotificationSettings> { if let Update::ChatNotificationSettings(t) = self { return Some(t) } None }
734 pub fn as_chat_online_member_count(&self) -> Option<&UpdateChatOnlineMemberCount> { if let Update::ChatOnlineMemberCount(t) = self { return Some(t) } None }
735 pub fn as_chat_pending_join_requests(&self) -> Option<&UpdateChatPendingJoinRequests> { if let Update::ChatPendingJoinRequests(t) = self { return Some(t) } None }
736 pub fn as_chat_permissions(&self) -> Option<&UpdateChatPermissions> { if let Update::ChatPermissions(t) = self { return Some(t) } None }
737 pub fn as_chat_photo(&self) -> Option<&UpdateChatPhoto> { if let Update::ChatPhoto(t) = self { return Some(t) } None }
738 pub fn as_chat_position(&self) -> Option<&UpdateChatPosition> { if let Update::ChatPosition(t) = self { return Some(t) } None }
739 pub fn as_chat_read_inbox(&self) -> Option<&UpdateChatReadInbox> { if let Update::ChatReadInbox(t) = self { return Some(t) } None }
740 pub fn as_chat_read_outbox(&self) -> Option<&UpdateChatReadOutbox> { if let Update::ChatReadOutbox(t) = self { return Some(t) } None }
741 pub fn as_chat_reply_markup(&self) -> Option<&UpdateChatReplyMarkup> { if let Update::ChatReplyMarkup(t) = self { return Some(t) } None }
742 pub fn as_chat_theme(&self) -> Option<&UpdateChatTheme> { if let Update::ChatTheme(t) = self { return Some(t) } None }
743 pub fn as_chat_themes(&self) -> Option<&UpdateChatThemes> { if let Update::ChatThemes(t) = self { return Some(t) } None }
744 pub fn as_chat_title(&self) -> Option<&UpdateChatTitle> { if let Update::ChatTitle(t) = self { return Some(t) } None }
745 pub fn as_chat_unread_mention_count(&self) -> Option<&UpdateChatUnreadMentionCount> { if let Update::ChatUnreadMentionCount(t) = self { return Some(t) } None }
746 pub fn as_chat_video_chat(&self) -> Option<&UpdateChatVideoChat> { if let Update::ChatVideoChat(t) = self { return Some(t) } None }
747 pub fn as_connection_state(&self) -> Option<&UpdateConnectionState> { if let Update::ConnectionState(t) = self { return Some(t) } None }
748 pub fn as_delete_messages(&self) -> Option<&UpdateDeleteMessages> { if let Update::DeleteMessages(t) = self { return Some(t) } None }
749 pub fn as_dice_emojis(&self) -> Option<&UpdateDiceEmojis> { if let Update::DiceEmojis(t) = self { return Some(t) } None }
750 pub fn as_favorite_stickers(&self) -> Option<&UpdateFavoriteStickers> { if let Update::FavoriteStickers(t) = self { return Some(t) } None }
751 pub fn as_file(&self) -> Option<&UpdateFile> { if let Update::File(t) = self { return Some(t) } None }
752 pub fn as_file_generation_start(&self) -> Option<&UpdateFileGenerationStart> { if let Update::FileGenerationStart(t) = self { return Some(t) } None }
753 pub fn as_file_generation_stop(&self) -> Option<&UpdateFileGenerationStop> { if let Update::FileGenerationStop(t) = self { return Some(t) } None }
754 pub fn as_group_call(&self) -> Option<&UpdateGroupCall> { if let Update::GroupCall(t) = self { return Some(t) } None }
755 pub fn as_group_call_participant(&self) -> Option<&UpdateGroupCallParticipant> { if let Update::GroupCallParticipant(t) = self { return Some(t) } None }
756 pub fn as_have_pending_notifications(&self) -> Option<&UpdateHavePendingNotifications> { if let Update::HavePendingNotifications(t) = self { return Some(t) } None }
757 pub fn as_installed_sticker_sets(&self) -> Option<&UpdateInstalledStickerSets> { if let Update::InstalledStickerSets(t) = self { return Some(t) } None }
758 pub fn as_language_pack_strings(&self) -> Option<&UpdateLanguagePackStrings> { if let Update::LanguagePackStrings(t) = self { return Some(t) } None }
759 pub fn as_message_content(&self) -> Option<&UpdateMessageContent> { if let Update::MessageContent(t) = self { return Some(t) } None }
760 pub fn as_message_content_opened(&self) -> Option<&UpdateMessageContentOpened> { if let Update::MessageContentOpened(t) = self { return Some(t) } None }
761 pub fn as_message_edited(&self) -> Option<&UpdateMessageEdited> { if let Update::MessageEdited(t) = self { return Some(t) } None }
762 pub fn as_message_interaction_info(&self) -> Option<&UpdateMessageInteractionInfo> { if let Update::MessageInteractionInfo(t) = self { return Some(t) } None }
763 pub fn as_message_is_pinned(&self) -> Option<&UpdateMessageIsPinned> { if let Update::MessageIsPinned(t) = self { return Some(t) } None }
764 pub fn as_message_live_location_viewed(&self) -> Option<&UpdateMessageLiveLocationViewed> { if let Update::MessageLiveLocationViewed(t) = self { return Some(t) } None }
765 pub fn as_message_mention_read(&self) -> Option<&UpdateMessageMentionRead> { if let Update::MessageMentionRead(t) = self { return Some(t) } None }
766 pub fn as_message_send_acknowledged(&self) -> Option<&UpdateMessageSendAcknowledged> { if let Update::MessageSendAcknowledged(t) = self { return Some(t) } None }
767 pub fn as_message_send_failed(&self) -> Option<&UpdateMessageSendFailed> { if let Update::MessageSendFailed(t) = self { return Some(t) } None }
768 pub fn as_message_send_succeeded(&self) -> Option<&UpdateMessageSendSucceeded> { if let Update::MessageSendSucceeded(t) = self { return Some(t) } None }
769 pub fn as_new_call_signaling_data(&self) -> Option<&UpdateNewCallSignalingData> { if let Update::NewCallSignalingData(t) = self { return Some(t) } None }
770 pub fn as_new_callback_query(&self) -> Option<&UpdateNewCallbackQuery> { if let Update::NewCallbackQuery(t) = self { return Some(t) } None }
771 pub fn as_new_chat(&self) -> Option<&UpdateNewChat> { if let Update::NewChat(t) = self { return Some(t) } None }
772 pub fn as_new_chat_join_request(&self) -> Option<&UpdateNewChatJoinRequest> { if let Update::NewChatJoinRequest(t) = self { return Some(t) } None }
773 pub fn as_new_chosen_inline_result(&self) -> Option<&UpdateNewChosenInlineResult> { if let Update::NewChosenInlineResult(t) = self { return Some(t) } None }
774 pub fn as_new_custom_event(&self) -> Option<&UpdateNewCustomEvent> { if let Update::NewCustomEvent(t) = self { return Some(t) } None }
775 pub fn as_new_custom_query(&self) -> Option<&UpdateNewCustomQuery> { if let Update::NewCustomQuery(t) = self { return Some(t) } None }
776 pub fn as_new_inline_callback_query(&self) -> Option<&UpdateNewInlineCallbackQuery> { if let Update::NewInlineCallbackQuery(t) = self { return Some(t) } None }
777 pub fn as_new_inline_query(&self) -> Option<&UpdateNewInlineQuery> { if let Update::NewInlineQuery(t) = self { return Some(t) } None }
778 pub fn as_new_message(&self) -> Option<&UpdateNewMessage> { if let Update::NewMessage(t) = self { return Some(t) } None }
779 pub fn as_new_pre_checkout_query(&self) -> Option<&UpdateNewPreCheckoutQuery> { if let Update::NewPreCheckoutQuery(t) = self { return Some(t) } None }
780 pub fn as_new_shipping_query(&self) -> Option<&UpdateNewShippingQuery> { if let Update::NewShippingQuery(t) = self { return Some(t) } None }
781 pub fn as_notification(&self) -> Option<&UpdateNotification> { if let Update::Notification(t) = self { return Some(t) } None }
782 pub fn as_notification_group(&self) -> Option<&UpdateNotificationGroup> { if let Update::NotificationGroup(t) = self { return Some(t) } None }
783 pub fn as_option(&self) -> Option<&UpdateOption> { if let Update::Option(t) = self { return Some(t) } None }
784 pub fn as_poll(&self) -> Option<&UpdatePoll> { if let Update::Poll(t) = self { return Some(t) } None }
785 pub fn as_poll_answer(&self) -> Option<&UpdatePollAnswer> { if let Update::PollAnswer(t) = self { return Some(t) } None }
786 pub fn as_recent_stickers(&self) -> Option<&UpdateRecentStickers> { if let Update::RecentStickers(t) = self { return Some(t) } None }
787 pub fn as_saved_animations(&self) -> Option<&UpdateSavedAnimations> { if let Update::SavedAnimations(t) = self { return Some(t) } None }
788 pub fn as_scope_notification_settings(&self) -> Option<&UpdateScopeNotificationSettings> { if let Update::ScopeNotificationSettings(t) = self { return Some(t) } None }
789 pub fn as_secret_chat(&self) -> Option<&UpdateSecretChat> { if let Update::SecretChat(t) = self { return Some(t) } None }
790 pub fn as_selected_background(&self) -> Option<&UpdateSelectedBackground> { if let Update::SelectedBackground(t) = self { return Some(t) } None }
791 pub fn as_service_notification(&self) -> Option<&UpdateServiceNotification> { if let Update::ServiceNotification(t) = self { return Some(t) } None }
792 pub fn as_sticker_set(&self) -> Option<&UpdateStickerSet> { if let Update::StickerSet(t) = self { return Some(t) } None }
793 pub fn as_suggested_actions(&self) -> Option<&UpdateSuggestedActions> { if let Update::SuggestedActions(t) = self { return Some(t) } None }
794 pub fn as_supergroup(&self) -> Option<&UpdateSupergroup> { if let Update::Supergroup(t) = self { return Some(t) } None }
795 pub fn as_supergroup_full_info(&self) -> Option<&UpdateSupergroupFullInfo> { if let Update::SupergroupFullInfo(t) = self { return Some(t) } None }
796 pub fn as_terms_of_service(&self) -> Option<&UpdateTermsOfService> { if let Update::TermsOfService(t) = self { return Some(t) } None }
797 pub fn as_trending_sticker_sets(&self) -> Option<&UpdateTrendingStickerSets> { if let Update::TrendingStickerSets(t) = self { return Some(t) } None }
798 pub fn as_unread_chat_count(&self) -> Option<&UpdateUnreadChatCount> { if let Update::UnreadChatCount(t) = self { return Some(t) } None }
799 pub fn as_unread_message_count(&self) -> Option<&UpdateUnreadMessageCount> { if let Update::UnreadMessageCount(t) = self { return Some(t) } None }
800 pub fn as_user(&self) -> Option<&UpdateUser> { if let Update::User(t) = self { return Some(t) } None }
801 pub fn as_user_full_info(&self) -> Option<&UpdateUserFullInfo> { if let Update::UserFullInfo(t) = self { return Some(t) } None }
802 pub fn as_user_privacy_setting_rules(&self) -> Option<&UpdateUserPrivacySettingRules> { if let Update::UserPrivacySettingRules(t) = self { return Some(t) } None }
803 pub fn as_user_status(&self) -> Option<&UpdateUserStatus> { if let Update::UserStatus(t) = self { return Some(t) } None }
804 pub fn as_users_nearby(&self) -> Option<&UpdateUsersNearby> { if let Update::UsersNearby(t) = self { return Some(t) } None }
805
806
807
808 pub fn test_use_update<T: AsRef<TestUseUpdate>>(t: T) -> Self { Update::TestUseUpdate(t.as_ref().clone()) }
809
810 pub fn active_notifications<T: AsRef<UpdateActiveNotifications>>(t: T) -> Self { Update::ActiveNotifications(t.as_ref().clone()) }
811
812 pub fn animated_emoji_message_clicked<T: AsRef<UpdateAnimatedEmojiMessageClicked>>(t: T) -> Self { Update::AnimatedEmojiMessageClicked(t.as_ref().clone()) }
813
814 pub fn animation_search_parameters<T: AsRef<UpdateAnimationSearchParameters>>(t: T) -> Self { Update::AnimationSearchParameters(t.as_ref().clone()) }
815
816 pub fn authorization_state<T: AsRef<UpdateAuthorizationState>>(t: T) -> Self { Update::AuthorizationState(t.as_ref().clone()) }
817
818 pub fn basic_group<T: AsRef<UpdateBasicGroup>>(t: T) -> Self { Update::BasicGroup(t.as_ref().clone()) }
819
820 pub fn basic_group_full_info<T: AsRef<UpdateBasicGroupFullInfo>>(t: T) -> Self { Update::BasicGroupFullInfo(t.as_ref().clone()) }
821
822 pub fn call<T: AsRef<UpdateCall>>(t: T) -> Self { Update::Call(t.as_ref().clone()) }
823
824 pub fn chat_action<T: AsRef<UpdateChatAction>>(t: T) -> Self { Update::ChatAction(t.as_ref().clone()) }
825
826 pub fn chat_action_bar<T: AsRef<UpdateChatActionBar>>(t: T) -> Self { Update::ChatActionBar(t.as_ref().clone()) }
827
828 pub fn chat_default_disable_notification<T: AsRef<UpdateChatDefaultDisableNotification>>(t: T) -> Self { Update::ChatDefaultDisableNotification(t.as_ref().clone()) }
829
830 pub fn chat_draft_message<T: AsRef<UpdateChatDraftMessage>>(t: T) -> Self { Update::ChatDraftMessage(t.as_ref().clone()) }
831
832 pub fn chat_filters<T: AsRef<UpdateChatFilters>>(t: T) -> Self { Update::ChatFilters(t.as_ref().clone()) }
833
834 pub fn chat_has_protected_content<T: AsRef<UpdateChatHasProtectedContent>>(t: T) -> Self { Update::ChatHasProtectedContent(t.as_ref().clone()) }
835
836 pub fn chat_has_scheduled_messages<T: AsRef<UpdateChatHasScheduledMessages>>(t: T) -> Self { Update::ChatHasScheduledMessages(t.as_ref().clone()) }
837
838 pub fn chat_is_blocked<T: AsRef<UpdateChatIsBlocked>>(t: T) -> Self { Update::ChatIsBlocked(t.as_ref().clone()) }
839
840 pub fn chat_is_marked_as_unread<T: AsRef<UpdateChatIsMarkedAsUnread>>(t: T) -> Self { Update::ChatIsMarkedAsUnread(t.as_ref().clone()) }
841
842 pub fn chat_last_message<T: AsRef<UpdateChatLastMessage>>(t: T) -> Self { Update::ChatLastMessage(t.as_ref().clone()) }
843
844 pub fn chat_member<T: AsRef<UpdateChatMember>>(t: T) -> Self { Update::ChatMember(t.as_ref().clone()) }
845
846 pub fn chat_message_sender<T: AsRef<UpdateChatMessageSender>>(t: T) -> Self { Update::ChatMessageSender(t.as_ref().clone()) }
847
848 pub fn chat_message_ttl<T: AsRef<UpdateChatMessageTtl>>(t: T) -> Self { Update::ChatMessageTtl(t.as_ref().clone()) }
849
850 pub fn chat_notification_settings<T: AsRef<UpdateChatNotificationSettings>>(t: T) -> Self { Update::ChatNotificationSettings(t.as_ref().clone()) }
851
852 pub fn chat_online_member_count<T: AsRef<UpdateChatOnlineMemberCount>>(t: T) -> Self { Update::ChatOnlineMemberCount(t.as_ref().clone()) }
853
854 pub fn chat_pending_join_requests<T: AsRef<UpdateChatPendingJoinRequests>>(t: T) -> Self { Update::ChatPendingJoinRequests(t.as_ref().clone()) }
855
856 pub fn chat_permissions<T: AsRef<UpdateChatPermissions>>(t: T) -> Self { Update::ChatPermissions(t.as_ref().clone()) }
857
858 pub fn chat_photo<T: AsRef<UpdateChatPhoto>>(t: T) -> Self { Update::ChatPhoto(t.as_ref().clone()) }
859
860 pub fn chat_position<T: AsRef<UpdateChatPosition>>(t: T) -> Self { Update::ChatPosition(t.as_ref().clone()) }
861
862 pub fn chat_read_inbox<T: AsRef<UpdateChatReadInbox>>(t: T) -> Self { Update::ChatReadInbox(t.as_ref().clone()) }
863
864 pub fn chat_read_outbox<T: AsRef<UpdateChatReadOutbox>>(t: T) -> Self { Update::ChatReadOutbox(t.as_ref().clone()) }
865
866 pub fn chat_reply_markup<T: AsRef<UpdateChatReplyMarkup>>(t: T) -> Self { Update::ChatReplyMarkup(t.as_ref().clone()) }
867
868 pub fn chat_theme<T: AsRef<UpdateChatTheme>>(t: T) -> Self { Update::ChatTheme(t.as_ref().clone()) }
869
870 pub fn chat_themes<T: AsRef<UpdateChatThemes>>(t: T) -> Self { Update::ChatThemes(t.as_ref().clone()) }
871
872 pub fn chat_title<T: AsRef<UpdateChatTitle>>(t: T) -> Self { Update::ChatTitle(t.as_ref().clone()) }
873
874 pub fn chat_unread_mention_count<T: AsRef<UpdateChatUnreadMentionCount>>(t: T) -> Self { Update::ChatUnreadMentionCount(t.as_ref().clone()) }
875
876 pub fn chat_video_chat<T: AsRef<UpdateChatVideoChat>>(t: T) -> Self { Update::ChatVideoChat(t.as_ref().clone()) }
877
878 pub fn connection_state<T: AsRef<UpdateConnectionState>>(t: T) -> Self { Update::ConnectionState(t.as_ref().clone()) }
879
880 pub fn delete_messages<T: AsRef<UpdateDeleteMessages>>(t: T) -> Self { Update::DeleteMessages(t.as_ref().clone()) }
881
882 pub fn dice_emojis<T: AsRef<UpdateDiceEmojis>>(t: T) -> Self { Update::DiceEmojis(t.as_ref().clone()) }
883
884 pub fn favorite_stickers<T: AsRef<UpdateFavoriteStickers>>(t: T) -> Self { Update::FavoriteStickers(t.as_ref().clone()) }
885
886 pub fn file<T: AsRef<UpdateFile>>(t: T) -> Self { Update::File(t.as_ref().clone()) }
887
888 pub fn file_generation_start<T: AsRef<UpdateFileGenerationStart>>(t: T) -> Self { Update::FileGenerationStart(t.as_ref().clone()) }
889
890 pub fn file_generation_stop<T: AsRef<UpdateFileGenerationStop>>(t: T) -> Self { Update::FileGenerationStop(t.as_ref().clone()) }
891
892 pub fn group_call<T: AsRef<UpdateGroupCall>>(t: T) -> Self { Update::GroupCall(t.as_ref().clone()) }
893
894 pub fn group_call_participant<T: AsRef<UpdateGroupCallParticipant>>(t: T) -> Self { Update::GroupCallParticipant(t.as_ref().clone()) }
895
896 pub fn have_pending_notifications<T: AsRef<UpdateHavePendingNotifications>>(t: T) -> Self { Update::HavePendingNotifications(t.as_ref().clone()) }
897
898 pub fn installed_sticker_sets<T: AsRef<UpdateInstalledStickerSets>>(t: T) -> Self { Update::InstalledStickerSets(t.as_ref().clone()) }
899
900 pub fn language_pack_strings<T: AsRef<UpdateLanguagePackStrings>>(t: T) -> Self { Update::LanguagePackStrings(t.as_ref().clone()) }
901
902 pub fn message_content<T: AsRef<UpdateMessageContent>>(t: T) -> Self { Update::MessageContent(t.as_ref().clone()) }
903
904 pub fn message_content_opened<T: AsRef<UpdateMessageContentOpened>>(t: T) -> Self { Update::MessageContentOpened(t.as_ref().clone()) }
905
906 pub fn message_edited<T: AsRef<UpdateMessageEdited>>(t: T) -> Self { Update::MessageEdited(t.as_ref().clone()) }
907
908 pub fn message_interaction_info<T: AsRef<UpdateMessageInteractionInfo>>(t: T) -> Self { Update::MessageInteractionInfo(t.as_ref().clone()) }
909
910 pub fn message_is_pinned<T: AsRef<UpdateMessageIsPinned>>(t: T) -> Self { Update::MessageIsPinned(t.as_ref().clone()) }
911
912 pub fn message_live_location_viewed<T: AsRef<UpdateMessageLiveLocationViewed>>(t: T) -> Self { Update::MessageLiveLocationViewed(t.as_ref().clone()) }
913
914 pub fn message_mention_read<T: AsRef<UpdateMessageMentionRead>>(t: T) -> Self { Update::MessageMentionRead(t.as_ref().clone()) }
915
916 pub fn message_send_acknowledged<T: AsRef<UpdateMessageSendAcknowledged>>(t: T) -> Self { Update::MessageSendAcknowledged(t.as_ref().clone()) }
917
918 pub fn message_send_failed<T: AsRef<UpdateMessageSendFailed>>(t: T) -> Self { Update::MessageSendFailed(t.as_ref().clone()) }
919
920 pub fn message_send_succeeded<T: AsRef<UpdateMessageSendSucceeded>>(t: T) -> Self { Update::MessageSendSucceeded(t.as_ref().clone()) }
921
922 pub fn new_call_signaling_data<T: AsRef<UpdateNewCallSignalingData>>(t: T) -> Self { Update::NewCallSignalingData(t.as_ref().clone()) }
923
924 pub fn new_callback_query<T: AsRef<UpdateNewCallbackQuery>>(t: T) -> Self { Update::NewCallbackQuery(t.as_ref().clone()) }
925
926 pub fn new_chat<T: AsRef<UpdateNewChat>>(t: T) -> Self { Update::NewChat(t.as_ref().clone()) }
927
928 pub fn new_chat_join_request<T: AsRef<UpdateNewChatJoinRequest>>(t: T) -> Self { Update::NewChatJoinRequest(t.as_ref().clone()) }
929
930 pub fn new_chosen_inline_result<T: AsRef<UpdateNewChosenInlineResult>>(t: T) -> Self { Update::NewChosenInlineResult(t.as_ref().clone()) }
931
932 pub fn new_custom_event<T: AsRef<UpdateNewCustomEvent>>(t: T) -> Self { Update::NewCustomEvent(t.as_ref().clone()) }
933
934 pub fn new_custom_query<T: AsRef<UpdateNewCustomQuery>>(t: T) -> Self { Update::NewCustomQuery(t.as_ref().clone()) }
935
936 pub fn new_inline_callback_query<T: AsRef<UpdateNewInlineCallbackQuery>>(t: T) -> Self { Update::NewInlineCallbackQuery(t.as_ref().clone()) }
937
938 pub fn new_inline_query<T: AsRef<UpdateNewInlineQuery>>(t: T) -> Self { Update::NewInlineQuery(t.as_ref().clone()) }
939
940 pub fn new_message<T: AsRef<UpdateNewMessage>>(t: T) -> Self { Update::NewMessage(t.as_ref().clone()) }
941
942 pub fn new_pre_checkout_query<T: AsRef<UpdateNewPreCheckoutQuery>>(t: T) -> Self { Update::NewPreCheckoutQuery(t.as_ref().clone()) }
943
944 pub fn new_shipping_query<T: AsRef<UpdateNewShippingQuery>>(t: T) -> Self { Update::NewShippingQuery(t.as_ref().clone()) }
945
946 pub fn notification<T: AsRef<UpdateNotification>>(t: T) -> Self { Update::Notification(t.as_ref().clone()) }
947
948 pub fn notification_group<T: AsRef<UpdateNotificationGroup>>(t: T) -> Self { Update::NotificationGroup(t.as_ref().clone()) }
949
950 pub fn option<T: AsRef<UpdateOption>>(t: T) -> Self { Update::Option(t.as_ref().clone()) }
951
952 pub fn poll<T: AsRef<UpdatePoll>>(t: T) -> Self { Update::Poll(t.as_ref().clone()) }
953
954 pub fn poll_answer<T: AsRef<UpdatePollAnswer>>(t: T) -> Self { Update::PollAnswer(t.as_ref().clone()) }
955
956 pub fn recent_stickers<T: AsRef<UpdateRecentStickers>>(t: T) -> Self { Update::RecentStickers(t.as_ref().clone()) }
957
958 pub fn saved_animations<T: AsRef<UpdateSavedAnimations>>(t: T) -> Self { Update::SavedAnimations(t.as_ref().clone()) }
959
960 pub fn scope_notification_settings<T: AsRef<UpdateScopeNotificationSettings>>(t: T) -> Self { Update::ScopeNotificationSettings(t.as_ref().clone()) }
961
962 pub fn secret_chat<T: AsRef<UpdateSecretChat>>(t: T) -> Self { Update::SecretChat(t.as_ref().clone()) }
963
964 pub fn selected_background<T: AsRef<UpdateSelectedBackground>>(t: T) -> Self { Update::SelectedBackground(t.as_ref().clone()) }
965
966 pub fn service_notification<T: AsRef<UpdateServiceNotification>>(t: T) -> Self { Update::ServiceNotification(t.as_ref().clone()) }
967
968 pub fn sticker_set<T: AsRef<UpdateStickerSet>>(t: T) -> Self { Update::StickerSet(t.as_ref().clone()) }
969
970 pub fn suggested_actions<T: AsRef<UpdateSuggestedActions>>(t: T) -> Self { Update::SuggestedActions(t.as_ref().clone()) }
971
972 pub fn supergroup<T: AsRef<UpdateSupergroup>>(t: T) -> Self { Update::Supergroup(t.as_ref().clone()) }
973
974 pub fn supergroup_full_info<T: AsRef<UpdateSupergroupFullInfo>>(t: T) -> Self { Update::SupergroupFullInfo(t.as_ref().clone()) }
975
976 pub fn terms_of_service<T: AsRef<UpdateTermsOfService>>(t: T) -> Self { Update::TermsOfService(t.as_ref().clone()) }
977
978 pub fn trending_sticker_sets<T: AsRef<UpdateTrendingStickerSets>>(t: T) -> Self { Update::TrendingStickerSets(t.as_ref().clone()) }
979
980 pub fn unread_chat_count<T: AsRef<UpdateUnreadChatCount>>(t: T) -> Self { Update::UnreadChatCount(t.as_ref().clone()) }
981
982 pub fn unread_message_count<T: AsRef<UpdateUnreadMessageCount>>(t: T) -> Self { Update::UnreadMessageCount(t.as_ref().clone()) }
983
984 pub fn user<T: AsRef<UpdateUser>>(t: T) -> Self { Update::User(t.as_ref().clone()) }
985
986 pub fn user_full_info<T: AsRef<UpdateUserFullInfo>>(t: T) -> Self { Update::UserFullInfo(t.as_ref().clone()) }
987
988 pub fn user_privacy_setting_rules<T: AsRef<UpdateUserPrivacySettingRules>>(t: T) -> Self { Update::UserPrivacySettingRules(t.as_ref().clone()) }
989
990 pub fn user_status<T: AsRef<UpdateUserStatus>>(t: T) -> Self { Update::UserStatus(t.as_ref().clone()) }
991
992 pub fn users_nearby<T: AsRef<UpdateUsersNearby>>(t: T) -> Self { Update::UsersNearby(t.as_ref().clone()) }
993
994}
995
996impl AsRef<Update> for Update {
997 fn as_ref(&self) -> &Update { self }
998}
999
1000
1001
1002
1003
1004
1005
1006#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1008pub struct UpdateActiveNotifications {
1009 #[doc(hidden)]
1010 #[serde(rename(serialize = "@type", deserialize = "@type"))]
1011 td_name: String,
1012 #[doc(hidden)]
1013 #[serde(rename(serialize = "@extra", deserialize = "@extra"))]
1014 extra: Option<String>,
1015 groups: Vec<NotificationGroup>,
1017
1018}
1019
1020impl RObject for UpdateActiveNotifications {
1021 #[doc(hidden)] fn td_name(&self) -> &'static str { "updateActiveNotifications" }
1022 #[doc(hidden)] fn extra(&self) -> Option<String> { self.extra.clone() }
1023 fn to_json(&self) -> RTDResult<String> { Ok(serde_json::to_string(self)?) }
1024}
1025
1026
1027impl TDUpdate for UpdateActiveNotifications {}
1028
1029
1030
1031impl UpdateActiveNotifications {
1032 pub fn from_json<S: AsRef<str>>(json: S) -> RTDResult<Self> { Ok(serde_json::from_str(json.as_ref())?) }
1033 pub fn builder() -> RTDUpdateActiveNotificationsBuilder {
1034 let mut inner = UpdateActiveNotifications::default();
1035 inner.td_name = "updateActiveNotifications".to_string();
1036 inner.extra = Some(Uuid::new_v4().to_string());
1037 RTDUpdateActiveNotificationsBuilder { inner }
1038 }
1039
1040 pub fn groups(&self) -> &Vec<NotificationGroup> { &self.groups }
1041
1042}
1043
1044#[doc(hidden)]
1045pub struct RTDUpdateActiveNotificationsBuilder {
1046 inner: UpdateActiveNotifications
1047}
1048
1049impl RTDUpdateActiveNotificationsBuilder {
1050 pub fn build(&self) -> UpdateActiveNotifications { self.inner.clone() }
1051
1052
1053 pub fn groups(&mut self, groups: Vec<NotificationGroup>) -> &mut Self {
1054 self.inner.groups = groups;
1055 self
1056 }
1057
1058}
1059
1060impl AsRef<UpdateActiveNotifications> for UpdateActiveNotifications {
1061 fn as_ref(&self) -> &UpdateActiveNotifications { self }
1062}
1063
1064impl AsRef<UpdateActiveNotifications> for RTDUpdateActiveNotificationsBuilder {
1065 fn as_ref(&self) -> &UpdateActiveNotifications { &self.inner }
1066}
1067
1068
1069
1070
1071
1072
1073
1074#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1076pub struct UpdateAnimatedEmojiMessageClicked {
1077 #[doc(hidden)]
1078 #[serde(rename(serialize = "@type", deserialize = "@type"))]
1079 td_name: String,
1080 #[doc(hidden)]
1081 #[serde(rename(serialize = "@extra", deserialize = "@extra"))]
1082 extra: Option<String>,
1083 chat_id: i64,
1085 message_id: i64,
1087 sticker: Sticker,
1089
1090}
1091
1092impl RObject for UpdateAnimatedEmojiMessageClicked {
1093 #[doc(hidden)] fn td_name(&self) -> &'static str { "updateAnimatedEmojiMessageClicked" }
1094 #[doc(hidden)] fn extra(&self) -> Option<String> { self.extra.clone() }
1095 fn to_json(&self) -> RTDResult<String> { Ok(serde_json::to_string(self)?) }
1096}
1097
1098
1099impl TDUpdate for UpdateAnimatedEmojiMessageClicked {}
1100
1101
1102
1103impl UpdateAnimatedEmojiMessageClicked {
1104 pub fn from_json<S: AsRef<str>>(json: S) -> RTDResult<Self> { Ok(serde_json::from_str(json.as_ref())?) }
1105 pub fn builder() -> RTDUpdateAnimatedEmojiMessageClickedBuilder {
1106 let mut inner = UpdateAnimatedEmojiMessageClicked::default();
1107 inner.td_name = "updateAnimatedEmojiMessageClicked".to_string();
1108 inner.extra = Some(Uuid::new_v4().to_string());
1109 RTDUpdateAnimatedEmojiMessageClickedBuilder { inner }
1110 }
1111
1112 pub fn chat_id(&self) -> i64 { self.chat_id }
1113
1114 pub fn message_id(&self) -> i64 { self.message_id }
1115
1116 pub fn sticker(&self) -> &Sticker { &self.sticker }
1117
1118}
1119
1120#[doc(hidden)]
1121pub struct RTDUpdateAnimatedEmojiMessageClickedBuilder {
1122 inner: UpdateAnimatedEmojiMessageClicked
1123}
1124
1125impl RTDUpdateAnimatedEmojiMessageClickedBuilder {
1126 pub fn build(&self) -> UpdateAnimatedEmojiMessageClicked { self.inner.clone() }
1127
1128
1129 pub fn chat_id(&mut self, chat_id: i64) -> &mut Self {
1130 self.inner.chat_id = chat_id;
1131 self
1132 }
1133
1134
1135 pub fn message_id(&mut self, message_id: i64) -> &mut Self {
1136 self.inner.message_id = message_id;
1137 self
1138 }
1139
1140
1141 pub fn sticker<T: AsRef<Sticker>>(&mut self, sticker: T) -> &mut Self {
1142 self.inner.sticker = sticker.as_ref().clone();
1143 self
1144 }
1145
1146}
1147
1148impl AsRef<UpdateAnimatedEmojiMessageClicked> for UpdateAnimatedEmojiMessageClicked {
1149 fn as_ref(&self) -> &UpdateAnimatedEmojiMessageClicked { self }
1150}
1151
1152impl AsRef<UpdateAnimatedEmojiMessageClicked> for RTDUpdateAnimatedEmojiMessageClickedBuilder {
1153 fn as_ref(&self) -> &UpdateAnimatedEmojiMessageClicked { &self.inner }
1154}
1155
1156
1157
1158
1159
1160
1161
1162#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1164pub struct UpdateAnimationSearchParameters {
1165 #[doc(hidden)]
1166 #[serde(rename(serialize = "@type", deserialize = "@type"))]
1167 td_name: String,
1168 #[doc(hidden)]
1169 #[serde(rename(serialize = "@extra", deserialize = "@extra"))]
1170 extra: Option<String>,
1171 provider: String,
1173 emojis: Vec<String>,
1175
1176}
1177
1178impl RObject for UpdateAnimationSearchParameters {
1179 #[doc(hidden)] fn td_name(&self) -> &'static str { "updateAnimationSearchParameters" }
1180 #[doc(hidden)] fn extra(&self) -> Option<String> { self.extra.clone() }
1181 fn to_json(&self) -> RTDResult<String> { Ok(serde_json::to_string(self)?) }
1182}
1183
1184
1185impl TDUpdate for UpdateAnimationSearchParameters {}
1186
1187
1188
1189impl UpdateAnimationSearchParameters {
1190 pub fn from_json<S: AsRef<str>>(json: S) -> RTDResult<Self> { Ok(serde_json::from_str(json.as_ref())?) }
1191 pub fn builder() -> RTDUpdateAnimationSearchParametersBuilder {
1192 let mut inner = UpdateAnimationSearchParameters::default();
1193 inner.td_name = "updateAnimationSearchParameters".to_string();
1194 inner.extra = Some(Uuid::new_v4().to_string());
1195 RTDUpdateAnimationSearchParametersBuilder { inner }
1196 }
1197
1198 pub fn provider(&self) -> &String { &self.provider }
1199
1200 pub fn emojis(&self) -> &Vec<String> { &self.emojis }
1201
1202}
1203
1204#[doc(hidden)]
1205pub struct RTDUpdateAnimationSearchParametersBuilder {
1206 inner: UpdateAnimationSearchParameters
1207}
1208
1209impl RTDUpdateAnimationSearchParametersBuilder {
1210 pub fn build(&self) -> UpdateAnimationSearchParameters { self.inner.clone() }
1211
1212
1213 pub fn provider<T: AsRef<str>>(&mut self, provider: T) -> &mut Self {
1214 self.inner.provider = provider.as_ref().to_string();
1215 self
1216 }
1217
1218
1219 pub fn emojis(&mut self, emojis: Vec<String>) -> &mut Self {
1220 self.inner.emojis = emojis;
1221 self
1222 }
1223
1224}
1225
1226impl AsRef<UpdateAnimationSearchParameters> for UpdateAnimationSearchParameters {
1227 fn as_ref(&self) -> &UpdateAnimationSearchParameters { self }
1228}
1229
1230impl AsRef<UpdateAnimationSearchParameters> for RTDUpdateAnimationSearchParametersBuilder {
1231 fn as_ref(&self) -> &UpdateAnimationSearchParameters { &self.inner }
1232}
1233
1234
1235
1236
1237
1238
1239
1240#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1242pub struct UpdateAuthorizationState {
1243 #[doc(hidden)]
1244 #[serde(rename(serialize = "@type", deserialize = "@type"))]
1245 td_name: String,
1246 #[doc(hidden)]
1247 #[serde(rename(serialize = "@extra", deserialize = "@extra"))]
1248 extra: Option<String>,
1249 authorization_state: AuthorizationState,
1251
1252}
1253
1254impl RObject for UpdateAuthorizationState {
1255 #[doc(hidden)] fn td_name(&self) -> &'static str { "updateAuthorizationState" }
1256 #[doc(hidden)] fn extra(&self) -> Option<String> { self.extra.clone() }
1257 fn to_json(&self) -> RTDResult<String> { Ok(serde_json::to_string(self)?) }
1258}
1259
1260
1261impl TDUpdate for UpdateAuthorizationState {}
1262
1263
1264
1265impl UpdateAuthorizationState {
1266 pub fn from_json<S: AsRef<str>>(json: S) -> RTDResult<Self> { Ok(serde_json::from_str(json.as_ref())?) }
1267 pub fn builder() -> RTDUpdateAuthorizationStateBuilder {
1268 let mut inner = UpdateAuthorizationState::default();
1269 inner.td_name = "updateAuthorizationState".to_string();
1270 inner.extra = Some(Uuid::new_v4().to_string());
1271 RTDUpdateAuthorizationStateBuilder { inner }
1272 }
1273
1274 pub fn authorization_state(&self) -> &AuthorizationState { &self.authorization_state }
1275
1276}
1277
1278#[doc(hidden)]
1279pub struct RTDUpdateAuthorizationStateBuilder {
1280 inner: UpdateAuthorizationState
1281}
1282
1283impl RTDUpdateAuthorizationStateBuilder {
1284 pub fn build(&self) -> UpdateAuthorizationState { self.inner.clone() }
1285
1286
1287 pub fn authorization_state<T: AsRef<AuthorizationState>>(&mut self, authorization_state: T) -> &mut Self {
1288 self.inner.authorization_state = authorization_state.as_ref().clone();
1289 self
1290 }
1291
1292}
1293
1294impl AsRef<UpdateAuthorizationState> for UpdateAuthorizationState {
1295 fn as_ref(&self) -> &UpdateAuthorizationState { self }
1296}
1297
1298impl AsRef<UpdateAuthorizationState> for RTDUpdateAuthorizationStateBuilder {
1299 fn as_ref(&self) -> &UpdateAuthorizationState { &self.inner }
1300}
1301
1302
1303
1304
1305
1306
1307
1308#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1310pub struct UpdateBasicGroup {
1311 #[doc(hidden)]
1312 #[serde(rename(serialize = "@type", deserialize = "@type"))]
1313 td_name: String,
1314 #[doc(hidden)]
1315 #[serde(rename(serialize = "@extra", deserialize = "@extra"))]
1316 extra: Option<String>,
1317 basic_group: BasicGroup,
1319
1320}
1321
1322impl RObject for UpdateBasicGroup {
1323 #[doc(hidden)] fn td_name(&self) -> &'static str { "updateBasicGroup" }
1324 #[doc(hidden)] fn extra(&self) -> Option<String> { self.extra.clone() }
1325 fn to_json(&self) -> RTDResult<String> { Ok(serde_json::to_string(self)?) }
1326}
1327
1328
1329impl TDUpdate for UpdateBasicGroup {}
1330
1331
1332
1333impl UpdateBasicGroup {
1334 pub fn from_json<S: AsRef<str>>(json: S) -> RTDResult<Self> { Ok(serde_json::from_str(json.as_ref())?) }
1335 pub fn builder() -> RTDUpdateBasicGroupBuilder {
1336 let mut inner = UpdateBasicGroup::default();
1337 inner.td_name = "updateBasicGroup".to_string();
1338 inner.extra = Some(Uuid::new_v4().to_string());
1339 RTDUpdateBasicGroupBuilder { inner }
1340 }
1341
1342 pub fn basic_group(&self) -> &BasicGroup { &self.basic_group }
1343
1344}
1345
1346#[doc(hidden)]
1347pub struct RTDUpdateBasicGroupBuilder {
1348 inner: UpdateBasicGroup
1349}
1350
1351impl RTDUpdateBasicGroupBuilder {
1352 pub fn build(&self) -> UpdateBasicGroup { self.inner.clone() }
1353
1354
1355 pub fn basic_group<T: AsRef<BasicGroup>>(&mut self, basic_group: T) -> &mut Self {
1356 self.inner.basic_group = basic_group.as_ref().clone();
1357 self
1358 }
1359
1360}
1361
1362impl AsRef<UpdateBasicGroup> for UpdateBasicGroup {
1363 fn as_ref(&self) -> &UpdateBasicGroup { self }
1364}
1365
1366impl AsRef<UpdateBasicGroup> for RTDUpdateBasicGroupBuilder {
1367 fn as_ref(&self) -> &UpdateBasicGroup { &self.inner }
1368}
1369
1370
1371
1372
1373
1374
1375
1376#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1378pub struct UpdateBasicGroupFullInfo {
1379 #[doc(hidden)]
1380 #[serde(rename(serialize = "@type", deserialize = "@type"))]
1381 td_name: String,
1382 #[doc(hidden)]
1383 #[serde(rename(serialize = "@extra", deserialize = "@extra"))]
1384 extra: Option<String>,
1385 basic_group_id: i64,
1387 basic_group_full_info: BasicGroupFullInfo,
1389
1390}
1391
1392impl RObject for UpdateBasicGroupFullInfo {
1393 #[doc(hidden)] fn td_name(&self) -> &'static str { "updateBasicGroupFullInfo" }
1394 #[doc(hidden)] fn extra(&self) -> Option<String> { self.extra.clone() }
1395 fn to_json(&self) -> RTDResult<String> { Ok(serde_json::to_string(self)?) }
1396}
1397
1398
1399impl TDUpdate for UpdateBasicGroupFullInfo {}
1400
1401
1402
1403impl UpdateBasicGroupFullInfo {
1404 pub fn from_json<S: AsRef<str>>(json: S) -> RTDResult<Self> { Ok(serde_json::from_str(json.as_ref())?) }
1405 pub fn builder() -> RTDUpdateBasicGroupFullInfoBuilder {
1406 let mut inner = UpdateBasicGroupFullInfo::default();
1407 inner.td_name = "updateBasicGroupFullInfo".to_string();
1408 inner.extra = Some(Uuid::new_v4().to_string());
1409 RTDUpdateBasicGroupFullInfoBuilder { inner }
1410 }
1411
1412 pub fn basic_group_id(&self) -> i64 { self.basic_group_id }
1413
1414 pub fn basic_group_full_info(&self) -> &BasicGroupFullInfo { &self.basic_group_full_info }
1415
1416}
1417
1418#[doc(hidden)]
1419pub struct RTDUpdateBasicGroupFullInfoBuilder {
1420 inner: UpdateBasicGroupFullInfo
1421}
1422
1423impl RTDUpdateBasicGroupFullInfoBuilder {
1424 pub fn build(&self) -> UpdateBasicGroupFullInfo { self.inner.clone() }
1425
1426
1427 pub fn basic_group_id(&mut self, basic_group_id: i64) -> &mut Self {
1428 self.inner.basic_group_id = basic_group_id;
1429 self
1430 }
1431
1432
1433 pub fn basic_group_full_info<T: AsRef<BasicGroupFullInfo>>(&mut self, basic_group_full_info: T) -> &mut Self {
1434 self.inner.basic_group_full_info = basic_group_full_info.as_ref().clone();
1435 self
1436 }
1437
1438}
1439
1440impl AsRef<UpdateBasicGroupFullInfo> for UpdateBasicGroupFullInfo {
1441 fn as_ref(&self) -> &UpdateBasicGroupFullInfo { self }
1442}
1443
1444impl AsRef<UpdateBasicGroupFullInfo> for RTDUpdateBasicGroupFullInfoBuilder {
1445 fn as_ref(&self) -> &UpdateBasicGroupFullInfo { &self.inner }
1446}
1447
1448
1449
1450
1451
1452
1453
1454#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1456pub struct UpdateCall {
1457 #[doc(hidden)]
1458 #[serde(rename(serialize = "@type", deserialize = "@type"))]
1459 td_name: String,
1460 #[doc(hidden)]
1461 #[serde(rename(serialize = "@extra", deserialize = "@extra"))]
1462 extra: Option<String>,
1463 call: Call,
1465
1466}
1467
1468impl RObject for UpdateCall {
1469 #[doc(hidden)] fn td_name(&self) -> &'static str { "updateCall" }
1470 #[doc(hidden)] fn extra(&self) -> Option<String> { self.extra.clone() }
1471 fn to_json(&self) -> RTDResult<String> { Ok(serde_json::to_string(self)?) }
1472}
1473
1474
1475impl TDUpdate for UpdateCall {}
1476
1477
1478
1479impl UpdateCall {
1480 pub fn from_json<S: AsRef<str>>(json: S) -> RTDResult<Self> { Ok(serde_json::from_str(json.as_ref())?) }
1481 pub fn builder() -> RTDUpdateCallBuilder {
1482 let mut inner = UpdateCall::default();
1483 inner.td_name = "updateCall".to_string();
1484 inner.extra = Some(Uuid::new_v4().to_string());
1485 RTDUpdateCallBuilder { inner }
1486 }
1487
1488 pub fn call(&self) -> &Call { &self.call }
1489
1490}
1491
1492#[doc(hidden)]
1493pub struct RTDUpdateCallBuilder {
1494 inner: UpdateCall
1495}
1496
1497impl RTDUpdateCallBuilder {
1498 pub fn build(&self) -> UpdateCall { self.inner.clone() }
1499
1500
1501 pub fn call<T: AsRef<Call>>(&mut self, call: T) -> &mut Self {
1502 self.inner.call = call.as_ref().clone();
1503 self
1504 }
1505
1506}
1507
1508impl AsRef<UpdateCall> for UpdateCall {
1509 fn as_ref(&self) -> &UpdateCall { self }
1510}
1511
1512impl AsRef<UpdateCall> for RTDUpdateCallBuilder {
1513 fn as_ref(&self) -> &UpdateCall { &self.inner }
1514}
1515
1516
1517
1518
1519
1520
1521
1522#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1524pub struct UpdateChatAction {
1525 #[doc(hidden)]
1526 #[serde(rename(serialize = "@type", deserialize = "@type"))]
1527 td_name: String,
1528 #[doc(hidden)]
1529 #[serde(rename(serialize = "@extra", deserialize = "@extra"))]
1530 extra: Option<String>,
1531 chat_id: i64,
1533 message_thread_id: i64,
1535 sender_id: MessageSender,
1537 action: ChatAction,
1539
1540}
1541
1542impl RObject for UpdateChatAction {
1543 #[doc(hidden)] fn td_name(&self) -> &'static str { "updateChatAction" }
1544 #[doc(hidden)] fn extra(&self) -> Option<String> { self.extra.clone() }
1545 fn to_json(&self) -> RTDResult<String> { Ok(serde_json::to_string(self)?) }
1546}
1547
1548
1549impl TDUpdate for UpdateChatAction {}
1550
1551
1552
1553impl UpdateChatAction {
1554 pub fn from_json<S: AsRef<str>>(json: S) -> RTDResult<Self> { Ok(serde_json::from_str(json.as_ref())?) }
1555 pub fn builder() -> RTDUpdateChatActionBuilder {
1556 let mut inner = UpdateChatAction::default();
1557 inner.td_name = "updateChatAction".to_string();
1558 inner.extra = Some(Uuid::new_v4().to_string());
1559 RTDUpdateChatActionBuilder { inner }
1560 }
1561
1562 pub fn chat_id(&self) -> i64 { self.chat_id }
1563
1564 pub fn message_thread_id(&self) -> i64 { self.message_thread_id }
1565
1566 pub fn sender_id(&self) -> &MessageSender { &self.sender_id }
1567
1568 pub fn action(&self) -> &ChatAction { &self.action }
1569
1570}
1571
1572#[doc(hidden)]
1573pub struct RTDUpdateChatActionBuilder {
1574 inner: UpdateChatAction
1575}
1576
1577impl RTDUpdateChatActionBuilder {
1578 pub fn build(&self) -> UpdateChatAction { self.inner.clone() }
1579
1580
1581 pub fn chat_id(&mut self, chat_id: i64) -> &mut Self {
1582 self.inner.chat_id = chat_id;
1583 self
1584 }
1585
1586
1587 pub fn message_thread_id(&mut self, message_thread_id: i64) -> &mut Self {
1588 self.inner.message_thread_id = message_thread_id;
1589 self
1590 }
1591
1592
1593 pub fn sender_id<T: AsRef<MessageSender>>(&mut self, sender_id: T) -> &mut Self {
1594 self.inner.sender_id = sender_id.as_ref().clone();
1595 self
1596 }
1597
1598
1599 pub fn action<T: AsRef<ChatAction>>(&mut self, action: T) -> &mut Self {
1600 self.inner.action = action.as_ref().clone();
1601 self
1602 }
1603
1604}
1605
1606impl AsRef<UpdateChatAction> for UpdateChatAction {
1607 fn as_ref(&self) -> &UpdateChatAction { self }
1608}
1609
1610impl AsRef<UpdateChatAction> for RTDUpdateChatActionBuilder {
1611 fn as_ref(&self) -> &UpdateChatAction { &self.inner }
1612}
1613
1614
1615
1616
1617
1618
1619
1620#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1622pub struct UpdateChatActionBar {
1623 #[doc(hidden)]
1624 #[serde(rename(serialize = "@type", deserialize = "@type"))]
1625 td_name: String,
1626 #[doc(hidden)]
1627 #[serde(rename(serialize = "@extra", deserialize = "@extra"))]
1628 extra: Option<String>,
1629 chat_id: i64,
1631 action_bar: Option<ChatActionBar>,
1633
1634}
1635
1636impl RObject for UpdateChatActionBar {
1637 #[doc(hidden)] fn td_name(&self) -> &'static str { "updateChatActionBar" }
1638 #[doc(hidden)] fn extra(&self) -> Option<String> { self.extra.clone() }
1639 fn to_json(&self) -> RTDResult<String> { Ok(serde_json::to_string(self)?) }
1640}
1641
1642
1643impl TDUpdate for UpdateChatActionBar {}
1644
1645
1646
1647impl UpdateChatActionBar {
1648 pub fn from_json<S: AsRef<str>>(json: S) -> RTDResult<Self> { Ok(serde_json::from_str(json.as_ref())?) }
1649 pub fn builder() -> RTDUpdateChatActionBarBuilder {
1650 let mut inner = UpdateChatActionBar::default();
1651 inner.td_name = "updateChatActionBar".to_string();
1652 inner.extra = Some(Uuid::new_v4().to_string());
1653 RTDUpdateChatActionBarBuilder { inner }
1654 }
1655
1656 pub fn chat_id(&self) -> i64 { self.chat_id }
1657
1658 pub fn action_bar(&self) -> &Option<ChatActionBar> { &self.action_bar }
1659
1660}
1661
1662#[doc(hidden)]
1663pub struct RTDUpdateChatActionBarBuilder {
1664 inner: UpdateChatActionBar
1665}
1666
1667impl RTDUpdateChatActionBarBuilder {
1668 pub fn build(&self) -> UpdateChatActionBar { self.inner.clone() }
1669
1670
1671 pub fn chat_id(&mut self, chat_id: i64) -> &mut Self {
1672 self.inner.chat_id = chat_id;
1673 self
1674 }
1675
1676
1677 pub fn action_bar<T: AsRef<ChatActionBar>>(&mut self, action_bar: T) -> &mut Self {
1678 self.inner.action_bar = Some(action_bar.as_ref().clone());
1679 self
1680 }
1681
1682}
1683
1684impl AsRef<UpdateChatActionBar> for UpdateChatActionBar {
1685 fn as_ref(&self) -> &UpdateChatActionBar { self }
1686}
1687
1688impl AsRef<UpdateChatActionBar> for RTDUpdateChatActionBarBuilder {
1689 fn as_ref(&self) -> &UpdateChatActionBar { &self.inner }
1690}
1691
1692
1693
1694
1695
1696
1697
1698#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1700pub struct UpdateChatDefaultDisableNotification {
1701 #[doc(hidden)]
1702 #[serde(rename(serialize = "@type", deserialize = "@type"))]
1703 td_name: String,
1704 #[doc(hidden)]
1705 #[serde(rename(serialize = "@extra", deserialize = "@extra"))]
1706 extra: Option<String>,
1707 chat_id: i64,
1709 default_disable_notification: bool,
1711
1712}
1713
1714impl RObject for UpdateChatDefaultDisableNotification {
1715 #[doc(hidden)] fn td_name(&self) -> &'static str { "updateChatDefaultDisableNotification" }
1716 #[doc(hidden)] fn extra(&self) -> Option<String> { self.extra.clone() }
1717 fn to_json(&self) -> RTDResult<String> { Ok(serde_json::to_string(self)?) }
1718}
1719
1720
1721impl TDUpdate for UpdateChatDefaultDisableNotification {}
1722
1723
1724
1725impl UpdateChatDefaultDisableNotification {
1726 pub fn from_json<S: AsRef<str>>(json: S) -> RTDResult<Self> { Ok(serde_json::from_str(json.as_ref())?) }
1727 pub fn builder() -> RTDUpdateChatDefaultDisableNotificationBuilder {
1728 let mut inner = UpdateChatDefaultDisableNotification::default();
1729 inner.td_name = "updateChatDefaultDisableNotification".to_string();
1730 inner.extra = Some(Uuid::new_v4().to_string());
1731 RTDUpdateChatDefaultDisableNotificationBuilder { inner }
1732 }
1733
1734 pub fn chat_id(&self) -> i64 { self.chat_id }
1735
1736 pub fn default_disable_notification(&self) -> bool { self.default_disable_notification }
1737
1738}
1739
1740#[doc(hidden)]
1741pub struct RTDUpdateChatDefaultDisableNotificationBuilder {
1742 inner: UpdateChatDefaultDisableNotification
1743}
1744
1745impl RTDUpdateChatDefaultDisableNotificationBuilder {
1746 pub fn build(&self) -> UpdateChatDefaultDisableNotification { self.inner.clone() }
1747
1748
1749 pub fn chat_id(&mut self, chat_id: i64) -> &mut Self {
1750 self.inner.chat_id = chat_id;
1751 self
1752 }
1753
1754
1755 pub fn default_disable_notification(&mut self, default_disable_notification: bool) -> &mut Self {
1756 self.inner.default_disable_notification = default_disable_notification;
1757 self
1758 }
1759
1760}
1761
1762impl AsRef<UpdateChatDefaultDisableNotification> for UpdateChatDefaultDisableNotification {
1763 fn as_ref(&self) -> &UpdateChatDefaultDisableNotification { self }
1764}
1765
1766impl AsRef<UpdateChatDefaultDisableNotification> for RTDUpdateChatDefaultDisableNotificationBuilder {
1767 fn as_ref(&self) -> &UpdateChatDefaultDisableNotification { &self.inner }
1768}
1769
1770
1771
1772
1773
1774
1775
1776#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1778pub struct UpdateChatDraftMessage {
1779 #[doc(hidden)]
1780 #[serde(rename(serialize = "@type", deserialize = "@type"))]
1781 td_name: String,
1782 #[doc(hidden)]
1783 #[serde(rename(serialize = "@extra", deserialize = "@extra"))]
1784 extra: Option<String>,
1785 chat_id: i64,
1787 draft_message: Option<DraftMessage>,
1789 positions: Vec<ChatPosition>,
1791
1792}
1793
1794impl RObject for UpdateChatDraftMessage {
1795 #[doc(hidden)] fn td_name(&self) -> &'static str { "updateChatDraftMessage" }
1796 #[doc(hidden)] fn extra(&self) -> Option<String> { self.extra.clone() }
1797 fn to_json(&self) -> RTDResult<String> { Ok(serde_json::to_string(self)?) }
1798}
1799
1800
1801impl TDUpdate for UpdateChatDraftMessage {}
1802
1803
1804
1805impl UpdateChatDraftMessage {
1806 pub fn from_json<S: AsRef<str>>(json: S) -> RTDResult<Self> { Ok(serde_json::from_str(json.as_ref())?) }
1807 pub fn builder() -> RTDUpdateChatDraftMessageBuilder {
1808 let mut inner = UpdateChatDraftMessage::default();
1809 inner.td_name = "updateChatDraftMessage".to_string();
1810 inner.extra = Some(Uuid::new_v4().to_string());
1811 RTDUpdateChatDraftMessageBuilder { inner }
1812 }
1813
1814 pub fn chat_id(&self) -> i64 { self.chat_id }
1815
1816 pub fn draft_message(&self) -> &Option<DraftMessage> { &self.draft_message }
1817
1818 pub fn positions(&self) -> &Vec<ChatPosition> { &self.positions }
1819
1820}
1821
1822#[doc(hidden)]
1823pub struct RTDUpdateChatDraftMessageBuilder {
1824 inner: UpdateChatDraftMessage
1825}
1826
1827impl RTDUpdateChatDraftMessageBuilder {
1828 pub fn build(&self) -> UpdateChatDraftMessage { self.inner.clone() }
1829
1830
1831 pub fn chat_id(&mut self, chat_id: i64) -> &mut Self {
1832 self.inner.chat_id = chat_id;
1833 self
1834 }
1835
1836
1837 pub fn draft_message<T: AsRef<DraftMessage>>(&mut self, draft_message: T) -> &mut Self {
1838 self.inner.draft_message = Some(draft_message.as_ref().clone());
1839 self
1840 }
1841
1842
1843 pub fn positions(&mut self, positions: Vec<ChatPosition>) -> &mut Self {
1844 self.inner.positions = positions;
1845 self
1846 }
1847
1848}
1849
1850impl AsRef<UpdateChatDraftMessage> for UpdateChatDraftMessage {
1851 fn as_ref(&self) -> &UpdateChatDraftMessage { self }
1852}
1853
1854impl AsRef<UpdateChatDraftMessage> for RTDUpdateChatDraftMessageBuilder {
1855 fn as_ref(&self) -> &UpdateChatDraftMessage { &self.inner }
1856}
1857
1858
1859
1860
1861
1862
1863
1864#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1866pub struct UpdateChatFilters {
1867 #[doc(hidden)]
1868 #[serde(rename(serialize = "@type", deserialize = "@type"))]
1869 td_name: String,
1870 #[doc(hidden)]
1871 #[serde(rename(serialize = "@extra", deserialize = "@extra"))]
1872 extra: Option<String>,
1873 chat_filters: Vec<ChatFilterInfo>,
1875
1876}
1877
1878impl RObject for UpdateChatFilters {
1879 #[doc(hidden)] fn td_name(&self) -> &'static str { "updateChatFilters" }
1880 #[doc(hidden)] fn extra(&self) -> Option<String> { self.extra.clone() }
1881 fn to_json(&self) -> RTDResult<String> { Ok(serde_json::to_string(self)?) }
1882}
1883
1884
1885impl TDUpdate for UpdateChatFilters {}
1886
1887
1888
1889impl UpdateChatFilters {
1890 pub fn from_json<S: AsRef<str>>(json: S) -> RTDResult<Self> { Ok(serde_json::from_str(json.as_ref())?) }
1891 pub fn builder() -> RTDUpdateChatFiltersBuilder {
1892 let mut inner = UpdateChatFilters::default();
1893 inner.td_name = "updateChatFilters".to_string();
1894 inner.extra = Some(Uuid::new_v4().to_string());
1895 RTDUpdateChatFiltersBuilder { inner }
1896 }
1897
1898 pub fn chat_filters(&self) -> &Vec<ChatFilterInfo> { &self.chat_filters }
1899
1900}
1901
1902#[doc(hidden)]
1903pub struct RTDUpdateChatFiltersBuilder {
1904 inner: UpdateChatFilters
1905}
1906
1907impl RTDUpdateChatFiltersBuilder {
1908 pub fn build(&self) -> UpdateChatFilters { self.inner.clone() }
1909
1910
1911 pub fn chat_filters(&mut self, chat_filters: Vec<ChatFilterInfo>) -> &mut Self {
1912 self.inner.chat_filters = chat_filters;
1913 self
1914 }
1915
1916}
1917
1918impl AsRef<UpdateChatFilters> for UpdateChatFilters {
1919 fn as_ref(&self) -> &UpdateChatFilters { self }
1920}
1921
1922impl AsRef<UpdateChatFilters> for RTDUpdateChatFiltersBuilder {
1923 fn as_ref(&self) -> &UpdateChatFilters { &self.inner }
1924}
1925
1926
1927
1928
1929
1930
1931
1932#[derive(Debug, Clone, Default, Serialize, Deserialize)]
1934pub struct UpdateChatHasProtectedContent {
1935 #[doc(hidden)]
1936 #[serde(rename(serialize = "@type", deserialize = "@type"))]
1937 td_name: String,
1938 #[doc(hidden)]
1939 #[serde(rename(serialize = "@extra", deserialize = "@extra"))]
1940 extra: Option<String>,
1941 chat_id: i64,
1943 has_protected_content: bool,
1945
1946}
1947
1948impl RObject for UpdateChatHasProtectedContent {
1949 #[doc(hidden)] fn td_name(&self) -> &'static str { "updateChatHasProtectedContent" }
1950 #[doc(hidden)] fn extra(&self) -> Option<String> { self.extra.clone() }
1951 fn to_json(&self) -> RTDResult<String> { Ok(serde_json::to_string(self)?) }
1952}
1953
1954
1955impl TDUpdate for UpdateChatHasProtectedContent {}
1956
1957
1958
1959impl UpdateChatHasProtectedContent {
1960 pub fn from_json<S: AsRef<str>>(json: S) -> RTDResult<Self> { Ok(serde_json::from_str(json.as_ref())?) }
1961 pub fn builder() -> RTDUpdateChatHasProtectedContentBuilder {
1962 let mut inner = UpdateChatHasProtectedContent::default();
1963 inner.td_name = "updateChatHasProtectedContent".to_string();
1964 inner.extra = Some(Uuid::new_v4().to_string());
1965 RTDUpdateChatHasProtectedContentBuilder { inner }
1966 }
1967
1968 pub fn chat_id(&self) -> i64 { self.chat_id }
1969
1970 pub fn has_protected_content(&self) -> bool { self.has_protected_content }
1971
1972}
1973
1974#[doc(hidden)]
1975pub struct RTDUpdateChatHasProtectedContentBuilder {
1976 inner: UpdateChatHasProtectedContent
1977}
1978
1979impl RTDUpdateChatHasProtectedContentBuilder {
1980 pub fn build(&self) -> UpdateChatHasProtectedContent { self.inner.clone() }
1981
1982
1983 pub fn chat_id(&mut self, chat_id: i64) -> &mut Self {
1984 self.inner.chat_id = chat_id;
1985 self
1986 }
1987
1988
1989 pub fn has_protected_content(&mut self, has_protected_content: bool) -> &mut Self {
1990 self.inner.has_protected_content = has_protected_content;
1991 self
1992 }
1993
1994}
1995
1996impl AsRef<UpdateChatHasProtectedContent> for UpdateChatHasProtectedContent {
1997 fn as_ref(&self) -> &UpdateChatHasProtectedContent { self }
1998}
1999
2000impl AsRef<UpdateChatHasProtectedContent> for RTDUpdateChatHasProtectedContentBuilder {
2001 fn as_ref(&self) -> &UpdateChatHasProtectedContent { &self.inner }
2002}
2003
2004
2005
2006
2007
2008
2009
2010#[derive(Debug, Clone, Default, Serialize, Deserialize)]
2012pub struct UpdateChatHasScheduledMessages {
2013 #[doc(hidden)]
2014 #[serde(rename(serialize = "@type", deserialize = "@type"))]
2015 td_name: String,
2016 #[doc(hidden)]
2017 #[serde(rename(serialize = "@extra", deserialize = "@extra"))]
2018 extra: Option<String>,
2019 chat_id: i64,
2021 has_scheduled_messages: bool,
2023
2024}
2025
2026impl RObject for UpdateChatHasScheduledMessages {
2027 #[doc(hidden)] fn td_name(&self) -> &'static str { "updateChatHasScheduledMessages" }
2028 #[doc(hidden)] fn extra(&self) -> Option<String> { self.extra.clone() }
2029 fn to_json(&self) -> RTDResult<String> { Ok(serde_json::to_string(self)?) }
2030}
2031
2032
2033impl TDUpdate for UpdateChatHasScheduledMessages {}
2034
2035
2036
2037impl UpdateChatHasScheduledMessages {
2038 pub fn from_json<S: AsRef<str>>(json: S) -> RTDResult<Self> { Ok(serde_json::from_str(json.as_ref())?) }
2039 pub fn builder() -> RTDUpdateChatHasScheduledMessagesBuilder {
2040 let mut inner = UpdateChatHasScheduledMessages::default();
2041 inner.td_name = "updateChatHasScheduledMessages".to_string();
2042 inner.extra = Some(Uuid::new_v4().to_string());
2043 RTDUpdateChatHasScheduledMessagesBuilder { inner }
2044 }
2045
2046 pub fn chat_id(&self) -> i64 { self.chat_id }
2047
2048 pub fn has_scheduled_messages(&self) -> bool { self.has_scheduled_messages }
2049
2050}
2051
2052#[doc(hidden)]
2053pub struct RTDUpdateChatHasScheduledMessagesBuilder {
2054 inner: UpdateChatHasScheduledMessages
2055}
2056
2057impl RTDUpdateChatHasScheduledMessagesBuilder {
2058 pub fn build(&self) -> UpdateChatHasScheduledMessages { self.inner.clone() }
2059
2060
2061 pub fn chat_id(&mut self, chat_id: i64) -> &mut Self {
2062 self.inner.chat_id = chat_id;
2063 self
2064 }
2065
2066
2067 pub fn has_scheduled_messages(&mut self, has_scheduled_messages: bool) -> &mut Self {
2068 self.inner.has_scheduled_messages = has_scheduled_messages;
2069 self
2070 }
2071
2072}
2073
2074impl AsRef<UpdateChatHasScheduledMessages> for UpdateChatHasScheduledMessages {
2075 fn as_ref(&self) -> &UpdateChatHasScheduledMessages { self }
2076}
2077
2078impl AsRef<UpdateChatHasScheduledMessages> for RTDUpdateChatHasScheduledMessagesBuilder {
2079 fn as_ref(&self) -> &UpdateChatHasScheduledMessages { &self.inner }
2080}
2081
2082
2083
2084
2085
2086
2087
2088#[derive(Debug, Clone, Default, Serialize, Deserialize)]
2090pub struct UpdateChatIsBlocked {
2091 #[doc(hidden)]
2092 #[serde(rename(serialize = "@type", deserialize = "@type"))]
2093 td_name: String,
2094 #[doc(hidden)]
2095 #[serde(rename(serialize = "@extra", deserialize = "@extra"))]
2096 extra: Option<String>,
2097 chat_id: i64,
2099 is_blocked: bool,
2101
2102}
2103
2104impl RObject for UpdateChatIsBlocked {
2105 #[doc(hidden)] fn td_name(&self) -> &'static str { "updateChatIsBlocked" }
2106 #[doc(hidden)] fn extra(&self) -> Option<String> { self.extra.clone() }
2107 fn to_json(&self) -> RTDResult<String> { Ok(serde_json::to_string(self)?) }
2108}
2109
2110
2111impl TDUpdate for UpdateChatIsBlocked {}
2112
2113
2114
2115impl UpdateChatIsBlocked {
2116 pub fn from_json<S: AsRef<str>>(json: S) -> RTDResult<Self> { Ok(serde_json::from_str(json.as_ref())?) }
2117 pub fn builder() -> RTDUpdateChatIsBlockedBuilder {
2118 let mut inner = UpdateChatIsBlocked::default();
2119 inner.td_name = "updateChatIsBlocked".to_string();
2120 inner.extra = Some(Uuid::new_v4().to_string());
2121 RTDUpdateChatIsBlockedBuilder { inner }
2122 }
2123
2124 pub fn chat_id(&self) -> i64 { self.chat_id }
2125
2126 pub fn is_blocked(&self) -> bool { self.is_blocked }
2127
2128}
2129
2130#[doc(hidden)]
2131pub struct RTDUpdateChatIsBlockedBuilder {
2132 inner: UpdateChatIsBlocked
2133}
2134
2135impl RTDUpdateChatIsBlockedBuilder {
2136 pub fn build(&self) -> UpdateChatIsBlocked { self.inner.clone() }
2137
2138
2139 pub fn chat_id(&mut self, chat_id: i64) -> &mut Self {
2140 self.inner.chat_id = chat_id;
2141 self
2142 }
2143
2144
2145 pub fn is_blocked(&mut self, is_blocked: bool) -> &mut Self {
2146 self.inner.is_blocked = is_blocked;
2147 self
2148 }
2149
2150}
2151
2152impl AsRef<UpdateChatIsBlocked> for UpdateChatIsBlocked {
2153 fn as_ref(&self) -> &UpdateChatIsBlocked { self }
2154}
2155
2156impl AsRef<UpdateChatIsBlocked> for RTDUpdateChatIsBlockedBuilder {
2157 fn as_ref(&self) -> &UpdateChatIsBlocked { &self.inner }
2158}
2159
2160
2161
2162
2163
2164
2165
2166#[derive(Debug, Clone, Default, Serialize, Deserialize)]
2168pub struct UpdateChatIsMarkedAsUnread {
2169 #[doc(hidden)]
2170 #[serde(rename(serialize = "@type", deserialize = "@type"))]
2171 td_name: String,
2172 #[doc(hidden)]
2173 #[serde(rename(serialize = "@extra", deserialize = "@extra"))]
2174 extra: Option<String>,
2175 chat_id: i64,
2177 is_marked_as_unread: bool,
2179
2180}
2181
2182impl RObject for UpdateChatIsMarkedAsUnread {
2183 #[doc(hidden)] fn td_name(&self) -> &'static str { "updateChatIsMarkedAsUnread" }
2184 #[doc(hidden)] fn extra(&self) -> Option<String> { self.extra.clone() }
2185 fn to_json(&self) -> RTDResult<String> { Ok(serde_json::to_string(self)?) }
2186}
2187
2188
2189impl TDUpdate for UpdateChatIsMarkedAsUnread {}
2190
2191
2192
2193impl UpdateChatIsMarkedAsUnread {
2194 pub fn from_json<S: AsRef<str>>(json: S) -> RTDResult<Self> { Ok(serde_json::from_str(json.as_ref())?) }
2195 pub fn builder() -> RTDUpdateChatIsMarkedAsUnreadBuilder {
2196 let mut inner = UpdateChatIsMarkedAsUnread::default();
2197 inner.td_name = "updateChatIsMarkedAsUnread".to_string();
2198 inner.extra = Some(Uuid::new_v4().to_string());
2199 RTDUpdateChatIsMarkedAsUnreadBuilder { inner }
2200 }
2201
2202 pub fn chat_id(&self) -> i64 { self.chat_id }
2203
2204 pub fn is_marked_as_unread(&self) -> bool { self.is_marked_as_unread }
2205
2206}
2207
2208#[doc(hidden)]
2209pub struct RTDUpdateChatIsMarkedAsUnreadBuilder {
2210 inner: UpdateChatIsMarkedAsUnread
2211}
2212
2213impl RTDUpdateChatIsMarkedAsUnreadBuilder {
2214 pub fn build(&self) -> UpdateChatIsMarkedAsUnread { self.inner.clone() }
2215
2216
2217 pub fn chat_id(&mut self, chat_id: i64) -> &mut Self {
2218 self.inner.chat_id = chat_id;
2219 self
2220 }
2221
2222
2223 pub fn is_marked_as_unread(&mut self, is_marked_as_unread: bool) -> &mut Self {
2224 self.inner.is_marked_as_unread = is_marked_as_unread;
2225 self
2226 }
2227
2228}
2229
2230impl AsRef<UpdateChatIsMarkedAsUnread> for UpdateChatIsMarkedAsUnread {
2231 fn as_ref(&self) -> &UpdateChatIsMarkedAsUnread { self }
2232}
2233
2234impl AsRef<UpdateChatIsMarkedAsUnread> for RTDUpdateChatIsMarkedAsUnreadBuilder {
2235 fn as_ref(&self) -> &UpdateChatIsMarkedAsUnread { &self.inner }
2236}
2237
2238
2239
2240
2241
2242
2243
2244#[derive(Debug, Clone, Default, Serialize, Deserialize)]
2246pub struct UpdateChatLastMessage {
2247 #[doc(hidden)]
2248 #[serde(rename(serialize = "@type", deserialize = "@type"))]
2249 td_name: String,
2250 #[doc(hidden)]
2251 #[serde(rename(serialize = "@extra", deserialize = "@extra"))]
2252 extra: Option<String>,
2253 chat_id: i64,
2255 last_message: Option<Message>,
2257 positions: Option<Vec<ChatPosition>>,
2259
2260}
2261
2262impl RObject for UpdateChatLastMessage {
2263 #[doc(hidden)] fn td_name(&self) -> &'static str { "updateChatLastMessage" }
2264 #[doc(hidden)] fn extra(&self) -> Option<String> { self.extra.clone() }
2265 fn to_json(&self) -> RTDResult<String> { Ok(serde_json::to_string(self)?) }
2266}
2267
2268
2269impl TDUpdate for UpdateChatLastMessage {}
2270
2271
2272
2273impl UpdateChatLastMessage {
2274 pub fn from_json<S: AsRef<str>>(json: S) -> RTDResult<Self> { Ok(serde_json::from_str(json.as_ref())?) }
2275 pub fn builder() -> RTDUpdateChatLastMessageBuilder {
2276 let mut inner = UpdateChatLastMessage::default();
2277 inner.td_name = "updateChatLastMessage".to_string();
2278 inner.extra = Some(Uuid::new_v4().to_string());
2279 RTDUpdateChatLastMessageBuilder { inner }
2280 }
2281
2282 pub fn chat_id(&self) -> i64 { self.chat_id }
2283
2284 pub fn last_message(&self) -> &Option<Message> { &self.last_message }
2285
2286 pub fn positions(&self) -> &Option<Vec<ChatPosition>> { &self.positions }
2287
2288}
2289
2290#[doc(hidden)]
2291pub struct RTDUpdateChatLastMessageBuilder {
2292 inner: UpdateChatLastMessage
2293}
2294
2295impl RTDUpdateChatLastMessageBuilder {
2296 pub fn build(&self) -> UpdateChatLastMessage { self.inner.clone() }
2297
2298
2299 pub fn chat_id(&mut self, chat_id: i64) -> &mut Self {
2300 self.inner.chat_id = chat_id;
2301 self
2302 }
2303
2304
2305 pub fn last_message<T: AsRef<Message>>(&mut self, last_message: T) -> &mut Self {
2306 self.inner.last_message = Some(last_message.as_ref().clone());
2307 self
2308 }
2309
2310
2311 pub fn positions(&mut self, positions: Vec<ChatPosition>) -> &mut Self {
2312 self.inner.positions = Some(positions);
2313 self
2314 }
2315
2316}
2317
2318impl AsRef<UpdateChatLastMessage> for UpdateChatLastMessage {
2319 fn as_ref(&self) -> &UpdateChatLastMessage { self }
2320}
2321
2322impl AsRef<UpdateChatLastMessage> for RTDUpdateChatLastMessageBuilder {
2323 fn as_ref(&self) -> &UpdateChatLastMessage { &self.inner }
2324}
2325
2326
2327
2328
2329
2330
2331
2332#[derive(Debug, Clone, Default, Serialize, Deserialize)]
2334pub struct UpdateChatMember {
2335 #[doc(hidden)]
2336 #[serde(rename(serialize = "@type", deserialize = "@type"))]
2337 td_name: String,
2338 #[doc(hidden)]
2339 #[serde(rename(serialize = "@extra", deserialize = "@extra"))]
2340 extra: Option<String>,
2341 chat_id: i64,
2343 actor_user_id: i64,
2345 date: i64,
2347 invite_link: Option<ChatInviteLink>,
2349 old_chat_member: ChatMember,
2351 new_chat_member: ChatMember,
2353
2354}
2355
2356impl RObject for UpdateChatMember {
2357 #[doc(hidden)] fn td_name(&self) -> &'static str { "updateChatMember" }
2358 #[doc(hidden)] fn extra(&self) -> Option<String> { self.extra.clone() }
2359 fn to_json(&self) -> RTDResult<String> { Ok(serde_json::to_string(self)?) }
2360}
2361
2362
2363impl TDUpdate for UpdateChatMember {}
2364
2365
2366
2367impl UpdateChatMember {
2368 pub fn from_json<S: AsRef<str>>(json: S) -> RTDResult<Self> { Ok(serde_json::from_str(json.as_ref())?) }
2369 pub fn builder() -> RTDUpdateChatMemberBuilder {
2370 let mut inner = UpdateChatMember::default();
2371 inner.td_name = "updateChatMember".to_string();
2372 inner.extra = Some(Uuid::new_v4().to_string());
2373 RTDUpdateChatMemberBuilder { inner }
2374 }
2375
2376 pub fn chat_id(&self) -> i64 { self.chat_id }
2377
2378 pub fn actor_user_id(&self) -> i64 { self.actor_user_id }
2379
2380 pub fn date(&self) -> i64 { self.date }
2381
2382 pub fn invite_link(&self) -> &Option<ChatInviteLink> { &self.invite_link }
2383
2384 pub fn old_chat_member(&self) -> &ChatMember { &self.old_chat_member }
2385
2386 pub fn new_chat_member(&self) -> &ChatMember { &self.new_chat_member }
2387
2388}
2389
2390#[doc(hidden)]
2391pub struct RTDUpdateChatMemberBuilder {
2392 inner: UpdateChatMember
2393}
2394
2395impl RTDUpdateChatMemberBuilder {
2396 pub fn build(&self) -> UpdateChatMember { self.inner.clone() }
2397
2398
2399 pub fn chat_id(&mut self, chat_id: i64) -> &mut Self {
2400 self.inner.chat_id = chat_id;
2401 self
2402 }
2403
2404
2405 pub fn actor_user_id(&mut self, actor_user_id: i64) -> &mut Self {
2406 self.inner.actor_user_id = actor_user_id;
2407 self
2408 }
2409
2410
2411 pub fn date(&mut self, date: i64) -> &mut Self {
2412 self.inner.date = date;
2413 self
2414 }
2415
2416
2417 pub fn invite_link<T: AsRef<ChatInviteLink>>(&mut self, invite_link: T) -> &mut Self {
2418 self.inner.invite_link = Some(invite_link.as_ref().clone());
2419 self
2420 }
2421
2422
2423 pub fn old_chat_member<T: AsRef<ChatMember>>(&mut self, old_chat_member: T) -> &mut Self {
2424 self.inner.old_chat_member = old_chat_member.as_ref().clone();
2425 self
2426 }
2427
2428
2429 pub fn new_chat_member<T: AsRef<ChatMember>>(&mut self, new_chat_member: T) -> &mut Self {
2430 self.inner.new_chat_member = new_chat_member.as_ref().clone();
2431 self
2432 }
2433
2434}
2435
2436impl AsRef<UpdateChatMember> for UpdateChatMember {
2437 fn as_ref(&self) -> &UpdateChatMember { self }
2438}
2439
2440impl AsRef<UpdateChatMember> for RTDUpdateChatMemberBuilder {
2441 fn as_ref(&self) -> &UpdateChatMember { &self.inner }
2442}
2443
2444
2445
2446
2447
2448
2449
2450#[derive(Debug, Clone, Default, Serialize, Deserialize)]
2452pub struct UpdateChatMessageSender {
2453 #[doc(hidden)]
2454 #[serde(rename(serialize = "@type", deserialize = "@type"))]
2455 td_name: String,
2456 #[doc(hidden)]
2457 #[serde(rename(serialize = "@extra", deserialize = "@extra"))]
2458 extra: Option<String>,
2459 chat_id: i64,
2461 message_sender_id: Option<MessageSender>,
2463
2464}
2465
2466impl RObject for UpdateChatMessageSender {
2467 #[doc(hidden)] fn td_name(&self) -> &'static str { "updateChatMessageSender" }
2468 #[doc(hidden)] fn extra(&self) -> Option<String> { self.extra.clone() }
2469 fn to_json(&self) -> RTDResult<String> { Ok(serde_json::to_string(self)?) }
2470}
2471
2472
2473impl TDUpdate for UpdateChatMessageSender {}
2474
2475
2476
2477impl UpdateChatMessageSender {
2478 pub fn from_json<S: AsRef<str>>(json: S) -> RTDResult<Self> { Ok(serde_json::from_str(json.as_ref())?) }
2479 pub fn builder() -> RTDUpdateChatMessageSenderBuilder {
2480 let mut inner = UpdateChatMessageSender::default();
2481 inner.td_name = "updateChatMessageSender".to_string();
2482 inner.extra = Some(Uuid::new_v4().to_string());
2483 RTDUpdateChatMessageSenderBuilder { inner }
2484 }
2485
2486 pub fn chat_id(&self) -> i64 { self.chat_id }
2487
2488 pub fn message_sender_id(&self) -> &Option<MessageSender> { &self.message_sender_id }
2489
2490}
2491
2492#[doc(hidden)]
2493pub struct RTDUpdateChatMessageSenderBuilder {
2494 inner: UpdateChatMessageSender
2495}
2496
2497impl RTDUpdateChatMessageSenderBuilder {
2498 pub fn build(&self) -> UpdateChatMessageSender { self.inner.clone() }
2499
2500
2501 pub fn chat_id(&mut self, chat_id: i64) -> &mut Self {
2502 self.inner.chat_id = chat_id;
2503 self
2504 }
2505
2506
2507 pub fn message_sender_id<T: AsRef<MessageSender>>(&mut self, message_sender_id: T) -> &mut Self {
2508 self.inner.message_sender_id = Some(message_sender_id.as_ref().clone());
2509 self
2510 }
2511
2512}
2513
2514impl AsRef<UpdateChatMessageSender> for UpdateChatMessageSender {
2515 fn as_ref(&self) -> &UpdateChatMessageSender { self }
2516}
2517
2518impl AsRef<UpdateChatMessageSender> for RTDUpdateChatMessageSenderBuilder {
2519 fn as_ref(&self) -> &UpdateChatMessageSender { &self.inner }
2520}
2521
2522
2523
2524
2525
2526
2527
2528#[derive(Debug, Clone, Default, Serialize, Deserialize)]
2530pub struct UpdateChatMessageTtl {
2531 #[doc(hidden)]
2532 #[serde(rename(serialize = "@type", deserialize = "@type"))]
2533 td_name: String,
2534 #[doc(hidden)]
2535 #[serde(rename(serialize = "@extra", deserialize = "@extra"))]
2536 extra: Option<String>,
2537 chat_id: i64,
2539 message_ttl: i64,
2541
2542}
2543
2544impl RObject for UpdateChatMessageTtl {
2545 #[doc(hidden)] fn td_name(&self) -> &'static str { "updateChatMessageTtl" }
2546 #[doc(hidden)] fn extra(&self) -> Option<String> { self.extra.clone() }
2547 fn to_json(&self) -> RTDResult<String> { Ok(serde_json::to_string(self)?) }
2548}
2549
2550
2551impl TDUpdate for UpdateChatMessageTtl {}
2552
2553
2554
2555impl UpdateChatMessageTtl {
2556 pub fn from_json<S: AsRef<str>>(json: S) -> RTDResult<Self> { Ok(serde_json::from_str(json.as_ref())?) }
2557 pub fn builder() -> RTDUpdateChatMessageTtlBuilder {
2558 let mut inner = UpdateChatMessageTtl::default();
2559 inner.td_name = "updateChatMessageTtl".to_string();
2560 inner.extra = Some(Uuid::new_v4().to_string());
2561 RTDUpdateChatMessageTtlBuilder { inner }
2562 }
2563
2564 pub fn chat_id(&self) -> i64 { self.chat_id }
2565
2566 pub fn message_ttl(&self) -> i64 { self.message_ttl }
2567
2568}
2569
2570#[doc(hidden)]
2571pub struct RTDUpdateChatMessageTtlBuilder {
2572 inner: UpdateChatMessageTtl
2573}
2574
2575impl RTDUpdateChatMessageTtlBuilder {
2576 pub fn build(&self) -> UpdateChatMessageTtl { self.inner.clone() }
2577
2578
2579 pub fn chat_id(&mut self, chat_id: i64) -> &mut Self {
2580 self.inner.chat_id = chat_id;
2581 self
2582 }
2583
2584
2585 pub fn message_ttl(&mut self, message_ttl: i64) -> &mut Self {
2586 self.inner.message_ttl = message_ttl;
2587 self
2588 }
2589
2590}
2591
2592impl AsRef<UpdateChatMessageTtl> for UpdateChatMessageTtl {
2593 fn as_ref(&self) -> &UpdateChatMessageTtl { self }
2594}
2595
2596impl AsRef<UpdateChatMessageTtl> for RTDUpdateChatMessageTtlBuilder {
2597 fn as_ref(&self) -> &UpdateChatMessageTtl { &self.inner }
2598}
2599
2600
2601
2602
2603
2604
2605
2606#[derive(Debug, Clone, Default, Serialize, Deserialize)]
2608pub struct UpdateChatNotificationSettings {
2609 #[doc(hidden)]
2610 #[serde(rename(serialize = "@type", deserialize = "@type"))]
2611 td_name: String,
2612 #[doc(hidden)]
2613 #[serde(rename(serialize = "@extra", deserialize = "@extra"))]
2614 extra: Option<String>,
2615 chat_id: i64,
2617 notification_settings: ChatNotificationSettings,
2619
2620}
2621
2622impl RObject for UpdateChatNotificationSettings {
2623 #[doc(hidden)] fn td_name(&self) -> &'static str { "updateChatNotificationSettings" }
2624 #[doc(hidden)] fn extra(&self) -> Option<String> { self.extra.clone() }
2625 fn to_json(&self) -> RTDResult<String> { Ok(serde_json::to_string(self)?) }
2626}
2627
2628
2629impl TDUpdate for UpdateChatNotificationSettings {}
2630
2631
2632
2633impl UpdateChatNotificationSettings {
2634 pub fn from_json<S: AsRef<str>>(json: S) -> RTDResult<Self> { Ok(serde_json::from_str(json.as_ref())?) }
2635 pub fn builder() -> RTDUpdateChatNotificationSettingsBuilder {
2636 let mut inner = UpdateChatNotificationSettings::default();
2637 inner.td_name = "updateChatNotificationSettings".to_string();
2638 inner.extra = Some(Uuid::new_v4().to_string());
2639 RTDUpdateChatNotificationSettingsBuilder { inner }
2640 }
2641
2642 pub fn chat_id(&self) -> i64 { self.chat_id }
2643
2644 pub fn notification_settings(&self) -> &ChatNotificationSettings { &self.notification_settings }
2645
2646}
2647
2648#[doc(hidden)]
2649pub struct RTDUpdateChatNotificationSettingsBuilder {
2650 inner: UpdateChatNotificationSettings
2651}
2652
2653impl RTDUpdateChatNotificationSettingsBuilder {
2654 pub fn build(&self) -> UpdateChatNotificationSettings { self.inner.clone() }
2655
2656
2657 pub fn chat_id(&mut self, chat_id: i64) -> &mut Self {
2658 self.inner.chat_id = chat_id;
2659 self
2660 }
2661
2662
2663 pub fn notification_settings<T: AsRef<ChatNotificationSettings>>(&mut self, notification_settings: T) -> &mut Self {
2664 self.inner.notification_settings = notification_settings.as_ref().clone();
2665 self
2666 }
2667
2668}
2669
2670impl AsRef<UpdateChatNotificationSettings> for UpdateChatNotificationSettings {
2671 fn as_ref(&self) -> &UpdateChatNotificationSettings { self }
2672}
2673
2674impl AsRef<UpdateChatNotificationSettings> for RTDUpdateChatNotificationSettingsBuilder {
2675 fn as_ref(&self) -> &UpdateChatNotificationSettings { &self.inner }
2676}
2677
2678
2679
2680
2681
2682
2683
2684#[derive(Debug, Clone, Default, Serialize, Deserialize)]
2686pub struct UpdateChatOnlineMemberCount {
2687 #[doc(hidden)]
2688 #[serde(rename(serialize = "@type", deserialize = "@type"))]
2689 td_name: String,
2690 #[doc(hidden)]
2691 #[serde(rename(serialize = "@extra", deserialize = "@extra"))]
2692 extra: Option<String>,
2693 chat_id: i64,
2695 online_member_count: i64,
2697
2698}
2699
2700impl RObject for UpdateChatOnlineMemberCount {
2701 #[doc(hidden)] fn td_name(&self) -> &'static str { "updateChatOnlineMemberCount" }
2702 #[doc(hidden)] fn extra(&self) -> Option<String> { self.extra.clone() }
2703 fn to_json(&self) -> RTDResult<String> { Ok(serde_json::to_string(self)?) }
2704}
2705
2706
2707impl TDUpdate for UpdateChatOnlineMemberCount {}
2708
2709
2710
2711impl UpdateChatOnlineMemberCount {
2712 pub fn from_json<S: AsRef<str>>(json: S) -> RTDResult<Self> { Ok(serde_json::from_str(json.as_ref())?) }
2713 pub fn builder() -> RTDUpdateChatOnlineMemberCountBuilder {
2714 let mut inner = UpdateChatOnlineMemberCount::default();
2715 inner.td_name = "updateChatOnlineMemberCount".to_string();
2716 inner.extra = Some(Uuid::new_v4().to_string());
2717 RTDUpdateChatOnlineMemberCountBuilder { inner }
2718 }
2719
2720 pub fn chat_id(&self) -> i64 { self.chat_id }
2721
2722 pub fn online_member_count(&self) -> i64 { self.online_member_count }
2723
2724}
2725
2726#[doc(hidden)]
2727pub struct RTDUpdateChatOnlineMemberCountBuilder {
2728 inner: UpdateChatOnlineMemberCount
2729}
2730
2731impl RTDUpdateChatOnlineMemberCountBuilder {
2732 pub fn build(&self) -> UpdateChatOnlineMemberCount { self.inner.clone() }
2733
2734
2735 pub fn chat_id(&mut self, chat_id: i64) -> &mut Self {
2736 self.inner.chat_id = chat_id;
2737 self
2738 }
2739
2740
2741 pub fn online_member_count(&mut self, online_member_count: i64) -> &mut Self {
2742 self.inner.online_member_count = online_member_count;
2743 self
2744 }
2745
2746}
2747
2748impl AsRef<UpdateChatOnlineMemberCount> for UpdateChatOnlineMemberCount {
2749 fn as_ref(&self) -> &UpdateChatOnlineMemberCount { self }
2750}
2751
2752impl AsRef<UpdateChatOnlineMemberCount> for RTDUpdateChatOnlineMemberCountBuilder {
2753 fn as_ref(&self) -> &UpdateChatOnlineMemberCount { &self.inner }
2754}
2755
2756
2757
2758
2759
2760
2761
2762#[derive(Debug, Clone, Default, Serialize, Deserialize)]
2764pub struct UpdateChatPendingJoinRequests {
2765 #[doc(hidden)]
2766 #[serde(rename(serialize = "@type", deserialize = "@type"))]
2767 td_name: String,
2768 #[doc(hidden)]
2769 #[serde(rename(serialize = "@extra", deserialize = "@extra"))]
2770 extra: Option<String>,
2771 chat_id: i64,
2773 pending_join_requests: Option<ChatJoinRequestsInfo>,
2775
2776}
2777
2778impl RObject for UpdateChatPendingJoinRequests {
2779 #[doc(hidden)] fn td_name(&self) -> &'static str { "updateChatPendingJoinRequests" }
2780 #[doc(hidden)] fn extra(&self) -> Option<String> { self.extra.clone() }
2781 fn to_json(&self) -> RTDResult<String> { Ok(serde_json::to_string(self)?) }
2782}
2783
2784
2785impl TDUpdate for UpdateChatPendingJoinRequests {}
2786
2787
2788
2789impl UpdateChatPendingJoinRequests {
2790 pub fn from_json<S: AsRef<str>>(json: S) -> RTDResult<Self> { Ok(serde_json::from_str(json.as_ref())?) }
2791 pub fn builder() -> RTDUpdateChatPendingJoinRequestsBuilder {
2792 let mut inner = UpdateChatPendingJoinRequests::default();
2793 inner.td_name = "updateChatPendingJoinRequests".to_string();
2794 inner.extra = Some(Uuid::new_v4().to_string());
2795 RTDUpdateChatPendingJoinRequestsBuilder { inner }
2796 }
2797
2798 pub fn chat_id(&self) -> i64 { self.chat_id }
2799
2800 pub fn pending_join_requests(&self) -> &Option<ChatJoinRequestsInfo> { &self.pending_join_requests }
2801
2802}
2803
2804#[doc(hidden)]
2805pub struct RTDUpdateChatPendingJoinRequestsBuilder {
2806 inner: UpdateChatPendingJoinRequests
2807}
2808
2809impl RTDUpdateChatPendingJoinRequestsBuilder {
2810 pub fn build(&self) -> UpdateChatPendingJoinRequests { self.inner.clone() }
2811
2812
2813 pub fn chat_id(&mut self, chat_id: i64) -> &mut Self {
2814 self.inner.chat_id = chat_id;
2815 self
2816 }
2817
2818
2819 pub fn pending_join_requests<T: AsRef<ChatJoinRequestsInfo>>(&mut self, pending_join_requests: T) -> &mut Self {
2820 self.inner.pending_join_requests = Some(pending_join_requests.as_ref().clone());
2821 self
2822 }
2823
2824}
2825
2826impl AsRef<UpdateChatPendingJoinRequests> for UpdateChatPendingJoinRequests {
2827 fn as_ref(&self) -> &UpdateChatPendingJoinRequests { self }
2828}
2829
2830impl AsRef<UpdateChatPendingJoinRequests> for RTDUpdateChatPendingJoinRequestsBuilder {
2831 fn as_ref(&self) -> &UpdateChatPendingJoinRequests { &self.inner }
2832}
2833
2834
2835
2836
2837
2838
2839
2840#[derive(Debug, Clone, Default, Serialize, Deserialize)]
2842pub struct UpdateChatPermissions {
2843 #[doc(hidden)]
2844 #[serde(rename(serialize = "@type", deserialize = "@type"))]
2845 td_name: String,
2846 #[doc(hidden)]
2847 #[serde(rename(serialize = "@extra", deserialize = "@extra"))]
2848 extra: Option<String>,
2849 chat_id: i64,
2851 permissions: ChatPermissions,
2853
2854}
2855
2856impl RObject for UpdateChatPermissions {
2857 #[doc(hidden)] fn td_name(&self) -> &'static str { "updateChatPermissions" }
2858 #[doc(hidden)] fn extra(&self) -> Option<String> { self.extra.clone() }
2859 fn to_json(&self) -> RTDResult<String> { Ok(serde_json::to_string(self)?) }
2860}
2861
2862
2863impl TDUpdate for UpdateChatPermissions {}
2864
2865
2866
2867impl UpdateChatPermissions {
2868 pub fn from_json<S: AsRef<str>>(json: S) -> RTDResult<Self> { Ok(serde_json::from_str(json.as_ref())?) }
2869 pub fn builder() -> RTDUpdateChatPermissionsBuilder {
2870 let mut inner = UpdateChatPermissions::default();
2871 inner.td_name = "updateChatPermissions".to_string();
2872 inner.extra = Some(Uuid::new_v4().to_string());
2873 RTDUpdateChatPermissionsBuilder { inner }
2874 }
2875
2876 pub fn chat_id(&self) -> i64 { self.chat_id }
2877
2878 pub fn permissions(&self) -> &ChatPermissions { &self.permissions }
2879
2880}
2881
2882#[doc(hidden)]
2883pub struct RTDUpdateChatPermissionsBuilder {
2884 inner: UpdateChatPermissions
2885}
2886
2887impl RTDUpdateChatPermissionsBuilder {
2888 pub fn build(&self) -> UpdateChatPermissions { self.inner.clone() }
2889
2890
2891 pub fn chat_id(&mut self, chat_id: i64) -> &mut Self {
2892 self.inner.chat_id = chat_id;
2893 self
2894 }
2895
2896
2897 pub fn permissions<T: AsRef<ChatPermissions>>(&mut self, permissions: T) -> &mut Self {
2898 self.inner.permissions = permissions.as_ref().clone();
2899 self
2900 }
2901
2902}
2903
2904impl AsRef<UpdateChatPermissions> for UpdateChatPermissions {
2905 fn as_ref(&self) -> &UpdateChatPermissions { self }
2906}
2907
2908impl AsRef<UpdateChatPermissions> for RTDUpdateChatPermissionsBuilder {
2909 fn as_ref(&self) -> &UpdateChatPermissions { &self.inner }
2910}
2911
2912
2913
2914
2915
2916
2917
2918#[derive(Debug, Clone, Default, Serialize, Deserialize)]
2920pub struct UpdateChatPhoto {
2921 #[doc(hidden)]
2922 #[serde(rename(serialize = "@type", deserialize = "@type"))]
2923 td_name: String,
2924 #[doc(hidden)]
2925 #[serde(rename(serialize = "@extra", deserialize = "@extra"))]
2926 extra: Option<String>,
2927 chat_id: i64,
2929 photo: Option<ChatPhotoInfo>,
2931
2932}
2933
2934impl RObject for UpdateChatPhoto {
2935 #[doc(hidden)] fn td_name(&self) -> &'static str { "updateChatPhoto" }
2936 #[doc(hidden)] fn extra(&self) -> Option<String> { self.extra.clone() }
2937 fn to_json(&self) -> RTDResult<String> { Ok(serde_json::to_string(self)?) }
2938}
2939
2940
2941impl TDUpdate for UpdateChatPhoto {}
2942
2943
2944
2945impl UpdateChatPhoto {
2946 pub fn from_json<S: AsRef<str>>(json: S) -> RTDResult<Self> { Ok(serde_json::from_str(json.as_ref())?) }
2947 pub fn builder() -> RTDUpdateChatPhotoBuilder {
2948 let mut inner = UpdateChatPhoto::default();
2949 inner.td_name = "updateChatPhoto".to_string();
2950 inner.extra = Some(Uuid::new_v4().to_string());
2951 RTDUpdateChatPhotoBuilder { inner }
2952 }
2953
2954 pub fn chat_id(&self) -> i64 { self.chat_id }
2955
2956 pub fn photo(&self) -> &Option<ChatPhotoInfo> { &self.photo }
2957
2958}
2959
2960#[doc(hidden)]
2961pub struct RTDUpdateChatPhotoBuilder {
2962 inner: UpdateChatPhoto
2963}
2964
2965impl RTDUpdateChatPhotoBuilder {
2966 pub fn build(&self) -> UpdateChatPhoto { self.inner.clone() }
2967
2968
2969 pub fn chat_id(&mut self, chat_id: i64) -> &mut Self {
2970 self.inner.chat_id = chat_id;
2971 self
2972 }
2973
2974
2975 pub fn photo<T: AsRef<ChatPhotoInfo>>(&mut self, photo: T) -> &mut Self {
2976 self.inner.photo = Some(photo.as_ref().clone());
2977 self
2978 }
2979
2980}
2981
2982impl AsRef<UpdateChatPhoto> for UpdateChatPhoto {
2983 fn as_ref(&self) -> &UpdateChatPhoto { self }
2984}
2985
2986impl AsRef<UpdateChatPhoto> for RTDUpdateChatPhotoBuilder {
2987 fn as_ref(&self) -> &UpdateChatPhoto { &self.inner }
2988}
2989
2990
2991
2992
2993
2994
2995
2996#[derive(Debug, Clone, Default, Serialize, Deserialize)]
2998pub struct UpdateChatPosition {
2999 #[doc(hidden)]
3000 #[serde(rename(serialize = "@type", deserialize = "@type"))]
3001 td_name: String,
3002 #[doc(hidden)]
3003 #[serde(rename(serialize = "@extra", deserialize = "@extra"))]
3004 extra: Option<String>,
3005 chat_id: i64,
3007 position: ChatPosition,
3009
3010}
3011
3012impl RObject for UpdateChatPosition {
3013 #[doc(hidden)] fn td_name(&self) -> &'static str { "updateChatPosition" }
3014 #[doc(hidden)] fn extra(&self) -> Option<String> { self.extra.clone() }
3015 fn to_json(&self) -> RTDResult<String> { Ok(serde_json::to_string(self)?) }
3016}
3017
3018
3019impl TDUpdate for UpdateChatPosition {}
3020
3021
3022
3023impl UpdateChatPosition {
3024 pub fn from_json<S: AsRef<str>>(json: S) -> RTDResult<Self> { Ok(serde_json::from_str(json.as_ref())?) }
3025 pub fn builder() -> RTDUpdateChatPositionBuilder {
3026 let mut inner = UpdateChatPosition::default();
3027 inner.td_name = "updateChatPosition".to_string();
3028 inner.extra = Some(Uuid::new_v4().to_string());
3029 RTDUpdateChatPositionBuilder { inner }
3030 }
3031
3032 pub fn chat_id(&self) -> i64 { self.chat_id }
3033
3034 pub fn position(&self) -> &ChatPosition { &self.position }
3035
3036}
3037
3038#[doc(hidden)]
3039pub struct RTDUpdateChatPositionBuilder {
3040 inner: UpdateChatPosition
3041}
3042
3043impl RTDUpdateChatPositionBuilder {
3044 pub fn build(&self) -> UpdateChatPosition { self.inner.clone() }
3045
3046
3047 pub fn chat_id(&mut self, chat_id: i64) -> &mut Self {
3048 self.inner.chat_id = chat_id;
3049 self
3050 }
3051
3052
3053 pub fn position<T: AsRef<ChatPosition>>(&mut self, position: T) -> &mut Self {
3054 self.inner.position = position.as_ref().clone();
3055 self
3056 }
3057
3058}
3059
3060impl AsRef<UpdateChatPosition> for UpdateChatPosition {
3061 fn as_ref(&self) -> &UpdateChatPosition { self }
3062}
3063
3064impl AsRef<UpdateChatPosition> for RTDUpdateChatPositionBuilder {
3065 fn as_ref(&self) -> &UpdateChatPosition { &self.inner }
3066}
3067
3068
3069
3070
3071
3072
3073
3074#[derive(Debug, Clone, Default, Serialize, Deserialize)]
3076pub struct UpdateChatReadInbox {
3077 #[doc(hidden)]
3078 #[serde(rename(serialize = "@type", deserialize = "@type"))]
3079 td_name: String,
3080 #[doc(hidden)]
3081 #[serde(rename(serialize = "@extra", deserialize = "@extra"))]
3082 extra: Option<String>,
3083 chat_id: i64,
3085 last_read_inbox_message_id: i64,
3087 unread_count: i64,
3089
3090}
3091
3092impl RObject for UpdateChatReadInbox {
3093 #[doc(hidden)] fn td_name(&self) -> &'static str { "updateChatReadInbox" }
3094 #[doc(hidden)] fn extra(&self) -> Option<String> { self.extra.clone() }
3095 fn to_json(&self) -> RTDResult<String> { Ok(serde_json::to_string(self)?) }
3096}
3097
3098
3099impl TDUpdate for UpdateChatReadInbox {}
3100
3101
3102
3103impl UpdateChatReadInbox {
3104 pub fn from_json<S: AsRef<str>>(json: S) -> RTDResult<Self> { Ok(serde_json::from_str(json.as_ref())?) }
3105 pub fn builder() -> RTDUpdateChatReadInboxBuilder {
3106 let mut inner = UpdateChatReadInbox::default();
3107 inner.td_name = "updateChatReadInbox".to_string();
3108 inner.extra = Some(Uuid::new_v4().to_string());
3109 RTDUpdateChatReadInboxBuilder { inner }
3110 }
3111
3112 pub fn chat_id(&self) -> i64 { self.chat_id }
3113
3114 pub fn last_read_inbox_message_id(&self) -> i64 { self.last_read_inbox_message_id }
3115
3116 pub fn unread_count(&self) -> i64 { self.unread_count }
3117
3118}
3119
3120#[doc(hidden)]
3121pub struct RTDUpdateChatReadInboxBuilder {
3122 inner: UpdateChatReadInbox
3123}
3124
3125impl RTDUpdateChatReadInboxBuilder {
3126 pub fn build(&self) -> UpdateChatReadInbox { self.inner.clone() }
3127
3128
3129 pub fn chat_id(&mut self, chat_id: i64) -> &mut Self {
3130 self.inner.chat_id = chat_id;
3131 self
3132 }
3133
3134
3135 pub fn last_read_inbox_message_id(&mut self, last_read_inbox_message_id: i64) -> &mut Self {
3136 self.inner.last_read_inbox_message_id = last_read_inbox_message_id;
3137 self
3138 }
3139
3140
3141 pub fn unread_count(&mut self, unread_count: i64) -> &mut Self {
3142 self.inner.unread_count = unread_count;
3143 self
3144 }
3145
3146}
3147
3148impl AsRef<UpdateChatReadInbox> for UpdateChatReadInbox {
3149 fn as_ref(&self) -> &UpdateChatReadInbox { self }
3150}
3151
3152impl AsRef<UpdateChatReadInbox> for RTDUpdateChatReadInboxBuilder {
3153 fn as_ref(&self) -> &UpdateChatReadInbox { &self.inner }
3154}
3155
3156
3157
3158
3159
3160
3161
3162#[derive(Debug, Clone, Default, Serialize, Deserialize)]
3164pub struct UpdateChatReadOutbox {
3165 #[doc(hidden)]
3166 #[serde(rename(serialize = "@type", deserialize = "@type"))]
3167 td_name: String,
3168 #[doc(hidden)]
3169 #[serde(rename(serialize = "@extra", deserialize = "@extra"))]
3170 extra: Option<String>,
3171 chat_id: i64,
3173 last_read_outbox_message_id: i64,
3175
3176}
3177
3178impl RObject for UpdateChatReadOutbox {
3179 #[doc(hidden)] fn td_name(&self) -> &'static str { "updateChatReadOutbox" }
3180 #[doc(hidden)] fn extra(&self) -> Option<String> { self.extra.clone() }
3181 fn to_json(&self) -> RTDResult<String> { Ok(serde_json::to_string(self)?) }
3182}
3183
3184
3185impl TDUpdate for UpdateChatReadOutbox {}
3186
3187
3188
3189impl UpdateChatReadOutbox {
3190 pub fn from_json<S: AsRef<str>>(json: S) -> RTDResult<Self> { Ok(serde_json::from_str(json.as_ref())?) }
3191 pub fn builder() -> RTDUpdateChatReadOutboxBuilder {
3192 let mut inner = UpdateChatReadOutbox::default();
3193 inner.td_name = "updateChatReadOutbox".to_string();
3194 inner.extra = Some(Uuid::new_v4().to_string());
3195 RTDUpdateChatReadOutboxBuilder { inner }
3196 }
3197
3198 pub fn chat_id(&self) -> i64 { self.chat_id }
3199
3200 pub fn last_read_outbox_message_id(&self) -> i64 { self.last_read_outbox_message_id }
3201
3202}
3203
3204#[doc(hidden)]
3205pub struct RTDUpdateChatReadOutboxBuilder {
3206 inner: UpdateChatReadOutbox
3207}
3208
3209impl RTDUpdateChatReadOutboxBuilder {
3210 pub fn build(&self) -> UpdateChatReadOutbox { self.inner.clone() }
3211
3212
3213 pub fn chat_id(&mut self, chat_id: i64) -> &mut Self {
3214 self.inner.chat_id = chat_id;
3215 self
3216 }
3217
3218
3219 pub fn last_read_outbox_message_id(&mut self, last_read_outbox_message_id: i64) -> &mut Self {
3220 self.inner.last_read_outbox_message_id = last_read_outbox_message_id;
3221 self
3222 }
3223
3224}
3225
3226impl AsRef<UpdateChatReadOutbox> for UpdateChatReadOutbox {
3227 fn as_ref(&self) -> &UpdateChatReadOutbox { self }
3228}
3229
3230impl AsRef<UpdateChatReadOutbox> for RTDUpdateChatReadOutboxBuilder {
3231 fn as_ref(&self) -> &UpdateChatReadOutbox { &self.inner }
3232}
3233
3234
3235
3236
3237
3238
3239
3240#[derive(Debug, Clone, Default, Serialize, Deserialize)]
3242pub struct UpdateChatReplyMarkup {
3243 #[doc(hidden)]
3244 #[serde(rename(serialize = "@type", deserialize = "@type"))]
3245 td_name: String,
3246 #[doc(hidden)]
3247 #[serde(rename(serialize = "@extra", deserialize = "@extra"))]
3248 extra: Option<String>,
3249 chat_id: i64,
3251 reply_markup_message_id: i64,
3253
3254}
3255
3256impl RObject for UpdateChatReplyMarkup {
3257 #[doc(hidden)] fn td_name(&self) -> &'static str { "updateChatReplyMarkup" }
3258 #[doc(hidden)] fn extra(&self) -> Option<String> { self.extra.clone() }
3259 fn to_json(&self) -> RTDResult<String> { Ok(serde_json::to_string(self)?) }
3260}
3261
3262
3263impl TDUpdate for UpdateChatReplyMarkup {}
3264
3265
3266
3267impl UpdateChatReplyMarkup {
3268 pub fn from_json<S: AsRef<str>>(json: S) -> RTDResult<Self> { Ok(serde_json::from_str(json.as_ref())?) }
3269 pub fn builder() -> RTDUpdateChatReplyMarkupBuilder {
3270 let mut inner = UpdateChatReplyMarkup::default();
3271 inner.td_name = "updateChatReplyMarkup".to_string();
3272 inner.extra = Some(Uuid::new_v4().to_string());
3273 RTDUpdateChatReplyMarkupBuilder { inner }
3274 }
3275
3276 pub fn chat_id(&self) -> i64 { self.chat_id }
3277
3278 pub fn reply_markup_message_id(&self) -> i64 { self.reply_markup_message_id }
3279
3280}
3281
3282#[doc(hidden)]
3283pub struct RTDUpdateChatReplyMarkupBuilder {
3284 inner: UpdateChatReplyMarkup
3285}
3286
3287impl RTDUpdateChatReplyMarkupBuilder {
3288 pub fn build(&self) -> UpdateChatReplyMarkup { self.inner.clone() }
3289
3290
3291 pub fn chat_id(&mut self, chat_id: i64) -> &mut Self {
3292 self.inner.chat_id = chat_id;
3293 self
3294 }
3295
3296
3297 pub fn reply_markup_message_id(&mut self, reply_markup_message_id: i64) -> &mut Self {
3298 self.inner.reply_markup_message_id = reply_markup_message_id;
3299 self
3300 }
3301
3302}
3303
3304impl AsRef<UpdateChatReplyMarkup> for UpdateChatReplyMarkup {
3305 fn as_ref(&self) -> &UpdateChatReplyMarkup { self }
3306}
3307
3308impl AsRef<UpdateChatReplyMarkup> for RTDUpdateChatReplyMarkupBuilder {
3309 fn as_ref(&self) -> &UpdateChatReplyMarkup { &self.inner }
3310}
3311
3312
3313
3314
3315
3316
3317
3318#[derive(Debug, Clone, Default, Serialize, Deserialize)]
3320pub struct UpdateChatTheme {
3321 #[doc(hidden)]
3322 #[serde(rename(serialize = "@type", deserialize = "@type"))]
3323 td_name: String,
3324 #[doc(hidden)]
3325 #[serde(rename(serialize = "@extra", deserialize = "@extra"))]
3326 extra: Option<String>,
3327 chat_id: i64,
3329 theme_name: String,
3331
3332}
3333
3334impl RObject for UpdateChatTheme {
3335 #[doc(hidden)] fn td_name(&self) -> &'static str { "updateChatTheme" }
3336 #[doc(hidden)] fn extra(&self) -> Option<String> { self.extra.clone() }
3337 fn to_json(&self) -> RTDResult<String> { Ok(serde_json::to_string(self)?) }
3338}
3339
3340
3341impl TDUpdate for UpdateChatTheme {}
3342
3343
3344
3345impl UpdateChatTheme {
3346 pub fn from_json<S: AsRef<str>>(json: S) -> RTDResult<Self> { Ok(serde_json::from_str(json.as_ref())?) }
3347 pub fn builder() -> RTDUpdateChatThemeBuilder {
3348 let mut inner = UpdateChatTheme::default();
3349 inner.td_name = "updateChatTheme".to_string();
3350 inner.extra = Some(Uuid::new_v4().to_string());
3351 RTDUpdateChatThemeBuilder { inner }
3352 }
3353
3354 pub fn chat_id(&self) -> i64 { self.chat_id }
3355
3356 pub fn theme_name(&self) -> &String { &self.theme_name }
3357
3358}
3359
3360#[doc(hidden)]
3361pub struct RTDUpdateChatThemeBuilder {
3362 inner: UpdateChatTheme
3363}
3364
3365impl RTDUpdateChatThemeBuilder {
3366 pub fn build(&self) -> UpdateChatTheme { self.inner.clone() }
3367
3368
3369 pub fn chat_id(&mut self, chat_id: i64) -> &mut Self {
3370 self.inner.chat_id = chat_id;
3371 self
3372 }
3373
3374
3375 pub fn theme_name<T: AsRef<str>>(&mut self, theme_name: T) -> &mut Self {
3376 self.inner.theme_name = theme_name.as_ref().to_string();
3377 self
3378 }
3379
3380}
3381
3382impl AsRef<UpdateChatTheme> for UpdateChatTheme {
3383 fn as_ref(&self) -> &UpdateChatTheme { self }
3384}
3385
3386impl AsRef<UpdateChatTheme> for RTDUpdateChatThemeBuilder {
3387 fn as_ref(&self) -> &UpdateChatTheme { &self.inner }
3388}
3389
3390
3391
3392
3393
3394
3395
3396#[derive(Debug, Clone, Default, Serialize, Deserialize)]
3398pub struct UpdateChatThemes {
3399 #[doc(hidden)]
3400 #[serde(rename(serialize = "@type", deserialize = "@type"))]
3401 td_name: String,
3402 #[doc(hidden)]
3403 #[serde(rename(serialize = "@extra", deserialize = "@extra"))]
3404 extra: Option<String>,
3405 chat_themes: Vec<ChatTheme>,
3407
3408}
3409
3410impl RObject for UpdateChatThemes {
3411 #[doc(hidden)] fn td_name(&self) -> &'static str { "updateChatThemes" }
3412 #[doc(hidden)] fn extra(&self) -> Option<String> { self.extra.clone() }
3413 fn to_json(&self) -> RTDResult<String> { Ok(serde_json::to_string(self)?) }
3414}
3415
3416
3417impl TDUpdate for UpdateChatThemes {}
3418
3419
3420
3421impl UpdateChatThemes {
3422 pub fn from_json<S: AsRef<str>>(json: S) -> RTDResult<Self> { Ok(serde_json::from_str(json.as_ref())?) }
3423 pub fn builder() -> RTDUpdateChatThemesBuilder {
3424 let mut inner = UpdateChatThemes::default();
3425 inner.td_name = "updateChatThemes".to_string();
3426 inner.extra = Some(Uuid::new_v4().to_string());
3427 RTDUpdateChatThemesBuilder { inner }
3428 }
3429
3430 pub fn chat_themes(&self) -> &Vec<ChatTheme> { &self.chat_themes }
3431
3432}
3433
3434#[doc(hidden)]
3435pub struct RTDUpdateChatThemesBuilder {
3436 inner: UpdateChatThemes
3437}
3438
3439impl RTDUpdateChatThemesBuilder {
3440 pub fn build(&self) -> UpdateChatThemes { self.inner.clone() }
3441
3442
3443 pub fn chat_themes(&mut self, chat_themes: Vec<ChatTheme>) -> &mut Self {
3444 self.inner.chat_themes = chat_themes;
3445 self
3446 }
3447
3448}
3449
3450impl AsRef<UpdateChatThemes> for UpdateChatThemes {
3451 fn as_ref(&self) -> &UpdateChatThemes { self }
3452}
3453
3454impl AsRef<UpdateChatThemes> for RTDUpdateChatThemesBuilder {
3455 fn as_ref(&self) -> &UpdateChatThemes { &self.inner }
3456}
3457
3458
3459
3460
3461
3462
3463
3464#[derive(Debug, Clone, Default, Serialize, Deserialize)]
3466pub struct UpdateChatTitle {
3467 #[doc(hidden)]
3468 #[serde(rename(serialize = "@type", deserialize = "@type"))]
3469 td_name: String,
3470 #[doc(hidden)]
3471 #[serde(rename(serialize = "@extra", deserialize = "@extra"))]
3472 extra: Option<String>,
3473 chat_id: i64,
3475 title: String,
3477
3478}
3479
3480impl RObject for UpdateChatTitle {
3481 #[doc(hidden)] fn td_name(&self) -> &'static str { "updateChatTitle" }
3482 #[doc(hidden)] fn extra(&self) -> Option<String> { self.extra.clone() }
3483 fn to_json(&self) -> RTDResult<String> { Ok(serde_json::to_string(self)?) }
3484}
3485
3486
3487impl TDUpdate for UpdateChatTitle {}
3488
3489
3490
3491impl UpdateChatTitle {
3492 pub fn from_json<S: AsRef<str>>(json: S) -> RTDResult<Self> { Ok(serde_json::from_str(json.as_ref())?) }
3493 pub fn builder() -> RTDUpdateChatTitleBuilder {
3494 let mut inner = UpdateChatTitle::default();
3495 inner.td_name = "updateChatTitle".to_string();
3496 inner.extra = Some(Uuid::new_v4().to_string());
3497 RTDUpdateChatTitleBuilder { inner }
3498 }
3499
3500 pub fn chat_id(&self) -> i64 { self.chat_id }
3501
3502 pub fn title(&self) -> &String { &self.title }
3503
3504}
3505
3506#[doc(hidden)]
3507pub struct RTDUpdateChatTitleBuilder {
3508 inner: UpdateChatTitle
3509}
3510
3511impl RTDUpdateChatTitleBuilder {
3512 pub fn build(&self) -> UpdateChatTitle { self.inner.clone() }
3513
3514
3515 pub fn chat_id(&mut self, chat_id: i64) -> &mut Self {
3516 self.inner.chat_id = chat_id;
3517 self
3518 }
3519
3520
3521 pub fn title<T: AsRef<str>>(&mut self, title: T) -> &mut Self {
3522 self.inner.title = title.as_ref().to_string();
3523 self
3524 }
3525
3526}
3527
3528impl AsRef<UpdateChatTitle> for UpdateChatTitle {
3529 fn as_ref(&self) -> &UpdateChatTitle { self }
3530}
3531
3532impl AsRef<UpdateChatTitle> for RTDUpdateChatTitleBuilder {
3533 fn as_ref(&self) -> &UpdateChatTitle { &self.inner }
3534}
3535
3536
3537
3538
3539
3540
3541
3542#[derive(Debug, Clone, Default, Serialize, Deserialize)]
3544pub struct UpdateChatUnreadMentionCount {
3545 #[doc(hidden)]
3546 #[serde(rename(serialize = "@type", deserialize = "@type"))]
3547 td_name: String,
3548 #[doc(hidden)]
3549 #[serde(rename(serialize = "@extra", deserialize = "@extra"))]
3550 extra: Option<String>,
3551 chat_id: i64,
3553 unread_mention_count: i64,
3555
3556}
3557
3558impl RObject for UpdateChatUnreadMentionCount {
3559 #[doc(hidden)] fn td_name(&self) -> &'static str { "updateChatUnreadMentionCount" }
3560 #[doc(hidden)] fn extra(&self) -> Option<String> { self.extra.clone() }
3561 fn to_json(&self) -> RTDResult<String> { Ok(serde_json::to_string(self)?) }
3562}
3563
3564
3565impl TDUpdate for UpdateChatUnreadMentionCount {}
3566
3567
3568
3569impl UpdateChatUnreadMentionCount {
3570 pub fn from_json<S: AsRef<str>>(json: S) -> RTDResult<Self> { Ok(serde_json::from_str(json.as_ref())?) }
3571 pub fn builder() -> RTDUpdateChatUnreadMentionCountBuilder {
3572 let mut inner = UpdateChatUnreadMentionCount::default();
3573 inner.td_name = "updateChatUnreadMentionCount".to_string();
3574 inner.extra = Some(Uuid::new_v4().to_string());
3575 RTDUpdateChatUnreadMentionCountBuilder { inner }
3576 }
3577
3578 pub fn chat_id(&self) -> i64 { self.chat_id }
3579
3580 pub fn unread_mention_count(&self) -> i64 { self.unread_mention_count }
3581
3582}
3583
3584#[doc(hidden)]
3585pub struct RTDUpdateChatUnreadMentionCountBuilder {
3586 inner: UpdateChatUnreadMentionCount
3587}
3588
3589impl RTDUpdateChatUnreadMentionCountBuilder {
3590 pub fn build(&self) -> UpdateChatUnreadMentionCount { self.inner.clone() }
3591
3592
3593 pub fn chat_id(&mut self, chat_id: i64) -> &mut Self {
3594 self.inner.chat_id = chat_id;
3595 self
3596 }
3597
3598
3599 pub fn unread_mention_count(&mut self, unread_mention_count: i64) -> &mut Self {
3600 self.inner.unread_mention_count = unread_mention_count;
3601 self
3602 }
3603
3604}
3605
3606impl AsRef<UpdateChatUnreadMentionCount> for UpdateChatUnreadMentionCount {
3607 fn as_ref(&self) -> &UpdateChatUnreadMentionCount { self }
3608}
3609
3610impl AsRef<UpdateChatUnreadMentionCount> for RTDUpdateChatUnreadMentionCountBuilder {
3611 fn as_ref(&self) -> &UpdateChatUnreadMentionCount { &self.inner }
3612}
3613
3614
3615
3616
3617
3618
3619
3620#[derive(Debug, Clone, Default, Serialize, Deserialize)]
3622pub struct UpdateChatVideoChat {
3623 #[doc(hidden)]
3624 #[serde(rename(serialize = "@type", deserialize = "@type"))]
3625 td_name: String,
3626 #[doc(hidden)]
3627 #[serde(rename(serialize = "@extra", deserialize = "@extra"))]
3628 extra: Option<String>,
3629 chat_id: i64,
3631 video_chat: VideoChat,
3633
3634}
3635
3636impl RObject for UpdateChatVideoChat {
3637 #[doc(hidden)] fn td_name(&self) -> &'static str { "updateChatVideoChat" }
3638 #[doc(hidden)] fn extra(&self) -> Option<String> { self.extra.clone() }
3639 fn to_json(&self) -> RTDResult<String> { Ok(serde_json::to_string(self)?) }
3640}
3641
3642
3643impl TDUpdate for UpdateChatVideoChat {}
3644
3645
3646
3647impl UpdateChatVideoChat {
3648 pub fn from_json<S: AsRef<str>>(json: S) -> RTDResult<Self> { Ok(serde_json::from_str(json.as_ref())?) }
3649 pub fn builder() -> RTDUpdateChatVideoChatBuilder {
3650 let mut inner = UpdateChatVideoChat::default();
3651 inner.td_name = "updateChatVideoChat".to_string();
3652 inner.extra = Some(Uuid::new_v4().to_string());
3653 RTDUpdateChatVideoChatBuilder { inner }
3654 }
3655
3656 pub fn chat_id(&self) -> i64 { self.chat_id }
3657
3658 pub fn video_chat(&self) -> &VideoChat { &self.video_chat }
3659
3660}
3661
3662#[doc(hidden)]
3663pub struct RTDUpdateChatVideoChatBuilder {
3664 inner: UpdateChatVideoChat
3665}
3666
3667impl RTDUpdateChatVideoChatBuilder {
3668 pub fn build(&self) -> UpdateChatVideoChat { self.inner.clone() }
3669
3670
3671 pub fn chat_id(&mut self, chat_id: i64) -> &mut Self {
3672 self.inner.chat_id = chat_id;
3673 self
3674 }
3675
3676
3677 pub fn video_chat<T: AsRef<VideoChat>>(&mut self, video_chat: T) -> &mut Self {
3678 self.inner.video_chat = video_chat.as_ref().clone();
3679 self
3680 }
3681
3682}
3683
3684impl AsRef<UpdateChatVideoChat> for UpdateChatVideoChat {
3685 fn as_ref(&self) -> &UpdateChatVideoChat { self }
3686}
3687
3688impl AsRef<UpdateChatVideoChat> for RTDUpdateChatVideoChatBuilder {
3689 fn as_ref(&self) -> &UpdateChatVideoChat { &self.inner }
3690}
3691
3692
3693
3694
3695
3696
3697
3698#[derive(Debug, Clone, Default, Serialize, Deserialize)]
3700pub struct UpdateConnectionState {
3701 #[doc(hidden)]
3702 #[serde(rename(serialize = "@type", deserialize = "@type"))]
3703 td_name: String,
3704 #[doc(hidden)]
3705 #[serde(rename(serialize = "@extra", deserialize = "@extra"))]
3706 extra: Option<String>,
3707 state: ConnectionState,
3709
3710}
3711
3712impl RObject for UpdateConnectionState {
3713 #[doc(hidden)] fn td_name(&self) -> &'static str { "updateConnectionState" }
3714 #[doc(hidden)] fn extra(&self) -> Option<String> { self.extra.clone() }
3715 fn to_json(&self) -> RTDResult<String> { Ok(serde_json::to_string(self)?) }
3716}
3717
3718
3719impl TDUpdate for UpdateConnectionState {}
3720
3721
3722
3723impl UpdateConnectionState {
3724 pub fn from_json<S: AsRef<str>>(json: S) -> RTDResult<Self> { Ok(serde_json::from_str(json.as_ref())?) }
3725 pub fn builder() -> RTDUpdateConnectionStateBuilder {
3726 let mut inner = UpdateConnectionState::default();
3727 inner.td_name = "updateConnectionState".to_string();
3728 inner.extra = Some(Uuid::new_v4().to_string());
3729 RTDUpdateConnectionStateBuilder { inner }
3730 }
3731
3732 pub fn state(&self) -> &ConnectionState { &self.state }
3733
3734}
3735
3736#[doc(hidden)]
3737pub struct RTDUpdateConnectionStateBuilder {
3738 inner: UpdateConnectionState
3739}
3740
3741impl RTDUpdateConnectionStateBuilder {
3742 pub fn build(&self) -> UpdateConnectionState { self.inner.clone() }
3743
3744
3745 pub fn state<T: AsRef<ConnectionState>>(&mut self, state: T) -> &mut Self {
3746 self.inner.state = state.as_ref().clone();
3747 self
3748 }
3749
3750}
3751
3752impl AsRef<UpdateConnectionState> for UpdateConnectionState {
3753 fn as_ref(&self) -> &UpdateConnectionState { self }
3754}
3755
3756impl AsRef<UpdateConnectionState> for RTDUpdateConnectionStateBuilder {
3757 fn as_ref(&self) -> &UpdateConnectionState { &self.inner }
3758}
3759
3760
3761
3762
3763
3764
3765
3766#[derive(Debug, Clone, Default, Serialize, Deserialize)]
3768pub struct UpdateDeleteMessages {
3769 #[doc(hidden)]
3770 #[serde(rename(serialize = "@type", deserialize = "@type"))]
3771 td_name: String,
3772 #[doc(hidden)]
3773 #[serde(rename(serialize = "@extra", deserialize = "@extra"))]
3774 extra: Option<String>,
3775 chat_id: i64,
3777 message_ids: Vec<i64>,
3779 is_permanent: bool,
3781 from_cache: bool,
3783
3784}
3785
3786impl RObject for UpdateDeleteMessages {
3787 #[doc(hidden)] fn td_name(&self) -> &'static str { "updateDeleteMessages" }
3788 #[doc(hidden)] fn extra(&self) -> Option<String> { self.extra.clone() }
3789 fn to_json(&self) -> RTDResult<String> { Ok(serde_json::to_string(self)?) }
3790}
3791
3792
3793impl TDUpdate for UpdateDeleteMessages {}
3794
3795
3796
3797impl UpdateDeleteMessages {
3798 pub fn from_json<S: AsRef<str>>(json: S) -> RTDResult<Self> { Ok(serde_json::from_str(json.as_ref())?) }
3799 pub fn builder() -> RTDUpdateDeleteMessagesBuilder {
3800 let mut inner = UpdateDeleteMessages::default();
3801 inner.td_name = "updateDeleteMessages".to_string();
3802 inner.extra = Some(Uuid::new_v4().to_string());
3803 RTDUpdateDeleteMessagesBuilder { inner }
3804 }
3805
3806 pub fn chat_id(&self) -> i64 { self.chat_id }
3807
3808 pub fn message_ids(&self) -> &Vec<i64> { &self.message_ids }
3809
3810 pub fn is_permanent(&self) -> bool { self.is_permanent }
3811
3812 pub fn from_cache(&self) -> bool { self.from_cache }
3813
3814}
3815
3816#[doc(hidden)]
3817pub struct RTDUpdateDeleteMessagesBuilder {
3818 inner: UpdateDeleteMessages
3819}
3820
3821impl RTDUpdateDeleteMessagesBuilder {
3822 pub fn build(&self) -> UpdateDeleteMessages { self.inner.clone() }
3823
3824
3825 pub fn chat_id(&mut self, chat_id: i64) -> &mut Self {
3826 self.inner.chat_id = chat_id;
3827 self
3828 }
3829
3830
3831 pub fn message_ids(&mut self, message_ids: Vec<i64>) -> &mut Self {
3832 self.inner.message_ids = message_ids;
3833 self
3834 }
3835
3836
3837 pub fn is_permanent(&mut self, is_permanent: bool) -> &mut Self {
3838 self.inner.is_permanent = is_permanent;
3839 self
3840 }
3841
3842
3843 pub fn from_cache(&mut self, from_cache: bool) -> &mut Self {
3844 self.inner.from_cache = from_cache;
3845 self
3846 }
3847
3848}
3849
3850impl AsRef<UpdateDeleteMessages> for UpdateDeleteMessages {
3851 fn as_ref(&self) -> &UpdateDeleteMessages { self }
3852}
3853
3854impl AsRef<UpdateDeleteMessages> for RTDUpdateDeleteMessagesBuilder {
3855 fn as_ref(&self) -> &UpdateDeleteMessages { &self.inner }
3856}
3857
3858
3859
3860
3861
3862
3863
3864#[derive(Debug, Clone, Default, Serialize, Deserialize)]
3866pub struct UpdateDiceEmojis {
3867 #[doc(hidden)]
3868 #[serde(rename(serialize = "@type", deserialize = "@type"))]
3869 td_name: String,
3870 #[doc(hidden)]
3871 #[serde(rename(serialize = "@extra", deserialize = "@extra"))]
3872 extra: Option<String>,
3873 emojis: Vec<String>,
3875
3876}
3877
3878impl RObject for UpdateDiceEmojis {
3879 #[doc(hidden)] fn td_name(&self) -> &'static str { "updateDiceEmojis" }
3880 #[doc(hidden)] fn extra(&self) -> Option<String> { self.extra.clone() }
3881 fn to_json(&self) -> RTDResult<String> { Ok(serde_json::to_string(self)?) }
3882}
3883
3884
3885impl TDUpdate for UpdateDiceEmojis {}
3886
3887
3888
3889impl UpdateDiceEmojis {
3890 pub fn from_json<S: AsRef<str>>(json: S) -> RTDResult<Self> { Ok(serde_json::from_str(json.as_ref())?) }
3891 pub fn builder() -> RTDUpdateDiceEmojisBuilder {
3892 let mut inner = UpdateDiceEmojis::default();
3893 inner.td_name = "updateDiceEmojis".to_string();
3894 inner.extra = Some(Uuid::new_v4().to_string());
3895 RTDUpdateDiceEmojisBuilder { inner }
3896 }
3897
3898 pub fn emojis(&self) -> &Vec<String> { &self.emojis }
3899
3900}
3901
3902#[doc(hidden)]
3903pub struct RTDUpdateDiceEmojisBuilder {
3904 inner: UpdateDiceEmojis
3905}
3906
3907impl RTDUpdateDiceEmojisBuilder {
3908 pub fn build(&self) -> UpdateDiceEmojis { self.inner.clone() }
3909
3910
3911 pub fn emojis(&mut self, emojis: Vec<String>) -> &mut Self {
3912 self.inner.emojis = emojis;
3913 self
3914 }
3915
3916}
3917
3918impl AsRef<UpdateDiceEmojis> for UpdateDiceEmojis {
3919 fn as_ref(&self) -> &UpdateDiceEmojis { self }
3920}
3921
3922impl AsRef<UpdateDiceEmojis> for RTDUpdateDiceEmojisBuilder {
3923 fn as_ref(&self) -> &UpdateDiceEmojis { &self.inner }
3924}
3925
3926
3927
3928
3929
3930
3931
3932#[derive(Debug, Clone, Default, Serialize, Deserialize)]
3934pub struct UpdateFavoriteStickers {
3935 #[doc(hidden)]
3936 #[serde(rename(serialize = "@type", deserialize = "@type"))]
3937 td_name: String,
3938 #[doc(hidden)]
3939 #[serde(rename(serialize = "@extra", deserialize = "@extra"))]
3940 extra: Option<String>,
3941 sticker_ids: Vec<i64>,
3943
3944}
3945
3946impl RObject for UpdateFavoriteStickers {
3947 #[doc(hidden)] fn td_name(&self) -> &'static str { "updateFavoriteStickers" }
3948 #[doc(hidden)] fn extra(&self) -> Option<String> { self.extra.clone() }
3949 fn to_json(&self) -> RTDResult<String> { Ok(serde_json::to_string(self)?) }
3950}
3951
3952
3953impl TDUpdate for UpdateFavoriteStickers {}
3954
3955
3956
3957impl UpdateFavoriteStickers {
3958 pub fn from_json<S: AsRef<str>>(json: S) -> RTDResult<Self> { Ok(serde_json::from_str(json.as_ref())?) }
3959 pub fn builder() -> RTDUpdateFavoriteStickersBuilder {
3960 let mut inner = UpdateFavoriteStickers::default();
3961 inner.td_name = "updateFavoriteStickers".to_string();
3962 inner.extra = Some(Uuid::new_v4().to_string());
3963 RTDUpdateFavoriteStickersBuilder { inner }
3964 }
3965
3966 pub fn sticker_ids(&self) -> &Vec<i64> { &self.sticker_ids }
3967
3968}
3969
3970#[doc(hidden)]
3971pub struct RTDUpdateFavoriteStickersBuilder {
3972 inner: UpdateFavoriteStickers
3973}
3974
3975impl RTDUpdateFavoriteStickersBuilder {
3976 pub fn build(&self) -> UpdateFavoriteStickers { self.inner.clone() }
3977
3978
3979 pub fn sticker_ids(&mut self, sticker_ids: Vec<i64>) -> &mut Self {
3980 self.inner.sticker_ids = sticker_ids;
3981 self
3982 }
3983
3984}
3985
3986impl AsRef<UpdateFavoriteStickers> for UpdateFavoriteStickers {
3987 fn as_ref(&self) -> &UpdateFavoriteStickers { self }
3988}
3989
3990impl AsRef<UpdateFavoriteStickers> for RTDUpdateFavoriteStickersBuilder {
3991 fn as_ref(&self) -> &UpdateFavoriteStickers { &self.inner }
3992}
3993
3994
3995
3996
3997
3998
3999
4000#[derive(Debug, Clone, Default, Serialize, Deserialize)]
4002pub struct UpdateFile {
4003 #[doc(hidden)]
4004 #[serde(rename(serialize = "@type", deserialize = "@type"))]
4005 td_name: String,
4006 #[doc(hidden)]
4007 #[serde(rename(serialize = "@extra", deserialize = "@extra"))]
4008 extra: Option<String>,
4009 file: File,
4011
4012}
4013
4014impl RObject for UpdateFile {
4015 #[doc(hidden)] fn td_name(&self) -> &'static str { "updateFile" }
4016 #[doc(hidden)] fn extra(&self) -> Option<String> { self.extra.clone() }
4017 fn to_json(&self) -> RTDResult<String> { Ok(serde_json::to_string(self)?) }
4018}
4019
4020
4021impl TDUpdate for UpdateFile {}
4022
4023
4024
4025impl UpdateFile {
4026 pub fn from_json<S: AsRef<str>>(json: S) -> RTDResult<Self> { Ok(serde_json::from_str(json.as_ref())?) }
4027 pub fn builder() -> RTDUpdateFileBuilder {
4028 let mut inner = UpdateFile::default();
4029 inner.td_name = "updateFile".to_string();
4030 inner.extra = Some(Uuid::new_v4().to_string());
4031 RTDUpdateFileBuilder { inner }
4032 }
4033
4034 pub fn file(&self) -> &File { &self.file }
4035
4036}
4037
4038#[doc(hidden)]
4039pub struct RTDUpdateFileBuilder {
4040 inner: UpdateFile
4041}
4042
4043impl RTDUpdateFileBuilder {
4044 pub fn build(&self) -> UpdateFile { self.inner.clone() }
4045
4046
4047 pub fn file<T: AsRef<File>>(&mut self, file: T) -> &mut Self {
4048 self.inner.file = file.as_ref().clone();
4049 self
4050 }
4051
4052}
4053
4054impl AsRef<UpdateFile> for UpdateFile {
4055 fn as_ref(&self) -> &UpdateFile { self }
4056}
4057
4058impl AsRef<UpdateFile> for RTDUpdateFileBuilder {
4059 fn as_ref(&self) -> &UpdateFile { &self.inner }
4060}
4061
4062
4063
4064
4065
4066
4067
4068#[derive(Debug, Clone, Default, Serialize, Deserialize)]
4070pub struct UpdateFileGenerationStart {
4071 #[doc(hidden)]
4072 #[serde(rename(serialize = "@type", deserialize = "@type"))]
4073 td_name: String,
4074 #[doc(hidden)]
4075 #[serde(rename(serialize = "@extra", deserialize = "@extra"))]
4076 extra: Option<String>,
4077 generation_id: isize,
4079 original_path: String,
4081 destination_path: String,
4083 conversion: String,
4085
4086}
4087
4088impl RObject for UpdateFileGenerationStart {
4089 #[doc(hidden)] fn td_name(&self) -> &'static str { "updateFileGenerationStart" }
4090 #[doc(hidden)] fn extra(&self) -> Option<String> { self.extra.clone() }
4091 fn to_json(&self) -> RTDResult<String> { Ok(serde_json::to_string(self)?) }
4092}
4093
4094
4095impl TDUpdate for UpdateFileGenerationStart {}
4096
4097
4098
4099impl UpdateFileGenerationStart {
4100 pub fn from_json<S: AsRef<str>>(json: S) -> RTDResult<Self> { Ok(serde_json::from_str(json.as_ref())?) }
4101 pub fn builder() -> RTDUpdateFileGenerationStartBuilder {
4102 let mut inner = UpdateFileGenerationStart::default();
4103 inner.td_name = "updateFileGenerationStart".to_string();
4104 inner.extra = Some(Uuid::new_v4().to_string());
4105 RTDUpdateFileGenerationStartBuilder { inner }
4106 }
4107
4108 pub fn generation_id(&self) -> isize { self.generation_id }
4109
4110 pub fn original_path(&self) -> &String { &self.original_path }
4111
4112 pub fn destination_path(&self) -> &String { &self.destination_path }
4113
4114 pub fn conversion(&self) -> &String { &self.conversion }
4115
4116}
4117
4118#[doc(hidden)]
4119pub struct RTDUpdateFileGenerationStartBuilder {
4120 inner: UpdateFileGenerationStart
4121}
4122
4123impl RTDUpdateFileGenerationStartBuilder {
4124 pub fn build(&self) -> UpdateFileGenerationStart { self.inner.clone() }
4125
4126
4127 pub fn generation_id(&mut self, generation_id: isize) -> &mut Self {
4128 self.inner.generation_id = generation_id;
4129 self
4130 }
4131
4132
4133 pub fn original_path<T: AsRef<str>>(&mut self, original_path: T) -> &mut Self {
4134 self.inner.original_path = original_path.as_ref().to_string();
4135 self
4136 }
4137
4138
4139 pub fn destination_path<T: AsRef<str>>(&mut self, destination_path: T) -> &mut Self {
4140 self.inner.destination_path = destination_path.as_ref().to_string();
4141 self
4142 }
4143
4144
4145 pub fn conversion<T: AsRef<str>>(&mut self, conversion: T) -> &mut Self {
4146 self.inner.conversion = conversion.as_ref().to_string();
4147 self
4148 }
4149
4150}
4151
4152impl AsRef<UpdateFileGenerationStart> for UpdateFileGenerationStart {
4153 fn as_ref(&self) -> &UpdateFileGenerationStart { self }
4154}
4155
4156impl AsRef<UpdateFileGenerationStart> for RTDUpdateFileGenerationStartBuilder {
4157 fn as_ref(&self) -> &UpdateFileGenerationStart { &self.inner }
4158}
4159
4160
4161
4162
4163
4164
4165
4166#[derive(Debug, Clone, Default, Serialize, Deserialize)]
4168pub struct UpdateFileGenerationStop {
4169 #[doc(hidden)]
4170 #[serde(rename(serialize = "@type", deserialize = "@type"))]
4171 td_name: String,
4172 #[doc(hidden)]
4173 #[serde(rename(serialize = "@extra", deserialize = "@extra"))]
4174 extra: Option<String>,
4175 generation_id: isize,
4177
4178}
4179
4180impl RObject for UpdateFileGenerationStop {
4181 #[doc(hidden)] fn td_name(&self) -> &'static str { "updateFileGenerationStop" }
4182 #[doc(hidden)] fn extra(&self) -> Option<String> { self.extra.clone() }
4183 fn to_json(&self) -> RTDResult<String> { Ok(serde_json::to_string(self)?) }
4184}
4185
4186
4187impl TDUpdate for UpdateFileGenerationStop {}
4188
4189
4190
4191impl UpdateFileGenerationStop {
4192 pub fn from_json<S: AsRef<str>>(json: S) -> RTDResult<Self> { Ok(serde_json::from_str(json.as_ref())?) }
4193 pub fn builder() -> RTDUpdateFileGenerationStopBuilder {
4194 let mut inner = UpdateFileGenerationStop::default();
4195 inner.td_name = "updateFileGenerationStop".to_string();
4196 inner.extra = Some(Uuid::new_v4().to_string());
4197 RTDUpdateFileGenerationStopBuilder { inner }
4198 }
4199
4200 pub fn generation_id(&self) -> isize { self.generation_id }
4201
4202}
4203
4204#[doc(hidden)]
4205pub struct RTDUpdateFileGenerationStopBuilder {
4206 inner: UpdateFileGenerationStop
4207}
4208
4209impl RTDUpdateFileGenerationStopBuilder {
4210 pub fn build(&self) -> UpdateFileGenerationStop { self.inner.clone() }
4211
4212
4213 pub fn generation_id(&mut self, generation_id: isize) -> &mut Self {
4214 self.inner.generation_id = generation_id;
4215 self
4216 }
4217
4218}
4219
4220impl AsRef<UpdateFileGenerationStop> for UpdateFileGenerationStop {
4221 fn as_ref(&self) -> &UpdateFileGenerationStop { self }
4222}
4223
4224impl AsRef<UpdateFileGenerationStop> for RTDUpdateFileGenerationStopBuilder {
4225 fn as_ref(&self) -> &UpdateFileGenerationStop { &self.inner }
4226}
4227
4228
4229
4230
4231
4232
4233
4234#[derive(Debug, Clone, Default, Serialize, Deserialize)]
4236pub struct UpdateGroupCall {
4237 #[doc(hidden)]
4238 #[serde(rename(serialize = "@type", deserialize = "@type"))]
4239 td_name: String,
4240 #[doc(hidden)]
4241 #[serde(rename(serialize = "@extra", deserialize = "@extra"))]
4242 extra: Option<String>,
4243 group_call: GroupCall,
4245
4246}
4247
4248impl RObject for UpdateGroupCall {
4249 #[doc(hidden)] fn td_name(&self) -> &'static str { "updateGroupCall" }
4250 #[doc(hidden)] fn extra(&self) -> Option<String> { self.extra.clone() }
4251 fn to_json(&self) -> RTDResult<String> { Ok(serde_json::to_string(self)?) }
4252}
4253
4254
4255impl TDUpdate for UpdateGroupCall {}
4256
4257
4258
4259impl UpdateGroupCall {
4260 pub fn from_json<S: AsRef<str>>(json: S) -> RTDResult<Self> { Ok(serde_json::from_str(json.as_ref())?) }
4261 pub fn builder() -> RTDUpdateGroupCallBuilder {
4262 let mut inner = UpdateGroupCall::default();
4263 inner.td_name = "updateGroupCall".to_string();
4264 inner.extra = Some(Uuid::new_v4().to_string());
4265 RTDUpdateGroupCallBuilder { inner }
4266 }
4267
4268 pub fn group_call(&self) -> &GroupCall { &self.group_call }
4269
4270}
4271
4272#[doc(hidden)]
4273pub struct RTDUpdateGroupCallBuilder {
4274 inner: UpdateGroupCall
4275}
4276
4277impl RTDUpdateGroupCallBuilder {
4278 pub fn build(&self) -> UpdateGroupCall { self.inner.clone() }
4279
4280
4281 pub fn group_call<T: AsRef<GroupCall>>(&mut self, group_call: T) -> &mut Self {
4282 self.inner.group_call = group_call.as_ref().clone();
4283 self
4284 }
4285
4286}
4287
4288impl AsRef<UpdateGroupCall> for UpdateGroupCall {
4289 fn as_ref(&self) -> &UpdateGroupCall { self }
4290}
4291
4292impl AsRef<UpdateGroupCall> for RTDUpdateGroupCallBuilder {
4293 fn as_ref(&self) -> &UpdateGroupCall { &self.inner }
4294}
4295
4296
4297
4298
4299
4300
4301
4302#[derive(Debug, Clone, Default, Serialize, Deserialize)]
4304pub struct UpdateGroupCallParticipant {
4305 #[doc(hidden)]
4306 #[serde(rename(serialize = "@type", deserialize = "@type"))]
4307 td_name: String,
4308 #[doc(hidden)]
4309 #[serde(rename(serialize = "@extra", deserialize = "@extra"))]
4310 extra: Option<String>,
4311 group_call_id: i64,
4313 participant: GroupCallParticipant,
4315
4316}
4317
4318impl RObject for UpdateGroupCallParticipant {
4319 #[doc(hidden)] fn td_name(&self) -> &'static str { "updateGroupCallParticipant" }
4320 #[doc(hidden)] fn extra(&self) -> Option<String> { self.extra.clone() }
4321 fn to_json(&self) -> RTDResult<String> { Ok(serde_json::to_string(self)?) }
4322}
4323
4324
4325impl TDUpdate for UpdateGroupCallParticipant {}
4326
4327
4328
4329impl UpdateGroupCallParticipant {
4330 pub fn from_json<S: AsRef<str>>(json: S) -> RTDResult<Self> { Ok(serde_json::from_str(json.as_ref())?) }
4331 pub fn builder() -> RTDUpdateGroupCallParticipantBuilder {
4332 let mut inner = UpdateGroupCallParticipant::default();
4333 inner.td_name = "updateGroupCallParticipant".to_string();
4334 inner.extra = Some(Uuid::new_v4().to_string());
4335 RTDUpdateGroupCallParticipantBuilder { inner }
4336 }
4337
4338 pub fn group_call_id(&self) -> i64 { self.group_call_id }
4339
4340 pub fn participant(&self) -> &GroupCallParticipant { &self.participant }
4341
4342}
4343
4344#[doc(hidden)]
4345pub struct RTDUpdateGroupCallParticipantBuilder {
4346 inner: UpdateGroupCallParticipant
4347}
4348
4349impl RTDUpdateGroupCallParticipantBuilder {
4350 pub fn build(&self) -> UpdateGroupCallParticipant { self.inner.clone() }
4351
4352
4353 pub fn group_call_id(&mut self, group_call_id: i64) -> &mut Self {
4354 self.inner.group_call_id = group_call_id;
4355 self
4356 }
4357
4358
4359 pub fn participant<T: AsRef<GroupCallParticipant>>(&mut self, participant: T) -> &mut Self {
4360 self.inner.participant = participant.as_ref().clone();
4361 self
4362 }
4363
4364}
4365
4366impl AsRef<UpdateGroupCallParticipant> for UpdateGroupCallParticipant {
4367 fn as_ref(&self) -> &UpdateGroupCallParticipant { self }
4368}
4369
4370impl AsRef<UpdateGroupCallParticipant> for RTDUpdateGroupCallParticipantBuilder {
4371 fn as_ref(&self) -> &UpdateGroupCallParticipant { &self.inner }
4372}
4373
4374
4375
4376
4377
4378
4379
4380#[derive(Debug, Clone, Default, Serialize, Deserialize)]
4382pub struct UpdateHavePendingNotifications {
4383 #[doc(hidden)]
4384 #[serde(rename(serialize = "@type", deserialize = "@type"))]
4385 td_name: String,
4386 #[doc(hidden)]
4387 #[serde(rename(serialize = "@extra", deserialize = "@extra"))]
4388 extra: Option<String>,
4389 have_delayed_notifications: bool,
4391 have_unreceived_notifications: bool,
4393
4394}
4395
4396impl RObject for UpdateHavePendingNotifications {
4397 #[doc(hidden)] fn td_name(&self) -> &'static str { "updateHavePendingNotifications" }
4398 #[doc(hidden)] fn extra(&self) -> Option<String> { self.extra.clone() }
4399 fn to_json(&self) -> RTDResult<String> { Ok(serde_json::to_string(self)?) }
4400}
4401
4402
4403impl TDUpdate for UpdateHavePendingNotifications {}
4404
4405
4406
4407impl UpdateHavePendingNotifications {
4408 pub fn from_json<S: AsRef<str>>(json: S) -> RTDResult<Self> { Ok(serde_json::from_str(json.as_ref())?) }
4409 pub fn builder() -> RTDUpdateHavePendingNotificationsBuilder {
4410 let mut inner = UpdateHavePendingNotifications::default();
4411 inner.td_name = "updateHavePendingNotifications".to_string();
4412 inner.extra = Some(Uuid::new_v4().to_string());
4413 RTDUpdateHavePendingNotificationsBuilder { inner }
4414 }
4415
4416 pub fn have_delayed_notifications(&self) -> bool { self.have_delayed_notifications }
4417
4418 pub fn have_unreceived_notifications(&self) -> bool { self.have_unreceived_notifications }
4419
4420}
4421
4422#[doc(hidden)]
4423pub struct RTDUpdateHavePendingNotificationsBuilder {
4424 inner: UpdateHavePendingNotifications
4425}
4426
4427impl RTDUpdateHavePendingNotificationsBuilder {
4428 pub fn build(&self) -> UpdateHavePendingNotifications { self.inner.clone() }
4429
4430
4431 pub fn have_delayed_notifications(&mut self, have_delayed_notifications: bool) -> &mut Self {
4432 self.inner.have_delayed_notifications = have_delayed_notifications;
4433 self
4434 }
4435
4436
4437 pub fn have_unreceived_notifications(&mut self, have_unreceived_notifications: bool) -> &mut Self {
4438 self.inner.have_unreceived_notifications = have_unreceived_notifications;
4439 self
4440 }
4441
4442}
4443
4444impl AsRef<UpdateHavePendingNotifications> for UpdateHavePendingNotifications {
4445 fn as_ref(&self) -> &UpdateHavePendingNotifications { self }
4446}
4447
4448impl AsRef<UpdateHavePendingNotifications> for RTDUpdateHavePendingNotificationsBuilder {
4449 fn as_ref(&self) -> &UpdateHavePendingNotifications { &self.inner }
4450}
4451
4452
4453
4454
4455
4456
4457
4458#[derive(Debug, Clone, Default, Serialize, Deserialize)]
4460pub struct UpdateInstalledStickerSets {
4461 #[doc(hidden)]
4462 #[serde(rename(serialize = "@type", deserialize = "@type"))]
4463 td_name: String,
4464 #[doc(hidden)]
4465 #[serde(rename(serialize = "@extra", deserialize = "@extra"))]
4466 extra: Option<String>,
4467 is_masks: bool,
4469 sticker_set_ids: Vec<isize>,
4471
4472}
4473
4474impl RObject for UpdateInstalledStickerSets {
4475 #[doc(hidden)] fn td_name(&self) -> &'static str { "updateInstalledStickerSets" }
4476 #[doc(hidden)] fn extra(&self) -> Option<String> { self.extra.clone() }
4477 fn to_json(&self) -> RTDResult<String> { Ok(serde_json::to_string(self)?) }
4478}
4479
4480
4481impl TDUpdate for UpdateInstalledStickerSets {}
4482
4483
4484
4485impl UpdateInstalledStickerSets {
4486 pub fn from_json<S: AsRef<str>>(json: S) -> RTDResult<Self> { Ok(serde_json::from_str(json.as_ref())?) }
4487 pub fn builder() -> RTDUpdateInstalledStickerSetsBuilder {
4488 let mut inner = UpdateInstalledStickerSets::default();
4489 inner.td_name = "updateInstalledStickerSets".to_string();
4490 inner.extra = Some(Uuid::new_v4().to_string());
4491 RTDUpdateInstalledStickerSetsBuilder { inner }
4492 }
4493
4494 pub fn is_masks(&self) -> bool { self.is_masks }
4495
4496 pub fn sticker_set_ids(&self) -> &Vec<isize> { &self.sticker_set_ids }
4497
4498}
4499
4500#[doc(hidden)]
4501pub struct RTDUpdateInstalledStickerSetsBuilder {
4502 inner: UpdateInstalledStickerSets
4503}
4504
4505impl RTDUpdateInstalledStickerSetsBuilder {
4506 pub fn build(&self) -> UpdateInstalledStickerSets { self.inner.clone() }
4507
4508
4509 pub fn is_masks(&mut self, is_masks: bool) -> &mut Self {
4510 self.inner.is_masks = is_masks;
4511 self
4512 }
4513
4514
4515 pub fn sticker_set_ids(&mut self, sticker_set_ids: Vec<isize>) -> &mut Self {
4516 self.inner.sticker_set_ids = sticker_set_ids;
4517 self
4518 }
4519
4520}
4521
4522impl AsRef<UpdateInstalledStickerSets> for UpdateInstalledStickerSets {
4523 fn as_ref(&self) -> &UpdateInstalledStickerSets { self }
4524}
4525
4526impl AsRef<UpdateInstalledStickerSets> for RTDUpdateInstalledStickerSetsBuilder {
4527 fn as_ref(&self) -> &UpdateInstalledStickerSets { &self.inner }
4528}
4529
4530
4531
4532
4533
4534
4535
4536#[derive(Debug, Clone, Default, Serialize, Deserialize)]
4538pub struct UpdateLanguagePackStrings {
4539 #[doc(hidden)]
4540 #[serde(rename(serialize = "@type", deserialize = "@type"))]
4541 td_name: String,
4542 #[doc(hidden)]
4543 #[serde(rename(serialize = "@extra", deserialize = "@extra"))]
4544 extra: Option<String>,
4545 localization_target: String,
4547 language_pack_id: String,
4549 strings: Vec<LanguagePackString>,
4551
4552}
4553
4554impl RObject for UpdateLanguagePackStrings {
4555 #[doc(hidden)] fn td_name(&self) -> &'static str { "updateLanguagePackStrings" }
4556 #[doc(hidden)] fn extra(&self) -> Option<String> { self.extra.clone() }
4557 fn to_json(&self) -> RTDResult<String> { Ok(serde_json::to_string(self)?) }
4558}
4559
4560
4561impl TDUpdate for UpdateLanguagePackStrings {}
4562
4563
4564
4565impl UpdateLanguagePackStrings {
4566 pub fn from_json<S: AsRef<str>>(json: S) -> RTDResult<Self> { Ok(serde_json::from_str(json.as_ref())?) }
4567 pub fn builder() -> RTDUpdateLanguagePackStringsBuilder {
4568 let mut inner = UpdateLanguagePackStrings::default();
4569 inner.td_name = "updateLanguagePackStrings".to_string();
4570 inner.extra = Some(Uuid::new_v4().to_string());
4571 RTDUpdateLanguagePackStringsBuilder { inner }
4572 }
4573
4574 pub fn localization_target(&self) -> &String { &self.localization_target }
4575
4576 pub fn language_pack_id(&self) -> &String { &self.language_pack_id }
4577
4578 pub fn strings(&self) -> &Vec<LanguagePackString> { &self.strings }
4579
4580}
4581
4582#[doc(hidden)]
4583pub struct RTDUpdateLanguagePackStringsBuilder {
4584 inner: UpdateLanguagePackStrings
4585}
4586
4587impl RTDUpdateLanguagePackStringsBuilder {
4588 pub fn build(&self) -> UpdateLanguagePackStrings { self.inner.clone() }
4589
4590
4591 pub fn localization_target<T: AsRef<str>>(&mut self, localization_target: T) -> &mut Self {
4592 self.inner.localization_target = localization_target.as_ref().to_string();
4593 self
4594 }
4595
4596
4597 pub fn language_pack_id<T: AsRef<str>>(&mut self, language_pack_id: T) -> &mut Self {
4598 self.inner.language_pack_id = language_pack_id.as_ref().to_string();
4599 self
4600 }
4601
4602
4603 pub fn strings(&mut self, strings: Vec<LanguagePackString>) -> &mut Self {
4604 self.inner.strings = strings;
4605 self
4606 }
4607
4608}
4609
4610impl AsRef<UpdateLanguagePackStrings> for UpdateLanguagePackStrings {
4611 fn as_ref(&self) -> &UpdateLanguagePackStrings { self }
4612}
4613
4614impl AsRef<UpdateLanguagePackStrings> for RTDUpdateLanguagePackStringsBuilder {
4615 fn as_ref(&self) -> &UpdateLanguagePackStrings { &self.inner }
4616}
4617
4618
4619
4620
4621
4622
4623
4624#[derive(Debug, Clone, Default, Serialize, Deserialize)]
4626pub struct UpdateMessageContent {
4627 #[doc(hidden)]
4628 #[serde(rename(serialize = "@type", deserialize = "@type"))]
4629 td_name: String,
4630 #[doc(hidden)]
4631 #[serde(rename(serialize = "@extra", deserialize = "@extra"))]
4632 extra: Option<String>,
4633 chat_id: i64,
4635 message_id: i64,
4637 new_content: MessageContent,
4639
4640}
4641
4642impl RObject for UpdateMessageContent {
4643 #[doc(hidden)] fn td_name(&self) -> &'static str { "updateMessageContent" }
4644 #[doc(hidden)] fn extra(&self) -> Option<String> { self.extra.clone() }
4645 fn to_json(&self) -> RTDResult<String> { Ok(serde_json::to_string(self)?) }
4646}
4647
4648
4649impl TDUpdate for UpdateMessageContent {}
4650
4651
4652
4653impl UpdateMessageContent {
4654 pub fn from_json<S: AsRef<str>>(json: S) -> RTDResult<Self> { Ok(serde_json::from_str(json.as_ref())?) }
4655 pub fn builder() -> RTDUpdateMessageContentBuilder {
4656 let mut inner = UpdateMessageContent::default();
4657 inner.td_name = "updateMessageContent".to_string();
4658 inner.extra = Some(Uuid::new_v4().to_string());
4659 RTDUpdateMessageContentBuilder { inner }
4660 }
4661
4662 pub fn chat_id(&self) -> i64 { self.chat_id }
4663
4664 pub fn message_id(&self) -> i64 { self.message_id }
4665
4666 pub fn new_content(&self) -> &MessageContent { &self.new_content }
4667
4668}
4669
4670#[doc(hidden)]
4671pub struct RTDUpdateMessageContentBuilder {
4672 inner: UpdateMessageContent
4673}
4674
4675impl RTDUpdateMessageContentBuilder {
4676 pub fn build(&self) -> UpdateMessageContent { self.inner.clone() }
4677
4678
4679 pub fn chat_id(&mut self, chat_id: i64) -> &mut Self {
4680 self.inner.chat_id = chat_id;
4681 self
4682 }
4683
4684
4685 pub fn message_id(&mut self, message_id: i64) -> &mut Self {
4686 self.inner.message_id = message_id;
4687 self
4688 }
4689
4690
4691 pub fn new_content<T: AsRef<MessageContent>>(&mut self, new_content: T) -> &mut Self {
4692 self.inner.new_content = new_content.as_ref().clone();
4693 self
4694 }
4695
4696}
4697
4698impl AsRef<UpdateMessageContent> for UpdateMessageContent {
4699 fn as_ref(&self) -> &UpdateMessageContent { self }
4700}
4701
4702impl AsRef<UpdateMessageContent> for RTDUpdateMessageContentBuilder {
4703 fn as_ref(&self) -> &UpdateMessageContent { &self.inner }
4704}
4705
4706
4707
4708
4709
4710
4711
4712#[derive(Debug, Clone, Default, Serialize, Deserialize)]
4714pub struct UpdateMessageContentOpened {
4715 #[doc(hidden)]
4716 #[serde(rename(serialize = "@type", deserialize = "@type"))]
4717 td_name: String,
4718 #[doc(hidden)]
4719 #[serde(rename(serialize = "@extra", deserialize = "@extra"))]
4720 extra: Option<String>,
4721 chat_id: i64,
4723 message_id: i64,
4725
4726}
4727
4728impl RObject for UpdateMessageContentOpened {
4729 #[doc(hidden)] fn td_name(&self) -> &'static str { "updateMessageContentOpened" }
4730 #[doc(hidden)] fn extra(&self) -> Option<String> { self.extra.clone() }
4731 fn to_json(&self) -> RTDResult<String> { Ok(serde_json::to_string(self)?) }
4732}
4733
4734
4735impl TDUpdate for UpdateMessageContentOpened {}
4736
4737
4738
4739impl UpdateMessageContentOpened {
4740 pub fn from_json<S: AsRef<str>>(json: S) -> RTDResult<Self> { Ok(serde_json::from_str(json.as_ref())?) }
4741 pub fn builder() -> RTDUpdateMessageContentOpenedBuilder {
4742 let mut inner = UpdateMessageContentOpened::default();
4743 inner.td_name = "updateMessageContentOpened".to_string();
4744 inner.extra = Some(Uuid::new_v4().to_string());
4745 RTDUpdateMessageContentOpenedBuilder { inner }
4746 }
4747
4748 pub fn chat_id(&self) -> i64 { self.chat_id }
4749
4750 pub fn message_id(&self) -> i64 { self.message_id }
4751
4752}
4753
4754#[doc(hidden)]
4755pub struct RTDUpdateMessageContentOpenedBuilder {
4756 inner: UpdateMessageContentOpened
4757}
4758
4759impl RTDUpdateMessageContentOpenedBuilder {
4760 pub fn build(&self) -> UpdateMessageContentOpened { self.inner.clone() }
4761
4762
4763 pub fn chat_id(&mut self, chat_id: i64) -> &mut Self {
4764 self.inner.chat_id = chat_id;
4765 self
4766 }
4767
4768
4769 pub fn message_id(&mut self, message_id: i64) -> &mut Self {
4770 self.inner.message_id = message_id;
4771 self
4772 }
4773
4774}
4775
4776impl AsRef<UpdateMessageContentOpened> for UpdateMessageContentOpened {
4777 fn as_ref(&self) -> &UpdateMessageContentOpened { self }
4778}
4779
4780impl AsRef<UpdateMessageContentOpened> for RTDUpdateMessageContentOpenedBuilder {
4781 fn as_ref(&self) -> &UpdateMessageContentOpened { &self.inner }
4782}
4783
4784
4785
4786
4787
4788
4789
4790#[derive(Debug, Clone, Default, Serialize, Deserialize)]
4792pub struct UpdateMessageEdited {
4793 #[doc(hidden)]
4794 #[serde(rename(serialize = "@type", deserialize = "@type"))]
4795 td_name: String,
4796 #[doc(hidden)]
4797 #[serde(rename(serialize = "@extra", deserialize = "@extra"))]
4798 extra: Option<String>,
4799 chat_id: i64,
4801 message_id: i64,
4803 edit_date: i64,
4805 reply_markup: Option<ReplyMarkup>,
4807
4808}
4809
4810impl RObject for UpdateMessageEdited {
4811 #[doc(hidden)] fn td_name(&self) -> &'static str { "updateMessageEdited" }
4812 #[doc(hidden)] fn extra(&self) -> Option<String> { self.extra.clone() }
4813 fn to_json(&self) -> RTDResult<String> { Ok(serde_json::to_string(self)?) }
4814}
4815
4816
4817impl TDUpdate for UpdateMessageEdited {}
4818
4819
4820
4821impl UpdateMessageEdited {
4822 pub fn from_json<S: AsRef<str>>(json: S) -> RTDResult<Self> { Ok(serde_json::from_str(json.as_ref())?) }
4823 pub fn builder() -> RTDUpdateMessageEditedBuilder {
4824 let mut inner = UpdateMessageEdited::default();
4825 inner.td_name = "updateMessageEdited".to_string();
4826 inner.extra = Some(Uuid::new_v4().to_string());
4827 RTDUpdateMessageEditedBuilder { inner }
4828 }
4829
4830 pub fn chat_id(&self) -> i64 { self.chat_id }
4831
4832 pub fn message_id(&self) -> i64 { self.message_id }
4833
4834 pub fn edit_date(&self) -> i64 { self.edit_date }
4835
4836 pub fn reply_markup(&self) -> &Option<ReplyMarkup> { &self.reply_markup }
4837
4838}
4839
4840#[doc(hidden)]
4841pub struct RTDUpdateMessageEditedBuilder {
4842 inner: UpdateMessageEdited
4843}
4844
4845impl RTDUpdateMessageEditedBuilder {
4846 pub fn build(&self) -> UpdateMessageEdited { self.inner.clone() }
4847
4848
4849 pub fn chat_id(&mut self, chat_id: i64) -> &mut Self {
4850 self.inner.chat_id = chat_id;
4851 self
4852 }
4853
4854
4855 pub fn message_id(&mut self, message_id: i64) -> &mut Self {
4856 self.inner.message_id = message_id;
4857 self
4858 }
4859
4860
4861 pub fn edit_date(&mut self, edit_date: i64) -> &mut Self {
4862 self.inner.edit_date = edit_date;
4863 self
4864 }
4865
4866
4867 pub fn reply_markup<T: AsRef<ReplyMarkup>>(&mut self, reply_markup: T) -> &mut Self {
4868 self.inner.reply_markup = Some(reply_markup.as_ref().clone());
4869 self
4870 }
4871
4872}
4873
4874impl AsRef<UpdateMessageEdited> for UpdateMessageEdited {
4875 fn as_ref(&self) -> &UpdateMessageEdited { self }
4876}
4877
4878impl AsRef<UpdateMessageEdited> for RTDUpdateMessageEditedBuilder {
4879 fn as_ref(&self) -> &UpdateMessageEdited { &self.inner }
4880}
4881
4882
4883
4884
4885
4886
4887
4888#[derive(Debug, Clone, Default, Serialize, Deserialize)]
4890pub struct UpdateMessageInteractionInfo {
4891 #[doc(hidden)]
4892 #[serde(rename(serialize = "@type", deserialize = "@type"))]
4893 td_name: String,
4894 #[doc(hidden)]
4895 #[serde(rename(serialize = "@extra", deserialize = "@extra"))]
4896 extra: Option<String>,
4897 chat_id: i64,
4899 message_id: i64,
4901 interaction_info: Option<MessageInteractionInfo>,
4903
4904}
4905
4906impl RObject for UpdateMessageInteractionInfo {
4907 #[doc(hidden)] fn td_name(&self) -> &'static str { "updateMessageInteractionInfo" }
4908 #[doc(hidden)] fn extra(&self) -> Option<String> { self.extra.clone() }
4909 fn to_json(&self) -> RTDResult<String> { Ok(serde_json::to_string(self)?) }
4910}
4911
4912
4913impl TDUpdate for UpdateMessageInteractionInfo {}
4914
4915
4916
4917impl UpdateMessageInteractionInfo {
4918 pub fn from_json<S: AsRef<str>>(json: S) -> RTDResult<Self> { Ok(serde_json::from_str(json.as_ref())?) }
4919 pub fn builder() -> RTDUpdateMessageInteractionInfoBuilder {
4920 let mut inner = UpdateMessageInteractionInfo::default();
4921 inner.td_name = "updateMessageInteractionInfo".to_string();
4922 inner.extra = Some(Uuid::new_v4().to_string());
4923 RTDUpdateMessageInteractionInfoBuilder { inner }
4924 }
4925
4926 pub fn chat_id(&self) -> i64 { self.chat_id }
4927
4928 pub fn message_id(&self) -> i64 { self.message_id }
4929
4930 pub fn interaction_info(&self) -> &Option<MessageInteractionInfo> { &self.interaction_info }
4931
4932}
4933
4934#[doc(hidden)]
4935pub struct RTDUpdateMessageInteractionInfoBuilder {
4936 inner: UpdateMessageInteractionInfo
4937}
4938
4939impl RTDUpdateMessageInteractionInfoBuilder {
4940 pub fn build(&self) -> UpdateMessageInteractionInfo { self.inner.clone() }
4941
4942
4943 pub fn chat_id(&mut self, chat_id: i64) -> &mut Self {
4944 self.inner.chat_id = chat_id;
4945 self
4946 }
4947
4948
4949 pub fn message_id(&mut self, message_id: i64) -> &mut Self {
4950 self.inner.message_id = message_id;
4951 self
4952 }
4953
4954
4955 pub fn interaction_info<T: AsRef<MessageInteractionInfo>>(&mut self, interaction_info: T) -> &mut Self {
4956 self.inner.interaction_info = Some(interaction_info.as_ref().clone());
4957 self
4958 }
4959
4960}
4961
4962impl AsRef<UpdateMessageInteractionInfo> for UpdateMessageInteractionInfo {
4963 fn as_ref(&self) -> &UpdateMessageInteractionInfo { self }
4964}
4965
4966impl AsRef<UpdateMessageInteractionInfo> for RTDUpdateMessageInteractionInfoBuilder {
4967 fn as_ref(&self) -> &UpdateMessageInteractionInfo { &self.inner }
4968}
4969
4970
4971
4972
4973
4974
4975
4976#[derive(Debug, Clone, Default, Serialize, Deserialize)]
4978pub struct UpdateMessageIsPinned {
4979 #[doc(hidden)]
4980 #[serde(rename(serialize = "@type", deserialize = "@type"))]
4981 td_name: String,
4982 #[doc(hidden)]
4983 #[serde(rename(serialize = "@extra", deserialize = "@extra"))]
4984 extra: Option<String>,
4985 chat_id: i64,
4987 message_id: i64,
4989 is_pinned: bool,
4991
4992}
4993
4994impl RObject for UpdateMessageIsPinned {
4995 #[doc(hidden)] fn td_name(&self) -> &'static str { "updateMessageIsPinned" }
4996 #[doc(hidden)] fn extra(&self) -> Option<String> { self.extra.clone() }
4997 fn to_json(&self) -> RTDResult<String> { Ok(serde_json::to_string(self)?) }
4998}
4999
5000
5001impl TDUpdate for UpdateMessageIsPinned {}
5002
5003
5004
5005impl UpdateMessageIsPinned {
5006 pub fn from_json<S: AsRef<str>>(json: S) -> RTDResult<Self> { Ok(serde_json::from_str(json.as_ref())?) }
5007 pub fn builder() -> RTDUpdateMessageIsPinnedBuilder {
5008 let mut inner = UpdateMessageIsPinned::default();
5009 inner.td_name = "updateMessageIsPinned".to_string();
5010 inner.extra = Some(Uuid::new_v4().to_string());
5011 RTDUpdateMessageIsPinnedBuilder { inner }
5012 }
5013
5014 pub fn chat_id(&self) -> i64 { self.chat_id }
5015
5016 pub fn message_id(&self) -> i64 { self.message_id }
5017
5018 pub fn is_pinned(&self) -> bool { self.is_pinned }
5019
5020}
5021
5022#[doc(hidden)]
5023pub struct RTDUpdateMessageIsPinnedBuilder {
5024 inner: UpdateMessageIsPinned
5025}
5026
5027impl RTDUpdateMessageIsPinnedBuilder {
5028 pub fn build(&self) -> UpdateMessageIsPinned { self.inner.clone() }
5029
5030
5031 pub fn chat_id(&mut self, chat_id: i64) -> &mut Self {
5032 self.inner.chat_id = chat_id;
5033 self
5034 }
5035
5036
5037 pub fn message_id(&mut self, message_id: i64) -> &mut Self {
5038 self.inner.message_id = message_id;
5039 self
5040 }
5041
5042
5043 pub fn is_pinned(&mut self, is_pinned: bool) -> &mut Self {
5044 self.inner.is_pinned = is_pinned;
5045 self
5046 }
5047
5048}
5049
5050impl AsRef<UpdateMessageIsPinned> for UpdateMessageIsPinned {
5051 fn as_ref(&self) -> &UpdateMessageIsPinned { self }
5052}
5053
5054impl AsRef<UpdateMessageIsPinned> for RTDUpdateMessageIsPinnedBuilder {
5055 fn as_ref(&self) -> &UpdateMessageIsPinned { &self.inner }
5056}
5057
5058
5059
5060
5061
5062
5063
5064#[derive(Debug, Clone, Default, Serialize, Deserialize)]
5066pub struct UpdateMessageLiveLocationViewed {
5067 #[doc(hidden)]
5068 #[serde(rename(serialize = "@type", deserialize = "@type"))]
5069 td_name: String,
5070 #[doc(hidden)]
5071 #[serde(rename(serialize = "@extra", deserialize = "@extra"))]
5072 extra: Option<String>,
5073 chat_id: i64,
5075 message_id: i64,
5077
5078}
5079
5080impl RObject for UpdateMessageLiveLocationViewed {
5081 #[doc(hidden)] fn td_name(&self) -> &'static str { "updateMessageLiveLocationViewed" }
5082 #[doc(hidden)] fn extra(&self) -> Option<String> { self.extra.clone() }
5083 fn to_json(&self) -> RTDResult<String> { Ok(serde_json::to_string(self)?) }
5084}
5085
5086
5087impl TDUpdate for UpdateMessageLiveLocationViewed {}
5088
5089
5090
5091impl UpdateMessageLiveLocationViewed {
5092 pub fn from_json<S: AsRef<str>>(json: S) -> RTDResult<Self> { Ok(serde_json::from_str(json.as_ref())?) }
5093 pub fn builder() -> RTDUpdateMessageLiveLocationViewedBuilder {
5094 let mut inner = UpdateMessageLiveLocationViewed::default();
5095 inner.td_name = "updateMessageLiveLocationViewed".to_string();
5096 inner.extra = Some(Uuid::new_v4().to_string());
5097 RTDUpdateMessageLiveLocationViewedBuilder { inner }
5098 }
5099
5100 pub fn chat_id(&self) -> i64 { self.chat_id }
5101
5102 pub fn message_id(&self) -> i64 { self.message_id }
5103
5104}
5105
5106#[doc(hidden)]
5107pub struct RTDUpdateMessageLiveLocationViewedBuilder {
5108 inner: UpdateMessageLiveLocationViewed
5109}
5110
5111impl RTDUpdateMessageLiveLocationViewedBuilder {
5112 pub fn build(&self) -> UpdateMessageLiveLocationViewed { self.inner.clone() }
5113
5114
5115 pub fn chat_id(&mut self, chat_id: i64) -> &mut Self {
5116 self.inner.chat_id = chat_id;
5117 self
5118 }
5119
5120
5121 pub fn message_id(&mut self, message_id: i64) -> &mut Self {
5122 self.inner.message_id = message_id;
5123 self
5124 }
5125
5126}
5127
5128impl AsRef<UpdateMessageLiveLocationViewed> for UpdateMessageLiveLocationViewed {
5129 fn as_ref(&self) -> &UpdateMessageLiveLocationViewed { self }
5130}
5131
5132impl AsRef<UpdateMessageLiveLocationViewed> for RTDUpdateMessageLiveLocationViewedBuilder {
5133 fn as_ref(&self) -> &UpdateMessageLiveLocationViewed { &self.inner }
5134}
5135
5136
5137
5138
5139
5140
5141
5142#[derive(Debug, Clone, Default, Serialize, Deserialize)]
5144pub struct UpdateMessageMentionRead {
5145 #[doc(hidden)]
5146 #[serde(rename(serialize = "@type", deserialize = "@type"))]
5147 td_name: String,
5148 #[doc(hidden)]
5149 #[serde(rename(serialize = "@extra", deserialize = "@extra"))]
5150 extra: Option<String>,
5151 chat_id: i64,
5153 message_id: i64,
5155 unread_mention_count: i64,
5157
5158}
5159
5160impl RObject for UpdateMessageMentionRead {
5161 #[doc(hidden)] fn td_name(&self) -> &'static str { "updateMessageMentionRead" }
5162 #[doc(hidden)] fn extra(&self) -> Option<String> { self.extra.clone() }
5163 fn to_json(&self) -> RTDResult<String> { Ok(serde_json::to_string(self)?) }
5164}
5165
5166
5167impl TDUpdate for UpdateMessageMentionRead {}
5168
5169
5170
5171impl UpdateMessageMentionRead {
5172 pub fn from_json<S: AsRef<str>>(json: S) -> RTDResult<Self> { Ok(serde_json::from_str(json.as_ref())?) }
5173 pub fn builder() -> RTDUpdateMessageMentionReadBuilder {
5174 let mut inner = UpdateMessageMentionRead::default();
5175 inner.td_name = "updateMessageMentionRead".to_string();
5176 inner.extra = Some(Uuid::new_v4().to_string());
5177 RTDUpdateMessageMentionReadBuilder { inner }
5178 }
5179
5180 pub fn chat_id(&self) -> i64 { self.chat_id }
5181
5182 pub fn message_id(&self) -> i64 { self.message_id }
5183
5184 pub fn unread_mention_count(&self) -> i64 { self.unread_mention_count }
5185
5186}
5187
5188#[doc(hidden)]
5189pub struct RTDUpdateMessageMentionReadBuilder {
5190 inner: UpdateMessageMentionRead
5191}
5192
5193impl RTDUpdateMessageMentionReadBuilder {
5194 pub fn build(&self) -> UpdateMessageMentionRead { self.inner.clone() }
5195
5196
5197 pub fn chat_id(&mut self, chat_id: i64) -> &mut Self {
5198 self.inner.chat_id = chat_id;
5199 self
5200 }
5201
5202
5203 pub fn message_id(&mut self, message_id: i64) -> &mut Self {
5204 self.inner.message_id = message_id;
5205 self
5206 }
5207
5208
5209 pub fn unread_mention_count(&mut self, unread_mention_count: i64) -> &mut Self {
5210 self.inner.unread_mention_count = unread_mention_count;
5211 self
5212 }
5213
5214}
5215
5216impl AsRef<UpdateMessageMentionRead> for UpdateMessageMentionRead {
5217 fn as_ref(&self) -> &UpdateMessageMentionRead { self }
5218}
5219
5220impl AsRef<UpdateMessageMentionRead> for RTDUpdateMessageMentionReadBuilder {
5221 fn as_ref(&self) -> &UpdateMessageMentionRead { &self.inner }
5222}
5223
5224
5225
5226
5227
5228
5229
5230#[derive(Debug, Clone, Default, Serialize, Deserialize)]
5232pub struct UpdateMessageSendAcknowledged {
5233 #[doc(hidden)]
5234 #[serde(rename(serialize = "@type", deserialize = "@type"))]
5235 td_name: String,
5236 #[doc(hidden)]
5237 #[serde(rename(serialize = "@extra", deserialize = "@extra"))]
5238 extra: Option<String>,
5239 chat_id: i64,
5241 message_id: i64,
5243
5244}
5245
5246impl RObject for UpdateMessageSendAcknowledged {
5247 #[doc(hidden)] fn td_name(&self) -> &'static str { "updateMessageSendAcknowledged" }
5248 #[doc(hidden)] fn extra(&self) -> Option<String> { self.extra.clone() }
5249 fn to_json(&self) -> RTDResult<String> { Ok(serde_json::to_string(self)?) }
5250}
5251
5252
5253impl TDUpdate for UpdateMessageSendAcknowledged {}
5254
5255
5256
5257impl UpdateMessageSendAcknowledged {
5258 pub fn from_json<S: AsRef<str>>(json: S) -> RTDResult<Self> { Ok(serde_json::from_str(json.as_ref())?) }
5259 pub fn builder() -> RTDUpdateMessageSendAcknowledgedBuilder {
5260 let mut inner = UpdateMessageSendAcknowledged::default();
5261 inner.td_name = "updateMessageSendAcknowledged".to_string();
5262 inner.extra = Some(Uuid::new_v4().to_string());
5263 RTDUpdateMessageSendAcknowledgedBuilder { inner }
5264 }
5265
5266 pub fn chat_id(&self) -> i64 { self.chat_id }
5267
5268 pub fn message_id(&self) -> i64 { self.message_id }
5269
5270}
5271
5272#[doc(hidden)]
5273pub struct RTDUpdateMessageSendAcknowledgedBuilder {
5274 inner: UpdateMessageSendAcknowledged
5275}
5276
5277impl RTDUpdateMessageSendAcknowledgedBuilder {
5278 pub fn build(&self) -> UpdateMessageSendAcknowledged { self.inner.clone() }
5279
5280
5281 pub fn chat_id(&mut self, chat_id: i64) -> &mut Self {
5282 self.inner.chat_id = chat_id;
5283 self
5284 }
5285
5286
5287 pub fn message_id(&mut self, message_id: i64) -> &mut Self {
5288 self.inner.message_id = message_id;
5289 self
5290 }
5291
5292}
5293
5294impl AsRef<UpdateMessageSendAcknowledged> for UpdateMessageSendAcknowledged {
5295 fn as_ref(&self) -> &UpdateMessageSendAcknowledged { self }
5296}
5297
5298impl AsRef<UpdateMessageSendAcknowledged> for RTDUpdateMessageSendAcknowledgedBuilder {
5299 fn as_ref(&self) -> &UpdateMessageSendAcknowledged { &self.inner }
5300}
5301
5302
5303
5304
5305
5306
5307
5308#[derive(Debug, Clone, Default, Serialize, Deserialize)]
5310pub struct UpdateMessageSendFailed {
5311 #[doc(hidden)]
5312 #[serde(rename(serialize = "@type", deserialize = "@type"))]
5313 td_name: String,
5314 #[doc(hidden)]
5315 #[serde(rename(serialize = "@extra", deserialize = "@extra"))]
5316 extra: Option<String>,
5317 message: Message,
5319 old_message_id: i64,
5321 error_code: i64,
5323 error_message: String,
5325
5326}
5327
5328impl RObject for UpdateMessageSendFailed {
5329 #[doc(hidden)] fn td_name(&self) -> &'static str { "updateMessageSendFailed" }
5330 #[doc(hidden)] fn extra(&self) -> Option<String> { self.extra.clone() }
5331 fn to_json(&self) -> RTDResult<String> { Ok(serde_json::to_string(self)?) }
5332}
5333
5334
5335impl TDUpdate for UpdateMessageSendFailed {}
5336
5337
5338
5339impl UpdateMessageSendFailed {
5340 pub fn from_json<S: AsRef<str>>(json: S) -> RTDResult<Self> { Ok(serde_json::from_str(json.as_ref())?) }
5341 pub fn builder() -> RTDUpdateMessageSendFailedBuilder {
5342 let mut inner = UpdateMessageSendFailed::default();
5343 inner.td_name = "updateMessageSendFailed".to_string();
5344 inner.extra = Some(Uuid::new_v4().to_string());
5345 RTDUpdateMessageSendFailedBuilder { inner }
5346 }
5347
5348 pub fn message(&self) -> &Message { &self.message }
5349
5350 pub fn old_message_id(&self) -> i64 { self.old_message_id }
5351
5352 pub fn error_code(&self) -> i64 { self.error_code }
5353
5354 pub fn error_message(&self) -> &String { &self.error_message }
5355
5356}
5357
5358#[doc(hidden)]
5359pub struct RTDUpdateMessageSendFailedBuilder {
5360 inner: UpdateMessageSendFailed
5361}
5362
5363impl RTDUpdateMessageSendFailedBuilder {
5364 pub fn build(&self) -> UpdateMessageSendFailed { self.inner.clone() }
5365
5366
5367 pub fn message<T: AsRef<Message>>(&mut self, message: T) -> &mut Self {
5368 self.inner.message = message.as_ref().clone();
5369 self
5370 }
5371
5372
5373 pub fn old_message_id(&mut self, old_message_id: i64) -> &mut Self {
5374 self.inner.old_message_id = old_message_id;
5375 self
5376 }
5377
5378
5379 pub fn error_code(&mut self, error_code: i64) -> &mut Self {
5380 self.inner.error_code = error_code;
5381 self
5382 }
5383
5384
5385 pub fn error_message<T: AsRef<str>>(&mut self, error_message: T) -> &mut Self {
5386 self.inner.error_message = error_message.as_ref().to_string();
5387 self
5388 }
5389
5390}
5391
5392impl AsRef<UpdateMessageSendFailed> for UpdateMessageSendFailed {
5393 fn as_ref(&self) -> &UpdateMessageSendFailed { self }
5394}
5395
5396impl AsRef<UpdateMessageSendFailed> for RTDUpdateMessageSendFailedBuilder {
5397 fn as_ref(&self) -> &UpdateMessageSendFailed { &self.inner }
5398}
5399
5400
5401
5402
5403
5404
5405
5406#[derive(Debug, Clone, Default, Serialize, Deserialize)]
5408pub struct UpdateMessageSendSucceeded {
5409 #[doc(hidden)]
5410 #[serde(rename(serialize = "@type", deserialize = "@type"))]
5411 td_name: String,
5412 #[doc(hidden)]
5413 #[serde(rename(serialize = "@extra", deserialize = "@extra"))]
5414 extra: Option<String>,
5415 message: Message,
5417 old_message_id: i64,
5419
5420}
5421
5422impl RObject for UpdateMessageSendSucceeded {
5423 #[doc(hidden)] fn td_name(&self) -> &'static str { "updateMessageSendSucceeded" }
5424 #[doc(hidden)] fn extra(&self) -> Option<String> { self.extra.clone() }
5425 fn to_json(&self) -> RTDResult<String> { Ok(serde_json::to_string(self)?) }
5426}
5427
5428
5429impl TDUpdate for UpdateMessageSendSucceeded {}
5430
5431
5432
5433impl UpdateMessageSendSucceeded {
5434 pub fn from_json<S: AsRef<str>>(json: S) -> RTDResult<Self> { Ok(serde_json::from_str(json.as_ref())?) }
5435 pub fn builder() -> RTDUpdateMessageSendSucceededBuilder {
5436 let mut inner = UpdateMessageSendSucceeded::default();
5437 inner.td_name = "updateMessageSendSucceeded".to_string();
5438 inner.extra = Some(Uuid::new_v4().to_string());
5439 RTDUpdateMessageSendSucceededBuilder { inner }
5440 }
5441
5442 pub fn message(&self) -> &Message { &self.message }
5443
5444 pub fn old_message_id(&self) -> i64 { self.old_message_id }
5445
5446}
5447
5448#[doc(hidden)]
5449pub struct RTDUpdateMessageSendSucceededBuilder {
5450 inner: UpdateMessageSendSucceeded
5451}
5452
5453impl RTDUpdateMessageSendSucceededBuilder {
5454 pub fn build(&self) -> UpdateMessageSendSucceeded { self.inner.clone() }
5455
5456
5457 pub fn message<T: AsRef<Message>>(&mut self, message: T) -> &mut Self {
5458 self.inner.message = message.as_ref().clone();
5459 self
5460 }
5461
5462
5463 pub fn old_message_id(&mut self, old_message_id: i64) -> &mut Self {
5464 self.inner.old_message_id = old_message_id;
5465 self
5466 }
5467
5468}
5469
5470impl AsRef<UpdateMessageSendSucceeded> for UpdateMessageSendSucceeded {
5471 fn as_ref(&self) -> &UpdateMessageSendSucceeded { self }
5472}
5473
5474impl AsRef<UpdateMessageSendSucceeded> for RTDUpdateMessageSendSucceededBuilder {
5475 fn as_ref(&self) -> &UpdateMessageSendSucceeded { &self.inner }
5476}
5477
5478
5479
5480
5481
5482
5483
5484#[derive(Debug, Clone, Default, Serialize, Deserialize)]
5486pub struct UpdateNewCallSignalingData {
5487 #[doc(hidden)]
5488 #[serde(rename(serialize = "@type", deserialize = "@type"))]
5489 td_name: String,
5490 #[doc(hidden)]
5491 #[serde(rename(serialize = "@extra", deserialize = "@extra"))]
5492 extra: Option<String>,
5493 call_id: i64,
5495 data: String,
5497
5498}
5499
5500impl RObject for UpdateNewCallSignalingData {
5501 #[doc(hidden)] fn td_name(&self) -> &'static str { "updateNewCallSignalingData" }
5502 #[doc(hidden)] fn extra(&self) -> Option<String> { self.extra.clone() }
5503 fn to_json(&self) -> RTDResult<String> { Ok(serde_json::to_string(self)?) }
5504}
5505
5506
5507impl TDUpdate for UpdateNewCallSignalingData {}
5508
5509
5510
5511impl UpdateNewCallSignalingData {
5512 pub fn from_json<S: AsRef<str>>(json: S) -> RTDResult<Self> { Ok(serde_json::from_str(json.as_ref())?) }
5513 pub fn builder() -> RTDUpdateNewCallSignalingDataBuilder {
5514 let mut inner = UpdateNewCallSignalingData::default();
5515 inner.td_name = "updateNewCallSignalingData".to_string();
5516 inner.extra = Some(Uuid::new_v4().to_string());
5517 RTDUpdateNewCallSignalingDataBuilder { inner }
5518 }
5519
5520 pub fn call_id(&self) -> i64 { self.call_id }
5521
5522 pub fn data(&self) -> &String { &self.data }
5523
5524}
5525
5526#[doc(hidden)]
5527pub struct RTDUpdateNewCallSignalingDataBuilder {
5528 inner: UpdateNewCallSignalingData
5529}
5530
5531impl RTDUpdateNewCallSignalingDataBuilder {
5532 pub fn build(&self) -> UpdateNewCallSignalingData { self.inner.clone() }
5533
5534
5535 pub fn call_id(&mut self, call_id: i64) -> &mut Self {
5536 self.inner.call_id = call_id;
5537 self
5538 }
5539
5540
5541 pub fn data<T: AsRef<str>>(&mut self, data: T) -> &mut Self {
5542 self.inner.data = data.as_ref().to_string();
5543 self
5544 }
5545
5546}
5547
5548impl AsRef<UpdateNewCallSignalingData> for UpdateNewCallSignalingData {
5549 fn as_ref(&self) -> &UpdateNewCallSignalingData { self }
5550}
5551
5552impl AsRef<UpdateNewCallSignalingData> for RTDUpdateNewCallSignalingDataBuilder {
5553 fn as_ref(&self) -> &UpdateNewCallSignalingData { &self.inner }
5554}
5555
5556
5557
5558
5559
5560
5561
5562#[derive(Debug, Clone, Default, Serialize, Deserialize)]
5564pub struct UpdateNewCallbackQuery {
5565 #[doc(hidden)]
5566 #[serde(rename(serialize = "@type", deserialize = "@type"))]
5567 td_name: String,
5568 #[doc(hidden)]
5569 #[serde(rename(serialize = "@extra", deserialize = "@extra"))]
5570 extra: Option<String>,
5571 id: isize,
5573 sender_user_id: i64,
5575 chat_id: i64,
5577 message_id: i64,
5579 chat_instance: isize,
5581 payload: CallbackQueryPayload,
5583
5584}
5585
5586impl RObject for UpdateNewCallbackQuery {
5587 #[doc(hidden)] fn td_name(&self) -> &'static str { "updateNewCallbackQuery" }
5588 #[doc(hidden)] fn extra(&self) -> Option<String> { self.extra.clone() }
5589 fn to_json(&self) -> RTDResult<String> { Ok(serde_json::to_string(self)?) }
5590}
5591
5592
5593impl TDUpdate for UpdateNewCallbackQuery {}
5594
5595
5596
5597impl UpdateNewCallbackQuery {
5598 pub fn from_json<S: AsRef<str>>(json: S) -> RTDResult<Self> { Ok(serde_json::from_str(json.as_ref())?) }
5599 pub fn builder() -> RTDUpdateNewCallbackQueryBuilder {
5600 let mut inner = UpdateNewCallbackQuery::default();
5601 inner.td_name = "updateNewCallbackQuery".to_string();
5602 inner.extra = Some(Uuid::new_v4().to_string());
5603 RTDUpdateNewCallbackQueryBuilder { inner }
5604 }
5605
5606 pub fn id(&self) -> isize { self.id }
5607
5608 pub fn sender_user_id(&self) -> i64 { self.sender_user_id }
5609
5610 pub fn chat_id(&self) -> i64 { self.chat_id }
5611
5612 pub fn message_id(&self) -> i64 { self.message_id }
5613
5614 pub fn chat_instance(&self) -> isize { self.chat_instance }
5615
5616 pub fn payload(&self) -> &CallbackQueryPayload { &self.payload }
5617
5618}
5619
5620#[doc(hidden)]
5621pub struct RTDUpdateNewCallbackQueryBuilder {
5622 inner: UpdateNewCallbackQuery
5623}
5624
5625impl RTDUpdateNewCallbackQueryBuilder {
5626 pub fn build(&self) -> UpdateNewCallbackQuery { self.inner.clone() }
5627
5628
5629 pub fn id(&mut self, id: isize) -> &mut Self {
5630 self.inner.id = id;
5631 self
5632 }
5633
5634
5635 pub fn sender_user_id(&mut self, sender_user_id: i64) -> &mut Self {
5636 self.inner.sender_user_id = sender_user_id;
5637 self
5638 }
5639
5640
5641 pub fn chat_id(&mut self, chat_id: i64) -> &mut Self {
5642 self.inner.chat_id = chat_id;
5643 self
5644 }
5645
5646
5647 pub fn message_id(&mut self, message_id: i64) -> &mut Self {
5648 self.inner.message_id = message_id;
5649 self
5650 }
5651
5652
5653 pub fn chat_instance(&mut self, chat_instance: isize) -> &mut Self {
5654 self.inner.chat_instance = chat_instance;
5655 self
5656 }
5657
5658
5659 pub fn payload<T: AsRef<CallbackQueryPayload>>(&mut self, payload: T) -> &mut Self {
5660 self.inner.payload = payload.as_ref().clone();
5661 self
5662 }
5663
5664}
5665
5666impl AsRef<UpdateNewCallbackQuery> for UpdateNewCallbackQuery {
5667 fn as_ref(&self) -> &UpdateNewCallbackQuery { self }
5668}
5669
5670impl AsRef<UpdateNewCallbackQuery> for RTDUpdateNewCallbackQueryBuilder {
5671 fn as_ref(&self) -> &UpdateNewCallbackQuery { &self.inner }
5672}
5673
5674
5675
5676
5677
5678
5679
5680#[derive(Debug, Clone, Default, Serialize, Deserialize)]
5682pub struct UpdateNewChat {
5683 #[doc(hidden)]
5684 #[serde(rename(serialize = "@type", deserialize = "@type"))]
5685 td_name: String,
5686 #[doc(hidden)]
5687 #[serde(rename(serialize = "@extra", deserialize = "@extra"))]
5688 extra: Option<String>,
5689 chat: Chat,
5691
5692}
5693
5694impl RObject for UpdateNewChat {
5695 #[doc(hidden)] fn td_name(&self) -> &'static str { "updateNewChat" }
5696 #[doc(hidden)] fn extra(&self) -> Option<String> { self.extra.clone() }
5697 fn to_json(&self) -> RTDResult<String> { Ok(serde_json::to_string(self)?) }
5698}
5699
5700
5701impl TDUpdate for UpdateNewChat {}
5702
5703
5704
5705impl UpdateNewChat {
5706 pub fn from_json<S: AsRef<str>>(json: S) -> RTDResult<Self> { Ok(serde_json::from_str(json.as_ref())?) }
5707 pub fn builder() -> RTDUpdateNewChatBuilder {
5708 let mut inner = UpdateNewChat::default();
5709 inner.td_name = "updateNewChat".to_string();
5710 inner.extra = Some(Uuid::new_v4().to_string());
5711 RTDUpdateNewChatBuilder { inner }
5712 }
5713
5714 pub fn chat(&self) -> &Chat { &self.chat }
5715
5716}
5717
5718#[doc(hidden)]
5719pub struct RTDUpdateNewChatBuilder {
5720 inner: UpdateNewChat
5721}
5722
5723impl RTDUpdateNewChatBuilder {
5724 pub fn build(&self) -> UpdateNewChat { self.inner.clone() }
5725
5726
5727 pub fn chat<T: AsRef<Chat>>(&mut self, chat: T) -> &mut Self {
5728 self.inner.chat = chat.as_ref().clone();
5729 self
5730 }
5731
5732}
5733
5734impl AsRef<UpdateNewChat> for UpdateNewChat {
5735 fn as_ref(&self) -> &UpdateNewChat { self }
5736}
5737
5738impl AsRef<UpdateNewChat> for RTDUpdateNewChatBuilder {
5739 fn as_ref(&self) -> &UpdateNewChat { &self.inner }
5740}
5741
5742
5743
5744
5745
5746
5747
5748#[derive(Debug, Clone, Default, Serialize, Deserialize)]
5750pub struct UpdateNewChatJoinRequest {
5751 #[doc(hidden)]
5752 #[serde(rename(serialize = "@type", deserialize = "@type"))]
5753 td_name: String,
5754 #[doc(hidden)]
5755 #[serde(rename(serialize = "@extra", deserialize = "@extra"))]
5756 extra: Option<String>,
5757 chat_id: i64,
5759 request: ChatJoinRequest,
5761 invite_link: Option<ChatInviteLink>,
5763
5764}
5765
5766impl RObject for UpdateNewChatJoinRequest {
5767 #[doc(hidden)] fn td_name(&self) -> &'static str { "updateNewChatJoinRequest" }
5768 #[doc(hidden)] fn extra(&self) -> Option<String> { self.extra.clone() }
5769 fn to_json(&self) -> RTDResult<String> { Ok(serde_json::to_string(self)?) }
5770}
5771
5772
5773impl TDUpdate for UpdateNewChatJoinRequest {}
5774
5775
5776
5777impl UpdateNewChatJoinRequest {
5778 pub fn from_json<S: AsRef<str>>(json: S) -> RTDResult<Self> { Ok(serde_json::from_str(json.as_ref())?) }
5779 pub fn builder() -> RTDUpdateNewChatJoinRequestBuilder {
5780 let mut inner = UpdateNewChatJoinRequest::default();
5781 inner.td_name = "updateNewChatJoinRequest".to_string();
5782 inner.extra = Some(Uuid::new_v4().to_string());
5783 RTDUpdateNewChatJoinRequestBuilder { inner }
5784 }
5785
5786 pub fn chat_id(&self) -> i64 { self.chat_id }
5787
5788 pub fn request(&self) -> &ChatJoinRequest { &self.request }
5789
5790 pub fn invite_link(&self) -> &Option<ChatInviteLink> { &self.invite_link }
5791
5792}
5793
5794#[doc(hidden)]
5795pub struct RTDUpdateNewChatJoinRequestBuilder {
5796 inner: UpdateNewChatJoinRequest
5797}
5798
5799impl RTDUpdateNewChatJoinRequestBuilder {
5800 pub fn build(&self) -> UpdateNewChatJoinRequest { self.inner.clone() }
5801
5802
5803 pub fn chat_id(&mut self, chat_id: i64) -> &mut Self {
5804 self.inner.chat_id = chat_id;
5805 self
5806 }
5807
5808
5809 pub fn request<T: AsRef<ChatJoinRequest>>(&mut self, request: T) -> &mut Self {
5810 self.inner.request = request.as_ref().clone();
5811 self
5812 }
5813
5814
5815 pub fn invite_link<T: AsRef<ChatInviteLink>>(&mut self, invite_link: T) -> &mut Self {
5816 self.inner.invite_link = Some(invite_link.as_ref().clone());
5817 self
5818 }
5819
5820}
5821
5822impl AsRef<UpdateNewChatJoinRequest> for UpdateNewChatJoinRequest {
5823 fn as_ref(&self) -> &UpdateNewChatJoinRequest { self }
5824}
5825
5826impl AsRef<UpdateNewChatJoinRequest> for RTDUpdateNewChatJoinRequestBuilder {
5827 fn as_ref(&self) -> &UpdateNewChatJoinRequest { &self.inner }
5828}
5829
5830
5831
5832
5833
5834
5835
5836#[derive(Debug, Clone, Default, Serialize, Deserialize)]
5838pub struct UpdateNewChosenInlineResult {
5839 #[doc(hidden)]
5840 #[serde(rename(serialize = "@type", deserialize = "@type"))]
5841 td_name: String,
5842 #[doc(hidden)]
5843 #[serde(rename(serialize = "@extra", deserialize = "@extra"))]
5844 extra: Option<String>,
5845 sender_user_id: i64,
5847 user_location: Option<Location>,
5849 query: String,
5851 result_id: String,
5853 inline_message_id: String,
5855
5856}
5857
5858impl RObject for UpdateNewChosenInlineResult {
5859 #[doc(hidden)] fn td_name(&self) -> &'static str { "updateNewChosenInlineResult" }
5860 #[doc(hidden)] fn extra(&self) -> Option<String> { self.extra.clone() }
5861 fn to_json(&self) -> RTDResult<String> { Ok(serde_json::to_string(self)?) }
5862}
5863
5864
5865impl TDUpdate for UpdateNewChosenInlineResult {}
5866
5867
5868
5869impl UpdateNewChosenInlineResult {
5870 pub fn from_json<S: AsRef<str>>(json: S) -> RTDResult<Self> { Ok(serde_json::from_str(json.as_ref())?) }
5871 pub fn builder() -> RTDUpdateNewChosenInlineResultBuilder {
5872 let mut inner = UpdateNewChosenInlineResult::default();
5873 inner.td_name = "updateNewChosenInlineResult".to_string();
5874 inner.extra = Some(Uuid::new_v4().to_string());
5875 RTDUpdateNewChosenInlineResultBuilder { inner }
5876 }
5877
5878 pub fn sender_user_id(&self) -> i64 { self.sender_user_id }
5879
5880 pub fn user_location(&self) -> &Option<Location> { &self.user_location }
5881
5882 pub fn query(&self) -> &String { &self.query }
5883
5884 pub fn result_id(&self) -> &String { &self.result_id }
5885
5886 pub fn inline_message_id(&self) -> &String { &self.inline_message_id }
5887
5888}
5889
5890#[doc(hidden)]
5891pub struct RTDUpdateNewChosenInlineResultBuilder {
5892 inner: UpdateNewChosenInlineResult
5893}
5894
5895impl RTDUpdateNewChosenInlineResultBuilder {
5896 pub fn build(&self) -> UpdateNewChosenInlineResult { self.inner.clone() }
5897
5898
5899 pub fn sender_user_id(&mut self, sender_user_id: i64) -> &mut Self {
5900 self.inner.sender_user_id = sender_user_id;
5901 self
5902 }
5903
5904
5905 pub fn user_location<T: AsRef<Location>>(&mut self, user_location: T) -> &mut Self {
5906 self.inner.user_location = Some(user_location.as_ref().clone());
5907 self
5908 }
5909
5910
5911 pub fn query<T: AsRef<str>>(&mut self, query: T) -> &mut Self {
5912 self.inner.query = query.as_ref().to_string();
5913 self
5914 }
5915
5916
5917 pub fn result_id<T: AsRef<str>>(&mut self, result_id: T) -> &mut Self {
5918 self.inner.result_id = result_id.as_ref().to_string();
5919 self
5920 }
5921
5922
5923 pub fn inline_message_id<T: AsRef<str>>(&mut self, inline_message_id: T) -> &mut Self {
5924 self.inner.inline_message_id = inline_message_id.as_ref().to_string();
5925 self
5926 }
5927
5928}
5929
5930impl AsRef<UpdateNewChosenInlineResult> for UpdateNewChosenInlineResult {
5931 fn as_ref(&self) -> &UpdateNewChosenInlineResult { self }
5932}
5933
5934impl AsRef<UpdateNewChosenInlineResult> for RTDUpdateNewChosenInlineResultBuilder {
5935 fn as_ref(&self) -> &UpdateNewChosenInlineResult { &self.inner }
5936}
5937
5938
5939
5940
5941
5942
5943
5944#[derive(Debug, Clone, Default, Serialize, Deserialize)]
5946pub struct UpdateNewCustomEvent {
5947 #[doc(hidden)]
5948 #[serde(rename(serialize = "@type", deserialize = "@type"))]
5949 td_name: String,
5950 #[doc(hidden)]
5951 #[serde(rename(serialize = "@extra", deserialize = "@extra"))]
5952 extra: Option<String>,
5953 event: String,
5955
5956}
5957
5958impl RObject for UpdateNewCustomEvent {
5959 #[doc(hidden)] fn td_name(&self) -> &'static str { "updateNewCustomEvent" }
5960 #[doc(hidden)] fn extra(&self) -> Option<String> { self.extra.clone() }
5961 fn to_json(&self) -> RTDResult<String> { Ok(serde_json::to_string(self)?) }
5962}
5963
5964
5965impl TDUpdate for UpdateNewCustomEvent {}
5966
5967
5968
5969impl UpdateNewCustomEvent {
5970 pub fn from_json<S: AsRef<str>>(json: S) -> RTDResult<Self> { Ok(serde_json::from_str(json.as_ref())?) }
5971 pub fn builder() -> RTDUpdateNewCustomEventBuilder {
5972 let mut inner = UpdateNewCustomEvent::default();
5973 inner.td_name = "updateNewCustomEvent".to_string();
5974 inner.extra = Some(Uuid::new_v4().to_string());
5975 RTDUpdateNewCustomEventBuilder { inner }
5976 }
5977
5978 pub fn event(&self) -> &String { &self.event }
5979
5980}
5981
5982#[doc(hidden)]
5983pub struct RTDUpdateNewCustomEventBuilder {
5984 inner: UpdateNewCustomEvent
5985}
5986
5987impl RTDUpdateNewCustomEventBuilder {
5988 pub fn build(&self) -> UpdateNewCustomEvent { self.inner.clone() }
5989
5990
5991 pub fn event<T: AsRef<str>>(&mut self, event: T) -> &mut Self {
5992 self.inner.event = event.as_ref().to_string();
5993 self
5994 }
5995
5996}
5997
5998impl AsRef<UpdateNewCustomEvent> for UpdateNewCustomEvent {
5999 fn as_ref(&self) -> &UpdateNewCustomEvent { self }
6000}
6001
6002impl AsRef<UpdateNewCustomEvent> for RTDUpdateNewCustomEventBuilder {
6003 fn as_ref(&self) -> &UpdateNewCustomEvent { &self.inner }
6004}
6005
6006
6007
6008
6009
6010
6011
6012#[derive(Debug, Clone, Default, Serialize, Deserialize)]
6014pub struct UpdateNewCustomQuery {
6015 #[doc(hidden)]
6016 #[serde(rename(serialize = "@type", deserialize = "@type"))]
6017 td_name: String,
6018 #[doc(hidden)]
6019 #[serde(rename(serialize = "@extra", deserialize = "@extra"))]
6020 extra: Option<String>,
6021 id: isize,
6023 data: String,
6025 timeout: i64,
6027
6028}
6029
6030impl RObject for UpdateNewCustomQuery {
6031 #[doc(hidden)] fn td_name(&self) -> &'static str { "updateNewCustomQuery" }
6032 #[doc(hidden)] fn extra(&self) -> Option<String> { self.extra.clone() }
6033 fn to_json(&self) -> RTDResult<String> { Ok(serde_json::to_string(self)?) }
6034}
6035
6036
6037impl TDUpdate for UpdateNewCustomQuery {}
6038
6039
6040
6041impl UpdateNewCustomQuery {
6042 pub fn from_json<S: AsRef<str>>(json: S) -> RTDResult<Self> { Ok(serde_json::from_str(json.as_ref())?) }
6043 pub fn builder() -> RTDUpdateNewCustomQueryBuilder {
6044 let mut inner = UpdateNewCustomQuery::default();
6045 inner.td_name = "updateNewCustomQuery".to_string();
6046 inner.extra = Some(Uuid::new_v4().to_string());
6047 RTDUpdateNewCustomQueryBuilder { inner }
6048 }
6049
6050 pub fn id(&self) -> isize { self.id }
6051
6052 pub fn data(&self) -> &String { &self.data }
6053
6054 pub fn timeout(&self) -> i64 { self.timeout }
6055
6056}
6057
6058#[doc(hidden)]
6059pub struct RTDUpdateNewCustomQueryBuilder {
6060 inner: UpdateNewCustomQuery
6061}
6062
6063impl RTDUpdateNewCustomQueryBuilder {
6064 pub fn build(&self) -> UpdateNewCustomQuery { self.inner.clone() }
6065
6066
6067 pub fn id(&mut self, id: isize) -> &mut Self {
6068 self.inner.id = id;
6069 self
6070 }
6071
6072
6073 pub fn data<T: AsRef<str>>(&mut self, data: T) -> &mut Self {
6074 self.inner.data = data.as_ref().to_string();
6075 self
6076 }
6077
6078
6079 pub fn timeout(&mut self, timeout: i64) -> &mut Self {
6080 self.inner.timeout = timeout;
6081 self
6082 }
6083
6084}
6085
6086impl AsRef<UpdateNewCustomQuery> for UpdateNewCustomQuery {
6087 fn as_ref(&self) -> &UpdateNewCustomQuery { self }
6088}
6089
6090impl AsRef<UpdateNewCustomQuery> for RTDUpdateNewCustomQueryBuilder {
6091 fn as_ref(&self) -> &UpdateNewCustomQuery { &self.inner }
6092}
6093
6094
6095
6096
6097
6098
6099
6100#[derive(Debug, Clone, Default, Serialize, Deserialize)]
6102pub struct UpdateNewInlineCallbackQuery {
6103 #[doc(hidden)]
6104 #[serde(rename(serialize = "@type", deserialize = "@type"))]
6105 td_name: String,
6106 #[doc(hidden)]
6107 #[serde(rename(serialize = "@extra", deserialize = "@extra"))]
6108 extra: Option<String>,
6109 id: isize,
6111 sender_user_id: i64,
6113 inline_message_id: String,
6115 chat_instance: isize,
6117 payload: CallbackQueryPayload,
6119
6120}
6121
6122impl RObject for UpdateNewInlineCallbackQuery {
6123 #[doc(hidden)] fn td_name(&self) -> &'static str { "updateNewInlineCallbackQuery" }
6124 #[doc(hidden)] fn extra(&self) -> Option<String> { self.extra.clone() }
6125 fn to_json(&self) -> RTDResult<String> { Ok(serde_json::to_string(self)?) }
6126}
6127
6128
6129impl TDUpdate for UpdateNewInlineCallbackQuery {}
6130
6131
6132
6133impl UpdateNewInlineCallbackQuery {
6134 pub fn from_json<S: AsRef<str>>(json: S) -> RTDResult<Self> { Ok(serde_json::from_str(json.as_ref())?) }
6135 pub fn builder() -> RTDUpdateNewInlineCallbackQueryBuilder {
6136 let mut inner = UpdateNewInlineCallbackQuery::default();
6137 inner.td_name = "updateNewInlineCallbackQuery".to_string();
6138 inner.extra = Some(Uuid::new_v4().to_string());
6139 RTDUpdateNewInlineCallbackQueryBuilder { inner }
6140 }
6141
6142 pub fn id(&self) -> isize { self.id }
6143
6144 pub fn sender_user_id(&self) -> i64 { self.sender_user_id }
6145
6146 pub fn inline_message_id(&self) -> &String { &self.inline_message_id }
6147
6148 pub fn chat_instance(&self) -> isize { self.chat_instance }
6149
6150 pub fn payload(&self) -> &CallbackQueryPayload { &self.payload }
6151
6152}
6153
6154#[doc(hidden)]
6155pub struct RTDUpdateNewInlineCallbackQueryBuilder {
6156 inner: UpdateNewInlineCallbackQuery
6157}
6158
6159impl RTDUpdateNewInlineCallbackQueryBuilder {
6160 pub fn build(&self) -> UpdateNewInlineCallbackQuery { self.inner.clone() }
6161
6162
6163 pub fn id(&mut self, id: isize) -> &mut Self {
6164 self.inner.id = id;
6165 self
6166 }
6167
6168
6169 pub fn sender_user_id(&mut self, sender_user_id: i64) -> &mut Self {
6170 self.inner.sender_user_id = sender_user_id;
6171 self
6172 }
6173
6174
6175 pub fn inline_message_id<T: AsRef<str>>(&mut self, inline_message_id: T) -> &mut Self {
6176 self.inner.inline_message_id = inline_message_id.as_ref().to_string();
6177 self
6178 }
6179
6180
6181 pub fn chat_instance(&mut self, chat_instance: isize) -> &mut Self {
6182 self.inner.chat_instance = chat_instance;
6183 self
6184 }
6185
6186
6187 pub fn payload<T: AsRef<CallbackQueryPayload>>(&mut self, payload: T) -> &mut Self {
6188 self.inner.payload = payload.as_ref().clone();
6189 self
6190 }
6191
6192}
6193
6194impl AsRef<UpdateNewInlineCallbackQuery> for UpdateNewInlineCallbackQuery {
6195 fn as_ref(&self) -> &UpdateNewInlineCallbackQuery { self }
6196}
6197
6198impl AsRef<UpdateNewInlineCallbackQuery> for RTDUpdateNewInlineCallbackQueryBuilder {
6199 fn as_ref(&self) -> &UpdateNewInlineCallbackQuery { &self.inner }
6200}
6201
6202
6203
6204
6205
6206
6207
6208#[derive(Debug, Clone, Default, Serialize, Deserialize)]
6210pub struct UpdateNewInlineQuery {
6211 #[doc(hidden)]
6212 #[serde(rename(serialize = "@type", deserialize = "@type"))]
6213 td_name: String,
6214 #[doc(hidden)]
6215 #[serde(rename(serialize = "@extra", deserialize = "@extra"))]
6216 extra: Option<String>,
6217 id: isize,
6219 sender_user_id: i64,
6221 user_location: Option<Location>,
6223 chat_type: Option<ChatType>,
6225 query: String,
6227 offset: String,
6229
6230}
6231
6232impl RObject for UpdateNewInlineQuery {
6233 #[doc(hidden)] fn td_name(&self) -> &'static str { "updateNewInlineQuery" }
6234 #[doc(hidden)] fn extra(&self) -> Option<String> { self.extra.clone() }
6235 fn to_json(&self) -> RTDResult<String> { Ok(serde_json::to_string(self)?) }
6236}
6237
6238
6239impl TDUpdate for UpdateNewInlineQuery {}
6240
6241
6242
6243impl UpdateNewInlineQuery {
6244 pub fn from_json<S: AsRef<str>>(json: S) -> RTDResult<Self> { Ok(serde_json::from_str(json.as_ref())?) }
6245 pub fn builder() -> RTDUpdateNewInlineQueryBuilder {
6246 let mut inner = UpdateNewInlineQuery::default();
6247 inner.td_name = "updateNewInlineQuery".to_string();
6248 inner.extra = Some(Uuid::new_v4().to_string());
6249 RTDUpdateNewInlineQueryBuilder { inner }
6250 }
6251
6252 pub fn id(&self) -> isize { self.id }
6253
6254 pub fn sender_user_id(&self) -> i64 { self.sender_user_id }
6255
6256 pub fn user_location(&self) -> &Option<Location> { &self.user_location }
6257
6258 pub fn chat_type(&self) -> &Option<ChatType> { &self.chat_type }
6259
6260 pub fn query(&self) -> &String { &self.query }
6261
6262 pub fn offset(&self) -> &String { &self.offset }
6263
6264}
6265
6266#[doc(hidden)]
6267pub struct RTDUpdateNewInlineQueryBuilder {
6268 inner: UpdateNewInlineQuery
6269}
6270
6271impl RTDUpdateNewInlineQueryBuilder {
6272 pub fn build(&self) -> UpdateNewInlineQuery { self.inner.clone() }
6273
6274
6275 pub fn id(&mut self, id: isize) -> &mut Self {
6276 self.inner.id = id;
6277 self
6278 }
6279
6280
6281 pub fn sender_user_id(&mut self, sender_user_id: i64) -> &mut Self {
6282 self.inner.sender_user_id = sender_user_id;
6283 self
6284 }
6285
6286
6287 pub fn user_location<T: AsRef<Location>>(&mut self, user_location: T) -> &mut Self {
6288 self.inner.user_location = Some(user_location.as_ref().clone());
6289 self
6290 }
6291
6292
6293 pub fn chat_type<T: AsRef<ChatType>>(&mut self, chat_type: T) -> &mut Self {
6294 self.inner.chat_type = Some(chat_type.as_ref().clone());
6295 self
6296 }
6297
6298
6299 pub fn query<T: AsRef<str>>(&mut self, query: T) -> &mut Self {
6300 self.inner.query = query.as_ref().to_string();
6301 self
6302 }
6303
6304
6305 pub fn offset<T: AsRef<str>>(&mut self, offset: T) -> &mut Self {
6306 self.inner.offset = offset.as_ref().to_string();
6307 self
6308 }
6309
6310}
6311
6312impl AsRef<UpdateNewInlineQuery> for UpdateNewInlineQuery {
6313 fn as_ref(&self) -> &UpdateNewInlineQuery { self }
6314}
6315
6316impl AsRef<UpdateNewInlineQuery> for RTDUpdateNewInlineQueryBuilder {
6317 fn as_ref(&self) -> &UpdateNewInlineQuery { &self.inner }
6318}
6319
6320
6321
6322
6323
6324
6325
6326#[derive(Debug, Clone, Default, Serialize, Deserialize)]
6328pub struct UpdateNewMessage {
6329 #[doc(hidden)]
6330 #[serde(rename(serialize = "@type", deserialize = "@type"))]
6331 td_name: String,
6332 #[doc(hidden)]
6333 #[serde(rename(serialize = "@extra", deserialize = "@extra"))]
6334 extra: Option<String>,
6335 message: Message,
6337
6338}
6339
6340impl RObject for UpdateNewMessage {
6341 #[doc(hidden)] fn td_name(&self) -> &'static str { "updateNewMessage" }
6342 #[doc(hidden)] fn extra(&self) -> Option<String> { self.extra.clone() }
6343 fn to_json(&self) -> RTDResult<String> { Ok(serde_json::to_string(self)?) }
6344}
6345
6346
6347impl TDUpdate for UpdateNewMessage {}
6348
6349
6350
6351impl UpdateNewMessage {
6352 pub fn from_json<S: AsRef<str>>(json: S) -> RTDResult<Self> { Ok(serde_json::from_str(json.as_ref())?) }
6353 pub fn builder() -> RTDUpdateNewMessageBuilder {
6354 let mut inner = UpdateNewMessage::default();
6355 inner.td_name = "updateNewMessage".to_string();
6356 inner.extra = Some(Uuid::new_v4().to_string());
6357 RTDUpdateNewMessageBuilder { inner }
6358 }
6359
6360 pub fn message(&self) -> &Message { &self.message }
6361
6362}
6363
6364#[doc(hidden)]
6365pub struct RTDUpdateNewMessageBuilder {
6366 inner: UpdateNewMessage
6367}
6368
6369impl RTDUpdateNewMessageBuilder {
6370 pub fn build(&self) -> UpdateNewMessage { self.inner.clone() }
6371
6372
6373 pub fn message<T: AsRef<Message>>(&mut self, message: T) -> &mut Self {
6374 self.inner.message = message.as_ref().clone();
6375 self
6376 }
6377
6378}
6379
6380impl AsRef<UpdateNewMessage> for UpdateNewMessage {
6381 fn as_ref(&self) -> &UpdateNewMessage { self }
6382}
6383
6384impl AsRef<UpdateNewMessage> for RTDUpdateNewMessageBuilder {
6385 fn as_ref(&self) -> &UpdateNewMessage { &self.inner }
6386}
6387
6388
6389
6390
6391
6392
6393
6394#[derive(Debug, Clone, Default, Serialize, Deserialize)]
6396pub struct UpdateNewPreCheckoutQuery {
6397 #[doc(hidden)]
6398 #[serde(rename(serialize = "@type", deserialize = "@type"))]
6399 td_name: String,
6400 #[doc(hidden)]
6401 #[serde(rename(serialize = "@extra", deserialize = "@extra"))]
6402 extra: Option<String>,
6403 id: isize,
6405 sender_user_id: i64,
6407 currency: String,
6409 total_amount: i64,
6411 invoice_payload: String,
6413 shipping_option_id: String,
6415 order_info: Option<OrderInfo>,
6417
6418}
6419
6420impl RObject for UpdateNewPreCheckoutQuery {
6421 #[doc(hidden)] fn td_name(&self) -> &'static str { "updateNewPreCheckoutQuery" }
6422 #[doc(hidden)] fn extra(&self) -> Option<String> { self.extra.clone() }
6423 fn to_json(&self) -> RTDResult<String> { Ok(serde_json::to_string(self)?) }
6424}
6425
6426
6427impl TDUpdate for UpdateNewPreCheckoutQuery {}
6428
6429
6430
6431impl UpdateNewPreCheckoutQuery {
6432 pub fn from_json<S: AsRef<str>>(json: S) -> RTDResult<Self> { Ok(serde_json::from_str(json.as_ref())?) }
6433 pub fn builder() -> RTDUpdateNewPreCheckoutQueryBuilder {
6434 let mut inner = UpdateNewPreCheckoutQuery::default();
6435 inner.td_name = "updateNewPreCheckoutQuery".to_string();
6436 inner.extra = Some(Uuid::new_v4().to_string());
6437 RTDUpdateNewPreCheckoutQueryBuilder { inner }
6438 }
6439
6440 pub fn id(&self) -> isize { self.id }
6441
6442 pub fn sender_user_id(&self) -> i64 { self.sender_user_id }
6443
6444 pub fn currency(&self) -> &String { &self.currency }
6445
6446 pub fn total_amount(&self) -> i64 { self.total_amount }
6447
6448 pub fn invoice_payload(&self) -> &String { &self.invoice_payload }
6449
6450 pub fn shipping_option_id(&self) -> &String { &self.shipping_option_id }
6451
6452 pub fn order_info(&self) -> &Option<OrderInfo> { &self.order_info }
6453
6454}
6455
6456#[doc(hidden)]
6457pub struct RTDUpdateNewPreCheckoutQueryBuilder {
6458 inner: UpdateNewPreCheckoutQuery
6459}
6460
6461impl RTDUpdateNewPreCheckoutQueryBuilder {
6462 pub fn build(&self) -> UpdateNewPreCheckoutQuery { self.inner.clone() }
6463
6464
6465 pub fn id(&mut self, id: isize) -> &mut Self {
6466 self.inner.id = id;
6467 self
6468 }
6469
6470
6471 pub fn sender_user_id(&mut self, sender_user_id: i64) -> &mut Self {
6472 self.inner.sender_user_id = sender_user_id;
6473 self
6474 }
6475
6476
6477 pub fn currency<T: AsRef<str>>(&mut self, currency: T) -> &mut Self {
6478 self.inner.currency = currency.as_ref().to_string();
6479 self
6480 }
6481
6482
6483 pub fn total_amount(&mut self, total_amount: i64) -> &mut Self {
6484 self.inner.total_amount = total_amount;
6485 self
6486 }
6487
6488
6489 pub fn invoice_payload<T: AsRef<str>>(&mut self, invoice_payload: T) -> &mut Self {
6490 self.inner.invoice_payload = invoice_payload.as_ref().to_string();
6491 self
6492 }
6493
6494
6495 pub fn shipping_option_id<T: AsRef<str>>(&mut self, shipping_option_id: T) -> &mut Self {
6496 self.inner.shipping_option_id = shipping_option_id.as_ref().to_string();
6497 self
6498 }
6499
6500
6501 pub fn order_info<T: AsRef<OrderInfo>>(&mut self, order_info: T) -> &mut Self {
6502 self.inner.order_info = Some(order_info.as_ref().clone());
6503 self
6504 }
6505
6506}
6507
6508impl AsRef<UpdateNewPreCheckoutQuery> for UpdateNewPreCheckoutQuery {
6509 fn as_ref(&self) -> &UpdateNewPreCheckoutQuery { self }
6510}
6511
6512impl AsRef<UpdateNewPreCheckoutQuery> for RTDUpdateNewPreCheckoutQueryBuilder {
6513 fn as_ref(&self) -> &UpdateNewPreCheckoutQuery { &self.inner }
6514}
6515
6516
6517
6518
6519
6520
6521
6522#[derive(Debug, Clone, Default, Serialize, Deserialize)]
6524pub struct UpdateNewShippingQuery {
6525 #[doc(hidden)]
6526 #[serde(rename(serialize = "@type", deserialize = "@type"))]
6527 td_name: String,
6528 #[doc(hidden)]
6529 #[serde(rename(serialize = "@extra", deserialize = "@extra"))]
6530 extra: Option<String>,
6531 id: isize,
6533 sender_user_id: i64,
6535 invoice_payload: String,
6537 shipping_address: Address,
6539
6540}
6541
6542impl RObject for UpdateNewShippingQuery {
6543 #[doc(hidden)] fn td_name(&self) -> &'static str { "updateNewShippingQuery" }
6544 #[doc(hidden)] fn extra(&self) -> Option<String> { self.extra.clone() }
6545 fn to_json(&self) -> RTDResult<String> { Ok(serde_json::to_string(self)?) }
6546}
6547
6548
6549impl TDUpdate for UpdateNewShippingQuery {}
6550
6551
6552
6553impl UpdateNewShippingQuery {
6554 pub fn from_json<S: AsRef<str>>(json: S) -> RTDResult<Self> { Ok(serde_json::from_str(json.as_ref())?) }
6555 pub fn builder() -> RTDUpdateNewShippingQueryBuilder {
6556 let mut inner = UpdateNewShippingQuery::default();
6557 inner.td_name = "updateNewShippingQuery".to_string();
6558 inner.extra = Some(Uuid::new_v4().to_string());
6559 RTDUpdateNewShippingQueryBuilder { inner }
6560 }
6561
6562 pub fn id(&self) -> isize { self.id }
6563
6564 pub fn sender_user_id(&self) -> i64 { self.sender_user_id }
6565
6566 pub fn invoice_payload(&self) -> &String { &self.invoice_payload }
6567
6568 pub fn shipping_address(&self) -> &Address { &self.shipping_address }
6569
6570}
6571
6572#[doc(hidden)]
6573pub struct RTDUpdateNewShippingQueryBuilder {
6574 inner: UpdateNewShippingQuery
6575}
6576
6577impl RTDUpdateNewShippingQueryBuilder {
6578 pub fn build(&self) -> UpdateNewShippingQuery { self.inner.clone() }
6579
6580
6581 pub fn id(&mut self, id: isize) -> &mut Self {
6582 self.inner.id = id;
6583 self
6584 }
6585
6586
6587 pub fn sender_user_id(&mut self, sender_user_id: i64) -> &mut Self {
6588 self.inner.sender_user_id = sender_user_id;
6589 self
6590 }
6591
6592
6593 pub fn invoice_payload<T: AsRef<str>>(&mut self, invoice_payload: T) -> &mut Self {
6594 self.inner.invoice_payload = invoice_payload.as_ref().to_string();
6595 self
6596 }
6597
6598
6599 pub fn shipping_address<T: AsRef<Address>>(&mut self, shipping_address: T) -> &mut Self {
6600 self.inner.shipping_address = shipping_address.as_ref().clone();
6601 self
6602 }
6603
6604}
6605
6606impl AsRef<UpdateNewShippingQuery> for UpdateNewShippingQuery {
6607 fn as_ref(&self) -> &UpdateNewShippingQuery { self }
6608}
6609
6610impl AsRef<UpdateNewShippingQuery> for RTDUpdateNewShippingQueryBuilder {
6611 fn as_ref(&self) -> &UpdateNewShippingQuery { &self.inner }
6612}
6613
6614
6615
6616
6617
6618
6619
6620#[derive(Debug, Clone, Default, Serialize, Deserialize)]
6622pub struct UpdateNotification {
6623 #[doc(hidden)]
6624 #[serde(rename(serialize = "@type", deserialize = "@type"))]
6625 td_name: String,
6626 #[doc(hidden)]
6627 #[serde(rename(serialize = "@extra", deserialize = "@extra"))]
6628 extra: Option<String>,
6629 notification_group_id: i64,
6631 notification: Notification,
6633
6634}
6635
6636impl RObject for UpdateNotification {
6637 #[doc(hidden)] fn td_name(&self) -> &'static str { "updateNotification" }
6638 #[doc(hidden)] fn extra(&self) -> Option<String> { self.extra.clone() }
6639 fn to_json(&self) -> RTDResult<String> { Ok(serde_json::to_string(self)?) }
6640}
6641
6642
6643impl TDUpdate for UpdateNotification {}
6644
6645
6646
6647impl UpdateNotification {
6648 pub fn from_json<S: AsRef<str>>(json: S) -> RTDResult<Self> { Ok(serde_json::from_str(json.as_ref())?) }
6649 pub fn builder() -> RTDUpdateNotificationBuilder {
6650 let mut inner = UpdateNotification::default();
6651 inner.td_name = "updateNotification".to_string();
6652 inner.extra = Some(Uuid::new_v4().to_string());
6653 RTDUpdateNotificationBuilder { inner }
6654 }
6655
6656 pub fn notification_group_id(&self) -> i64 { self.notification_group_id }
6657
6658 pub fn notification(&self) -> &Notification { &self.notification }
6659
6660}
6661
6662#[doc(hidden)]
6663pub struct RTDUpdateNotificationBuilder {
6664 inner: UpdateNotification
6665}
6666
6667impl RTDUpdateNotificationBuilder {
6668 pub fn build(&self) -> UpdateNotification { self.inner.clone() }
6669
6670
6671 pub fn notification_group_id(&mut self, notification_group_id: i64) -> &mut Self {
6672 self.inner.notification_group_id = notification_group_id;
6673 self
6674 }
6675
6676
6677 pub fn notification<T: AsRef<Notification>>(&mut self, notification: T) -> &mut Self {
6678 self.inner.notification = notification.as_ref().clone();
6679 self
6680 }
6681
6682}
6683
6684impl AsRef<UpdateNotification> for UpdateNotification {
6685 fn as_ref(&self) -> &UpdateNotification { self }
6686}
6687
6688impl AsRef<UpdateNotification> for RTDUpdateNotificationBuilder {
6689 fn as_ref(&self) -> &UpdateNotification { &self.inner }
6690}
6691
6692
6693
6694
6695
6696
6697
6698#[derive(Debug, Clone, Default, Serialize, Deserialize)]
6700pub struct UpdateNotificationGroup {
6701 #[doc(hidden)]
6702 #[serde(rename(serialize = "@type", deserialize = "@type"))]
6703 td_name: String,
6704 #[doc(hidden)]
6705 #[serde(rename(serialize = "@extra", deserialize = "@extra"))]
6706 extra: Option<String>,
6707 notification_group_id: i64,
6709 #[serde(rename(serialize = "type", deserialize = "type"))] type_: NotificationGroupType,
6711 chat_id: i64,
6713 notification_settings_chat_id: i64,
6715 is_silent: bool,
6717 total_count: i64,
6719 added_notifications: Vec<Notification>,
6721 removed_notification_ids: Vec<i64>,
6723
6724}
6725
6726impl RObject for UpdateNotificationGroup {
6727 #[doc(hidden)] fn td_name(&self) -> &'static str { "updateNotificationGroup" }
6728 #[doc(hidden)] fn extra(&self) -> Option<String> { self.extra.clone() }
6729 fn to_json(&self) -> RTDResult<String> { Ok(serde_json::to_string(self)?) }
6730}
6731
6732
6733impl TDUpdate for UpdateNotificationGroup {}
6734
6735
6736
6737impl UpdateNotificationGroup {
6738 pub fn from_json<S: AsRef<str>>(json: S) -> RTDResult<Self> { Ok(serde_json::from_str(json.as_ref())?) }
6739 pub fn builder() -> RTDUpdateNotificationGroupBuilder {
6740 let mut inner = UpdateNotificationGroup::default();
6741 inner.td_name = "updateNotificationGroup".to_string();
6742 inner.extra = Some(Uuid::new_v4().to_string());
6743 RTDUpdateNotificationGroupBuilder { inner }
6744 }
6745
6746 pub fn notification_group_id(&self) -> i64 { self.notification_group_id }
6747
6748 pub fn type_(&self) -> &NotificationGroupType { &self.type_ }
6749
6750 pub fn chat_id(&self) -> i64 { self.chat_id }
6751
6752 pub fn notification_settings_chat_id(&self) -> i64 { self.notification_settings_chat_id }
6753
6754 pub fn is_silent(&self) -> bool { self.is_silent }
6755
6756 pub fn total_count(&self) -> i64 { self.total_count }
6757
6758 pub fn added_notifications(&self) -> &Vec<Notification> { &self.added_notifications }
6759
6760 pub fn removed_notification_ids(&self) -> &Vec<i64> { &self.removed_notification_ids }
6761
6762}
6763
6764#[doc(hidden)]
6765pub struct RTDUpdateNotificationGroupBuilder {
6766 inner: UpdateNotificationGroup
6767}
6768
6769impl RTDUpdateNotificationGroupBuilder {
6770 pub fn build(&self) -> UpdateNotificationGroup { self.inner.clone() }
6771
6772
6773 pub fn notification_group_id(&mut self, notification_group_id: i64) -> &mut Self {
6774 self.inner.notification_group_id = notification_group_id;
6775 self
6776 }
6777
6778
6779 pub fn type_<T: AsRef<NotificationGroupType>>(&mut self, type_: T) -> &mut Self {
6780 self.inner.type_ = type_.as_ref().clone();
6781 self
6782 }
6783
6784
6785 pub fn chat_id(&mut self, chat_id: i64) -> &mut Self {
6786 self.inner.chat_id = chat_id;
6787 self
6788 }
6789
6790
6791 pub fn notification_settings_chat_id(&mut self, notification_settings_chat_id: i64) -> &mut Self {
6792 self.inner.notification_settings_chat_id = notification_settings_chat_id;
6793 self
6794 }
6795
6796
6797 pub fn is_silent(&mut self, is_silent: bool) -> &mut Self {
6798 self.inner.is_silent = is_silent;
6799 self
6800 }
6801
6802
6803 pub fn total_count(&mut self, total_count: i64) -> &mut Self {
6804 self.inner.total_count = total_count;
6805 self
6806 }
6807
6808
6809 pub fn added_notifications(&mut self, added_notifications: Vec<Notification>) -> &mut Self {
6810 self.inner.added_notifications = added_notifications;
6811 self
6812 }
6813
6814
6815 pub fn removed_notification_ids(&mut self, removed_notification_ids: Vec<i64>) -> &mut Self {
6816 self.inner.removed_notification_ids = removed_notification_ids;
6817 self
6818 }
6819
6820}
6821
6822impl AsRef<UpdateNotificationGroup> for UpdateNotificationGroup {
6823 fn as_ref(&self) -> &UpdateNotificationGroup { self }
6824}
6825
6826impl AsRef<UpdateNotificationGroup> for RTDUpdateNotificationGroupBuilder {
6827 fn as_ref(&self) -> &UpdateNotificationGroup { &self.inner }
6828}
6829
6830
6831
6832
6833
6834
6835
6836#[derive(Debug, Clone, Default, Serialize, Deserialize)]
6838pub struct UpdateOption {
6839 #[doc(hidden)]
6840 #[serde(rename(serialize = "@type", deserialize = "@type"))]
6841 td_name: String,
6842 #[doc(hidden)]
6843 #[serde(rename(serialize = "@extra", deserialize = "@extra"))]
6844 extra: Option<String>,
6845 name: String,
6847 value: OptionValue,
6849
6850}
6851
6852impl RObject for UpdateOption {
6853 #[doc(hidden)] fn td_name(&self) -> &'static str { "updateOption" }
6854 #[doc(hidden)] fn extra(&self) -> Option<String> { self.extra.clone() }
6855 fn to_json(&self) -> RTDResult<String> { Ok(serde_json::to_string(self)?) }
6856}
6857
6858
6859impl TDUpdate for UpdateOption {}
6860
6861
6862
6863impl UpdateOption {
6864 pub fn from_json<S: AsRef<str>>(json: S) -> RTDResult<Self> { Ok(serde_json::from_str(json.as_ref())?) }
6865 pub fn builder() -> RTDUpdateOptionBuilder {
6866 let mut inner = UpdateOption::default();
6867 inner.td_name = "updateOption".to_string();
6868 inner.extra = Some(Uuid::new_v4().to_string());
6869 RTDUpdateOptionBuilder { inner }
6870 }
6871
6872 pub fn name(&self) -> &String { &self.name }
6873
6874 pub fn value(&self) -> &OptionValue { &self.value }
6875
6876}
6877
6878#[doc(hidden)]
6879pub struct RTDUpdateOptionBuilder {
6880 inner: UpdateOption
6881}
6882
6883impl RTDUpdateOptionBuilder {
6884 pub fn build(&self) -> UpdateOption { self.inner.clone() }
6885
6886
6887 pub fn name<T: AsRef<str>>(&mut self, name: T) -> &mut Self {
6888 self.inner.name = name.as_ref().to_string();
6889 self
6890 }
6891
6892
6893 pub fn value<T: AsRef<OptionValue>>(&mut self, value: T) -> &mut Self {
6894 self.inner.value = value.as_ref().clone();
6895 self
6896 }
6897
6898}
6899
6900impl AsRef<UpdateOption> for UpdateOption {
6901 fn as_ref(&self) -> &UpdateOption { self }
6902}
6903
6904impl AsRef<UpdateOption> for RTDUpdateOptionBuilder {
6905 fn as_ref(&self) -> &UpdateOption { &self.inner }
6906}
6907
6908
6909
6910
6911
6912
6913
6914#[derive(Debug, Clone, Default, Serialize, Deserialize)]
6916pub struct UpdatePoll {
6917 #[doc(hidden)]
6918 #[serde(rename(serialize = "@type", deserialize = "@type"))]
6919 td_name: String,
6920 #[doc(hidden)]
6921 #[serde(rename(serialize = "@extra", deserialize = "@extra"))]
6922 extra: Option<String>,
6923 poll: Poll,
6925
6926}
6927
6928impl RObject for UpdatePoll {
6929 #[doc(hidden)] fn td_name(&self) -> &'static str { "updatePoll" }
6930 #[doc(hidden)] fn extra(&self) -> Option<String> { self.extra.clone() }
6931 fn to_json(&self) -> RTDResult<String> { Ok(serde_json::to_string(self)?) }
6932}
6933
6934
6935impl TDUpdate for UpdatePoll {}
6936
6937
6938
6939impl UpdatePoll {
6940 pub fn from_json<S: AsRef<str>>(json: S) -> RTDResult<Self> { Ok(serde_json::from_str(json.as_ref())?) }
6941 pub fn builder() -> RTDUpdatePollBuilder {
6942 let mut inner = UpdatePoll::default();
6943 inner.td_name = "updatePoll".to_string();
6944 inner.extra = Some(Uuid::new_v4().to_string());
6945 RTDUpdatePollBuilder { inner }
6946 }
6947
6948 pub fn poll(&self) -> &Poll { &self.poll }
6949
6950}
6951
6952#[doc(hidden)]
6953pub struct RTDUpdatePollBuilder {
6954 inner: UpdatePoll
6955}
6956
6957impl RTDUpdatePollBuilder {
6958 pub fn build(&self) -> UpdatePoll { self.inner.clone() }
6959
6960
6961 pub fn poll<T: AsRef<Poll>>(&mut self, poll: T) -> &mut Self {
6962 self.inner.poll = poll.as_ref().clone();
6963 self
6964 }
6965
6966}
6967
6968impl AsRef<UpdatePoll> for UpdatePoll {
6969 fn as_ref(&self) -> &UpdatePoll { self }
6970}
6971
6972impl AsRef<UpdatePoll> for RTDUpdatePollBuilder {
6973 fn as_ref(&self) -> &UpdatePoll { &self.inner }
6974}
6975
6976
6977
6978
6979
6980
6981
6982#[derive(Debug, Clone, Default, Serialize, Deserialize)]
6984pub struct UpdatePollAnswer {
6985 #[doc(hidden)]
6986 #[serde(rename(serialize = "@type", deserialize = "@type"))]
6987 td_name: String,
6988 #[doc(hidden)]
6989 #[serde(rename(serialize = "@extra", deserialize = "@extra"))]
6990 extra: Option<String>,
6991 poll_id: isize,
6993 user_id: i64,
6995 option_ids: Vec<i64>,
6997
6998}
6999
7000impl RObject for UpdatePollAnswer {
7001 #[doc(hidden)] fn td_name(&self) -> &'static str { "updatePollAnswer" }
7002 #[doc(hidden)] fn extra(&self) -> Option<String> { self.extra.clone() }
7003 fn to_json(&self) -> RTDResult<String> { Ok(serde_json::to_string(self)?) }
7004}
7005
7006
7007impl TDUpdate for UpdatePollAnswer {}
7008
7009
7010
7011impl UpdatePollAnswer {
7012 pub fn from_json<S: AsRef<str>>(json: S) -> RTDResult<Self> { Ok(serde_json::from_str(json.as_ref())?) }
7013 pub fn builder() -> RTDUpdatePollAnswerBuilder {
7014 let mut inner = UpdatePollAnswer::default();
7015 inner.td_name = "updatePollAnswer".to_string();
7016 inner.extra = Some(Uuid::new_v4().to_string());
7017 RTDUpdatePollAnswerBuilder { inner }
7018 }
7019
7020 pub fn poll_id(&self) -> isize { self.poll_id }
7021
7022 pub fn user_id(&self) -> i64 { self.user_id }
7023
7024 pub fn option_ids(&self) -> &Vec<i64> { &self.option_ids }
7025
7026}
7027
7028#[doc(hidden)]
7029pub struct RTDUpdatePollAnswerBuilder {
7030 inner: UpdatePollAnswer
7031}
7032
7033impl RTDUpdatePollAnswerBuilder {
7034 pub fn build(&self) -> UpdatePollAnswer { self.inner.clone() }
7035
7036
7037 pub fn poll_id(&mut self, poll_id: isize) -> &mut Self {
7038 self.inner.poll_id = poll_id;
7039 self
7040 }
7041
7042
7043 pub fn user_id(&mut self, user_id: i64) -> &mut Self {
7044 self.inner.user_id = user_id;
7045 self
7046 }
7047
7048
7049 pub fn option_ids(&mut self, option_ids: Vec<i64>) -> &mut Self {
7050 self.inner.option_ids = option_ids;
7051 self
7052 }
7053
7054}
7055
7056impl AsRef<UpdatePollAnswer> for UpdatePollAnswer {
7057 fn as_ref(&self) -> &UpdatePollAnswer { self }
7058}
7059
7060impl AsRef<UpdatePollAnswer> for RTDUpdatePollAnswerBuilder {
7061 fn as_ref(&self) -> &UpdatePollAnswer { &self.inner }
7062}
7063
7064
7065
7066
7067
7068
7069
7070#[derive(Debug, Clone, Default, Serialize, Deserialize)]
7072pub struct UpdateRecentStickers {
7073 #[doc(hidden)]
7074 #[serde(rename(serialize = "@type", deserialize = "@type"))]
7075 td_name: String,
7076 #[doc(hidden)]
7077 #[serde(rename(serialize = "@extra", deserialize = "@extra"))]
7078 extra: Option<String>,
7079 is_attached: bool,
7081 sticker_ids: Vec<i64>,
7083
7084}
7085
7086impl RObject for UpdateRecentStickers {
7087 #[doc(hidden)] fn td_name(&self) -> &'static str { "updateRecentStickers" }
7088 #[doc(hidden)] fn extra(&self) -> Option<String> { self.extra.clone() }
7089 fn to_json(&self) -> RTDResult<String> { Ok(serde_json::to_string(self)?) }
7090}
7091
7092
7093impl TDUpdate for UpdateRecentStickers {}
7094
7095
7096
7097impl UpdateRecentStickers {
7098 pub fn from_json<S: AsRef<str>>(json: S) -> RTDResult<Self> { Ok(serde_json::from_str(json.as_ref())?) }
7099 pub fn builder() -> RTDUpdateRecentStickersBuilder {
7100 let mut inner = UpdateRecentStickers::default();
7101 inner.td_name = "updateRecentStickers".to_string();
7102 inner.extra = Some(Uuid::new_v4().to_string());
7103 RTDUpdateRecentStickersBuilder { inner }
7104 }
7105
7106 pub fn is_attached(&self) -> bool { self.is_attached }
7107
7108 pub fn sticker_ids(&self) -> &Vec<i64> { &self.sticker_ids }
7109
7110}
7111
7112#[doc(hidden)]
7113pub struct RTDUpdateRecentStickersBuilder {
7114 inner: UpdateRecentStickers
7115}
7116
7117impl RTDUpdateRecentStickersBuilder {
7118 pub fn build(&self) -> UpdateRecentStickers { self.inner.clone() }
7119
7120
7121 pub fn is_attached(&mut self, is_attached: bool) -> &mut Self {
7122 self.inner.is_attached = is_attached;
7123 self
7124 }
7125
7126
7127 pub fn sticker_ids(&mut self, sticker_ids: Vec<i64>) -> &mut Self {
7128 self.inner.sticker_ids = sticker_ids;
7129 self
7130 }
7131
7132}
7133
7134impl AsRef<UpdateRecentStickers> for UpdateRecentStickers {
7135 fn as_ref(&self) -> &UpdateRecentStickers { self }
7136}
7137
7138impl AsRef<UpdateRecentStickers> for RTDUpdateRecentStickersBuilder {
7139 fn as_ref(&self) -> &UpdateRecentStickers { &self.inner }
7140}
7141
7142
7143
7144
7145
7146
7147
7148#[derive(Debug, Clone, Default, Serialize, Deserialize)]
7150pub struct UpdateSavedAnimations {
7151 #[doc(hidden)]
7152 #[serde(rename(serialize = "@type", deserialize = "@type"))]
7153 td_name: String,
7154 #[doc(hidden)]
7155 #[serde(rename(serialize = "@extra", deserialize = "@extra"))]
7156 extra: Option<String>,
7157 animation_ids: Vec<i64>,
7159
7160}
7161
7162impl RObject for UpdateSavedAnimations {
7163 #[doc(hidden)] fn td_name(&self) -> &'static str { "updateSavedAnimations" }
7164 #[doc(hidden)] fn extra(&self) -> Option<String> { self.extra.clone() }
7165 fn to_json(&self) -> RTDResult<String> { Ok(serde_json::to_string(self)?) }
7166}
7167
7168
7169impl TDUpdate for UpdateSavedAnimations {}
7170
7171
7172
7173impl UpdateSavedAnimations {
7174 pub fn from_json<S: AsRef<str>>(json: S) -> RTDResult<Self> { Ok(serde_json::from_str(json.as_ref())?) }
7175 pub fn builder() -> RTDUpdateSavedAnimationsBuilder {
7176 let mut inner = UpdateSavedAnimations::default();
7177 inner.td_name = "updateSavedAnimations".to_string();
7178 inner.extra = Some(Uuid::new_v4().to_string());
7179 RTDUpdateSavedAnimationsBuilder { inner }
7180 }
7181
7182 pub fn animation_ids(&self) -> &Vec<i64> { &self.animation_ids }
7183
7184}
7185
7186#[doc(hidden)]
7187pub struct RTDUpdateSavedAnimationsBuilder {
7188 inner: UpdateSavedAnimations
7189}
7190
7191impl RTDUpdateSavedAnimationsBuilder {
7192 pub fn build(&self) -> UpdateSavedAnimations { self.inner.clone() }
7193
7194
7195 pub fn animation_ids(&mut self, animation_ids: Vec<i64>) -> &mut Self {
7196 self.inner.animation_ids = animation_ids;
7197 self
7198 }
7199
7200}
7201
7202impl AsRef<UpdateSavedAnimations> for UpdateSavedAnimations {
7203 fn as_ref(&self) -> &UpdateSavedAnimations { self }
7204}
7205
7206impl AsRef<UpdateSavedAnimations> for RTDUpdateSavedAnimationsBuilder {
7207 fn as_ref(&self) -> &UpdateSavedAnimations { &self.inner }
7208}
7209
7210
7211
7212
7213
7214
7215
7216#[derive(Debug, Clone, Default, Serialize, Deserialize)]
7218pub struct UpdateScopeNotificationSettings {
7219 #[doc(hidden)]
7220 #[serde(rename(serialize = "@type", deserialize = "@type"))]
7221 td_name: String,
7222 #[doc(hidden)]
7223 #[serde(rename(serialize = "@extra", deserialize = "@extra"))]
7224 extra: Option<String>,
7225 scope: NotificationSettingsScope,
7227 notification_settings: ScopeNotificationSettings,
7229
7230}
7231
7232impl RObject for UpdateScopeNotificationSettings {
7233 #[doc(hidden)] fn td_name(&self) -> &'static str { "updateScopeNotificationSettings" }
7234 #[doc(hidden)] fn extra(&self) -> Option<String> { self.extra.clone() }
7235 fn to_json(&self) -> RTDResult<String> { Ok(serde_json::to_string(self)?) }
7236}
7237
7238
7239impl TDUpdate for UpdateScopeNotificationSettings {}
7240
7241
7242
7243impl UpdateScopeNotificationSettings {
7244 pub fn from_json<S: AsRef<str>>(json: S) -> RTDResult<Self> { Ok(serde_json::from_str(json.as_ref())?) }
7245 pub fn builder() -> RTDUpdateScopeNotificationSettingsBuilder {
7246 let mut inner = UpdateScopeNotificationSettings::default();
7247 inner.td_name = "updateScopeNotificationSettings".to_string();
7248 inner.extra = Some(Uuid::new_v4().to_string());
7249 RTDUpdateScopeNotificationSettingsBuilder { inner }
7250 }
7251
7252 pub fn scope(&self) -> &NotificationSettingsScope { &self.scope }
7253
7254 pub fn notification_settings(&self) -> &ScopeNotificationSettings { &self.notification_settings }
7255
7256}
7257
7258#[doc(hidden)]
7259pub struct RTDUpdateScopeNotificationSettingsBuilder {
7260 inner: UpdateScopeNotificationSettings
7261}
7262
7263impl RTDUpdateScopeNotificationSettingsBuilder {
7264 pub fn build(&self) -> UpdateScopeNotificationSettings { self.inner.clone() }
7265
7266
7267 pub fn scope<T: AsRef<NotificationSettingsScope>>(&mut self, scope: T) -> &mut Self {
7268 self.inner.scope = scope.as_ref().clone();
7269 self
7270 }
7271
7272
7273 pub fn notification_settings<T: AsRef<ScopeNotificationSettings>>(&mut self, notification_settings: T) -> &mut Self {
7274 self.inner.notification_settings = notification_settings.as_ref().clone();
7275 self
7276 }
7277
7278}
7279
7280impl AsRef<UpdateScopeNotificationSettings> for UpdateScopeNotificationSettings {
7281 fn as_ref(&self) -> &UpdateScopeNotificationSettings { self }
7282}
7283
7284impl AsRef<UpdateScopeNotificationSettings> for RTDUpdateScopeNotificationSettingsBuilder {
7285 fn as_ref(&self) -> &UpdateScopeNotificationSettings { &self.inner }
7286}
7287
7288
7289
7290
7291
7292
7293
7294#[derive(Debug, Clone, Default, Serialize, Deserialize)]
7296pub struct UpdateSecretChat {
7297 #[doc(hidden)]
7298 #[serde(rename(serialize = "@type", deserialize = "@type"))]
7299 td_name: String,
7300 #[doc(hidden)]
7301 #[serde(rename(serialize = "@extra", deserialize = "@extra"))]
7302 extra: Option<String>,
7303 secret_chat: SecretChat,
7305
7306}
7307
7308impl RObject for UpdateSecretChat {
7309 #[doc(hidden)] fn td_name(&self) -> &'static str { "updateSecretChat" }
7310 #[doc(hidden)] fn extra(&self) -> Option<String> { self.extra.clone() }
7311 fn to_json(&self) -> RTDResult<String> { Ok(serde_json::to_string(self)?) }
7312}
7313
7314
7315impl TDUpdate for UpdateSecretChat {}
7316
7317
7318
7319impl UpdateSecretChat {
7320 pub fn from_json<S: AsRef<str>>(json: S) -> RTDResult<Self> { Ok(serde_json::from_str(json.as_ref())?) }
7321 pub fn builder() -> RTDUpdateSecretChatBuilder {
7322 let mut inner = UpdateSecretChat::default();
7323 inner.td_name = "updateSecretChat".to_string();
7324 inner.extra = Some(Uuid::new_v4().to_string());
7325 RTDUpdateSecretChatBuilder { inner }
7326 }
7327
7328 pub fn secret_chat(&self) -> &SecretChat { &self.secret_chat }
7329
7330}
7331
7332#[doc(hidden)]
7333pub struct RTDUpdateSecretChatBuilder {
7334 inner: UpdateSecretChat
7335}
7336
7337impl RTDUpdateSecretChatBuilder {
7338 pub fn build(&self) -> UpdateSecretChat { self.inner.clone() }
7339
7340
7341 pub fn secret_chat<T: AsRef<SecretChat>>(&mut self, secret_chat: T) -> &mut Self {
7342 self.inner.secret_chat = secret_chat.as_ref().clone();
7343 self
7344 }
7345
7346}
7347
7348impl AsRef<UpdateSecretChat> for UpdateSecretChat {
7349 fn as_ref(&self) -> &UpdateSecretChat { self }
7350}
7351
7352impl AsRef<UpdateSecretChat> for RTDUpdateSecretChatBuilder {
7353 fn as_ref(&self) -> &UpdateSecretChat { &self.inner }
7354}
7355
7356
7357
7358
7359
7360
7361
7362#[derive(Debug, Clone, Default, Serialize, Deserialize)]
7364pub struct UpdateSelectedBackground {
7365 #[doc(hidden)]
7366 #[serde(rename(serialize = "@type", deserialize = "@type"))]
7367 td_name: String,
7368 #[doc(hidden)]
7369 #[serde(rename(serialize = "@extra", deserialize = "@extra"))]
7370 extra: Option<String>,
7371 for_dark_theme: bool,
7373 background: Option<Background>,
7375
7376}
7377
7378impl RObject for UpdateSelectedBackground {
7379 #[doc(hidden)] fn td_name(&self) -> &'static str { "updateSelectedBackground" }
7380 #[doc(hidden)] fn extra(&self) -> Option<String> { self.extra.clone() }
7381 fn to_json(&self) -> RTDResult<String> { Ok(serde_json::to_string(self)?) }
7382}
7383
7384
7385impl TDUpdate for UpdateSelectedBackground {}
7386
7387
7388
7389impl UpdateSelectedBackground {
7390 pub fn from_json<S: AsRef<str>>(json: S) -> RTDResult<Self> { Ok(serde_json::from_str(json.as_ref())?) }
7391 pub fn builder() -> RTDUpdateSelectedBackgroundBuilder {
7392 let mut inner = UpdateSelectedBackground::default();
7393 inner.td_name = "updateSelectedBackground".to_string();
7394 inner.extra = Some(Uuid::new_v4().to_string());
7395 RTDUpdateSelectedBackgroundBuilder { inner }
7396 }
7397
7398 pub fn for_dark_theme(&self) -> bool { self.for_dark_theme }
7399
7400 pub fn background(&self) -> &Option<Background> { &self.background }
7401
7402}
7403
7404#[doc(hidden)]
7405pub struct RTDUpdateSelectedBackgroundBuilder {
7406 inner: UpdateSelectedBackground
7407}
7408
7409impl RTDUpdateSelectedBackgroundBuilder {
7410 pub fn build(&self) -> UpdateSelectedBackground { self.inner.clone() }
7411
7412
7413 pub fn for_dark_theme(&mut self, for_dark_theme: bool) -> &mut Self {
7414 self.inner.for_dark_theme = for_dark_theme;
7415 self
7416 }
7417
7418
7419 pub fn background<T: AsRef<Background>>(&mut self, background: T) -> &mut Self {
7420 self.inner.background = Some(background.as_ref().clone());
7421 self
7422 }
7423
7424}
7425
7426impl AsRef<UpdateSelectedBackground> for UpdateSelectedBackground {
7427 fn as_ref(&self) -> &UpdateSelectedBackground { self }
7428}
7429
7430impl AsRef<UpdateSelectedBackground> for RTDUpdateSelectedBackgroundBuilder {
7431 fn as_ref(&self) -> &UpdateSelectedBackground { &self.inner }
7432}
7433
7434
7435
7436
7437
7438
7439
7440#[derive(Debug, Clone, Default, Serialize, Deserialize)]
7442pub struct UpdateServiceNotification {
7443 #[doc(hidden)]
7444 #[serde(rename(serialize = "@type", deserialize = "@type"))]
7445 td_name: String,
7446 #[doc(hidden)]
7447 #[serde(rename(serialize = "@extra", deserialize = "@extra"))]
7448 extra: Option<String>,
7449 #[serde(rename(serialize = "type", deserialize = "type"))] type_: String,
7451 content: MessageContent,
7453
7454}
7455
7456impl RObject for UpdateServiceNotification {
7457 #[doc(hidden)] fn td_name(&self) -> &'static str { "updateServiceNotification" }
7458 #[doc(hidden)] fn extra(&self) -> Option<String> { self.extra.clone() }
7459 fn to_json(&self) -> RTDResult<String> { Ok(serde_json::to_string(self)?) }
7460}
7461
7462
7463impl TDUpdate for UpdateServiceNotification {}
7464
7465
7466
7467impl UpdateServiceNotification {
7468 pub fn from_json<S: AsRef<str>>(json: S) -> RTDResult<Self> { Ok(serde_json::from_str(json.as_ref())?) }
7469 pub fn builder() -> RTDUpdateServiceNotificationBuilder {
7470 let mut inner = UpdateServiceNotification::default();
7471 inner.td_name = "updateServiceNotification".to_string();
7472 inner.extra = Some(Uuid::new_v4().to_string());
7473 RTDUpdateServiceNotificationBuilder { inner }
7474 }
7475
7476 pub fn type_(&self) -> &String { &self.type_ }
7477
7478 pub fn content(&self) -> &MessageContent { &self.content }
7479
7480}
7481
7482#[doc(hidden)]
7483pub struct RTDUpdateServiceNotificationBuilder {
7484 inner: UpdateServiceNotification
7485}
7486
7487impl RTDUpdateServiceNotificationBuilder {
7488 pub fn build(&self) -> UpdateServiceNotification { self.inner.clone() }
7489
7490
7491 pub fn type_<T: AsRef<str>>(&mut self, type_: T) -> &mut Self {
7492 self.inner.type_ = type_.as_ref().to_string();
7493 self
7494 }
7495
7496
7497 pub fn content<T: AsRef<MessageContent>>(&mut self, content: T) -> &mut Self {
7498 self.inner.content = content.as_ref().clone();
7499 self
7500 }
7501
7502}
7503
7504impl AsRef<UpdateServiceNotification> for UpdateServiceNotification {
7505 fn as_ref(&self) -> &UpdateServiceNotification { self }
7506}
7507
7508impl AsRef<UpdateServiceNotification> for RTDUpdateServiceNotificationBuilder {
7509 fn as_ref(&self) -> &UpdateServiceNotification { &self.inner }
7510}
7511
7512
7513
7514
7515
7516
7517
7518#[derive(Debug, Clone, Default, Serialize, Deserialize)]
7520pub struct UpdateStickerSet {
7521 #[doc(hidden)]
7522 #[serde(rename(serialize = "@type", deserialize = "@type"))]
7523 td_name: String,
7524 #[doc(hidden)]
7525 #[serde(rename(serialize = "@extra", deserialize = "@extra"))]
7526 extra: Option<String>,
7527 sticker_set: StickerSet,
7529
7530}
7531
7532impl RObject for UpdateStickerSet {
7533 #[doc(hidden)] fn td_name(&self) -> &'static str { "updateStickerSet" }
7534 #[doc(hidden)] fn extra(&self) -> Option<String> { self.extra.clone() }
7535 fn to_json(&self) -> RTDResult<String> { Ok(serde_json::to_string(self)?) }
7536}
7537
7538
7539impl TDUpdate for UpdateStickerSet {}
7540
7541
7542
7543impl UpdateStickerSet {
7544 pub fn from_json<S: AsRef<str>>(json: S) -> RTDResult<Self> { Ok(serde_json::from_str(json.as_ref())?) }
7545 pub fn builder() -> RTDUpdateStickerSetBuilder {
7546 let mut inner = UpdateStickerSet::default();
7547 inner.td_name = "updateStickerSet".to_string();
7548 inner.extra = Some(Uuid::new_v4().to_string());
7549 RTDUpdateStickerSetBuilder { inner }
7550 }
7551
7552 pub fn sticker_set(&self) -> &StickerSet { &self.sticker_set }
7553
7554}
7555
7556#[doc(hidden)]
7557pub struct RTDUpdateStickerSetBuilder {
7558 inner: UpdateStickerSet
7559}
7560
7561impl RTDUpdateStickerSetBuilder {
7562 pub fn build(&self) -> UpdateStickerSet { self.inner.clone() }
7563
7564
7565 pub fn sticker_set<T: AsRef<StickerSet>>(&mut self, sticker_set: T) -> &mut Self {
7566 self.inner.sticker_set = sticker_set.as_ref().clone();
7567 self
7568 }
7569
7570}
7571
7572impl AsRef<UpdateStickerSet> for UpdateStickerSet {
7573 fn as_ref(&self) -> &UpdateStickerSet { self }
7574}
7575
7576impl AsRef<UpdateStickerSet> for RTDUpdateStickerSetBuilder {
7577 fn as_ref(&self) -> &UpdateStickerSet { &self.inner }
7578}
7579
7580
7581
7582
7583
7584
7585
7586#[derive(Debug, Clone, Default, Serialize, Deserialize)]
7588pub struct UpdateSuggestedActions {
7589 #[doc(hidden)]
7590 #[serde(rename(serialize = "@type", deserialize = "@type"))]
7591 td_name: String,
7592 #[doc(hidden)]
7593 #[serde(rename(serialize = "@extra", deserialize = "@extra"))]
7594 extra: Option<String>,
7595 added_actions: Vec<SuggestedAction>,
7597 removed_actions: Vec<SuggestedAction>,
7599
7600}
7601
7602impl RObject for UpdateSuggestedActions {
7603 #[doc(hidden)] fn td_name(&self) -> &'static str { "updateSuggestedActions" }
7604 #[doc(hidden)] fn extra(&self) -> Option<String> { self.extra.clone() }
7605 fn to_json(&self) -> RTDResult<String> { Ok(serde_json::to_string(self)?) }
7606}
7607
7608
7609impl TDUpdate for UpdateSuggestedActions {}
7610
7611
7612
7613impl UpdateSuggestedActions {
7614 pub fn from_json<S: AsRef<str>>(json: S) -> RTDResult<Self> { Ok(serde_json::from_str(json.as_ref())?) }
7615 pub fn builder() -> RTDUpdateSuggestedActionsBuilder {
7616 let mut inner = UpdateSuggestedActions::default();
7617 inner.td_name = "updateSuggestedActions".to_string();
7618 inner.extra = Some(Uuid::new_v4().to_string());
7619 RTDUpdateSuggestedActionsBuilder { inner }
7620 }
7621
7622 pub fn added_actions(&self) -> &Vec<SuggestedAction> { &self.added_actions }
7623
7624 pub fn removed_actions(&self) -> &Vec<SuggestedAction> { &self.removed_actions }
7625
7626}
7627
7628#[doc(hidden)]
7629pub struct RTDUpdateSuggestedActionsBuilder {
7630 inner: UpdateSuggestedActions
7631}
7632
7633impl RTDUpdateSuggestedActionsBuilder {
7634 pub fn build(&self) -> UpdateSuggestedActions { self.inner.clone() }
7635
7636
7637 pub fn added_actions(&mut self, added_actions: Vec<SuggestedAction>) -> &mut Self {
7638 self.inner.added_actions = added_actions;
7639 self
7640 }
7641
7642
7643 pub fn removed_actions(&mut self, removed_actions: Vec<SuggestedAction>) -> &mut Self {
7644 self.inner.removed_actions = removed_actions;
7645 self
7646 }
7647
7648}
7649
7650impl AsRef<UpdateSuggestedActions> for UpdateSuggestedActions {
7651 fn as_ref(&self) -> &UpdateSuggestedActions { self }
7652}
7653
7654impl AsRef<UpdateSuggestedActions> for RTDUpdateSuggestedActionsBuilder {
7655 fn as_ref(&self) -> &UpdateSuggestedActions { &self.inner }
7656}
7657
7658
7659
7660
7661
7662
7663
7664#[derive(Debug, Clone, Default, Serialize, Deserialize)]
7666pub struct UpdateSupergroup {
7667 #[doc(hidden)]
7668 #[serde(rename(serialize = "@type", deserialize = "@type"))]
7669 td_name: String,
7670 #[doc(hidden)]
7671 #[serde(rename(serialize = "@extra", deserialize = "@extra"))]
7672 extra: Option<String>,
7673 supergroup: Supergroup,
7675
7676}
7677
7678impl RObject for UpdateSupergroup {
7679 #[doc(hidden)] fn td_name(&self) -> &'static str { "updateSupergroup" }
7680 #[doc(hidden)] fn extra(&self) -> Option<String> { self.extra.clone() }
7681 fn to_json(&self) -> RTDResult<String> { Ok(serde_json::to_string(self)?) }
7682}
7683
7684
7685impl TDUpdate for UpdateSupergroup {}
7686
7687
7688
7689impl UpdateSupergroup {
7690 pub fn from_json<S: AsRef<str>>(json: S) -> RTDResult<Self> { Ok(serde_json::from_str(json.as_ref())?) }
7691 pub fn builder() -> RTDUpdateSupergroupBuilder {
7692 let mut inner = UpdateSupergroup::default();
7693 inner.td_name = "updateSupergroup".to_string();
7694 inner.extra = Some(Uuid::new_v4().to_string());
7695 RTDUpdateSupergroupBuilder { inner }
7696 }
7697
7698 pub fn supergroup(&self) -> &Supergroup { &self.supergroup }
7699
7700}
7701
7702#[doc(hidden)]
7703pub struct RTDUpdateSupergroupBuilder {
7704 inner: UpdateSupergroup
7705}
7706
7707impl RTDUpdateSupergroupBuilder {
7708 pub fn build(&self) -> UpdateSupergroup { self.inner.clone() }
7709
7710
7711 pub fn supergroup<T: AsRef<Supergroup>>(&mut self, supergroup: T) -> &mut Self {
7712 self.inner.supergroup = supergroup.as_ref().clone();
7713 self
7714 }
7715
7716}
7717
7718impl AsRef<UpdateSupergroup> for UpdateSupergroup {
7719 fn as_ref(&self) -> &UpdateSupergroup { self }
7720}
7721
7722impl AsRef<UpdateSupergroup> for RTDUpdateSupergroupBuilder {
7723 fn as_ref(&self) -> &UpdateSupergroup { &self.inner }
7724}
7725
7726
7727
7728
7729
7730
7731
7732#[derive(Debug, Clone, Default, Serialize, Deserialize)]
7734pub struct UpdateSupergroupFullInfo {
7735 #[doc(hidden)]
7736 #[serde(rename(serialize = "@type", deserialize = "@type"))]
7737 td_name: String,
7738 #[doc(hidden)]
7739 #[serde(rename(serialize = "@extra", deserialize = "@extra"))]
7740 extra: Option<String>,
7741 #[serde(deserialize_with = "serde_aux::field_attributes::deserialize_number_from_string")] supergroup_id: i64,
7743 supergroup_full_info: SupergroupFullInfo,
7745
7746}
7747
7748impl RObject for UpdateSupergroupFullInfo {
7749 #[doc(hidden)] fn td_name(&self) -> &'static str { "updateSupergroupFullInfo" }
7750 #[doc(hidden)] fn extra(&self) -> Option<String> { self.extra.clone() }
7751 fn to_json(&self) -> RTDResult<String> { Ok(serde_json::to_string(self)?) }
7752}
7753
7754
7755impl TDUpdate for UpdateSupergroupFullInfo {}
7756
7757
7758
7759impl UpdateSupergroupFullInfo {
7760 pub fn from_json<S: AsRef<str>>(json: S) -> RTDResult<Self> { Ok(serde_json::from_str(json.as_ref())?) }
7761 pub fn builder() -> RTDUpdateSupergroupFullInfoBuilder {
7762 let mut inner = UpdateSupergroupFullInfo::default();
7763 inner.td_name = "updateSupergroupFullInfo".to_string();
7764 inner.extra = Some(Uuid::new_v4().to_string());
7765 RTDUpdateSupergroupFullInfoBuilder { inner }
7766 }
7767
7768 pub fn supergroup_id(&self) -> i64 { self.supergroup_id }
7769
7770 pub fn supergroup_full_info(&self) -> &SupergroupFullInfo { &self.supergroup_full_info }
7771
7772}
7773
7774#[doc(hidden)]
7775pub struct RTDUpdateSupergroupFullInfoBuilder {
7776 inner: UpdateSupergroupFullInfo
7777}
7778
7779impl RTDUpdateSupergroupFullInfoBuilder {
7780 pub fn build(&self) -> UpdateSupergroupFullInfo { self.inner.clone() }
7781
7782
7783 pub fn supergroup_id(&mut self, supergroup_id: i64) -> &mut Self {
7784 self.inner.supergroup_id = supergroup_id;
7785 self
7786 }
7787
7788
7789 pub fn supergroup_full_info<T: AsRef<SupergroupFullInfo>>(&mut self, supergroup_full_info: T) -> &mut Self {
7790 self.inner.supergroup_full_info = supergroup_full_info.as_ref().clone();
7791 self
7792 }
7793
7794}
7795
7796impl AsRef<UpdateSupergroupFullInfo> for UpdateSupergroupFullInfo {
7797 fn as_ref(&self) -> &UpdateSupergroupFullInfo { self }
7798}
7799
7800impl AsRef<UpdateSupergroupFullInfo> for RTDUpdateSupergroupFullInfoBuilder {
7801 fn as_ref(&self) -> &UpdateSupergroupFullInfo { &self.inner }
7802}
7803
7804
7805
7806
7807
7808
7809
7810#[derive(Debug, Clone, Default, Serialize, Deserialize)]
7812pub struct UpdateTermsOfService {
7813 #[doc(hidden)]
7814 #[serde(rename(serialize = "@type", deserialize = "@type"))]
7815 td_name: String,
7816 #[doc(hidden)]
7817 #[serde(rename(serialize = "@extra", deserialize = "@extra"))]
7818 extra: Option<String>,
7819 terms_of_service_id: String,
7821 terms_of_service: TermsOfService,
7823
7824}
7825
7826impl RObject for UpdateTermsOfService {
7827 #[doc(hidden)] fn td_name(&self) -> &'static str { "updateTermsOfService" }
7828 #[doc(hidden)] fn extra(&self) -> Option<String> { self.extra.clone() }
7829 fn to_json(&self) -> RTDResult<String> { Ok(serde_json::to_string(self)?) }
7830}
7831
7832
7833impl TDUpdate for UpdateTermsOfService {}
7834
7835
7836
7837impl UpdateTermsOfService {
7838 pub fn from_json<S: AsRef<str>>(json: S) -> RTDResult<Self> { Ok(serde_json::from_str(json.as_ref())?) }
7839 pub fn builder() -> RTDUpdateTermsOfServiceBuilder {
7840 let mut inner = UpdateTermsOfService::default();
7841 inner.td_name = "updateTermsOfService".to_string();
7842 inner.extra = Some(Uuid::new_v4().to_string());
7843 RTDUpdateTermsOfServiceBuilder { inner }
7844 }
7845
7846 pub fn terms_of_service_id(&self) -> &String { &self.terms_of_service_id }
7847
7848 pub fn terms_of_service(&self) -> &TermsOfService { &self.terms_of_service }
7849
7850}
7851
7852#[doc(hidden)]
7853pub struct RTDUpdateTermsOfServiceBuilder {
7854 inner: UpdateTermsOfService
7855}
7856
7857impl RTDUpdateTermsOfServiceBuilder {
7858 pub fn build(&self) -> UpdateTermsOfService { self.inner.clone() }
7859
7860
7861 pub fn terms_of_service_id<T: AsRef<str>>(&mut self, terms_of_service_id: T) -> &mut Self {
7862 self.inner.terms_of_service_id = terms_of_service_id.as_ref().to_string();
7863 self
7864 }
7865
7866
7867 pub fn terms_of_service<T: AsRef<TermsOfService>>(&mut self, terms_of_service: T) -> &mut Self {
7868 self.inner.terms_of_service = terms_of_service.as_ref().clone();
7869 self
7870 }
7871
7872}
7873
7874impl AsRef<UpdateTermsOfService> for UpdateTermsOfService {
7875 fn as_ref(&self) -> &UpdateTermsOfService { self }
7876}
7877
7878impl AsRef<UpdateTermsOfService> for RTDUpdateTermsOfServiceBuilder {
7879 fn as_ref(&self) -> &UpdateTermsOfService { &self.inner }
7880}
7881
7882
7883
7884
7885
7886
7887
7888#[derive(Debug, Clone, Default, Serialize, Deserialize)]
7890pub struct UpdateTrendingStickerSets {
7891 #[doc(hidden)]
7892 #[serde(rename(serialize = "@type", deserialize = "@type"))]
7893 td_name: String,
7894 #[doc(hidden)]
7895 #[serde(rename(serialize = "@extra", deserialize = "@extra"))]
7896 extra: Option<String>,
7897 sticker_sets: StickerSets,
7899
7900}
7901
7902impl RObject for UpdateTrendingStickerSets {
7903 #[doc(hidden)] fn td_name(&self) -> &'static str { "updateTrendingStickerSets" }
7904 #[doc(hidden)] fn extra(&self) -> Option<String> { self.extra.clone() }
7905 fn to_json(&self) -> RTDResult<String> { Ok(serde_json::to_string(self)?) }
7906}
7907
7908
7909impl TDUpdate for UpdateTrendingStickerSets {}
7910
7911
7912
7913impl UpdateTrendingStickerSets {
7914 pub fn from_json<S: AsRef<str>>(json: S) -> RTDResult<Self> { Ok(serde_json::from_str(json.as_ref())?) }
7915 pub fn builder() -> RTDUpdateTrendingStickerSetsBuilder {
7916 let mut inner = UpdateTrendingStickerSets::default();
7917 inner.td_name = "updateTrendingStickerSets".to_string();
7918 inner.extra = Some(Uuid::new_v4().to_string());
7919 RTDUpdateTrendingStickerSetsBuilder { inner }
7920 }
7921
7922 pub fn sticker_sets(&self) -> &StickerSets { &self.sticker_sets }
7923
7924}
7925
7926#[doc(hidden)]
7927pub struct RTDUpdateTrendingStickerSetsBuilder {
7928 inner: UpdateTrendingStickerSets
7929}
7930
7931impl RTDUpdateTrendingStickerSetsBuilder {
7932 pub fn build(&self) -> UpdateTrendingStickerSets { self.inner.clone() }
7933
7934
7935 pub fn sticker_sets<T: AsRef<StickerSets>>(&mut self, sticker_sets: T) -> &mut Self {
7936 self.inner.sticker_sets = sticker_sets.as_ref().clone();
7937 self
7938 }
7939
7940}
7941
7942impl AsRef<UpdateTrendingStickerSets> for UpdateTrendingStickerSets {
7943 fn as_ref(&self) -> &UpdateTrendingStickerSets { self }
7944}
7945
7946impl AsRef<UpdateTrendingStickerSets> for RTDUpdateTrendingStickerSetsBuilder {
7947 fn as_ref(&self) -> &UpdateTrendingStickerSets { &self.inner }
7948}
7949
7950
7951
7952
7953
7954
7955
7956#[derive(Debug, Clone, Default, Serialize, Deserialize)]
7958pub struct UpdateUnreadChatCount {
7959 #[doc(hidden)]
7960 #[serde(rename(serialize = "@type", deserialize = "@type"))]
7961 td_name: String,
7962 #[doc(hidden)]
7963 #[serde(rename(serialize = "@extra", deserialize = "@extra"))]
7964 extra: Option<String>,
7965 chat_list: ChatList,
7967 total_count: i64,
7969 unread_count: i64,
7971 unread_unmuted_count: i64,
7973 marked_as_unread_count: i64,
7975 marked_as_unread_unmuted_count: i64,
7977
7978}
7979
7980impl RObject for UpdateUnreadChatCount {
7981 #[doc(hidden)] fn td_name(&self) -> &'static str { "updateUnreadChatCount" }
7982 #[doc(hidden)] fn extra(&self) -> Option<String> { self.extra.clone() }
7983 fn to_json(&self) -> RTDResult<String> { Ok(serde_json::to_string(self)?) }
7984}
7985
7986
7987impl TDUpdate for UpdateUnreadChatCount {}
7988
7989
7990
7991impl UpdateUnreadChatCount {
7992 pub fn from_json<S: AsRef<str>>(json: S) -> RTDResult<Self> { Ok(serde_json::from_str(json.as_ref())?) }
7993 pub fn builder() -> RTDUpdateUnreadChatCountBuilder {
7994 let mut inner = UpdateUnreadChatCount::default();
7995 inner.td_name = "updateUnreadChatCount".to_string();
7996 inner.extra = Some(Uuid::new_v4().to_string());
7997 RTDUpdateUnreadChatCountBuilder { inner }
7998 }
7999
8000 pub fn chat_list(&self) -> &ChatList { &self.chat_list }
8001
8002 pub fn total_count(&self) -> i64 { self.total_count }
8003
8004 pub fn unread_count(&self) -> i64 { self.unread_count }
8005
8006 pub fn unread_unmuted_count(&self) -> i64 { self.unread_unmuted_count }
8007
8008 pub fn marked_as_unread_count(&self) -> i64 { self.marked_as_unread_count }
8009
8010 pub fn marked_as_unread_unmuted_count(&self) -> i64 { self.marked_as_unread_unmuted_count }
8011
8012}
8013
8014#[doc(hidden)]
8015pub struct RTDUpdateUnreadChatCountBuilder {
8016 inner: UpdateUnreadChatCount
8017}
8018
8019impl RTDUpdateUnreadChatCountBuilder {
8020 pub fn build(&self) -> UpdateUnreadChatCount { self.inner.clone() }
8021
8022
8023 pub fn chat_list<T: AsRef<ChatList>>(&mut self, chat_list: T) -> &mut Self {
8024 self.inner.chat_list = chat_list.as_ref().clone();
8025 self
8026 }
8027
8028
8029 pub fn total_count(&mut self, total_count: i64) -> &mut Self {
8030 self.inner.total_count = total_count;
8031 self
8032 }
8033
8034
8035 pub fn unread_count(&mut self, unread_count: i64) -> &mut Self {
8036 self.inner.unread_count = unread_count;
8037 self
8038 }
8039
8040
8041 pub fn unread_unmuted_count(&mut self, unread_unmuted_count: i64) -> &mut Self {
8042 self.inner.unread_unmuted_count = unread_unmuted_count;
8043 self
8044 }
8045
8046
8047 pub fn marked_as_unread_count(&mut self, marked_as_unread_count: i64) -> &mut Self {
8048 self.inner.marked_as_unread_count = marked_as_unread_count;
8049 self
8050 }
8051
8052
8053 pub fn marked_as_unread_unmuted_count(&mut self, marked_as_unread_unmuted_count: i64) -> &mut Self {
8054 self.inner.marked_as_unread_unmuted_count = marked_as_unread_unmuted_count;
8055 self
8056 }
8057
8058}
8059
8060impl AsRef<UpdateUnreadChatCount> for UpdateUnreadChatCount {
8061 fn as_ref(&self) -> &UpdateUnreadChatCount { self }
8062}
8063
8064impl AsRef<UpdateUnreadChatCount> for RTDUpdateUnreadChatCountBuilder {
8065 fn as_ref(&self) -> &UpdateUnreadChatCount { &self.inner }
8066}
8067
8068
8069
8070
8071
8072
8073
8074#[derive(Debug, Clone, Default, Serialize, Deserialize)]
8076pub struct UpdateUnreadMessageCount {
8077 #[doc(hidden)]
8078 #[serde(rename(serialize = "@type", deserialize = "@type"))]
8079 td_name: String,
8080 #[doc(hidden)]
8081 #[serde(rename(serialize = "@extra", deserialize = "@extra"))]
8082 extra: Option<String>,
8083 chat_list: ChatList,
8085 unread_count: i64,
8087 unread_unmuted_count: i64,
8089
8090}
8091
8092impl RObject for UpdateUnreadMessageCount {
8093 #[doc(hidden)] fn td_name(&self) -> &'static str { "updateUnreadMessageCount" }
8094 #[doc(hidden)] fn extra(&self) -> Option<String> { self.extra.clone() }
8095 fn to_json(&self) -> RTDResult<String> { Ok(serde_json::to_string(self)?) }
8096}
8097
8098
8099impl TDUpdate for UpdateUnreadMessageCount {}
8100
8101
8102
8103impl UpdateUnreadMessageCount {
8104 pub fn from_json<S: AsRef<str>>(json: S) -> RTDResult<Self> { Ok(serde_json::from_str(json.as_ref())?) }
8105 pub fn builder() -> RTDUpdateUnreadMessageCountBuilder {
8106 let mut inner = UpdateUnreadMessageCount::default();
8107 inner.td_name = "updateUnreadMessageCount".to_string();
8108 inner.extra = Some(Uuid::new_v4().to_string());
8109 RTDUpdateUnreadMessageCountBuilder { inner }
8110 }
8111
8112 pub fn chat_list(&self) -> &ChatList { &self.chat_list }
8113
8114 pub fn unread_count(&self) -> i64 { self.unread_count }
8115
8116 pub fn unread_unmuted_count(&self) -> i64 { self.unread_unmuted_count }
8117
8118}
8119
8120#[doc(hidden)]
8121pub struct RTDUpdateUnreadMessageCountBuilder {
8122 inner: UpdateUnreadMessageCount
8123}
8124
8125impl RTDUpdateUnreadMessageCountBuilder {
8126 pub fn build(&self) -> UpdateUnreadMessageCount { self.inner.clone() }
8127
8128
8129 pub fn chat_list<T: AsRef<ChatList>>(&mut self, chat_list: T) -> &mut Self {
8130 self.inner.chat_list = chat_list.as_ref().clone();
8131 self
8132 }
8133
8134
8135 pub fn unread_count(&mut self, unread_count: i64) -> &mut Self {
8136 self.inner.unread_count = unread_count;
8137 self
8138 }
8139
8140
8141 pub fn unread_unmuted_count(&mut self, unread_unmuted_count: i64) -> &mut Self {
8142 self.inner.unread_unmuted_count = unread_unmuted_count;
8143 self
8144 }
8145
8146}
8147
8148impl AsRef<UpdateUnreadMessageCount> for UpdateUnreadMessageCount {
8149 fn as_ref(&self) -> &UpdateUnreadMessageCount { self }
8150}
8151
8152impl AsRef<UpdateUnreadMessageCount> for RTDUpdateUnreadMessageCountBuilder {
8153 fn as_ref(&self) -> &UpdateUnreadMessageCount { &self.inner }
8154}
8155
8156
8157
8158
8159
8160
8161
8162#[derive(Debug, Clone, Default, Serialize, Deserialize)]
8164pub struct UpdateUser {
8165 #[doc(hidden)]
8166 #[serde(rename(serialize = "@type", deserialize = "@type"))]
8167 td_name: String,
8168 #[doc(hidden)]
8169 #[serde(rename(serialize = "@extra", deserialize = "@extra"))]
8170 extra: Option<String>,
8171 user: User,
8173
8174}
8175
8176impl RObject for UpdateUser {
8177 #[doc(hidden)] fn td_name(&self) -> &'static str { "updateUser" }
8178 #[doc(hidden)] fn extra(&self) -> Option<String> { self.extra.clone() }
8179 fn to_json(&self) -> RTDResult<String> { Ok(serde_json::to_string(self)?) }
8180}
8181
8182
8183impl TDUpdate for UpdateUser {}
8184
8185
8186
8187impl UpdateUser {
8188 pub fn from_json<S: AsRef<str>>(json: S) -> RTDResult<Self> { Ok(serde_json::from_str(json.as_ref())?) }
8189 pub fn builder() -> RTDUpdateUserBuilder {
8190 let mut inner = UpdateUser::default();
8191 inner.td_name = "updateUser".to_string();
8192 inner.extra = Some(Uuid::new_v4().to_string());
8193 RTDUpdateUserBuilder { inner }
8194 }
8195
8196 pub fn user(&self) -> &User { &self.user }
8197
8198}
8199
8200#[doc(hidden)]
8201pub struct RTDUpdateUserBuilder {
8202 inner: UpdateUser
8203}
8204
8205impl RTDUpdateUserBuilder {
8206 pub fn build(&self) -> UpdateUser { self.inner.clone() }
8207
8208
8209 pub fn user<T: AsRef<User>>(&mut self, user: T) -> &mut Self {
8210 self.inner.user = user.as_ref().clone();
8211 self
8212 }
8213
8214}
8215
8216impl AsRef<UpdateUser> for UpdateUser {
8217 fn as_ref(&self) -> &UpdateUser { self }
8218}
8219
8220impl AsRef<UpdateUser> for RTDUpdateUserBuilder {
8221 fn as_ref(&self) -> &UpdateUser { &self.inner }
8222}
8223
8224
8225
8226
8227
8228
8229
8230#[derive(Debug, Clone, Default, Serialize, Deserialize)]
8232pub struct UpdateUserFullInfo {
8233 #[doc(hidden)]
8234 #[serde(rename(serialize = "@type", deserialize = "@type"))]
8235 td_name: String,
8236 #[doc(hidden)]
8237 #[serde(rename(serialize = "@extra", deserialize = "@extra"))]
8238 extra: Option<String>,
8239 user_id: i64,
8241 user_full_info: UserFullInfo,
8243
8244}
8245
8246impl RObject for UpdateUserFullInfo {
8247 #[doc(hidden)] fn td_name(&self) -> &'static str { "updateUserFullInfo" }
8248 #[doc(hidden)] fn extra(&self) -> Option<String> { self.extra.clone() }
8249 fn to_json(&self) -> RTDResult<String> { Ok(serde_json::to_string(self)?) }
8250}
8251
8252
8253impl TDUpdate for UpdateUserFullInfo {}
8254
8255
8256
8257impl UpdateUserFullInfo {
8258 pub fn from_json<S: AsRef<str>>(json: S) -> RTDResult<Self> { Ok(serde_json::from_str(json.as_ref())?) }
8259 pub fn builder() -> RTDUpdateUserFullInfoBuilder {
8260 let mut inner = UpdateUserFullInfo::default();
8261 inner.td_name = "updateUserFullInfo".to_string();
8262 inner.extra = Some(Uuid::new_v4().to_string());
8263 RTDUpdateUserFullInfoBuilder { inner }
8264 }
8265
8266 pub fn user_id(&self) -> i64 { self.user_id }
8267
8268 pub fn user_full_info(&self) -> &UserFullInfo { &self.user_full_info }
8269
8270}
8271
8272#[doc(hidden)]
8273pub struct RTDUpdateUserFullInfoBuilder {
8274 inner: UpdateUserFullInfo
8275}
8276
8277impl RTDUpdateUserFullInfoBuilder {
8278 pub fn build(&self) -> UpdateUserFullInfo { self.inner.clone() }
8279
8280
8281 pub fn user_id(&mut self, user_id: i64) -> &mut Self {
8282 self.inner.user_id = user_id;
8283 self
8284 }
8285
8286
8287 pub fn user_full_info<T: AsRef<UserFullInfo>>(&mut self, user_full_info: T) -> &mut Self {
8288 self.inner.user_full_info = user_full_info.as_ref().clone();
8289 self
8290 }
8291
8292}
8293
8294impl AsRef<UpdateUserFullInfo> for UpdateUserFullInfo {
8295 fn as_ref(&self) -> &UpdateUserFullInfo { self }
8296}
8297
8298impl AsRef<UpdateUserFullInfo> for RTDUpdateUserFullInfoBuilder {
8299 fn as_ref(&self) -> &UpdateUserFullInfo { &self.inner }
8300}
8301
8302
8303
8304
8305
8306
8307
8308#[derive(Debug, Clone, Default, Serialize, Deserialize)]
8310pub struct UpdateUserPrivacySettingRules {
8311 #[doc(hidden)]
8312 #[serde(rename(serialize = "@type", deserialize = "@type"))]
8313 td_name: String,
8314 #[doc(hidden)]
8315 #[serde(rename(serialize = "@extra", deserialize = "@extra"))]
8316 extra: Option<String>,
8317 setting: UserPrivacySetting,
8319 rules: UserPrivacySettingRules,
8321
8322}
8323
8324impl RObject for UpdateUserPrivacySettingRules {
8325 #[doc(hidden)] fn td_name(&self) -> &'static str { "updateUserPrivacySettingRules" }
8326 #[doc(hidden)] fn extra(&self) -> Option<String> { self.extra.clone() }
8327 fn to_json(&self) -> RTDResult<String> { Ok(serde_json::to_string(self)?) }
8328}
8329
8330
8331impl TDUpdate for UpdateUserPrivacySettingRules {}
8332
8333
8334
8335impl UpdateUserPrivacySettingRules {
8336 pub fn from_json<S: AsRef<str>>(json: S) -> RTDResult<Self> { Ok(serde_json::from_str(json.as_ref())?) }
8337 pub fn builder() -> RTDUpdateUserPrivacySettingRulesBuilder {
8338 let mut inner = UpdateUserPrivacySettingRules::default();
8339 inner.td_name = "updateUserPrivacySettingRules".to_string();
8340 inner.extra = Some(Uuid::new_v4().to_string());
8341 RTDUpdateUserPrivacySettingRulesBuilder { inner }
8342 }
8343
8344 pub fn setting(&self) -> &UserPrivacySetting { &self.setting }
8345
8346 pub fn rules(&self) -> &UserPrivacySettingRules { &self.rules }
8347
8348}
8349
8350#[doc(hidden)]
8351pub struct RTDUpdateUserPrivacySettingRulesBuilder {
8352 inner: UpdateUserPrivacySettingRules
8353}
8354
8355impl RTDUpdateUserPrivacySettingRulesBuilder {
8356 pub fn build(&self) -> UpdateUserPrivacySettingRules { self.inner.clone() }
8357
8358
8359 pub fn setting<T: AsRef<UserPrivacySetting>>(&mut self, setting: T) -> &mut Self {
8360 self.inner.setting = setting.as_ref().clone();
8361 self
8362 }
8363
8364
8365 pub fn rules<T: AsRef<UserPrivacySettingRules>>(&mut self, rules: T) -> &mut Self {
8366 self.inner.rules = rules.as_ref().clone();
8367 self
8368 }
8369
8370}
8371
8372impl AsRef<UpdateUserPrivacySettingRules> for UpdateUserPrivacySettingRules {
8373 fn as_ref(&self) -> &UpdateUserPrivacySettingRules { self }
8374}
8375
8376impl AsRef<UpdateUserPrivacySettingRules> for RTDUpdateUserPrivacySettingRulesBuilder {
8377 fn as_ref(&self) -> &UpdateUserPrivacySettingRules { &self.inner }
8378}
8379
8380
8381
8382
8383
8384
8385
8386#[derive(Debug, Clone, Default, Serialize, Deserialize)]
8388pub struct UpdateUserStatus {
8389 #[doc(hidden)]
8390 #[serde(rename(serialize = "@type", deserialize = "@type"))]
8391 td_name: String,
8392 #[doc(hidden)]
8393 #[serde(rename(serialize = "@extra", deserialize = "@extra"))]
8394 extra: Option<String>,
8395 user_id: i64,
8397 status: UserStatus,
8399
8400}
8401
8402impl RObject for UpdateUserStatus {
8403 #[doc(hidden)] fn td_name(&self) -> &'static str { "updateUserStatus" }
8404 #[doc(hidden)] fn extra(&self) -> Option<String> { self.extra.clone() }
8405 fn to_json(&self) -> RTDResult<String> { Ok(serde_json::to_string(self)?) }
8406}
8407
8408
8409impl TDUpdate for UpdateUserStatus {}
8410
8411
8412
8413impl UpdateUserStatus {
8414 pub fn from_json<S: AsRef<str>>(json: S) -> RTDResult<Self> { Ok(serde_json::from_str(json.as_ref())?) }
8415 pub fn builder() -> RTDUpdateUserStatusBuilder {
8416 let mut inner = UpdateUserStatus::default();
8417 inner.td_name = "updateUserStatus".to_string();
8418 inner.extra = Some(Uuid::new_v4().to_string());
8419 RTDUpdateUserStatusBuilder { inner }
8420 }
8421
8422 pub fn user_id(&self) -> i64 { self.user_id }
8423
8424 pub fn status(&self) -> &UserStatus { &self.status }
8425
8426}
8427
8428#[doc(hidden)]
8429pub struct RTDUpdateUserStatusBuilder {
8430 inner: UpdateUserStatus
8431}
8432
8433impl RTDUpdateUserStatusBuilder {
8434 pub fn build(&self) -> UpdateUserStatus { self.inner.clone() }
8435
8436
8437 pub fn user_id(&mut self, user_id: i64) -> &mut Self {
8438 self.inner.user_id = user_id;
8439 self
8440 }
8441
8442
8443 pub fn status<T: AsRef<UserStatus>>(&mut self, status: T) -> &mut Self {
8444 self.inner.status = status.as_ref().clone();
8445 self
8446 }
8447
8448}
8449
8450impl AsRef<UpdateUserStatus> for UpdateUserStatus {
8451 fn as_ref(&self) -> &UpdateUserStatus { self }
8452}
8453
8454impl AsRef<UpdateUserStatus> for RTDUpdateUserStatusBuilder {
8455 fn as_ref(&self) -> &UpdateUserStatus { &self.inner }
8456}
8457
8458
8459
8460
8461
8462
8463
8464#[derive(Debug, Clone, Default, Serialize, Deserialize)]
8466pub struct UpdateUsersNearby {
8467 #[doc(hidden)]
8468 #[serde(rename(serialize = "@type", deserialize = "@type"))]
8469 td_name: String,
8470 #[doc(hidden)]
8471 #[serde(rename(serialize = "@extra", deserialize = "@extra"))]
8472 extra: Option<String>,
8473 users_nearby: Vec<ChatNearby>,
8475
8476}
8477
8478impl RObject for UpdateUsersNearby {
8479 #[doc(hidden)] fn td_name(&self) -> &'static str { "updateUsersNearby" }
8480 #[doc(hidden)] fn extra(&self) -> Option<String> { self.extra.clone() }
8481 fn to_json(&self) -> RTDResult<String> { Ok(serde_json::to_string(self)?) }
8482}
8483
8484
8485impl TDUpdate for UpdateUsersNearby {}
8486
8487
8488
8489impl UpdateUsersNearby {
8490 pub fn from_json<S: AsRef<str>>(json: S) -> RTDResult<Self> { Ok(serde_json::from_str(json.as_ref())?) }
8491 pub fn builder() -> RTDUpdateUsersNearbyBuilder {
8492 let mut inner = UpdateUsersNearby::default();
8493 inner.td_name = "updateUsersNearby".to_string();
8494 inner.extra = Some(Uuid::new_v4().to_string());
8495 RTDUpdateUsersNearbyBuilder { inner }
8496 }
8497
8498 pub fn users_nearby(&self) -> &Vec<ChatNearby> { &self.users_nearby }
8499
8500}
8501
8502#[doc(hidden)]
8503pub struct RTDUpdateUsersNearbyBuilder {
8504 inner: UpdateUsersNearby
8505}
8506
8507impl RTDUpdateUsersNearbyBuilder {
8508 pub fn build(&self) -> UpdateUsersNearby { self.inner.clone() }
8509
8510
8511 pub fn users_nearby(&mut self, users_nearby: Vec<ChatNearby>) -> &mut Self {
8512 self.inner.users_nearby = users_nearby;
8513 self
8514 }
8515
8516}
8517
8518impl AsRef<UpdateUsersNearby> for UpdateUsersNearby {
8519 fn as_ref(&self) -> &UpdateUsersNearby { self }
8520}
8521
8522impl AsRef<UpdateUsersNearby> for RTDUpdateUsersNearbyBuilder {
8523 fn as_ref(&self) -> &UpdateUsersNearby { &self.inner }
8524}
8525
8526
8527