rust_tdlib/types/
update.rs

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