atrium-api 0.26.0

API library for AT Protocol (Bluesky)
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
// @generated - This file is generated by atrium-codegen. DO NOT EDIT.
//!Definitions for the `chat.bsky.convo.defs` namespace.
pub type ConvoKind = String;
pub type ConvoLockStatus = String;
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct ConvoRefData {
    pub convo_id: String,
    pub did: crate::types::string::Did,
}
pub type ConvoRef = crate::types::Object<ConvoRefData>;
pub type ConvoStatus = String;
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct ConvoViewData {
    pub id: String,
    ///Union field that has data specific to different kinds of convos.
    #[serde(skip_serializing_if = "core::option::Option::is_none")]
    pub kind: core::option::Option<crate::types::Union<ConvoViewKindRefs>>,
    #[serde(skip_serializing_if = "core::option::Option::is_none")]
    pub last_message: core::option::Option<
        crate::types::Union<ConvoViewLastMessageRefs>,
    >,
    #[serde(skip_serializing_if = "core::option::Option::is_none")]
    pub last_reaction: core::option::Option<
        crate::types::Union<ConvoViewLastReactionRefs>,
    >,
    ///Members of this conversation. For direct convos, it will be an immutable list of the 2 members. For group convos, it will a list of important members (the first few members, the viewer, the member who added the viewer, the member who sent the last message, the member who sent the last reaction), but will not contain the full list of members. Use chat.bsky.convo.getConvoMembers to list all members.
    pub members: Vec<crate::chat::bsky::actor::defs::ProfileViewBasic>,
    pub muted: bool,
    pub rev: String,
    ///Convo status for the viewer member (not the convo itself).
    #[serde(skip_serializing_if = "core::option::Option::is_none")]
    pub status: core::option::Option<ConvoStatus>,
    pub unread_count: i64,
}
pub type ConvoView = crate::types::Object<ConvoViewData>;
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct DeletedMessageViewData {
    pub id: String,
    pub rev: String,
    pub sender: MessageViewSender,
    pub sent_at: crate::types::string::Datetime,
}
pub type DeletedMessageView = crate::types::Object<DeletedMessageViewData>;
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct DirectConvoData {}
pub type DirectConvo = crate::types::Object<DirectConvoData>;
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct GroupConvoData {
    pub created_at: crate::types::string::Datetime,
    #[serde(skip_serializing_if = "core::option::Option::is_none")]
    pub join_link: core::option::Option<crate::chat::bsky::group::defs::JoinLinkView>,
    ///The total number of pending join requests for the group conversation. Only present for the owner. Capped at 21.
    #[serde(skip_serializing_if = "core::option::Option::is_none")]
    pub join_request_count: core::option::Option<i64>,
    ///The lock status of the conversation.
    pub lock_status: ConvoLockStatus,
    ///Whether the lock status is being forced by a moderation override (account inactivation or convo takedown) rather than the owner's own setting.
    pub lock_status_moderation_override: bool,
    ///The total number of members in the group conversation.
    pub member_count: i64,
    ///The maximum number of members allowed in the group conversation.
    pub member_limit: i64,
    ///The display name of the group conversation.
    pub name: String,
    ///The number of unread join requests for the group conversation. Only present for the owner.
    #[serde(skip_serializing_if = "core::option::Option::is_none")]
    pub unread_join_request_count: core::option::Option<i64>,
}
pub type GroupConvo = crate::types::Object<GroupConvoData>;
///Event indicating the viewer accepted a convo, and it can be moved out of the request inbox. Can be direct or group.
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct LogAcceptConvoData {
    pub convo_id: String,
    pub rev: String,
}
pub type LogAcceptConvo = crate::types::Object<LogAcceptConvoData>;
///Event indicating a member was added to a group convo. The member who was added gets a logBeginConvo (to create the convo) but also a logAddMember (to show the system message as the first message the user sees).
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct LogAddMemberData {
    pub convo_id: String,
    ///A system message with data of type #systemMessageDataAddMember
    pub message: SystemMessageView,
    ///Profiles referred in the system message.
    pub related_profiles: Vec<crate::chat::bsky::actor::defs::ProfileViewBasic>,
    pub rev: String,
}
pub type LogAddMember = crate::types::Object<LogAddMemberData>;
///Event indicating a reaction was added to a message.
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct LogAddReactionData {
    pub convo_id: String,
    pub message: crate::types::Union<LogAddReactionMessageRefs>,
    pub reaction: ReactionView,
    ///Profiles referred in the message and reaction views. This isn't required for compatibility, because it was added later, but should generally be present.
    #[serde(skip_serializing_if = "core::option::Option::is_none")]
    pub related_profiles: core::option::Option<
        Vec<crate::chat::bsky::actor::defs::ProfileViewBasic>,
    >,
    pub rev: String,
}
pub type LogAddReaction = crate::types::Object<LogAddReactionData>;
///Event indicating a join request was approved by the viewer. Only the owner gets this. The approved member gets a logBeginConvo.
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct LogApproveJoinRequestData {
    pub convo_id: String,
    ///Prospective member who requested to join.
    pub member: crate::chat::bsky::actor::defs::ProfileViewBasic,
    pub rev: String,
}
pub type LogApproveJoinRequest = crate::types::Object<LogApproveJoinRequestData>;
///Event indicating a convo containing the viewer was started. Can be direct or group. When a member is added to a group convo, they also get this event.
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct LogBeginConvoData {
    pub convo_id: String,
    pub rev: String,
}
pub type LogBeginConvo = crate::types::Object<LogBeginConvoData>;
///Event indicating a join link was created for a group convo.
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct LogCreateJoinLinkData {
    pub convo_id: String,
    ///A system message with data of type #systemMessageDataCreateJoinLink
    pub message: SystemMessageView,
    pub rev: String,
}
pub type LogCreateJoinLink = crate::types::Object<LogCreateJoinLinkData>;
///Event indicating a user-originated message was created. Is not emitted for system messages.
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct LogCreateMessageData {
    pub convo_id: String,
    pub message: crate::types::Union<LogCreateMessageMessageRefs>,
    ///Profiles referred to in the message view. This isn't required for compatibility, because it was added later, but should generally be present.
    #[serde(skip_serializing_if = "core::option::Option::is_none")]
    pub related_profiles: core::option::Option<
        Vec<crate::chat::bsky::actor::defs::ProfileViewBasic>,
    >,
    pub rev: String,
}
pub type LogCreateMessage = crate::types::Object<LogCreateMessageData>;
///Event indicating a user-originated message was deleted. Is not emitted for system messages.
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct LogDeleteMessageData {
    pub convo_id: String,
    pub message: crate::types::Union<LogDeleteMessageMessageRefs>,
    pub rev: String,
}
pub type LogDeleteMessage = crate::types::Object<LogDeleteMessageData>;
///Event indicating a join link was disabled for a group convo.
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct LogDisableJoinLinkData {
    pub convo_id: String,
    ///A system message with data of type #systemMessageDataDisableJoinLink
    pub message: SystemMessageView,
    pub rev: String,
}
pub type LogDisableJoinLink = crate::types::Object<LogDisableJoinLinkData>;
///Event indicating info about group convo was edited.
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct LogEditGroupData {
    pub convo_id: String,
    ///A system message with data of type #systemMessageDataEditGroup
    pub message: SystemMessageView,
    pub rev: String,
}
pub type LogEditGroup = crate::types::Object<LogEditGroupData>;
///Event indicating a settings about a join link for a group convo were edited.
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct LogEditJoinLinkData {
    pub convo_id: String,
    ///A system message with data of type #systemMessageDataEditJoinLink
    pub message: SystemMessageView,
    pub rev: String,
}
pub type LogEditJoinLink = crate::types::Object<LogEditJoinLinkData>;
///Event indicating a join link was enabled for a group convo.
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct LogEnableJoinLinkData {
    pub convo_id: String,
    ///A system message with data of type #systemMessageDataEnableJoinLink
    pub message: SystemMessageView,
    pub rev: String,
}
pub type LogEnableJoinLink = crate::types::Object<LogEnableJoinLinkData>;
///Event indicating a join request was made to a group the viewer owns. Only the owner gets this.
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct LogIncomingJoinRequestData {
    pub convo_id: String,
    ///Prospective member who requested to join.
    pub member: crate::chat::bsky::actor::defs::ProfileViewBasic,
    pub rev: String,
}
pub type LogIncomingJoinRequest = crate::types::Object<LogIncomingJoinRequestData>;
///Event indicating the viewer left a convo. Can be direct or group.
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct LogLeaveConvoData {
    pub convo_id: String,
    pub rev: String,
}
pub type LogLeaveConvo = crate::types::Object<LogLeaveConvoData>;
///Event indicating a group convo was locked.
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct LogLockConvoData {
    pub convo_id: String,
    ///A system message with data of type #systemMessageDataLockConvo
    pub message: SystemMessageView,
    ///Profiles referred in the system message.
    pub related_profiles: Vec<crate::chat::bsky::actor::defs::ProfileViewBasic>,
    pub rev: String,
}
pub type LogLockConvo = crate::types::Object<LogLockConvoData>;
///Event indicating a group convo was locked permanently.
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct LogLockConvoPermanentlyData {
    pub convo_id: String,
    ///A system message with data of type #systemMessageDataLockConvoPermanently
    pub message: SystemMessageView,
    ///Profiles referred in the system message.
    pub related_profiles: Vec<crate::chat::bsky::actor::defs::ProfileViewBasic>,
    pub rev: String,
}
pub type LogLockConvoPermanently = crate::types::Object<LogLockConvoPermanentlyData>;
///Event indicating a member joined a group convo via join link. The member who was added gets a logBeginConvo (to create the convo) but also a logMemberJoin (to show the system message as the first message the user sees).
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct LogMemberJoinData {
    pub convo_id: String,
    ///A system message with data of type #systemMessageDataMemberJoin
    pub message: SystemMessageView,
    ///Profiles referred in the system message.
    pub related_profiles: Vec<crate::chat::bsky::actor::defs::ProfileViewBasic>,
    pub rev: String,
}
pub type LogMemberJoin = crate::types::Object<LogMemberJoinData>;
///Event indicating a member voluntarily left a group convo. The member who was removed gets a logLeaveConvo (to leave the convo) but not a logMemberLeave (because they already left, so can't see the system message).
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct LogMemberLeaveData {
    pub convo_id: String,
    ///A system message with data of type #systemMessageDataMemberLeave
    pub message: SystemMessageView,
    ///Profiles referred in the system message.
    pub related_profiles: Vec<crate::chat::bsky::actor::defs::ProfileViewBasic>,
    pub rev: String,
}
pub type LogMemberLeave = crate::types::Object<LogMemberLeaveData>;
///Event indicating the viewer muted a convo. Can be direct or group.
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct LogMuteConvoData {
    pub convo_id: String,
    pub rev: String,
}
pub type LogMuteConvo = crate::types::Object<LogMuteConvoData>;
///Event indicating a join request was made by the requester. Only requester actor gets this.
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct LogOutgoingJoinRequestData {
    pub convo_id: String,
    pub rev: String,
}
pub type LogOutgoingJoinRequest = crate::types::Object<LogOutgoingJoinRequestData>;
///Event indicating a convo was read up to a certain message.
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct LogReadConvoData {
    pub convo_id: String,
    pub message: crate::types::Union<LogReadConvoMessageRefs>,
    pub rev: String,
}
pub type LogReadConvo = crate::types::Object<LogReadConvoData>;
///Event indicating the group owner marked join requests as read. Only the owner gets this.
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct LogReadJoinRequestsData {
    pub convo_id: String,
    pub rev: String,
}
pub type LogReadJoinRequests = crate::types::Object<LogReadJoinRequestsData>;
///DEPRECATED: use logReadConvo instead. Event indicating a convo was read up to a certain message.
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct LogReadMessageData {
    pub convo_id: String,
    pub message: crate::types::Union<LogReadMessageMessageRefs>,
    pub rev: String,
}
pub type LogReadMessage = crate::types::Object<LogReadMessageData>;
///Event indicating a join request was rejected by the viewer. Only the owner gets this.
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct LogRejectJoinRequestData {
    pub convo_id: String,
    ///Prospective member who requested to join.
    pub member: crate::chat::bsky::actor::defs::ProfileViewBasic,
    pub rev: String,
}
pub type LogRejectJoinRequest = crate::types::Object<LogRejectJoinRequestData>;
///Event indicating a member was removed from a group convo. The member who was removed gets a logLeaveConvo (to leave the convo) but not a logRemoveMember (because they already left, so can't see the system message).
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct LogRemoveMemberData {
    pub convo_id: String,
    ///A system message with data of type #systemMessageDataRemoveMember
    pub message: SystemMessageView,
    ///Profiles referred in the system message.
    pub related_profiles: Vec<crate::chat::bsky::actor::defs::ProfileViewBasic>,
    pub rev: String,
}
pub type LogRemoveMember = crate::types::Object<LogRemoveMemberData>;
///Event indicating a reaction was removed from a message.
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct LogRemoveReactionData {
    pub convo_id: String,
    pub message: crate::types::Union<LogRemoveReactionMessageRefs>,
    pub reaction: ReactionView,
    ///Profiles referred in the message and reaction views. This isn't required for compatibility, because it was added later, but should generally be present.
    #[serde(skip_serializing_if = "core::option::Option::is_none")]
    pub related_profiles: core::option::Option<
        Vec<crate::chat::bsky::actor::defs::ProfileViewBasic>,
    >,
    pub rev: String,
}
pub type LogRemoveReaction = crate::types::Object<LogRemoveReactionData>;
///Event indicating a group convo was unlocked.
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct LogUnlockConvoData {
    pub convo_id: String,
    ///A system message with data of type #systemMessageDataUnlockConvo
    pub message: SystemMessageView,
    ///Profiles referred in the system message.
    pub related_profiles: Vec<crate::chat::bsky::actor::defs::ProfileViewBasic>,
    pub rev: String,
}
pub type LogUnlockConvo = crate::types::Object<LogUnlockConvoData>;
///Event indicating the viewer unmuted a convo. Can be direct or group.
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct LogUnmuteConvoData {
    pub convo_id: String,
    pub rev: String,
}
pub type LogUnmuteConvo = crate::types::Object<LogUnmuteConvoData>;
///Event indicating a prospective member withdrew their join request. Only the owner gets this.
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct LogWithdrawIncomingJoinRequestData {
    pub convo_id: String,
    ///Prospective member who withdrew their join request.
    pub member: crate::chat::bsky::actor::defs::ProfileViewBasic,
    pub rev: String,
}
pub type LogWithdrawIncomingJoinRequest = crate::types::Object<
    LogWithdrawIncomingJoinRequestData,
>;
///Event indicating the viewer withdrew their own join request. Only requester actor gets this.
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct LogWithdrawOutgoingJoinRequestData {
    pub convo_id: String,
    pub rev: String,
}
pub type LogWithdrawOutgoingJoinRequest = crate::types::Object<
    LogWithdrawOutgoingJoinRequestData,
>;
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct MessageAndReactionViewData {
    pub message: MessageView,
    pub reaction: ReactionView,
}
pub type MessageAndReactionView = crate::types::Object<MessageAndReactionViewData>;
///Placeholder embedded in place of a reply's parent message when that parent was sent before the viewer joined the group convo. The viewer has no access to that history, so no message data is carried.
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct MessageBeforeUserJoinedGroupViewData {}
pub type MessageBeforeUserJoinedGroupView = crate::types::Object<
    MessageBeforeUserJoinedGroupViewData,
>;
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct MessageInputData {
    #[serde(skip_serializing_if = "core::option::Option::is_none")]
    pub embed: core::option::Option<crate::types::Union<MessageInputEmbedRefs>>,
    ///Annotations of text (mentions, URLs, hashtags, etc)
    #[serde(skip_serializing_if = "core::option::Option::is_none")]
    pub facets: core::option::Option<Vec<crate::app::bsky::richtext::facet::Main>>,
    ///If set, the message this message is replying to. The referenced message must be in the same convo.
    #[serde(skip_serializing_if = "core::option::Option::is_none")]
    pub reply_to: core::option::Option<ReplyRef>,
    pub text: String,
}
pub type MessageInput = crate::types::Object<MessageInputData>;
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct MessageRefData {
    pub convo_id: String,
    pub did: crate::types::string::Did,
    pub message_id: String,
}
pub type MessageRef = crate::types::Object<MessageRefData>;
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct MessageViewData {
    #[serde(skip_serializing_if = "core::option::Option::is_none")]
    pub embed: core::option::Option<crate::types::Union<MessageViewEmbedRefs>>,
    ///Annotations of text (mentions, URLs, hashtags, etc)
    #[serde(skip_serializing_if = "core::option::Option::is_none")]
    pub facets: core::option::Option<Vec<crate::app::bsky::richtext::facet::Main>>,
    pub id: String,
    ///Reactions to this message, in ascending order of creation time.
    #[serde(skip_serializing_if = "core::option::Option::is_none")]
    pub reactions: core::option::Option<Vec<ReactionView>>,
    ///If set, the message this message is replying to. The full view of the referenced message is embedded so the client can render it inline. Only a single level is embedded: the embedded message will not itself have a populated 'replyTo' field even if it was also a reply.
    #[serde(skip_serializing_if = "core::option::Option::is_none")]
    pub reply_to: core::option::Option<crate::types::Union<MessageViewReplyToRefs>>,
    pub rev: String,
    pub sender: MessageViewSender,
    pub sent_at: crate::types::string::Datetime,
    pub text: String,
}
pub type MessageView = crate::types::Object<MessageViewData>;
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct MessageViewSenderData {
    pub did: crate::types::string::Did,
}
pub type MessageViewSender = crate::types::Object<MessageViewSenderData>;
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct ReactionViewData {
    pub created_at: crate::types::string::Datetime,
    pub sender: ReactionViewSender,
    pub value: String,
}
pub type ReactionView = crate::types::Object<ReactionViewData>;
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct ReactionViewSenderData {
    pub did: crate::types::string::Did,
}
pub type ReactionViewSender = crate::types::Object<ReactionViewSenderData>;
///A reference to another message within the same convo, used to indicate that a message is a reply to it.
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct ReplyRefData {
    pub message_id: String,
}
pub type ReplyRef = crate::types::Object<ReplyRefData>;
///System message indicating a user was added to the group convo.
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct SystemMessageDataAddMemberData {
    pub added_by: SystemMessageReferredUser,
    ///Current view of the member who was added.
    pub member: SystemMessageReferredUser,
    ///Role the user was added to the group with. The role from 'member' will reflect the current data, not historical.
    pub role: crate::chat::bsky::actor::defs::MemberRole,
}
pub type SystemMessageDataAddMember = crate::types::Object<
    SystemMessageDataAddMemberData,
>;
///System message indicating the group join link was created.
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct SystemMessageDataCreateJoinLinkData {}
pub type SystemMessageDataCreateJoinLink = crate::types::Object<
    SystemMessageDataCreateJoinLinkData,
>;
///System message indicating the group join link was disabled.
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct SystemMessageDataDisableJoinLinkData {}
pub type SystemMessageDataDisableJoinLink = crate::types::Object<
    SystemMessageDataDisableJoinLinkData,
>;
///System message indicating the group info was edited.
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct SystemMessageDataEditGroupData {
    ///Group name that replaced the old.
    #[serde(skip_serializing_if = "core::option::Option::is_none")]
    pub new_name: core::option::Option<String>,
    ///Group name that was replaced.
    #[serde(skip_serializing_if = "core::option::Option::is_none")]
    pub old_name: core::option::Option<String>,
}
pub type SystemMessageDataEditGroup = crate::types::Object<
    SystemMessageDataEditGroupData,
>;
///System message indicating the group join link was edited.
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct SystemMessageDataEditJoinLinkData {}
pub type SystemMessageDataEditJoinLink = crate::types::Object<
    SystemMessageDataEditJoinLinkData,
>;
///System message indicating the group join link was enabled.
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct SystemMessageDataEnableJoinLinkData {}
pub type SystemMessageDataEnableJoinLink = crate::types::Object<
    SystemMessageDataEnableJoinLinkData,
>;
///System message indicating the group convo was locked.
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct SystemMessageDataLockConvoData {
    ///Current view of the member who locked the group.
    pub locked_by: SystemMessageReferredUser,
}
pub type SystemMessageDataLockConvo = crate::types::Object<
    SystemMessageDataLockConvoData,
>;
///System message indicating the group convo was locked permanently.
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct SystemMessageDataLockConvoPermanentlyData {
    ///Current view of the member who locked the group.
    pub locked_by: SystemMessageReferredUser,
}
pub type SystemMessageDataLockConvoPermanently = crate::types::Object<
    SystemMessageDataLockConvoPermanentlyData,
>;
///System message indicating a user joined the group convo via join link.
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct SystemMessageDataMemberJoinData {
    ///If join link was configured to require approval, this will be set to who approved the request. Undefined if approval was not required.
    #[serde(skip_serializing_if = "core::option::Option::is_none")]
    pub approved_by: core::option::Option<SystemMessageReferredUser>,
    ///Current view of the member who joined.
    pub member: SystemMessageReferredUser,
    ///Role the user was added to the group with. The role from 'member' will reflect the current data, not historical.
    pub role: crate::chat::bsky::actor::defs::MemberRole,
}
pub type SystemMessageDataMemberJoin = crate::types::Object<
    SystemMessageDataMemberJoinData,
>;
///System message indicating a user voluntarily left the group convo.
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct SystemMessageDataMemberLeaveData {
    ///Current view of the member who left the group.
    pub member: SystemMessageReferredUser,
}
pub type SystemMessageDataMemberLeave = crate::types::Object<
    SystemMessageDataMemberLeaveData,
>;
///System message indicating a user was removed from the group convo.
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct SystemMessageDataRemoveMemberData {
    ///Current view of the member who was removed.
    pub member: SystemMessageReferredUser,
    pub removed_by: SystemMessageReferredUser,
}
pub type SystemMessageDataRemoveMember = crate::types::Object<
    SystemMessageDataRemoveMemberData,
>;
///System message indicating the group convo was unlocked.
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct SystemMessageDataUnlockConvoData {
    ///Current view of the member who unlocked the group.
    pub unlocked_by: SystemMessageReferredUser,
}
pub type SystemMessageDataUnlockConvo = crate::types::Object<
    SystemMessageDataUnlockConvoData,
>;
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct SystemMessageReferredUserData {
    pub did: crate::types::string::Did,
}
pub type SystemMessageReferredUser = crate::types::Object<SystemMessageReferredUserData>;
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct SystemMessageViewData {
    pub data: crate::types::Union<SystemMessageViewDataRefs>,
    pub id: String,
    pub rev: String,
    pub sent_at: crate::types::string::Datetime,
}
pub type SystemMessageView = crate::types::Object<SystemMessageViewData>;
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(tag = "$type")]
pub enum ConvoViewKindRefs {
    #[serde(rename = "chat.bsky.convo.defs#directConvo")]
    DirectConvo(Box<DirectConvo>),
    #[serde(rename = "chat.bsky.convo.defs#groupConvo")]
    GroupConvo(Box<GroupConvo>),
}
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(tag = "$type")]
pub enum ConvoViewLastMessageRefs {
    #[serde(rename = "chat.bsky.convo.defs#messageView")]
    MessageView(Box<MessageView>),
    #[serde(rename = "chat.bsky.convo.defs#deletedMessageView")]
    DeletedMessageView(Box<DeletedMessageView>),
    #[serde(rename = "chat.bsky.convo.defs#systemMessageView")]
    SystemMessageView(Box<SystemMessageView>),
}
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(tag = "$type")]
pub enum ConvoViewLastReactionRefs {
    #[serde(rename = "chat.bsky.convo.defs#messageAndReactionView")]
    MessageAndReactionView(Box<MessageAndReactionView>),
}
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(tag = "$type")]
pub enum LogAddReactionMessageRefs {
    #[serde(rename = "chat.bsky.convo.defs#messageView")]
    MessageView(Box<MessageView>),
    #[serde(rename = "chat.bsky.convo.defs#deletedMessageView")]
    DeletedMessageView(Box<DeletedMessageView>),
}
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(tag = "$type")]
pub enum LogCreateMessageMessageRefs {
    #[serde(rename = "chat.bsky.convo.defs#messageView")]
    MessageView(Box<MessageView>),
    #[serde(rename = "chat.bsky.convo.defs#deletedMessageView")]
    DeletedMessageView(Box<DeletedMessageView>),
}
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(tag = "$type")]
pub enum LogDeleteMessageMessageRefs {
    #[serde(rename = "chat.bsky.convo.defs#messageView")]
    MessageView(Box<MessageView>),
    #[serde(rename = "chat.bsky.convo.defs#deletedMessageView")]
    DeletedMessageView(Box<DeletedMessageView>),
}
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(tag = "$type")]
pub enum LogReadConvoMessageRefs {
    #[serde(rename = "chat.bsky.convo.defs#messageView")]
    MessageView(Box<MessageView>),
    #[serde(rename = "chat.bsky.convo.defs#deletedMessageView")]
    DeletedMessageView(Box<DeletedMessageView>),
    #[serde(rename = "chat.bsky.convo.defs#systemMessageView")]
    SystemMessageView(Box<SystemMessageView>),
}
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(tag = "$type")]
pub enum LogReadMessageMessageRefs {
    #[serde(rename = "chat.bsky.convo.defs#messageView")]
    MessageView(Box<MessageView>),
    #[serde(rename = "chat.bsky.convo.defs#deletedMessageView")]
    DeletedMessageView(Box<DeletedMessageView>),
    #[serde(rename = "chat.bsky.convo.defs#systemMessageView")]
    SystemMessageView(Box<SystemMessageView>),
}
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(tag = "$type")]
pub enum LogRemoveReactionMessageRefs {
    #[serde(rename = "chat.bsky.convo.defs#messageView")]
    MessageView(Box<MessageView>),
    #[serde(rename = "chat.bsky.convo.defs#deletedMessageView")]
    DeletedMessageView(Box<DeletedMessageView>),
}
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(tag = "$type")]
pub enum MessageInputEmbedRefs {
    #[serde(rename = "app.bsky.embed.record")]
    AppBskyEmbedRecordMain(Box<crate::app::bsky::embed::record::Main>),
    #[serde(rename = "chat.bsky.embed.joinLink")]
    ChatBskyEmbedJoinLinkMain(Box<crate::chat::bsky::embed::join_link::Main>),
}
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(tag = "$type")]
pub enum MessageViewEmbedRefs {
    #[serde(rename = "app.bsky.embed.record#view")]
    AppBskyEmbedRecordView(Box<crate::app::bsky::embed::record::View>),
    #[serde(rename = "chat.bsky.embed.joinLink#view")]
    ChatBskyEmbedJoinLinkView(Box<crate::chat::bsky::embed::join_link::View>),
}
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(tag = "$type")]
pub enum MessageViewReplyToRefs {
    #[serde(rename = "chat.bsky.convo.defs#messageView")]
    MessageView(Box<MessageView>),
    #[serde(rename = "chat.bsky.convo.defs#deletedMessageView")]
    DeletedMessageView(Box<DeletedMessageView>),
    #[serde(rename = "chat.bsky.convo.defs#messageBeforeUserJoinedGroupView")]
    MessageBeforeUserJoinedGroupView(Box<MessageBeforeUserJoinedGroupView>),
}
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(tag = "$type")]
pub enum SystemMessageViewDataRefs {
    #[serde(rename = "chat.bsky.convo.defs#systemMessageDataAddMember")]
    SystemMessageDataAddMember(Box<SystemMessageDataAddMember>),
    #[serde(rename = "chat.bsky.convo.defs#systemMessageDataRemoveMember")]
    SystemMessageDataRemoveMember(Box<SystemMessageDataRemoveMember>),
    #[serde(rename = "chat.bsky.convo.defs#systemMessageDataMemberJoin")]
    SystemMessageDataMemberJoin(Box<SystemMessageDataMemberJoin>),
    #[serde(rename = "chat.bsky.convo.defs#systemMessageDataMemberLeave")]
    SystemMessageDataMemberLeave(Box<SystemMessageDataMemberLeave>),
    #[serde(rename = "chat.bsky.convo.defs#systemMessageDataLockConvo")]
    SystemMessageDataLockConvo(Box<SystemMessageDataLockConvo>),
    #[serde(rename = "chat.bsky.convo.defs#systemMessageDataUnlockConvo")]
    SystemMessageDataUnlockConvo(Box<SystemMessageDataUnlockConvo>),
    #[serde(rename = "chat.bsky.convo.defs#systemMessageDataLockConvoPermanently")]
    SystemMessageDataLockConvoPermanently(Box<SystemMessageDataLockConvoPermanently>),
    #[serde(rename = "chat.bsky.convo.defs#systemMessageDataEditGroup")]
    SystemMessageDataEditGroup(Box<SystemMessageDataEditGroup>),
    #[serde(rename = "chat.bsky.convo.defs#systemMessageDataCreateJoinLink")]
    SystemMessageDataCreateJoinLink(Box<SystemMessageDataCreateJoinLink>),
    #[serde(rename = "chat.bsky.convo.defs#systemMessageDataEditJoinLink")]
    SystemMessageDataEditJoinLink(Box<SystemMessageDataEditJoinLink>),
    #[serde(rename = "chat.bsky.convo.defs#systemMessageDataEnableJoinLink")]
    SystemMessageDataEnableJoinLink(Box<SystemMessageDataEnableJoinLink>),
    #[serde(rename = "chat.bsky.convo.defs#systemMessageDataDisableJoinLink")]
    SystemMessageDataDisableJoinLink(Box<SystemMessageDataDisableJoinLink>),
}