Skip to main content

jacquard_api/chat_bsky/
convo.rs

1// @generated by jacquard-lexicon. DO NOT EDIT.
2//
3// Lexicon: chat.bsky.convo.defs
4//
5// This file was automatically generated from Lexicon schemas.
6// Any manual changes will be overwritten on the next regeneration.
7
8//! Generated bindings for the `chat.bsky.convo` Lexicon namespace/module.
9pub mod accept_convo;
10pub mod add_reaction;
11pub mod delete_message_for_self;
12pub mod get_convo;
13pub mod get_convo_availability;
14pub mod get_convo_for_members;
15pub mod get_convo_members;
16pub mod get_log;
17pub mod get_messages;
18pub mod get_unread_counts;
19pub mod leave_convo;
20pub mod list_convo_requests;
21pub mod list_convos;
22pub mod lock_convo;
23pub mod mute_convo;
24pub mod remove_reaction;
25pub mod send_message;
26pub mod send_message_batch;
27pub mod unlock_convo;
28pub mod unmute_convo;
29pub mod update_all_read;
30pub mod update_read;
31
32#[allow(unused_imports)]
33use alloc::collections::BTreeMap;
34
35#[allow(unused_imports)]
36use core::marker::PhantomData;
37use jacquard_common::{BosStr, CowStr, DefaultStr, FromStaticStr};
38
39#[allow(unused_imports)]
40use jacquard_common::deps::codegen::unicode_segmentation::UnicodeSegmentation;
41use jacquard_common::deps::smol_str::SmolStr;
42use jacquard_common::types::string::{Datetime, Did};
43use jacquard_common::types::value::Data;
44use jacquard_derive::{IntoStatic, open_union};
45use jacquard_lexicon::lexicon::LexiconDoc;
46use jacquard_lexicon::schema::LexiconSchema;
47
48use crate::app_bsky::embed::record;
49use crate::app_bsky::embed::record::Record;
50use crate::app_bsky::richtext::facet::Facet;
51use crate::chat_bsky::actor::MemberRole;
52use crate::chat_bsky::actor::ProfileViewBasic;
53use crate::chat_bsky::convo;
54use crate::chat_bsky::embed::join_link;
55use crate::chat_bsky::embed::join_link::JoinLink;
56use crate::chat_bsky::group::JoinLinkView;
57#[allow(unused_imports)]
58use jacquard_lexicon::validation::{ConstraintError, ValidationPath};
59use serde::{Deserialize, Serialize};
60
61#[derive(Debug, Clone, PartialEq, Eq, Hash)]
62pub enum ConvoKind<S: BosStr = DefaultStr> {
63    Direct,
64    Group,
65    Other(S),
66}
67
68impl<S: BosStr> ConvoKind<S> {
69    pub fn as_str(&self) -> &str {
70        match self {
71            Self::Direct => "direct",
72            Self::Group => "group",
73            Self::Other(s) => s.as_ref(),
74        }
75    }
76    /// Construct from a string-like value, matching known values.
77    pub fn from_value(s: S) -> Self {
78        match s.as_ref() {
79            "direct" => Self::Direct,
80            "group" => Self::Group,
81            _ => Self::Other(s),
82        }
83    }
84}
85
86impl<S: BosStr> AsRef<str> for ConvoKind<S> {
87    fn as_ref(&self) -> &str {
88        self.as_str()
89    }
90}
91
92impl<S: BosStr> core::fmt::Display for ConvoKind<S> {
93    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
94        write!(f, "{}", self.as_str())
95    }
96}
97
98impl<S: BosStr> Serialize for ConvoKind<S> {
99    fn serialize<Ser>(&self, serializer: Ser) -> Result<Ser::Ok, Ser::Error>
100    where
101        Ser: serde::Serializer,
102    {
103        serializer.serialize_str(self.as_str())
104    }
105}
106
107impl<'de, S: Deserialize<'de> + BosStr> Deserialize<'de> for ConvoKind<S> {
108    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
109    where
110        D: serde::Deserializer<'de>,
111    {
112        let s = S::deserialize(deserializer)?;
113        Ok(Self::from_value(s))
114    }
115}
116
117impl<S: BosStr> jacquard_common::IntoStatic for ConvoKind<S>
118where
119    S: BosStr + jacquard_common::IntoStatic,
120    S::Output: BosStr,
121{
122    type Output = ConvoKind<S::Output>;
123    fn into_static(self) -> Self::Output {
124        match self {
125            ConvoKind::Direct => ConvoKind::Direct,
126            ConvoKind::Group => ConvoKind::Group,
127            ConvoKind::Other(v) => ConvoKind::Other(v.into_static()),
128        }
129    }
130}
131
132#[derive(Debug, Clone, PartialEq, Eq, Hash)]
133pub enum ConvoLockStatus<S: BosStr = DefaultStr> {
134    Unlocked,
135    Locked,
136    LockedPermanently,
137    Other(S),
138}
139
140impl<S: BosStr> ConvoLockStatus<S> {
141    pub fn as_str(&self) -> &str {
142        match self {
143            Self::Unlocked => "unlocked",
144            Self::Locked => "locked",
145            Self::LockedPermanently => "locked-permanently",
146            Self::Other(s) => s.as_ref(),
147        }
148    }
149    /// Construct from a string-like value, matching known values.
150    pub fn from_value(s: S) -> Self {
151        match s.as_ref() {
152            "unlocked" => Self::Unlocked,
153            "locked" => Self::Locked,
154            "locked-permanently" => Self::LockedPermanently,
155            _ => Self::Other(s),
156        }
157    }
158}
159
160impl<S: BosStr> AsRef<str> for ConvoLockStatus<S> {
161    fn as_ref(&self) -> &str {
162        self.as_str()
163    }
164}
165
166impl<S: BosStr> core::fmt::Display for ConvoLockStatus<S> {
167    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
168        write!(f, "{}", self.as_str())
169    }
170}
171
172impl<S: BosStr> Serialize for ConvoLockStatus<S> {
173    fn serialize<Ser>(&self, serializer: Ser) -> Result<Ser::Ok, Ser::Error>
174    where
175        Ser: serde::Serializer,
176    {
177        serializer.serialize_str(self.as_str())
178    }
179}
180
181impl<'de, S: Deserialize<'de> + BosStr> Deserialize<'de> for ConvoLockStatus<S> {
182    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
183    where
184        D: serde::Deserializer<'de>,
185    {
186        let s = S::deserialize(deserializer)?;
187        Ok(Self::from_value(s))
188    }
189}
190
191impl<S: BosStr> jacquard_common::IntoStatic for ConvoLockStatus<S>
192where
193    S: BosStr + jacquard_common::IntoStatic,
194    S::Output: BosStr,
195{
196    type Output = ConvoLockStatus<S::Output>;
197    fn into_static(self) -> Self::Output {
198        match self {
199            ConvoLockStatus::Unlocked => ConvoLockStatus::Unlocked,
200            ConvoLockStatus::Locked => ConvoLockStatus::Locked,
201            ConvoLockStatus::LockedPermanently => ConvoLockStatus::LockedPermanently,
202            ConvoLockStatus::Other(v) => ConvoLockStatus::Other(v.into_static()),
203        }
204    }
205}
206
207#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
208#[serde(
209    rename_all = "camelCase",
210    bound(deserialize = "S: Deserialize<'de> + BosStr")
211)]
212pub struct ConvoRef<S: BosStr = DefaultStr> {
213    pub convo_id: S,
214    pub did: Did<S>,
215    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
216    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
217}
218
219#[derive(Debug, Clone, PartialEq, Eq, Hash)]
220pub enum ConvoStatus<S: BosStr = DefaultStr> {
221    Request,
222    Accepted,
223    Other(S),
224}
225
226impl<S: BosStr> ConvoStatus<S> {
227    pub fn as_str(&self) -> &str {
228        match self {
229            Self::Request => "request",
230            Self::Accepted => "accepted",
231            Self::Other(s) => s.as_ref(),
232        }
233    }
234    /// Construct from a string-like value, matching known values.
235    pub fn from_value(s: S) -> Self {
236        match s.as_ref() {
237            "request" => Self::Request,
238            "accepted" => Self::Accepted,
239            _ => Self::Other(s),
240        }
241    }
242}
243
244impl<S: BosStr> AsRef<str> for ConvoStatus<S> {
245    fn as_ref(&self) -> &str {
246        self.as_str()
247    }
248}
249
250impl<S: BosStr> core::fmt::Display for ConvoStatus<S> {
251    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
252        write!(f, "{}", self.as_str())
253    }
254}
255
256impl<S: BosStr> Serialize for ConvoStatus<S> {
257    fn serialize<Ser>(&self, serializer: Ser) -> Result<Ser::Ok, Ser::Error>
258    where
259        Ser: serde::Serializer,
260    {
261        serializer.serialize_str(self.as_str())
262    }
263}
264
265impl<'de, S: Deserialize<'de> + BosStr> Deserialize<'de> for ConvoStatus<S> {
266    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
267    where
268        D: serde::Deserializer<'de>,
269    {
270        let s = S::deserialize(deserializer)?;
271        Ok(Self::from_value(s))
272    }
273}
274
275impl<S: BosStr> jacquard_common::IntoStatic for ConvoStatus<S>
276where
277    S: BosStr + jacquard_common::IntoStatic,
278    S::Output: BosStr,
279{
280    type Output = ConvoStatus<S::Output>;
281    fn into_static(self) -> Self::Output {
282        match self {
283            ConvoStatus::Request => ConvoStatus::Request,
284            ConvoStatus::Accepted => ConvoStatus::Accepted,
285            ConvoStatus::Other(v) => ConvoStatus::Other(v.into_static()),
286        }
287    }
288}
289
290#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
291#[serde(
292    rename_all = "camelCase",
293    bound(deserialize = "S: Deserialize<'de> + BosStr")
294)]
295pub struct ConvoView<S: BosStr = DefaultStr> {
296    pub id: S,
297    ///Union field that has data specific to different kinds of convos.
298    #[serde(skip_serializing_if = "Option::is_none")]
299    pub kind: Option<ConvoViewKind<S>>,
300    #[serde(skip_serializing_if = "Option::is_none")]
301    pub last_message: Option<ConvoViewLastMessage<S>>,
302    #[serde(skip_serializing_if = "Option::is_none")]
303    pub last_reaction: Option<convo::MessageAndReactionView<S>>,
304    ///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.
305    pub members: Vec<ProfileViewBasic<S>>,
306    pub muted: bool,
307    pub rev: S,
308    ///Convo status for the viewer member (not the convo itself).
309    #[serde(skip_serializing_if = "Option::is_none")]
310    pub status: Option<convo::ConvoStatus<S>>,
311    pub unread_count: i64,
312    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
313    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
314}
315
316#[open_union]
317#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
318#[serde(tag = "$type", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
319pub enum ConvoViewKind<S: BosStr = DefaultStr> {
320    #[serde(rename = "chat.bsky.convo.defs#directConvo")]
321    DirectConvo(Box<convo::DirectConvo<S>>),
322    #[serde(rename = "chat.bsky.convo.defs#groupConvo")]
323    GroupConvo(Box<convo::GroupConvo<S>>),
324}
325
326#[open_union]
327#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
328#[serde(tag = "$type", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
329pub enum ConvoViewLastMessage<S: BosStr = DefaultStr> {
330    #[serde(rename = "chat.bsky.convo.defs#messageView")]
331    MessageView(Box<convo::MessageView<S>>),
332    #[serde(rename = "chat.bsky.convo.defs#deletedMessageView")]
333    DeletedMessageView(Box<convo::DeletedMessageView<S>>),
334    #[serde(rename = "chat.bsky.convo.defs#systemMessageView")]
335    SystemMessageView(Box<convo::SystemMessageView<S>>),
336}
337
338#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
339#[serde(
340    rename_all = "camelCase",
341    bound(deserialize = "S: Deserialize<'de> + BosStr")
342)]
343pub struct DeletedMessageView<S: BosStr = DefaultStr> {
344    pub id: S,
345    pub rev: S,
346    pub sender: convo::MessageViewSender<S>,
347    pub sent_at: Datetime,
348    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
349    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
350}
351
352#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
353#[serde(
354    rename_all = "camelCase",
355    bound(deserialize = "S: Deserialize<'de> + BosStr")
356)]
357pub struct DirectConvo<S: BosStr = DefaultStr> {
358    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
359    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
360}
361
362#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
363#[serde(
364    rename_all = "camelCase",
365    bound(deserialize = "S: Deserialize<'de> + BosStr")
366)]
367pub struct GroupConvo<S: BosStr = DefaultStr> {
368    pub created_at: Datetime,
369    #[serde(skip_serializing_if = "Option::is_none")]
370    pub join_link: Option<JoinLinkView<S>>,
371    ///The total number of pending join requests for the group conversation. Only present for the owner. Capped at 21.
372    #[serde(skip_serializing_if = "Option::is_none")]
373    pub join_request_count: Option<i64>,
374    ///The lock status of the conversation.
375    pub lock_status: convo::ConvoLockStatus<S>,
376    ///Whether the lock status is being forced by a moderation override (account inactivation or convo takedown) rather than the owner's own setting.
377    pub lock_status_moderation_override: bool,
378    ///The total number of members in the group conversation.
379    pub member_count: i64,
380    ///The maximum number of members allowed in the group conversation.
381    pub member_limit: i64,
382    ///The display name of the group conversation.
383    pub name: S,
384    ///The number of unread join requests for the group conversation. Only present for the owner.
385    #[serde(skip_serializing_if = "Option::is_none")]
386    pub unread_join_request_count: Option<i64>,
387    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
388    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
389}
390
391/// Event indicating the viewer accepted a convo, and it can be moved out of the request inbox. Can be direct or group.
392
393#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
394#[serde(
395    rename_all = "camelCase",
396    bound(deserialize = "S: Deserialize<'de> + BosStr")
397)]
398pub struct LogAcceptConvo<S: BosStr = DefaultStr> {
399    pub convo_id: S,
400    pub rev: S,
401    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
402    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
403}
404
405/// 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).
406
407#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
408#[serde(
409    rename_all = "camelCase",
410    bound(deserialize = "S: Deserialize<'de> + BosStr")
411)]
412pub struct LogAddMember<S: BosStr = DefaultStr> {
413    pub convo_id: S,
414    ///A system message with data of type #systemMessageDataAddMember
415    pub message: convo::SystemMessageView<S>,
416    ///Profiles referred in the system message.
417    pub related_profiles: Vec<ProfileViewBasic<S>>,
418    pub rev: S,
419    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
420    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
421}
422
423/// Event indicating a reaction was added to a message.
424
425#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
426#[serde(
427    rename_all = "camelCase",
428    bound(deserialize = "S: Deserialize<'de> + BosStr")
429)]
430pub struct LogAddReaction<S: BosStr = DefaultStr> {
431    pub convo_id: S,
432    pub message: LogAddReactionMessage<S>,
433    pub reaction: convo::ReactionView<S>,
434    ///Profiles referred in the message and reaction views. This isn't required for compatibility, because it was added later, but should generally be present.
435    #[serde(skip_serializing_if = "Option::is_none")]
436    pub related_profiles: Option<Vec<ProfileViewBasic<S>>>,
437    pub rev: S,
438    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
439    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
440}
441
442#[open_union]
443#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
444#[serde(tag = "$type", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
445pub enum LogAddReactionMessage<S: BosStr = DefaultStr> {
446    #[serde(rename = "chat.bsky.convo.defs#messageView")]
447    MessageView(Box<convo::MessageView<S>>),
448    #[serde(rename = "chat.bsky.convo.defs#deletedMessageView")]
449    DeletedMessageView(Box<convo::DeletedMessageView<S>>),
450}
451
452/// Event indicating a join request was approved by the viewer. Only the owner gets this. The approved member gets a logBeginConvo.
453
454#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
455#[serde(
456    rename_all = "camelCase",
457    bound(deserialize = "S: Deserialize<'de> + BosStr")
458)]
459pub struct LogApproveJoinRequest<S: BosStr = DefaultStr> {
460    pub convo_id: S,
461    ///Prospective member who requested to join.
462    pub member: ProfileViewBasic<S>,
463    pub rev: S,
464    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
465    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
466}
467
468/// 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.
469
470#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
471#[serde(
472    rename_all = "camelCase",
473    bound(deserialize = "S: Deserialize<'de> + BosStr")
474)]
475pub struct LogBeginConvo<S: BosStr = DefaultStr> {
476    pub convo_id: S,
477    pub rev: S,
478    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
479    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
480}
481
482/// Event indicating a join link was created for a group convo.
483
484#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
485#[serde(
486    rename_all = "camelCase",
487    bound(deserialize = "S: Deserialize<'de> + BosStr")
488)]
489pub struct LogCreateJoinLink<S: BosStr = DefaultStr> {
490    pub convo_id: S,
491    ///A system message with data of type #systemMessageDataCreateJoinLink
492    pub message: convo::SystemMessageView<S>,
493    pub rev: S,
494    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
495    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
496}
497
498/// Event indicating a user-originated message was created. Is not emitted for system messages.
499
500#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
501#[serde(
502    rename_all = "camelCase",
503    bound(deserialize = "S: Deserialize<'de> + BosStr")
504)]
505pub struct LogCreateMessage<S: BosStr = DefaultStr> {
506    pub convo_id: S,
507    pub message: LogCreateMessageMessage<S>,
508    ///Profiles referred to in the message view. This isn't required for compatibility, because it was added later, but should generally be present.
509    #[serde(skip_serializing_if = "Option::is_none")]
510    pub related_profiles: Option<Vec<ProfileViewBasic<S>>>,
511    pub rev: S,
512    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
513    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
514}
515
516#[open_union]
517#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
518#[serde(tag = "$type", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
519pub enum LogCreateMessageMessage<S: BosStr = DefaultStr> {
520    #[serde(rename = "chat.bsky.convo.defs#messageView")]
521    MessageView(Box<convo::MessageView<S>>),
522    #[serde(rename = "chat.bsky.convo.defs#deletedMessageView")]
523    DeletedMessageView(Box<convo::DeletedMessageView<S>>),
524}
525
526/// Event indicating a user-originated message was deleted. Is not emitted for system messages.
527
528#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
529#[serde(
530    rename_all = "camelCase",
531    bound(deserialize = "S: Deserialize<'de> + BosStr")
532)]
533pub struct LogDeleteMessage<S: BosStr = DefaultStr> {
534    pub convo_id: S,
535    pub message: LogDeleteMessageMessage<S>,
536    pub rev: S,
537    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
538    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
539}
540
541#[open_union]
542#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
543#[serde(tag = "$type", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
544pub enum LogDeleteMessageMessage<S: BosStr = DefaultStr> {
545    #[serde(rename = "chat.bsky.convo.defs#messageView")]
546    MessageView(Box<convo::MessageView<S>>),
547    #[serde(rename = "chat.bsky.convo.defs#deletedMessageView")]
548    DeletedMessageView(Box<convo::DeletedMessageView<S>>),
549}
550
551/// Event indicating a join link was disabled for a group convo.
552
553#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
554#[serde(
555    rename_all = "camelCase",
556    bound(deserialize = "S: Deserialize<'de> + BosStr")
557)]
558pub struct LogDisableJoinLink<S: BosStr = DefaultStr> {
559    pub convo_id: S,
560    ///A system message with data of type #systemMessageDataDisableJoinLink
561    pub message: convo::SystemMessageView<S>,
562    pub rev: S,
563    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
564    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
565}
566
567/// Event indicating info about group convo was edited.
568
569#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
570#[serde(
571    rename_all = "camelCase",
572    bound(deserialize = "S: Deserialize<'de> + BosStr")
573)]
574pub struct LogEditGroup<S: BosStr = DefaultStr> {
575    pub convo_id: S,
576    ///A system message with data of type #systemMessageDataEditGroup
577    pub message: convo::SystemMessageView<S>,
578    pub rev: S,
579    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
580    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
581}
582
583/// Event indicating a settings about a join link for a group convo were edited.
584
585#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
586#[serde(
587    rename_all = "camelCase",
588    bound(deserialize = "S: Deserialize<'de> + BosStr")
589)]
590pub struct LogEditJoinLink<S: BosStr = DefaultStr> {
591    pub convo_id: S,
592    ///A system message with data of type #systemMessageDataEditJoinLink
593    pub message: convo::SystemMessageView<S>,
594    pub rev: S,
595    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
596    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
597}
598
599/// Event indicating a join link was enabled for a group convo.
600
601#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
602#[serde(
603    rename_all = "camelCase",
604    bound(deserialize = "S: Deserialize<'de> + BosStr")
605)]
606pub struct LogEnableJoinLink<S: BosStr = DefaultStr> {
607    pub convo_id: S,
608    ///A system message with data of type #systemMessageDataEnableJoinLink
609    pub message: convo::SystemMessageView<S>,
610    pub rev: S,
611    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
612    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
613}
614
615/// Event indicating a join request was made to a group the viewer owns. Only the owner gets this.
616
617#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
618#[serde(
619    rename_all = "camelCase",
620    bound(deserialize = "S: Deserialize<'de> + BosStr")
621)]
622pub struct LogIncomingJoinRequest<S: BosStr = DefaultStr> {
623    pub convo_id: S,
624    ///Prospective member who requested to join.
625    pub member: ProfileViewBasic<S>,
626    pub rev: S,
627    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
628    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
629}
630
631/// Event indicating the viewer left a convo. Can be direct or group.
632
633#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
634#[serde(
635    rename_all = "camelCase",
636    bound(deserialize = "S: Deserialize<'de> + BosStr")
637)]
638pub struct LogLeaveConvo<S: BosStr = DefaultStr> {
639    pub convo_id: S,
640    pub rev: S,
641    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
642    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
643}
644
645/// Event indicating a group convo was locked.
646
647#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
648#[serde(
649    rename_all = "camelCase",
650    bound(deserialize = "S: Deserialize<'de> + BosStr")
651)]
652pub struct LogLockConvo<S: BosStr = DefaultStr> {
653    pub convo_id: S,
654    ///A system message with data of type #systemMessageDataLockConvo
655    pub message: convo::SystemMessageView<S>,
656    ///Profiles referred in the system message.
657    pub related_profiles: Vec<ProfileViewBasic<S>>,
658    pub rev: S,
659    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
660    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
661}
662
663/// Event indicating a group convo was locked permanently.
664
665#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
666#[serde(
667    rename_all = "camelCase",
668    bound(deserialize = "S: Deserialize<'de> + BosStr")
669)]
670pub struct LogLockConvoPermanently<S: BosStr = DefaultStr> {
671    pub convo_id: S,
672    ///A system message with data of type #systemMessageDataLockConvoPermanently
673    pub message: convo::SystemMessageView<S>,
674    ///Profiles referred in the system message.
675    pub related_profiles: Vec<ProfileViewBasic<S>>,
676    pub rev: S,
677    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
678    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
679}
680
681/// 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).
682
683#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
684#[serde(
685    rename_all = "camelCase",
686    bound(deserialize = "S: Deserialize<'de> + BosStr")
687)]
688pub struct LogMemberJoin<S: BosStr = DefaultStr> {
689    pub convo_id: S,
690    ///A system message with data of type #systemMessageDataMemberJoin
691    pub message: convo::SystemMessageView<S>,
692    ///Profiles referred in the system message.
693    pub related_profiles: Vec<ProfileViewBasic<S>>,
694    pub rev: S,
695    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
696    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
697}
698
699/// 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).
700
701#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
702#[serde(
703    rename_all = "camelCase",
704    bound(deserialize = "S: Deserialize<'de> + BosStr")
705)]
706pub struct LogMemberLeave<S: BosStr = DefaultStr> {
707    pub convo_id: S,
708    ///A system message with data of type #systemMessageDataMemberLeave
709    pub message: convo::SystemMessageView<S>,
710    ///Profiles referred in the system message.
711    pub related_profiles: Vec<ProfileViewBasic<S>>,
712    pub rev: S,
713    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
714    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
715}
716
717/// Event indicating the viewer muted a convo. Can be direct or group.
718
719#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
720#[serde(
721    rename_all = "camelCase",
722    bound(deserialize = "S: Deserialize<'de> + BosStr")
723)]
724pub struct LogMuteConvo<S: BosStr = DefaultStr> {
725    pub convo_id: S,
726    pub rev: S,
727    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
728    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
729}
730
731/// Event indicating a join request was made by the requester. Only requester actor gets this.
732
733#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
734#[serde(
735    rename_all = "camelCase",
736    bound(deserialize = "S: Deserialize<'de> + BosStr")
737)]
738pub struct LogOutgoingJoinRequest<S: BosStr = DefaultStr> {
739    pub convo_id: S,
740    pub rev: S,
741    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
742    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
743}
744
745/// Event indicating a convo was read up to a certain message.
746
747#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
748#[serde(
749    rename_all = "camelCase",
750    bound(deserialize = "S: Deserialize<'de> + BosStr")
751)]
752pub struct LogReadConvo<S: BosStr = DefaultStr> {
753    pub convo_id: S,
754    pub message: LogReadConvoMessage<S>,
755    pub rev: S,
756    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
757    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
758}
759
760#[open_union]
761#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
762#[serde(tag = "$type", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
763pub enum LogReadConvoMessage<S: BosStr = DefaultStr> {
764    #[serde(rename = "chat.bsky.convo.defs#messageView")]
765    MessageView(Box<convo::MessageView<S>>),
766    #[serde(rename = "chat.bsky.convo.defs#deletedMessageView")]
767    DeletedMessageView(Box<convo::DeletedMessageView<S>>),
768    #[serde(rename = "chat.bsky.convo.defs#systemMessageView")]
769    SystemMessageView(Box<convo::SystemMessageView<S>>),
770}
771
772/// Event indicating the group owner marked join requests as read. Only the owner gets this.
773
774#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
775#[serde(
776    rename_all = "camelCase",
777    bound(deserialize = "S: Deserialize<'de> + BosStr")
778)]
779pub struct LogReadJoinRequests<S: BosStr = DefaultStr> {
780    pub convo_id: S,
781    pub rev: S,
782    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
783    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
784}
785
786/// DEPRECATED: use logReadConvo instead. Event indicating a convo was read up to a certain message.
787
788#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
789#[serde(
790    rename_all = "camelCase",
791    bound(deserialize = "S: Deserialize<'de> + BosStr")
792)]
793pub struct LogReadMessage<S: BosStr = DefaultStr> {
794    pub convo_id: S,
795    pub message: LogReadMessageMessage<S>,
796    pub rev: S,
797    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
798    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
799}
800
801#[open_union]
802#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
803#[serde(tag = "$type", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
804pub enum LogReadMessageMessage<S: BosStr = DefaultStr> {
805    #[serde(rename = "chat.bsky.convo.defs#messageView")]
806    MessageView(Box<convo::MessageView<S>>),
807    #[serde(rename = "chat.bsky.convo.defs#deletedMessageView")]
808    DeletedMessageView(Box<convo::DeletedMessageView<S>>),
809    #[serde(rename = "chat.bsky.convo.defs#systemMessageView")]
810    SystemMessageView(Box<convo::SystemMessageView<S>>),
811}
812
813/// Event indicating a join request was rejected by the viewer. Only the owner gets this.
814
815#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
816#[serde(
817    rename_all = "camelCase",
818    bound(deserialize = "S: Deserialize<'de> + BosStr")
819)]
820pub struct LogRejectJoinRequest<S: BosStr = DefaultStr> {
821    pub convo_id: S,
822    ///Prospective member who requested to join.
823    pub member: ProfileViewBasic<S>,
824    pub rev: S,
825    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
826    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
827}
828
829/// 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).
830
831#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
832#[serde(
833    rename_all = "camelCase",
834    bound(deserialize = "S: Deserialize<'de> + BosStr")
835)]
836pub struct LogRemoveMember<S: BosStr = DefaultStr> {
837    pub convo_id: S,
838    ///A system message with data of type #systemMessageDataRemoveMember
839    pub message: convo::SystemMessageView<S>,
840    ///Profiles referred in the system message.
841    pub related_profiles: Vec<ProfileViewBasic<S>>,
842    pub rev: S,
843    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
844    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
845}
846
847/// Event indicating a reaction was removed from a message.
848
849#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
850#[serde(
851    rename_all = "camelCase",
852    bound(deserialize = "S: Deserialize<'de> + BosStr")
853)]
854pub struct LogRemoveReaction<S: BosStr = DefaultStr> {
855    pub convo_id: S,
856    pub message: LogRemoveReactionMessage<S>,
857    pub reaction: convo::ReactionView<S>,
858    ///Profiles referred in the message and reaction views. This isn't required for compatibility, because it was added later, but should generally be present.
859    #[serde(skip_serializing_if = "Option::is_none")]
860    pub related_profiles: Option<Vec<ProfileViewBasic<S>>>,
861    pub rev: S,
862    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
863    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
864}
865
866#[open_union]
867#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
868#[serde(tag = "$type", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
869pub enum LogRemoveReactionMessage<S: BosStr = DefaultStr> {
870    #[serde(rename = "chat.bsky.convo.defs#messageView")]
871    MessageView(Box<convo::MessageView<S>>),
872    #[serde(rename = "chat.bsky.convo.defs#deletedMessageView")]
873    DeletedMessageView(Box<convo::DeletedMessageView<S>>),
874}
875
876/// Event indicating a group convo was unlocked.
877
878#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
879#[serde(
880    rename_all = "camelCase",
881    bound(deserialize = "S: Deserialize<'de> + BosStr")
882)]
883pub struct LogUnlockConvo<S: BosStr = DefaultStr> {
884    pub convo_id: S,
885    ///A system message with data of type #systemMessageDataUnlockConvo
886    pub message: convo::SystemMessageView<S>,
887    ///Profiles referred in the system message.
888    pub related_profiles: Vec<ProfileViewBasic<S>>,
889    pub rev: S,
890    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
891    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
892}
893
894/// Event indicating the viewer unmuted a convo. Can be direct or group.
895
896#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
897#[serde(
898    rename_all = "camelCase",
899    bound(deserialize = "S: Deserialize<'de> + BosStr")
900)]
901pub struct LogUnmuteConvo<S: BosStr = DefaultStr> {
902    pub convo_id: S,
903    pub rev: S,
904    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
905    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
906}
907
908/// Event indicating a prospective member withdrew their join request. Only the owner gets this.
909
910#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
911#[serde(
912    rename_all = "camelCase",
913    bound(deserialize = "S: Deserialize<'de> + BosStr")
914)]
915pub struct LogWithdrawIncomingJoinRequest<S: BosStr = DefaultStr> {
916    pub convo_id: S,
917    ///Prospective member who withdrew their join request.
918    pub member: ProfileViewBasic<S>,
919    pub rev: S,
920    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
921    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
922}
923
924/// Event indicating the viewer withdrew their own join request. Only requester actor gets this.
925
926#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
927#[serde(
928    rename_all = "camelCase",
929    bound(deserialize = "S: Deserialize<'de> + BosStr")
930)]
931pub struct LogWithdrawOutgoingJoinRequest<S: BosStr = DefaultStr> {
932    pub convo_id: S,
933    pub rev: S,
934    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
935    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
936}
937
938#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
939#[serde(
940    rename_all = "camelCase",
941    bound(deserialize = "S: Deserialize<'de> + BosStr")
942)]
943pub struct MessageAndReactionView<S: BosStr = DefaultStr> {
944    pub message: convo::MessageView<S>,
945    pub reaction: convo::ReactionView<S>,
946    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
947    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
948}
949
950/// 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.
951
952#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
953#[serde(
954    rename_all = "camelCase",
955    bound(deserialize = "S: Deserialize<'de> + BosStr")
956)]
957pub struct MessageBeforeUserJoinedGroupView<S: BosStr = DefaultStr> {
958    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
959    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
960}
961
962#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
963#[serde(
964    rename_all = "camelCase",
965    bound(deserialize = "S: Deserialize<'de> + BosStr")
966)]
967pub struct MessageInput<S: BosStr = DefaultStr> {
968    #[serde(skip_serializing_if = "Option::is_none")]
969    pub embed: Option<MessageInputEmbed<S>>,
970    ///Annotations of text (mentions, URLs, hashtags, etc)
971    #[serde(skip_serializing_if = "Option::is_none")]
972    pub facets: Option<Vec<Facet<S>>>,
973    ///If set, the message this message is replying to. The referenced message must be in the same convo.
974    #[serde(skip_serializing_if = "Option::is_none")]
975    pub reply_to: Option<convo::ReplyRef<S>>,
976    pub text: S,
977    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
978    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
979}
980
981#[open_union]
982#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
983#[serde(tag = "$type", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
984pub enum MessageInputEmbed<S: BosStr = DefaultStr> {
985    #[serde(rename = "app.bsky.embed.record")]
986    Record(Box<Record<S>>),
987    #[serde(rename = "chat.bsky.embed.joinLink")]
988    JoinLink(Box<JoinLink<S>>),
989}
990
991#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
992#[serde(
993    rename_all = "camelCase",
994    bound(deserialize = "S: Deserialize<'de> + BosStr")
995)]
996pub struct MessageRef<S: BosStr = DefaultStr> {
997    pub convo_id: S,
998    pub did: Did<S>,
999    pub message_id: S,
1000    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
1001    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
1002}
1003
1004#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
1005#[serde(
1006    rename_all = "camelCase",
1007    bound(deserialize = "S: Deserialize<'de> + BosStr")
1008)]
1009pub struct MessageView<S: BosStr = DefaultStr> {
1010    #[serde(skip_serializing_if = "Option::is_none")]
1011    pub embed: Option<MessageViewEmbed<S>>,
1012    ///Annotations of text (mentions, URLs, hashtags, etc)
1013    #[serde(skip_serializing_if = "Option::is_none")]
1014    pub facets: Option<Vec<Facet<S>>>,
1015    pub id: S,
1016    ///Reactions to this message, in ascending order of creation time.
1017    #[serde(skip_serializing_if = "Option::is_none")]
1018    pub reactions: Option<Vec<convo::ReactionView<S>>>,
1019    ///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.
1020    #[serde(skip_serializing_if = "Option::is_none")]
1021    pub reply_to: Option<MessageViewReplyTo<S>>,
1022    pub rev: S,
1023    pub sender: convo::MessageViewSender<S>,
1024    pub sent_at: Datetime,
1025    pub text: S,
1026    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
1027    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
1028}
1029
1030#[open_union]
1031#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
1032#[serde(tag = "$type", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
1033pub enum MessageViewEmbed<S: BosStr = DefaultStr> {
1034    #[serde(rename = "app.bsky.embed.record#view")]
1035    RecordView(Box<record::View<S>>),
1036    #[serde(rename = "chat.bsky.embed.joinLink#view")]
1037    JoinLinkView(Box<join_link::View<S>>),
1038}
1039
1040#[open_union]
1041#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
1042#[serde(tag = "$type", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
1043pub enum MessageViewReplyTo<S: BosStr = DefaultStr> {
1044    #[serde(rename = "chat.bsky.convo.defs#messageView")]
1045    MessageView(Box<convo::MessageView<S>>),
1046    #[serde(rename = "chat.bsky.convo.defs#deletedMessageView")]
1047    DeletedMessageView(Box<convo::DeletedMessageView<S>>),
1048    #[serde(rename = "chat.bsky.convo.defs#messageBeforeUserJoinedGroupView")]
1049    MessageBeforeUserJoinedGroupView(Box<convo::MessageBeforeUserJoinedGroupView<S>>),
1050}
1051
1052#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
1053#[serde(
1054    rename_all = "camelCase",
1055    bound(deserialize = "S: Deserialize<'de> + BosStr")
1056)]
1057pub struct MessageViewSender<S: BosStr = DefaultStr> {
1058    pub did: Did<S>,
1059    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
1060    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
1061}
1062
1063#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
1064#[serde(
1065    rename_all = "camelCase",
1066    bound(deserialize = "S: Deserialize<'de> + BosStr")
1067)]
1068pub struct ReactionView<S: BosStr = DefaultStr> {
1069    pub created_at: Datetime,
1070    pub sender: convo::ReactionViewSender<S>,
1071    pub value: S,
1072    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
1073    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
1074}
1075
1076#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
1077#[serde(
1078    rename_all = "camelCase",
1079    bound(deserialize = "S: Deserialize<'de> + BosStr")
1080)]
1081pub struct ReactionViewSender<S: BosStr = DefaultStr> {
1082    pub did: Did<S>,
1083    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
1084    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
1085}
1086
1087/// A reference to another message within the same convo, used to indicate that a message is a reply to it.
1088
1089#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
1090#[serde(
1091    rename_all = "camelCase",
1092    bound(deserialize = "S: Deserialize<'de> + BosStr")
1093)]
1094pub struct ReplyRef<S: BosStr = DefaultStr> {
1095    pub message_id: S,
1096    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
1097    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
1098}
1099
1100/// System message indicating a user was added to the group convo.
1101
1102#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
1103#[serde(
1104    rename_all = "camelCase",
1105    bound(deserialize = "S: Deserialize<'de> + BosStr")
1106)]
1107pub struct SystemMessageDataAddMember<S: BosStr = DefaultStr> {
1108    pub added_by: convo::SystemMessageReferredUser<S>,
1109    ///Current view of the member who was added.
1110    pub member: convo::SystemMessageReferredUser<S>,
1111    ///Role the user was added to the group with. The role from 'member' will reflect the current data, not historical.
1112    pub role: MemberRole<S>,
1113    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
1114    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
1115}
1116
1117/// System message indicating the group join link was created.
1118
1119#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
1120#[serde(
1121    rename_all = "camelCase",
1122    bound(deserialize = "S: Deserialize<'de> + BosStr")
1123)]
1124pub struct SystemMessageDataCreateJoinLink<S: BosStr = DefaultStr> {
1125    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
1126    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
1127}
1128
1129/// System message indicating the group join link was disabled.
1130
1131#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
1132#[serde(
1133    rename_all = "camelCase",
1134    bound(deserialize = "S: Deserialize<'de> + BosStr")
1135)]
1136pub struct SystemMessageDataDisableJoinLink<S: BosStr = DefaultStr> {
1137    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
1138    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
1139}
1140
1141/// System message indicating the group info was edited.
1142
1143#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
1144#[serde(
1145    rename_all = "camelCase",
1146    bound(deserialize = "S: Deserialize<'de> + BosStr")
1147)]
1148pub struct SystemMessageDataEditGroup<S: BosStr = DefaultStr> {
1149    ///Group name that replaced the old.
1150    #[serde(skip_serializing_if = "Option::is_none")]
1151    pub new_name: Option<S>,
1152    ///Group name that was replaced.
1153    #[serde(skip_serializing_if = "Option::is_none")]
1154    pub old_name: Option<S>,
1155    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
1156    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
1157}
1158
1159/// System message indicating the group join link was edited.
1160
1161#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
1162#[serde(
1163    rename_all = "camelCase",
1164    bound(deserialize = "S: Deserialize<'de> + BosStr")
1165)]
1166pub struct SystemMessageDataEditJoinLink<S: BosStr = DefaultStr> {
1167    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
1168    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
1169}
1170
1171/// System message indicating the group join link was enabled.
1172
1173#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
1174#[serde(
1175    rename_all = "camelCase",
1176    bound(deserialize = "S: Deserialize<'de> + BosStr")
1177)]
1178pub struct SystemMessageDataEnableJoinLink<S: BosStr = DefaultStr> {
1179    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
1180    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
1181}
1182
1183/// System message indicating the group convo was locked.
1184
1185#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
1186#[serde(
1187    rename_all = "camelCase",
1188    bound(deserialize = "S: Deserialize<'de> + BosStr")
1189)]
1190pub struct SystemMessageDataLockConvo<S: BosStr = DefaultStr> {
1191    ///Current view of the member who locked the group.
1192    pub locked_by: convo::SystemMessageReferredUser<S>,
1193    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
1194    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
1195}
1196
1197/// System message indicating the group convo was locked permanently.
1198
1199#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
1200#[serde(
1201    rename_all = "camelCase",
1202    bound(deserialize = "S: Deserialize<'de> + BosStr")
1203)]
1204pub struct SystemMessageDataLockConvoPermanently<S: BosStr = DefaultStr> {
1205    ///Current view of the member who locked the group.
1206    pub locked_by: convo::SystemMessageReferredUser<S>,
1207    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
1208    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
1209}
1210
1211/// System message indicating a user joined the group convo via join link.
1212
1213#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
1214#[serde(
1215    rename_all = "camelCase",
1216    bound(deserialize = "S: Deserialize<'de> + BosStr")
1217)]
1218pub struct SystemMessageDataMemberJoin<S: BosStr = DefaultStr> {
1219    ///If join link was configured to require approval, this will be set to who approved the request. Undefined if approval was not required.
1220    #[serde(skip_serializing_if = "Option::is_none")]
1221    pub approved_by: Option<convo::SystemMessageReferredUser<S>>,
1222    ///Current view of the member who joined.
1223    pub member: convo::SystemMessageReferredUser<S>,
1224    ///Role the user was added to the group with. The role from 'member' will reflect the current data, not historical.
1225    pub role: MemberRole<S>,
1226    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
1227    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
1228}
1229
1230/// System message indicating a user voluntarily left the group convo.
1231
1232#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
1233#[serde(
1234    rename_all = "camelCase",
1235    bound(deserialize = "S: Deserialize<'de> + BosStr")
1236)]
1237pub struct SystemMessageDataMemberLeave<S: BosStr = DefaultStr> {
1238    ///Current view of the member who left the group.
1239    pub member: convo::SystemMessageReferredUser<S>,
1240    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
1241    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
1242}
1243
1244/// System message indicating a user was removed from the group convo.
1245
1246#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
1247#[serde(
1248    rename_all = "camelCase",
1249    bound(deserialize = "S: Deserialize<'de> + BosStr")
1250)]
1251pub struct SystemMessageDataRemoveMember<S: BosStr = DefaultStr> {
1252    ///Current view of the member who was removed.
1253    pub member: convo::SystemMessageReferredUser<S>,
1254    pub removed_by: convo::SystemMessageReferredUser<S>,
1255    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
1256    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
1257}
1258
1259/// System message indicating the group convo was unlocked.
1260
1261#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
1262#[serde(
1263    rename_all = "camelCase",
1264    bound(deserialize = "S: Deserialize<'de> + BosStr")
1265)]
1266pub struct SystemMessageDataUnlockConvo<S: BosStr = DefaultStr> {
1267    ///Current view of the member who unlocked the group.
1268    pub unlocked_by: convo::SystemMessageReferredUser<S>,
1269    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
1270    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
1271}
1272
1273#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
1274#[serde(
1275    rename_all = "camelCase",
1276    bound(deserialize = "S: Deserialize<'de> + BosStr")
1277)]
1278pub struct SystemMessageReferredUser<S: BosStr = DefaultStr> {
1279    pub did: Did<S>,
1280    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
1281    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
1282}
1283
1284#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
1285#[serde(
1286    rename_all = "camelCase",
1287    bound(deserialize = "S: Deserialize<'de> + BosStr")
1288)]
1289pub struct SystemMessageView<S: BosStr = DefaultStr> {
1290    pub data: SystemMessageViewData<S>,
1291    pub id: S,
1292    pub rev: S,
1293    pub sent_at: Datetime,
1294    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
1295    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
1296}
1297
1298#[open_union]
1299#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
1300#[serde(tag = "$type", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
1301pub enum SystemMessageViewData<S: BosStr = DefaultStr> {
1302    #[serde(rename = "chat.bsky.convo.defs#systemMessageDataAddMember")]
1303    SystemMessageDataAddMember(Box<convo::SystemMessageDataAddMember<S>>),
1304    #[serde(rename = "chat.bsky.convo.defs#systemMessageDataRemoveMember")]
1305    SystemMessageDataRemoveMember(Box<convo::SystemMessageDataRemoveMember<S>>),
1306    #[serde(rename = "chat.bsky.convo.defs#systemMessageDataMemberJoin")]
1307    SystemMessageDataMemberJoin(Box<convo::SystemMessageDataMemberJoin<S>>),
1308    #[serde(rename = "chat.bsky.convo.defs#systemMessageDataMemberLeave")]
1309    SystemMessageDataMemberLeave(Box<convo::SystemMessageDataMemberLeave<S>>),
1310    #[serde(rename = "chat.bsky.convo.defs#systemMessageDataLockConvo")]
1311    SystemMessageDataLockConvo(Box<convo::SystemMessageDataLockConvo<S>>),
1312    #[serde(rename = "chat.bsky.convo.defs#systemMessageDataUnlockConvo")]
1313    SystemMessageDataUnlockConvo(Box<convo::SystemMessageDataUnlockConvo<S>>),
1314    #[serde(rename = "chat.bsky.convo.defs#systemMessageDataLockConvoPermanently")]
1315    SystemMessageDataLockConvoPermanently(Box<convo::SystemMessageDataLockConvoPermanently<S>>),
1316    #[serde(rename = "chat.bsky.convo.defs#systemMessageDataEditGroup")]
1317    SystemMessageDataEditGroup(Box<convo::SystemMessageDataEditGroup<S>>),
1318    #[serde(rename = "chat.bsky.convo.defs#systemMessageDataCreateJoinLink")]
1319    SystemMessageDataCreateJoinLink(Box<convo::SystemMessageDataCreateJoinLink<S>>),
1320    #[serde(rename = "chat.bsky.convo.defs#systemMessageDataEditJoinLink")]
1321    SystemMessageDataEditJoinLink(Box<convo::SystemMessageDataEditJoinLink<S>>),
1322    #[serde(rename = "chat.bsky.convo.defs#systemMessageDataEnableJoinLink")]
1323    SystemMessageDataEnableJoinLink(Box<convo::SystemMessageDataEnableJoinLink<S>>),
1324    #[serde(rename = "chat.bsky.convo.defs#systemMessageDataDisableJoinLink")]
1325    SystemMessageDataDisableJoinLink(Box<convo::SystemMessageDataDisableJoinLink<S>>),
1326}
1327
1328impl<S: BosStr> LexiconSchema for ConvoRef<S> {
1329    fn nsid() -> &'static str {
1330        "chat.bsky.convo.defs"
1331    }
1332    fn def_name() -> &'static str {
1333        "convoRef"
1334    }
1335    fn lexicon_doc() -> LexiconDoc<'static> {
1336        lexicon_doc_chat_bsky_convo_defs()
1337    }
1338    fn validate(&self) -> Result<(), ConstraintError> {
1339        Ok(())
1340    }
1341}
1342
1343impl<S: BosStr> LexiconSchema for ConvoView<S> {
1344    fn nsid() -> &'static str {
1345        "chat.bsky.convo.defs"
1346    }
1347    fn def_name() -> &'static str {
1348        "convoView"
1349    }
1350    fn lexicon_doc() -> LexiconDoc<'static> {
1351        lexicon_doc_chat_bsky_convo_defs()
1352    }
1353    fn validate(&self) -> Result<(), ConstraintError> {
1354        Ok(())
1355    }
1356}
1357
1358impl<S: BosStr> LexiconSchema for DeletedMessageView<S> {
1359    fn nsid() -> &'static str {
1360        "chat.bsky.convo.defs"
1361    }
1362    fn def_name() -> &'static str {
1363        "deletedMessageView"
1364    }
1365    fn lexicon_doc() -> LexiconDoc<'static> {
1366        lexicon_doc_chat_bsky_convo_defs()
1367    }
1368    fn validate(&self) -> Result<(), ConstraintError> {
1369        Ok(())
1370    }
1371}
1372
1373impl<S: BosStr> LexiconSchema for DirectConvo<S> {
1374    fn nsid() -> &'static str {
1375        "chat.bsky.convo.defs"
1376    }
1377    fn def_name() -> &'static str {
1378        "directConvo"
1379    }
1380    fn lexicon_doc() -> LexiconDoc<'static> {
1381        lexicon_doc_chat_bsky_convo_defs()
1382    }
1383    fn validate(&self) -> Result<(), ConstraintError> {
1384        Ok(())
1385    }
1386}
1387
1388impl<S: BosStr> LexiconSchema for GroupConvo<S> {
1389    fn nsid() -> &'static str {
1390        "chat.bsky.convo.defs"
1391    }
1392    fn def_name() -> &'static str {
1393        "groupConvo"
1394    }
1395    fn lexicon_doc() -> LexiconDoc<'static> {
1396        lexicon_doc_chat_bsky_convo_defs()
1397    }
1398    fn validate(&self) -> Result<(), ConstraintError> {
1399        {
1400            let value = &self.name;
1401            #[allow(unused_comparisons)]
1402            if <str>::len(value.as_ref()) > 500usize {
1403                return Err(ConstraintError::MaxLength {
1404                    path: ValidationPath::from_field("name"),
1405                    max: 500usize,
1406                    actual: <str>::len(value.as_ref()),
1407                });
1408            }
1409        }
1410        {
1411            let value = &self.name;
1412            {
1413                let count = UnicodeSegmentation::graphemes(value.as_ref(), true).count();
1414                if count > 50usize {
1415                    return Err(ConstraintError::MaxGraphemes {
1416                        path: ValidationPath::from_field("name"),
1417                        max: 50usize,
1418                        actual: count,
1419                    });
1420                }
1421            }
1422        }
1423        Ok(())
1424    }
1425}
1426
1427impl<S: BosStr> LexiconSchema for LogAcceptConvo<S> {
1428    fn nsid() -> &'static str {
1429        "chat.bsky.convo.defs"
1430    }
1431    fn def_name() -> &'static str {
1432        "logAcceptConvo"
1433    }
1434    fn lexicon_doc() -> LexiconDoc<'static> {
1435        lexicon_doc_chat_bsky_convo_defs()
1436    }
1437    fn validate(&self) -> Result<(), ConstraintError> {
1438        Ok(())
1439    }
1440}
1441
1442impl<S: BosStr> LexiconSchema for LogAddMember<S> {
1443    fn nsid() -> &'static str {
1444        "chat.bsky.convo.defs"
1445    }
1446    fn def_name() -> &'static str {
1447        "logAddMember"
1448    }
1449    fn lexicon_doc() -> LexiconDoc<'static> {
1450        lexicon_doc_chat_bsky_convo_defs()
1451    }
1452    fn validate(&self) -> Result<(), ConstraintError> {
1453        Ok(())
1454    }
1455}
1456
1457impl<S: BosStr> LexiconSchema for LogAddReaction<S> {
1458    fn nsid() -> &'static str {
1459        "chat.bsky.convo.defs"
1460    }
1461    fn def_name() -> &'static str {
1462        "logAddReaction"
1463    }
1464    fn lexicon_doc() -> LexiconDoc<'static> {
1465        lexicon_doc_chat_bsky_convo_defs()
1466    }
1467    fn validate(&self) -> Result<(), ConstraintError> {
1468        Ok(())
1469    }
1470}
1471
1472impl<S: BosStr> LexiconSchema for LogApproveJoinRequest<S> {
1473    fn nsid() -> &'static str {
1474        "chat.bsky.convo.defs"
1475    }
1476    fn def_name() -> &'static str {
1477        "logApproveJoinRequest"
1478    }
1479    fn lexicon_doc() -> LexiconDoc<'static> {
1480        lexicon_doc_chat_bsky_convo_defs()
1481    }
1482    fn validate(&self) -> Result<(), ConstraintError> {
1483        Ok(())
1484    }
1485}
1486
1487impl<S: BosStr> LexiconSchema for LogBeginConvo<S> {
1488    fn nsid() -> &'static str {
1489        "chat.bsky.convo.defs"
1490    }
1491    fn def_name() -> &'static str {
1492        "logBeginConvo"
1493    }
1494    fn lexicon_doc() -> LexiconDoc<'static> {
1495        lexicon_doc_chat_bsky_convo_defs()
1496    }
1497    fn validate(&self) -> Result<(), ConstraintError> {
1498        Ok(())
1499    }
1500}
1501
1502impl<S: BosStr> LexiconSchema for LogCreateJoinLink<S> {
1503    fn nsid() -> &'static str {
1504        "chat.bsky.convo.defs"
1505    }
1506    fn def_name() -> &'static str {
1507        "logCreateJoinLink"
1508    }
1509    fn lexicon_doc() -> LexiconDoc<'static> {
1510        lexicon_doc_chat_bsky_convo_defs()
1511    }
1512    fn validate(&self) -> Result<(), ConstraintError> {
1513        Ok(())
1514    }
1515}
1516
1517impl<S: BosStr> LexiconSchema for LogCreateMessage<S> {
1518    fn nsid() -> &'static str {
1519        "chat.bsky.convo.defs"
1520    }
1521    fn def_name() -> &'static str {
1522        "logCreateMessage"
1523    }
1524    fn lexicon_doc() -> LexiconDoc<'static> {
1525        lexicon_doc_chat_bsky_convo_defs()
1526    }
1527    fn validate(&self) -> Result<(), ConstraintError> {
1528        Ok(())
1529    }
1530}
1531
1532impl<S: BosStr> LexiconSchema for LogDeleteMessage<S> {
1533    fn nsid() -> &'static str {
1534        "chat.bsky.convo.defs"
1535    }
1536    fn def_name() -> &'static str {
1537        "logDeleteMessage"
1538    }
1539    fn lexicon_doc() -> LexiconDoc<'static> {
1540        lexicon_doc_chat_bsky_convo_defs()
1541    }
1542    fn validate(&self) -> Result<(), ConstraintError> {
1543        Ok(())
1544    }
1545}
1546
1547impl<S: BosStr> LexiconSchema for LogDisableJoinLink<S> {
1548    fn nsid() -> &'static str {
1549        "chat.bsky.convo.defs"
1550    }
1551    fn def_name() -> &'static str {
1552        "logDisableJoinLink"
1553    }
1554    fn lexicon_doc() -> LexiconDoc<'static> {
1555        lexicon_doc_chat_bsky_convo_defs()
1556    }
1557    fn validate(&self) -> Result<(), ConstraintError> {
1558        Ok(())
1559    }
1560}
1561
1562impl<S: BosStr> LexiconSchema for LogEditGroup<S> {
1563    fn nsid() -> &'static str {
1564        "chat.bsky.convo.defs"
1565    }
1566    fn def_name() -> &'static str {
1567        "logEditGroup"
1568    }
1569    fn lexicon_doc() -> LexiconDoc<'static> {
1570        lexicon_doc_chat_bsky_convo_defs()
1571    }
1572    fn validate(&self) -> Result<(), ConstraintError> {
1573        Ok(())
1574    }
1575}
1576
1577impl<S: BosStr> LexiconSchema for LogEditJoinLink<S> {
1578    fn nsid() -> &'static str {
1579        "chat.bsky.convo.defs"
1580    }
1581    fn def_name() -> &'static str {
1582        "logEditJoinLink"
1583    }
1584    fn lexicon_doc() -> LexiconDoc<'static> {
1585        lexicon_doc_chat_bsky_convo_defs()
1586    }
1587    fn validate(&self) -> Result<(), ConstraintError> {
1588        Ok(())
1589    }
1590}
1591
1592impl<S: BosStr> LexiconSchema for LogEnableJoinLink<S> {
1593    fn nsid() -> &'static str {
1594        "chat.bsky.convo.defs"
1595    }
1596    fn def_name() -> &'static str {
1597        "logEnableJoinLink"
1598    }
1599    fn lexicon_doc() -> LexiconDoc<'static> {
1600        lexicon_doc_chat_bsky_convo_defs()
1601    }
1602    fn validate(&self) -> Result<(), ConstraintError> {
1603        Ok(())
1604    }
1605}
1606
1607impl<S: BosStr> LexiconSchema for LogIncomingJoinRequest<S> {
1608    fn nsid() -> &'static str {
1609        "chat.bsky.convo.defs"
1610    }
1611    fn def_name() -> &'static str {
1612        "logIncomingJoinRequest"
1613    }
1614    fn lexicon_doc() -> LexiconDoc<'static> {
1615        lexicon_doc_chat_bsky_convo_defs()
1616    }
1617    fn validate(&self) -> Result<(), ConstraintError> {
1618        Ok(())
1619    }
1620}
1621
1622impl<S: BosStr> LexiconSchema for LogLeaveConvo<S> {
1623    fn nsid() -> &'static str {
1624        "chat.bsky.convo.defs"
1625    }
1626    fn def_name() -> &'static str {
1627        "logLeaveConvo"
1628    }
1629    fn lexicon_doc() -> LexiconDoc<'static> {
1630        lexicon_doc_chat_bsky_convo_defs()
1631    }
1632    fn validate(&self) -> Result<(), ConstraintError> {
1633        Ok(())
1634    }
1635}
1636
1637impl<S: BosStr> LexiconSchema for LogLockConvo<S> {
1638    fn nsid() -> &'static str {
1639        "chat.bsky.convo.defs"
1640    }
1641    fn def_name() -> &'static str {
1642        "logLockConvo"
1643    }
1644    fn lexicon_doc() -> LexiconDoc<'static> {
1645        lexicon_doc_chat_bsky_convo_defs()
1646    }
1647    fn validate(&self) -> Result<(), ConstraintError> {
1648        Ok(())
1649    }
1650}
1651
1652impl<S: BosStr> LexiconSchema for LogLockConvoPermanently<S> {
1653    fn nsid() -> &'static str {
1654        "chat.bsky.convo.defs"
1655    }
1656    fn def_name() -> &'static str {
1657        "logLockConvoPermanently"
1658    }
1659    fn lexicon_doc() -> LexiconDoc<'static> {
1660        lexicon_doc_chat_bsky_convo_defs()
1661    }
1662    fn validate(&self) -> Result<(), ConstraintError> {
1663        Ok(())
1664    }
1665}
1666
1667impl<S: BosStr> LexiconSchema for LogMemberJoin<S> {
1668    fn nsid() -> &'static str {
1669        "chat.bsky.convo.defs"
1670    }
1671    fn def_name() -> &'static str {
1672        "logMemberJoin"
1673    }
1674    fn lexicon_doc() -> LexiconDoc<'static> {
1675        lexicon_doc_chat_bsky_convo_defs()
1676    }
1677    fn validate(&self) -> Result<(), ConstraintError> {
1678        Ok(())
1679    }
1680}
1681
1682impl<S: BosStr> LexiconSchema for LogMemberLeave<S> {
1683    fn nsid() -> &'static str {
1684        "chat.bsky.convo.defs"
1685    }
1686    fn def_name() -> &'static str {
1687        "logMemberLeave"
1688    }
1689    fn lexicon_doc() -> LexiconDoc<'static> {
1690        lexicon_doc_chat_bsky_convo_defs()
1691    }
1692    fn validate(&self) -> Result<(), ConstraintError> {
1693        Ok(())
1694    }
1695}
1696
1697impl<S: BosStr> LexiconSchema for LogMuteConvo<S> {
1698    fn nsid() -> &'static str {
1699        "chat.bsky.convo.defs"
1700    }
1701    fn def_name() -> &'static str {
1702        "logMuteConvo"
1703    }
1704    fn lexicon_doc() -> LexiconDoc<'static> {
1705        lexicon_doc_chat_bsky_convo_defs()
1706    }
1707    fn validate(&self) -> Result<(), ConstraintError> {
1708        Ok(())
1709    }
1710}
1711
1712impl<S: BosStr> LexiconSchema for LogOutgoingJoinRequest<S> {
1713    fn nsid() -> &'static str {
1714        "chat.bsky.convo.defs"
1715    }
1716    fn def_name() -> &'static str {
1717        "logOutgoingJoinRequest"
1718    }
1719    fn lexicon_doc() -> LexiconDoc<'static> {
1720        lexicon_doc_chat_bsky_convo_defs()
1721    }
1722    fn validate(&self) -> Result<(), ConstraintError> {
1723        Ok(())
1724    }
1725}
1726
1727impl<S: BosStr> LexiconSchema for LogReadConvo<S> {
1728    fn nsid() -> &'static str {
1729        "chat.bsky.convo.defs"
1730    }
1731    fn def_name() -> &'static str {
1732        "logReadConvo"
1733    }
1734    fn lexicon_doc() -> LexiconDoc<'static> {
1735        lexicon_doc_chat_bsky_convo_defs()
1736    }
1737    fn validate(&self) -> Result<(), ConstraintError> {
1738        Ok(())
1739    }
1740}
1741
1742impl<S: BosStr> LexiconSchema for LogReadJoinRequests<S> {
1743    fn nsid() -> &'static str {
1744        "chat.bsky.convo.defs"
1745    }
1746    fn def_name() -> &'static str {
1747        "logReadJoinRequests"
1748    }
1749    fn lexicon_doc() -> LexiconDoc<'static> {
1750        lexicon_doc_chat_bsky_convo_defs()
1751    }
1752    fn validate(&self) -> Result<(), ConstraintError> {
1753        Ok(())
1754    }
1755}
1756
1757impl<S: BosStr> LexiconSchema for LogReadMessage<S> {
1758    fn nsid() -> &'static str {
1759        "chat.bsky.convo.defs"
1760    }
1761    fn def_name() -> &'static str {
1762        "logReadMessage"
1763    }
1764    fn lexicon_doc() -> LexiconDoc<'static> {
1765        lexicon_doc_chat_bsky_convo_defs()
1766    }
1767    fn validate(&self) -> Result<(), ConstraintError> {
1768        Ok(())
1769    }
1770}
1771
1772impl<S: BosStr> LexiconSchema for LogRejectJoinRequest<S> {
1773    fn nsid() -> &'static str {
1774        "chat.bsky.convo.defs"
1775    }
1776    fn def_name() -> &'static str {
1777        "logRejectJoinRequest"
1778    }
1779    fn lexicon_doc() -> LexiconDoc<'static> {
1780        lexicon_doc_chat_bsky_convo_defs()
1781    }
1782    fn validate(&self) -> Result<(), ConstraintError> {
1783        Ok(())
1784    }
1785}
1786
1787impl<S: BosStr> LexiconSchema for LogRemoveMember<S> {
1788    fn nsid() -> &'static str {
1789        "chat.bsky.convo.defs"
1790    }
1791    fn def_name() -> &'static str {
1792        "logRemoveMember"
1793    }
1794    fn lexicon_doc() -> LexiconDoc<'static> {
1795        lexicon_doc_chat_bsky_convo_defs()
1796    }
1797    fn validate(&self) -> Result<(), ConstraintError> {
1798        Ok(())
1799    }
1800}
1801
1802impl<S: BosStr> LexiconSchema for LogRemoveReaction<S> {
1803    fn nsid() -> &'static str {
1804        "chat.bsky.convo.defs"
1805    }
1806    fn def_name() -> &'static str {
1807        "logRemoveReaction"
1808    }
1809    fn lexicon_doc() -> LexiconDoc<'static> {
1810        lexicon_doc_chat_bsky_convo_defs()
1811    }
1812    fn validate(&self) -> Result<(), ConstraintError> {
1813        Ok(())
1814    }
1815}
1816
1817impl<S: BosStr> LexiconSchema for LogUnlockConvo<S> {
1818    fn nsid() -> &'static str {
1819        "chat.bsky.convo.defs"
1820    }
1821    fn def_name() -> &'static str {
1822        "logUnlockConvo"
1823    }
1824    fn lexicon_doc() -> LexiconDoc<'static> {
1825        lexicon_doc_chat_bsky_convo_defs()
1826    }
1827    fn validate(&self) -> Result<(), ConstraintError> {
1828        Ok(())
1829    }
1830}
1831
1832impl<S: BosStr> LexiconSchema for LogUnmuteConvo<S> {
1833    fn nsid() -> &'static str {
1834        "chat.bsky.convo.defs"
1835    }
1836    fn def_name() -> &'static str {
1837        "logUnmuteConvo"
1838    }
1839    fn lexicon_doc() -> LexiconDoc<'static> {
1840        lexicon_doc_chat_bsky_convo_defs()
1841    }
1842    fn validate(&self) -> Result<(), ConstraintError> {
1843        Ok(())
1844    }
1845}
1846
1847impl<S: BosStr> LexiconSchema for LogWithdrawIncomingJoinRequest<S> {
1848    fn nsid() -> &'static str {
1849        "chat.bsky.convo.defs"
1850    }
1851    fn def_name() -> &'static str {
1852        "logWithdrawIncomingJoinRequest"
1853    }
1854    fn lexicon_doc() -> LexiconDoc<'static> {
1855        lexicon_doc_chat_bsky_convo_defs()
1856    }
1857    fn validate(&self) -> Result<(), ConstraintError> {
1858        Ok(())
1859    }
1860}
1861
1862impl<S: BosStr> LexiconSchema for LogWithdrawOutgoingJoinRequest<S> {
1863    fn nsid() -> &'static str {
1864        "chat.bsky.convo.defs"
1865    }
1866    fn def_name() -> &'static str {
1867        "logWithdrawOutgoingJoinRequest"
1868    }
1869    fn lexicon_doc() -> LexiconDoc<'static> {
1870        lexicon_doc_chat_bsky_convo_defs()
1871    }
1872    fn validate(&self) -> Result<(), ConstraintError> {
1873        Ok(())
1874    }
1875}
1876
1877impl<S: BosStr> LexiconSchema for MessageAndReactionView<S> {
1878    fn nsid() -> &'static str {
1879        "chat.bsky.convo.defs"
1880    }
1881    fn def_name() -> &'static str {
1882        "messageAndReactionView"
1883    }
1884    fn lexicon_doc() -> LexiconDoc<'static> {
1885        lexicon_doc_chat_bsky_convo_defs()
1886    }
1887    fn validate(&self) -> Result<(), ConstraintError> {
1888        Ok(())
1889    }
1890}
1891
1892impl<S: BosStr> LexiconSchema for MessageBeforeUserJoinedGroupView<S> {
1893    fn nsid() -> &'static str {
1894        "chat.bsky.convo.defs"
1895    }
1896    fn def_name() -> &'static str {
1897        "messageBeforeUserJoinedGroupView"
1898    }
1899    fn lexicon_doc() -> LexiconDoc<'static> {
1900        lexicon_doc_chat_bsky_convo_defs()
1901    }
1902    fn validate(&self) -> Result<(), ConstraintError> {
1903        Ok(())
1904    }
1905}
1906
1907impl<S: BosStr> LexiconSchema for MessageInput<S> {
1908    fn nsid() -> &'static str {
1909        "chat.bsky.convo.defs"
1910    }
1911    fn def_name() -> &'static str {
1912        "messageInput"
1913    }
1914    fn lexicon_doc() -> LexiconDoc<'static> {
1915        lexicon_doc_chat_bsky_convo_defs()
1916    }
1917    fn validate(&self) -> Result<(), ConstraintError> {
1918        {
1919            let value = &self.text;
1920            #[allow(unused_comparisons)]
1921            if <str>::len(value.as_ref()) > 10000usize {
1922                return Err(ConstraintError::MaxLength {
1923                    path: ValidationPath::from_field("text"),
1924                    max: 10000usize,
1925                    actual: <str>::len(value.as_ref()),
1926                });
1927            }
1928        }
1929        {
1930            let value = &self.text;
1931            {
1932                let count = UnicodeSegmentation::graphemes(value.as_ref(), true).count();
1933                if count > 1000usize {
1934                    return Err(ConstraintError::MaxGraphemes {
1935                        path: ValidationPath::from_field("text"),
1936                        max: 1000usize,
1937                        actual: count,
1938                    });
1939                }
1940            }
1941        }
1942        Ok(())
1943    }
1944}
1945
1946impl<S: BosStr> LexiconSchema for MessageRef<S> {
1947    fn nsid() -> &'static str {
1948        "chat.bsky.convo.defs"
1949    }
1950    fn def_name() -> &'static str {
1951        "messageRef"
1952    }
1953    fn lexicon_doc() -> LexiconDoc<'static> {
1954        lexicon_doc_chat_bsky_convo_defs()
1955    }
1956    fn validate(&self) -> Result<(), ConstraintError> {
1957        Ok(())
1958    }
1959}
1960
1961impl<S: BosStr> LexiconSchema for MessageView<S> {
1962    fn nsid() -> &'static str {
1963        "chat.bsky.convo.defs"
1964    }
1965    fn def_name() -> &'static str {
1966        "messageView"
1967    }
1968    fn lexicon_doc() -> LexiconDoc<'static> {
1969        lexicon_doc_chat_bsky_convo_defs()
1970    }
1971    fn validate(&self) -> Result<(), ConstraintError> {
1972        {
1973            let value = &self.text;
1974            #[allow(unused_comparisons)]
1975            if <str>::len(value.as_ref()) > 10000usize {
1976                return Err(ConstraintError::MaxLength {
1977                    path: ValidationPath::from_field("text"),
1978                    max: 10000usize,
1979                    actual: <str>::len(value.as_ref()),
1980                });
1981            }
1982        }
1983        {
1984            let value = &self.text;
1985            {
1986                let count = UnicodeSegmentation::graphemes(value.as_ref(), true).count();
1987                if count > 1000usize {
1988                    return Err(ConstraintError::MaxGraphemes {
1989                        path: ValidationPath::from_field("text"),
1990                        max: 1000usize,
1991                        actual: count,
1992                    });
1993                }
1994            }
1995        }
1996        Ok(())
1997    }
1998}
1999
2000impl<S: BosStr> LexiconSchema for MessageViewSender<S> {
2001    fn nsid() -> &'static str {
2002        "chat.bsky.convo.defs"
2003    }
2004    fn def_name() -> &'static str {
2005        "messageViewSender"
2006    }
2007    fn lexicon_doc() -> LexiconDoc<'static> {
2008        lexicon_doc_chat_bsky_convo_defs()
2009    }
2010    fn validate(&self) -> Result<(), ConstraintError> {
2011        Ok(())
2012    }
2013}
2014
2015impl<S: BosStr> LexiconSchema for ReactionView<S> {
2016    fn nsid() -> &'static str {
2017        "chat.bsky.convo.defs"
2018    }
2019    fn def_name() -> &'static str {
2020        "reactionView"
2021    }
2022    fn lexicon_doc() -> LexiconDoc<'static> {
2023        lexicon_doc_chat_bsky_convo_defs()
2024    }
2025    fn validate(&self) -> Result<(), ConstraintError> {
2026        Ok(())
2027    }
2028}
2029
2030impl<S: BosStr> LexiconSchema for ReactionViewSender<S> {
2031    fn nsid() -> &'static str {
2032        "chat.bsky.convo.defs"
2033    }
2034    fn def_name() -> &'static str {
2035        "reactionViewSender"
2036    }
2037    fn lexicon_doc() -> LexiconDoc<'static> {
2038        lexicon_doc_chat_bsky_convo_defs()
2039    }
2040    fn validate(&self) -> Result<(), ConstraintError> {
2041        Ok(())
2042    }
2043}
2044
2045impl<S: BosStr> LexiconSchema for ReplyRef<S> {
2046    fn nsid() -> &'static str {
2047        "chat.bsky.convo.defs"
2048    }
2049    fn def_name() -> &'static str {
2050        "replyRef"
2051    }
2052    fn lexicon_doc() -> LexiconDoc<'static> {
2053        lexicon_doc_chat_bsky_convo_defs()
2054    }
2055    fn validate(&self) -> Result<(), ConstraintError> {
2056        Ok(())
2057    }
2058}
2059
2060impl<S: BosStr> LexiconSchema for SystemMessageDataAddMember<S> {
2061    fn nsid() -> &'static str {
2062        "chat.bsky.convo.defs"
2063    }
2064    fn def_name() -> &'static str {
2065        "systemMessageDataAddMember"
2066    }
2067    fn lexicon_doc() -> LexiconDoc<'static> {
2068        lexicon_doc_chat_bsky_convo_defs()
2069    }
2070    fn validate(&self) -> Result<(), ConstraintError> {
2071        Ok(())
2072    }
2073}
2074
2075impl<S: BosStr> LexiconSchema for SystemMessageDataCreateJoinLink<S> {
2076    fn nsid() -> &'static str {
2077        "chat.bsky.convo.defs"
2078    }
2079    fn def_name() -> &'static str {
2080        "systemMessageDataCreateJoinLink"
2081    }
2082    fn lexicon_doc() -> LexiconDoc<'static> {
2083        lexicon_doc_chat_bsky_convo_defs()
2084    }
2085    fn validate(&self) -> Result<(), ConstraintError> {
2086        Ok(())
2087    }
2088}
2089
2090impl<S: BosStr> LexiconSchema for SystemMessageDataDisableJoinLink<S> {
2091    fn nsid() -> &'static str {
2092        "chat.bsky.convo.defs"
2093    }
2094    fn def_name() -> &'static str {
2095        "systemMessageDataDisableJoinLink"
2096    }
2097    fn lexicon_doc() -> LexiconDoc<'static> {
2098        lexicon_doc_chat_bsky_convo_defs()
2099    }
2100    fn validate(&self) -> Result<(), ConstraintError> {
2101        Ok(())
2102    }
2103}
2104
2105impl<S: BosStr> LexiconSchema for SystemMessageDataEditGroup<S> {
2106    fn nsid() -> &'static str {
2107        "chat.bsky.convo.defs"
2108    }
2109    fn def_name() -> &'static str {
2110        "systemMessageDataEditGroup"
2111    }
2112    fn lexicon_doc() -> LexiconDoc<'static> {
2113        lexicon_doc_chat_bsky_convo_defs()
2114    }
2115    fn validate(&self) -> Result<(), ConstraintError> {
2116        Ok(())
2117    }
2118}
2119
2120impl<S: BosStr> LexiconSchema for SystemMessageDataEditJoinLink<S> {
2121    fn nsid() -> &'static str {
2122        "chat.bsky.convo.defs"
2123    }
2124    fn def_name() -> &'static str {
2125        "systemMessageDataEditJoinLink"
2126    }
2127    fn lexicon_doc() -> LexiconDoc<'static> {
2128        lexicon_doc_chat_bsky_convo_defs()
2129    }
2130    fn validate(&self) -> Result<(), ConstraintError> {
2131        Ok(())
2132    }
2133}
2134
2135impl<S: BosStr> LexiconSchema for SystemMessageDataEnableJoinLink<S> {
2136    fn nsid() -> &'static str {
2137        "chat.bsky.convo.defs"
2138    }
2139    fn def_name() -> &'static str {
2140        "systemMessageDataEnableJoinLink"
2141    }
2142    fn lexicon_doc() -> LexiconDoc<'static> {
2143        lexicon_doc_chat_bsky_convo_defs()
2144    }
2145    fn validate(&self) -> Result<(), ConstraintError> {
2146        Ok(())
2147    }
2148}
2149
2150impl<S: BosStr> LexiconSchema for SystemMessageDataLockConvo<S> {
2151    fn nsid() -> &'static str {
2152        "chat.bsky.convo.defs"
2153    }
2154    fn def_name() -> &'static str {
2155        "systemMessageDataLockConvo"
2156    }
2157    fn lexicon_doc() -> LexiconDoc<'static> {
2158        lexicon_doc_chat_bsky_convo_defs()
2159    }
2160    fn validate(&self) -> Result<(), ConstraintError> {
2161        Ok(())
2162    }
2163}
2164
2165impl<S: BosStr> LexiconSchema for SystemMessageDataLockConvoPermanently<S> {
2166    fn nsid() -> &'static str {
2167        "chat.bsky.convo.defs"
2168    }
2169    fn def_name() -> &'static str {
2170        "systemMessageDataLockConvoPermanently"
2171    }
2172    fn lexicon_doc() -> LexiconDoc<'static> {
2173        lexicon_doc_chat_bsky_convo_defs()
2174    }
2175    fn validate(&self) -> Result<(), ConstraintError> {
2176        Ok(())
2177    }
2178}
2179
2180impl<S: BosStr> LexiconSchema for SystemMessageDataMemberJoin<S> {
2181    fn nsid() -> &'static str {
2182        "chat.bsky.convo.defs"
2183    }
2184    fn def_name() -> &'static str {
2185        "systemMessageDataMemberJoin"
2186    }
2187    fn lexicon_doc() -> LexiconDoc<'static> {
2188        lexicon_doc_chat_bsky_convo_defs()
2189    }
2190    fn validate(&self) -> Result<(), ConstraintError> {
2191        Ok(())
2192    }
2193}
2194
2195impl<S: BosStr> LexiconSchema for SystemMessageDataMemberLeave<S> {
2196    fn nsid() -> &'static str {
2197        "chat.bsky.convo.defs"
2198    }
2199    fn def_name() -> &'static str {
2200        "systemMessageDataMemberLeave"
2201    }
2202    fn lexicon_doc() -> LexiconDoc<'static> {
2203        lexicon_doc_chat_bsky_convo_defs()
2204    }
2205    fn validate(&self) -> Result<(), ConstraintError> {
2206        Ok(())
2207    }
2208}
2209
2210impl<S: BosStr> LexiconSchema for SystemMessageDataRemoveMember<S> {
2211    fn nsid() -> &'static str {
2212        "chat.bsky.convo.defs"
2213    }
2214    fn def_name() -> &'static str {
2215        "systemMessageDataRemoveMember"
2216    }
2217    fn lexicon_doc() -> LexiconDoc<'static> {
2218        lexicon_doc_chat_bsky_convo_defs()
2219    }
2220    fn validate(&self) -> Result<(), ConstraintError> {
2221        Ok(())
2222    }
2223}
2224
2225impl<S: BosStr> LexiconSchema for SystemMessageDataUnlockConvo<S> {
2226    fn nsid() -> &'static str {
2227        "chat.bsky.convo.defs"
2228    }
2229    fn def_name() -> &'static str {
2230        "systemMessageDataUnlockConvo"
2231    }
2232    fn lexicon_doc() -> LexiconDoc<'static> {
2233        lexicon_doc_chat_bsky_convo_defs()
2234    }
2235    fn validate(&self) -> Result<(), ConstraintError> {
2236        Ok(())
2237    }
2238}
2239
2240impl<S: BosStr> LexiconSchema for SystemMessageReferredUser<S> {
2241    fn nsid() -> &'static str {
2242        "chat.bsky.convo.defs"
2243    }
2244    fn def_name() -> &'static str {
2245        "systemMessageReferredUser"
2246    }
2247    fn lexicon_doc() -> LexiconDoc<'static> {
2248        lexicon_doc_chat_bsky_convo_defs()
2249    }
2250    fn validate(&self) -> Result<(), ConstraintError> {
2251        Ok(())
2252    }
2253}
2254
2255impl<S: BosStr> LexiconSchema for SystemMessageView<S> {
2256    fn nsid() -> &'static str {
2257        "chat.bsky.convo.defs"
2258    }
2259    fn def_name() -> &'static str {
2260        "systemMessageView"
2261    }
2262    fn lexicon_doc() -> LexiconDoc<'static> {
2263        lexicon_doc_chat_bsky_convo_defs()
2264    }
2265    fn validate(&self) -> Result<(), ConstraintError> {
2266        Ok(())
2267    }
2268}
2269
2270pub mod convo_ref_state {
2271
2272    pub use crate::builder_types::{IsSet, IsUnset, Set, Unset};
2273    #[allow(unused)]
2274    use ::core::marker::PhantomData;
2275    mod sealed {
2276        pub trait Sealed {}
2277    }
2278    /// State trait tracking which required fields have been set
2279    pub trait State: sealed::Sealed {
2280        type ConvoId;
2281        type Did;
2282    }
2283    /// Empty state - all required fields are unset
2284    pub struct Empty(());
2285    impl sealed::Sealed for Empty {}
2286    impl State for Empty {
2287        type ConvoId = Unset;
2288        type Did = Unset;
2289    }
2290    ///State transition - sets the `convo_id` field to Set
2291    pub struct SetConvoId<St: State = Empty>(PhantomData<fn() -> St>);
2292    impl<St: State> sealed::Sealed for SetConvoId<St> {}
2293    impl<St: State> State for SetConvoId<St> {
2294        type ConvoId = Set<members::convo_id>;
2295        type Did = St::Did;
2296    }
2297    ///State transition - sets the `did` field to Set
2298    pub struct SetDid<St: State = Empty>(PhantomData<fn() -> St>);
2299    impl<St: State> sealed::Sealed for SetDid<St> {}
2300    impl<St: State> State for SetDid<St> {
2301        type ConvoId = St::ConvoId;
2302        type Did = Set<members::did>;
2303    }
2304    /// Marker types for field names
2305    #[allow(non_camel_case_types)]
2306    pub mod members {
2307        ///Marker type for the `convo_id` field
2308        pub struct convo_id(());
2309        ///Marker type for the `did` field
2310        pub struct did(());
2311    }
2312}
2313
2314/// Builder for constructing an instance of this type.
2315pub struct ConvoRefBuilder<St: convo_ref_state::State, S: BosStr = DefaultStr> {
2316    _state: PhantomData<fn() -> St>,
2317    _fields: (Option<S>, Option<Did<S>>),
2318    _type: PhantomData<fn() -> S>,
2319}
2320
2321impl ConvoRef<DefaultStr> {
2322    /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed
2323    pub fn new() -> ConvoRefBuilder<convo_ref_state::Empty, DefaultStr> {
2324        ConvoRefBuilder::new()
2325    }
2326}
2327
2328impl<S: BosStr> ConvoRef<S> {
2329    /// Create a new builder for this type
2330    pub fn builder() -> ConvoRefBuilder<convo_ref_state::Empty, S> {
2331        ConvoRefBuilder::builder()
2332    }
2333}
2334
2335impl ConvoRefBuilder<convo_ref_state::Empty, DefaultStr> {
2336    /// Create a new builder with all fields unset, using the default string type, if needed
2337    pub fn new() -> Self {
2338        ConvoRefBuilder {
2339            _state: PhantomData,
2340            _fields: (None, None),
2341            _type: PhantomData,
2342        }
2343    }
2344}
2345
2346impl<S: BosStr> ConvoRefBuilder<convo_ref_state::Empty, S> {
2347    /// Create a new builder with all fields unset
2348    pub fn builder() -> Self {
2349        ConvoRefBuilder {
2350            _state: PhantomData,
2351            _fields: (None, None),
2352            _type: PhantomData,
2353        }
2354    }
2355}
2356
2357impl<St, S: BosStr> ConvoRefBuilder<St, S>
2358where
2359    St: convo_ref_state::State,
2360    St::ConvoId: convo_ref_state::IsUnset,
2361{
2362    /// Set the `convoId` field (required)
2363    pub fn convo_id(
2364        mut self,
2365        value: impl Into<S>,
2366    ) -> ConvoRefBuilder<convo_ref_state::SetConvoId<St>, S> {
2367        self._fields.0 = Option::Some(value.into());
2368        ConvoRefBuilder {
2369            _state: PhantomData,
2370            _fields: self._fields,
2371            _type: PhantomData,
2372        }
2373    }
2374}
2375
2376impl<St, S: BosStr> ConvoRefBuilder<St, S>
2377where
2378    St: convo_ref_state::State,
2379    St::Did: convo_ref_state::IsUnset,
2380{
2381    /// Set the `did` field (required)
2382    pub fn did(
2383        mut self,
2384        value: impl Into<Did<S>>,
2385    ) -> ConvoRefBuilder<convo_ref_state::SetDid<St>, S> {
2386        self._fields.1 = Option::Some(value.into());
2387        ConvoRefBuilder {
2388            _state: PhantomData,
2389            _fields: self._fields,
2390            _type: PhantomData,
2391        }
2392    }
2393}
2394
2395impl<St, S: BosStr> ConvoRefBuilder<St, S>
2396where
2397    St: convo_ref_state::State,
2398    St::ConvoId: convo_ref_state::IsSet,
2399    St::Did: convo_ref_state::IsSet,
2400{
2401    /// Build the final struct.
2402    pub fn build(self) -> ConvoRef<S> {
2403        ConvoRef {
2404            convo_id: self._fields.0.unwrap(),
2405            did: self._fields.1.unwrap(),
2406            extra_data: Default::default(),
2407        }
2408    }
2409    /// Build the final struct with custom extra_data.
2410    pub fn build_with_data(self, extra_data: BTreeMap<SmolStr, Data<S>>) -> ConvoRef<S> {
2411        ConvoRef {
2412            convo_id: self._fields.0.unwrap(),
2413            did: self._fields.1.unwrap(),
2414            extra_data: Some(extra_data),
2415        }
2416    }
2417}
2418
2419fn lexicon_doc_chat_bsky_convo_defs() -> LexiconDoc<'static> {
2420    use alloc::collections::BTreeMap;
2421    #[allow(unused_imports)]
2422    use jacquard_common::{CowStr, deps::smol_str::SmolStr, types::blob::MimeType};
2423    use jacquard_lexicon::lexicon::*;
2424    LexiconDoc {
2425        lexicon: Lexicon::Lexicon1,
2426        id: CowStr::new_static("chat.bsky.convo.defs"),
2427        defs: {
2428            let mut map = BTreeMap::new();
2429            map.insert(
2430                SmolStr::new_static("convoKind"),
2431                LexUserType::String(LexString {
2432                    ..Default::default()
2433                }),
2434            );
2435            map.insert(
2436                SmolStr::new_static("convoLockStatus"),
2437                LexUserType::String(LexString {
2438                    ..Default::default()
2439                }),
2440            );
2441            map.insert(
2442                SmolStr::new_static("convoRef"),
2443                LexUserType::Object(LexObject {
2444                    required: Some(vec![
2445                        SmolStr::new_static("did"),
2446                        SmolStr::new_static("convoId"),
2447                    ]),
2448                    properties: {
2449                        #[allow(unused_mut)]
2450                        let mut map = BTreeMap::new();
2451                        map.insert(
2452                            SmolStr::new_static("convoId"),
2453                            LexObjectProperty::String(LexString {
2454                                ..Default::default()
2455                            }),
2456                        );
2457                        map.insert(
2458                            SmolStr::new_static("did"),
2459                            LexObjectProperty::String(LexString {
2460                                format: Some(LexStringFormat::Did),
2461                                ..Default::default()
2462                            }),
2463                        );
2464                        map
2465                    },
2466                    ..Default::default()
2467                }),
2468            );
2469            map.insert(
2470                SmolStr::new_static("convoStatus"),
2471                LexUserType::String(LexString {
2472                    ..Default::default()
2473                }),
2474            );
2475            map.insert(
2476                SmolStr::new_static("convoView"),
2477                LexUserType::Object(LexObject {
2478                    required: Some(
2479                        vec![
2480                            SmolStr::new_static("id"), SmolStr::new_static("rev"),
2481                            SmolStr::new_static("members"), SmolStr::new_static("muted"),
2482                            SmolStr::new_static("unreadCount")
2483                        ],
2484                    ),
2485                    properties: {
2486                        #[allow(unused_mut)]
2487                        let mut map = BTreeMap::new();
2488                        map.insert(
2489                            SmolStr::new_static("id"),
2490                            LexObjectProperty::String(LexString { ..Default::default() }),
2491                        );
2492                        map.insert(
2493                            SmolStr::new_static("kind"),
2494                            LexObjectProperty::Union(LexRefUnion {
2495                                description: Some(
2496                                    CowStr::new_static(
2497                                        "Union field that has data specific to different kinds of convos.",
2498                                    ),
2499                                ),
2500                                refs: vec![
2501                                    CowStr::new_static("#directConvo"),
2502                                    CowStr::new_static("#groupConvo")
2503                                ],
2504                                ..Default::default()
2505                            }),
2506                        );
2507                        map.insert(
2508                            SmolStr::new_static("lastMessage"),
2509                            LexObjectProperty::Union(LexRefUnion {
2510                                refs: vec![
2511                                    CowStr::new_static("#messageView"),
2512                                    CowStr::new_static("#deletedMessageView"),
2513                                    CowStr::new_static("#systemMessageView")
2514                                ],
2515                                ..Default::default()
2516                            }),
2517                        );
2518                        map.insert(
2519                            SmolStr::new_static("lastReaction"),
2520                            LexObjectProperty::Union(LexRefUnion {
2521                                refs: vec![CowStr::new_static("#messageAndReactionView")],
2522                                ..Default::default()
2523                            }),
2524                        );
2525                        map.insert(
2526                            SmolStr::new_static("members"),
2527                            LexObjectProperty::Array(LexArray {
2528                                description: Some(
2529                                    CowStr::new_static(
2530                                        "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.",
2531                                    ),
2532                                ),
2533                                items: LexArrayItem::Ref(LexRef {
2534                                    r#ref: CowStr::new_static(
2535                                        "chat.bsky.actor.defs#profileViewBasic",
2536                                    ),
2537                                    ..Default::default()
2538                                }),
2539                                ..Default::default()
2540                            }),
2541                        );
2542                        map.insert(
2543                            SmolStr::new_static("muted"),
2544                            LexObjectProperty::Boolean(LexBoolean {
2545                                ..Default::default()
2546                            }),
2547                        );
2548                        map.insert(
2549                            SmolStr::new_static("rev"),
2550                            LexObjectProperty::String(LexString { ..Default::default() }),
2551                        );
2552                        map.insert(
2553                            SmolStr::new_static("status"),
2554                            LexObjectProperty::Ref(LexRef {
2555                                r#ref: CowStr::new_static("#convoStatus"),
2556                                ..Default::default()
2557                            }),
2558                        );
2559                        map.insert(
2560                            SmolStr::new_static("unreadCount"),
2561                            LexObjectProperty::Integer(LexInteger {
2562                                ..Default::default()
2563                            }),
2564                        );
2565                        map
2566                    },
2567                    ..Default::default()
2568                }),
2569            );
2570            map.insert(
2571                SmolStr::new_static("deletedMessageView"),
2572                LexUserType::Object(LexObject {
2573                    required: Some(vec![
2574                        SmolStr::new_static("id"),
2575                        SmolStr::new_static("rev"),
2576                        SmolStr::new_static("sender"),
2577                        SmolStr::new_static("sentAt"),
2578                    ]),
2579                    properties: {
2580                        #[allow(unused_mut)]
2581                        let mut map = BTreeMap::new();
2582                        map.insert(
2583                            SmolStr::new_static("id"),
2584                            LexObjectProperty::String(LexString {
2585                                ..Default::default()
2586                            }),
2587                        );
2588                        map.insert(
2589                            SmolStr::new_static("rev"),
2590                            LexObjectProperty::String(LexString {
2591                                ..Default::default()
2592                            }),
2593                        );
2594                        map.insert(
2595                            SmolStr::new_static("sender"),
2596                            LexObjectProperty::Ref(LexRef {
2597                                r#ref: CowStr::new_static("#messageViewSender"),
2598                                ..Default::default()
2599                            }),
2600                        );
2601                        map.insert(
2602                            SmolStr::new_static("sentAt"),
2603                            LexObjectProperty::String(LexString {
2604                                format: Some(LexStringFormat::Datetime),
2605                                ..Default::default()
2606                            }),
2607                        );
2608                        map
2609                    },
2610                    ..Default::default()
2611                }),
2612            );
2613            map.insert(
2614                SmolStr::new_static("directConvo"),
2615                LexUserType::Object(LexObject {
2616                    properties: {
2617                        #[allow(unused_mut)]
2618                        let mut map = BTreeMap::new();
2619                        map
2620                    },
2621                    ..Default::default()
2622                }),
2623            );
2624            map.insert(
2625                SmolStr::new_static("groupConvo"),
2626                LexUserType::Object(LexObject {
2627                    required: Some(vec![
2628                        SmolStr::new_static("createdAt"),
2629                        SmolStr::new_static("lockStatus"),
2630                        SmolStr::new_static("lockStatusModerationOverride"),
2631                        SmolStr::new_static("memberCount"),
2632                        SmolStr::new_static("memberLimit"),
2633                        SmolStr::new_static("name"),
2634                    ]),
2635                    properties: {
2636                        #[allow(unused_mut)]
2637                        let mut map = BTreeMap::new();
2638                        map.insert(
2639                            SmolStr::new_static("createdAt"),
2640                            LexObjectProperty::String(LexString {
2641                                format: Some(LexStringFormat::Datetime),
2642                                ..Default::default()
2643                            }),
2644                        );
2645                        map.insert(
2646                            SmolStr::new_static("joinLink"),
2647                            LexObjectProperty::Ref(LexRef {
2648                                r#ref: CowStr::new_static("chat.bsky.group.defs#joinLinkView"),
2649                                ..Default::default()
2650                            }),
2651                        );
2652                        map.insert(
2653                            SmolStr::new_static("joinRequestCount"),
2654                            LexObjectProperty::Integer(LexInteger {
2655                                ..Default::default()
2656                            }),
2657                        );
2658                        map.insert(
2659                            SmolStr::new_static("lockStatus"),
2660                            LexObjectProperty::Ref(LexRef {
2661                                r#ref: CowStr::new_static("#convoLockStatus"),
2662                                ..Default::default()
2663                            }),
2664                        );
2665                        map.insert(
2666                            SmolStr::new_static("lockStatusModerationOverride"),
2667                            LexObjectProperty::Boolean(LexBoolean {
2668                                ..Default::default()
2669                            }),
2670                        );
2671                        map.insert(
2672                            SmolStr::new_static("memberCount"),
2673                            LexObjectProperty::Integer(LexInteger {
2674                                ..Default::default()
2675                            }),
2676                        );
2677                        map.insert(
2678                            SmolStr::new_static("memberLimit"),
2679                            LexObjectProperty::Integer(LexInteger {
2680                                ..Default::default()
2681                            }),
2682                        );
2683                        map.insert(
2684                            SmolStr::new_static("name"),
2685                            LexObjectProperty::String(LexString {
2686                                description: Some(CowStr::new_static(
2687                                    "The display name of the group conversation.",
2688                                )),
2689                                max_length: Some(500usize),
2690                                max_graphemes: Some(50usize),
2691                                ..Default::default()
2692                            }),
2693                        );
2694                        map.insert(
2695                            SmolStr::new_static("unreadJoinRequestCount"),
2696                            LexObjectProperty::Integer(LexInteger {
2697                                ..Default::default()
2698                            }),
2699                        );
2700                        map
2701                    },
2702                    ..Default::default()
2703                }),
2704            );
2705            map.insert(
2706                SmolStr::new_static("logAcceptConvo"),
2707                LexUserType::Object(LexObject {
2708                    description: Some(
2709                        CowStr::new_static(
2710                            "Event indicating the viewer accepted a convo, and it can be moved out of the request inbox. Can be direct or group.",
2711                        ),
2712                    ),
2713                    required: Some(
2714                        vec![SmolStr::new_static("rev"), SmolStr::new_static("convoId")],
2715                    ),
2716                    properties: {
2717                        #[allow(unused_mut)]
2718                        let mut map = BTreeMap::new();
2719                        map.insert(
2720                            SmolStr::new_static("convoId"),
2721                            LexObjectProperty::String(LexString { ..Default::default() }),
2722                        );
2723                        map.insert(
2724                            SmolStr::new_static("rev"),
2725                            LexObjectProperty::String(LexString { ..Default::default() }),
2726                        );
2727                        map
2728                    },
2729                    ..Default::default()
2730                }),
2731            );
2732            map.insert(
2733                SmolStr::new_static("logAddMember"),
2734                LexUserType::Object(LexObject {
2735                    description: Some(
2736                        CowStr::new_static(
2737                            "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).",
2738                        ),
2739                    ),
2740                    required: Some(
2741                        vec![
2742                            SmolStr::new_static("rev"), SmolStr::new_static("convoId"),
2743                            SmolStr::new_static("message"),
2744                            SmolStr::new_static("relatedProfiles")
2745                        ],
2746                    ),
2747                    properties: {
2748                        #[allow(unused_mut)]
2749                        let mut map = BTreeMap::new();
2750                        map.insert(
2751                            SmolStr::new_static("convoId"),
2752                            LexObjectProperty::String(LexString { ..Default::default() }),
2753                        );
2754                        map.insert(
2755                            SmolStr::new_static("message"),
2756                            LexObjectProperty::Ref(LexRef {
2757                                r#ref: CowStr::new_static("#systemMessageView"),
2758                                ..Default::default()
2759                            }),
2760                        );
2761                        map.insert(
2762                            SmolStr::new_static("relatedProfiles"),
2763                            LexObjectProperty::Array(LexArray {
2764                                description: Some(
2765                                    CowStr::new_static(
2766                                        "Profiles referred in the system message.",
2767                                    ),
2768                                ),
2769                                items: LexArrayItem::Ref(LexRef {
2770                                    r#ref: CowStr::new_static(
2771                                        "chat.bsky.actor.defs#profileViewBasic",
2772                                    ),
2773                                    ..Default::default()
2774                                }),
2775                                ..Default::default()
2776                            }),
2777                        );
2778                        map.insert(
2779                            SmolStr::new_static("rev"),
2780                            LexObjectProperty::String(LexString { ..Default::default() }),
2781                        );
2782                        map
2783                    },
2784                    ..Default::default()
2785                }),
2786            );
2787            map.insert(
2788                SmolStr::new_static("logAddReaction"),
2789                LexUserType::Object(LexObject {
2790                    description: Some(
2791                        CowStr::new_static(
2792                            "Event indicating a reaction was added to a message.",
2793                        ),
2794                    ),
2795                    required: Some(
2796                        vec![
2797                            SmolStr::new_static("rev"), SmolStr::new_static("convoId"),
2798                            SmolStr::new_static("message"),
2799                            SmolStr::new_static("reaction")
2800                        ],
2801                    ),
2802                    properties: {
2803                        #[allow(unused_mut)]
2804                        let mut map = BTreeMap::new();
2805                        map.insert(
2806                            SmolStr::new_static("convoId"),
2807                            LexObjectProperty::String(LexString { ..Default::default() }),
2808                        );
2809                        map.insert(
2810                            SmolStr::new_static("message"),
2811                            LexObjectProperty::Union(LexRefUnion {
2812                                refs: vec![
2813                                    CowStr::new_static("#messageView"),
2814                                    CowStr::new_static("#deletedMessageView")
2815                                ],
2816                                ..Default::default()
2817                            }),
2818                        );
2819                        map.insert(
2820                            SmolStr::new_static("reaction"),
2821                            LexObjectProperty::Ref(LexRef {
2822                                r#ref: CowStr::new_static("#reactionView"),
2823                                ..Default::default()
2824                            }),
2825                        );
2826                        map.insert(
2827                            SmolStr::new_static("relatedProfiles"),
2828                            LexObjectProperty::Array(LexArray {
2829                                description: Some(
2830                                    CowStr::new_static(
2831                                        "Profiles referred in the message and reaction views. This isn't required for compatibility, because it was added later, but should generally be present.",
2832                                    ),
2833                                ),
2834                                items: LexArrayItem::Ref(LexRef {
2835                                    r#ref: CowStr::new_static(
2836                                        "chat.bsky.actor.defs#profileViewBasic",
2837                                    ),
2838                                    ..Default::default()
2839                                }),
2840                                ..Default::default()
2841                            }),
2842                        );
2843                        map.insert(
2844                            SmolStr::new_static("rev"),
2845                            LexObjectProperty::String(LexString { ..Default::default() }),
2846                        );
2847                        map
2848                    },
2849                    ..Default::default()
2850                }),
2851            );
2852            map.insert(
2853                SmolStr::new_static("logApproveJoinRequest"),
2854                LexUserType::Object(LexObject {
2855                    description: Some(
2856                        CowStr::new_static(
2857                            "Event indicating a join request was approved by the viewer. Only the owner gets this. The approved member gets a logBeginConvo.",
2858                        ),
2859                    ),
2860                    required: Some(
2861                        vec![
2862                            SmolStr::new_static("rev"), SmolStr::new_static("convoId"),
2863                            SmolStr::new_static("member")
2864                        ],
2865                    ),
2866                    properties: {
2867                        #[allow(unused_mut)]
2868                        let mut map = BTreeMap::new();
2869                        map.insert(
2870                            SmolStr::new_static("convoId"),
2871                            LexObjectProperty::String(LexString { ..Default::default() }),
2872                        );
2873                        map.insert(
2874                            SmolStr::new_static("member"),
2875                            LexObjectProperty::Ref(LexRef {
2876                                r#ref: CowStr::new_static(
2877                                    "chat.bsky.actor.defs#profileViewBasic",
2878                                ),
2879                                ..Default::default()
2880                            }),
2881                        );
2882                        map.insert(
2883                            SmolStr::new_static("rev"),
2884                            LexObjectProperty::String(LexString { ..Default::default() }),
2885                        );
2886                        map
2887                    },
2888                    ..Default::default()
2889                }),
2890            );
2891            map.insert(
2892                SmolStr::new_static("logBeginConvo"),
2893                LexUserType::Object(LexObject {
2894                    description: Some(
2895                        CowStr::new_static(
2896                            "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.",
2897                        ),
2898                    ),
2899                    required: Some(
2900                        vec![SmolStr::new_static("rev"), SmolStr::new_static("convoId")],
2901                    ),
2902                    properties: {
2903                        #[allow(unused_mut)]
2904                        let mut map = BTreeMap::new();
2905                        map.insert(
2906                            SmolStr::new_static("convoId"),
2907                            LexObjectProperty::String(LexString { ..Default::default() }),
2908                        );
2909                        map.insert(
2910                            SmolStr::new_static("rev"),
2911                            LexObjectProperty::String(LexString { ..Default::default() }),
2912                        );
2913                        map
2914                    },
2915                    ..Default::default()
2916                }),
2917            );
2918            map.insert(
2919                SmolStr::new_static("logCreateJoinLink"),
2920                LexUserType::Object(LexObject {
2921                    description: Some(CowStr::new_static(
2922                        "Event indicating a join link was created for a group convo.",
2923                    )),
2924                    required: Some(vec![
2925                        SmolStr::new_static("rev"),
2926                        SmolStr::new_static("convoId"),
2927                        SmolStr::new_static("message"),
2928                    ]),
2929                    properties: {
2930                        #[allow(unused_mut)]
2931                        let mut map = BTreeMap::new();
2932                        map.insert(
2933                            SmolStr::new_static("convoId"),
2934                            LexObjectProperty::String(LexString {
2935                                ..Default::default()
2936                            }),
2937                        );
2938                        map.insert(
2939                            SmolStr::new_static("message"),
2940                            LexObjectProperty::Ref(LexRef {
2941                                r#ref: CowStr::new_static("#systemMessageView"),
2942                                ..Default::default()
2943                            }),
2944                        );
2945                        map.insert(
2946                            SmolStr::new_static("rev"),
2947                            LexObjectProperty::String(LexString {
2948                                ..Default::default()
2949                            }),
2950                        );
2951                        map
2952                    },
2953                    ..Default::default()
2954                }),
2955            );
2956            map.insert(
2957                SmolStr::new_static("logCreateMessage"),
2958                LexUserType::Object(LexObject {
2959                    description: Some(
2960                        CowStr::new_static(
2961                            "Event indicating a user-originated message was created. Is not emitted for system messages.",
2962                        ),
2963                    ),
2964                    required: Some(
2965                        vec![
2966                            SmolStr::new_static("rev"), SmolStr::new_static("convoId"),
2967                            SmolStr::new_static("message")
2968                        ],
2969                    ),
2970                    properties: {
2971                        #[allow(unused_mut)]
2972                        let mut map = BTreeMap::new();
2973                        map.insert(
2974                            SmolStr::new_static("convoId"),
2975                            LexObjectProperty::String(LexString { ..Default::default() }),
2976                        );
2977                        map.insert(
2978                            SmolStr::new_static("message"),
2979                            LexObjectProperty::Union(LexRefUnion {
2980                                refs: vec![
2981                                    CowStr::new_static("#messageView"),
2982                                    CowStr::new_static("#deletedMessageView")
2983                                ],
2984                                ..Default::default()
2985                            }),
2986                        );
2987                        map.insert(
2988                            SmolStr::new_static("relatedProfiles"),
2989                            LexObjectProperty::Array(LexArray {
2990                                description: Some(
2991                                    CowStr::new_static(
2992                                        "Profiles referred to in the message view. This isn't required for compatibility, because it was added later, but should generally be present.",
2993                                    ),
2994                                ),
2995                                items: LexArrayItem::Ref(LexRef {
2996                                    r#ref: CowStr::new_static(
2997                                        "chat.bsky.actor.defs#profileViewBasic",
2998                                    ),
2999                                    ..Default::default()
3000                                }),
3001                                ..Default::default()
3002                            }),
3003                        );
3004                        map.insert(
3005                            SmolStr::new_static("rev"),
3006                            LexObjectProperty::String(LexString { ..Default::default() }),
3007                        );
3008                        map
3009                    },
3010                    ..Default::default()
3011                }),
3012            );
3013            map.insert(
3014                SmolStr::new_static("logDeleteMessage"),
3015                LexUserType::Object(LexObject {
3016                    description: Some(
3017                        CowStr::new_static(
3018                            "Event indicating a user-originated message was deleted. Is not emitted for system messages.",
3019                        ),
3020                    ),
3021                    required: Some(
3022                        vec![
3023                            SmolStr::new_static("rev"), SmolStr::new_static("convoId"),
3024                            SmolStr::new_static("message")
3025                        ],
3026                    ),
3027                    properties: {
3028                        #[allow(unused_mut)]
3029                        let mut map = BTreeMap::new();
3030                        map.insert(
3031                            SmolStr::new_static("convoId"),
3032                            LexObjectProperty::String(LexString { ..Default::default() }),
3033                        );
3034                        map.insert(
3035                            SmolStr::new_static("message"),
3036                            LexObjectProperty::Union(LexRefUnion {
3037                                refs: vec![
3038                                    CowStr::new_static("#messageView"),
3039                                    CowStr::new_static("#deletedMessageView")
3040                                ],
3041                                ..Default::default()
3042                            }),
3043                        );
3044                        map.insert(
3045                            SmolStr::new_static("rev"),
3046                            LexObjectProperty::String(LexString { ..Default::default() }),
3047                        );
3048                        map
3049                    },
3050                    ..Default::default()
3051                }),
3052            );
3053            map.insert(
3054                SmolStr::new_static("logDisableJoinLink"),
3055                LexUserType::Object(LexObject {
3056                    description: Some(CowStr::new_static(
3057                        "Event indicating a join link was disabled for a group convo.",
3058                    )),
3059                    required: Some(vec![
3060                        SmolStr::new_static("rev"),
3061                        SmolStr::new_static("convoId"),
3062                        SmolStr::new_static("message"),
3063                    ]),
3064                    properties: {
3065                        #[allow(unused_mut)]
3066                        let mut map = BTreeMap::new();
3067                        map.insert(
3068                            SmolStr::new_static("convoId"),
3069                            LexObjectProperty::String(LexString {
3070                                ..Default::default()
3071                            }),
3072                        );
3073                        map.insert(
3074                            SmolStr::new_static("message"),
3075                            LexObjectProperty::Ref(LexRef {
3076                                r#ref: CowStr::new_static("#systemMessageView"),
3077                                ..Default::default()
3078                            }),
3079                        );
3080                        map.insert(
3081                            SmolStr::new_static("rev"),
3082                            LexObjectProperty::String(LexString {
3083                                ..Default::default()
3084                            }),
3085                        );
3086                        map
3087                    },
3088                    ..Default::default()
3089                }),
3090            );
3091            map.insert(
3092                SmolStr::new_static("logEditGroup"),
3093                LexUserType::Object(LexObject {
3094                    description: Some(CowStr::new_static(
3095                        "Event indicating info about group convo was edited.",
3096                    )),
3097                    required: Some(vec![
3098                        SmolStr::new_static("rev"),
3099                        SmolStr::new_static("convoId"),
3100                        SmolStr::new_static("message"),
3101                    ]),
3102                    properties: {
3103                        #[allow(unused_mut)]
3104                        let mut map = BTreeMap::new();
3105                        map.insert(
3106                            SmolStr::new_static("convoId"),
3107                            LexObjectProperty::String(LexString {
3108                                ..Default::default()
3109                            }),
3110                        );
3111                        map.insert(
3112                            SmolStr::new_static("message"),
3113                            LexObjectProperty::Ref(LexRef {
3114                                r#ref: CowStr::new_static("#systemMessageView"),
3115                                ..Default::default()
3116                            }),
3117                        );
3118                        map.insert(
3119                            SmolStr::new_static("rev"),
3120                            LexObjectProperty::String(LexString {
3121                                ..Default::default()
3122                            }),
3123                        );
3124                        map
3125                    },
3126                    ..Default::default()
3127                }),
3128            );
3129            map.insert(
3130                SmolStr::new_static("logEditJoinLink"),
3131                LexUserType::Object(LexObject {
3132                    description: Some(
3133                        CowStr::new_static(
3134                            "Event indicating a settings about a join link for a group convo were edited.",
3135                        ),
3136                    ),
3137                    required: Some(
3138                        vec![
3139                            SmolStr::new_static("rev"), SmolStr::new_static("convoId"),
3140                            SmolStr::new_static("message")
3141                        ],
3142                    ),
3143                    properties: {
3144                        #[allow(unused_mut)]
3145                        let mut map = BTreeMap::new();
3146                        map.insert(
3147                            SmolStr::new_static("convoId"),
3148                            LexObjectProperty::String(LexString { ..Default::default() }),
3149                        );
3150                        map.insert(
3151                            SmolStr::new_static("message"),
3152                            LexObjectProperty::Ref(LexRef {
3153                                r#ref: CowStr::new_static("#systemMessageView"),
3154                                ..Default::default()
3155                            }),
3156                        );
3157                        map.insert(
3158                            SmolStr::new_static("rev"),
3159                            LexObjectProperty::String(LexString { ..Default::default() }),
3160                        );
3161                        map
3162                    },
3163                    ..Default::default()
3164                }),
3165            );
3166            map.insert(
3167                SmolStr::new_static("logEnableJoinLink"),
3168                LexUserType::Object(LexObject {
3169                    description: Some(CowStr::new_static(
3170                        "Event indicating a join link was enabled for a group convo.",
3171                    )),
3172                    required: Some(vec![
3173                        SmolStr::new_static("rev"),
3174                        SmolStr::new_static("convoId"),
3175                        SmolStr::new_static("message"),
3176                    ]),
3177                    properties: {
3178                        #[allow(unused_mut)]
3179                        let mut map = BTreeMap::new();
3180                        map.insert(
3181                            SmolStr::new_static("convoId"),
3182                            LexObjectProperty::String(LexString {
3183                                ..Default::default()
3184                            }),
3185                        );
3186                        map.insert(
3187                            SmolStr::new_static("message"),
3188                            LexObjectProperty::Ref(LexRef {
3189                                r#ref: CowStr::new_static("#systemMessageView"),
3190                                ..Default::default()
3191                            }),
3192                        );
3193                        map.insert(
3194                            SmolStr::new_static("rev"),
3195                            LexObjectProperty::String(LexString {
3196                                ..Default::default()
3197                            }),
3198                        );
3199                        map
3200                    },
3201                    ..Default::default()
3202                }),
3203            );
3204            map.insert(
3205                SmolStr::new_static("logIncomingJoinRequest"),
3206                LexUserType::Object(LexObject {
3207                    description: Some(
3208                        CowStr::new_static(
3209                            "Event indicating a join request was made to a group the viewer owns. Only the owner gets this.",
3210                        ),
3211                    ),
3212                    required: Some(
3213                        vec![
3214                            SmolStr::new_static("rev"), SmolStr::new_static("convoId"),
3215                            SmolStr::new_static("member")
3216                        ],
3217                    ),
3218                    properties: {
3219                        #[allow(unused_mut)]
3220                        let mut map = BTreeMap::new();
3221                        map.insert(
3222                            SmolStr::new_static("convoId"),
3223                            LexObjectProperty::String(LexString { ..Default::default() }),
3224                        );
3225                        map.insert(
3226                            SmolStr::new_static("member"),
3227                            LexObjectProperty::Ref(LexRef {
3228                                r#ref: CowStr::new_static(
3229                                    "chat.bsky.actor.defs#profileViewBasic",
3230                                ),
3231                                ..Default::default()
3232                            }),
3233                        );
3234                        map.insert(
3235                            SmolStr::new_static("rev"),
3236                            LexObjectProperty::String(LexString { ..Default::default() }),
3237                        );
3238                        map
3239                    },
3240                    ..Default::default()
3241                }),
3242            );
3243            map.insert(
3244                SmolStr::new_static("logLeaveConvo"),
3245                LexUserType::Object(LexObject {
3246                    description: Some(CowStr::new_static(
3247                        "Event indicating the viewer left a convo. Can be direct or group.",
3248                    )),
3249                    required: Some(vec![
3250                        SmolStr::new_static("rev"),
3251                        SmolStr::new_static("convoId"),
3252                    ]),
3253                    properties: {
3254                        #[allow(unused_mut)]
3255                        let mut map = BTreeMap::new();
3256                        map.insert(
3257                            SmolStr::new_static("convoId"),
3258                            LexObjectProperty::String(LexString {
3259                                ..Default::default()
3260                            }),
3261                        );
3262                        map.insert(
3263                            SmolStr::new_static("rev"),
3264                            LexObjectProperty::String(LexString {
3265                                ..Default::default()
3266                            }),
3267                        );
3268                        map
3269                    },
3270                    ..Default::default()
3271                }),
3272            );
3273            map.insert(
3274                SmolStr::new_static("logLockConvo"),
3275                LexUserType::Object(LexObject {
3276                    description: Some(CowStr::new_static(
3277                        "Event indicating a group convo was locked.",
3278                    )),
3279                    required: Some(vec![
3280                        SmolStr::new_static("rev"),
3281                        SmolStr::new_static("convoId"),
3282                        SmolStr::new_static("message"),
3283                        SmolStr::new_static("relatedProfiles"),
3284                    ]),
3285                    properties: {
3286                        #[allow(unused_mut)]
3287                        let mut map = BTreeMap::new();
3288                        map.insert(
3289                            SmolStr::new_static("convoId"),
3290                            LexObjectProperty::String(LexString {
3291                                ..Default::default()
3292                            }),
3293                        );
3294                        map.insert(
3295                            SmolStr::new_static("message"),
3296                            LexObjectProperty::Ref(LexRef {
3297                                r#ref: CowStr::new_static("#systemMessageView"),
3298                                ..Default::default()
3299                            }),
3300                        );
3301                        map.insert(
3302                            SmolStr::new_static("relatedProfiles"),
3303                            LexObjectProperty::Array(LexArray {
3304                                description: Some(CowStr::new_static(
3305                                    "Profiles referred in the system message.",
3306                                )),
3307                                items: LexArrayItem::Ref(LexRef {
3308                                    r#ref: CowStr::new_static(
3309                                        "chat.bsky.actor.defs#profileViewBasic",
3310                                    ),
3311                                    ..Default::default()
3312                                }),
3313                                ..Default::default()
3314                            }),
3315                        );
3316                        map.insert(
3317                            SmolStr::new_static("rev"),
3318                            LexObjectProperty::String(LexString {
3319                                ..Default::default()
3320                            }),
3321                        );
3322                        map
3323                    },
3324                    ..Default::default()
3325                }),
3326            );
3327            map.insert(
3328                SmolStr::new_static("logLockConvoPermanently"),
3329                LexUserType::Object(LexObject {
3330                    description: Some(CowStr::new_static(
3331                        "Event indicating a group convo was locked permanently.",
3332                    )),
3333                    required: Some(vec![
3334                        SmolStr::new_static("rev"),
3335                        SmolStr::new_static("convoId"),
3336                        SmolStr::new_static("message"),
3337                        SmolStr::new_static("relatedProfiles"),
3338                    ]),
3339                    properties: {
3340                        #[allow(unused_mut)]
3341                        let mut map = BTreeMap::new();
3342                        map.insert(
3343                            SmolStr::new_static("convoId"),
3344                            LexObjectProperty::String(LexString {
3345                                ..Default::default()
3346                            }),
3347                        );
3348                        map.insert(
3349                            SmolStr::new_static("message"),
3350                            LexObjectProperty::Ref(LexRef {
3351                                r#ref: CowStr::new_static("#systemMessageView"),
3352                                ..Default::default()
3353                            }),
3354                        );
3355                        map.insert(
3356                            SmolStr::new_static("relatedProfiles"),
3357                            LexObjectProperty::Array(LexArray {
3358                                description: Some(CowStr::new_static(
3359                                    "Profiles referred in the system message.",
3360                                )),
3361                                items: LexArrayItem::Ref(LexRef {
3362                                    r#ref: CowStr::new_static(
3363                                        "chat.bsky.actor.defs#profileViewBasic",
3364                                    ),
3365                                    ..Default::default()
3366                                }),
3367                                ..Default::default()
3368                            }),
3369                        );
3370                        map.insert(
3371                            SmolStr::new_static("rev"),
3372                            LexObjectProperty::String(LexString {
3373                                ..Default::default()
3374                            }),
3375                        );
3376                        map
3377                    },
3378                    ..Default::default()
3379                }),
3380            );
3381            map.insert(
3382                SmolStr::new_static("logMemberJoin"),
3383                LexUserType::Object(LexObject {
3384                    description: Some(
3385                        CowStr::new_static(
3386                            "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).",
3387                        ),
3388                    ),
3389                    required: Some(
3390                        vec![
3391                            SmolStr::new_static("rev"), SmolStr::new_static("convoId"),
3392                            SmolStr::new_static("message"),
3393                            SmolStr::new_static("relatedProfiles")
3394                        ],
3395                    ),
3396                    properties: {
3397                        #[allow(unused_mut)]
3398                        let mut map = BTreeMap::new();
3399                        map.insert(
3400                            SmolStr::new_static("convoId"),
3401                            LexObjectProperty::String(LexString { ..Default::default() }),
3402                        );
3403                        map.insert(
3404                            SmolStr::new_static("message"),
3405                            LexObjectProperty::Ref(LexRef {
3406                                r#ref: CowStr::new_static("#systemMessageView"),
3407                                ..Default::default()
3408                            }),
3409                        );
3410                        map.insert(
3411                            SmolStr::new_static("relatedProfiles"),
3412                            LexObjectProperty::Array(LexArray {
3413                                description: Some(
3414                                    CowStr::new_static(
3415                                        "Profiles referred in the system message.",
3416                                    ),
3417                                ),
3418                                items: LexArrayItem::Ref(LexRef {
3419                                    r#ref: CowStr::new_static(
3420                                        "chat.bsky.actor.defs#profileViewBasic",
3421                                    ),
3422                                    ..Default::default()
3423                                }),
3424                                ..Default::default()
3425                            }),
3426                        );
3427                        map.insert(
3428                            SmolStr::new_static("rev"),
3429                            LexObjectProperty::String(LexString { ..Default::default() }),
3430                        );
3431                        map
3432                    },
3433                    ..Default::default()
3434                }),
3435            );
3436            map.insert(
3437                SmolStr::new_static("logMemberLeave"),
3438                LexUserType::Object(LexObject {
3439                    description: Some(
3440                        CowStr::new_static(
3441                            "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).",
3442                        ),
3443                    ),
3444                    required: Some(
3445                        vec![
3446                            SmolStr::new_static("rev"), SmolStr::new_static("convoId"),
3447                            SmolStr::new_static("message"),
3448                            SmolStr::new_static("relatedProfiles")
3449                        ],
3450                    ),
3451                    properties: {
3452                        #[allow(unused_mut)]
3453                        let mut map = BTreeMap::new();
3454                        map.insert(
3455                            SmolStr::new_static("convoId"),
3456                            LexObjectProperty::String(LexString { ..Default::default() }),
3457                        );
3458                        map.insert(
3459                            SmolStr::new_static("message"),
3460                            LexObjectProperty::Ref(LexRef {
3461                                r#ref: CowStr::new_static("#systemMessageView"),
3462                                ..Default::default()
3463                            }),
3464                        );
3465                        map.insert(
3466                            SmolStr::new_static("relatedProfiles"),
3467                            LexObjectProperty::Array(LexArray {
3468                                description: Some(
3469                                    CowStr::new_static(
3470                                        "Profiles referred in the system message.",
3471                                    ),
3472                                ),
3473                                items: LexArrayItem::Ref(LexRef {
3474                                    r#ref: CowStr::new_static(
3475                                        "chat.bsky.actor.defs#profileViewBasic",
3476                                    ),
3477                                    ..Default::default()
3478                                }),
3479                                ..Default::default()
3480                            }),
3481                        );
3482                        map.insert(
3483                            SmolStr::new_static("rev"),
3484                            LexObjectProperty::String(LexString { ..Default::default() }),
3485                        );
3486                        map
3487                    },
3488                    ..Default::default()
3489                }),
3490            );
3491            map.insert(
3492                SmolStr::new_static("logMuteConvo"),
3493                LexUserType::Object(LexObject {
3494                    description: Some(CowStr::new_static(
3495                        "Event indicating the viewer muted a convo. Can be direct or group.",
3496                    )),
3497                    required: Some(vec![
3498                        SmolStr::new_static("rev"),
3499                        SmolStr::new_static("convoId"),
3500                    ]),
3501                    properties: {
3502                        #[allow(unused_mut)]
3503                        let mut map = BTreeMap::new();
3504                        map.insert(
3505                            SmolStr::new_static("convoId"),
3506                            LexObjectProperty::String(LexString {
3507                                ..Default::default()
3508                            }),
3509                        );
3510                        map.insert(
3511                            SmolStr::new_static("rev"),
3512                            LexObjectProperty::String(LexString {
3513                                ..Default::default()
3514                            }),
3515                        );
3516                        map
3517                    },
3518                    ..Default::default()
3519                }),
3520            );
3521            map.insert(
3522                SmolStr::new_static("logOutgoingJoinRequest"),
3523                LexUserType::Object(LexObject {
3524                    description: Some(
3525                        CowStr::new_static(
3526                            "Event indicating a join request was made by the requester. Only requester actor gets this.",
3527                        ),
3528                    ),
3529                    required: Some(
3530                        vec![SmolStr::new_static("rev"), SmolStr::new_static("convoId")],
3531                    ),
3532                    properties: {
3533                        #[allow(unused_mut)]
3534                        let mut map = BTreeMap::new();
3535                        map.insert(
3536                            SmolStr::new_static("convoId"),
3537                            LexObjectProperty::String(LexString { ..Default::default() }),
3538                        );
3539                        map.insert(
3540                            SmolStr::new_static("rev"),
3541                            LexObjectProperty::String(LexString { ..Default::default() }),
3542                        );
3543                        map
3544                    },
3545                    ..Default::default()
3546                }),
3547            );
3548            map.insert(
3549                SmolStr::new_static("logReadConvo"),
3550                LexUserType::Object(LexObject {
3551                    description: Some(CowStr::new_static(
3552                        "Event indicating a convo was read up to a certain message.",
3553                    )),
3554                    required: Some(vec![
3555                        SmolStr::new_static("rev"),
3556                        SmolStr::new_static("convoId"),
3557                        SmolStr::new_static("message"),
3558                    ]),
3559                    properties: {
3560                        #[allow(unused_mut)]
3561                        let mut map = BTreeMap::new();
3562                        map.insert(
3563                            SmolStr::new_static("convoId"),
3564                            LexObjectProperty::String(LexString {
3565                                ..Default::default()
3566                            }),
3567                        );
3568                        map.insert(
3569                            SmolStr::new_static("message"),
3570                            LexObjectProperty::Union(LexRefUnion {
3571                                refs: vec![
3572                                    CowStr::new_static("#messageView"),
3573                                    CowStr::new_static("#deletedMessageView"),
3574                                    CowStr::new_static("#systemMessageView"),
3575                                ],
3576                                ..Default::default()
3577                            }),
3578                        );
3579                        map.insert(
3580                            SmolStr::new_static("rev"),
3581                            LexObjectProperty::String(LexString {
3582                                ..Default::default()
3583                            }),
3584                        );
3585                        map
3586                    },
3587                    ..Default::default()
3588                }),
3589            );
3590            map.insert(
3591                SmolStr::new_static("logReadJoinRequests"),
3592                LexUserType::Object(LexObject {
3593                    description: Some(
3594                        CowStr::new_static(
3595                            "Event indicating the group owner marked join requests as read. Only the owner gets this.",
3596                        ),
3597                    ),
3598                    required: Some(
3599                        vec![SmolStr::new_static("rev"), SmolStr::new_static("convoId")],
3600                    ),
3601                    properties: {
3602                        #[allow(unused_mut)]
3603                        let mut map = BTreeMap::new();
3604                        map.insert(
3605                            SmolStr::new_static("convoId"),
3606                            LexObjectProperty::String(LexString { ..Default::default() }),
3607                        );
3608                        map.insert(
3609                            SmolStr::new_static("rev"),
3610                            LexObjectProperty::String(LexString { ..Default::default() }),
3611                        );
3612                        map
3613                    },
3614                    ..Default::default()
3615                }),
3616            );
3617            map.insert(
3618                SmolStr::new_static("logReadMessage"),
3619                LexUserType::Object(LexObject {
3620                    description: Some(
3621                        CowStr::new_static(
3622                            "DEPRECATED: use logReadConvo instead. Event indicating a convo was read up to a certain message.",
3623                        ),
3624                    ),
3625                    required: Some(
3626                        vec![
3627                            SmolStr::new_static("rev"), SmolStr::new_static("convoId"),
3628                            SmolStr::new_static("message")
3629                        ],
3630                    ),
3631                    properties: {
3632                        #[allow(unused_mut)]
3633                        let mut map = BTreeMap::new();
3634                        map.insert(
3635                            SmolStr::new_static("convoId"),
3636                            LexObjectProperty::String(LexString { ..Default::default() }),
3637                        );
3638                        map.insert(
3639                            SmolStr::new_static("message"),
3640                            LexObjectProperty::Union(LexRefUnion {
3641                                refs: vec![
3642                                    CowStr::new_static("#messageView"),
3643                                    CowStr::new_static("#deletedMessageView"),
3644                                    CowStr::new_static("#systemMessageView")
3645                                ],
3646                                ..Default::default()
3647                            }),
3648                        );
3649                        map.insert(
3650                            SmolStr::new_static("rev"),
3651                            LexObjectProperty::String(LexString { ..Default::default() }),
3652                        );
3653                        map
3654                    },
3655                    ..Default::default()
3656                }),
3657            );
3658            map.insert(
3659                SmolStr::new_static("logRejectJoinRequest"),
3660                LexUserType::Object(LexObject {
3661                    description: Some(
3662                        CowStr::new_static(
3663                            "Event indicating a join request was rejected by the viewer. Only the owner gets this.",
3664                        ),
3665                    ),
3666                    required: Some(
3667                        vec![
3668                            SmolStr::new_static("rev"), SmolStr::new_static("convoId"),
3669                            SmolStr::new_static("member")
3670                        ],
3671                    ),
3672                    properties: {
3673                        #[allow(unused_mut)]
3674                        let mut map = BTreeMap::new();
3675                        map.insert(
3676                            SmolStr::new_static("convoId"),
3677                            LexObjectProperty::String(LexString { ..Default::default() }),
3678                        );
3679                        map.insert(
3680                            SmolStr::new_static("member"),
3681                            LexObjectProperty::Ref(LexRef {
3682                                r#ref: CowStr::new_static(
3683                                    "chat.bsky.actor.defs#profileViewBasic",
3684                                ),
3685                                ..Default::default()
3686                            }),
3687                        );
3688                        map.insert(
3689                            SmolStr::new_static("rev"),
3690                            LexObjectProperty::String(LexString { ..Default::default() }),
3691                        );
3692                        map
3693                    },
3694                    ..Default::default()
3695                }),
3696            );
3697            map.insert(
3698                SmolStr::new_static("logRemoveMember"),
3699                LexUserType::Object(LexObject {
3700                    description: Some(
3701                        CowStr::new_static(
3702                            "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).",
3703                        ),
3704                    ),
3705                    required: Some(
3706                        vec![
3707                            SmolStr::new_static("rev"), SmolStr::new_static("convoId"),
3708                            SmolStr::new_static("message"),
3709                            SmolStr::new_static("relatedProfiles")
3710                        ],
3711                    ),
3712                    properties: {
3713                        #[allow(unused_mut)]
3714                        let mut map = BTreeMap::new();
3715                        map.insert(
3716                            SmolStr::new_static("convoId"),
3717                            LexObjectProperty::String(LexString { ..Default::default() }),
3718                        );
3719                        map.insert(
3720                            SmolStr::new_static("message"),
3721                            LexObjectProperty::Ref(LexRef {
3722                                r#ref: CowStr::new_static("#systemMessageView"),
3723                                ..Default::default()
3724                            }),
3725                        );
3726                        map.insert(
3727                            SmolStr::new_static("relatedProfiles"),
3728                            LexObjectProperty::Array(LexArray {
3729                                description: Some(
3730                                    CowStr::new_static(
3731                                        "Profiles referred in the system message.",
3732                                    ),
3733                                ),
3734                                items: LexArrayItem::Ref(LexRef {
3735                                    r#ref: CowStr::new_static(
3736                                        "chat.bsky.actor.defs#profileViewBasic",
3737                                    ),
3738                                    ..Default::default()
3739                                }),
3740                                ..Default::default()
3741                            }),
3742                        );
3743                        map.insert(
3744                            SmolStr::new_static("rev"),
3745                            LexObjectProperty::String(LexString { ..Default::default() }),
3746                        );
3747                        map
3748                    },
3749                    ..Default::default()
3750                }),
3751            );
3752            map.insert(
3753                SmolStr::new_static("logRemoveReaction"),
3754                LexUserType::Object(LexObject {
3755                    description: Some(
3756                        CowStr::new_static(
3757                            "Event indicating a reaction was removed from a message.",
3758                        ),
3759                    ),
3760                    required: Some(
3761                        vec![
3762                            SmolStr::new_static("rev"), SmolStr::new_static("convoId"),
3763                            SmolStr::new_static("message"),
3764                            SmolStr::new_static("reaction")
3765                        ],
3766                    ),
3767                    properties: {
3768                        #[allow(unused_mut)]
3769                        let mut map = BTreeMap::new();
3770                        map.insert(
3771                            SmolStr::new_static("convoId"),
3772                            LexObjectProperty::String(LexString { ..Default::default() }),
3773                        );
3774                        map.insert(
3775                            SmolStr::new_static("message"),
3776                            LexObjectProperty::Union(LexRefUnion {
3777                                refs: vec![
3778                                    CowStr::new_static("#messageView"),
3779                                    CowStr::new_static("#deletedMessageView")
3780                                ],
3781                                ..Default::default()
3782                            }),
3783                        );
3784                        map.insert(
3785                            SmolStr::new_static("reaction"),
3786                            LexObjectProperty::Ref(LexRef {
3787                                r#ref: CowStr::new_static("#reactionView"),
3788                                ..Default::default()
3789                            }),
3790                        );
3791                        map.insert(
3792                            SmolStr::new_static("relatedProfiles"),
3793                            LexObjectProperty::Array(LexArray {
3794                                description: Some(
3795                                    CowStr::new_static(
3796                                        "Profiles referred in the message and reaction views. This isn't required for compatibility, because it was added later, but should generally be present.",
3797                                    ),
3798                                ),
3799                                items: LexArrayItem::Ref(LexRef {
3800                                    r#ref: CowStr::new_static(
3801                                        "chat.bsky.actor.defs#profileViewBasic",
3802                                    ),
3803                                    ..Default::default()
3804                                }),
3805                                ..Default::default()
3806                            }),
3807                        );
3808                        map.insert(
3809                            SmolStr::new_static("rev"),
3810                            LexObjectProperty::String(LexString { ..Default::default() }),
3811                        );
3812                        map
3813                    },
3814                    ..Default::default()
3815                }),
3816            );
3817            map.insert(
3818                SmolStr::new_static("logUnlockConvo"),
3819                LexUserType::Object(LexObject {
3820                    description: Some(CowStr::new_static(
3821                        "Event indicating a group convo was unlocked.",
3822                    )),
3823                    required: Some(vec![
3824                        SmolStr::new_static("rev"),
3825                        SmolStr::new_static("convoId"),
3826                        SmolStr::new_static("message"),
3827                        SmolStr::new_static("relatedProfiles"),
3828                    ]),
3829                    properties: {
3830                        #[allow(unused_mut)]
3831                        let mut map = BTreeMap::new();
3832                        map.insert(
3833                            SmolStr::new_static("convoId"),
3834                            LexObjectProperty::String(LexString {
3835                                ..Default::default()
3836                            }),
3837                        );
3838                        map.insert(
3839                            SmolStr::new_static("message"),
3840                            LexObjectProperty::Ref(LexRef {
3841                                r#ref: CowStr::new_static("#systemMessageView"),
3842                                ..Default::default()
3843                            }),
3844                        );
3845                        map.insert(
3846                            SmolStr::new_static("relatedProfiles"),
3847                            LexObjectProperty::Array(LexArray {
3848                                description: Some(CowStr::new_static(
3849                                    "Profiles referred in the system message.",
3850                                )),
3851                                items: LexArrayItem::Ref(LexRef {
3852                                    r#ref: CowStr::new_static(
3853                                        "chat.bsky.actor.defs#profileViewBasic",
3854                                    ),
3855                                    ..Default::default()
3856                                }),
3857                                ..Default::default()
3858                            }),
3859                        );
3860                        map.insert(
3861                            SmolStr::new_static("rev"),
3862                            LexObjectProperty::String(LexString {
3863                                ..Default::default()
3864                            }),
3865                        );
3866                        map
3867                    },
3868                    ..Default::default()
3869                }),
3870            );
3871            map.insert(
3872                SmolStr::new_static("logUnmuteConvo"),
3873                LexUserType::Object(LexObject {
3874                    description: Some(CowStr::new_static(
3875                        "Event indicating the viewer unmuted a convo. Can be direct or group.",
3876                    )),
3877                    required: Some(vec![
3878                        SmolStr::new_static("rev"),
3879                        SmolStr::new_static("convoId"),
3880                    ]),
3881                    properties: {
3882                        #[allow(unused_mut)]
3883                        let mut map = BTreeMap::new();
3884                        map.insert(
3885                            SmolStr::new_static("convoId"),
3886                            LexObjectProperty::String(LexString {
3887                                ..Default::default()
3888                            }),
3889                        );
3890                        map.insert(
3891                            SmolStr::new_static("rev"),
3892                            LexObjectProperty::String(LexString {
3893                                ..Default::default()
3894                            }),
3895                        );
3896                        map
3897                    },
3898                    ..Default::default()
3899                }),
3900            );
3901            map.insert(
3902                SmolStr::new_static("logWithdrawIncomingJoinRequest"),
3903                LexUserType::Object(LexObject {
3904                    description: Some(
3905                        CowStr::new_static(
3906                            "Event indicating a prospective member withdrew their join request. Only the owner gets this.",
3907                        ),
3908                    ),
3909                    required: Some(
3910                        vec![
3911                            SmolStr::new_static("rev"), SmolStr::new_static("convoId"),
3912                            SmolStr::new_static("member")
3913                        ],
3914                    ),
3915                    properties: {
3916                        #[allow(unused_mut)]
3917                        let mut map = BTreeMap::new();
3918                        map.insert(
3919                            SmolStr::new_static("convoId"),
3920                            LexObjectProperty::String(LexString { ..Default::default() }),
3921                        );
3922                        map.insert(
3923                            SmolStr::new_static("member"),
3924                            LexObjectProperty::Ref(LexRef {
3925                                r#ref: CowStr::new_static(
3926                                    "chat.bsky.actor.defs#profileViewBasic",
3927                                ),
3928                                ..Default::default()
3929                            }),
3930                        );
3931                        map.insert(
3932                            SmolStr::new_static("rev"),
3933                            LexObjectProperty::String(LexString { ..Default::default() }),
3934                        );
3935                        map
3936                    },
3937                    ..Default::default()
3938                }),
3939            );
3940            map.insert(
3941                SmolStr::new_static("logWithdrawOutgoingJoinRequest"),
3942                LexUserType::Object(LexObject {
3943                    description: Some(
3944                        CowStr::new_static(
3945                            "Event indicating the viewer withdrew their own join request. Only requester actor gets this.",
3946                        ),
3947                    ),
3948                    required: Some(
3949                        vec![SmolStr::new_static("rev"), SmolStr::new_static("convoId")],
3950                    ),
3951                    properties: {
3952                        #[allow(unused_mut)]
3953                        let mut map = BTreeMap::new();
3954                        map.insert(
3955                            SmolStr::new_static("convoId"),
3956                            LexObjectProperty::String(LexString { ..Default::default() }),
3957                        );
3958                        map.insert(
3959                            SmolStr::new_static("rev"),
3960                            LexObjectProperty::String(LexString { ..Default::default() }),
3961                        );
3962                        map
3963                    },
3964                    ..Default::default()
3965                }),
3966            );
3967            map.insert(
3968                SmolStr::new_static("messageAndReactionView"),
3969                LexUserType::Object(LexObject {
3970                    required: Some(vec![
3971                        SmolStr::new_static("message"),
3972                        SmolStr::new_static("reaction"),
3973                    ]),
3974                    properties: {
3975                        #[allow(unused_mut)]
3976                        let mut map = BTreeMap::new();
3977                        map.insert(
3978                            SmolStr::new_static("message"),
3979                            LexObjectProperty::Ref(LexRef {
3980                                r#ref: CowStr::new_static("#messageView"),
3981                                ..Default::default()
3982                            }),
3983                        );
3984                        map.insert(
3985                            SmolStr::new_static("reaction"),
3986                            LexObjectProperty::Ref(LexRef {
3987                                r#ref: CowStr::new_static("#reactionView"),
3988                                ..Default::default()
3989                            }),
3990                        );
3991                        map
3992                    },
3993                    ..Default::default()
3994                }),
3995            );
3996            map.insert(
3997                SmolStr::new_static("messageBeforeUserJoinedGroupView"),
3998                LexUserType::Object(LexObject {
3999                    description: Some(
4000                        CowStr::new_static(
4001                            "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.",
4002                        ),
4003                    ),
4004                    properties: {
4005                        #[allow(unused_mut)]
4006                        let mut map = BTreeMap::new();
4007                        map
4008                    },
4009                    ..Default::default()
4010                }),
4011            );
4012            map.insert(
4013                SmolStr::new_static("messageInput"),
4014                LexUserType::Object(LexObject {
4015                    required: Some(vec![SmolStr::new_static("text")]),
4016                    properties: {
4017                        #[allow(unused_mut)]
4018                        let mut map = BTreeMap::new();
4019                        map.insert(
4020                            SmolStr::new_static("embed"),
4021                            LexObjectProperty::Union(LexRefUnion {
4022                                refs: vec![
4023                                    CowStr::new_static("app.bsky.embed.record"),
4024                                    CowStr::new_static("chat.bsky.embed.joinLink"),
4025                                ],
4026                                ..Default::default()
4027                            }),
4028                        );
4029                        map.insert(
4030                            SmolStr::new_static("facets"),
4031                            LexObjectProperty::Array(LexArray {
4032                                description: Some(CowStr::new_static(
4033                                    "Annotations of text (mentions, URLs, hashtags, etc)",
4034                                )),
4035                                items: LexArrayItem::Ref(LexRef {
4036                                    r#ref: CowStr::new_static("app.bsky.richtext.facet"),
4037                                    ..Default::default()
4038                                }),
4039                                ..Default::default()
4040                            }),
4041                        );
4042                        map.insert(
4043                            SmolStr::new_static("replyTo"),
4044                            LexObjectProperty::Ref(LexRef {
4045                                r#ref: CowStr::new_static("#replyRef"),
4046                                ..Default::default()
4047                            }),
4048                        );
4049                        map.insert(
4050                            SmolStr::new_static("text"),
4051                            LexObjectProperty::String(LexString {
4052                                max_length: Some(10000usize),
4053                                max_graphemes: Some(1000usize),
4054                                ..Default::default()
4055                            }),
4056                        );
4057                        map
4058                    },
4059                    ..Default::default()
4060                }),
4061            );
4062            map.insert(
4063                SmolStr::new_static("messageRef"),
4064                LexUserType::Object(LexObject {
4065                    required: Some(vec![
4066                        SmolStr::new_static("did"),
4067                        SmolStr::new_static("messageId"),
4068                        SmolStr::new_static("convoId"),
4069                    ]),
4070                    properties: {
4071                        #[allow(unused_mut)]
4072                        let mut map = BTreeMap::new();
4073                        map.insert(
4074                            SmolStr::new_static("convoId"),
4075                            LexObjectProperty::String(LexString {
4076                                ..Default::default()
4077                            }),
4078                        );
4079                        map.insert(
4080                            SmolStr::new_static("did"),
4081                            LexObjectProperty::String(LexString {
4082                                format: Some(LexStringFormat::Did),
4083                                ..Default::default()
4084                            }),
4085                        );
4086                        map.insert(
4087                            SmolStr::new_static("messageId"),
4088                            LexObjectProperty::String(LexString {
4089                                ..Default::default()
4090                            }),
4091                        );
4092                        map
4093                    },
4094                    ..Default::default()
4095                }),
4096            );
4097            map.insert(
4098                SmolStr::new_static("messageView"),
4099                LexUserType::Object(LexObject {
4100                    required: Some(
4101                        vec![
4102                            SmolStr::new_static("id"), SmolStr::new_static("rev"),
4103                            SmolStr::new_static("text"), SmolStr::new_static("sender"),
4104                            SmolStr::new_static("sentAt")
4105                        ],
4106                    ),
4107                    properties: {
4108                        #[allow(unused_mut)]
4109                        let mut map = BTreeMap::new();
4110                        map.insert(
4111                            SmolStr::new_static("embed"),
4112                            LexObjectProperty::Union(LexRefUnion {
4113                                refs: vec![
4114                                    CowStr::new_static("app.bsky.embed.record#view"),
4115                                    CowStr::new_static("chat.bsky.embed.joinLink#view")
4116                                ],
4117                                ..Default::default()
4118                            }),
4119                        );
4120                        map.insert(
4121                            SmolStr::new_static("facets"),
4122                            LexObjectProperty::Array(LexArray {
4123                                description: Some(
4124                                    CowStr::new_static(
4125                                        "Annotations of text (mentions, URLs, hashtags, etc)",
4126                                    ),
4127                                ),
4128                                items: LexArrayItem::Ref(LexRef {
4129                                    r#ref: CowStr::new_static("app.bsky.richtext.facet"),
4130                                    ..Default::default()
4131                                }),
4132                                ..Default::default()
4133                            }),
4134                        );
4135                        map.insert(
4136                            SmolStr::new_static("id"),
4137                            LexObjectProperty::String(LexString { ..Default::default() }),
4138                        );
4139                        map.insert(
4140                            SmolStr::new_static("reactions"),
4141                            LexObjectProperty::Array(LexArray {
4142                                description: Some(
4143                                    CowStr::new_static(
4144                                        "Reactions to this message, in ascending order of creation time.",
4145                                    ),
4146                                ),
4147                                items: LexArrayItem::Ref(LexRef {
4148                                    r#ref: CowStr::new_static("#reactionView"),
4149                                    ..Default::default()
4150                                }),
4151                                ..Default::default()
4152                            }),
4153                        );
4154                        map.insert(
4155                            SmolStr::new_static("replyTo"),
4156                            LexObjectProperty::Union(LexRefUnion {
4157                                description: Some(
4158                                    CowStr::new_static(
4159                                        "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.",
4160                                    ),
4161                                ),
4162                                refs: vec![
4163                                    CowStr::new_static("#messageView"),
4164                                    CowStr::new_static("#deletedMessageView"),
4165                                    CowStr::new_static("#messageBeforeUserJoinedGroupView")
4166                                ],
4167                                ..Default::default()
4168                            }),
4169                        );
4170                        map.insert(
4171                            SmolStr::new_static("rev"),
4172                            LexObjectProperty::String(LexString { ..Default::default() }),
4173                        );
4174                        map.insert(
4175                            SmolStr::new_static("sender"),
4176                            LexObjectProperty::Ref(LexRef {
4177                                r#ref: CowStr::new_static("#messageViewSender"),
4178                                ..Default::default()
4179                            }),
4180                        );
4181                        map.insert(
4182                            SmolStr::new_static("sentAt"),
4183                            LexObjectProperty::String(LexString {
4184                                format: Some(LexStringFormat::Datetime),
4185                                ..Default::default()
4186                            }),
4187                        );
4188                        map.insert(
4189                            SmolStr::new_static("text"),
4190                            LexObjectProperty::String(LexString {
4191                                max_length: Some(10000usize),
4192                                max_graphemes: Some(1000usize),
4193                                ..Default::default()
4194                            }),
4195                        );
4196                        map
4197                    },
4198                    ..Default::default()
4199                }),
4200            );
4201            map.insert(
4202                SmolStr::new_static("messageViewSender"),
4203                LexUserType::Object(LexObject {
4204                    required: Some(vec![SmolStr::new_static("did")]),
4205                    properties: {
4206                        #[allow(unused_mut)]
4207                        let mut map = BTreeMap::new();
4208                        map.insert(
4209                            SmolStr::new_static("did"),
4210                            LexObjectProperty::String(LexString {
4211                                format: Some(LexStringFormat::Did),
4212                                ..Default::default()
4213                            }),
4214                        );
4215                        map
4216                    },
4217                    ..Default::default()
4218                }),
4219            );
4220            map.insert(
4221                SmolStr::new_static("reactionView"),
4222                LexUserType::Object(LexObject {
4223                    required: Some(vec![
4224                        SmolStr::new_static("value"),
4225                        SmolStr::new_static("sender"),
4226                        SmolStr::new_static("createdAt"),
4227                    ]),
4228                    properties: {
4229                        #[allow(unused_mut)]
4230                        let mut map = BTreeMap::new();
4231                        map.insert(
4232                            SmolStr::new_static("createdAt"),
4233                            LexObjectProperty::String(LexString {
4234                                format: Some(LexStringFormat::Datetime),
4235                                ..Default::default()
4236                            }),
4237                        );
4238                        map.insert(
4239                            SmolStr::new_static("sender"),
4240                            LexObjectProperty::Ref(LexRef {
4241                                r#ref: CowStr::new_static("#reactionViewSender"),
4242                                ..Default::default()
4243                            }),
4244                        );
4245                        map.insert(
4246                            SmolStr::new_static("value"),
4247                            LexObjectProperty::String(LexString {
4248                                ..Default::default()
4249                            }),
4250                        );
4251                        map
4252                    },
4253                    ..Default::default()
4254                }),
4255            );
4256            map.insert(
4257                SmolStr::new_static("reactionViewSender"),
4258                LexUserType::Object(LexObject {
4259                    required: Some(vec![SmolStr::new_static("did")]),
4260                    properties: {
4261                        #[allow(unused_mut)]
4262                        let mut map = BTreeMap::new();
4263                        map.insert(
4264                            SmolStr::new_static("did"),
4265                            LexObjectProperty::String(LexString {
4266                                format: Some(LexStringFormat::Did),
4267                                ..Default::default()
4268                            }),
4269                        );
4270                        map
4271                    },
4272                    ..Default::default()
4273                }),
4274            );
4275            map.insert(
4276                SmolStr::new_static("replyRef"),
4277                LexUserType::Object(LexObject {
4278                    description: Some(
4279                        CowStr::new_static(
4280                            "A reference to another message within the same convo, used to indicate that a message is a reply to it.",
4281                        ),
4282                    ),
4283                    required: Some(vec![SmolStr::new_static("messageId")]),
4284                    properties: {
4285                        #[allow(unused_mut)]
4286                        let mut map = BTreeMap::new();
4287                        map.insert(
4288                            SmolStr::new_static("messageId"),
4289                            LexObjectProperty::String(LexString { ..Default::default() }),
4290                        );
4291                        map
4292                    },
4293                    ..Default::default()
4294                }),
4295            );
4296            map.insert(
4297                SmolStr::new_static("systemMessageDataAddMember"),
4298                LexUserType::Object(LexObject {
4299                    description: Some(CowStr::new_static(
4300                        "System message indicating a user was added to the group convo.",
4301                    )),
4302                    required: Some(vec![
4303                        SmolStr::new_static("member"),
4304                        SmolStr::new_static("role"),
4305                        SmolStr::new_static("addedBy"),
4306                    ]),
4307                    properties: {
4308                        #[allow(unused_mut)]
4309                        let mut map = BTreeMap::new();
4310                        map.insert(
4311                            SmolStr::new_static("addedBy"),
4312                            LexObjectProperty::Ref(LexRef {
4313                                r#ref: CowStr::new_static("#systemMessageReferredUser"),
4314                                ..Default::default()
4315                            }),
4316                        );
4317                        map.insert(
4318                            SmolStr::new_static("member"),
4319                            LexObjectProperty::Ref(LexRef {
4320                                r#ref: CowStr::new_static("#systemMessageReferredUser"),
4321                                ..Default::default()
4322                            }),
4323                        );
4324                        map.insert(
4325                            SmolStr::new_static("role"),
4326                            LexObjectProperty::Ref(LexRef {
4327                                r#ref: CowStr::new_static("chat.bsky.actor.defs#memberRole"),
4328                                ..Default::default()
4329                            }),
4330                        );
4331                        map
4332                    },
4333                    ..Default::default()
4334                }),
4335            );
4336            map.insert(
4337                SmolStr::new_static("systemMessageDataCreateJoinLink"),
4338                LexUserType::Object(LexObject {
4339                    description: Some(CowStr::new_static(
4340                        "System message indicating the group join link was created.",
4341                    )),
4342                    properties: {
4343                        #[allow(unused_mut)]
4344                        let mut map = BTreeMap::new();
4345                        map
4346                    },
4347                    ..Default::default()
4348                }),
4349            );
4350            map.insert(
4351                SmolStr::new_static("systemMessageDataDisableJoinLink"),
4352                LexUserType::Object(LexObject {
4353                    description: Some(CowStr::new_static(
4354                        "System message indicating the group join link was disabled.",
4355                    )),
4356                    properties: {
4357                        #[allow(unused_mut)]
4358                        let mut map = BTreeMap::new();
4359                        map
4360                    },
4361                    ..Default::default()
4362                }),
4363            );
4364            map.insert(
4365                SmolStr::new_static("systemMessageDataEditGroup"),
4366                LexUserType::Object(LexObject {
4367                    description: Some(CowStr::new_static(
4368                        "System message indicating the group info was edited.",
4369                    )),
4370                    properties: {
4371                        #[allow(unused_mut)]
4372                        let mut map = BTreeMap::new();
4373                        map.insert(
4374                            SmolStr::new_static("newName"),
4375                            LexObjectProperty::String(LexString {
4376                                description: Some(CowStr::new_static(
4377                                    "Group name that replaced the old.",
4378                                )),
4379                                ..Default::default()
4380                            }),
4381                        );
4382                        map.insert(
4383                            SmolStr::new_static("oldName"),
4384                            LexObjectProperty::String(LexString {
4385                                description: Some(CowStr::new_static(
4386                                    "Group name that was replaced.",
4387                                )),
4388                                ..Default::default()
4389                            }),
4390                        );
4391                        map
4392                    },
4393                    ..Default::default()
4394                }),
4395            );
4396            map.insert(
4397                SmolStr::new_static("systemMessageDataEditJoinLink"),
4398                LexUserType::Object(LexObject {
4399                    description: Some(CowStr::new_static(
4400                        "System message indicating the group join link was edited.",
4401                    )),
4402                    properties: {
4403                        #[allow(unused_mut)]
4404                        let mut map = BTreeMap::new();
4405                        map
4406                    },
4407                    ..Default::default()
4408                }),
4409            );
4410            map.insert(
4411                SmolStr::new_static("systemMessageDataEnableJoinLink"),
4412                LexUserType::Object(LexObject {
4413                    description: Some(CowStr::new_static(
4414                        "System message indicating the group join link was enabled.",
4415                    )),
4416                    properties: {
4417                        #[allow(unused_mut)]
4418                        let mut map = BTreeMap::new();
4419                        map
4420                    },
4421                    ..Default::default()
4422                }),
4423            );
4424            map.insert(
4425                SmolStr::new_static("systemMessageDataLockConvo"),
4426                LexUserType::Object(LexObject {
4427                    description: Some(CowStr::new_static(
4428                        "System message indicating the group convo was locked.",
4429                    )),
4430                    required: Some(vec![SmolStr::new_static("lockedBy")]),
4431                    properties: {
4432                        #[allow(unused_mut)]
4433                        let mut map = BTreeMap::new();
4434                        map.insert(
4435                            SmolStr::new_static("lockedBy"),
4436                            LexObjectProperty::Ref(LexRef {
4437                                r#ref: CowStr::new_static("#systemMessageReferredUser"),
4438                                ..Default::default()
4439                            }),
4440                        );
4441                        map
4442                    },
4443                    ..Default::default()
4444                }),
4445            );
4446            map.insert(
4447                SmolStr::new_static("systemMessageDataLockConvoPermanently"),
4448                LexUserType::Object(LexObject {
4449                    description: Some(CowStr::new_static(
4450                        "System message indicating the group convo was locked permanently.",
4451                    )),
4452                    required: Some(vec![SmolStr::new_static("lockedBy")]),
4453                    properties: {
4454                        #[allow(unused_mut)]
4455                        let mut map = BTreeMap::new();
4456                        map.insert(
4457                            SmolStr::new_static("lockedBy"),
4458                            LexObjectProperty::Ref(LexRef {
4459                                r#ref: CowStr::new_static("#systemMessageReferredUser"),
4460                                ..Default::default()
4461                            }),
4462                        );
4463                        map
4464                    },
4465                    ..Default::default()
4466                }),
4467            );
4468            map.insert(
4469                SmolStr::new_static("systemMessageDataMemberJoin"),
4470                LexUserType::Object(LexObject {
4471                    description: Some(CowStr::new_static(
4472                        "System message indicating a user joined the group convo via join link.",
4473                    )),
4474                    required: Some(vec![
4475                        SmolStr::new_static("member"),
4476                        SmolStr::new_static("role"),
4477                    ]),
4478                    properties: {
4479                        #[allow(unused_mut)]
4480                        let mut map = BTreeMap::new();
4481                        map.insert(
4482                            SmolStr::new_static("approvedBy"),
4483                            LexObjectProperty::Ref(LexRef {
4484                                r#ref: CowStr::new_static("#systemMessageReferredUser"),
4485                                ..Default::default()
4486                            }),
4487                        );
4488                        map.insert(
4489                            SmolStr::new_static("member"),
4490                            LexObjectProperty::Ref(LexRef {
4491                                r#ref: CowStr::new_static("#systemMessageReferredUser"),
4492                                ..Default::default()
4493                            }),
4494                        );
4495                        map.insert(
4496                            SmolStr::new_static("role"),
4497                            LexObjectProperty::Ref(LexRef {
4498                                r#ref: CowStr::new_static("chat.bsky.actor.defs#memberRole"),
4499                                ..Default::default()
4500                            }),
4501                        );
4502                        map
4503                    },
4504                    ..Default::default()
4505                }),
4506            );
4507            map.insert(
4508                SmolStr::new_static("systemMessageDataMemberLeave"),
4509                LexUserType::Object(LexObject {
4510                    description: Some(CowStr::new_static(
4511                        "System message indicating a user voluntarily left the group convo.",
4512                    )),
4513                    required: Some(vec![SmolStr::new_static("member")]),
4514                    properties: {
4515                        #[allow(unused_mut)]
4516                        let mut map = BTreeMap::new();
4517                        map.insert(
4518                            SmolStr::new_static("member"),
4519                            LexObjectProperty::Ref(LexRef {
4520                                r#ref: CowStr::new_static("#systemMessageReferredUser"),
4521                                ..Default::default()
4522                            }),
4523                        );
4524                        map
4525                    },
4526                    ..Default::default()
4527                }),
4528            );
4529            map.insert(
4530                SmolStr::new_static("systemMessageDataRemoveMember"),
4531                LexUserType::Object(LexObject {
4532                    description: Some(CowStr::new_static(
4533                        "System message indicating a user was removed from the group convo.",
4534                    )),
4535                    required: Some(vec![
4536                        SmolStr::new_static("member"),
4537                        SmolStr::new_static("removedBy"),
4538                    ]),
4539                    properties: {
4540                        #[allow(unused_mut)]
4541                        let mut map = BTreeMap::new();
4542                        map.insert(
4543                            SmolStr::new_static("member"),
4544                            LexObjectProperty::Ref(LexRef {
4545                                r#ref: CowStr::new_static("#systemMessageReferredUser"),
4546                                ..Default::default()
4547                            }),
4548                        );
4549                        map.insert(
4550                            SmolStr::new_static("removedBy"),
4551                            LexObjectProperty::Ref(LexRef {
4552                                r#ref: CowStr::new_static("#systemMessageReferredUser"),
4553                                ..Default::default()
4554                            }),
4555                        );
4556                        map
4557                    },
4558                    ..Default::default()
4559                }),
4560            );
4561            map.insert(
4562                SmolStr::new_static("systemMessageDataUnlockConvo"),
4563                LexUserType::Object(LexObject {
4564                    description: Some(CowStr::new_static(
4565                        "System message indicating the group convo was unlocked.",
4566                    )),
4567                    required: Some(vec![SmolStr::new_static("unlockedBy")]),
4568                    properties: {
4569                        #[allow(unused_mut)]
4570                        let mut map = BTreeMap::new();
4571                        map.insert(
4572                            SmolStr::new_static("unlockedBy"),
4573                            LexObjectProperty::Ref(LexRef {
4574                                r#ref: CowStr::new_static("#systemMessageReferredUser"),
4575                                ..Default::default()
4576                            }),
4577                        );
4578                        map
4579                    },
4580                    ..Default::default()
4581                }),
4582            );
4583            map.insert(
4584                SmolStr::new_static("systemMessageReferredUser"),
4585                LexUserType::Object(LexObject {
4586                    required: Some(vec![SmolStr::new_static("did")]),
4587                    properties: {
4588                        #[allow(unused_mut)]
4589                        let mut map = BTreeMap::new();
4590                        map.insert(
4591                            SmolStr::new_static("did"),
4592                            LexObjectProperty::String(LexString {
4593                                format: Some(LexStringFormat::Did),
4594                                ..Default::default()
4595                            }),
4596                        );
4597                        map
4598                    },
4599                    ..Default::default()
4600                }),
4601            );
4602            map.insert(
4603                SmolStr::new_static("systemMessageView"),
4604                LexUserType::Object(LexObject {
4605                    required: Some(vec![
4606                        SmolStr::new_static("id"),
4607                        SmolStr::new_static("rev"),
4608                        SmolStr::new_static("sentAt"),
4609                        SmolStr::new_static("data"),
4610                    ]),
4611                    properties: {
4612                        #[allow(unused_mut)]
4613                        let mut map = BTreeMap::new();
4614                        map.insert(
4615                            SmolStr::new_static("data"),
4616                            LexObjectProperty::Union(LexRefUnion {
4617                                refs: vec![
4618                                    CowStr::new_static("#systemMessageDataAddMember"),
4619                                    CowStr::new_static("#systemMessageDataRemoveMember"),
4620                                    CowStr::new_static("#systemMessageDataMemberJoin"),
4621                                    CowStr::new_static("#systemMessageDataMemberLeave"),
4622                                    CowStr::new_static("#systemMessageDataLockConvo"),
4623                                    CowStr::new_static("#systemMessageDataUnlockConvo"),
4624                                    CowStr::new_static("#systemMessageDataLockConvoPermanently"),
4625                                    CowStr::new_static("#systemMessageDataEditGroup"),
4626                                    CowStr::new_static("#systemMessageDataCreateJoinLink"),
4627                                    CowStr::new_static("#systemMessageDataEditJoinLink"),
4628                                    CowStr::new_static("#systemMessageDataEnableJoinLink"),
4629                                    CowStr::new_static("#systemMessageDataDisableJoinLink"),
4630                                ],
4631                                ..Default::default()
4632                            }),
4633                        );
4634                        map.insert(
4635                            SmolStr::new_static("id"),
4636                            LexObjectProperty::String(LexString {
4637                                ..Default::default()
4638                            }),
4639                        );
4640                        map.insert(
4641                            SmolStr::new_static("rev"),
4642                            LexObjectProperty::String(LexString {
4643                                ..Default::default()
4644                            }),
4645                        );
4646                        map.insert(
4647                            SmolStr::new_static("sentAt"),
4648                            LexObjectProperty::String(LexString {
4649                                format: Some(LexStringFormat::Datetime),
4650                                ..Default::default()
4651                            }),
4652                        );
4653                        map
4654                    },
4655                    ..Default::default()
4656                }),
4657            );
4658            map
4659        },
4660        ..Default::default()
4661    }
4662}
4663
4664pub mod convo_view_state {
4665
4666    pub use crate::builder_types::{IsSet, IsUnset, Set, Unset};
4667    #[allow(unused)]
4668    use ::core::marker::PhantomData;
4669    mod sealed {
4670        pub trait Sealed {}
4671    }
4672    /// State trait tracking which required fields have been set
4673    pub trait State: sealed::Sealed {
4674        type Id;
4675        type Members;
4676        type Muted;
4677        type Rev;
4678        type UnreadCount;
4679    }
4680    /// Empty state - all required fields are unset
4681    pub struct Empty(());
4682    impl sealed::Sealed for Empty {}
4683    impl State for Empty {
4684        type Id = Unset;
4685        type Members = Unset;
4686        type Muted = Unset;
4687        type Rev = Unset;
4688        type UnreadCount = Unset;
4689    }
4690    ///State transition - sets the `id` field to Set
4691    pub struct SetId<St: State = Empty>(PhantomData<fn() -> St>);
4692    impl<St: State> sealed::Sealed for SetId<St> {}
4693    impl<St: State> State for SetId<St> {
4694        type Id = Set<members::id>;
4695        type Members = St::Members;
4696        type Muted = St::Muted;
4697        type Rev = St::Rev;
4698        type UnreadCount = St::UnreadCount;
4699    }
4700    ///State transition - sets the `members` field to Set
4701    pub struct SetMembers<St: State = Empty>(PhantomData<fn() -> St>);
4702    impl<St: State> sealed::Sealed for SetMembers<St> {}
4703    impl<St: State> State for SetMembers<St> {
4704        type Id = St::Id;
4705        type Members = Set<members::members>;
4706        type Muted = St::Muted;
4707        type Rev = St::Rev;
4708        type UnreadCount = St::UnreadCount;
4709    }
4710    ///State transition - sets the `muted` field to Set
4711    pub struct SetMuted<St: State = Empty>(PhantomData<fn() -> St>);
4712    impl<St: State> sealed::Sealed for SetMuted<St> {}
4713    impl<St: State> State for SetMuted<St> {
4714        type Id = St::Id;
4715        type Members = St::Members;
4716        type Muted = Set<members::muted>;
4717        type Rev = St::Rev;
4718        type UnreadCount = St::UnreadCount;
4719    }
4720    ///State transition - sets the `rev` field to Set
4721    pub struct SetRev<St: State = Empty>(PhantomData<fn() -> St>);
4722    impl<St: State> sealed::Sealed for SetRev<St> {}
4723    impl<St: State> State for SetRev<St> {
4724        type Id = St::Id;
4725        type Members = St::Members;
4726        type Muted = St::Muted;
4727        type Rev = Set<members::rev>;
4728        type UnreadCount = St::UnreadCount;
4729    }
4730    ///State transition - sets the `unread_count` field to Set
4731    pub struct SetUnreadCount<St: State = Empty>(PhantomData<fn() -> St>);
4732    impl<St: State> sealed::Sealed for SetUnreadCount<St> {}
4733    impl<St: State> State for SetUnreadCount<St> {
4734        type Id = St::Id;
4735        type Members = St::Members;
4736        type Muted = St::Muted;
4737        type Rev = St::Rev;
4738        type UnreadCount = Set<members::unread_count>;
4739    }
4740    /// Marker types for field names
4741    #[allow(non_camel_case_types)]
4742    pub mod members {
4743        ///Marker type for the `id` field
4744        pub struct id(());
4745        ///Marker type for the `members` field
4746        pub struct members(());
4747        ///Marker type for the `muted` field
4748        pub struct muted(());
4749        ///Marker type for the `rev` field
4750        pub struct rev(());
4751        ///Marker type for the `unread_count` field
4752        pub struct unread_count(());
4753    }
4754}
4755
4756/// Builder for constructing an instance of this type.
4757pub struct ConvoViewBuilder<St: convo_view_state::State, S: BosStr = DefaultStr> {
4758    _state: PhantomData<fn() -> St>,
4759    _fields: (
4760        Option<S>,
4761        Option<ConvoViewKind<S>>,
4762        Option<ConvoViewLastMessage<S>>,
4763        Option<convo::MessageAndReactionView<S>>,
4764        Option<Vec<ProfileViewBasic<S>>>,
4765        Option<bool>,
4766        Option<S>,
4767        Option<convo::ConvoStatus<S>>,
4768        Option<i64>,
4769    ),
4770    _type: PhantomData<fn() -> S>,
4771}
4772
4773impl ConvoView<DefaultStr> {
4774    /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed
4775    pub fn new() -> ConvoViewBuilder<convo_view_state::Empty, DefaultStr> {
4776        ConvoViewBuilder::new()
4777    }
4778}
4779
4780impl<S: BosStr> ConvoView<S> {
4781    /// Create a new builder for this type
4782    pub fn builder() -> ConvoViewBuilder<convo_view_state::Empty, S> {
4783        ConvoViewBuilder::builder()
4784    }
4785}
4786
4787impl ConvoViewBuilder<convo_view_state::Empty, DefaultStr> {
4788    /// Create a new builder with all fields unset, using the default string type, if needed
4789    pub fn new() -> Self {
4790        ConvoViewBuilder {
4791            _state: PhantomData,
4792            _fields: (None, None, None, None, None, None, None, None, None),
4793            _type: PhantomData,
4794        }
4795    }
4796}
4797
4798impl<S: BosStr> ConvoViewBuilder<convo_view_state::Empty, S> {
4799    /// Create a new builder with all fields unset
4800    pub fn builder() -> Self {
4801        ConvoViewBuilder {
4802            _state: PhantomData,
4803            _fields: (None, None, None, None, None, None, None, None, None),
4804            _type: PhantomData,
4805        }
4806    }
4807}
4808
4809impl<St, S: BosStr> ConvoViewBuilder<St, S>
4810where
4811    St: convo_view_state::State,
4812    St::Id: convo_view_state::IsUnset,
4813{
4814    /// Set the `id` field (required)
4815    pub fn id(mut self, value: impl Into<S>) -> ConvoViewBuilder<convo_view_state::SetId<St>, S> {
4816        self._fields.0 = Option::Some(value.into());
4817        ConvoViewBuilder {
4818            _state: PhantomData,
4819            _fields: self._fields,
4820            _type: PhantomData,
4821        }
4822    }
4823}
4824
4825impl<St: convo_view_state::State, S: BosStr> ConvoViewBuilder<St, S> {
4826    /// Set the `kind` field (optional)
4827    pub fn kind(mut self, value: impl Into<Option<ConvoViewKind<S>>>) -> Self {
4828        self._fields.1 = value.into();
4829        self
4830    }
4831    /// Set the `kind` field to an Option value (optional)
4832    pub fn maybe_kind(mut self, value: Option<ConvoViewKind<S>>) -> Self {
4833        self._fields.1 = value;
4834        self
4835    }
4836}
4837
4838impl<St: convo_view_state::State, S: BosStr> ConvoViewBuilder<St, S> {
4839    /// Set the `lastMessage` field (optional)
4840    pub fn last_message(mut self, value: impl Into<Option<ConvoViewLastMessage<S>>>) -> Self {
4841        self._fields.2 = value.into();
4842        self
4843    }
4844    /// Set the `lastMessage` field to an Option value (optional)
4845    pub fn maybe_last_message(mut self, value: Option<ConvoViewLastMessage<S>>) -> Self {
4846        self._fields.2 = value;
4847        self
4848    }
4849}
4850
4851impl<St: convo_view_state::State, S: BosStr> ConvoViewBuilder<St, S> {
4852    /// Set the `lastReaction` field (optional)
4853    pub fn last_reaction(
4854        mut self,
4855        value: impl Into<Option<convo::MessageAndReactionView<S>>>,
4856    ) -> Self {
4857        self._fields.3 = value.into();
4858        self
4859    }
4860    /// Set the `lastReaction` field to an Option value (optional)
4861    pub fn maybe_last_reaction(mut self, value: Option<convo::MessageAndReactionView<S>>) -> Self {
4862        self._fields.3 = value;
4863        self
4864    }
4865}
4866
4867impl<St, S: BosStr> ConvoViewBuilder<St, S>
4868where
4869    St: convo_view_state::State,
4870    St::Members: convo_view_state::IsUnset,
4871{
4872    /// Set the `members` field (required)
4873    pub fn members(
4874        mut self,
4875        value: impl Into<Vec<ProfileViewBasic<S>>>,
4876    ) -> ConvoViewBuilder<convo_view_state::SetMembers<St>, S> {
4877        self._fields.4 = Option::Some(value.into());
4878        ConvoViewBuilder {
4879            _state: PhantomData,
4880            _fields: self._fields,
4881            _type: PhantomData,
4882        }
4883    }
4884}
4885
4886impl<St, S: BosStr> ConvoViewBuilder<St, S>
4887where
4888    St: convo_view_state::State,
4889    St::Muted: convo_view_state::IsUnset,
4890{
4891    /// Set the `muted` field (required)
4892    pub fn muted(
4893        mut self,
4894        value: impl Into<bool>,
4895    ) -> ConvoViewBuilder<convo_view_state::SetMuted<St>, S> {
4896        self._fields.5 = Option::Some(value.into());
4897        ConvoViewBuilder {
4898            _state: PhantomData,
4899            _fields: self._fields,
4900            _type: PhantomData,
4901        }
4902    }
4903}
4904
4905impl<St, S: BosStr> ConvoViewBuilder<St, S>
4906where
4907    St: convo_view_state::State,
4908    St::Rev: convo_view_state::IsUnset,
4909{
4910    /// Set the `rev` field (required)
4911    pub fn rev(mut self, value: impl Into<S>) -> ConvoViewBuilder<convo_view_state::SetRev<St>, S> {
4912        self._fields.6 = Option::Some(value.into());
4913        ConvoViewBuilder {
4914            _state: PhantomData,
4915            _fields: self._fields,
4916            _type: PhantomData,
4917        }
4918    }
4919}
4920
4921impl<St: convo_view_state::State, S: BosStr> ConvoViewBuilder<St, S> {
4922    /// Set the `status` field (optional)
4923    pub fn status(mut self, value: impl Into<Option<convo::ConvoStatus<S>>>) -> Self {
4924        self._fields.7 = value.into();
4925        self
4926    }
4927    /// Set the `status` field to an Option value (optional)
4928    pub fn maybe_status(mut self, value: Option<convo::ConvoStatus<S>>) -> Self {
4929        self._fields.7 = value;
4930        self
4931    }
4932}
4933
4934impl<St, S: BosStr> ConvoViewBuilder<St, S>
4935where
4936    St: convo_view_state::State,
4937    St::UnreadCount: convo_view_state::IsUnset,
4938{
4939    /// Set the `unreadCount` field (required)
4940    pub fn unread_count(
4941        mut self,
4942        value: impl Into<i64>,
4943    ) -> ConvoViewBuilder<convo_view_state::SetUnreadCount<St>, S> {
4944        self._fields.8 = Option::Some(value.into());
4945        ConvoViewBuilder {
4946            _state: PhantomData,
4947            _fields: self._fields,
4948            _type: PhantomData,
4949        }
4950    }
4951}
4952
4953impl<St, S: BosStr> ConvoViewBuilder<St, S>
4954where
4955    St: convo_view_state::State,
4956    St::Id: convo_view_state::IsSet,
4957    St::Members: convo_view_state::IsSet,
4958    St::Muted: convo_view_state::IsSet,
4959    St::Rev: convo_view_state::IsSet,
4960    St::UnreadCount: convo_view_state::IsSet,
4961{
4962    /// Build the final struct.
4963    pub fn build(self) -> ConvoView<S> {
4964        ConvoView {
4965            id: self._fields.0.unwrap(),
4966            kind: self._fields.1,
4967            last_message: self._fields.2,
4968            last_reaction: self._fields.3,
4969            members: self._fields.4.unwrap(),
4970            muted: self._fields.5.unwrap(),
4971            rev: self._fields.6.unwrap(),
4972            status: self._fields.7,
4973            unread_count: self._fields.8.unwrap(),
4974            extra_data: Default::default(),
4975        }
4976    }
4977    /// Build the final struct with custom extra_data.
4978    pub fn build_with_data(self, extra_data: BTreeMap<SmolStr, Data<S>>) -> ConvoView<S> {
4979        ConvoView {
4980            id: self._fields.0.unwrap(),
4981            kind: self._fields.1,
4982            last_message: self._fields.2,
4983            last_reaction: self._fields.3,
4984            members: self._fields.4.unwrap(),
4985            muted: self._fields.5.unwrap(),
4986            rev: self._fields.6.unwrap(),
4987            status: self._fields.7,
4988            unread_count: self._fields.8.unwrap(),
4989            extra_data: Some(extra_data),
4990        }
4991    }
4992}
4993
4994pub mod deleted_message_view_state {
4995
4996    pub use crate::builder_types::{IsSet, IsUnset, Set, Unset};
4997    #[allow(unused)]
4998    use ::core::marker::PhantomData;
4999    mod sealed {
5000        pub trait Sealed {}
5001    }
5002    /// State trait tracking which required fields have been set
5003    pub trait State: sealed::Sealed {
5004        type Id;
5005        type Rev;
5006        type Sender;
5007        type SentAt;
5008    }
5009    /// Empty state - all required fields are unset
5010    pub struct Empty(());
5011    impl sealed::Sealed for Empty {}
5012    impl State for Empty {
5013        type Id = Unset;
5014        type Rev = Unset;
5015        type Sender = Unset;
5016        type SentAt = Unset;
5017    }
5018    ///State transition - sets the `id` field to Set
5019    pub struct SetId<St: State = Empty>(PhantomData<fn() -> St>);
5020    impl<St: State> sealed::Sealed for SetId<St> {}
5021    impl<St: State> State for SetId<St> {
5022        type Id = Set<members::id>;
5023        type Rev = St::Rev;
5024        type Sender = St::Sender;
5025        type SentAt = St::SentAt;
5026    }
5027    ///State transition - sets the `rev` field to Set
5028    pub struct SetRev<St: State = Empty>(PhantomData<fn() -> St>);
5029    impl<St: State> sealed::Sealed for SetRev<St> {}
5030    impl<St: State> State for SetRev<St> {
5031        type Id = St::Id;
5032        type Rev = Set<members::rev>;
5033        type Sender = St::Sender;
5034        type SentAt = St::SentAt;
5035    }
5036    ///State transition - sets the `sender` field to Set
5037    pub struct SetSender<St: State = Empty>(PhantomData<fn() -> St>);
5038    impl<St: State> sealed::Sealed for SetSender<St> {}
5039    impl<St: State> State for SetSender<St> {
5040        type Id = St::Id;
5041        type Rev = St::Rev;
5042        type Sender = Set<members::sender>;
5043        type SentAt = St::SentAt;
5044    }
5045    ///State transition - sets the `sent_at` field to Set
5046    pub struct SetSentAt<St: State = Empty>(PhantomData<fn() -> St>);
5047    impl<St: State> sealed::Sealed for SetSentAt<St> {}
5048    impl<St: State> State for SetSentAt<St> {
5049        type Id = St::Id;
5050        type Rev = St::Rev;
5051        type Sender = St::Sender;
5052        type SentAt = Set<members::sent_at>;
5053    }
5054    /// Marker types for field names
5055    #[allow(non_camel_case_types)]
5056    pub mod members {
5057        ///Marker type for the `id` field
5058        pub struct id(());
5059        ///Marker type for the `rev` field
5060        pub struct rev(());
5061        ///Marker type for the `sender` field
5062        pub struct sender(());
5063        ///Marker type for the `sent_at` field
5064        pub struct sent_at(());
5065    }
5066}
5067
5068/// Builder for constructing an instance of this type.
5069pub struct DeletedMessageViewBuilder<St: deleted_message_view_state::State, S: BosStr = DefaultStr>
5070{
5071    _state: PhantomData<fn() -> St>,
5072    _fields: (
5073        Option<S>,
5074        Option<S>,
5075        Option<convo::MessageViewSender<S>>,
5076        Option<Datetime>,
5077    ),
5078    _type: PhantomData<fn() -> S>,
5079}
5080
5081impl DeletedMessageView<DefaultStr> {
5082    /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed
5083    pub fn new() -> DeletedMessageViewBuilder<deleted_message_view_state::Empty, DefaultStr> {
5084        DeletedMessageViewBuilder::new()
5085    }
5086}
5087
5088impl<S: BosStr> DeletedMessageView<S> {
5089    /// Create a new builder for this type
5090    pub fn builder() -> DeletedMessageViewBuilder<deleted_message_view_state::Empty, S> {
5091        DeletedMessageViewBuilder::builder()
5092    }
5093}
5094
5095impl DeletedMessageViewBuilder<deleted_message_view_state::Empty, DefaultStr> {
5096    /// Create a new builder with all fields unset, using the default string type, if needed
5097    pub fn new() -> Self {
5098        DeletedMessageViewBuilder {
5099            _state: PhantomData,
5100            _fields: (None, None, None, None),
5101            _type: PhantomData,
5102        }
5103    }
5104}
5105
5106impl<S: BosStr> DeletedMessageViewBuilder<deleted_message_view_state::Empty, S> {
5107    /// Create a new builder with all fields unset
5108    pub fn builder() -> Self {
5109        DeletedMessageViewBuilder {
5110            _state: PhantomData,
5111            _fields: (None, None, None, None),
5112            _type: PhantomData,
5113        }
5114    }
5115}
5116
5117impl<St, S: BosStr> DeletedMessageViewBuilder<St, S>
5118where
5119    St: deleted_message_view_state::State,
5120    St::Id: deleted_message_view_state::IsUnset,
5121{
5122    /// Set the `id` field (required)
5123    pub fn id(
5124        mut self,
5125        value: impl Into<S>,
5126    ) -> DeletedMessageViewBuilder<deleted_message_view_state::SetId<St>, S> {
5127        self._fields.0 = Option::Some(value.into());
5128        DeletedMessageViewBuilder {
5129            _state: PhantomData,
5130            _fields: self._fields,
5131            _type: PhantomData,
5132        }
5133    }
5134}
5135
5136impl<St, S: BosStr> DeletedMessageViewBuilder<St, S>
5137where
5138    St: deleted_message_view_state::State,
5139    St::Rev: deleted_message_view_state::IsUnset,
5140{
5141    /// Set the `rev` field (required)
5142    pub fn rev(
5143        mut self,
5144        value: impl Into<S>,
5145    ) -> DeletedMessageViewBuilder<deleted_message_view_state::SetRev<St>, S> {
5146        self._fields.1 = Option::Some(value.into());
5147        DeletedMessageViewBuilder {
5148            _state: PhantomData,
5149            _fields: self._fields,
5150            _type: PhantomData,
5151        }
5152    }
5153}
5154
5155impl<St, S: BosStr> DeletedMessageViewBuilder<St, S>
5156where
5157    St: deleted_message_view_state::State,
5158    St::Sender: deleted_message_view_state::IsUnset,
5159{
5160    /// Set the `sender` field (required)
5161    pub fn sender(
5162        mut self,
5163        value: impl Into<convo::MessageViewSender<S>>,
5164    ) -> DeletedMessageViewBuilder<deleted_message_view_state::SetSender<St>, S> {
5165        self._fields.2 = Option::Some(value.into());
5166        DeletedMessageViewBuilder {
5167            _state: PhantomData,
5168            _fields: self._fields,
5169            _type: PhantomData,
5170        }
5171    }
5172}
5173
5174impl<St, S: BosStr> DeletedMessageViewBuilder<St, S>
5175where
5176    St: deleted_message_view_state::State,
5177    St::SentAt: deleted_message_view_state::IsUnset,
5178{
5179    /// Set the `sentAt` field (required)
5180    pub fn sent_at(
5181        mut self,
5182        value: impl Into<Datetime>,
5183    ) -> DeletedMessageViewBuilder<deleted_message_view_state::SetSentAt<St>, S> {
5184        self._fields.3 = Option::Some(value.into());
5185        DeletedMessageViewBuilder {
5186            _state: PhantomData,
5187            _fields: self._fields,
5188            _type: PhantomData,
5189        }
5190    }
5191}
5192
5193impl<St, S: BosStr> DeletedMessageViewBuilder<St, S>
5194where
5195    St: deleted_message_view_state::State,
5196    St::Id: deleted_message_view_state::IsSet,
5197    St::Rev: deleted_message_view_state::IsSet,
5198    St::Sender: deleted_message_view_state::IsSet,
5199    St::SentAt: deleted_message_view_state::IsSet,
5200{
5201    /// Build the final struct.
5202    pub fn build(self) -> DeletedMessageView<S> {
5203        DeletedMessageView {
5204            id: self._fields.0.unwrap(),
5205            rev: self._fields.1.unwrap(),
5206            sender: self._fields.2.unwrap(),
5207            sent_at: self._fields.3.unwrap(),
5208            extra_data: Default::default(),
5209        }
5210    }
5211    /// Build the final struct with custom extra_data.
5212    pub fn build_with_data(self, extra_data: BTreeMap<SmolStr, Data<S>>) -> DeletedMessageView<S> {
5213        DeletedMessageView {
5214            id: self._fields.0.unwrap(),
5215            rev: self._fields.1.unwrap(),
5216            sender: self._fields.2.unwrap(),
5217            sent_at: self._fields.3.unwrap(),
5218            extra_data: Some(extra_data),
5219        }
5220    }
5221}
5222
5223pub mod group_convo_state {
5224
5225    pub use crate::builder_types::{IsSet, IsUnset, Set, Unset};
5226    #[allow(unused)]
5227    use ::core::marker::PhantomData;
5228    mod sealed {
5229        pub trait Sealed {}
5230    }
5231    /// State trait tracking which required fields have been set
5232    pub trait State: sealed::Sealed {
5233        type CreatedAt;
5234        type LockStatus;
5235        type LockStatusModerationOverride;
5236        type MemberCount;
5237        type MemberLimit;
5238        type Name;
5239    }
5240    /// Empty state - all required fields are unset
5241    pub struct Empty(());
5242    impl sealed::Sealed for Empty {}
5243    impl State for Empty {
5244        type CreatedAt = Unset;
5245        type LockStatus = Unset;
5246        type LockStatusModerationOverride = Unset;
5247        type MemberCount = Unset;
5248        type MemberLimit = Unset;
5249        type Name = Unset;
5250    }
5251    ///State transition - sets the `created_at` field to Set
5252    pub struct SetCreatedAt<St: State = Empty>(PhantomData<fn() -> St>);
5253    impl<St: State> sealed::Sealed for SetCreatedAt<St> {}
5254    impl<St: State> State for SetCreatedAt<St> {
5255        type CreatedAt = Set<members::created_at>;
5256        type LockStatus = St::LockStatus;
5257        type LockStatusModerationOverride = St::LockStatusModerationOverride;
5258        type MemberCount = St::MemberCount;
5259        type MemberLimit = St::MemberLimit;
5260        type Name = St::Name;
5261    }
5262    ///State transition - sets the `lock_status` field to Set
5263    pub struct SetLockStatus<St: State = Empty>(PhantomData<fn() -> St>);
5264    impl<St: State> sealed::Sealed for SetLockStatus<St> {}
5265    impl<St: State> State for SetLockStatus<St> {
5266        type CreatedAt = St::CreatedAt;
5267        type LockStatus = Set<members::lock_status>;
5268        type LockStatusModerationOverride = St::LockStatusModerationOverride;
5269        type MemberCount = St::MemberCount;
5270        type MemberLimit = St::MemberLimit;
5271        type Name = St::Name;
5272    }
5273    ///State transition - sets the `lock_status_moderation_override` field to Set
5274    pub struct SetLockStatusModerationOverride<St: State = Empty>(PhantomData<fn() -> St>);
5275    impl<St: State> sealed::Sealed for SetLockStatusModerationOverride<St> {}
5276    impl<St: State> State for SetLockStatusModerationOverride<St> {
5277        type CreatedAt = St::CreatedAt;
5278        type LockStatus = St::LockStatus;
5279        type LockStatusModerationOverride = Set<members::lock_status_moderation_override>;
5280        type MemberCount = St::MemberCount;
5281        type MemberLimit = St::MemberLimit;
5282        type Name = St::Name;
5283    }
5284    ///State transition - sets the `member_count` field to Set
5285    pub struct SetMemberCount<St: State = Empty>(PhantomData<fn() -> St>);
5286    impl<St: State> sealed::Sealed for SetMemberCount<St> {}
5287    impl<St: State> State for SetMemberCount<St> {
5288        type CreatedAt = St::CreatedAt;
5289        type LockStatus = St::LockStatus;
5290        type LockStatusModerationOverride = St::LockStatusModerationOverride;
5291        type MemberCount = Set<members::member_count>;
5292        type MemberLimit = St::MemberLimit;
5293        type Name = St::Name;
5294    }
5295    ///State transition - sets the `member_limit` field to Set
5296    pub struct SetMemberLimit<St: State = Empty>(PhantomData<fn() -> St>);
5297    impl<St: State> sealed::Sealed for SetMemberLimit<St> {}
5298    impl<St: State> State for SetMemberLimit<St> {
5299        type CreatedAt = St::CreatedAt;
5300        type LockStatus = St::LockStatus;
5301        type LockStatusModerationOverride = St::LockStatusModerationOverride;
5302        type MemberCount = St::MemberCount;
5303        type MemberLimit = Set<members::member_limit>;
5304        type Name = St::Name;
5305    }
5306    ///State transition - sets the `name` field to Set
5307    pub struct SetName<St: State = Empty>(PhantomData<fn() -> St>);
5308    impl<St: State> sealed::Sealed for SetName<St> {}
5309    impl<St: State> State for SetName<St> {
5310        type CreatedAt = St::CreatedAt;
5311        type LockStatus = St::LockStatus;
5312        type LockStatusModerationOverride = St::LockStatusModerationOverride;
5313        type MemberCount = St::MemberCount;
5314        type MemberLimit = St::MemberLimit;
5315        type Name = Set<members::name>;
5316    }
5317    /// Marker types for field names
5318    #[allow(non_camel_case_types)]
5319    pub mod members {
5320        ///Marker type for the `created_at` field
5321        pub struct created_at(());
5322        ///Marker type for the `lock_status` field
5323        pub struct lock_status(());
5324        ///Marker type for the `lock_status_moderation_override` field
5325        pub struct lock_status_moderation_override(());
5326        ///Marker type for the `member_count` field
5327        pub struct member_count(());
5328        ///Marker type for the `member_limit` field
5329        pub struct member_limit(());
5330        ///Marker type for the `name` field
5331        pub struct name(());
5332    }
5333}
5334
5335/// Builder for constructing an instance of this type.
5336pub struct GroupConvoBuilder<St: group_convo_state::State, S: BosStr = DefaultStr> {
5337    _state: PhantomData<fn() -> St>,
5338    _fields: (
5339        Option<Datetime>,
5340        Option<JoinLinkView<S>>,
5341        Option<i64>,
5342        Option<convo::ConvoLockStatus<S>>,
5343        Option<bool>,
5344        Option<i64>,
5345        Option<i64>,
5346        Option<S>,
5347        Option<i64>,
5348    ),
5349    _type: PhantomData<fn() -> S>,
5350}
5351
5352impl GroupConvo<DefaultStr> {
5353    /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed
5354    pub fn new() -> GroupConvoBuilder<group_convo_state::Empty, DefaultStr> {
5355        GroupConvoBuilder::new()
5356    }
5357}
5358
5359impl<S: BosStr> GroupConvo<S> {
5360    /// Create a new builder for this type
5361    pub fn builder() -> GroupConvoBuilder<group_convo_state::Empty, S> {
5362        GroupConvoBuilder::builder()
5363    }
5364}
5365
5366impl GroupConvoBuilder<group_convo_state::Empty, DefaultStr> {
5367    /// Create a new builder with all fields unset, using the default string type, if needed
5368    pub fn new() -> Self {
5369        GroupConvoBuilder {
5370            _state: PhantomData,
5371            _fields: (None, None, None, None, None, None, None, None, None),
5372            _type: PhantomData,
5373        }
5374    }
5375}
5376
5377impl<S: BosStr> GroupConvoBuilder<group_convo_state::Empty, S> {
5378    /// Create a new builder with all fields unset
5379    pub fn builder() -> Self {
5380        GroupConvoBuilder {
5381            _state: PhantomData,
5382            _fields: (None, None, None, None, None, None, None, None, None),
5383            _type: PhantomData,
5384        }
5385    }
5386}
5387
5388impl<St, S: BosStr> GroupConvoBuilder<St, S>
5389where
5390    St: group_convo_state::State,
5391    St::CreatedAt: group_convo_state::IsUnset,
5392{
5393    /// Set the `createdAt` field (required)
5394    pub fn created_at(
5395        mut self,
5396        value: impl Into<Datetime>,
5397    ) -> GroupConvoBuilder<group_convo_state::SetCreatedAt<St>, S> {
5398        self._fields.0 = Option::Some(value.into());
5399        GroupConvoBuilder {
5400            _state: PhantomData,
5401            _fields: self._fields,
5402            _type: PhantomData,
5403        }
5404    }
5405}
5406
5407impl<St: group_convo_state::State, S: BosStr> GroupConvoBuilder<St, S> {
5408    /// Set the `joinLink` field (optional)
5409    pub fn join_link(mut self, value: impl Into<Option<JoinLinkView<S>>>) -> Self {
5410        self._fields.1 = value.into();
5411        self
5412    }
5413    /// Set the `joinLink` field to an Option value (optional)
5414    pub fn maybe_join_link(mut self, value: Option<JoinLinkView<S>>) -> Self {
5415        self._fields.1 = value;
5416        self
5417    }
5418}
5419
5420impl<St: group_convo_state::State, S: BosStr> GroupConvoBuilder<St, S> {
5421    /// Set the `joinRequestCount` field (optional)
5422    pub fn join_request_count(mut self, value: impl Into<Option<i64>>) -> Self {
5423        self._fields.2 = value.into();
5424        self
5425    }
5426    /// Set the `joinRequestCount` field to an Option value (optional)
5427    pub fn maybe_join_request_count(mut self, value: Option<i64>) -> Self {
5428        self._fields.2 = value;
5429        self
5430    }
5431}
5432
5433impl<St, S: BosStr> GroupConvoBuilder<St, S>
5434where
5435    St: group_convo_state::State,
5436    St::LockStatus: group_convo_state::IsUnset,
5437{
5438    /// Set the `lockStatus` field (required)
5439    pub fn lock_status(
5440        mut self,
5441        value: impl Into<convo::ConvoLockStatus<S>>,
5442    ) -> GroupConvoBuilder<group_convo_state::SetLockStatus<St>, S> {
5443        self._fields.3 = Option::Some(value.into());
5444        GroupConvoBuilder {
5445            _state: PhantomData,
5446            _fields: self._fields,
5447            _type: PhantomData,
5448        }
5449    }
5450}
5451
5452impl<St, S: BosStr> GroupConvoBuilder<St, S>
5453where
5454    St: group_convo_state::State,
5455    St::LockStatusModerationOverride: group_convo_state::IsUnset,
5456{
5457    /// Set the `lockStatusModerationOverride` field (required)
5458    pub fn lock_status_moderation_override(
5459        mut self,
5460        value: impl Into<bool>,
5461    ) -> GroupConvoBuilder<group_convo_state::SetLockStatusModerationOverride<St>, S> {
5462        self._fields.4 = Option::Some(value.into());
5463        GroupConvoBuilder {
5464            _state: PhantomData,
5465            _fields: self._fields,
5466            _type: PhantomData,
5467        }
5468    }
5469}
5470
5471impl<St, S: BosStr> GroupConvoBuilder<St, S>
5472where
5473    St: group_convo_state::State,
5474    St::MemberCount: group_convo_state::IsUnset,
5475{
5476    /// Set the `memberCount` field (required)
5477    pub fn member_count(
5478        mut self,
5479        value: impl Into<i64>,
5480    ) -> GroupConvoBuilder<group_convo_state::SetMemberCount<St>, S> {
5481        self._fields.5 = Option::Some(value.into());
5482        GroupConvoBuilder {
5483            _state: PhantomData,
5484            _fields: self._fields,
5485            _type: PhantomData,
5486        }
5487    }
5488}
5489
5490impl<St, S: BosStr> GroupConvoBuilder<St, S>
5491where
5492    St: group_convo_state::State,
5493    St::MemberLimit: group_convo_state::IsUnset,
5494{
5495    /// Set the `memberLimit` field (required)
5496    pub fn member_limit(
5497        mut self,
5498        value: impl Into<i64>,
5499    ) -> GroupConvoBuilder<group_convo_state::SetMemberLimit<St>, S> {
5500        self._fields.6 = Option::Some(value.into());
5501        GroupConvoBuilder {
5502            _state: PhantomData,
5503            _fields: self._fields,
5504            _type: PhantomData,
5505        }
5506    }
5507}
5508
5509impl<St, S: BosStr> GroupConvoBuilder<St, S>
5510where
5511    St: group_convo_state::State,
5512    St::Name: group_convo_state::IsUnset,
5513{
5514    /// Set the `name` field (required)
5515    pub fn name(
5516        mut self,
5517        value: impl Into<S>,
5518    ) -> GroupConvoBuilder<group_convo_state::SetName<St>, S> {
5519        self._fields.7 = Option::Some(value.into());
5520        GroupConvoBuilder {
5521            _state: PhantomData,
5522            _fields: self._fields,
5523            _type: PhantomData,
5524        }
5525    }
5526}
5527
5528impl<St: group_convo_state::State, S: BosStr> GroupConvoBuilder<St, S> {
5529    /// Set the `unreadJoinRequestCount` field (optional)
5530    pub fn unread_join_request_count(mut self, value: impl Into<Option<i64>>) -> Self {
5531        self._fields.8 = value.into();
5532        self
5533    }
5534    /// Set the `unreadJoinRequestCount` field to an Option value (optional)
5535    pub fn maybe_unread_join_request_count(mut self, value: Option<i64>) -> Self {
5536        self._fields.8 = value;
5537        self
5538    }
5539}
5540
5541impl<St, S: BosStr> GroupConvoBuilder<St, S>
5542where
5543    St: group_convo_state::State,
5544    St::CreatedAt: group_convo_state::IsSet,
5545    St::LockStatus: group_convo_state::IsSet,
5546    St::LockStatusModerationOverride: group_convo_state::IsSet,
5547    St::MemberCount: group_convo_state::IsSet,
5548    St::MemberLimit: group_convo_state::IsSet,
5549    St::Name: group_convo_state::IsSet,
5550{
5551    /// Build the final struct.
5552    pub fn build(self) -> GroupConvo<S> {
5553        GroupConvo {
5554            created_at: self._fields.0.unwrap(),
5555            join_link: self._fields.1,
5556            join_request_count: self._fields.2,
5557            lock_status: self._fields.3.unwrap(),
5558            lock_status_moderation_override: self._fields.4.unwrap(),
5559            member_count: self._fields.5.unwrap(),
5560            member_limit: self._fields.6.unwrap(),
5561            name: self._fields.7.unwrap(),
5562            unread_join_request_count: self._fields.8,
5563            extra_data: Default::default(),
5564        }
5565    }
5566    /// Build the final struct with custom extra_data.
5567    pub fn build_with_data(self, extra_data: BTreeMap<SmolStr, Data<S>>) -> GroupConvo<S> {
5568        GroupConvo {
5569            created_at: self._fields.0.unwrap(),
5570            join_link: self._fields.1,
5571            join_request_count: self._fields.2,
5572            lock_status: self._fields.3.unwrap(),
5573            lock_status_moderation_override: self._fields.4.unwrap(),
5574            member_count: self._fields.5.unwrap(),
5575            member_limit: self._fields.6.unwrap(),
5576            name: self._fields.7.unwrap(),
5577            unread_join_request_count: self._fields.8,
5578            extra_data: Some(extra_data),
5579        }
5580    }
5581}
5582
5583pub mod log_add_member_state {
5584
5585    pub use crate::builder_types::{IsSet, IsUnset, Set, Unset};
5586    #[allow(unused)]
5587    use ::core::marker::PhantomData;
5588    mod sealed {
5589        pub trait Sealed {}
5590    }
5591    /// State trait tracking which required fields have been set
5592    pub trait State: sealed::Sealed {
5593        type ConvoId;
5594        type Message;
5595        type RelatedProfiles;
5596        type Rev;
5597    }
5598    /// Empty state - all required fields are unset
5599    pub struct Empty(());
5600    impl sealed::Sealed for Empty {}
5601    impl State for Empty {
5602        type ConvoId = Unset;
5603        type Message = Unset;
5604        type RelatedProfiles = Unset;
5605        type Rev = Unset;
5606    }
5607    ///State transition - sets the `convo_id` field to Set
5608    pub struct SetConvoId<St: State = Empty>(PhantomData<fn() -> St>);
5609    impl<St: State> sealed::Sealed for SetConvoId<St> {}
5610    impl<St: State> State for SetConvoId<St> {
5611        type ConvoId = Set<members::convo_id>;
5612        type Message = St::Message;
5613        type RelatedProfiles = St::RelatedProfiles;
5614        type Rev = St::Rev;
5615    }
5616    ///State transition - sets the `message` field to Set
5617    pub struct SetMessage<St: State = Empty>(PhantomData<fn() -> St>);
5618    impl<St: State> sealed::Sealed for SetMessage<St> {}
5619    impl<St: State> State for SetMessage<St> {
5620        type ConvoId = St::ConvoId;
5621        type Message = Set<members::message>;
5622        type RelatedProfiles = St::RelatedProfiles;
5623        type Rev = St::Rev;
5624    }
5625    ///State transition - sets the `related_profiles` field to Set
5626    pub struct SetRelatedProfiles<St: State = Empty>(PhantomData<fn() -> St>);
5627    impl<St: State> sealed::Sealed for SetRelatedProfiles<St> {}
5628    impl<St: State> State for SetRelatedProfiles<St> {
5629        type ConvoId = St::ConvoId;
5630        type Message = St::Message;
5631        type RelatedProfiles = Set<members::related_profiles>;
5632        type Rev = St::Rev;
5633    }
5634    ///State transition - sets the `rev` field to Set
5635    pub struct SetRev<St: State = Empty>(PhantomData<fn() -> St>);
5636    impl<St: State> sealed::Sealed for SetRev<St> {}
5637    impl<St: State> State for SetRev<St> {
5638        type ConvoId = St::ConvoId;
5639        type Message = St::Message;
5640        type RelatedProfiles = St::RelatedProfiles;
5641        type Rev = Set<members::rev>;
5642    }
5643    /// Marker types for field names
5644    #[allow(non_camel_case_types)]
5645    pub mod members {
5646        ///Marker type for the `convo_id` field
5647        pub struct convo_id(());
5648        ///Marker type for the `message` field
5649        pub struct message(());
5650        ///Marker type for the `related_profiles` field
5651        pub struct related_profiles(());
5652        ///Marker type for the `rev` field
5653        pub struct rev(());
5654    }
5655}
5656
5657/// Builder for constructing an instance of this type.
5658pub struct LogAddMemberBuilder<St: log_add_member_state::State, S: BosStr = DefaultStr> {
5659    _state: PhantomData<fn() -> St>,
5660    _fields: (
5661        Option<S>,
5662        Option<convo::SystemMessageView<S>>,
5663        Option<Vec<ProfileViewBasic<S>>>,
5664        Option<S>,
5665    ),
5666    _type: PhantomData<fn() -> S>,
5667}
5668
5669impl LogAddMember<DefaultStr> {
5670    /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed
5671    pub fn new() -> LogAddMemberBuilder<log_add_member_state::Empty, DefaultStr> {
5672        LogAddMemberBuilder::new()
5673    }
5674}
5675
5676impl<S: BosStr> LogAddMember<S> {
5677    /// Create a new builder for this type
5678    pub fn builder() -> LogAddMemberBuilder<log_add_member_state::Empty, S> {
5679        LogAddMemberBuilder::builder()
5680    }
5681}
5682
5683impl LogAddMemberBuilder<log_add_member_state::Empty, DefaultStr> {
5684    /// Create a new builder with all fields unset, using the default string type, if needed
5685    pub fn new() -> Self {
5686        LogAddMemberBuilder {
5687            _state: PhantomData,
5688            _fields: (None, None, None, None),
5689            _type: PhantomData,
5690        }
5691    }
5692}
5693
5694impl<S: BosStr> LogAddMemberBuilder<log_add_member_state::Empty, S> {
5695    /// Create a new builder with all fields unset
5696    pub fn builder() -> Self {
5697        LogAddMemberBuilder {
5698            _state: PhantomData,
5699            _fields: (None, None, None, None),
5700            _type: PhantomData,
5701        }
5702    }
5703}
5704
5705impl<St, S: BosStr> LogAddMemberBuilder<St, S>
5706where
5707    St: log_add_member_state::State,
5708    St::ConvoId: log_add_member_state::IsUnset,
5709{
5710    /// Set the `convoId` field (required)
5711    pub fn convo_id(
5712        mut self,
5713        value: impl Into<S>,
5714    ) -> LogAddMemberBuilder<log_add_member_state::SetConvoId<St>, S> {
5715        self._fields.0 = Option::Some(value.into());
5716        LogAddMemberBuilder {
5717            _state: PhantomData,
5718            _fields: self._fields,
5719            _type: PhantomData,
5720        }
5721    }
5722}
5723
5724impl<St, S: BosStr> LogAddMemberBuilder<St, S>
5725where
5726    St: log_add_member_state::State,
5727    St::Message: log_add_member_state::IsUnset,
5728{
5729    /// Set the `message` field (required)
5730    pub fn message(
5731        mut self,
5732        value: impl Into<convo::SystemMessageView<S>>,
5733    ) -> LogAddMemberBuilder<log_add_member_state::SetMessage<St>, S> {
5734        self._fields.1 = Option::Some(value.into());
5735        LogAddMemberBuilder {
5736            _state: PhantomData,
5737            _fields: self._fields,
5738            _type: PhantomData,
5739        }
5740    }
5741}
5742
5743impl<St, S: BosStr> LogAddMemberBuilder<St, S>
5744where
5745    St: log_add_member_state::State,
5746    St::RelatedProfiles: log_add_member_state::IsUnset,
5747{
5748    /// Set the `relatedProfiles` field (required)
5749    pub fn related_profiles(
5750        mut self,
5751        value: impl Into<Vec<ProfileViewBasic<S>>>,
5752    ) -> LogAddMemberBuilder<log_add_member_state::SetRelatedProfiles<St>, S> {
5753        self._fields.2 = Option::Some(value.into());
5754        LogAddMemberBuilder {
5755            _state: PhantomData,
5756            _fields: self._fields,
5757            _type: PhantomData,
5758        }
5759    }
5760}
5761
5762impl<St, S: BosStr> LogAddMemberBuilder<St, S>
5763where
5764    St: log_add_member_state::State,
5765    St::Rev: log_add_member_state::IsUnset,
5766{
5767    /// Set the `rev` field (required)
5768    pub fn rev(
5769        mut self,
5770        value: impl Into<S>,
5771    ) -> LogAddMemberBuilder<log_add_member_state::SetRev<St>, S> {
5772        self._fields.3 = Option::Some(value.into());
5773        LogAddMemberBuilder {
5774            _state: PhantomData,
5775            _fields: self._fields,
5776            _type: PhantomData,
5777        }
5778    }
5779}
5780
5781impl<St, S: BosStr> LogAddMemberBuilder<St, S>
5782where
5783    St: log_add_member_state::State,
5784    St::ConvoId: log_add_member_state::IsSet,
5785    St::Message: log_add_member_state::IsSet,
5786    St::RelatedProfiles: log_add_member_state::IsSet,
5787    St::Rev: log_add_member_state::IsSet,
5788{
5789    /// Build the final struct.
5790    pub fn build(self) -> LogAddMember<S> {
5791        LogAddMember {
5792            convo_id: self._fields.0.unwrap(),
5793            message: self._fields.1.unwrap(),
5794            related_profiles: self._fields.2.unwrap(),
5795            rev: self._fields.3.unwrap(),
5796            extra_data: Default::default(),
5797        }
5798    }
5799    /// Build the final struct with custom extra_data.
5800    pub fn build_with_data(self, extra_data: BTreeMap<SmolStr, Data<S>>) -> LogAddMember<S> {
5801        LogAddMember {
5802            convo_id: self._fields.0.unwrap(),
5803            message: self._fields.1.unwrap(),
5804            related_profiles: self._fields.2.unwrap(),
5805            rev: self._fields.3.unwrap(),
5806            extra_data: Some(extra_data),
5807        }
5808    }
5809}
5810
5811pub mod log_add_reaction_state {
5812
5813    pub use crate::builder_types::{IsSet, IsUnset, Set, Unset};
5814    #[allow(unused)]
5815    use ::core::marker::PhantomData;
5816    mod sealed {
5817        pub trait Sealed {}
5818    }
5819    /// State trait tracking which required fields have been set
5820    pub trait State: sealed::Sealed {
5821        type ConvoId;
5822        type Message;
5823        type Reaction;
5824        type Rev;
5825    }
5826    /// Empty state - all required fields are unset
5827    pub struct Empty(());
5828    impl sealed::Sealed for Empty {}
5829    impl State for Empty {
5830        type ConvoId = Unset;
5831        type Message = Unset;
5832        type Reaction = Unset;
5833        type Rev = Unset;
5834    }
5835    ///State transition - sets the `convo_id` field to Set
5836    pub struct SetConvoId<St: State = Empty>(PhantomData<fn() -> St>);
5837    impl<St: State> sealed::Sealed for SetConvoId<St> {}
5838    impl<St: State> State for SetConvoId<St> {
5839        type ConvoId = Set<members::convo_id>;
5840        type Message = St::Message;
5841        type Reaction = St::Reaction;
5842        type Rev = St::Rev;
5843    }
5844    ///State transition - sets the `message` field to Set
5845    pub struct SetMessage<St: State = Empty>(PhantomData<fn() -> St>);
5846    impl<St: State> sealed::Sealed for SetMessage<St> {}
5847    impl<St: State> State for SetMessage<St> {
5848        type ConvoId = St::ConvoId;
5849        type Message = Set<members::message>;
5850        type Reaction = St::Reaction;
5851        type Rev = St::Rev;
5852    }
5853    ///State transition - sets the `reaction` field to Set
5854    pub struct SetReaction<St: State = Empty>(PhantomData<fn() -> St>);
5855    impl<St: State> sealed::Sealed for SetReaction<St> {}
5856    impl<St: State> State for SetReaction<St> {
5857        type ConvoId = St::ConvoId;
5858        type Message = St::Message;
5859        type Reaction = Set<members::reaction>;
5860        type Rev = St::Rev;
5861    }
5862    ///State transition - sets the `rev` field to Set
5863    pub struct SetRev<St: State = Empty>(PhantomData<fn() -> St>);
5864    impl<St: State> sealed::Sealed for SetRev<St> {}
5865    impl<St: State> State for SetRev<St> {
5866        type ConvoId = St::ConvoId;
5867        type Message = St::Message;
5868        type Reaction = St::Reaction;
5869        type Rev = Set<members::rev>;
5870    }
5871    /// Marker types for field names
5872    #[allow(non_camel_case_types)]
5873    pub mod members {
5874        ///Marker type for the `convo_id` field
5875        pub struct convo_id(());
5876        ///Marker type for the `message` field
5877        pub struct message(());
5878        ///Marker type for the `reaction` field
5879        pub struct reaction(());
5880        ///Marker type for the `rev` field
5881        pub struct rev(());
5882    }
5883}
5884
5885/// Builder for constructing an instance of this type.
5886pub struct LogAddReactionBuilder<St: log_add_reaction_state::State, S: BosStr = DefaultStr> {
5887    _state: PhantomData<fn() -> St>,
5888    _fields: (
5889        Option<S>,
5890        Option<LogAddReactionMessage<S>>,
5891        Option<convo::ReactionView<S>>,
5892        Option<Vec<ProfileViewBasic<S>>>,
5893        Option<S>,
5894    ),
5895    _type: PhantomData<fn() -> S>,
5896}
5897
5898impl LogAddReaction<DefaultStr> {
5899    /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed
5900    pub fn new() -> LogAddReactionBuilder<log_add_reaction_state::Empty, DefaultStr> {
5901        LogAddReactionBuilder::new()
5902    }
5903}
5904
5905impl<S: BosStr> LogAddReaction<S> {
5906    /// Create a new builder for this type
5907    pub fn builder() -> LogAddReactionBuilder<log_add_reaction_state::Empty, S> {
5908        LogAddReactionBuilder::builder()
5909    }
5910}
5911
5912impl LogAddReactionBuilder<log_add_reaction_state::Empty, DefaultStr> {
5913    /// Create a new builder with all fields unset, using the default string type, if needed
5914    pub fn new() -> Self {
5915        LogAddReactionBuilder {
5916            _state: PhantomData,
5917            _fields: (None, None, None, None, None),
5918            _type: PhantomData,
5919        }
5920    }
5921}
5922
5923impl<S: BosStr> LogAddReactionBuilder<log_add_reaction_state::Empty, S> {
5924    /// Create a new builder with all fields unset
5925    pub fn builder() -> Self {
5926        LogAddReactionBuilder {
5927            _state: PhantomData,
5928            _fields: (None, None, None, None, None),
5929            _type: PhantomData,
5930        }
5931    }
5932}
5933
5934impl<St, S: BosStr> LogAddReactionBuilder<St, S>
5935where
5936    St: log_add_reaction_state::State,
5937    St::ConvoId: log_add_reaction_state::IsUnset,
5938{
5939    /// Set the `convoId` field (required)
5940    pub fn convo_id(
5941        mut self,
5942        value: impl Into<S>,
5943    ) -> LogAddReactionBuilder<log_add_reaction_state::SetConvoId<St>, S> {
5944        self._fields.0 = Option::Some(value.into());
5945        LogAddReactionBuilder {
5946            _state: PhantomData,
5947            _fields: self._fields,
5948            _type: PhantomData,
5949        }
5950    }
5951}
5952
5953impl<St, S: BosStr> LogAddReactionBuilder<St, S>
5954where
5955    St: log_add_reaction_state::State,
5956    St::Message: log_add_reaction_state::IsUnset,
5957{
5958    /// Set the `message` field (required)
5959    pub fn message(
5960        mut self,
5961        value: impl Into<LogAddReactionMessage<S>>,
5962    ) -> LogAddReactionBuilder<log_add_reaction_state::SetMessage<St>, S> {
5963        self._fields.1 = Option::Some(value.into());
5964        LogAddReactionBuilder {
5965            _state: PhantomData,
5966            _fields: self._fields,
5967            _type: PhantomData,
5968        }
5969    }
5970}
5971
5972impl<St, S: BosStr> LogAddReactionBuilder<St, S>
5973where
5974    St: log_add_reaction_state::State,
5975    St::Reaction: log_add_reaction_state::IsUnset,
5976{
5977    /// Set the `reaction` field (required)
5978    pub fn reaction(
5979        mut self,
5980        value: impl Into<convo::ReactionView<S>>,
5981    ) -> LogAddReactionBuilder<log_add_reaction_state::SetReaction<St>, S> {
5982        self._fields.2 = Option::Some(value.into());
5983        LogAddReactionBuilder {
5984            _state: PhantomData,
5985            _fields: self._fields,
5986            _type: PhantomData,
5987        }
5988    }
5989}
5990
5991impl<St: log_add_reaction_state::State, S: BosStr> LogAddReactionBuilder<St, S> {
5992    /// Set the `relatedProfiles` field (optional)
5993    pub fn related_profiles(mut self, value: impl Into<Option<Vec<ProfileViewBasic<S>>>>) -> Self {
5994        self._fields.3 = value.into();
5995        self
5996    }
5997    /// Set the `relatedProfiles` field to an Option value (optional)
5998    pub fn maybe_related_profiles(mut self, value: Option<Vec<ProfileViewBasic<S>>>) -> Self {
5999        self._fields.3 = value;
6000        self
6001    }
6002}
6003
6004impl<St, S: BosStr> LogAddReactionBuilder<St, S>
6005where
6006    St: log_add_reaction_state::State,
6007    St::Rev: log_add_reaction_state::IsUnset,
6008{
6009    /// Set the `rev` field (required)
6010    pub fn rev(
6011        mut self,
6012        value: impl Into<S>,
6013    ) -> LogAddReactionBuilder<log_add_reaction_state::SetRev<St>, S> {
6014        self._fields.4 = Option::Some(value.into());
6015        LogAddReactionBuilder {
6016            _state: PhantomData,
6017            _fields: self._fields,
6018            _type: PhantomData,
6019        }
6020    }
6021}
6022
6023impl<St, S: BosStr> LogAddReactionBuilder<St, S>
6024where
6025    St: log_add_reaction_state::State,
6026    St::ConvoId: log_add_reaction_state::IsSet,
6027    St::Message: log_add_reaction_state::IsSet,
6028    St::Reaction: log_add_reaction_state::IsSet,
6029    St::Rev: log_add_reaction_state::IsSet,
6030{
6031    /// Build the final struct.
6032    pub fn build(self) -> LogAddReaction<S> {
6033        LogAddReaction {
6034            convo_id: self._fields.0.unwrap(),
6035            message: self._fields.1.unwrap(),
6036            reaction: self._fields.2.unwrap(),
6037            related_profiles: self._fields.3,
6038            rev: self._fields.4.unwrap(),
6039            extra_data: Default::default(),
6040        }
6041    }
6042    /// Build the final struct with custom extra_data.
6043    pub fn build_with_data(self, extra_data: BTreeMap<SmolStr, Data<S>>) -> LogAddReaction<S> {
6044        LogAddReaction {
6045            convo_id: self._fields.0.unwrap(),
6046            message: self._fields.1.unwrap(),
6047            reaction: self._fields.2.unwrap(),
6048            related_profiles: self._fields.3,
6049            rev: self._fields.4.unwrap(),
6050            extra_data: Some(extra_data),
6051        }
6052    }
6053}
6054
6055pub mod log_approve_join_request_state {
6056
6057    pub use crate::builder_types::{IsSet, IsUnset, Set, Unset};
6058    #[allow(unused)]
6059    use ::core::marker::PhantomData;
6060    mod sealed {
6061        pub trait Sealed {}
6062    }
6063    /// State trait tracking which required fields have been set
6064    pub trait State: sealed::Sealed {
6065        type ConvoId;
6066        type Member;
6067        type Rev;
6068    }
6069    /// Empty state - all required fields are unset
6070    pub struct Empty(());
6071    impl sealed::Sealed for Empty {}
6072    impl State for Empty {
6073        type ConvoId = Unset;
6074        type Member = Unset;
6075        type Rev = Unset;
6076    }
6077    ///State transition - sets the `convo_id` field to Set
6078    pub struct SetConvoId<St: State = Empty>(PhantomData<fn() -> St>);
6079    impl<St: State> sealed::Sealed for SetConvoId<St> {}
6080    impl<St: State> State for SetConvoId<St> {
6081        type ConvoId = Set<members::convo_id>;
6082        type Member = St::Member;
6083        type Rev = St::Rev;
6084    }
6085    ///State transition - sets the `member` field to Set
6086    pub struct SetMember<St: State = Empty>(PhantomData<fn() -> St>);
6087    impl<St: State> sealed::Sealed for SetMember<St> {}
6088    impl<St: State> State for SetMember<St> {
6089        type ConvoId = St::ConvoId;
6090        type Member = Set<members::member>;
6091        type Rev = St::Rev;
6092    }
6093    ///State transition - sets the `rev` field to Set
6094    pub struct SetRev<St: State = Empty>(PhantomData<fn() -> St>);
6095    impl<St: State> sealed::Sealed for SetRev<St> {}
6096    impl<St: State> State for SetRev<St> {
6097        type ConvoId = St::ConvoId;
6098        type Member = St::Member;
6099        type Rev = Set<members::rev>;
6100    }
6101    /// Marker types for field names
6102    #[allow(non_camel_case_types)]
6103    pub mod members {
6104        ///Marker type for the `convo_id` field
6105        pub struct convo_id(());
6106        ///Marker type for the `member` field
6107        pub struct member(());
6108        ///Marker type for the `rev` field
6109        pub struct rev(());
6110    }
6111}
6112
6113/// Builder for constructing an instance of this type.
6114pub struct LogApproveJoinRequestBuilder<
6115    St: log_approve_join_request_state::State,
6116    S: BosStr = DefaultStr,
6117> {
6118    _state: PhantomData<fn() -> St>,
6119    _fields: (Option<S>, Option<ProfileViewBasic<S>>, Option<S>),
6120    _type: PhantomData<fn() -> S>,
6121}
6122
6123impl LogApproveJoinRequest<DefaultStr> {
6124    /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed
6125    pub fn new() -> LogApproveJoinRequestBuilder<log_approve_join_request_state::Empty, DefaultStr>
6126    {
6127        LogApproveJoinRequestBuilder::new()
6128    }
6129}
6130
6131impl<S: BosStr> LogApproveJoinRequest<S> {
6132    /// Create a new builder for this type
6133    pub fn builder() -> LogApproveJoinRequestBuilder<log_approve_join_request_state::Empty, S> {
6134        LogApproveJoinRequestBuilder::builder()
6135    }
6136}
6137
6138impl LogApproveJoinRequestBuilder<log_approve_join_request_state::Empty, DefaultStr> {
6139    /// Create a new builder with all fields unset, using the default string type, if needed
6140    pub fn new() -> Self {
6141        LogApproveJoinRequestBuilder {
6142            _state: PhantomData,
6143            _fields: (None, None, None),
6144            _type: PhantomData,
6145        }
6146    }
6147}
6148
6149impl<S: BosStr> LogApproveJoinRequestBuilder<log_approve_join_request_state::Empty, S> {
6150    /// Create a new builder with all fields unset
6151    pub fn builder() -> Self {
6152        LogApproveJoinRequestBuilder {
6153            _state: PhantomData,
6154            _fields: (None, None, None),
6155            _type: PhantomData,
6156        }
6157    }
6158}
6159
6160impl<St, S: BosStr> LogApproveJoinRequestBuilder<St, S>
6161where
6162    St: log_approve_join_request_state::State,
6163    St::ConvoId: log_approve_join_request_state::IsUnset,
6164{
6165    /// Set the `convoId` field (required)
6166    pub fn convo_id(
6167        mut self,
6168        value: impl Into<S>,
6169    ) -> LogApproveJoinRequestBuilder<log_approve_join_request_state::SetConvoId<St>, S> {
6170        self._fields.0 = Option::Some(value.into());
6171        LogApproveJoinRequestBuilder {
6172            _state: PhantomData,
6173            _fields: self._fields,
6174            _type: PhantomData,
6175        }
6176    }
6177}
6178
6179impl<St, S: BosStr> LogApproveJoinRequestBuilder<St, S>
6180where
6181    St: log_approve_join_request_state::State,
6182    St::Member: log_approve_join_request_state::IsUnset,
6183{
6184    /// Set the `member` field (required)
6185    pub fn member(
6186        mut self,
6187        value: impl Into<ProfileViewBasic<S>>,
6188    ) -> LogApproveJoinRequestBuilder<log_approve_join_request_state::SetMember<St>, S> {
6189        self._fields.1 = Option::Some(value.into());
6190        LogApproveJoinRequestBuilder {
6191            _state: PhantomData,
6192            _fields: self._fields,
6193            _type: PhantomData,
6194        }
6195    }
6196}
6197
6198impl<St, S: BosStr> LogApproveJoinRequestBuilder<St, S>
6199where
6200    St: log_approve_join_request_state::State,
6201    St::Rev: log_approve_join_request_state::IsUnset,
6202{
6203    /// Set the `rev` field (required)
6204    pub fn rev(
6205        mut self,
6206        value: impl Into<S>,
6207    ) -> LogApproveJoinRequestBuilder<log_approve_join_request_state::SetRev<St>, S> {
6208        self._fields.2 = Option::Some(value.into());
6209        LogApproveJoinRequestBuilder {
6210            _state: PhantomData,
6211            _fields: self._fields,
6212            _type: PhantomData,
6213        }
6214    }
6215}
6216
6217impl<St, S: BosStr> LogApproveJoinRequestBuilder<St, S>
6218where
6219    St: log_approve_join_request_state::State,
6220    St::ConvoId: log_approve_join_request_state::IsSet,
6221    St::Member: log_approve_join_request_state::IsSet,
6222    St::Rev: log_approve_join_request_state::IsSet,
6223{
6224    /// Build the final struct.
6225    pub fn build(self) -> LogApproveJoinRequest<S> {
6226        LogApproveJoinRequest {
6227            convo_id: self._fields.0.unwrap(),
6228            member: self._fields.1.unwrap(),
6229            rev: self._fields.2.unwrap(),
6230            extra_data: Default::default(),
6231        }
6232    }
6233    /// Build the final struct with custom extra_data.
6234    pub fn build_with_data(
6235        self,
6236        extra_data: BTreeMap<SmolStr, Data<S>>,
6237    ) -> LogApproveJoinRequest<S> {
6238        LogApproveJoinRequest {
6239            convo_id: self._fields.0.unwrap(),
6240            member: self._fields.1.unwrap(),
6241            rev: self._fields.2.unwrap(),
6242            extra_data: Some(extra_data),
6243        }
6244    }
6245}
6246
6247pub mod log_create_join_link_state {
6248
6249    pub use crate::builder_types::{IsSet, IsUnset, Set, Unset};
6250    #[allow(unused)]
6251    use ::core::marker::PhantomData;
6252    mod sealed {
6253        pub trait Sealed {}
6254    }
6255    /// State trait tracking which required fields have been set
6256    pub trait State: sealed::Sealed {
6257        type ConvoId;
6258        type Message;
6259        type Rev;
6260    }
6261    /// Empty state - all required fields are unset
6262    pub struct Empty(());
6263    impl sealed::Sealed for Empty {}
6264    impl State for Empty {
6265        type ConvoId = Unset;
6266        type Message = Unset;
6267        type Rev = Unset;
6268    }
6269    ///State transition - sets the `convo_id` field to Set
6270    pub struct SetConvoId<St: State = Empty>(PhantomData<fn() -> St>);
6271    impl<St: State> sealed::Sealed for SetConvoId<St> {}
6272    impl<St: State> State for SetConvoId<St> {
6273        type ConvoId = Set<members::convo_id>;
6274        type Message = St::Message;
6275        type Rev = St::Rev;
6276    }
6277    ///State transition - sets the `message` field to Set
6278    pub struct SetMessage<St: State = Empty>(PhantomData<fn() -> St>);
6279    impl<St: State> sealed::Sealed for SetMessage<St> {}
6280    impl<St: State> State for SetMessage<St> {
6281        type ConvoId = St::ConvoId;
6282        type Message = Set<members::message>;
6283        type Rev = St::Rev;
6284    }
6285    ///State transition - sets the `rev` field to Set
6286    pub struct SetRev<St: State = Empty>(PhantomData<fn() -> St>);
6287    impl<St: State> sealed::Sealed for SetRev<St> {}
6288    impl<St: State> State for SetRev<St> {
6289        type ConvoId = St::ConvoId;
6290        type Message = St::Message;
6291        type Rev = Set<members::rev>;
6292    }
6293    /// Marker types for field names
6294    #[allow(non_camel_case_types)]
6295    pub mod members {
6296        ///Marker type for the `convo_id` field
6297        pub struct convo_id(());
6298        ///Marker type for the `message` field
6299        pub struct message(());
6300        ///Marker type for the `rev` field
6301        pub struct rev(());
6302    }
6303}
6304
6305/// Builder for constructing an instance of this type.
6306pub struct LogCreateJoinLinkBuilder<St: log_create_join_link_state::State, S: BosStr = DefaultStr> {
6307    _state: PhantomData<fn() -> St>,
6308    _fields: (Option<S>, Option<convo::SystemMessageView<S>>, Option<S>),
6309    _type: PhantomData<fn() -> S>,
6310}
6311
6312impl LogCreateJoinLink<DefaultStr> {
6313    /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed
6314    pub fn new() -> LogCreateJoinLinkBuilder<log_create_join_link_state::Empty, DefaultStr> {
6315        LogCreateJoinLinkBuilder::new()
6316    }
6317}
6318
6319impl<S: BosStr> LogCreateJoinLink<S> {
6320    /// Create a new builder for this type
6321    pub fn builder() -> LogCreateJoinLinkBuilder<log_create_join_link_state::Empty, S> {
6322        LogCreateJoinLinkBuilder::builder()
6323    }
6324}
6325
6326impl LogCreateJoinLinkBuilder<log_create_join_link_state::Empty, DefaultStr> {
6327    /// Create a new builder with all fields unset, using the default string type, if needed
6328    pub fn new() -> Self {
6329        LogCreateJoinLinkBuilder {
6330            _state: PhantomData,
6331            _fields: (None, None, None),
6332            _type: PhantomData,
6333        }
6334    }
6335}
6336
6337impl<S: BosStr> LogCreateJoinLinkBuilder<log_create_join_link_state::Empty, S> {
6338    /// Create a new builder with all fields unset
6339    pub fn builder() -> Self {
6340        LogCreateJoinLinkBuilder {
6341            _state: PhantomData,
6342            _fields: (None, None, None),
6343            _type: PhantomData,
6344        }
6345    }
6346}
6347
6348impl<St, S: BosStr> LogCreateJoinLinkBuilder<St, S>
6349where
6350    St: log_create_join_link_state::State,
6351    St::ConvoId: log_create_join_link_state::IsUnset,
6352{
6353    /// Set the `convoId` field (required)
6354    pub fn convo_id(
6355        mut self,
6356        value: impl Into<S>,
6357    ) -> LogCreateJoinLinkBuilder<log_create_join_link_state::SetConvoId<St>, S> {
6358        self._fields.0 = Option::Some(value.into());
6359        LogCreateJoinLinkBuilder {
6360            _state: PhantomData,
6361            _fields: self._fields,
6362            _type: PhantomData,
6363        }
6364    }
6365}
6366
6367impl<St, S: BosStr> LogCreateJoinLinkBuilder<St, S>
6368where
6369    St: log_create_join_link_state::State,
6370    St::Message: log_create_join_link_state::IsUnset,
6371{
6372    /// Set the `message` field (required)
6373    pub fn message(
6374        mut self,
6375        value: impl Into<convo::SystemMessageView<S>>,
6376    ) -> LogCreateJoinLinkBuilder<log_create_join_link_state::SetMessage<St>, S> {
6377        self._fields.1 = Option::Some(value.into());
6378        LogCreateJoinLinkBuilder {
6379            _state: PhantomData,
6380            _fields: self._fields,
6381            _type: PhantomData,
6382        }
6383    }
6384}
6385
6386impl<St, S: BosStr> LogCreateJoinLinkBuilder<St, S>
6387where
6388    St: log_create_join_link_state::State,
6389    St::Rev: log_create_join_link_state::IsUnset,
6390{
6391    /// Set the `rev` field (required)
6392    pub fn rev(
6393        mut self,
6394        value: impl Into<S>,
6395    ) -> LogCreateJoinLinkBuilder<log_create_join_link_state::SetRev<St>, S> {
6396        self._fields.2 = Option::Some(value.into());
6397        LogCreateJoinLinkBuilder {
6398            _state: PhantomData,
6399            _fields: self._fields,
6400            _type: PhantomData,
6401        }
6402    }
6403}
6404
6405impl<St, S: BosStr> LogCreateJoinLinkBuilder<St, S>
6406where
6407    St: log_create_join_link_state::State,
6408    St::ConvoId: log_create_join_link_state::IsSet,
6409    St::Message: log_create_join_link_state::IsSet,
6410    St::Rev: log_create_join_link_state::IsSet,
6411{
6412    /// Build the final struct.
6413    pub fn build(self) -> LogCreateJoinLink<S> {
6414        LogCreateJoinLink {
6415            convo_id: self._fields.0.unwrap(),
6416            message: self._fields.1.unwrap(),
6417            rev: self._fields.2.unwrap(),
6418            extra_data: Default::default(),
6419        }
6420    }
6421    /// Build the final struct with custom extra_data.
6422    pub fn build_with_data(self, extra_data: BTreeMap<SmolStr, Data<S>>) -> LogCreateJoinLink<S> {
6423        LogCreateJoinLink {
6424            convo_id: self._fields.0.unwrap(),
6425            message: self._fields.1.unwrap(),
6426            rev: self._fields.2.unwrap(),
6427            extra_data: Some(extra_data),
6428        }
6429    }
6430}
6431
6432pub mod log_create_message_state {
6433
6434    pub use crate::builder_types::{IsSet, IsUnset, Set, Unset};
6435    #[allow(unused)]
6436    use ::core::marker::PhantomData;
6437    mod sealed {
6438        pub trait Sealed {}
6439    }
6440    /// State trait tracking which required fields have been set
6441    pub trait State: sealed::Sealed {
6442        type ConvoId;
6443        type Message;
6444        type Rev;
6445    }
6446    /// Empty state - all required fields are unset
6447    pub struct Empty(());
6448    impl sealed::Sealed for Empty {}
6449    impl State for Empty {
6450        type ConvoId = Unset;
6451        type Message = Unset;
6452        type Rev = Unset;
6453    }
6454    ///State transition - sets the `convo_id` field to Set
6455    pub struct SetConvoId<St: State = Empty>(PhantomData<fn() -> St>);
6456    impl<St: State> sealed::Sealed for SetConvoId<St> {}
6457    impl<St: State> State for SetConvoId<St> {
6458        type ConvoId = Set<members::convo_id>;
6459        type Message = St::Message;
6460        type Rev = St::Rev;
6461    }
6462    ///State transition - sets the `message` field to Set
6463    pub struct SetMessage<St: State = Empty>(PhantomData<fn() -> St>);
6464    impl<St: State> sealed::Sealed for SetMessage<St> {}
6465    impl<St: State> State for SetMessage<St> {
6466        type ConvoId = St::ConvoId;
6467        type Message = Set<members::message>;
6468        type Rev = St::Rev;
6469    }
6470    ///State transition - sets the `rev` field to Set
6471    pub struct SetRev<St: State = Empty>(PhantomData<fn() -> St>);
6472    impl<St: State> sealed::Sealed for SetRev<St> {}
6473    impl<St: State> State for SetRev<St> {
6474        type ConvoId = St::ConvoId;
6475        type Message = St::Message;
6476        type Rev = Set<members::rev>;
6477    }
6478    /// Marker types for field names
6479    #[allow(non_camel_case_types)]
6480    pub mod members {
6481        ///Marker type for the `convo_id` field
6482        pub struct convo_id(());
6483        ///Marker type for the `message` field
6484        pub struct message(());
6485        ///Marker type for the `rev` field
6486        pub struct rev(());
6487    }
6488}
6489
6490/// Builder for constructing an instance of this type.
6491pub struct LogCreateMessageBuilder<St: log_create_message_state::State, S: BosStr = DefaultStr> {
6492    _state: PhantomData<fn() -> St>,
6493    _fields: (
6494        Option<S>,
6495        Option<LogCreateMessageMessage<S>>,
6496        Option<Vec<ProfileViewBasic<S>>>,
6497        Option<S>,
6498    ),
6499    _type: PhantomData<fn() -> S>,
6500}
6501
6502impl LogCreateMessage<DefaultStr> {
6503    /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed
6504    pub fn new() -> LogCreateMessageBuilder<log_create_message_state::Empty, DefaultStr> {
6505        LogCreateMessageBuilder::new()
6506    }
6507}
6508
6509impl<S: BosStr> LogCreateMessage<S> {
6510    /// Create a new builder for this type
6511    pub fn builder() -> LogCreateMessageBuilder<log_create_message_state::Empty, S> {
6512        LogCreateMessageBuilder::builder()
6513    }
6514}
6515
6516impl LogCreateMessageBuilder<log_create_message_state::Empty, DefaultStr> {
6517    /// Create a new builder with all fields unset, using the default string type, if needed
6518    pub fn new() -> Self {
6519        LogCreateMessageBuilder {
6520            _state: PhantomData,
6521            _fields: (None, None, None, None),
6522            _type: PhantomData,
6523        }
6524    }
6525}
6526
6527impl<S: BosStr> LogCreateMessageBuilder<log_create_message_state::Empty, S> {
6528    /// Create a new builder with all fields unset
6529    pub fn builder() -> Self {
6530        LogCreateMessageBuilder {
6531            _state: PhantomData,
6532            _fields: (None, None, None, None),
6533            _type: PhantomData,
6534        }
6535    }
6536}
6537
6538impl<St, S: BosStr> LogCreateMessageBuilder<St, S>
6539where
6540    St: log_create_message_state::State,
6541    St::ConvoId: log_create_message_state::IsUnset,
6542{
6543    /// Set the `convoId` field (required)
6544    pub fn convo_id(
6545        mut self,
6546        value: impl Into<S>,
6547    ) -> LogCreateMessageBuilder<log_create_message_state::SetConvoId<St>, S> {
6548        self._fields.0 = Option::Some(value.into());
6549        LogCreateMessageBuilder {
6550            _state: PhantomData,
6551            _fields: self._fields,
6552            _type: PhantomData,
6553        }
6554    }
6555}
6556
6557impl<St, S: BosStr> LogCreateMessageBuilder<St, S>
6558where
6559    St: log_create_message_state::State,
6560    St::Message: log_create_message_state::IsUnset,
6561{
6562    /// Set the `message` field (required)
6563    pub fn message(
6564        mut self,
6565        value: impl Into<LogCreateMessageMessage<S>>,
6566    ) -> LogCreateMessageBuilder<log_create_message_state::SetMessage<St>, S> {
6567        self._fields.1 = Option::Some(value.into());
6568        LogCreateMessageBuilder {
6569            _state: PhantomData,
6570            _fields: self._fields,
6571            _type: PhantomData,
6572        }
6573    }
6574}
6575
6576impl<St: log_create_message_state::State, S: BosStr> LogCreateMessageBuilder<St, S> {
6577    /// Set the `relatedProfiles` field (optional)
6578    pub fn related_profiles(mut self, value: impl Into<Option<Vec<ProfileViewBasic<S>>>>) -> Self {
6579        self._fields.2 = value.into();
6580        self
6581    }
6582    /// Set the `relatedProfiles` field to an Option value (optional)
6583    pub fn maybe_related_profiles(mut self, value: Option<Vec<ProfileViewBasic<S>>>) -> Self {
6584        self._fields.2 = value;
6585        self
6586    }
6587}
6588
6589impl<St, S: BosStr> LogCreateMessageBuilder<St, S>
6590where
6591    St: log_create_message_state::State,
6592    St::Rev: log_create_message_state::IsUnset,
6593{
6594    /// Set the `rev` field (required)
6595    pub fn rev(
6596        mut self,
6597        value: impl Into<S>,
6598    ) -> LogCreateMessageBuilder<log_create_message_state::SetRev<St>, S> {
6599        self._fields.3 = Option::Some(value.into());
6600        LogCreateMessageBuilder {
6601            _state: PhantomData,
6602            _fields: self._fields,
6603            _type: PhantomData,
6604        }
6605    }
6606}
6607
6608impl<St, S: BosStr> LogCreateMessageBuilder<St, S>
6609where
6610    St: log_create_message_state::State,
6611    St::ConvoId: log_create_message_state::IsSet,
6612    St::Message: log_create_message_state::IsSet,
6613    St::Rev: log_create_message_state::IsSet,
6614{
6615    /// Build the final struct.
6616    pub fn build(self) -> LogCreateMessage<S> {
6617        LogCreateMessage {
6618            convo_id: self._fields.0.unwrap(),
6619            message: self._fields.1.unwrap(),
6620            related_profiles: self._fields.2,
6621            rev: self._fields.3.unwrap(),
6622            extra_data: Default::default(),
6623        }
6624    }
6625    /// Build the final struct with custom extra_data.
6626    pub fn build_with_data(self, extra_data: BTreeMap<SmolStr, Data<S>>) -> LogCreateMessage<S> {
6627        LogCreateMessage {
6628            convo_id: self._fields.0.unwrap(),
6629            message: self._fields.1.unwrap(),
6630            related_profiles: self._fields.2,
6631            rev: self._fields.3.unwrap(),
6632            extra_data: Some(extra_data),
6633        }
6634    }
6635}
6636
6637pub mod log_delete_message_state {
6638
6639    pub use crate::builder_types::{IsSet, IsUnset, Set, Unset};
6640    #[allow(unused)]
6641    use ::core::marker::PhantomData;
6642    mod sealed {
6643        pub trait Sealed {}
6644    }
6645    /// State trait tracking which required fields have been set
6646    pub trait State: sealed::Sealed {
6647        type ConvoId;
6648        type Message;
6649        type Rev;
6650    }
6651    /// Empty state - all required fields are unset
6652    pub struct Empty(());
6653    impl sealed::Sealed for Empty {}
6654    impl State for Empty {
6655        type ConvoId = Unset;
6656        type Message = Unset;
6657        type Rev = Unset;
6658    }
6659    ///State transition - sets the `convo_id` field to Set
6660    pub struct SetConvoId<St: State = Empty>(PhantomData<fn() -> St>);
6661    impl<St: State> sealed::Sealed for SetConvoId<St> {}
6662    impl<St: State> State for SetConvoId<St> {
6663        type ConvoId = Set<members::convo_id>;
6664        type Message = St::Message;
6665        type Rev = St::Rev;
6666    }
6667    ///State transition - sets the `message` field to Set
6668    pub struct SetMessage<St: State = Empty>(PhantomData<fn() -> St>);
6669    impl<St: State> sealed::Sealed for SetMessage<St> {}
6670    impl<St: State> State for SetMessage<St> {
6671        type ConvoId = St::ConvoId;
6672        type Message = Set<members::message>;
6673        type Rev = St::Rev;
6674    }
6675    ///State transition - sets the `rev` field to Set
6676    pub struct SetRev<St: State = Empty>(PhantomData<fn() -> St>);
6677    impl<St: State> sealed::Sealed for SetRev<St> {}
6678    impl<St: State> State for SetRev<St> {
6679        type ConvoId = St::ConvoId;
6680        type Message = St::Message;
6681        type Rev = Set<members::rev>;
6682    }
6683    /// Marker types for field names
6684    #[allow(non_camel_case_types)]
6685    pub mod members {
6686        ///Marker type for the `convo_id` field
6687        pub struct convo_id(());
6688        ///Marker type for the `message` field
6689        pub struct message(());
6690        ///Marker type for the `rev` field
6691        pub struct rev(());
6692    }
6693}
6694
6695/// Builder for constructing an instance of this type.
6696pub struct LogDeleteMessageBuilder<St: log_delete_message_state::State, S: BosStr = DefaultStr> {
6697    _state: PhantomData<fn() -> St>,
6698    _fields: (Option<S>, Option<LogDeleteMessageMessage<S>>, Option<S>),
6699    _type: PhantomData<fn() -> S>,
6700}
6701
6702impl LogDeleteMessage<DefaultStr> {
6703    /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed
6704    pub fn new() -> LogDeleteMessageBuilder<log_delete_message_state::Empty, DefaultStr> {
6705        LogDeleteMessageBuilder::new()
6706    }
6707}
6708
6709impl<S: BosStr> LogDeleteMessage<S> {
6710    /// Create a new builder for this type
6711    pub fn builder() -> LogDeleteMessageBuilder<log_delete_message_state::Empty, S> {
6712        LogDeleteMessageBuilder::builder()
6713    }
6714}
6715
6716impl LogDeleteMessageBuilder<log_delete_message_state::Empty, DefaultStr> {
6717    /// Create a new builder with all fields unset, using the default string type, if needed
6718    pub fn new() -> Self {
6719        LogDeleteMessageBuilder {
6720            _state: PhantomData,
6721            _fields: (None, None, None),
6722            _type: PhantomData,
6723        }
6724    }
6725}
6726
6727impl<S: BosStr> LogDeleteMessageBuilder<log_delete_message_state::Empty, S> {
6728    /// Create a new builder with all fields unset
6729    pub fn builder() -> Self {
6730        LogDeleteMessageBuilder {
6731            _state: PhantomData,
6732            _fields: (None, None, None),
6733            _type: PhantomData,
6734        }
6735    }
6736}
6737
6738impl<St, S: BosStr> LogDeleteMessageBuilder<St, S>
6739where
6740    St: log_delete_message_state::State,
6741    St::ConvoId: log_delete_message_state::IsUnset,
6742{
6743    /// Set the `convoId` field (required)
6744    pub fn convo_id(
6745        mut self,
6746        value: impl Into<S>,
6747    ) -> LogDeleteMessageBuilder<log_delete_message_state::SetConvoId<St>, S> {
6748        self._fields.0 = Option::Some(value.into());
6749        LogDeleteMessageBuilder {
6750            _state: PhantomData,
6751            _fields: self._fields,
6752            _type: PhantomData,
6753        }
6754    }
6755}
6756
6757impl<St, S: BosStr> LogDeleteMessageBuilder<St, S>
6758where
6759    St: log_delete_message_state::State,
6760    St::Message: log_delete_message_state::IsUnset,
6761{
6762    /// Set the `message` field (required)
6763    pub fn message(
6764        mut self,
6765        value: impl Into<LogDeleteMessageMessage<S>>,
6766    ) -> LogDeleteMessageBuilder<log_delete_message_state::SetMessage<St>, S> {
6767        self._fields.1 = Option::Some(value.into());
6768        LogDeleteMessageBuilder {
6769            _state: PhantomData,
6770            _fields: self._fields,
6771            _type: PhantomData,
6772        }
6773    }
6774}
6775
6776impl<St, S: BosStr> LogDeleteMessageBuilder<St, S>
6777where
6778    St: log_delete_message_state::State,
6779    St::Rev: log_delete_message_state::IsUnset,
6780{
6781    /// Set the `rev` field (required)
6782    pub fn rev(
6783        mut self,
6784        value: impl Into<S>,
6785    ) -> LogDeleteMessageBuilder<log_delete_message_state::SetRev<St>, S> {
6786        self._fields.2 = Option::Some(value.into());
6787        LogDeleteMessageBuilder {
6788            _state: PhantomData,
6789            _fields: self._fields,
6790            _type: PhantomData,
6791        }
6792    }
6793}
6794
6795impl<St, S: BosStr> LogDeleteMessageBuilder<St, S>
6796where
6797    St: log_delete_message_state::State,
6798    St::ConvoId: log_delete_message_state::IsSet,
6799    St::Message: log_delete_message_state::IsSet,
6800    St::Rev: log_delete_message_state::IsSet,
6801{
6802    /// Build the final struct.
6803    pub fn build(self) -> LogDeleteMessage<S> {
6804        LogDeleteMessage {
6805            convo_id: self._fields.0.unwrap(),
6806            message: self._fields.1.unwrap(),
6807            rev: self._fields.2.unwrap(),
6808            extra_data: Default::default(),
6809        }
6810    }
6811    /// Build the final struct with custom extra_data.
6812    pub fn build_with_data(self, extra_data: BTreeMap<SmolStr, Data<S>>) -> LogDeleteMessage<S> {
6813        LogDeleteMessage {
6814            convo_id: self._fields.0.unwrap(),
6815            message: self._fields.1.unwrap(),
6816            rev: self._fields.2.unwrap(),
6817            extra_data: Some(extra_data),
6818        }
6819    }
6820}
6821
6822pub mod log_disable_join_link_state {
6823
6824    pub use crate::builder_types::{IsSet, IsUnset, Set, Unset};
6825    #[allow(unused)]
6826    use ::core::marker::PhantomData;
6827    mod sealed {
6828        pub trait Sealed {}
6829    }
6830    /// State trait tracking which required fields have been set
6831    pub trait State: sealed::Sealed {
6832        type ConvoId;
6833        type Message;
6834        type Rev;
6835    }
6836    /// Empty state - all required fields are unset
6837    pub struct Empty(());
6838    impl sealed::Sealed for Empty {}
6839    impl State for Empty {
6840        type ConvoId = Unset;
6841        type Message = Unset;
6842        type Rev = Unset;
6843    }
6844    ///State transition - sets the `convo_id` field to Set
6845    pub struct SetConvoId<St: State = Empty>(PhantomData<fn() -> St>);
6846    impl<St: State> sealed::Sealed for SetConvoId<St> {}
6847    impl<St: State> State for SetConvoId<St> {
6848        type ConvoId = Set<members::convo_id>;
6849        type Message = St::Message;
6850        type Rev = St::Rev;
6851    }
6852    ///State transition - sets the `message` field to Set
6853    pub struct SetMessage<St: State = Empty>(PhantomData<fn() -> St>);
6854    impl<St: State> sealed::Sealed for SetMessage<St> {}
6855    impl<St: State> State for SetMessage<St> {
6856        type ConvoId = St::ConvoId;
6857        type Message = Set<members::message>;
6858        type Rev = St::Rev;
6859    }
6860    ///State transition - sets the `rev` field to Set
6861    pub struct SetRev<St: State = Empty>(PhantomData<fn() -> St>);
6862    impl<St: State> sealed::Sealed for SetRev<St> {}
6863    impl<St: State> State for SetRev<St> {
6864        type ConvoId = St::ConvoId;
6865        type Message = St::Message;
6866        type Rev = Set<members::rev>;
6867    }
6868    /// Marker types for field names
6869    #[allow(non_camel_case_types)]
6870    pub mod members {
6871        ///Marker type for the `convo_id` field
6872        pub struct convo_id(());
6873        ///Marker type for the `message` field
6874        pub struct message(());
6875        ///Marker type for the `rev` field
6876        pub struct rev(());
6877    }
6878}
6879
6880/// Builder for constructing an instance of this type.
6881pub struct LogDisableJoinLinkBuilder<St: log_disable_join_link_state::State, S: BosStr = DefaultStr>
6882{
6883    _state: PhantomData<fn() -> St>,
6884    _fields: (Option<S>, Option<convo::SystemMessageView<S>>, Option<S>),
6885    _type: PhantomData<fn() -> S>,
6886}
6887
6888impl LogDisableJoinLink<DefaultStr> {
6889    /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed
6890    pub fn new() -> LogDisableJoinLinkBuilder<log_disable_join_link_state::Empty, DefaultStr> {
6891        LogDisableJoinLinkBuilder::new()
6892    }
6893}
6894
6895impl<S: BosStr> LogDisableJoinLink<S> {
6896    /// Create a new builder for this type
6897    pub fn builder() -> LogDisableJoinLinkBuilder<log_disable_join_link_state::Empty, S> {
6898        LogDisableJoinLinkBuilder::builder()
6899    }
6900}
6901
6902impl LogDisableJoinLinkBuilder<log_disable_join_link_state::Empty, DefaultStr> {
6903    /// Create a new builder with all fields unset, using the default string type, if needed
6904    pub fn new() -> Self {
6905        LogDisableJoinLinkBuilder {
6906            _state: PhantomData,
6907            _fields: (None, None, None),
6908            _type: PhantomData,
6909        }
6910    }
6911}
6912
6913impl<S: BosStr> LogDisableJoinLinkBuilder<log_disable_join_link_state::Empty, S> {
6914    /// Create a new builder with all fields unset
6915    pub fn builder() -> Self {
6916        LogDisableJoinLinkBuilder {
6917            _state: PhantomData,
6918            _fields: (None, None, None),
6919            _type: PhantomData,
6920        }
6921    }
6922}
6923
6924impl<St, S: BosStr> LogDisableJoinLinkBuilder<St, S>
6925where
6926    St: log_disable_join_link_state::State,
6927    St::ConvoId: log_disable_join_link_state::IsUnset,
6928{
6929    /// Set the `convoId` field (required)
6930    pub fn convo_id(
6931        mut self,
6932        value: impl Into<S>,
6933    ) -> LogDisableJoinLinkBuilder<log_disable_join_link_state::SetConvoId<St>, S> {
6934        self._fields.0 = Option::Some(value.into());
6935        LogDisableJoinLinkBuilder {
6936            _state: PhantomData,
6937            _fields: self._fields,
6938            _type: PhantomData,
6939        }
6940    }
6941}
6942
6943impl<St, S: BosStr> LogDisableJoinLinkBuilder<St, S>
6944where
6945    St: log_disable_join_link_state::State,
6946    St::Message: log_disable_join_link_state::IsUnset,
6947{
6948    /// Set the `message` field (required)
6949    pub fn message(
6950        mut self,
6951        value: impl Into<convo::SystemMessageView<S>>,
6952    ) -> LogDisableJoinLinkBuilder<log_disable_join_link_state::SetMessage<St>, S> {
6953        self._fields.1 = Option::Some(value.into());
6954        LogDisableJoinLinkBuilder {
6955            _state: PhantomData,
6956            _fields: self._fields,
6957            _type: PhantomData,
6958        }
6959    }
6960}
6961
6962impl<St, S: BosStr> LogDisableJoinLinkBuilder<St, S>
6963where
6964    St: log_disable_join_link_state::State,
6965    St::Rev: log_disable_join_link_state::IsUnset,
6966{
6967    /// Set the `rev` field (required)
6968    pub fn rev(
6969        mut self,
6970        value: impl Into<S>,
6971    ) -> LogDisableJoinLinkBuilder<log_disable_join_link_state::SetRev<St>, S> {
6972        self._fields.2 = Option::Some(value.into());
6973        LogDisableJoinLinkBuilder {
6974            _state: PhantomData,
6975            _fields: self._fields,
6976            _type: PhantomData,
6977        }
6978    }
6979}
6980
6981impl<St, S: BosStr> LogDisableJoinLinkBuilder<St, S>
6982where
6983    St: log_disable_join_link_state::State,
6984    St::ConvoId: log_disable_join_link_state::IsSet,
6985    St::Message: log_disable_join_link_state::IsSet,
6986    St::Rev: log_disable_join_link_state::IsSet,
6987{
6988    /// Build the final struct.
6989    pub fn build(self) -> LogDisableJoinLink<S> {
6990        LogDisableJoinLink {
6991            convo_id: self._fields.0.unwrap(),
6992            message: self._fields.1.unwrap(),
6993            rev: self._fields.2.unwrap(),
6994            extra_data: Default::default(),
6995        }
6996    }
6997    /// Build the final struct with custom extra_data.
6998    pub fn build_with_data(self, extra_data: BTreeMap<SmolStr, Data<S>>) -> LogDisableJoinLink<S> {
6999        LogDisableJoinLink {
7000            convo_id: self._fields.0.unwrap(),
7001            message: self._fields.1.unwrap(),
7002            rev: self._fields.2.unwrap(),
7003            extra_data: Some(extra_data),
7004        }
7005    }
7006}
7007
7008pub mod log_edit_group_state {
7009
7010    pub use crate::builder_types::{IsSet, IsUnset, Set, Unset};
7011    #[allow(unused)]
7012    use ::core::marker::PhantomData;
7013    mod sealed {
7014        pub trait Sealed {}
7015    }
7016    /// State trait tracking which required fields have been set
7017    pub trait State: sealed::Sealed {
7018        type ConvoId;
7019        type Message;
7020        type Rev;
7021    }
7022    /// Empty state - all required fields are unset
7023    pub struct Empty(());
7024    impl sealed::Sealed for Empty {}
7025    impl State for Empty {
7026        type ConvoId = Unset;
7027        type Message = Unset;
7028        type Rev = Unset;
7029    }
7030    ///State transition - sets the `convo_id` field to Set
7031    pub struct SetConvoId<St: State = Empty>(PhantomData<fn() -> St>);
7032    impl<St: State> sealed::Sealed for SetConvoId<St> {}
7033    impl<St: State> State for SetConvoId<St> {
7034        type ConvoId = Set<members::convo_id>;
7035        type Message = St::Message;
7036        type Rev = St::Rev;
7037    }
7038    ///State transition - sets the `message` field to Set
7039    pub struct SetMessage<St: State = Empty>(PhantomData<fn() -> St>);
7040    impl<St: State> sealed::Sealed for SetMessage<St> {}
7041    impl<St: State> State for SetMessage<St> {
7042        type ConvoId = St::ConvoId;
7043        type Message = Set<members::message>;
7044        type Rev = St::Rev;
7045    }
7046    ///State transition - sets the `rev` field to Set
7047    pub struct SetRev<St: State = Empty>(PhantomData<fn() -> St>);
7048    impl<St: State> sealed::Sealed for SetRev<St> {}
7049    impl<St: State> State for SetRev<St> {
7050        type ConvoId = St::ConvoId;
7051        type Message = St::Message;
7052        type Rev = Set<members::rev>;
7053    }
7054    /// Marker types for field names
7055    #[allow(non_camel_case_types)]
7056    pub mod members {
7057        ///Marker type for the `convo_id` field
7058        pub struct convo_id(());
7059        ///Marker type for the `message` field
7060        pub struct message(());
7061        ///Marker type for the `rev` field
7062        pub struct rev(());
7063    }
7064}
7065
7066/// Builder for constructing an instance of this type.
7067pub struct LogEditGroupBuilder<St: log_edit_group_state::State, S: BosStr = DefaultStr> {
7068    _state: PhantomData<fn() -> St>,
7069    _fields: (Option<S>, Option<convo::SystemMessageView<S>>, Option<S>),
7070    _type: PhantomData<fn() -> S>,
7071}
7072
7073impl LogEditGroup<DefaultStr> {
7074    /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed
7075    pub fn new() -> LogEditGroupBuilder<log_edit_group_state::Empty, DefaultStr> {
7076        LogEditGroupBuilder::new()
7077    }
7078}
7079
7080impl<S: BosStr> LogEditGroup<S> {
7081    /// Create a new builder for this type
7082    pub fn builder() -> LogEditGroupBuilder<log_edit_group_state::Empty, S> {
7083        LogEditGroupBuilder::builder()
7084    }
7085}
7086
7087impl LogEditGroupBuilder<log_edit_group_state::Empty, DefaultStr> {
7088    /// Create a new builder with all fields unset, using the default string type, if needed
7089    pub fn new() -> Self {
7090        LogEditGroupBuilder {
7091            _state: PhantomData,
7092            _fields: (None, None, None),
7093            _type: PhantomData,
7094        }
7095    }
7096}
7097
7098impl<S: BosStr> LogEditGroupBuilder<log_edit_group_state::Empty, S> {
7099    /// Create a new builder with all fields unset
7100    pub fn builder() -> Self {
7101        LogEditGroupBuilder {
7102            _state: PhantomData,
7103            _fields: (None, None, None),
7104            _type: PhantomData,
7105        }
7106    }
7107}
7108
7109impl<St, S: BosStr> LogEditGroupBuilder<St, S>
7110where
7111    St: log_edit_group_state::State,
7112    St::ConvoId: log_edit_group_state::IsUnset,
7113{
7114    /// Set the `convoId` field (required)
7115    pub fn convo_id(
7116        mut self,
7117        value: impl Into<S>,
7118    ) -> LogEditGroupBuilder<log_edit_group_state::SetConvoId<St>, S> {
7119        self._fields.0 = Option::Some(value.into());
7120        LogEditGroupBuilder {
7121            _state: PhantomData,
7122            _fields: self._fields,
7123            _type: PhantomData,
7124        }
7125    }
7126}
7127
7128impl<St, S: BosStr> LogEditGroupBuilder<St, S>
7129where
7130    St: log_edit_group_state::State,
7131    St::Message: log_edit_group_state::IsUnset,
7132{
7133    /// Set the `message` field (required)
7134    pub fn message(
7135        mut self,
7136        value: impl Into<convo::SystemMessageView<S>>,
7137    ) -> LogEditGroupBuilder<log_edit_group_state::SetMessage<St>, S> {
7138        self._fields.1 = Option::Some(value.into());
7139        LogEditGroupBuilder {
7140            _state: PhantomData,
7141            _fields: self._fields,
7142            _type: PhantomData,
7143        }
7144    }
7145}
7146
7147impl<St, S: BosStr> LogEditGroupBuilder<St, S>
7148where
7149    St: log_edit_group_state::State,
7150    St::Rev: log_edit_group_state::IsUnset,
7151{
7152    /// Set the `rev` field (required)
7153    pub fn rev(
7154        mut self,
7155        value: impl Into<S>,
7156    ) -> LogEditGroupBuilder<log_edit_group_state::SetRev<St>, S> {
7157        self._fields.2 = Option::Some(value.into());
7158        LogEditGroupBuilder {
7159            _state: PhantomData,
7160            _fields: self._fields,
7161            _type: PhantomData,
7162        }
7163    }
7164}
7165
7166impl<St, S: BosStr> LogEditGroupBuilder<St, S>
7167where
7168    St: log_edit_group_state::State,
7169    St::ConvoId: log_edit_group_state::IsSet,
7170    St::Message: log_edit_group_state::IsSet,
7171    St::Rev: log_edit_group_state::IsSet,
7172{
7173    /// Build the final struct.
7174    pub fn build(self) -> LogEditGroup<S> {
7175        LogEditGroup {
7176            convo_id: self._fields.0.unwrap(),
7177            message: self._fields.1.unwrap(),
7178            rev: self._fields.2.unwrap(),
7179            extra_data: Default::default(),
7180        }
7181    }
7182    /// Build the final struct with custom extra_data.
7183    pub fn build_with_data(self, extra_data: BTreeMap<SmolStr, Data<S>>) -> LogEditGroup<S> {
7184        LogEditGroup {
7185            convo_id: self._fields.0.unwrap(),
7186            message: self._fields.1.unwrap(),
7187            rev: self._fields.2.unwrap(),
7188            extra_data: Some(extra_data),
7189        }
7190    }
7191}
7192
7193pub mod log_edit_join_link_state {
7194
7195    pub use crate::builder_types::{IsSet, IsUnset, Set, Unset};
7196    #[allow(unused)]
7197    use ::core::marker::PhantomData;
7198    mod sealed {
7199        pub trait Sealed {}
7200    }
7201    /// State trait tracking which required fields have been set
7202    pub trait State: sealed::Sealed {
7203        type ConvoId;
7204        type Message;
7205        type Rev;
7206    }
7207    /// Empty state - all required fields are unset
7208    pub struct Empty(());
7209    impl sealed::Sealed for Empty {}
7210    impl State for Empty {
7211        type ConvoId = Unset;
7212        type Message = Unset;
7213        type Rev = Unset;
7214    }
7215    ///State transition - sets the `convo_id` field to Set
7216    pub struct SetConvoId<St: State = Empty>(PhantomData<fn() -> St>);
7217    impl<St: State> sealed::Sealed for SetConvoId<St> {}
7218    impl<St: State> State for SetConvoId<St> {
7219        type ConvoId = Set<members::convo_id>;
7220        type Message = St::Message;
7221        type Rev = St::Rev;
7222    }
7223    ///State transition - sets the `message` field to Set
7224    pub struct SetMessage<St: State = Empty>(PhantomData<fn() -> St>);
7225    impl<St: State> sealed::Sealed for SetMessage<St> {}
7226    impl<St: State> State for SetMessage<St> {
7227        type ConvoId = St::ConvoId;
7228        type Message = Set<members::message>;
7229        type Rev = St::Rev;
7230    }
7231    ///State transition - sets the `rev` field to Set
7232    pub struct SetRev<St: State = Empty>(PhantomData<fn() -> St>);
7233    impl<St: State> sealed::Sealed for SetRev<St> {}
7234    impl<St: State> State for SetRev<St> {
7235        type ConvoId = St::ConvoId;
7236        type Message = St::Message;
7237        type Rev = Set<members::rev>;
7238    }
7239    /// Marker types for field names
7240    #[allow(non_camel_case_types)]
7241    pub mod members {
7242        ///Marker type for the `convo_id` field
7243        pub struct convo_id(());
7244        ///Marker type for the `message` field
7245        pub struct message(());
7246        ///Marker type for the `rev` field
7247        pub struct rev(());
7248    }
7249}
7250
7251/// Builder for constructing an instance of this type.
7252pub struct LogEditJoinLinkBuilder<St: log_edit_join_link_state::State, S: BosStr = DefaultStr> {
7253    _state: PhantomData<fn() -> St>,
7254    _fields: (Option<S>, Option<convo::SystemMessageView<S>>, Option<S>),
7255    _type: PhantomData<fn() -> S>,
7256}
7257
7258impl LogEditJoinLink<DefaultStr> {
7259    /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed
7260    pub fn new() -> LogEditJoinLinkBuilder<log_edit_join_link_state::Empty, DefaultStr> {
7261        LogEditJoinLinkBuilder::new()
7262    }
7263}
7264
7265impl<S: BosStr> LogEditJoinLink<S> {
7266    /// Create a new builder for this type
7267    pub fn builder() -> LogEditJoinLinkBuilder<log_edit_join_link_state::Empty, S> {
7268        LogEditJoinLinkBuilder::builder()
7269    }
7270}
7271
7272impl LogEditJoinLinkBuilder<log_edit_join_link_state::Empty, DefaultStr> {
7273    /// Create a new builder with all fields unset, using the default string type, if needed
7274    pub fn new() -> Self {
7275        LogEditJoinLinkBuilder {
7276            _state: PhantomData,
7277            _fields: (None, None, None),
7278            _type: PhantomData,
7279        }
7280    }
7281}
7282
7283impl<S: BosStr> LogEditJoinLinkBuilder<log_edit_join_link_state::Empty, S> {
7284    /// Create a new builder with all fields unset
7285    pub fn builder() -> Self {
7286        LogEditJoinLinkBuilder {
7287            _state: PhantomData,
7288            _fields: (None, None, None),
7289            _type: PhantomData,
7290        }
7291    }
7292}
7293
7294impl<St, S: BosStr> LogEditJoinLinkBuilder<St, S>
7295where
7296    St: log_edit_join_link_state::State,
7297    St::ConvoId: log_edit_join_link_state::IsUnset,
7298{
7299    /// Set the `convoId` field (required)
7300    pub fn convo_id(
7301        mut self,
7302        value: impl Into<S>,
7303    ) -> LogEditJoinLinkBuilder<log_edit_join_link_state::SetConvoId<St>, S> {
7304        self._fields.0 = Option::Some(value.into());
7305        LogEditJoinLinkBuilder {
7306            _state: PhantomData,
7307            _fields: self._fields,
7308            _type: PhantomData,
7309        }
7310    }
7311}
7312
7313impl<St, S: BosStr> LogEditJoinLinkBuilder<St, S>
7314where
7315    St: log_edit_join_link_state::State,
7316    St::Message: log_edit_join_link_state::IsUnset,
7317{
7318    /// Set the `message` field (required)
7319    pub fn message(
7320        mut self,
7321        value: impl Into<convo::SystemMessageView<S>>,
7322    ) -> LogEditJoinLinkBuilder<log_edit_join_link_state::SetMessage<St>, S> {
7323        self._fields.1 = Option::Some(value.into());
7324        LogEditJoinLinkBuilder {
7325            _state: PhantomData,
7326            _fields: self._fields,
7327            _type: PhantomData,
7328        }
7329    }
7330}
7331
7332impl<St, S: BosStr> LogEditJoinLinkBuilder<St, S>
7333where
7334    St: log_edit_join_link_state::State,
7335    St::Rev: log_edit_join_link_state::IsUnset,
7336{
7337    /// Set the `rev` field (required)
7338    pub fn rev(
7339        mut self,
7340        value: impl Into<S>,
7341    ) -> LogEditJoinLinkBuilder<log_edit_join_link_state::SetRev<St>, S> {
7342        self._fields.2 = Option::Some(value.into());
7343        LogEditJoinLinkBuilder {
7344            _state: PhantomData,
7345            _fields: self._fields,
7346            _type: PhantomData,
7347        }
7348    }
7349}
7350
7351impl<St, S: BosStr> LogEditJoinLinkBuilder<St, S>
7352where
7353    St: log_edit_join_link_state::State,
7354    St::ConvoId: log_edit_join_link_state::IsSet,
7355    St::Message: log_edit_join_link_state::IsSet,
7356    St::Rev: log_edit_join_link_state::IsSet,
7357{
7358    /// Build the final struct.
7359    pub fn build(self) -> LogEditJoinLink<S> {
7360        LogEditJoinLink {
7361            convo_id: self._fields.0.unwrap(),
7362            message: self._fields.1.unwrap(),
7363            rev: self._fields.2.unwrap(),
7364            extra_data: Default::default(),
7365        }
7366    }
7367    /// Build the final struct with custom extra_data.
7368    pub fn build_with_data(self, extra_data: BTreeMap<SmolStr, Data<S>>) -> LogEditJoinLink<S> {
7369        LogEditJoinLink {
7370            convo_id: self._fields.0.unwrap(),
7371            message: self._fields.1.unwrap(),
7372            rev: self._fields.2.unwrap(),
7373            extra_data: Some(extra_data),
7374        }
7375    }
7376}
7377
7378pub mod log_enable_join_link_state {
7379
7380    pub use crate::builder_types::{IsSet, IsUnset, Set, Unset};
7381    #[allow(unused)]
7382    use ::core::marker::PhantomData;
7383    mod sealed {
7384        pub trait Sealed {}
7385    }
7386    /// State trait tracking which required fields have been set
7387    pub trait State: sealed::Sealed {
7388        type ConvoId;
7389        type Message;
7390        type Rev;
7391    }
7392    /// Empty state - all required fields are unset
7393    pub struct Empty(());
7394    impl sealed::Sealed for Empty {}
7395    impl State for Empty {
7396        type ConvoId = Unset;
7397        type Message = Unset;
7398        type Rev = Unset;
7399    }
7400    ///State transition - sets the `convo_id` field to Set
7401    pub struct SetConvoId<St: State = Empty>(PhantomData<fn() -> St>);
7402    impl<St: State> sealed::Sealed for SetConvoId<St> {}
7403    impl<St: State> State for SetConvoId<St> {
7404        type ConvoId = Set<members::convo_id>;
7405        type Message = St::Message;
7406        type Rev = St::Rev;
7407    }
7408    ///State transition - sets the `message` field to Set
7409    pub struct SetMessage<St: State = Empty>(PhantomData<fn() -> St>);
7410    impl<St: State> sealed::Sealed for SetMessage<St> {}
7411    impl<St: State> State for SetMessage<St> {
7412        type ConvoId = St::ConvoId;
7413        type Message = Set<members::message>;
7414        type Rev = St::Rev;
7415    }
7416    ///State transition - sets the `rev` field to Set
7417    pub struct SetRev<St: State = Empty>(PhantomData<fn() -> St>);
7418    impl<St: State> sealed::Sealed for SetRev<St> {}
7419    impl<St: State> State for SetRev<St> {
7420        type ConvoId = St::ConvoId;
7421        type Message = St::Message;
7422        type Rev = Set<members::rev>;
7423    }
7424    /// Marker types for field names
7425    #[allow(non_camel_case_types)]
7426    pub mod members {
7427        ///Marker type for the `convo_id` field
7428        pub struct convo_id(());
7429        ///Marker type for the `message` field
7430        pub struct message(());
7431        ///Marker type for the `rev` field
7432        pub struct rev(());
7433    }
7434}
7435
7436/// Builder for constructing an instance of this type.
7437pub struct LogEnableJoinLinkBuilder<St: log_enable_join_link_state::State, S: BosStr = DefaultStr> {
7438    _state: PhantomData<fn() -> St>,
7439    _fields: (Option<S>, Option<convo::SystemMessageView<S>>, Option<S>),
7440    _type: PhantomData<fn() -> S>,
7441}
7442
7443impl LogEnableJoinLink<DefaultStr> {
7444    /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed
7445    pub fn new() -> LogEnableJoinLinkBuilder<log_enable_join_link_state::Empty, DefaultStr> {
7446        LogEnableJoinLinkBuilder::new()
7447    }
7448}
7449
7450impl<S: BosStr> LogEnableJoinLink<S> {
7451    /// Create a new builder for this type
7452    pub fn builder() -> LogEnableJoinLinkBuilder<log_enable_join_link_state::Empty, S> {
7453        LogEnableJoinLinkBuilder::builder()
7454    }
7455}
7456
7457impl LogEnableJoinLinkBuilder<log_enable_join_link_state::Empty, DefaultStr> {
7458    /// Create a new builder with all fields unset, using the default string type, if needed
7459    pub fn new() -> Self {
7460        LogEnableJoinLinkBuilder {
7461            _state: PhantomData,
7462            _fields: (None, None, None),
7463            _type: PhantomData,
7464        }
7465    }
7466}
7467
7468impl<S: BosStr> LogEnableJoinLinkBuilder<log_enable_join_link_state::Empty, S> {
7469    /// Create a new builder with all fields unset
7470    pub fn builder() -> Self {
7471        LogEnableJoinLinkBuilder {
7472            _state: PhantomData,
7473            _fields: (None, None, None),
7474            _type: PhantomData,
7475        }
7476    }
7477}
7478
7479impl<St, S: BosStr> LogEnableJoinLinkBuilder<St, S>
7480where
7481    St: log_enable_join_link_state::State,
7482    St::ConvoId: log_enable_join_link_state::IsUnset,
7483{
7484    /// Set the `convoId` field (required)
7485    pub fn convo_id(
7486        mut self,
7487        value: impl Into<S>,
7488    ) -> LogEnableJoinLinkBuilder<log_enable_join_link_state::SetConvoId<St>, S> {
7489        self._fields.0 = Option::Some(value.into());
7490        LogEnableJoinLinkBuilder {
7491            _state: PhantomData,
7492            _fields: self._fields,
7493            _type: PhantomData,
7494        }
7495    }
7496}
7497
7498impl<St, S: BosStr> LogEnableJoinLinkBuilder<St, S>
7499where
7500    St: log_enable_join_link_state::State,
7501    St::Message: log_enable_join_link_state::IsUnset,
7502{
7503    /// Set the `message` field (required)
7504    pub fn message(
7505        mut self,
7506        value: impl Into<convo::SystemMessageView<S>>,
7507    ) -> LogEnableJoinLinkBuilder<log_enable_join_link_state::SetMessage<St>, S> {
7508        self._fields.1 = Option::Some(value.into());
7509        LogEnableJoinLinkBuilder {
7510            _state: PhantomData,
7511            _fields: self._fields,
7512            _type: PhantomData,
7513        }
7514    }
7515}
7516
7517impl<St, S: BosStr> LogEnableJoinLinkBuilder<St, S>
7518where
7519    St: log_enable_join_link_state::State,
7520    St::Rev: log_enable_join_link_state::IsUnset,
7521{
7522    /// Set the `rev` field (required)
7523    pub fn rev(
7524        mut self,
7525        value: impl Into<S>,
7526    ) -> LogEnableJoinLinkBuilder<log_enable_join_link_state::SetRev<St>, S> {
7527        self._fields.2 = Option::Some(value.into());
7528        LogEnableJoinLinkBuilder {
7529            _state: PhantomData,
7530            _fields: self._fields,
7531            _type: PhantomData,
7532        }
7533    }
7534}
7535
7536impl<St, S: BosStr> LogEnableJoinLinkBuilder<St, S>
7537where
7538    St: log_enable_join_link_state::State,
7539    St::ConvoId: log_enable_join_link_state::IsSet,
7540    St::Message: log_enable_join_link_state::IsSet,
7541    St::Rev: log_enable_join_link_state::IsSet,
7542{
7543    /// Build the final struct.
7544    pub fn build(self) -> LogEnableJoinLink<S> {
7545        LogEnableJoinLink {
7546            convo_id: self._fields.0.unwrap(),
7547            message: self._fields.1.unwrap(),
7548            rev: self._fields.2.unwrap(),
7549            extra_data: Default::default(),
7550        }
7551    }
7552    /// Build the final struct with custom extra_data.
7553    pub fn build_with_data(self, extra_data: BTreeMap<SmolStr, Data<S>>) -> LogEnableJoinLink<S> {
7554        LogEnableJoinLink {
7555            convo_id: self._fields.0.unwrap(),
7556            message: self._fields.1.unwrap(),
7557            rev: self._fields.2.unwrap(),
7558            extra_data: Some(extra_data),
7559        }
7560    }
7561}
7562
7563pub mod log_incoming_join_request_state {
7564
7565    pub use crate::builder_types::{IsSet, IsUnset, Set, Unset};
7566    #[allow(unused)]
7567    use ::core::marker::PhantomData;
7568    mod sealed {
7569        pub trait Sealed {}
7570    }
7571    /// State trait tracking which required fields have been set
7572    pub trait State: sealed::Sealed {
7573        type ConvoId;
7574        type Member;
7575        type Rev;
7576    }
7577    /// Empty state - all required fields are unset
7578    pub struct Empty(());
7579    impl sealed::Sealed for Empty {}
7580    impl State for Empty {
7581        type ConvoId = Unset;
7582        type Member = Unset;
7583        type Rev = Unset;
7584    }
7585    ///State transition - sets the `convo_id` field to Set
7586    pub struct SetConvoId<St: State = Empty>(PhantomData<fn() -> St>);
7587    impl<St: State> sealed::Sealed for SetConvoId<St> {}
7588    impl<St: State> State for SetConvoId<St> {
7589        type ConvoId = Set<members::convo_id>;
7590        type Member = St::Member;
7591        type Rev = St::Rev;
7592    }
7593    ///State transition - sets the `member` field to Set
7594    pub struct SetMember<St: State = Empty>(PhantomData<fn() -> St>);
7595    impl<St: State> sealed::Sealed for SetMember<St> {}
7596    impl<St: State> State for SetMember<St> {
7597        type ConvoId = St::ConvoId;
7598        type Member = Set<members::member>;
7599        type Rev = St::Rev;
7600    }
7601    ///State transition - sets the `rev` field to Set
7602    pub struct SetRev<St: State = Empty>(PhantomData<fn() -> St>);
7603    impl<St: State> sealed::Sealed for SetRev<St> {}
7604    impl<St: State> State for SetRev<St> {
7605        type ConvoId = St::ConvoId;
7606        type Member = St::Member;
7607        type Rev = Set<members::rev>;
7608    }
7609    /// Marker types for field names
7610    #[allow(non_camel_case_types)]
7611    pub mod members {
7612        ///Marker type for the `convo_id` field
7613        pub struct convo_id(());
7614        ///Marker type for the `member` field
7615        pub struct member(());
7616        ///Marker type for the `rev` field
7617        pub struct rev(());
7618    }
7619}
7620
7621/// Builder for constructing an instance of this type.
7622pub struct LogIncomingJoinRequestBuilder<
7623    St: log_incoming_join_request_state::State,
7624    S: BosStr = DefaultStr,
7625> {
7626    _state: PhantomData<fn() -> St>,
7627    _fields: (Option<S>, Option<ProfileViewBasic<S>>, Option<S>),
7628    _type: PhantomData<fn() -> S>,
7629}
7630
7631impl LogIncomingJoinRequest<DefaultStr> {
7632    /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed
7633    pub fn new() -> LogIncomingJoinRequestBuilder<log_incoming_join_request_state::Empty, DefaultStr>
7634    {
7635        LogIncomingJoinRequestBuilder::new()
7636    }
7637}
7638
7639impl<S: BosStr> LogIncomingJoinRequest<S> {
7640    /// Create a new builder for this type
7641    pub fn builder() -> LogIncomingJoinRequestBuilder<log_incoming_join_request_state::Empty, S> {
7642        LogIncomingJoinRequestBuilder::builder()
7643    }
7644}
7645
7646impl LogIncomingJoinRequestBuilder<log_incoming_join_request_state::Empty, DefaultStr> {
7647    /// Create a new builder with all fields unset, using the default string type, if needed
7648    pub fn new() -> Self {
7649        LogIncomingJoinRequestBuilder {
7650            _state: PhantomData,
7651            _fields: (None, None, None),
7652            _type: PhantomData,
7653        }
7654    }
7655}
7656
7657impl<S: BosStr> LogIncomingJoinRequestBuilder<log_incoming_join_request_state::Empty, S> {
7658    /// Create a new builder with all fields unset
7659    pub fn builder() -> Self {
7660        LogIncomingJoinRequestBuilder {
7661            _state: PhantomData,
7662            _fields: (None, None, None),
7663            _type: PhantomData,
7664        }
7665    }
7666}
7667
7668impl<St, S: BosStr> LogIncomingJoinRequestBuilder<St, S>
7669where
7670    St: log_incoming_join_request_state::State,
7671    St::ConvoId: log_incoming_join_request_state::IsUnset,
7672{
7673    /// Set the `convoId` field (required)
7674    pub fn convo_id(
7675        mut self,
7676        value: impl Into<S>,
7677    ) -> LogIncomingJoinRequestBuilder<log_incoming_join_request_state::SetConvoId<St>, S> {
7678        self._fields.0 = Option::Some(value.into());
7679        LogIncomingJoinRequestBuilder {
7680            _state: PhantomData,
7681            _fields: self._fields,
7682            _type: PhantomData,
7683        }
7684    }
7685}
7686
7687impl<St, S: BosStr> LogIncomingJoinRequestBuilder<St, S>
7688where
7689    St: log_incoming_join_request_state::State,
7690    St::Member: log_incoming_join_request_state::IsUnset,
7691{
7692    /// Set the `member` field (required)
7693    pub fn member(
7694        mut self,
7695        value: impl Into<ProfileViewBasic<S>>,
7696    ) -> LogIncomingJoinRequestBuilder<log_incoming_join_request_state::SetMember<St>, S> {
7697        self._fields.1 = Option::Some(value.into());
7698        LogIncomingJoinRequestBuilder {
7699            _state: PhantomData,
7700            _fields: self._fields,
7701            _type: PhantomData,
7702        }
7703    }
7704}
7705
7706impl<St, S: BosStr> LogIncomingJoinRequestBuilder<St, S>
7707where
7708    St: log_incoming_join_request_state::State,
7709    St::Rev: log_incoming_join_request_state::IsUnset,
7710{
7711    /// Set the `rev` field (required)
7712    pub fn rev(
7713        mut self,
7714        value: impl Into<S>,
7715    ) -> LogIncomingJoinRequestBuilder<log_incoming_join_request_state::SetRev<St>, S> {
7716        self._fields.2 = Option::Some(value.into());
7717        LogIncomingJoinRequestBuilder {
7718            _state: PhantomData,
7719            _fields: self._fields,
7720            _type: PhantomData,
7721        }
7722    }
7723}
7724
7725impl<St, S: BosStr> LogIncomingJoinRequestBuilder<St, S>
7726where
7727    St: log_incoming_join_request_state::State,
7728    St::ConvoId: log_incoming_join_request_state::IsSet,
7729    St::Member: log_incoming_join_request_state::IsSet,
7730    St::Rev: log_incoming_join_request_state::IsSet,
7731{
7732    /// Build the final struct.
7733    pub fn build(self) -> LogIncomingJoinRequest<S> {
7734        LogIncomingJoinRequest {
7735            convo_id: self._fields.0.unwrap(),
7736            member: self._fields.1.unwrap(),
7737            rev: self._fields.2.unwrap(),
7738            extra_data: Default::default(),
7739        }
7740    }
7741    /// Build the final struct with custom extra_data.
7742    pub fn build_with_data(
7743        self,
7744        extra_data: BTreeMap<SmolStr, Data<S>>,
7745    ) -> LogIncomingJoinRequest<S> {
7746        LogIncomingJoinRequest {
7747            convo_id: self._fields.0.unwrap(),
7748            member: self._fields.1.unwrap(),
7749            rev: self._fields.2.unwrap(),
7750            extra_data: Some(extra_data),
7751        }
7752    }
7753}
7754
7755pub mod log_lock_convo_state {
7756
7757    pub use crate::builder_types::{IsSet, IsUnset, Set, Unset};
7758    #[allow(unused)]
7759    use ::core::marker::PhantomData;
7760    mod sealed {
7761        pub trait Sealed {}
7762    }
7763    /// State trait tracking which required fields have been set
7764    pub trait State: sealed::Sealed {
7765        type ConvoId;
7766        type Message;
7767        type RelatedProfiles;
7768        type Rev;
7769    }
7770    /// Empty state - all required fields are unset
7771    pub struct Empty(());
7772    impl sealed::Sealed for Empty {}
7773    impl State for Empty {
7774        type ConvoId = Unset;
7775        type Message = Unset;
7776        type RelatedProfiles = Unset;
7777        type Rev = Unset;
7778    }
7779    ///State transition - sets the `convo_id` field to Set
7780    pub struct SetConvoId<St: State = Empty>(PhantomData<fn() -> St>);
7781    impl<St: State> sealed::Sealed for SetConvoId<St> {}
7782    impl<St: State> State for SetConvoId<St> {
7783        type ConvoId = Set<members::convo_id>;
7784        type Message = St::Message;
7785        type RelatedProfiles = St::RelatedProfiles;
7786        type Rev = St::Rev;
7787    }
7788    ///State transition - sets the `message` field to Set
7789    pub struct SetMessage<St: State = Empty>(PhantomData<fn() -> St>);
7790    impl<St: State> sealed::Sealed for SetMessage<St> {}
7791    impl<St: State> State for SetMessage<St> {
7792        type ConvoId = St::ConvoId;
7793        type Message = Set<members::message>;
7794        type RelatedProfiles = St::RelatedProfiles;
7795        type Rev = St::Rev;
7796    }
7797    ///State transition - sets the `related_profiles` field to Set
7798    pub struct SetRelatedProfiles<St: State = Empty>(PhantomData<fn() -> St>);
7799    impl<St: State> sealed::Sealed for SetRelatedProfiles<St> {}
7800    impl<St: State> State for SetRelatedProfiles<St> {
7801        type ConvoId = St::ConvoId;
7802        type Message = St::Message;
7803        type RelatedProfiles = Set<members::related_profiles>;
7804        type Rev = St::Rev;
7805    }
7806    ///State transition - sets the `rev` field to Set
7807    pub struct SetRev<St: State = Empty>(PhantomData<fn() -> St>);
7808    impl<St: State> sealed::Sealed for SetRev<St> {}
7809    impl<St: State> State for SetRev<St> {
7810        type ConvoId = St::ConvoId;
7811        type Message = St::Message;
7812        type RelatedProfiles = St::RelatedProfiles;
7813        type Rev = Set<members::rev>;
7814    }
7815    /// Marker types for field names
7816    #[allow(non_camel_case_types)]
7817    pub mod members {
7818        ///Marker type for the `convo_id` field
7819        pub struct convo_id(());
7820        ///Marker type for the `message` field
7821        pub struct message(());
7822        ///Marker type for the `related_profiles` field
7823        pub struct related_profiles(());
7824        ///Marker type for the `rev` field
7825        pub struct rev(());
7826    }
7827}
7828
7829/// Builder for constructing an instance of this type.
7830pub struct LogLockConvoBuilder<St: log_lock_convo_state::State, S: BosStr = DefaultStr> {
7831    _state: PhantomData<fn() -> St>,
7832    _fields: (
7833        Option<S>,
7834        Option<convo::SystemMessageView<S>>,
7835        Option<Vec<ProfileViewBasic<S>>>,
7836        Option<S>,
7837    ),
7838    _type: PhantomData<fn() -> S>,
7839}
7840
7841impl LogLockConvo<DefaultStr> {
7842    /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed
7843    pub fn new() -> LogLockConvoBuilder<log_lock_convo_state::Empty, DefaultStr> {
7844        LogLockConvoBuilder::new()
7845    }
7846}
7847
7848impl<S: BosStr> LogLockConvo<S> {
7849    /// Create a new builder for this type
7850    pub fn builder() -> LogLockConvoBuilder<log_lock_convo_state::Empty, S> {
7851        LogLockConvoBuilder::builder()
7852    }
7853}
7854
7855impl LogLockConvoBuilder<log_lock_convo_state::Empty, DefaultStr> {
7856    /// Create a new builder with all fields unset, using the default string type, if needed
7857    pub fn new() -> Self {
7858        LogLockConvoBuilder {
7859            _state: PhantomData,
7860            _fields: (None, None, None, None),
7861            _type: PhantomData,
7862        }
7863    }
7864}
7865
7866impl<S: BosStr> LogLockConvoBuilder<log_lock_convo_state::Empty, S> {
7867    /// Create a new builder with all fields unset
7868    pub fn builder() -> Self {
7869        LogLockConvoBuilder {
7870            _state: PhantomData,
7871            _fields: (None, None, None, None),
7872            _type: PhantomData,
7873        }
7874    }
7875}
7876
7877impl<St, S: BosStr> LogLockConvoBuilder<St, S>
7878where
7879    St: log_lock_convo_state::State,
7880    St::ConvoId: log_lock_convo_state::IsUnset,
7881{
7882    /// Set the `convoId` field (required)
7883    pub fn convo_id(
7884        mut self,
7885        value: impl Into<S>,
7886    ) -> LogLockConvoBuilder<log_lock_convo_state::SetConvoId<St>, S> {
7887        self._fields.0 = Option::Some(value.into());
7888        LogLockConvoBuilder {
7889            _state: PhantomData,
7890            _fields: self._fields,
7891            _type: PhantomData,
7892        }
7893    }
7894}
7895
7896impl<St, S: BosStr> LogLockConvoBuilder<St, S>
7897where
7898    St: log_lock_convo_state::State,
7899    St::Message: log_lock_convo_state::IsUnset,
7900{
7901    /// Set the `message` field (required)
7902    pub fn message(
7903        mut self,
7904        value: impl Into<convo::SystemMessageView<S>>,
7905    ) -> LogLockConvoBuilder<log_lock_convo_state::SetMessage<St>, S> {
7906        self._fields.1 = Option::Some(value.into());
7907        LogLockConvoBuilder {
7908            _state: PhantomData,
7909            _fields: self._fields,
7910            _type: PhantomData,
7911        }
7912    }
7913}
7914
7915impl<St, S: BosStr> LogLockConvoBuilder<St, S>
7916where
7917    St: log_lock_convo_state::State,
7918    St::RelatedProfiles: log_lock_convo_state::IsUnset,
7919{
7920    /// Set the `relatedProfiles` field (required)
7921    pub fn related_profiles(
7922        mut self,
7923        value: impl Into<Vec<ProfileViewBasic<S>>>,
7924    ) -> LogLockConvoBuilder<log_lock_convo_state::SetRelatedProfiles<St>, S> {
7925        self._fields.2 = Option::Some(value.into());
7926        LogLockConvoBuilder {
7927            _state: PhantomData,
7928            _fields: self._fields,
7929            _type: PhantomData,
7930        }
7931    }
7932}
7933
7934impl<St, S: BosStr> LogLockConvoBuilder<St, S>
7935where
7936    St: log_lock_convo_state::State,
7937    St::Rev: log_lock_convo_state::IsUnset,
7938{
7939    /// Set the `rev` field (required)
7940    pub fn rev(
7941        mut self,
7942        value: impl Into<S>,
7943    ) -> LogLockConvoBuilder<log_lock_convo_state::SetRev<St>, S> {
7944        self._fields.3 = Option::Some(value.into());
7945        LogLockConvoBuilder {
7946            _state: PhantomData,
7947            _fields: self._fields,
7948            _type: PhantomData,
7949        }
7950    }
7951}
7952
7953impl<St, S: BosStr> LogLockConvoBuilder<St, S>
7954where
7955    St: log_lock_convo_state::State,
7956    St::ConvoId: log_lock_convo_state::IsSet,
7957    St::Message: log_lock_convo_state::IsSet,
7958    St::RelatedProfiles: log_lock_convo_state::IsSet,
7959    St::Rev: log_lock_convo_state::IsSet,
7960{
7961    /// Build the final struct.
7962    pub fn build(self) -> LogLockConvo<S> {
7963        LogLockConvo {
7964            convo_id: self._fields.0.unwrap(),
7965            message: self._fields.1.unwrap(),
7966            related_profiles: self._fields.2.unwrap(),
7967            rev: self._fields.3.unwrap(),
7968            extra_data: Default::default(),
7969        }
7970    }
7971    /// Build the final struct with custom extra_data.
7972    pub fn build_with_data(self, extra_data: BTreeMap<SmolStr, Data<S>>) -> LogLockConvo<S> {
7973        LogLockConvo {
7974            convo_id: self._fields.0.unwrap(),
7975            message: self._fields.1.unwrap(),
7976            related_profiles: self._fields.2.unwrap(),
7977            rev: self._fields.3.unwrap(),
7978            extra_data: Some(extra_data),
7979        }
7980    }
7981}
7982
7983pub mod log_lock_convo_permanently_state {
7984
7985    pub use crate::builder_types::{IsSet, IsUnset, Set, Unset};
7986    #[allow(unused)]
7987    use ::core::marker::PhantomData;
7988    mod sealed {
7989        pub trait Sealed {}
7990    }
7991    /// State trait tracking which required fields have been set
7992    pub trait State: sealed::Sealed {
7993        type ConvoId;
7994        type Message;
7995        type RelatedProfiles;
7996        type Rev;
7997    }
7998    /// Empty state - all required fields are unset
7999    pub struct Empty(());
8000    impl sealed::Sealed for Empty {}
8001    impl State for Empty {
8002        type ConvoId = Unset;
8003        type Message = Unset;
8004        type RelatedProfiles = Unset;
8005        type Rev = Unset;
8006    }
8007    ///State transition - sets the `convo_id` field to Set
8008    pub struct SetConvoId<St: State = Empty>(PhantomData<fn() -> St>);
8009    impl<St: State> sealed::Sealed for SetConvoId<St> {}
8010    impl<St: State> State for SetConvoId<St> {
8011        type ConvoId = Set<members::convo_id>;
8012        type Message = St::Message;
8013        type RelatedProfiles = St::RelatedProfiles;
8014        type Rev = St::Rev;
8015    }
8016    ///State transition - sets the `message` field to Set
8017    pub struct SetMessage<St: State = Empty>(PhantomData<fn() -> St>);
8018    impl<St: State> sealed::Sealed for SetMessage<St> {}
8019    impl<St: State> State for SetMessage<St> {
8020        type ConvoId = St::ConvoId;
8021        type Message = Set<members::message>;
8022        type RelatedProfiles = St::RelatedProfiles;
8023        type Rev = St::Rev;
8024    }
8025    ///State transition - sets the `related_profiles` field to Set
8026    pub struct SetRelatedProfiles<St: State = Empty>(PhantomData<fn() -> St>);
8027    impl<St: State> sealed::Sealed for SetRelatedProfiles<St> {}
8028    impl<St: State> State for SetRelatedProfiles<St> {
8029        type ConvoId = St::ConvoId;
8030        type Message = St::Message;
8031        type RelatedProfiles = Set<members::related_profiles>;
8032        type Rev = St::Rev;
8033    }
8034    ///State transition - sets the `rev` field to Set
8035    pub struct SetRev<St: State = Empty>(PhantomData<fn() -> St>);
8036    impl<St: State> sealed::Sealed for SetRev<St> {}
8037    impl<St: State> State for SetRev<St> {
8038        type ConvoId = St::ConvoId;
8039        type Message = St::Message;
8040        type RelatedProfiles = St::RelatedProfiles;
8041        type Rev = Set<members::rev>;
8042    }
8043    /// Marker types for field names
8044    #[allow(non_camel_case_types)]
8045    pub mod members {
8046        ///Marker type for the `convo_id` field
8047        pub struct convo_id(());
8048        ///Marker type for the `message` field
8049        pub struct message(());
8050        ///Marker type for the `related_profiles` field
8051        pub struct related_profiles(());
8052        ///Marker type for the `rev` field
8053        pub struct rev(());
8054    }
8055}
8056
8057/// Builder for constructing an instance of this type.
8058pub struct LogLockConvoPermanentlyBuilder<
8059    St: log_lock_convo_permanently_state::State,
8060    S: BosStr = DefaultStr,
8061> {
8062    _state: PhantomData<fn() -> St>,
8063    _fields: (
8064        Option<S>,
8065        Option<convo::SystemMessageView<S>>,
8066        Option<Vec<ProfileViewBasic<S>>>,
8067        Option<S>,
8068    ),
8069    _type: PhantomData<fn() -> S>,
8070}
8071
8072impl LogLockConvoPermanently<DefaultStr> {
8073    /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed
8074    pub fn new()
8075    -> LogLockConvoPermanentlyBuilder<log_lock_convo_permanently_state::Empty, DefaultStr> {
8076        LogLockConvoPermanentlyBuilder::new()
8077    }
8078}
8079
8080impl<S: BosStr> LogLockConvoPermanently<S> {
8081    /// Create a new builder for this type
8082    pub fn builder() -> LogLockConvoPermanentlyBuilder<log_lock_convo_permanently_state::Empty, S> {
8083        LogLockConvoPermanentlyBuilder::builder()
8084    }
8085}
8086
8087impl LogLockConvoPermanentlyBuilder<log_lock_convo_permanently_state::Empty, DefaultStr> {
8088    /// Create a new builder with all fields unset, using the default string type, if needed
8089    pub fn new() -> Self {
8090        LogLockConvoPermanentlyBuilder {
8091            _state: PhantomData,
8092            _fields: (None, None, None, None),
8093            _type: PhantomData,
8094        }
8095    }
8096}
8097
8098impl<S: BosStr> LogLockConvoPermanentlyBuilder<log_lock_convo_permanently_state::Empty, S> {
8099    /// Create a new builder with all fields unset
8100    pub fn builder() -> Self {
8101        LogLockConvoPermanentlyBuilder {
8102            _state: PhantomData,
8103            _fields: (None, None, None, None),
8104            _type: PhantomData,
8105        }
8106    }
8107}
8108
8109impl<St, S: BosStr> LogLockConvoPermanentlyBuilder<St, S>
8110where
8111    St: log_lock_convo_permanently_state::State,
8112    St::ConvoId: log_lock_convo_permanently_state::IsUnset,
8113{
8114    /// Set the `convoId` field (required)
8115    pub fn convo_id(
8116        mut self,
8117        value: impl Into<S>,
8118    ) -> LogLockConvoPermanentlyBuilder<log_lock_convo_permanently_state::SetConvoId<St>, S> {
8119        self._fields.0 = Option::Some(value.into());
8120        LogLockConvoPermanentlyBuilder {
8121            _state: PhantomData,
8122            _fields: self._fields,
8123            _type: PhantomData,
8124        }
8125    }
8126}
8127
8128impl<St, S: BosStr> LogLockConvoPermanentlyBuilder<St, S>
8129where
8130    St: log_lock_convo_permanently_state::State,
8131    St::Message: log_lock_convo_permanently_state::IsUnset,
8132{
8133    /// Set the `message` field (required)
8134    pub fn message(
8135        mut self,
8136        value: impl Into<convo::SystemMessageView<S>>,
8137    ) -> LogLockConvoPermanentlyBuilder<log_lock_convo_permanently_state::SetMessage<St>, S> {
8138        self._fields.1 = Option::Some(value.into());
8139        LogLockConvoPermanentlyBuilder {
8140            _state: PhantomData,
8141            _fields: self._fields,
8142            _type: PhantomData,
8143        }
8144    }
8145}
8146
8147impl<St, S: BosStr> LogLockConvoPermanentlyBuilder<St, S>
8148where
8149    St: log_lock_convo_permanently_state::State,
8150    St::RelatedProfiles: log_lock_convo_permanently_state::IsUnset,
8151{
8152    /// Set the `relatedProfiles` field (required)
8153    pub fn related_profiles(
8154        mut self,
8155        value: impl Into<Vec<ProfileViewBasic<S>>>,
8156    ) -> LogLockConvoPermanentlyBuilder<log_lock_convo_permanently_state::SetRelatedProfiles<St>, S>
8157    {
8158        self._fields.2 = Option::Some(value.into());
8159        LogLockConvoPermanentlyBuilder {
8160            _state: PhantomData,
8161            _fields: self._fields,
8162            _type: PhantomData,
8163        }
8164    }
8165}
8166
8167impl<St, S: BosStr> LogLockConvoPermanentlyBuilder<St, S>
8168where
8169    St: log_lock_convo_permanently_state::State,
8170    St::Rev: log_lock_convo_permanently_state::IsUnset,
8171{
8172    /// Set the `rev` field (required)
8173    pub fn rev(
8174        mut self,
8175        value: impl Into<S>,
8176    ) -> LogLockConvoPermanentlyBuilder<log_lock_convo_permanently_state::SetRev<St>, S> {
8177        self._fields.3 = Option::Some(value.into());
8178        LogLockConvoPermanentlyBuilder {
8179            _state: PhantomData,
8180            _fields: self._fields,
8181            _type: PhantomData,
8182        }
8183    }
8184}
8185
8186impl<St, S: BosStr> LogLockConvoPermanentlyBuilder<St, S>
8187where
8188    St: log_lock_convo_permanently_state::State,
8189    St::ConvoId: log_lock_convo_permanently_state::IsSet,
8190    St::Message: log_lock_convo_permanently_state::IsSet,
8191    St::RelatedProfiles: log_lock_convo_permanently_state::IsSet,
8192    St::Rev: log_lock_convo_permanently_state::IsSet,
8193{
8194    /// Build the final struct.
8195    pub fn build(self) -> LogLockConvoPermanently<S> {
8196        LogLockConvoPermanently {
8197            convo_id: self._fields.0.unwrap(),
8198            message: self._fields.1.unwrap(),
8199            related_profiles: self._fields.2.unwrap(),
8200            rev: self._fields.3.unwrap(),
8201            extra_data: Default::default(),
8202        }
8203    }
8204    /// Build the final struct with custom extra_data.
8205    pub fn build_with_data(
8206        self,
8207        extra_data: BTreeMap<SmolStr, Data<S>>,
8208    ) -> LogLockConvoPermanently<S> {
8209        LogLockConvoPermanently {
8210            convo_id: self._fields.0.unwrap(),
8211            message: self._fields.1.unwrap(),
8212            related_profiles: self._fields.2.unwrap(),
8213            rev: self._fields.3.unwrap(),
8214            extra_data: Some(extra_data),
8215        }
8216    }
8217}
8218
8219pub mod log_member_join_state {
8220
8221    pub use crate::builder_types::{IsSet, IsUnset, Set, Unset};
8222    #[allow(unused)]
8223    use ::core::marker::PhantomData;
8224    mod sealed {
8225        pub trait Sealed {}
8226    }
8227    /// State trait tracking which required fields have been set
8228    pub trait State: sealed::Sealed {
8229        type ConvoId;
8230        type Message;
8231        type RelatedProfiles;
8232        type Rev;
8233    }
8234    /// Empty state - all required fields are unset
8235    pub struct Empty(());
8236    impl sealed::Sealed for Empty {}
8237    impl State for Empty {
8238        type ConvoId = Unset;
8239        type Message = Unset;
8240        type RelatedProfiles = Unset;
8241        type Rev = Unset;
8242    }
8243    ///State transition - sets the `convo_id` field to Set
8244    pub struct SetConvoId<St: State = Empty>(PhantomData<fn() -> St>);
8245    impl<St: State> sealed::Sealed for SetConvoId<St> {}
8246    impl<St: State> State for SetConvoId<St> {
8247        type ConvoId = Set<members::convo_id>;
8248        type Message = St::Message;
8249        type RelatedProfiles = St::RelatedProfiles;
8250        type Rev = St::Rev;
8251    }
8252    ///State transition - sets the `message` field to Set
8253    pub struct SetMessage<St: State = Empty>(PhantomData<fn() -> St>);
8254    impl<St: State> sealed::Sealed for SetMessage<St> {}
8255    impl<St: State> State for SetMessage<St> {
8256        type ConvoId = St::ConvoId;
8257        type Message = Set<members::message>;
8258        type RelatedProfiles = St::RelatedProfiles;
8259        type Rev = St::Rev;
8260    }
8261    ///State transition - sets the `related_profiles` field to Set
8262    pub struct SetRelatedProfiles<St: State = Empty>(PhantomData<fn() -> St>);
8263    impl<St: State> sealed::Sealed for SetRelatedProfiles<St> {}
8264    impl<St: State> State for SetRelatedProfiles<St> {
8265        type ConvoId = St::ConvoId;
8266        type Message = St::Message;
8267        type RelatedProfiles = Set<members::related_profiles>;
8268        type Rev = St::Rev;
8269    }
8270    ///State transition - sets the `rev` field to Set
8271    pub struct SetRev<St: State = Empty>(PhantomData<fn() -> St>);
8272    impl<St: State> sealed::Sealed for SetRev<St> {}
8273    impl<St: State> State for SetRev<St> {
8274        type ConvoId = St::ConvoId;
8275        type Message = St::Message;
8276        type RelatedProfiles = St::RelatedProfiles;
8277        type Rev = Set<members::rev>;
8278    }
8279    /// Marker types for field names
8280    #[allow(non_camel_case_types)]
8281    pub mod members {
8282        ///Marker type for the `convo_id` field
8283        pub struct convo_id(());
8284        ///Marker type for the `message` field
8285        pub struct message(());
8286        ///Marker type for the `related_profiles` field
8287        pub struct related_profiles(());
8288        ///Marker type for the `rev` field
8289        pub struct rev(());
8290    }
8291}
8292
8293/// Builder for constructing an instance of this type.
8294pub struct LogMemberJoinBuilder<St: log_member_join_state::State, S: BosStr = DefaultStr> {
8295    _state: PhantomData<fn() -> St>,
8296    _fields: (
8297        Option<S>,
8298        Option<convo::SystemMessageView<S>>,
8299        Option<Vec<ProfileViewBasic<S>>>,
8300        Option<S>,
8301    ),
8302    _type: PhantomData<fn() -> S>,
8303}
8304
8305impl LogMemberJoin<DefaultStr> {
8306    /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed
8307    pub fn new() -> LogMemberJoinBuilder<log_member_join_state::Empty, DefaultStr> {
8308        LogMemberJoinBuilder::new()
8309    }
8310}
8311
8312impl<S: BosStr> LogMemberJoin<S> {
8313    /// Create a new builder for this type
8314    pub fn builder() -> LogMemberJoinBuilder<log_member_join_state::Empty, S> {
8315        LogMemberJoinBuilder::builder()
8316    }
8317}
8318
8319impl LogMemberJoinBuilder<log_member_join_state::Empty, DefaultStr> {
8320    /// Create a new builder with all fields unset, using the default string type, if needed
8321    pub fn new() -> Self {
8322        LogMemberJoinBuilder {
8323            _state: PhantomData,
8324            _fields: (None, None, None, None),
8325            _type: PhantomData,
8326        }
8327    }
8328}
8329
8330impl<S: BosStr> LogMemberJoinBuilder<log_member_join_state::Empty, S> {
8331    /// Create a new builder with all fields unset
8332    pub fn builder() -> Self {
8333        LogMemberJoinBuilder {
8334            _state: PhantomData,
8335            _fields: (None, None, None, None),
8336            _type: PhantomData,
8337        }
8338    }
8339}
8340
8341impl<St, S: BosStr> LogMemberJoinBuilder<St, S>
8342where
8343    St: log_member_join_state::State,
8344    St::ConvoId: log_member_join_state::IsUnset,
8345{
8346    /// Set the `convoId` field (required)
8347    pub fn convo_id(
8348        mut self,
8349        value: impl Into<S>,
8350    ) -> LogMemberJoinBuilder<log_member_join_state::SetConvoId<St>, S> {
8351        self._fields.0 = Option::Some(value.into());
8352        LogMemberJoinBuilder {
8353            _state: PhantomData,
8354            _fields: self._fields,
8355            _type: PhantomData,
8356        }
8357    }
8358}
8359
8360impl<St, S: BosStr> LogMemberJoinBuilder<St, S>
8361where
8362    St: log_member_join_state::State,
8363    St::Message: log_member_join_state::IsUnset,
8364{
8365    /// Set the `message` field (required)
8366    pub fn message(
8367        mut self,
8368        value: impl Into<convo::SystemMessageView<S>>,
8369    ) -> LogMemberJoinBuilder<log_member_join_state::SetMessage<St>, S> {
8370        self._fields.1 = Option::Some(value.into());
8371        LogMemberJoinBuilder {
8372            _state: PhantomData,
8373            _fields: self._fields,
8374            _type: PhantomData,
8375        }
8376    }
8377}
8378
8379impl<St, S: BosStr> LogMemberJoinBuilder<St, S>
8380where
8381    St: log_member_join_state::State,
8382    St::RelatedProfiles: log_member_join_state::IsUnset,
8383{
8384    /// Set the `relatedProfiles` field (required)
8385    pub fn related_profiles(
8386        mut self,
8387        value: impl Into<Vec<ProfileViewBasic<S>>>,
8388    ) -> LogMemberJoinBuilder<log_member_join_state::SetRelatedProfiles<St>, S> {
8389        self._fields.2 = Option::Some(value.into());
8390        LogMemberJoinBuilder {
8391            _state: PhantomData,
8392            _fields: self._fields,
8393            _type: PhantomData,
8394        }
8395    }
8396}
8397
8398impl<St, S: BosStr> LogMemberJoinBuilder<St, S>
8399where
8400    St: log_member_join_state::State,
8401    St::Rev: log_member_join_state::IsUnset,
8402{
8403    /// Set the `rev` field (required)
8404    pub fn rev(
8405        mut self,
8406        value: impl Into<S>,
8407    ) -> LogMemberJoinBuilder<log_member_join_state::SetRev<St>, S> {
8408        self._fields.3 = Option::Some(value.into());
8409        LogMemberJoinBuilder {
8410            _state: PhantomData,
8411            _fields: self._fields,
8412            _type: PhantomData,
8413        }
8414    }
8415}
8416
8417impl<St, S: BosStr> LogMemberJoinBuilder<St, S>
8418where
8419    St: log_member_join_state::State,
8420    St::ConvoId: log_member_join_state::IsSet,
8421    St::Message: log_member_join_state::IsSet,
8422    St::RelatedProfiles: log_member_join_state::IsSet,
8423    St::Rev: log_member_join_state::IsSet,
8424{
8425    /// Build the final struct.
8426    pub fn build(self) -> LogMemberJoin<S> {
8427        LogMemberJoin {
8428            convo_id: self._fields.0.unwrap(),
8429            message: self._fields.1.unwrap(),
8430            related_profiles: self._fields.2.unwrap(),
8431            rev: self._fields.3.unwrap(),
8432            extra_data: Default::default(),
8433        }
8434    }
8435    /// Build the final struct with custom extra_data.
8436    pub fn build_with_data(self, extra_data: BTreeMap<SmolStr, Data<S>>) -> LogMemberJoin<S> {
8437        LogMemberJoin {
8438            convo_id: self._fields.0.unwrap(),
8439            message: self._fields.1.unwrap(),
8440            related_profiles: self._fields.2.unwrap(),
8441            rev: self._fields.3.unwrap(),
8442            extra_data: Some(extra_data),
8443        }
8444    }
8445}
8446
8447pub mod log_member_leave_state {
8448
8449    pub use crate::builder_types::{IsSet, IsUnset, Set, Unset};
8450    #[allow(unused)]
8451    use ::core::marker::PhantomData;
8452    mod sealed {
8453        pub trait Sealed {}
8454    }
8455    /// State trait tracking which required fields have been set
8456    pub trait State: sealed::Sealed {
8457        type ConvoId;
8458        type Message;
8459        type RelatedProfiles;
8460        type Rev;
8461    }
8462    /// Empty state - all required fields are unset
8463    pub struct Empty(());
8464    impl sealed::Sealed for Empty {}
8465    impl State for Empty {
8466        type ConvoId = Unset;
8467        type Message = Unset;
8468        type RelatedProfiles = Unset;
8469        type Rev = Unset;
8470    }
8471    ///State transition - sets the `convo_id` field to Set
8472    pub struct SetConvoId<St: State = Empty>(PhantomData<fn() -> St>);
8473    impl<St: State> sealed::Sealed for SetConvoId<St> {}
8474    impl<St: State> State for SetConvoId<St> {
8475        type ConvoId = Set<members::convo_id>;
8476        type Message = St::Message;
8477        type RelatedProfiles = St::RelatedProfiles;
8478        type Rev = St::Rev;
8479    }
8480    ///State transition - sets the `message` field to Set
8481    pub struct SetMessage<St: State = Empty>(PhantomData<fn() -> St>);
8482    impl<St: State> sealed::Sealed for SetMessage<St> {}
8483    impl<St: State> State for SetMessage<St> {
8484        type ConvoId = St::ConvoId;
8485        type Message = Set<members::message>;
8486        type RelatedProfiles = St::RelatedProfiles;
8487        type Rev = St::Rev;
8488    }
8489    ///State transition - sets the `related_profiles` field to Set
8490    pub struct SetRelatedProfiles<St: State = Empty>(PhantomData<fn() -> St>);
8491    impl<St: State> sealed::Sealed for SetRelatedProfiles<St> {}
8492    impl<St: State> State for SetRelatedProfiles<St> {
8493        type ConvoId = St::ConvoId;
8494        type Message = St::Message;
8495        type RelatedProfiles = Set<members::related_profiles>;
8496        type Rev = St::Rev;
8497    }
8498    ///State transition - sets the `rev` field to Set
8499    pub struct SetRev<St: State = Empty>(PhantomData<fn() -> St>);
8500    impl<St: State> sealed::Sealed for SetRev<St> {}
8501    impl<St: State> State for SetRev<St> {
8502        type ConvoId = St::ConvoId;
8503        type Message = St::Message;
8504        type RelatedProfiles = St::RelatedProfiles;
8505        type Rev = Set<members::rev>;
8506    }
8507    /// Marker types for field names
8508    #[allow(non_camel_case_types)]
8509    pub mod members {
8510        ///Marker type for the `convo_id` field
8511        pub struct convo_id(());
8512        ///Marker type for the `message` field
8513        pub struct message(());
8514        ///Marker type for the `related_profiles` field
8515        pub struct related_profiles(());
8516        ///Marker type for the `rev` field
8517        pub struct rev(());
8518    }
8519}
8520
8521/// Builder for constructing an instance of this type.
8522pub struct LogMemberLeaveBuilder<St: log_member_leave_state::State, S: BosStr = DefaultStr> {
8523    _state: PhantomData<fn() -> St>,
8524    _fields: (
8525        Option<S>,
8526        Option<convo::SystemMessageView<S>>,
8527        Option<Vec<ProfileViewBasic<S>>>,
8528        Option<S>,
8529    ),
8530    _type: PhantomData<fn() -> S>,
8531}
8532
8533impl LogMemberLeave<DefaultStr> {
8534    /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed
8535    pub fn new() -> LogMemberLeaveBuilder<log_member_leave_state::Empty, DefaultStr> {
8536        LogMemberLeaveBuilder::new()
8537    }
8538}
8539
8540impl<S: BosStr> LogMemberLeave<S> {
8541    /// Create a new builder for this type
8542    pub fn builder() -> LogMemberLeaveBuilder<log_member_leave_state::Empty, S> {
8543        LogMemberLeaveBuilder::builder()
8544    }
8545}
8546
8547impl LogMemberLeaveBuilder<log_member_leave_state::Empty, DefaultStr> {
8548    /// Create a new builder with all fields unset, using the default string type, if needed
8549    pub fn new() -> Self {
8550        LogMemberLeaveBuilder {
8551            _state: PhantomData,
8552            _fields: (None, None, None, None),
8553            _type: PhantomData,
8554        }
8555    }
8556}
8557
8558impl<S: BosStr> LogMemberLeaveBuilder<log_member_leave_state::Empty, S> {
8559    /// Create a new builder with all fields unset
8560    pub fn builder() -> Self {
8561        LogMemberLeaveBuilder {
8562            _state: PhantomData,
8563            _fields: (None, None, None, None),
8564            _type: PhantomData,
8565        }
8566    }
8567}
8568
8569impl<St, S: BosStr> LogMemberLeaveBuilder<St, S>
8570where
8571    St: log_member_leave_state::State,
8572    St::ConvoId: log_member_leave_state::IsUnset,
8573{
8574    /// Set the `convoId` field (required)
8575    pub fn convo_id(
8576        mut self,
8577        value: impl Into<S>,
8578    ) -> LogMemberLeaveBuilder<log_member_leave_state::SetConvoId<St>, S> {
8579        self._fields.0 = Option::Some(value.into());
8580        LogMemberLeaveBuilder {
8581            _state: PhantomData,
8582            _fields: self._fields,
8583            _type: PhantomData,
8584        }
8585    }
8586}
8587
8588impl<St, S: BosStr> LogMemberLeaveBuilder<St, S>
8589where
8590    St: log_member_leave_state::State,
8591    St::Message: log_member_leave_state::IsUnset,
8592{
8593    /// Set the `message` field (required)
8594    pub fn message(
8595        mut self,
8596        value: impl Into<convo::SystemMessageView<S>>,
8597    ) -> LogMemberLeaveBuilder<log_member_leave_state::SetMessage<St>, S> {
8598        self._fields.1 = Option::Some(value.into());
8599        LogMemberLeaveBuilder {
8600            _state: PhantomData,
8601            _fields: self._fields,
8602            _type: PhantomData,
8603        }
8604    }
8605}
8606
8607impl<St, S: BosStr> LogMemberLeaveBuilder<St, S>
8608where
8609    St: log_member_leave_state::State,
8610    St::RelatedProfiles: log_member_leave_state::IsUnset,
8611{
8612    /// Set the `relatedProfiles` field (required)
8613    pub fn related_profiles(
8614        mut self,
8615        value: impl Into<Vec<ProfileViewBasic<S>>>,
8616    ) -> LogMemberLeaveBuilder<log_member_leave_state::SetRelatedProfiles<St>, S> {
8617        self._fields.2 = Option::Some(value.into());
8618        LogMemberLeaveBuilder {
8619            _state: PhantomData,
8620            _fields: self._fields,
8621            _type: PhantomData,
8622        }
8623    }
8624}
8625
8626impl<St, S: BosStr> LogMemberLeaveBuilder<St, S>
8627where
8628    St: log_member_leave_state::State,
8629    St::Rev: log_member_leave_state::IsUnset,
8630{
8631    /// Set the `rev` field (required)
8632    pub fn rev(
8633        mut self,
8634        value: impl Into<S>,
8635    ) -> LogMemberLeaveBuilder<log_member_leave_state::SetRev<St>, S> {
8636        self._fields.3 = Option::Some(value.into());
8637        LogMemberLeaveBuilder {
8638            _state: PhantomData,
8639            _fields: self._fields,
8640            _type: PhantomData,
8641        }
8642    }
8643}
8644
8645impl<St, S: BosStr> LogMemberLeaveBuilder<St, S>
8646where
8647    St: log_member_leave_state::State,
8648    St::ConvoId: log_member_leave_state::IsSet,
8649    St::Message: log_member_leave_state::IsSet,
8650    St::RelatedProfiles: log_member_leave_state::IsSet,
8651    St::Rev: log_member_leave_state::IsSet,
8652{
8653    /// Build the final struct.
8654    pub fn build(self) -> LogMemberLeave<S> {
8655        LogMemberLeave {
8656            convo_id: self._fields.0.unwrap(),
8657            message: self._fields.1.unwrap(),
8658            related_profiles: self._fields.2.unwrap(),
8659            rev: self._fields.3.unwrap(),
8660            extra_data: Default::default(),
8661        }
8662    }
8663    /// Build the final struct with custom extra_data.
8664    pub fn build_with_data(self, extra_data: BTreeMap<SmolStr, Data<S>>) -> LogMemberLeave<S> {
8665        LogMemberLeave {
8666            convo_id: self._fields.0.unwrap(),
8667            message: self._fields.1.unwrap(),
8668            related_profiles: self._fields.2.unwrap(),
8669            rev: self._fields.3.unwrap(),
8670            extra_data: Some(extra_data),
8671        }
8672    }
8673}
8674
8675pub mod log_read_convo_state {
8676
8677    pub use crate::builder_types::{IsSet, IsUnset, Set, Unset};
8678    #[allow(unused)]
8679    use ::core::marker::PhantomData;
8680    mod sealed {
8681        pub trait Sealed {}
8682    }
8683    /// State trait tracking which required fields have been set
8684    pub trait State: sealed::Sealed {
8685        type ConvoId;
8686        type Message;
8687        type Rev;
8688    }
8689    /// Empty state - all required fields are unset
8690    pub struct Empty(());
8691    impl sealed::Sealed for Empty {}
8692    impl State for Empty {
8693        type ConvoId = Unset;
8694        type Message = Unset;
8695        type Rev = Unset;
8696    }
8697    ///State transition - sets the `convo_id` field to Set
8698    pub struct SetConvoId<St: State = Empty>(PhantomData<fn() -> St>);
8699    impl<St: State> sealed::Sealed for SetConvoId<St> {}
8700    impl<St: State> State for SetConvoId<St> {
8701        type ConvoId = Set<members::convo_id>;
8702        type Message = St::Message;
8703        type Rev = St::Rev;
8704    }
8705    ///State transition - sets the `message` field to Set
8706    pub struct SetMessage<St: State = Empty>(PhantomData<fn() -> St>);
8707    impl<St: State> sealed::Sealed for SetMessage<St> {}
8708    impl<St: State> State for SetMessage<St> {
8709        type ConvoId = St::ConvoId;
8710        type Message = Set<members::message>;
8711        type Rev = St::Rev;
8712    }
8713    ///State transition - sets the `rev` field to Set
8714    pub struct SetRev<St: State = Empty>(PhantomData<fn() -> St>);
8715    impl<St: State> sealed::Sealed for SetRev<St> {}
8716    impl<St: State> State for SetRev<St> {
8717        type ConvoId = St::ConvoId;
8718        type Message = St::Message;
8719        type Rev = Set<members::rev>;
8720    }
8721    /// Marker types for field names
8722    #[allow(non_camel_case_types)]
8723    pub mod members {
8724        ///Marker type for the `convo_id` field
8725        pub struct convo_id(());
8726        ///Marker type for the `message` field
8727        pub struct message(());
8728        ///Marker type for the `rev` field
8729        pub struct rev(());
8730    }
8731}
8732
8733/// Builder for constructing an instance of this type.
8734pub struct LogReadConvoBuilder<St: log_read_convo_state::State, S: BosStr = DefaultStr> {
8735    _state: PhantomData<fn() -> St>,
8736    _fields: (Option<S>, Option<LogReadConvoMessage<S>>, Option<S>),
8737    _type: PhantomData<fn() -> S>,
8738}
8739
8740impl LogReadConvo<DefaultStr> {
8741    /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed
8742    pub fn new() -> LogReadConvoBuilder<log_read_convo_state::Empty, DefaultStr> {
8743        LogReadConvoBuilder::new()
8744    }
8745}
8746
8747impl<S: BosStr> LogReadConvo<S> {
8748    /// Create a new builder for this type
8749    pub fn builder() -> LogReadConvoBuilder<log_read_convo_state::Empty, S> {
8750        LogReadConvoBuilder::builder()
8751    }
8752}
8753
8754impl LogReadConvoBuilder<log_read_convo_state::Empty, DefaultStr> {
8755    /// Create a new builder with all fields unset, using the default string type, if needed
8756    pub fn new() -> Self {
8757        LogReadConvoBuilder {
8758            _state: PhantomData,
8759            _fields: (None, None, None),
8760            _type: PhantomData,
8761        }
8762    }
8763}
8764
8765impl<S: BosStr> LogReadConvoBuilder<log_read_convo_state::Empty, S> {
8766    /// Create a new builder with all fields unset
8767    pub fn builder() -> Self {
8768        LogReadConvoBuilder {
8769            _state: PhantomData,
8770            _fields: (None, None, None),
8771            _type: PhantomData,
8772        }
8773    }
8774}
8775
8776impl<St, S: BosStr> LogReadConvoBuilder<St, S>
8777where
8778    St: log_read_convo_state::State,
8779    St::ConvoId: log_read_convo_state::IsUnset,
8780{
8781    /// Set the `convoId` field (required)
8782    pub fn convo_id(
8783        mut self,
8784        value: impl Into<S>,
8785    ) -> LogReadConvoBuilder<log_read_convo_state::SetConvoId<St>, S> {
8786        self._fields.0 = Option::Some(value.into());
8787        LogReadConvoBuilder {
8788            _state: PhantomData,
8789            _fields: self._fields,
8790            _type: PhantomData,
8791        }
8792    }
8793}
8794
8795impl<St, S: BosStr> LogReadConvoBuilder<St, S>
8796where
8797    St: log_read_convo_state::State,
8798    St::Message: log_read_convo_state::IsUnset,
8799{
8800    /// Set the `message` field (required)
8801    pub fn message(
8802        mut self,
8803        value: impl Into<LogReadConvoMessage<S>>,
8804    ) -> LogReadConvoBuilder<log_read_convo_state::SetMessage<St>, S> {
8805        self._fields.1 = Option::Some(value.into());
8806        LogReadConvoBuilder {
8807            _state: PhantomData,
8808            _fields: self._fields,
8809            _type: PhantomData,
8810        }
8811    }
8812}
8813
8814impl<St, S: BosStr> LogReadConvoBuilder<St, S>
8815where
8816    St: log_read_convo_state::State,
8817    St::Rev: log_read_convo_state::IsUnset,
8818{
8819    /// Set the `rev` field (required)
8820    pub fn rev(
8821        mut self,
8822        value: impl Into<S>,
8823    ) -> LogReadConvoBuilder<log_read_convo_state::SetRev<St>, S> {
8824        self._fields.2 = Option::Some(value.into());
8825        LogReadConvoBuilder {
8826            _state: PhantomData,
8827            _fields: self._fields,
8828            _type: PhantomData,
8829        }
8830    }
8831}
8832
8833impl<St, S: BosStr> LogReadConvoBuilder<St, S>
8834where
8835    St: log_read_convo_state::State,
8836    St::ConvoId: log_read_convo_state::IsSet,
8837    St::Message: log_read_convo_state::IsSet,
8838    St::Rev: log_read_convo_state::IsSet,
8839{
8840    /// Build the final struct.
8841    pub fn build(self) -> LogReadConvo<S> {
8842        LogReadConvo {
8843            convo_id: self._fields.0.unwrap(),
8844            message: self._fields.1.unwrap(),
8845            rev: self._fields.2.unwrap(),
8846            extra_data: Default::default(),
8847        }
8848    }
8849    /// Build the final struct with custom extra_data.
8850    pub fn build_with_data(self, extra_data: BTreeMap<SmolStr, Data<S>>) -> LogReadConvo<S> {
8851        LogReadConvo {
8852            convo_id: self._fields.0.unwrap(),
8853            message: self._fields.1.unwrap(),
8854            rev: self._fields.2.unwrap(),
8855            extra_data: Some(extra_data),
8856        }
8857    }
8858}
8859
8860pub mod log_read_message_state {
8861
8862    pub use crate::builder_types::{IsSet, IsUnset, Set, Unset};
8863    #[allow(unused)]
8864    use ::core::marker::PhantomData;
8865    mod sealed {
8866        pub trait Sealed {}
8867    }
8868    /// State trait tracking which required fields have been set
8869    pub trait State: sealed::Sealed {
8870        type ConvoId;
8871        type Message;
8872        type Rev;
8873    }
8874    /// Empty state - all required fields are unset
8875    pub struct Empty(());
8876    impl sealed::Sealed for Empty {}
8877    impl State for Empty {
8878        type ConvoId = Unset;
8879        type Message = Unset;
8880        type Rev = Unset;
8881    }
8882    ///State transition - sets the `convo_id` field to Set
8883    pub struct SetConvoId<St: State = Empty>(PhantomData<fn() -> St>);
8884    impl<St: State> sealed::Sealed for SetConvoId<St> {}
8885    impl<St: State> State for SetConvoId<St> {
8886        type ConvoId = Set<members::convo_id>;
8887        type Message = St::Message;
8888        type Rev = St::Rev;
8889    }
8890    ///State transition - sets the `message` field to Set
8891    pub struct SetMessage<St: State = Empty>(PhantomData<fn() -> St>);
8892    impl<St: State> sealed::Sealed for SetMessage<St> {}
8893    impl<St: State> State for SetMessage<St> {
8894        type ConvoId = St::ConvoId;
8895        type Message = Set<members::message>;
8896        type Rev = St::Rev;
8897    }
8898    ///State transition - sets the `rev` field to Set
8899    pub struct SetRev<St: State = Empty>(PhantomData<fn() -> St>);
8900    impl<St: State> sealed::Sealed for SetRev<St> {}
8901    impl<St: State> State for SetRev<St> {
8902        type ConvoId = St::ConvoId;
8903        type Message = St::Message;
8904        type Rev = Set<members::rev>;
8905    }
8906    /// Marker types for field names
8907    #[allow(non_camel_case_types)]
8908    pub mod members {
8909        ///Marker type for the `convo_id` field
8910        pub struct convo_id(());
8911        ///Marker type for the `message` field
8912        pub struct message(());
8913        ///Marker type for the `rev` field
8914        pub struct rev(());
8915    }
8916}
8917
8918/// Builder for constructing an instance of this type.
8919pub struct LogReadMessageBuilder<St: log_read_message_state::State, S: BosStr = DefaultStr> {
8920    _state: PhantomData<fn() -> St>,
8921    _fields: (Option<S>, Option<LogReadMessageMessage<S>>, Option<S>),
8922    _type: PhantomData<fn() -> S>,
8923}
8924
8925impl LogReadMessage<DefaultStr> {
8926    /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed
8927    pub fn new() -> LogReadMessageBuilder<log_read_message_state::Empty, DefaultStr> {
8928        LogReadMessageBuilder::new()
8929    }
8930}
8931
8932impl<S: BosStr> LogReadMessage<S> {
8933    /// Create a new builder for this type
8934    pub fn builder() -> LogReadMessageBuilder<log_read_message_state::Empty, S> {
8935        LogReadMessageBuilder::builder()
8936    }
8937}
8938
8939impl LogReadMessageBuilder<log_read_message_state::Empty, DefaultStr> {
8940    /// Create a new builder with all fields unset, using the default string type, if needed
8941    pub fn new() -> Self {
8942        LogReadMessageBuilder {
8943            _state: PhantomData,
8944            _fields: (None, None, None),
8945            _type: PhantomData,
8946        }
8947    }
8948}
8949
8950impl<S: BosStr> LogReadMessageBuilder<log_read_message_state::Empty, S> {
8951    /// Create a new builder with all fields unset
8952    pub fn builder() -> Self {
8953        LogReadMessageBuilder {
8954            _state: PhantomData,
8955            _fields: (None, None, None),
8956            _type: PhantomData,
8957        }
8958    }
8959}
8960
8961impl<St, S: BosStr> LogReadMessageBuilder<St, S>
8962where
8963    St: log_read_message_state::State,
8964    St::ConvoId: log_read_message_state::IsUnset,
8965{
8966    /// Set the `convoId` field (required)
8967    pub fn convo_id(
8968        mut self,
8969        value: impl Into<S>,
8970    ) -> LogReadMessageBuilder<log_read_message_state::SetConvoId<St>, S> {
8971        self._fields.0 = Option::Some(value.into());
8972        LogReadMessageBuilder {
8973            _state: PhantomData,
8974            _fields: self._fields,
8975            _type: PhantomData,
8976        }
8977    }
8978}
8979
8980impl<St, S: BosStr> LogReadMessageBuilder<St, S>
8981where
8982    St: log_read_message_state::State,
8983    St::Message: log_read_message_state::IsUnset,
8984{
8985    /// Set the `message` field (required)
8986    pub fn message(
8987        mut self,
8988        value: impl Into<LogReadMessageMessage<S>>,
8989    ) -> LogReadMessageBuilder<log_read_message_state::SetMessage<St>, S> {
8990        self._fields.1 = Option::Some(value.into());
8991        LogReadMessageBuilder {
8992            _state: PhantomData,
8993            _fields: self._fields,
8994            _type: PhantomData,
8995        }
8996    }
8997}
8998
8999impl<St, S: BosStr> LogReadMessageBuilder<St, S>
9000where
9001    St: log_read_message_state::State,
9002    St::Rev: log_read_message_state::IsUnset,
9003{
9004    /// Set the `rev` field (required)
9005    pub fn rev(
9006        mut self,
9007        value: impl Into<S>,
9008    ) -> LogReadMessageBuilder<log_read_message_state::SetRev<St>, S> {
9009        self._fields.2 = Option::Some(value.into());
9010        LogReadMessageBuilder {
9011            _state: PhantomData,
9012            _fields: self._fields,
9013            _type: PhantomData,
9014        }
9015    }
9016}
9017
9018impl<St, S: BosStr> LogReadMessageBuilder<St, S>
9019where
9020    St: log_read_message_state::State,
9021    St::ConvoId: log_read_message_state::IsSet,
9022    St::Message: log_read_message_state::IsSet,
9023    St::Rev: log_read_message_state::IsSet,
9024{
9025    /// Build the final struct.
9026    pub fn build(self) -> LogReadMessage<S> {
9027        LogReadMessage {
9028            convo_id: self._fields.0.unwrap(),
9029            message: self._fields.1.unwrap(),
9030            rev: self._fields.2.unwrap(),
9031            extra_data: Default::default(),
9032        }
9033    }
9034    /// Build the final struct with custom extra_data.
9035    pub fn build_with_data(self, extra_data: BTreeMap<SmolStr, Data<S>>) -> LogReadMessage<S> {
9036        LogReadMessage {
9037            convo_id: self._fields.0.unwrap(),
9038            message: self._fields.1.unwrap(),
9039            rev: self._fields.2.unwrap(),
9040            extra_data: Some(extra_data),
9041        }
9042    }
9043}
9044
9045pub mod log_reject_join_request_state {
9046
9047    pub use crate::builder_types::{IsSet, IsUnset, Set, Unset};
9048    #[allow(unused)]
9049    use ::core::marker::PhantomData;
9050    mod sealed {
9051        pub trait Sealed {}
9052    }
9053    /// State trait tracking which required fields have been set
9054    pub trait State: sealed::Sealed {
9055        type ConvoId;
9056        type Member;
9057        type Rev;
9058    }
9059    /// Empty state - all required fields are unset
9060    pub struct Empty(());
9061    impl sealed::Sealed for Empty {}
9062    impl State for Empty {
9063        type ConvoId = Unset;
9064        type Member = Unset;
9065        type Rev = Unset;
9066    }
9067    ///State transition - sets the `convo_id` field to Set
9068    pub struct SetConvoId<St: State = Empty>(PhantomData<fn() -> St>);
9069    impl<St: State> sealed::Sealed for SetConvoId<St> {}
9070    impl<St: State> State for SetConvoId<St> {
9071        type ConvoId = Set<members::convo_id>;
9072        type Member = St::Member;
9073        type Rev = St::Rev;
9074    }
9075    ///State transition - sets the `member` field to Set
9076    pub struct SetMember<St: State = Empty>(PhantomData<fn() -> St>);
9077    impl<St: State> sealed::Sealed for SetMember<St> {}
9078    impl<St: State> State for SetMember<St> {
9079        type ConvoId = St::ConvoId;
9080        type Member = Set<members::member>;
9081        type Rev = St::Rev;
9082    }
9083    ///State transition - sets the `rev` field to Set
9084    pub struct SetRev<St: State = Empty>(PhantomData<fn() -> St>);
9085    impl<St: State> sealed::Sealed for SetRev<St> {}
9086    impl<St: State> State for SetRev<St> {
9087        type ConvoId = St::ConvoId;
9088        type Member = St::Member;
9089        type Rev = Set<members::rev>;
9090    }
9091    /// Marker types for field names
9092    #[allow(non_camel_case_types)]
9093    pub mod members {
9094        ///Marker type for the `convo_id` field
9095        pub struct convo_id(());
9096        ///Marker type for the `member` field
9097        pub struct member(());
9098        ///Marker type for the `rev` field
9099        pub struct rev(());
9100    }
9101}
9102
9103/// Builder for constructing an instance of this type.
9104pub struct LogRejectJoinRequestBuilder<
9105    St: log_reject_join_request_state::State,
9106    S: BosStr = DefaultStr,
9107> {
9108    _state: PhantomData<fn() -> St>,
9109    _fields: (Option<S>, Option<ProfileViewBasic<S>>, Option<S>),
9110    _type: PhantomData<fn() -> S>,
9111}
9112
9113impl LogRejectJoinRequest<DefaultStr> {
9114    /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed
9115    pub fn new() -> LogRejectJoinRequestBuilder<log_reject_join_request_state::Empty, DefaultStr> {
9116        LogRejectJoinRequestBuilder::new()
9117    }
9118}
9119
9120impl<S: BosStr> LogRejectJoinRequest<S> {
9121    /// Create a new builder for this type
9122    pub fn builder() -> LogRejectJoinRequestBuilder<log_reject_join_request_state::Empty, S> {
9123        LogRejectJoinRequestBuilder::builder()
9124    }
9125}
9126
9127impl LogRejectJoinRequestBuilder<log_reject_join_request_state::Empty, DefaultStr> {
9128    /// Create a new builder with all fields unset, using the default string type, if needed
9129    pub fn new() -> Self {
9130        LogRejectJoinRequestBuilder {
9131            _state: PhantomData,
9132            _fields: (None, None, None),
9133            _type: PhantomData,
9134        }
9135    }
9136}
9137
9138impl<S: BosStr> LogRejectJoinRequestBuilder<log_reject_join_request_state::Empty, S> {
9139    /// Create a new builder with all fields unset
9140    pub fn builder() -> Self {
9141        LogRejectJoinRequestBuilder {
9142            _state: PhantomData,
9143            _fields: (None, None, None),
9144            _type: PhantomData,
9145        }
9146    }
9147}
9148
9149impl<St, S: BosStr> LogRejectJoinRequestBuilder<St, S>
9150where
9151    St: log_reject_join_request_state::State,
9152    St::ConvoId: log_reject_join_request_state::IsUnset,
9153{
9154    /// Set the `convoId` field (required)
9155    pub fn convo_id(
9156        mut self,
9157        value: impl Into<S>,
9158    ) -> LogRejectJoinRequestBuilder<log_reject_join_request_state::SetConvoId<St>, S> {
9159        self._fields.0 = Option::Some(value.into());
9160        LogRejectJoinRequestBuilder {
9161            _state: PhantomData,
9162            _fields: self._fields,
9163            _type: PhantomData,
9164        }
9165    }
9166}
9167
9168impl<St, S: BosStr> LogRejectJoinRequestBuilder<St, S>
9169where
9170    St: log_reject_join_request_state::State,
9171    St::Member: log_reject_join_request_state::IsUnset,
9172{
9173    /// Set the `member` field (required)
9174    pub fn member(
9175        mut self,
9176        value: impl Into<ProfileViewBasic<S>>,
9177    ) -> LogRejectJoinRequestBuilder<log_reject_join_request_state::SetMember<St>, S> {
9178        self._fields.1 = Option::Some(value.into());
9179        LogRejectJoinRequestBuilder {
9180            _state: PhantomData,
9181            _fields: self._fields,
9182            _type: PhantomData,
9183        }
9184    }
9185}
9186
9187impl<St, S: BosStr> LogRejectJoinRequestBuilder<St, S>
9188where
9189    St: log_reject_join_request_state::State,
9190    St::Rev: log_reject_join_request_state::IsUnset,
9191{
9192    /// Set the `rev` field (required)
9193    pub fn rev(
9194        mut self,
9195        value: impl Into<S>,
9196    ) -> LogRejectJoinRequestBuilder<log_reject_join_request_state::SetRev<St>, S> {
9197        self._fields.2 = Option::Some(value.into());
9198        LogRejectJoinRequestBuilder {
9199            _state: PhantomData,
9200            _fields: self._fields,
9201            _type: PhantomData,
9202        }
9203    }
9204}
9205
9206impl<St, S: BosStr> LogRejectJoinRequestBuilder<St, S>
9207where
9208    St: log_reject_join_request_state::State,
9209    St::ConvoId: log_reject_join_request_state::IsSet,
9210    St::Member: log_reject_join_request_state::IsSet,
9211    St::Rev: log_reject_join_request_state::IsSet,
9212{
9213    /// Build the final struct.
9214    pub fn build(self) -> LogRejectJoinRequest<S> {
9215        LogRejectJoinRequest {
9216            convo_id: self._fields.0.unwrap(),
9217            member: self._fields.1.unwrap(),
9218            rev: self._fields.2.unwrap(),
9219            extra_data: Default::default(),
9220        }
9221    }
9222    /// Build the final struct with custom extra_data.
9223    pub fn build_with_data(
9224        self,
9225        extra_data: BTreeMap<SmolStr, Data<S>>,
9226    ) -> LogRejectJoinRequest<S> {
9227        LogRejectJoinRequest {
9228            convo_id: self._fields.0.unwrap(),
9229            member: self._fields.1.unwrap(),
9230            rev: self._fields.2.unwrap(),
9231            extra_data: Some(extra_data),
9232        }
9233    }
9234}
9235
9236pub mod log_remove_member_state {
9237
9238    pub use crate::builder_types::{IsSet, IsUnset, Set, Unset};
9239    #[allow(unused)]
9240    use ::core::marker::PhantomData;
9241    mod sealed {
9242        pub trait Sealed {}
9243    }
9244    /// State trait tracking which required fields have been set
9245    pub trait State: sealed::Sealed {
9246        type ConvoId;
9247        type Message;
9248        type RelatedProfiles;
9249        type Rev;
9250    }
9251    /// Empty state - all required fields are unset
9252    pub struct Empty(());
9253    impl sealed::Sealed for Empty {}
9254    impl State for Empty {
9255        type ConvoId = Unset;
9256        type Message = Unset;
9257        type RelatedProfiles = Unset;
9258        type Rev = Unset;
9259    }
9260    ///State transition - sets the `convo_id` field to Set
9261    pub struct SetConvoId<St: State = Empty>(PhantomData<fn() -> St>);
9262    impl<St: State> sealed::Sealed for SetConvoId<St> {}
9263    impl<St: State> State for SetConvoId<St> {
9264        type ConvoId = Set<members::convo_id>;
9265        type Message = St::Message;
9266        type RelatedProfiles = St::RelatedProfiles;
9267        type Rev = St::Rev;
9268    }
9269    ///State transition - sets the `message` field to Set
9270    pub struct SetMessage<St: State = Empty>(PhantomData<fn() -> St>);
9271    impl<St: State> sealed::Sealed for SetMessage<St> {}
9272    impl<St: State> State for SetMessage<St> {
9273        type ConvoId = St::ConvoId;
9274        type Message = Set<members::message>;
9275        type RelatedProfiles = St::RelatedProfiles;
9276        type Rev = St::Rev;
9277    }
9278    ///State transition - sets the `related_profiles` field to Set
9279    pub struct SetRelatedProfiles<St: State = Empty>(PhantomData<fn() -> St>);
9280    impl<St: State> sealed::Sealed for SetRelatedProfiles<St> {}
9281    impl<St: State> State for SetRelatedProfiles<St> {
9282        type ConvoId = St::ConvoId;
9283        type Message = St::Message;
9284        type RelatedProfiles = Set<members::related_profiles>;
9285        type Rev = St::Rev;
9286    }
9287    ///State transition - sets the `rev` field to Set
9288    pub struct SetRev<St: State = Empty>(PhantomData<fn() -> St>);
9289    impl<St: State> sealed::Sealed for SetRev<St> {}
9290    impl<St: State> State for SetRev<St> {
9291        type ConvoId = St::ConvoId;
9292        type Message = St::Message;
9293        type RelatedProfiles = St::RelatedProfiles;
9294        type Rev = Set<members::rev>;
9295    }
9296    /// Marker types for field names
9297    #[allow(non_camel_case_types)]
9298    pub mod members {
9299        ///Marker type for the `convo_id` field
9300        pub struct convo_id(());
9301        ///Marker type for the `message` field
9302        pub struct message(());
9303        ///Marker type for the `related_profiles` field
9304        pub struct related_profiles(());
9305        ///Marker type for the `rev` field
9306        pub struct rev(());
9307    }
9308}
9309
9310/// Builder for constructing an instance of this type.
9311pub struct LogRemoveMemberBuilder<St: log_remove_member_state::State, S: BosStr = DefaultStr> {
9312    _state: PhantomData<fn() -> St>,
9313    _fields: (
9314        Option<S>,
9315        Option<convo::SystemMessageView<S>>,
9316        Option<Vec<ProfileViewBasic<S>>>,
9317        Option<S>,
9318    ),
9319    _type: PhantomData<fn() -> S>,
9320}
9321
9322impl LogRemoveMember<DefaultStr> {
9323    /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed
9324    pub fn new() -> LogRemoveMemberBuilder<log_remove_member_state::Empty, DefaultStr> {
9325        LogRemoveMemberBuilder::new()
9326    }
9327}
9328
9329impl<S: BosStr> LogRemoveMember<S> {
9330    /// Create a new builder for this type
9331    pub fn builder() -> LogRemoveMemberBuilder<log_remove_member_state::Empty, S> {
9332        LogRemoveMemberBuilder::builder()
9333    }
9334}
9335
9336impl LogRemoveMemberBuilder<log_remove_member_state::Empty, DefaultStr> {
9337    /// Create a new builder with all fields unset, using the default string type, if needed
9338    pub fn new() -> Self {
9339        LogRemoveMemberBuilder {
9340            _state: PhantomData,
9341            _fields: (None, None, None, None),
9342            _type: PhantomData,
9343        }
9344    }
9345}
9346
9347impl<S: BosStr> LogRemoveMemberBuilder<log_remove_member_state::Empty, S> {
9348    /// Create a new builder with all fields unset
9349    pub fn builder() -> Self {
9350        LogRemoveMemberBuilder {
9351            _state: PhantomData,
9352            _fields: (None, None, None, None),
9353            _type: PhantomData,
9354        }
9355    }
9356}
9357
9358impl<St, S: BosStr> LogRemoveMemberBuilder<St, S>
9359where
9360    St: log_remove_member_state::State,
9361    St::ConvoId: log_remove_member_state::IsUnset,
9362{
9363    /// Set the `convoId` field (required)
9364    pub fn convo_id(
9365        mut self,
9366        value: impl Into<S>,
9367    ) -> LogRemoveMemberBuilder<log_remove_member_state::SetConvoId<St>, S> {
9368        self._fields.0 = Option::Some(value.into());
9369        LogRemoveMemberBuilder {
9370            _state: PhantomData,
9371            _fields: self._fields,
9372            _type: PhantomData,
9373        }
9374    }
9375}
9376
9377impl<St, S: BosStr> LogRemoveMemberBuilder<St, S>
9378where
9379    St: log_remove_member_state::State,
9380    St::Message: log_remove_member_state::IsUnset,
9381{
9382    /// Set the `message` field (required)
9383    pub fn message(
9384        mut self,
9385        value: impl Into<convo::SystemMessageView<S>>,
9386    ) -> LogRemoveMemberBuilder<log_remove_member_state::SetMessage<St>, S> {
9387        self._fields.1 = Option::Some(value.into());
9388        LogRemoveMemberBuilder {
9389            _state: PhantomData,
9390            _fields: self._fields,
9391            _type: PhantomData,
9392        }
9393    }
9394}
9395
9396impl<St, S: BosStr> LogRemoveMemberBuilder<St, S>
9397where
9398    St: log_remove_member_state::State,
9399    St::RelatedProfiles: log_remove_member_state::IsUnset,
9400{
9401    /// Set the `relatedProfiles` field (required)
9402    pub fn related_profiles(
9403        mut self,
9404        value: impl Into<Vec<ProfileViewBasic<S>>>,
9405    ) -> LogRemoveMemberBuilder<log_remove_member_state::SetRelatedProfiles<St>, S> {
9406        self._fields.2 = Option::Some(value.into());
9407        LogRemoveMemberBuilder {
9408            _state: PhantomData,
9409            _fields: self._fields,
9410            _type: PhantomData,
9411        }
9412    }
9413}
9414
9415impl<St, S: BosStr> LogRemoveMemberBuilder<St, S>
9416where
9417    St: log_remove_member_state::State,
9418    St::Rev: log_remove_member_state::IsUnset,
9419{
9420    /// Set the `rev` field (required)
9421    pub fn rev(
9422        mut self,
9423        value: impl Into<S>,
9424    ) -> LogRemoveMemberBuilder<log_remove_member_state::SetRev<St>, S> {
9425        self._fields.3 = Option::Some(value.into());
9426        LogRemoveMemberBuilder {
9427            _state: PhantomData,
9428            _fields: self._fields,
9429            _type: PhantomData,
9430        }
9431    }
9432}
9433
9434impl<St, S: BosStr> LogRemoveMemberBuilder<St, S>
9435where
9436    St: log_remove_member_state::State,
9437    St::ConvoId: log_remove_member_state::IsSet,
9438    St::Message: log_remove_member_state::IsSet,
9439    St::RelatedProfiles: log_remove_member_state::IsSet,
9440    St::Rev: log_remove_member_state::IsSet,
9441{
9442    /// Build the final struct.
9443    pub fn build(self) -> LogRemoveMember<S> {
9444        LogRemoveMember {
9445            convo_id: self._fields.0.unwrap(),
9446            message: self._fields.1.unwrap(),
9447            related_profiles: self._fields.2.unwrap(),
9448            rev: self._fields.3.unwrap(),
9449            extra_data: Default::default(),
9450        }
9451    }
9452    /// Build the final struct with custom extra_data.
9453    pub fn build_with_data(self, extra_data: BTreeMap<SmolStr, Data<S>>) -> LogRemoveMember<S> {
9454        LogRemoveMember {
9455            convo_id: self._fields.0.unwrap(),
9456            message: self._fields.1.unwrap(),
9457            related_profiles: self._fields.2.unwrap(),
9458            rev: self._fields.3.unwrap(),
9459            extra_data: Some(extra_data),
9460        }
9461    }
9462}
9463
9464pub mod log_remove_reaction_state {
9465
9466    pub use crate::builder_types::{IsSet, IsUnset, Set, Unset};
9467    #[allow(unused)]
9468    use ::core::marker::PhantomData;
9469    mod sealed {
9470        pub trait Sealed {}
9471    }
9472    /// State trait tracking which required fields have been set
9473    pub trait State: sealed::Sealed {
9474        type ConvoId;
9475        type Message;
9476        type Reaction;
9477        type Rev;
9478    }
9479    /// Empty state - all required fields are unset
9480    pub struct Empty(());
9481    impl sealed::Sealed for Empty {}
9482    impl State for Empty {
9483        type ConvoId = Unset;
9484        type Message = Unset;
9485        type Reaction = Unset;
9486        type Rev = Unset;
9487    }
9488    ///State transition - sets the `convo_id` field to Set
9489    pub struct SetConvoId<St: State = Empty>(PhantomData<fn() -> St>);
9490    impl<St: State> sealed::Sealed for SetConvoId<St> {}
9491    impl<St: State> State for SetConvoId<St> {
9492        type ConvoId = Set<members::convo_id>;
9493        type Message = St::Message;
9494        type Reaction = St::Reaction;
9495        type Rev = St::Rev;
9496    }
9497    ///State transition - sets the `message` field to Set
9498    pub struct SetMessage<St: State = Empty>(PhantomData<fn() -> St>);
9499    impl<St: State> sealed::Sealed for SetMessage<St> {}
9500    impl<St: State> State for SetMessage<St> {
9501        type ConvoId = St::ConvoId;
9502        type Message = Set<members::message>;
9503        type Reaction = St::Reaction;
9504        type Rev = St::Rev;
9505    }
9506    ///State transition - sets the `reaction` field to Set
9507    pub struct SetReaction<St: State = Empty>(PhantomData<fn() -> St>);
9508    impl<St: State> sealed::Sealed for SetReaction<St> {}
9509    impl<St: State> State for SetReaction<St> {
9510        type ConvoId = St::ConvoId;
9511        type Message = St::Message;
9512        type Reaction = Set<members::reaction>;
9513        type Rev = St::Rev;
9514    }
9515    ///State transition - sets the `rev` field to Set
9516    pub struct SetRev<St: State = Empty>(PhantomData<fn() -> St>);
9517    impl<St: State> sealed::Sealed for SetRev<St> {}
9518    impl<St: State> State for SetRev<St> {
9519        type ConvoId = St::ConvoId;
9520        type Message = St::Message;
9521        type Reaction = St::Reaction;
9522        type Rev = Set<members::rev>;
9523    }
9524    /// Marker types for field names
9525    #[allow(non_camel_case_types)]
9526    pub mod members {
9527        ///Marker type for the `convo_id` field
9528        pub struct convo_id(());
9529        ///Marker type for the `message` field
9530        pub struct message(());
9531        ///Marker type for the `reaction` field
9532        pub struct reaction(());
9533        ///Marker type for the `rev` field
9534        pub struct rev(());
9535    }
9536}
9537
9538/// Builder for constructing an instance of this type.
9539pub struct LogRemoveReactionBuilder<St: log_remove_reaction_state::State, S: BosStr = DefaultStr> {
9540    _state: PhantomData<fn() -> St>,
9541    _fields: (
9542        Option<S>,
9543        Option<LogRemoveReactionMessage<S>>,
9544        Option<convo::ReactionView<S>>,
9545        Option<Vec<ProfileViewBasic<S>>>,
9546        Option<S>,
9547    ),
9548    _type: PhantomData<fn() -> S>,
9549}
9550
9551impl LogRemoveReaction<DefaultStr> {
9552    /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed
9553    pub fn new() -> LogRemoveReactionBuilder<log_remove_reaction_state::Empty, DefaultStr> {
9554        LogRemoveReactionBuilder::new()
9555    }
9556}
9557
9558impl<S: BosStr> LogRemoveReaction<S> {
9559    /// Create a new builder for this type
9560    pub fn builder() -> LogRemoveReactionBuilder<log_remove_reaction_state::Empty, S> {
9561        LogRemoveReactionBuilder::builder()
9562    }
9563}
9564
9565impl LogRemoveReactionBuilder<log_remove_reaction_state::Empty, DefaultStr> {
9566    /// Create a new builder with all fields unset, using the default string type, if needed
9567    pub fn new() -> Self {
9568        LogRemoveReactionBuilder {
9569            _state: PhantomData,
9570            _fields: (None, None, None, None, None),
9571            _type: PhantomData,
9572        }
9573    }
9574}
9575
9576impl<S: BosStr> LogRemoveReactionBuilder<log_remove_reaction_state::Empty, S> {
9577    /// Create a new builder with all fields unset
9578    pub fn builder() -> Self {
9579        LogRemoveReactionBuilder {
9580            _state: PhantomData,
9581            _fields: (None, None, None, None, None),
9582            _type: PhantomData,
9583        }
9584    }
9585}
9586
9587impl<St, S: BosStr> LogRemoveReactionBuilder<St, S>
9588where
9589    St: log_remove_reaction_state::State,
9590    St::ConvoId: log_remove_reaction_state::IsUnset,
9591{
9592    /// Set the `convoId` field (required)
9593    pub fn convo_id(
9594        mut self,
9595        value: impl Into<S>,
9596    ) -> LogRemoveReactionBuilder<log_remove_reaction_state::SetConvoId<St>, S> {
9597        self._fields.0 = Option::Some(value.into());
9598        LogRemoveReactionBuilder {
9599            _state: PhantomData,
9600            _fields: self._fields,
9601            _type: PhantomData,
9602        }
9603    }
9604}
9605
9606impl<St, S: BosStr> LogRemoveReactionBuilder<St, S>
9607where
9608    St: log_remove_reaction_state::State,
9609    St::Message: log_remove_reaction_state::IsUnset,
9610{
9611    /// Set the `message` field (required)
9612    pub fn message(
9613        mut self,
9614        value: impl Into<LogRemoveReactionMessage<S>>,
9615    ) -> LogRemoveReactionBuilder<log_remove_reaction_state::SetMessage<St>, S> {
9616        self._fields.1 = Option::Some(value.into());
9617        LogRemoveReactionBuilder {
9618            _state: PhantomData,
9619            _fields: self._fields,
9620            _type: PhantomData,
9621        }
9622    }
9623}
9624
9625impl<St, S: BosStr> LogRemoveReactionBuilder<St, S>
9626where
9627    St: log_remove_reaction_state::State,
9628    St::Reaction: log_remove_reaction_state::IsUnset,
9629{
9630    /// Set the `reaction` field (required)
9631    pub fn reaction(
9632        mut self,
9633        value: impl Into<convo::ReactionView<S>>,
9634    ) -> LogRemoveReactionBuilder<log_remove_reaction_state::SetReaction<St>, S> {
9635        self._fields.2 = Option::Some(value.into());
9636        LogRemoveReactionBuilder {
9637            _state: PhantomData,
9638            _fields: self._fields,
9639            _type: PhantomData,
9640        }
9641    }
9642}
9643
9644impl<St: log_remove_reaction_state::State, S: BosStr> LogRemoveReactionBuilder<St, S> {
9645    /// Set the `relatedProfiles` field (optional)
9646    pub fn related_profiles(mut self, value: impl Into<Option<Vec<ProfileViewBasic<S>>>>) -> Self {
9647        self._fields.3 = value.into();
9648        self
9649    }
9650    /// Set the `relatedProfiles` field to an Option value (optional)
9651    pub fn maybe_related_profiles(mut self, value: Option<Vec<ProfileViewBasic<S>>>) -> Self {
9652        self._fields.3 = value;
9653        self
9654    }
9655}
9656
9657impl<St, S: BosStr> LogRemoveReactionBuilder<St, S>
9658where
9659    St: log_remove_reaction_state::State,
9660    St::Rev: log_remove_reaction_state::IsUnset,
9661{
9662    /// Set the `rev` field (required)
9663    pub fn rev(
9664        mut self,
9665        value: impl Into<S>,
9666    ) -> LogRemoveReactionBuilder<log_remove_reaction_state::SetRev<St>, S> {
9667        self._fields.4 = Option::Some(value.into());
9668        LogRemoveReactionBuilder {
9669            _state: PhantomData,
9670            _fields: self._fields,
9671            _type: PhantomData,
9672        }
9673    }
9674}
9675
9676impl<St, S: BosStr> LogRemoveReactionBuilder<St, S>
9677where
9678    St: log_remove_reaction_state::State,
9679    St::ConvoId: log_remove_reaction_state::IsSet,
9680    St::Message: log_remove_reaction_state::IsSet,
9681    St::Reaction: log_remove_reaction_state::IsSet,
9682    St::Rev: log_remove_reaction_state::IsSet,
9683{
9684    /// Build the final struct.
9685    pub fn build(self) -> LogRemoveReaction<S> {
9686        LogRemoveReaction {
9687            convo_id: self._fields.0.unwrap(),
9688            message: self._fields.1.unwrap(),
9689            reaction: self._fields.2.unwrap(),
9690            related_profiles: self._fields.3,
9691            rev: self._fields.4.unwrap(),
9692            extra_data: Default::default(),
9693        }
9694    }
9695    /// Build the final struct with custom extra_data.
9696    pub fn build_with_data(self, extra_data: BTreeMap<SmolStr, Data<S>>) -> LogRemoveReaction<S> {
9697        LogRemoveReaction {
9698            convo_id: self._fields.0.unwrap(),
9699            message: self._fields.1.unwrap(),
9700            reaction: self._fields.2.unwrap(),
9701            related_profiles: self._fields.3,
9702            rev: self._fields.4.unwrap(),
9703            extra_data: Some(extra_data),
9704        }
9705    }
9706}
9707
9708pub mod log_unlock_convo_state {
9709
9710    pub use crate::builder_types::{IsSet, IsUnset, Set, Unset};
9711    #[allow(unused)]
9712    use ::core::marker::PhantomData;
9713    mod sealed {
9714        pub trait Sealed {}
9715    }
9716    /// State trait tracking which required fields have been set
9717    pub trait State: sealed::Sealed {
9718        type ConvoId;
9719        type Message;
9720        type RelatedProfiles;
9721        type Rev;
9722    }
9723    /// Empty state - all required fields are unset
9724    pub struct Empty(());
9725    impl sealed::Sealed for Empty {}
9726    impl State for Empty {
9727        type ConvoId = Unset;
9728        type Message = Unset;
9729        type RelatedProfiles = Unset;
9730        type Rev = Unset;
9731    }
9732    ///State transition - sets the `convo_id` field to Set
9733    pub struct SetConvoId<St: State = Empty>(PhantomData<fn() -> St>);
9734    impl<St: State> sealed::Sealed for SetConvoId<St> {}
9735    impl<St: State> State for SetConvoId<St> {
9736        type ConvoId = Set<members::convo_id>;
9737        type Message = St::Message;
9738        type RelatedProfiles = St::RelatedProfiles;
9739        type Rev = St::Rev;
9740    }
9741    ///State transition - sets the `message` field to Set
9742    pub struct SetMessage<St: State = Empty>(PhantomData<fn() -> St>);
9743    impl<St: State> sealed::Sealed for SetMessage<St> {}
9744    impl<St: State> State for SetMessage<St> {
9745        type ConvoId = St::ConvoId;
9746        type Message = Set<members::message>;
9747        type RelatedProfiles = St::RelatedProfiles;
9748        type Rev = St::Rev;
9749    }
9750    ///State transition - sets the `related_profiles` field to Set
9751    pub struct SetRelatedProfiles<St: State = Empty>(PhantomData<fn() -> St>);
9752    impl<St: State> sealed::Sealed for SetRelatedProfiles<St> {}
9753    impl<St: State> State for SetRelatedProfiles<St> {
9754        type ConvoId = St::ConvoId;
9755        type Message = St::Message;
9756        type RelatedProfiles = Set<members::related_profiles>;
9757        type Rev = St::Rev;
9758    }
9759    ///State transition - sets the `rev` field to Set
9760    pub struct SetRev<St: State = Empty>(PhantomData<fn() -> St>);
9761    impl<St: State> sealed::Sealed for SetRev<St> {}
9762    impl<St: State> State for SetRev<St> {
9763        type ConvoId = St::ConvoId;
9764        type Message = St::Message;
9765        type RelatedProfiles = St::RelatedProfiles;
9766        type Rev = Set<members::rev>;
9767    }
9768    /// Marker types for field names
9769    #[allow(non_camel_case_types)]
9770    pub mod members {
9771        ///Marker type for the `convo_id` field
9772        pub struct convo_id(());
9773        ///Marker type for the `message` field
9774        pub struct message(());
9775        ///Marker type for the `related_profiles` field
9776        pub struct related_profiles(());
9777        ///Marker type for the `rev` field
9778        pub struct rev(());
9779    }
9780}
9781
9782/// Builder for constructing an instance of this type.
9783pub struct LogUnlockConvoBuilder<St: log_unlock_convo_state::State, S: BosStr = DefaultStr> {
9784    _state: PhantomData<fn() -> St>,
9785    _fields: (
9786        Option<S>,
9787        Option<convo::SystemMessageView<S>>,
9788        Option<Vec<ProfileViewBasic<S>>>,
9789        Option<S>,
9790    ),
9791    _type: PhantomData<fn() -> S>,
9792}
9793
9794impl LogUnlockConvo<DefaultStr> {
9795    /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed
9796    pub fn new() -> LogUnlockConvoBuilder<log_unlock_convo_state::Empty, DefaultStr> {
9797        LogUnlockConvoBuilder::new()
9798    }
9799}
9800
9801impl<S: BosStr> LogUnlockConvo<S> {
9802    /// Create a new builder for this type
9803    pub fn builder() -> LogUnlockConvoBuilder<log_unlock_convo_state::Empty, S> {
9804        LogUnlockConvoBuilder::builder()
9805    }
9806}
9807
9808impl LogUnlockConvoBuilder<log_unlock_convo_state::Empty, DefaultStr> {
9809    /// Create a new builder with all fields unset, using the default string type, if needed
9810    pub fn new() -> Self {
9811        LogUnlockConvoBuilder {
9812            _state: PhantomData,
9813            _fields: (None, None, None, None),
9814            _type: PhantomData,
9815        }
9816    }
9817}
9818
9819impl<S: BosStr> LogUnlockConvoBuilder<log_unlock_convo_state::Empty, S> {
9820    /// Create a new builder with all fields unset
9821    pub fn builder() -> Self {
9822        LogUnlockConvoBuilder {
9823            _state: PhantomData,
9824            _fields: (None, None, None, None),
9825            _type: PhantomData,
9826        }
9827    }
9828}
9829
9830impl<St, S: BosStr> LogUnlockConvoBuilder<St, S>
9831where
9832    St: log_unlock_convo_state::State,
9833    St::ConvoId: log_unlock_convo_state::IsUnset,
9834{
9835    /// Set the `convoId` field (required)
9836    pub fn convo_id(
9837        mut self,
9838        value: impl Into<S>,
9839    ) -> LogUnlockConvoBuilder<log_unlock_convo_state::SetConvoId<St>, S> {
9840        self._fields.0 = Option::Some(value.into());
9841        LogUnlockConvoBuilder {
9842            _state: PhantomData,
9843            _fields: self._fields,
9844            _type: PhantomData,
9845        }
9846    }
9847}
9848
9849impl<St, S: BosStr> LogUnlockConvoBuilder<St, S>
9850where
9851    St: log_unlock_convo_state::State,
9852    St::Message: log_unlock_convo_state::IsUnset,
9853{
9854    /// Set the `message` field (required)
9855    pub fn message(
9856        mut self,
9857        value: impl Into<convo::SystemMessageView<S>>,
9858    ) -> LogUnlockConvoBuilder<log_unlock_convo_state::SetMessage<St>, S> {
9859        self._fields.1 = Option::Some(value.into());
9860        LogUnlockConvoBuilder {
9861            _state: PhantomData,
9862            _fields: self._fields,
9863            _type: PhantomData,
9864        }
9865    }
9866}
9867
9868impl<St, S: BosStr> LogUnlockConvoBuilder<St, S>
9869where
9870    St: log_unlock_convo_state::State,
9871    St::RelatedProfiles: log_unlock_convo_state::IsUnset,
9872{
9873    /// Set the `relatedProfiles` field (required)
9874    pub fn related_profiles(
9875        mut self,
9876        value: impl Into<Vec<ProfileViewBasic<S>>>,
9877    ) -> LogUnlockConvoBuilder<log_unlock_convo_state::SetRelatedProfiles<St>, S> {
9878        self._fields.2 = Option::Some(value.into());
9879        LogUnlockConvoBuilder {
9880            _state: PhantomData,
9881            _fields: self._fields,
9882            _type: PhantomData,
9883        }
9884    }
9885}
9886
9887impl<St, S: BosStr> LogUnlockConvoBuilder<St, S>
9888where
9889    St: log_unlock_convo_state::State,
9890    St::Rev: log_unlock_convo_state::IsUnset,
9891{
9892    /// Set the `rev` field (required)
9893    pub fn rev(
9894        mut self,
9895        value: impl Into<S>,
9896    ) -> LogUnlockConvoBuilder<log_unlock_convo_state::SetRev<St>, S> {
9897        self._fields.3 = Option::Some(value.into());
9898        LogUnlockConvoBuilder {
9899            _state: PhantomData,
9900            _fields: self._fields,
9901            _type: PhantomData,
9902        }
9903    }
9904}
9905
9906impl<St, S: BosStr> LogUnlockConvoBuilder<St, S>
9907where
9908    St: log_unlock_convo_state::State,
9909    St::ConvoId: log_unlock_convo_state::IsSet,
9910    St::Message: log_unlock_convo_state::IsSet,
9911    St::RelatedProfiles: log_unlock_convo_state::IsSet,
9912    St::Rev: log_unlock_convo_state::IsSet,
9913{
9914    /// Build the final struct.
9915    pub fn build(self) -> LogUnlockConvo<S> {
9916        LogUnlockConvo {
9917            convo_id: self._fields.0.unwrap(),
9918            message: self._fields.1.unwrap(),
9919            related_profiles: self._fields.2.unwrap(),
9920            rev: self._fields.3.unwrap(),
9921            extra_data: Default::default(),
9922        }
9923    }
9924    /// Build the final struct with custom extra_data.
9925    pub fn build_with_data(self, extra_data: BTreeMap<SmolStr, Data<S>>) -> LogUnlockConvo<S> {
9926        LogUnlockConvo {
9927            convo_id: self._fields.0.unwrap(),
9928            message: self._fields.1.unwrap(),
9929            related_profiles: self._fields.2.unwrap(),
9930            rev: self._fields.3.unwrap(),
9931            extra_data: Some(extra_data),
9932        }
9933    }
9934}
9935
9936pub mod log_withdraw_incoming_join_request_state {
9937
9938    pub use crate::builder_types::{IsSet, IsUnset, Set, Unset};
9939    #[allow(unused)]
9940    use ::core::marker::PhantomData;
9941    mod sealed {
9942        pub trait Sealed {}
9943    }
9944    /// State trait tracking which required fields have been set
9945    pub trait State: sealed::Sealed {
9946        type ConvoId;
9947        type Member;
9948        type Rev;
9949    }
9950    /// Empty state - all required fields are unset
9951    pub struct Empty(());
9952    impl sealed::Sealed for Empty {}
9953    impl State for Empty {
9954        type ConvoId = Unset;
9955        type Member = Unset;
9956        type Rev = Unset;
9957    }
9958    ///State transition - sets the `convo_id` field to Set
9959    pub struct SetConvoId<St: State = Empty>(PhantomData<fn() -> St>);
9960    impl<St: State> sealed::Sealed for SetConvoId<St> {}
9961    impl<St: State> State for SetConvoId<St> {
9962        type ConvoId = Set<members::convo_id>;
9963        type Member = St::Member;
9964        type Rev = St::Rev;
9965    }
9966    ///State transition - sets the `member` field to Set
9967    pub struct SetMember<St: State = Empty>(PhantomData<fn() -> St>);
9968    impl<St: State> sealed::Sealed for SetMember<St> {}
9969    impl<St: State> State for SetMember<St> {
9970        type ConvoId = St::ConvoId;
9971        type Member = Set<members::member>;
9972        type Rev = St::Rev;
9973    }
9974    ///State transition - sets the `rev` field to Set
9975    pub struct SetRev<St: State = Empty>(PhantomData<fn() -> St>);
9976    impl<St: State> sealed::Sealed for SetRev<St> {}
9977    impl<St: State> State for SetRev<St> {
9978        type ConvoId = St::ConvoId;
9979        type Member = St::Member;
9980        type Rev = Set<members::rev>;
9981    }
9982    /// Marker types for field names
9983    #[allow(non_camel_case_types)]
9984    pub mod members {
9985        ///Marker type for the `convo_id` field
9986        pub struct convo_id(());
9987        ///Marker type for the `member` field
9988        pub struct member(());
9989        ///Marker type for the `rev` field
9990        pub struct rev(());
9991    }
9992}
9993
9994/// Builder for constructing an instance of this type.
9995pub struct LogWithdrawIncomingJoinRequestBuilder<
9996    St: log_withdraw_incoming_join_request_state::State,
9997    S: BosStr = DefaultStr,
9998> {
9999    _state: PhantomData<fn() -> St>,
10000    _fields: (Option<S>, Option<ProfileViewBasic<S>>, Option<S>),
10001    _type: PhantomData<fn() -> S>,
10002}
10003
10004impl LogWithdrawIncomingJoinRequest<DefaultStr> {
10005    /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed
10006    pub fn new() -> LogWithdrawIncomingJoinRequestBuilder<
10007        log_withdraw_incoming_join_request_state::Empty,
10008        DefaultStr,
10009    > {
10010        LogWithdrawIncomingJoinRequestBuilder::new()
10011    }
10012}
10013
10014impl<S: BosStr> LogWithdrawIncomingJoinRequest<S> {
10015    /// Create a new builder for this type
10016    pub fn builder()
10017    -> LogWithdrawIncomingJoinRequestBuilder<log_withdraw_incoming_join_request_state::Empty, S>
10018    {
10019        LogWithdrawIncomingJoinRequestBuilder::builder()
10020    }
10021}
10022
10023impl
10024    LogWithdrawIncomingJoinRequestBuilder<
10025        log_withdraw_incoming_join_request_state::Empty,
10026        DefaultStr,
10027    >
10028{
10029    /// Create a new builder with all fields unset, using the default string type, if needed
10030    pub fn new() -> Self {
10031        LogWithdrawIncomingJoinRequestBuilder {
10032            _state: PhantomData,
10033            _fields: (None, None, None),
10034            _type: PhantomData,
10035        }
10036    }
10037}
10038
10039impl<S: BosStr>
10040    LogWithdrawIncomingJoinRequestBuilder<log_withdraw_incoming_join_request_state::Empty, S>
10041{
10042    /// Create a new builder with all fields unset
10043    pub fn builder() -> Self {
10044        LogWithdrawIncomingJoinRequestBuilder {
10045            _state: PhantomData,
10046            _fields: (None, None, None),
10047            _type: PhantomData,
10048        }
10049    }
10050}
10051
10052impl<St, S: BosStr> LogWithdrawIncomingJoinRequestBuilder<St, S>
10053where
10054    St: log_withdraw_incoming_join_request_state::State,
10055    St::ConvoId: log_withdraw_incoming_join_request_state::IsUnset,
10056{
10057    /// Set the `convoId` field (required)
10058    pub fn convo_id(
10059        mut self,
10060        value: impl Into<S>,
10061    ) -> LogWithdrawIncomingJoinRequestBuilder<
10062        log_withdraw_incoming_join_request_state::SetConvoId<St>,
10063        S,
10064    > {
10065        self._fields.0 = Option::Some(value.into());
10066        LogWithdrawIncomingJoinRequestBuilder {
10067            _state: PhantomData,
10068            _fields: self._fields,
10069            _type: PhantomData,
10070        }
10071    }
10072}
10073
10074impl<St, S: BosStr> LogWithdrawIncomingJoinRequestBuilder<St, S>
10075where
10076    St: log_withdraw_incoming_join_request_state::State,
10077    St::Member: log_withdraw_incoming_join_request_state::IsUnset,
10078{
10079    /// Set the `member` field (required)
10080    pub fn member(
10081        mut self,
10082        value: impl Into<ProfileViewBasic<S>>,
10083    ) -> LogWithdrawIncomingJoinRequestBuilder<
10084        log_withdraw_incoming_join_request_state::SetMember<St>,
10085        S,
10086    > {
10087        self._fields.1 = Option::Some(value.into());
10088        LogWithdrawIncomingJoinRequestBuilder {
10089            _state: PhantomData,
10090            _fields: self._fields,
10091            _type: PhantomData,
10092        }
10093    }
10094}
10095
10096impl<St, S: BosStr> LogWithdrawIncomingJoinRequestBuilder<St, S>
10097where
10098    St: log_withdraw_incoming_join_request_state::State,
10099    St::Rev: log_withdraw_incoming_join_request_state::IsUnset,
10100{
10101    /// Set the `rev` field (required)
10102    pub fn rev(
10103        mut self,
10104        value: impl Into<S>,
10105    ) -> LogWithdrawIncomingJoinRequestBuilder<
10106        log_withdraw_incoming_join_request_state::SetRev<St>,
10107        S,
10108    > {
10109        self._fields.2 = Option::Some(value.into());
10110        LogWithdrawIncomingJoinRequestBuilder {
10111            _state: PhantomData,
10112            _fields: self._fields,
10113            _type: PhantomData,
10114        }
10115    }
10116}
10117
10118impl<St, S: BosStr> LogWithdrawIncomingJoinRequestBuilder<St, S>
10119where
10120    St: log_withdraw_incoming_join_request_state::State,
10121    St::ConvoId: log_withdraw_incoming_join_request_state::IsSet,
10122    St::Member: log_withdraw_incoming_join_request_state::IsSet,
10123    St::Rev: log_withdraw_incoming_join_request_state::IsSet,
10124{
10125    /// Build the final struct.
10126    pub fn build(self) -> LogWithdrawIncomingJoinRequest<S> {
10127        LogWithdrawIncomingJoinRequest {
10128            convo_id: self._fields.0.unwrap(),
10129            member: self._fields.1.unwrap(),
10130            rev: self._fields.2.unwrap(),
10131            extra_data: Default::default(),
10132        }
10133    }
10134    /// Build the final struct with custom extra_data.
10135    pub fn build_with_data(
10136        self,
10137        extra_data: BTreeMap<SmolStr, Data<S>>,
10138    ) -> LogWithdrawIncomingJoinRequest<S> {
10139        LogWithdrawIncomingJoinRequest {
10140            convo_id: self._fields.0.unwrap(),
10141            member: self._fields.1.unwrap(),
10142            rev: self._fields.2.unwrap(),
10143            extra_data: Some(extra_data),
10144        }
10145    }
10146}
10147
10148pub mod message_and_reaction_view_state {
10149
10150    pub use crate::builder_types::{IsSet, IsUnset, Set, Unset};
10151    #[allow(unused)]
10152    use ::core::marker::PhantomData;
10153    mod sealed {
10154        pub trait Sealed {}
10155    }
10156    /// State trait tracking which required fields have been set
10157    pub trait State: sealed::Sealed {
10158        type Message;
10159        type Reaction;
10160    }
10161    /// Empty state - all required fields are unset
10162    pub struct Empty(());
10163    impl sealed::Sealed for Empty {}
10164    impl State for Empty {
10165        type Message = Unset;
10166        type Reaction = Unset;
10167    }
10168    ///State transition - sets the `message` field to Set
10169    pub struct SetMessage<St: State = Empty>(PhantomData<fn() -> St>);
10170    impl<St: State> sealed::Sealed for SetMessage<St> {}
10171    impl<St: State> State for SetMessage<St> {
10172        type Message = Set<members::message>;
10173        type Reaction = St::Reaction;
10174    }
10175    ///State transition - sets the `reaction` field to Set
10176    pub struct SetReaction<St: State = Empty>(PhantomData<fn() -> St>);
10177    impl<St: State> sealed::Sealed for SetReaction<St> {}
10178    impl<St: State> State for SetReaction<St> {
10179        type Message = St::Message;
10180        type Reaction = Set<members::reaction>;
10181    }
10182    /// Marker types for field names
10183    #[allow(non_camel_case_types)]
10184    pub mod members {
10185        ///Marker type for the `message` field
10186        pub struct message(());
10187        ///Marker type for the `reaction` field
10188        pub struct reaction(());
10189    }
10190}
10191
10192/// Builder for constructing an instance of this type.
10193pub struct MessageAndReactionViewBuilder<
10194    St: message_and_reaction_view_state::State,
10195    S: BosStr = DefaultStr,
10196> {
10197    _state: PhantomData<fn() -> St>,
10198    _fields: (
10199        Option<convo::MessageView<S>>,
10200        Option<convo::ReactionView<S>>,
10201    ),
10202    _type: PhantomData<fn() -> S>,
10203}
10204
10205impl MessageAndReactionView<DefaultStr> {
10206    /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed
10207    pub fn new() -> MessageAndReactionViewBuilder<message_and_reaction_view_state::Empty, DefaultStr>
10208    {
10209        MessageAndReactionViewBuilder::new()
10210    }
10211}
10212
10213impl<S: BosStr> MessageAndReactionView<S> {
10214    /// Create a new builder for this type
10215    pub fn builder() -> MessageAndReactionViewBuilder<message_and_reaction_view_state::Empty, S> {
10216        MessageAndReactionViewBuilder::builder()
10217    }
10218}
10219
10220impl MessageAndReactionViewBuilder<message_and_reaction_view_state::Empty, DefaultStr> {
10221    /// Create a new builder with all fields unset, using the default string type, if needed
10222    pub fn new() -> Self {
10223        MessageAndReactionViewBuilder {
10224            _state: PhantomData,
10225            _fields: (None, None),
10226            _type: PhantomData,
10227        }
10228    }
10229}
10230
10231impl<S: BosStr> MessageAndReactionViewBuilder<message_and_reaction_view_state::Empty, S> {
10232    /// Create a new builder with all fields unset
10233    pub fn builder() -> Self {
10234        MessageAndReactionViewBuilder {
10235            _state: PhantomData,
10236            _fields: (None, None),
10237            _type: PhantomData,
10238        }
10239    }
10240}
10241
10242impl<St, S: BosStr> MessageAndReactionViewBuilder<St, S>
10243where
10244    St: message_and_reaction_view_state::State,
10245    St::Message: message_and_reaction_view_state::IsUnset,
10246{
10247    /// Set the `message` field (required)
10248    pub fn message(
10249        mut self,
10250        value: impl Into<convo::MessageView<S>>,
10251    ) -> MessageAndReactionViewBuilder<message_and_reaction_view_state::SetMessage<St>, S> {
10252        self._fields.0 = Option::Some(value.into());
10253        MessageAndReactionViewBuilder {
10254            _state: PhantomData,
10255            _fields: self._fields,
10256            _type: PhantomData,
10257        }
10258    }
10259}
10260
10261impl<St, S: BosStr> MessageAndReactionViewBuilder<St, S>
10262where
10263    St: message_and_reaction_view_state::State,
10264    St::Reaction: message_and_reaction_view_state::IsUnset,
10265{
10266    /// Set the `reaction` field (required)
10267    pub fn reaction(
10268        mut self,
10269        value: impl Into<convo::ReactionView<S>>,
10270    ) -> MessageAndReactionViewBuilder<message_and_reaction_view_state::SetReaction<St>, S> {
10271        self._fields.1 = Option::Some(value.into());
10272        MessageAndReactionViewBuilder {
10273            _state: PhantomData,
10274            _fields: self._fields,
10275            _type: PhantomData,
10276        }
10277    }
10278}
10279
10280impl<St, S: BosStr> MessageAndReactionViewBuilder<St, S>
10281where
10282    St: message_and_reaction_view_state::State,
10283    St::Message: message_and_reaction_view_state::IsSet,
10284    St::Reaction: message_and_reaction_view_state::IsSet,
10285{
10286    /// Build the final struct.
10287    pub fn build(self) -> MessageAndReactionView<S> {
10288        MessageAndReactionView {
10289            message: self._fields.0.unwrap(),
10290            reaction: self._fields.1.unwrap(),
10291            extra_data: Default::default(),
10292        }
10293    }
10294    /// Build the final struct with custom extra_data.
10295    pub fn build_with_data(
10296        self,
10297        extra_data: BTreeMap<SmolStr, Data<S>>,
10298    ) -> MessageAndReactionView<S> {
10299        MessageAndReactionView {
10300            message: self._fields.0.unwrap(),
10301            reaction: self._fields.1.unwrap(),
10302            extra_data: Some(extra_data),
10303        }
10304    }
10305}
10306
10307pub mod message_ref_state {
10308
10309    pub use crate::builder_types::{IsSet, IsUnset, Set, Unset};
10310    #[allow(unused)]
10311    use ::core::marker::PhantomData;
10312    mod sealed {
10313        pub trait Sealed {}
10314    }
10315    /// State trait tracking which required fields have been set
10316    pub trait State: sealed::Sealed {
10317        type ConvoId;
10318        type Did;
10319        type MessageId;
10320    }
10321    /// Empty state - all required fields are unset
10322    pub struct Empty(());
10323    impl sealed::Sealed for Empty {}
10324    impl State for Empty {
10325        type ConvoId = Unset;
10326        type Did = Unset;
10327        type MessageId = Unset;
10328    }
10329    ///State transition - sets the `convo_id` field to Set
10330    pub struct SetConvoId<St: State = Empty>(PhantomData<fn() -> St>);
10331    impl<St: State> sealed::Sealed for SetConvoId<St> {}
10332    impl<St: State> State for SetConvoId<St> {
10333        type ConvoId = Set<members::convo_id>;
10334        type Did = St::Did;
10335        type MessageId = St::MessageId;
10336    }
10337    ///State transition - sets the `did` field to Set
10338    pub struct SetDid<St: State = Empty>(PhantomData<fn() -> St>);
10339    impl<St: State> sealed::Sealed for SetDid<St> {}
10340    impl<St: State> State for SetDid<St> {
10341        type ConvoId = St::ConvoId;
10342        type Did = Set<members::did>;
10343        type MessageId = St::MessageId;
10344    }
10345    ///State transition - sets the `message_id` field to Set
10346    pub struct SetMessageId<St: State = Empty>(PhantomData<fn() -> St>);
10347    impl<St: State> sealed::Sealed for SetMessageId<St> {}
10348    impl<St: State> State for SetMessageId<St> {
10349        type ConvoId = St::ConvoId;
10350        type Did = St::Did;
10351        type MessageId = Set<members::message_id>;
10352    }
10353    /// Marker types for field names
10354    #[allow(non_camel_case_types)]
10355    pub mod members {
10356        ///Marker type for the `convo_id` field
10357        pub struct convo_id(());
10358        ///Marker type for the `did` field
10359        pub struct did(());
10360        ///Marker type for the `message_id` field
10361        pub struct message_id(());
10362    }
10363}
10364
10365/// Builder for constructing an instance of this type.
10366pub struct MessageRefBuilder<St: message_ref_state::State, S: BosStr = DefaultStr> {
10367    _state: PhantomData<fn() -> St>,
10368    _fields: (Option<S>, Option<Did<S>>, Option<S>),
10369    _type: PhantomData<fn() -> S>,
10370}
10371
10372impl MessageRef<DefaultStr> {
10373    /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed
10374    pub fn new() -> MessageRefBuilder<message_ref_state::Empty, DefaultStr> {
10375        MessageRefBuilder::new()
10376    }
10377}
10378
10379impl<S: BosStr> MessageRef<S> {
10380    /// Create a new builder for this type
10381    pub fn builder() -> MessageRefBuilder<message_ref_state::Empty, S> {
10382        MessageRefBuilder::builder()
10383    }
10384}
10385
10386impl MessageRefBuilder<message_ref_state::Empty, DefaultStr> {
10387    /// Create a new builder with all fields unset, using the default string type, if needed
10388    pub fn new() -> Self {
10389        MessageRefBuilder {
10390            _state: PhantomData,
10391            _fields: (None, None, None),
10392            _type: PhantomData,
10393        }
10394    }
10395}
10396
10397impl<S: BosStr> MessageRefBuilder<message_ref_state::Empty, S> {
10398    /// Create a new builder with all fields unset
10399    pub fn builder() -> Self {
10400        MessageRefBuilder {
10401            _state: PhantomData,
10402            _fields: (None, None, None),
10403            _type: PhantomData,
10404        }
10405    }
10406}
10407
10408impl<St, S: BosStr> MessageRefBuilder<St, S>
10409where
10410    St: message_ref_state::State,
10411    St::ConvoId: message_ref_state::IsUnset,
10412{
10413    /// Set the `convoId` field (required)
10414    pub fn convo_id(
10415        mut self,
10416        value: impl Into<S>,
10417    ) -> MessageRefBuilder<message_ref_state::SetConvoId<St>, S> {
10418        self._fields.0 = Option::Some(value.into());
10419        MessageRefBuilder {
10420            _state: PhantomData,
10421            _fields: self._fields,
10422            _type: PhantomData,
10423        }
10424    }
10425}
10426
10427impl<St, S: BosStr> MessageRefBuilder<St, S>
10428where
10429    St: message_ref_state::State,
10430    St::Did: message_ref_state::IsUnset,
10431{
10432    /// Set the `did` field (required)
10433    pub fn did(
10434        mut self,
10435        value: impl Into<Did<S>>,
10436    ) -> MessageRefBuilder<message_ref_state::SetDid<St>, S> {
10437        self._fields.1 = Option::Some(value.into());
10438        MessageRefBuilder {
10439            _state: PhantomData,
10440            _fields: self._fields,
10441            _type: PhantomData,
10442        }
10443    }
10444}
10445
10446impl<St, S: BosStr> MessageRefBuilder<St, S>
10447where
10448    St: message_ref_state::State,
10449    St::MessageId: message_ref_state::IsUnset,
10450{
10451    /// Set the `messageId` field (required)
10452    pub fn message_id(
10453        mut self,
10454        value: impl Into<S>,
10455    ) -> MessageRefBuilder<message_ref_state::SetMessageId<St>, S> {
10456        self._fields.2 = Option::Some(value.into());
10457        MessageRefBuilder {
10458            _state: PhantomData,
10459            _fields: self._fields,
10460            _type: PhantomData,
10461        }
10462    }
10463}
10464
10465impl<St, S: BosStr> MessageRefBuilder<St, S>
10466where
10467    St: message_ref_state::State,
10468    St::ConvoId: message_ref_state::IsSet,
10469    St::Did: message_ref_state::IsSet,
10470    St::MessageId: message_ref_state::IsSet,
10471{
10472    /// Build the final struct.
10473    pub fn build(self) -> MessageRef<S> {
10474        MessageRef {
10475            convo_id: self._fields.0.unwrap(),
10476            did: self._fields.1.unwrap(),
10477            message_id: self._fields.2.unwrap(),
10478            extra_data: Default::default(),
10479        }
10480    }
10481    /// Build the final struct with custom extra_data.
10482    pub fn build_with_data(self, extra_data: BTreeMap<SmolStr, Data<S>>) -> MessageRef<S> {
10483        MessageRef {
10484            convo_id: self._fields.0.unwrap(),
10485            did: self._fields.1.unwrap(),
10486            message_id: self._fields.2.unwrap(),
10487            extra_data: Some(extra_data),
10488        }
10489    }
10490}
10491
10492pub mod message_view_state {
10493
10494    pub use crate::builder_types::{IsSet, IsUnset, Set, Unset};
10495    #[allow(unused)]
10496    use ::core::marker::PhantomData;
10497    mod sealed {
10498        pub trait Sealed {}
10499    }
10500    /// State trait tracking which required fields have been set
10501    pub trait State: sealed::Sealed {
10502        type Id;
10503        type Rev;
10504        type Sender;
10505        type SentAt;
10506        type Text;
10507    }
10508    /// Empty state - all required fields are unset
10509    pub struct Empty(());
10510    impl sealed::Sealed for Empty {}
10511    impl State for Empty {
10512        type Id = Unset;
10513        type Rev = Unset;
10514        type Sender = Unset;
10515        type SentAt = Unset;
10516        type Text = Unset;
10517    }
10518    ///State transition - sets the `id` field to Set
10519    pub struct SetId<St: State = Empty>(PhantomData<fn() -> St>);
10520    impl<St: State> sealed::Sealed for SetId<St> {}
10521    impl<St: State> State for SetId<St> {
10522        type Id = Set<members::id>;
10523        type Rev = St::Rev;
10524        type Sender = St::Sender;
10525        type SentAt = St::SentAt;
10526        type Text = St::Text;
10527    }
10528    ///State transition - sets the `rev` field to Set
10529    pub struct SetRev<St: State = Empty>(PhantomData<fn() -> St>);
10530    impl<St: State> sealed::Sealed for SetRev<St> {}
10531    impl<St: State> State for SetRev<St> {
10532        type Id = St::Id;
10533        type Rev = Set<members::rev>;
10534        type Sender = St::Sender;
10535        type SentAt = St::SentAt;
10536        type Text = St::Text;
10537    }
10538    ///State transition - sets the `sender` field to Set
10539    pub struct SetSender<St: State = Empty>(PhantomData<fn() -> St>);
10540    impl<St: State> sealed::Sealed for SetSender<St> {}
10541    impl<St: State> State for SetSender<St> {
10542        type Id = St::Id;
10543        type Rev = St::Rev;
10544        type Sender = Set<members::sender>;
10545        type SentAt = St::SentAt;
10546        type Text = St::Text;
10547    }
10548    ///State transition - sets the `sent_at` field to Set
10549    pub struct SetSentAt<St: State = Empty>(PhantomData<fn() -> St>);
10550    impl<St: State> sealed::Sealed for SetSentAt<St> {}
10551    impl<St: State> State for SetSentAt<St> {
10552        type Id = St::Id;
10553        type Rev = St::Rev;
10554        type Sender = St::Sender;
10555        type SentAt = Set<members::sent_at>;
10556        type Text = St::Text;
10557    }
10558    ///State transition - sets the `text` field to Set
10559    pub struct SetText<St: State = Empty>(PhantomData<fn() -> St>);
10560    impl<St: State> sealed::Sealed for SetText<St> {}
10561    impl<St: State> State for SetText<St> {
10562        type Id = St::Id;
10563        type Rev = St::Rev;
10564        type Sender = St::Sender;
10565        type SentAt = St::SentAt;
10566        type Text = Set<members::text>;
10567    }
10568    /// Marker types for field names
10569    #[allow(non_camel_case_types)]
10570    pub mod members {
10571        ///Marker type for the `id` field
10572        pub struct id(());
10573        ///Marker type for the `rev` field
10574        pub struct rev(());
10575        ///Marker type for the `sender` field
10576        pub struct sender(());
10577        ///Marker type for the `sent_at` field
10578        pub struct sent_at(());
10579        ///Marker type for the `text` field
10580        pub struct text(());
10581    }
10582}
10583
10584/// Builder for constructing an instance of this type.
10585pub struct MessageViewBuilder<St: message_view_state::State, S: BosStr = DefaultStr> {
10586    _state: PhantomData<fn() -> St>,
10587    _fields: (
10588        Option<MessageViewEmbed<S>>,
10589        Option<Vec<Facet<S>>>,
10590        Option<S>,
10591        Option<Vec<convo::ReactionView<S>>>,
10592        Option<MessageViewReplyTo<S>>,
10593        Option<S>,
10594        Option<convo::MessageViewSender<S>>,
10595        Option<Datetime>,
10596        Option<S>,
10597    ),
10598    _type: PhantomData<fn() -> S>,
10599}
10600
10601impl MessageView<DefaultStr> {
10602    /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed
10603    pub fn new() -> MessageViewBuilder<message_view_state::Empty, DefaultStr> {
10604        MessageViewBuilder::new()
10605    }
10606}
10607
10608impl<S: BosStr> MessageView<S> {
10609    /// Create a new builder for this type
10610    pub fn builder() -> MessageViewBuilder<message_view_state::Empty, S> {
10611        MessageViewBuilder::builder()
10612    }
10613}
10614
10615impl MessageViewBuilder<message_view_state::Empty, DefaultStr> {
10616    /// Create a new builder with all fields unset, using the default string type, if needed
10617    pub fn new() -> Self {
10618        MessageViewBuilder {
10619            _state: PhantomData,
10620            _fields: (None, None, None, None, None, None, None, None, None),
10621            _type: PhantomData,
10622        }
10623    }
10624}
10625
10626impl<S: BosStr> MessageViewBuilder<message_view_state::Empty, S> {
10627    /// Create a new builder with all fields unset
10628    pub fn builder() -> Self {
10629        MessageViewBuilder {
10630            _state: PhantomData,
10631            _fields: (None, None, None, None, None, None, None, None, None),
10632            _type: PhantomData,
10633        }
10634    }
10635}
10636
10637impl<St: message_view_state::State, S: BosStr> MessageViewBuilder<St, S> {
10638    /// Set the `embed` field (optional)
10639    pub fn embed(mut self, value: impl Into<Option<MessageViewEmbed<S>>>) -> Self {
10640        self._fields.0 = value.into();
10641        self
10642    }
10643    /// Set the `embed` field to an Option value (optional)
10644    pub fn maybe_embed(mut self, value: Option<MessageViewEmbed<S>>) -> Self {
10645        self._fields.0 = value;
10646        self
10647    }
10648}
10649
10650impl<St: message_view_state::State, S: BosStr> MessageViewBuilder<St, S> {
10651    /// Set the `facets` field (optional)
10652    pub fn facets(mut self, value: impl Into<Option<Vec<Facet<S>>>>) -> Self {
10653        self._fields.1 = value.into();
10654        self
10655    }
10656    /// Set the `facets` field to an Option value (optional)
10657    pub fn maybe_facets(mut self, value: Option<Vec<Facet<S>>>) -> Self {
10658        self._fields.1 = value;
10659        self
10660    }
10661}
10662
10663impl<St, S: BosStr> MessageViewBuilder<St, S>
10664where
10665    St: message_view_state::State,
10666    St::Id: message_view_state::IsUnset,
10667{
10668    /// Set the `id` field (required)
10669    pub fn id(
10670        mut self,
10671        value: impl Into<S>,
10672    ) -> MessageViewBuilder<message_view_state::SetId<St>, S> {
10673        self._fields.2 = Option::Some(value.into());
10674        MessageViewBuilder {
10675            _state: PhantomData,
10676            _fields: self._fields,
10677            _type: PhantomData,
10678        }
10679    }
10680}
10681
10682impl<St: message_view_state::State, S: BosStr> MessageViewBuilder<St, S> {
10683    /// Set the `reactions` field (optional)
10684    pub fn reactions(mut self, value: impl Into<Option<Vec<convo::ReactionView<S>>>>) -> Self {
10685        self._fields.3 = value.into();
10686        self
10687    }
10688    /// Set the `reactions` field to an Option value (optional)
10689    pub fn maybe_reactions(mut self, value: Option<Vec<convo::ReactionView<S>>>) -> Self {
10690        self._fields.3 = value;
10691        self
10692    }
10693}
10694
10695impl<St: message_view_state::State, S: BosStr> MessageViewBuilder<St, S> {
10696    /// Set the `replyTo` field (optional)
10697    pub fn reply_to(mut self, value: impl Into<Option<MessageViewReplyTo<S>>>) -> Self {
10698        self._fields.4 = value.into();
10699        self
10700    }
10701    /// Set the `replyTo` field to an Option value (optional)
10702    pub fn maybe_reply_to(mut self, value: Option<MessageViewReplyTo<S>>) -> Self {
10703        self._fields.4 = value;
10704        self
10705    }
10706}
10707
10708impl<St, S: BosStr> MessageViewBuilder<St, S>
10709where
10710    St: message_view_state::State,
10711    St::Rev: message_view_state::IsUnset,
10712{
10713    /// Set the `rev` field (required)
10714    pub fn rev(
10715        mut self,
10716        value: impl Into<S>,
10717    ) -> MessageViewBuilder<message_view_state::SetRev<St>, S> {
10718        self._fields.5 = Option::Some(value.into());
10719        MessageViewBuilder {
10720            _state: PhantomData,
10721            _fields: self._fields,
10722            _type: PhantomData,
10723        }
10724    }
10725}
10726
10727impl<St, S: BosStr> MessageViewBuilder<St, S>
10728where
10729    St: message_view_state::State,
10730    St::Sender: message_view_state::IsUnset,
10731{
10732    /// Set the `sender` field (required)
10733    pub fn sender(
10734        mut self,
10735        value: impl Into<convo::MessageViewSender<S>>,
10736    ) -> MessageViewBuilder<message_view_state::SetSender<St>, S> {
10737        self._fields.6 = Option::Some(value.into());
10738        MessageViewBuilder {
10739            _state: PhantomData,
10740            _fields: self._fields,
10741            _type: PhantomData,
10742        }
10743    }
10744}
10745
10746impl<St, S: BosStr> MessageViewBuilder<St, S>
10747where
10748    St: message_view_state::State,
10749    St::SentAt: message_view_state::IsUnset,
10750{
10751    /// Set the `sentAt` field (required)
10752    pub fn sent_at(
10753        mut self,
10754        value: impl Into<Datetime>,
10755    ) -> MessageViewBuilder<message_view_state::SetSentAt<St>, S> {
10756        self._fields.7 = Option::Some(value.into());
10757        MessageViewBuilder {
10758            _state: PhantomData,
10759            _fields: self._fields,
10760            _type: PhantomData,
10761        }
10762    }
10763}
10764
10765impl<St, S: BosStr> MessageViewBuilder<St, S>
10766where
10767    St: message_view_state::State,
10768    St::Text: message_view_state::IsUnset,
10769{
10770    /// Set the `text` field (required)
10771    pub fn text(
10772        mut self,
10773        value: impl Into<S>,
10774    ) -> MessageViewBuilder<message_view_state::SetText<St>, S> {
10775        self._fields.8 = Option::Some(value.into());
10776        MessageViewBuilder {
10777            _state: PhantomData,
10778            _fields: self._fields,
10779            _type: PhantomData,
10780        }
10781    }
10782}
10783
10784impl<St, S: BosStr> MessageViewBuilder<St, S>
10785where
10786    St: message_view_state::State,
10787    St::Id: message_view_state::IsSet,
10788    St::Rev: message_view_state::IsSet,
10789    St::Sender: message_view_state::IsSet,
10790    St::SentAt: message_view_state::IsSet,
10791    St::Text: message_view_state::IsSet,
10792{
10793    /// Build the final struct.
10794    pub fn build(self) -> MessageView<S> {
10795        MessageView {
10796            embed: self._fields.0,
10797            facets: self._fields.1,
10798            id: self._fields.2.unwrap(),
10799            reactions: self._fields.3,
10800            reply_to: self._fields.4,
10801            rev: self._fields.5.unwrap(),
10802            sender: self._fields.6.unwrap(),
10803            sent_at: self._fields.7.unwrap(),
10804            text: self._fields.8.unwrap(),
10805            extra_data: Default::default(),
10806        }
10807    }
10808    /// Build the final struct with custom extra_data.
10809    pub fn build_with_data(self, extra_data: BTreeMap<SmolStr, Data<S>>) -> MessageView<S> {
10810        MessageView {
10811            embed: self._fields.0,
10812            facets: self._fields.1,
10813            id: self._fields.2.unwrap(),
10814            reactions: self._fields.3,
10815            reply_to: self._fields.4,
10816            rev: self._fields.5.unwrap(),
10817            sender: self._fields.6.unwrap(),
10818            sent_at: self._fields.7.unwrap(),
10819            text: self._fields.8.unwrap(),
10820            extra_data: Some(extra_data),
10821        }
10822    }
10823}
10824
10825pub mod message_view_sender_state {
10826
10827    pub use crate::builder_types::{IsSet, IsUnset, Set, Unset};
10828    #[allow(unused)]
10829    use ::core::marker::PhantomData;
10830    mod sealed {
10831        pub trait Sealed {}
10832    }
10833    /// State trait tracking which required fields have been set
10834    pub trait State: sealed::Sealed {
10835        type Did;
10836    }
10837    /// Empty state - all required fields are unset
10838    pub struct Empty(());
10839    impl sealed::Sealed for Empty {}
10840    impl State for Empty {
10841        type Did = Unset;
10842    }
10843    ///State transition - sets the `did` field to Set
10844    pub struct SetDid<St: State = Empty>(PhantomData<fn() -> St>);
10845    impl<St: State> sealed::Sealed for SetDid<St> {}
10846    impl<St: State> State for SetDid<St> {
10847        type Did = Set<members::did>;
10848    }
10849    /// Marker types for field names
10850    #[allow(non_camel_case_types)]
10851    pub mod members {
10852        ///Marker type for the `did` field
10853        pub struct did(());
10854    }
10855}
10856
10857/// Builder for constructing an instance of this type.
10858pub struct MessageViewSenderBuilder<St: message_view_sender_state::State, S: BosStr = DefaultStr> {
10859    _state: PhantomData<fn() -> St>,
10860    _fields: (Option<Did<S>>,),
10861    _type: PhantomData<fn() -> S>,
10862}
10863
10864impl MessageViewSender<DefaultStr> {
10865    /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed
10866    pub fn new() -> MessageViewSenderBuilder<message_view_sender_state::Empty, DefaultStr> {
10867        MessageViewSenderBuilder::new()
10868    }
10869}
10870
10871impl<S: BosStr> MessageViewSender<S> {
10872    /// Create a new builder for this type
10873    pub fn builder() -> MessageViewSenderBuilder<message_view_sender_state::Empty, S> {
10874        MessageViewSenderBuilder::builder()
10875    }
10876}
10877
10878impl MessageViewSenderBuilder<message_view_sender_state::Empty, DefaultStr> {
10879    /// Create a new builder with all fields unset, using the default string type, if needed
10880    pub fn new() -> Self {
10881        MessageViewSenderBuilder {
10882            _state: PhantomData,
10883            _fields: (None,),
10884            _type: PhantomData,
10885        }
10886    }
10887}
10888
10889impl<S: BosStr> MessageViewSenderBuilder<message_view_sender_state::Empty, S> {
10890    /// Create a new builder with all fields unset
10891    pub fn builder() -> Self {
10892        MessageViewSenderBuilder {
10893            _state: PhantomData,
10894            _fields: (None,),
10895            _type: PhantomData,
10896        }
10897    }
10898}
10899
10900impl<St, S: BosStr> MessageViewSenderBuilder<St, S>
10901where
10902    St: message_view_sender_state::State,
10903    St::Did: message_view_sender_state::IsUnset,
10904{
10905    /// Set the `did` field (required)
10906    pub fn did(
10907        mut self,
10908        value: impl Into<Did<S>>,
10909    ) -> MessageViewSenderBuilder<message_view_sender_state::SetDid<St>, S> {
10910        self._fields.0 = Option::Some(value.into());
10911        MessageViewSenderBuilder {
10912            _state: PhantomData,
10913            _fields: self._fields,
10914            _type: PhantomData,
10915        }
10916    }
10917}
10918
10919impl<St, S: BosStr> MessageViewSenderBuilder<St, S>
10920where
10921    St: message_view_sender_state::State,
10922    St::Did: message_view_sender_state::IsSet,
10923{
10924    /// Build the final struct.
10925    pub fn build(self) -> MessageViewSender<S> {
10926        MessageViewSender {
10927            did: self._fields.0.unwrap(),
10928            extra_data: Default::default(),
10929        }
10930    }
10931    /// Build the final struct with custom extra_data.
10932    pub fn build_with_data(self, extra_data: BTreeMap<SmolStr, Data<S>>) -> MessageViewSender<S> {
10933        MessageViewSender {
10934            did: self._fields.0.unwrap(),
10935            extra_data: Some(extra_data),
10936        }
10937    }
10938}
10939
10940pub mod reaction_view_state {
10941
10942    pub use crate::builder_types::{IsSet, IsUnset, Set, Unset};
10943    #[allow(unused)]
10944    use ::core::marker::PhantomData;
10945    mod sealed {
10946        pub trait Sealed {}
10947    }
10948    /// State trait tracking which required fields have been set
10949    pub trait State: sealed::Sealed {
10950        type CreatedAt;
10951        type Sender;
10952        type Value;
10953    }
10954    /// Empty state - all required fields are unset
10955    pub struct Empty(());
10956    impl sealed::Sealed for Empty {}
10957    impl State for Empty {
10958        type CreatedAt = Unset;
10959        type Sender = Unset;
10960        type Value = Unset;
10961    }
10962    ///State transition - sets the `created_at` field to Set
10963    pub struct SetCreatedAt<St: State = Empty>(PhantomData<fn() -> St>);
10964    impl<St: State> sealed::Sealed for SetCreatedAt<St> {}
10965    impl<St: State> State for SetCreatedAt<St> {
10966        type CreatedAt = Set<members::created_at>;
10967        type Sender = St::Sender;
10968        type Value = St::Value;
10969    }
10970    ///State transition - sets the `sender` field to Set
10971    pub struct SetSender<St: State = Empty>(PhantomData<fn() -> St>);
10972    impl<St: State> sealed::Sealed for SetSender<St> {}
10973    impl<St: State> State for SetSender<St> {
10974        type CreatedAt = St::CreatedAt;
10975        type Sender = Set<members::sender>;
10976        type Value = St::Value;
10977    }
10978    ///State transition - sets the `value` field to Set
10979    pub struct SetValue<St: State = Empty>(PhantomData<fn() -> St>);
10980    impl<St: State> sealed::Sealed for SetValue<St> {}
10981    impl<St: State> State for SetValue<St> {
10982        type CreatedAt = St::CreatedAt;
10983        type Sender = St::Sender;
10984        type Value = Set<members::value>;
10985    }
10986    /// Marker types for field names
10987    #[allow(non_camel_case_types)]
10988    pub mod members {
10989        ///Marker type for the `created_at` field
10990        pub struct created_at(());
10991        ///Marker type for the `sender` field
10992        pub struct sender(());
10993        ///Marker type for the `value` field
10994        pub struct value(());
10995    }
10996}
10997
10998/// Builder for constructing an instance of this type.
10999pub struct ReactionViewBuilder<St: reaction_view_state::State, S: BosStr = DefaultStr> {
11000    _state: PhantomData<fn() -> St>,
11001    _fields: (
11002        Option<Datetime>,
11003        Option<convo::ReactionViewSender<S>>,
11004        Option<S>,
11005    ),
11006    _type: PhantomData<fn() -> S>,
11007}
11008
11009impl ReactionView<DefaultStr> {
11010    /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed
11011    pub fn new() -> ReactionViewBuilder<reaction_view_state::Empty, DefaultStr> {
11012        ReactionViewBuilder::new()
11013    }
11014}
11015
11016impl<S: BosStr> ReactionView<S> {
11017    /// Create a new builder for this type
11018    pub fn builder() -> ReactionViewBuilder<reaction_view_state::Empty, S> {
11019        ReactionViewBuilder::builder()
11020    }
11021}
11022
11023impl ReactionViewBuilder<reaction_view_state::Empty, DefaultStr> {
11024    /// Create a new builder with all fields unset, using the default string type, if needed
11025    pub fn new() -> Self {
11026        ReactionViewBuilder {
11027            _state: PhantomData,
11028            _fields: (None, None, None),
11029            _type: PhantomData,
11030        }
11031    }
11032}
11033
11034impl<S: BosStr> ReactionViewBuilder<reaction_view_state::Empty, S> {
11035    /// Create a new builder with all fields unset
11036    pub fn builder() -> Self {
11037        ReactionViewBuilder {
11038            _state: PhantomData,
11039            _fields: (None, None, None),
11040            _type: PhantomData,
11041        }
11042    }
11043}
11044
11045impl<St, S: BosStr> ReactionViewBuilder<St, S>
11046where
11047    St: reaction_view_state::State,
11048    St::CreatedAt: reaction_view_state::IsUnset,
11049{
11050    /// Set the `createdAt` field (required)
11051    pub fn created_at(
11052        mut self,
11053        value: impl Into<Datetime>,
11054    ) -> ReactionViewBuilder<reaction_view_state::SetCreatedAt<St>, S> {
11055        self._fields.0 = Option::Some(value.into());
11056        ReactionViewBuilder {
11057            _state: PhantomData,
11058            _fields: self._fields,
11059            _type: PhantomData,
11060        }
11061    }
11062}
11063
11064impl<St, S: BosStr> ReactionViewBuilder<St, S>
11065where
11066    St: reaction_view_state::State,
11067    St::Sender: reaction_view_state::IsUnset,
11068{
11069    /// Set the `sender` field (required)
11070    pub fn sender(
11071        mut self,
11072        value: impl Into<convo::ReactionViewSender<S>>,
11073    ) -> ReactionViewBuilder<reaction_view_state::SetSender<St>, S> {
11074        self._fields.1 = Option::Some(value.into());
11075        ReactionViewBuilder {
11076            _state: PhantomData,
11077            _fields: self._fields,
11078            _type: PhantomData,
11079        }
11080    }
11081}
11082
11083impl<St, S: BosStr> ReactionViewBuilder<St, S>
11084where
11085    St: reaction_view_state::State,
11086    St::Value: reaction_view_state::IsUnset,
11087{
11088    /// Set the `value` field (required)
11089    pub fn value(
11090        mut self,
11091        value: impl Into<S>,
11092    ) -> ReactionViewBuilder<reaction_view_state::SetValue<St>, S> {
11093        self._fields.2 = Option::Some(value.into());
11094        ReactionViewBuilder {
11095            _state: PhantomData,
11096            _fields: self._fields,
11097            _type: PhantomData,
11098        }
11099    }
11100}
11101
11102impl<St, S: BosStr> ReactionViewBuilder<St, S>
11103where
11104    St: reaction_view_state::State,
11105    St::CreatedAt: reaction_view_state::IsSet,
11106    St::Sender: reaction_view_state::IsSet,
11107    St::Value: reaction_view_state::IsSet,
11108{
11109    /// Build the final struct.
11110    pub fn build(self) -> ReactionView<S> {
11111        ReactionView {
11112            created_at: self._fields.0.unwrap(),
11113            sender: self._fields.1.unwrap(),
11114            value: self._fields.2.unwrap(),
11115            extra_data: Default::default(),
11116        }
11117    }
11118    /// Build the final struct with custom extra_data.
11119    pub fn build_with_data(self, extra_data: BTreeMap<SmolStr, Data<S>>) -> ReactionView<S> {
11120        ReactionView {
11121            created_at: self._fields.0.unwrap(),
11122            sender: self._fields.1.unwrap(),
11123            value: self._fields.2.unwrap(),
11124            extra_data: Some(extra_data),
11125        }
11126    }
11127}
11128
11129pub mod reaction_view_sender_state {
11130
11131    pub use crate::builder_types::{IsSet, IsUnset, Set, Unset};
11132    #[allow(unused)]
11133    use ::core::marker::PhantomData;
11134    mod sealed {
11135        pub trait Sealed {}
11136    }
11137    /// State trait tracking which required fields have been set
11138    pub trait State: sealed::Sealed {
11139        type Did;
11140    }
11141    /// Empty state - all required fields are unset
11142    pub struct Empty(());
11143    impl sealed::Sealed for Empty {}
11144    impl State for Empty {
11145        type Did = Unset;
11146    }
11147    ///State transition - sets the `did` field to Set
11148    pub struct SetDid<St: State = Empty>(PhantomData<fn() -> St>);
11149    impl<St: State> sealed::Sealed for SetDid<St> {}
11150    impl<St: State> State for SetDid<St> {
11151        type Did = Set<members::did>;
11152    }
11153    /// Marker types for field names
11154    #[allow(non_camel_case_types)]
11155    pub mod members {
11156        ///Marker type for the `did` field
11157        pub struct did(());
11158    }
11159}
11160
11161/// Builder for constructing an instance of this type.
11162pub struct ReactionViewSenderBuilder<St: reaction_view_sender_state::State, S: BosStr = DefaultStr>
11163{
11164    _state: PhantomData<fn() -> St>,
11165    _fields: (Option<Did<S>>,),
11166    _type: PhantomData<fn() -> S>,
11167}
11168
11169impl ReactionViewSender<DefaultStr> {
11170    /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed
11171    pub fn new() -> ReactionViewSenderBuilder<reaction_view_sender_state::Empty, DefaultStr> {
11172        ReactionViewSenderBuilder::new()
11173    }
11174}
11175
11176impl<S: BosStr> ReactionViewSender<S> {
11177    /// Create a new builder for this type
11178    pub fn builder() -> ReactionViewSenderBuilder<reaction_view_sender_state::Empty, S> {
11179        ReactionViewSenderBuilder::builder()
11180    }
11181}
11182
11183impl ReactionViewSenderBuilder<reaction_view_sender_state::Empty, DefaultStr> {
11184    /// Create a new builder with all fields unset, using the default string type, if needed
11185    pub fn new() -> Self {
11186        ReactionViewSenderBuilder {
11187            _state: PhantomData,
11188            _fields: (None,),
11189            _type: PhantomData,
11190        }
11191    }
11192}
11193
11194impl<S: BosStr> ReactionViewSenderBuilder<reaction_view_sender_state::Empty, S> {
11195    /// Create a new builder with all fields unset
11196    pub fn builder() -> Self {
11197        ReactionViewSenderBuilder {
11198            _state: PhantomData,
11199            _fields: (None,),
11200            _type: PhantomData,
11201        }
11202    }
11203}
11204
11205impl<St, S: BosStr> ReactionViewSenderBuilder<St, S>
11206where
11207    St: reaction_view_sender_state::State,
11208    St::Did: reaction_view_sender_state::IsUnset,
11209{
11210    /// Set the `did` field (required)
11211    pub fn did(
11212        mut self,
11213        value: impl Into<Did<S>>,
11214    ) -> ReactionViewSenderBuilder<reaction_view_sender_state::SetDid<St>, S> {
11215        self._fields.0 = Option::Some(value.into());
11216        ReactionViewSenderBuilder {
11217            _state: PhantomData,
11218            _fields: self._fields,
11219            _type: PhantomData,
11220        }
11221    }
11222}
11223
11224impl<St, S: BosStr> ReactionViewSenderBuilder<St, S>
11225where
11226    St: reaction_view_sender_state::State,
11227    St::Did: reaction_view_sender_state::IsSet,
11228{
11229    /// Build the final struct.
11230    pub fn build(self) -> ReactionViewSender<S> {
11231        ReactionViewSender {
11232            did: self._fields.0.unwrap(),
11233            extra_data: Default::default(),
11234        }
11235    }
11236    /// Build the final struct with custom extra_data.
11237    pub fn build_with_data(self, extra_data: BTreeMap<SmolStr, Data<S>>) -> ReactionViewSender<S> {
11238        ReactionViewSender {
11239            did: self._fields.0.unwrap(),
11240            extra_data: Some(extra_data),
11241        }
11242    }
11243}
11244
11245pub mod system_message_data_add_member_state {
11246
11247    pub use crate::builder_types::{IsSet, IsUnset, Set, Unset};
11248    #[allow(unused)]
11249    use ::core::marker::PhantomData;
11250    mod sealed {
11251        pub trait Sealed {}
11252    }
11253    /// State trait tracking which required fields have been set
11254    pub trait State: sealed::Sealed {
11255        type AddedBy;
11256        type Member;
11257        type Role;
11258    }
11259    /// Empty state - all required fields are unset
11260    pub struct Empty(());
11261    impl sealed::Sealed for Empty {}
11262    impl State for Empty {
11263        type AddedBy = Unset;
11264        type Member = Unset;
11265        type Role = Unset;
11266    }
11267    ///State transition - sets the `added_by` field to Set
11268    pub struct SetAddedBy<St: State = Empty>(PhantomData<fn() -> St>);
11269    impl<St: State> sealed::Sealed for SetAddedBy<St> {}
11270    impl<St: State> State for SetAddedBy<St> {
11271        type AddedBy = Set<members::added_by>;
11272        type Member = St::Member;
11273        type Role = St::Role;
11274    }
11275    ///State transition - sets the `member` field to Set
11276    pub struct SetMember<St: State = Empty>(PhantomData<fn() -> St>);
11277    impl<St: State> sealed::Sealed for SetMember<St> {}
11278    impl<St: State> State for SetMember<St> {
11279        type AddedBy = St::AddedBy;
11280        type Member = Set<members::member>;
11281        type Role = St::Role;
11282    }
11283    ///State transition - sets the `role` field to Set
11284    pub struct SetRole<St: State = Empty>(PhantomData<fn() -> St>);
11285    impl<St: State> sealed::Sealed for SetRole<St> {}
11286    impl<St: State> State for SetRole<St> {
11287        type AddedBy = St::AddedBy;
11288        type Member = St::Member;
11289        type Role = Set<members::role>;
11290    }
11291    /// Marker types for field names
11292    #[allow(non_camel_case_types)]
11293    pub mod members {
11294        ///Marker type for the `added_by` field
11295        pub struct added_by(());
11296        ///Marker type for the `member` field
11297        pub struct member(());
11298        ///Marker type for the `role` field
11299        pub struct role(());
11300    }
11301}
11302
11303/// Builder for constructing an instance of this type.
11304pub struct SystemMessageDataAddMemberBuilder<
11305    St: system_message_data_add_member_state::State,
11306    S: BosStr = DefaultStr,
11307> {
11308    _state: PhantomData<fn() -> St>,
11309    _fields: (
11310        Option<convo::SystemMessageReferredUser<S>>,
11311        Option<convo::SystemMessageReferredUser<S>>,
11312        Option<MemberRole<S>>,
11313    ),
11314    _type: PhantomData<fn() -> S>,
11315}
11316
11317impl SystemMessageDataAddMember<DefaultStr> {
11318    /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed
11319    pub fn new()
11320    -> SystemMessageDataAddMemberBuilder<system_message_data_add_member_state::Empty, DefaultStr>
11321    {
11322        SystemMessageDataAddMemberBuilder::new()
11323    }
11324}
11325
11326impl<S: BosStr> SystemMessageDataAddMember<S> {
11327    /// Create a new builder for this type
11328    pub fn builder()
11329    -> SystemMessageDataAddMemberBuilder<system_message_data_add_member_state::Empty, S> {
11330        SystemMessageDataAddMemberBuilder::builder()
11331    }
11332}
11333
11334impl SystemMessageDataAddMemberBuilder<system_message_data_add_member_state::Empty, DefaultStr> {
11335    /// Create a new builder with all fields unset, using the default string type, if needed
11336    pub fn new() -> Self {
11337        SystemMessageDataAddMemberBuilder {
11338            _state: PhantomData,
11339            _fields: (None, None, None),
11340            _type: PhantomData,
11341        }
11342    }
11343}
11344
11345impl<S: BosStr> SystemMessageDataAddMemberBuilder<system_message_data_add_member_state::Empty, S> {
11346    /// Create a new builder with all fields unset
11347    pub fn builder() -> Self {
11348        SystemMessageDataAddMemberBuilder {
11349            _state: PhantomData,
11350            _fields: (None, None, None),
11351            _type: PhantomData,
11352        }
11353    }
11354}
11355
11356impl<St, S: BosStr> SystemMessageDataAddMemberBuilder<St, S>
11357where
11358    St: system_message_data_add_member_state::State,
11359    St::AddedBy: system_message_data_add_member_state::IsUnset,
11360{
11361    /// Set the `addedBy` field (required)
11362    pub fn added_by(
11363        mut self,
11364        value: impl Into<convo::SystemMessageReferredUser<S>>,
11365    ) -> SystemMessageDataAddMemberBuilder<system_message_data_add_member_state::SetAddedBy<St>, S>
11366    {
11367        self._fields.0 = Option::Some(value.into());
11368        SystemMessageDataAddMemberBuilder {
11369            _state: PhantomData,
11370            _fields: self._fields,
11371            _type: PhantomData,
11372        }
11373    }
11374}
11375
11376impl<St, S: BosStr> SystemMessageDataAddMemberBuilder<St, S>
11377where
11378    St: system_message_data_add_member_state::State,
11379    St::Member: system_message_data_add_member_state::IsUnset,
11380{
11381    /// Set the `member` field (required)
11382    pub fn member(
11383        mut self,
11384        value: impl Into<convo::SystemMessageReferredUser<S>>,
11385    ) -> SystemMessageDataAddMemberBuilder<system_message_data_add_member_state::SetMember<St>, S>
11386    {
11387        self._fields.1 = Option::Some(value.into());
11388        SystemMessageDataAddMemberBuilder {
11389            _state: PhantomData,
11390            _fields: self._fields,
11391            _type: PhantomData,
11392        }
11393    }
11394}
11395
11396impl<St, S: BosStr> SystemMessageDataAddMemberBuilder<St, S>
11397where
11398    St: system_message_data_add_member_state::State,
11399    St::Role: system_message_data_add_member_state::IsUnset,
11400{
11401    /// Set the `role` field (required)
11402    pub fn role(
11403        mut self,
11404        value: impl Into<MemberRole<S>>,
11405    ) -> SystemMessageDataAddMemberBuilder<system_message_data_add_member_state::SetRole<St>, S>
11406    {
11407        self._fields.2 = Option::Some(value.into());
11408        SystemMessageDataAddMemberBuilder {
11409            _state: PhantomData,
11410            _fields: self._fields,
11411            _type: PhantomData,
11412        }
11413    }
11414}
11415
11416impl<St, S: BosStr> SystemMessageDataAddMemberBuilder<St, S>
11417where
11418    St: system_message_data_add_member_state::State,
11419    St::AddedBy: system_message_data_add_member_state::IsSet,
11420    St::Member: system_message_data_add_member_state::IsSet,
11421    St::Role: system_message_data_add_member_state::IsSet,
11422{
11423    /// Build the final struct.
11424    pub fn build(self) -> SystemMessageDataAddMember<S> {
11425        SystemMessageDataAddMember {
11426            added_by: self._fields.0.unwrap(),
11427            member: self._fields.1.unwrap(),
11428            role: self._fields.2.unwrap(),
11429            extra_data: Default::default(),
11430        }
11431    }
11432    /// Build the final struct with custom extra_data.
11433    pub fn build_with_data(
11434        self,
11435        extra_data: BTreeMap<SmolStr, Data<S>>,
11436    ) -> SystemMessageDataAddMember<S> {
11437        SystemMessageDataAddMember {
11438            added_by: self._fields.0.unwrap(),
11439            member: self._fields.1.unwrap(),
11440            role: self._fields.2.unwrap(),
11441            extra_data: Some(extra_data),
11442        }
11443    }
11444}
11445
11446pub mod system_message_data_lock_convo_state {
11447
11448    pub use crate::builder_types::{IsSet, IsUnset, Set, Unset};
11449    #[allow(unused)]
11450    use ::core::marker::PhantomData;
11451    mod sealed {
11452        pub trait Sealed {}
11453    }
11454    /// State trait tracking which required fields have been set
11455    pub trait State: sealed::Sealed {
11456        type LockedBy;
11457    }
11458    /// Empty state - all required fields are unset
11459    pub struct Empty(());
11460    impl sealed::Sealed for Empty {}
11461    impl State for Empty {
11462        type LockedBy = Unset;
11463    }
11464    ///State transition - sets the `locked_by` field to Set
11465    pub struct SetLockedBy<St: State = Empty>(PhantomData<fn() -> St>);
11466    impl<St: State> sealed::Sealed for SetLockedBy<St> {}
11467    impl<St: State> State for SetLockedBy<St> {
11468        type LockedBy = Set<members::locked_by>;
11469    }
11470    /// Marker types for field names
11471    #[allow(non_camel_case_types)]
11472    pub mod members {
11473        ///Marker type for the `locked_by` field
11474        pub struct locked_by(());
11475    }
11476}
11477
11478/// Builder for constructing an instance of this type.
11479pub struct SystemMessageDataLockConvoBuilder<
11480    St: system_message_data_lock_convo_state::State,
11481    S: BosStr = DefaultStr,
11482> {
11483    _state: PhantomData<fn() -> St>,
11484    _fields: (Option<convo::SystemMessageReferredUser<S>>,),
11485    _type: PhantomData<fn() -> S>,
11486}
11487
11488impl SystemMessageDataLockConvo<DefaultStr> {
11489    /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed
11490    pub fn new()
11491    -> SystemMessageDataLockConvoBuilder<system_message_data_lock_convo_state::Empty, DefaultStr>
11492    {
11493        SystemMessageDataLockConvoBuilder::new()
11494    }
11495}
11496
11497impl<S: BosStr> SystemMessageDataLockConvo<S> {
11498    /// Create a new builder for this type
11499    pub fn builder()
11500    -> SystemMessageDataLockConvoBuilder<system_message_data_lock_convo_state::Empty, S> {
11501        SystemMessageDataLockConvoBuilder::builder()
11502    }
11503}
11504
11505impl SystemMessageDataLockConvoBuilder<system_message_data_lock_convo_state::Empty, DefaultStr> {
11506    /// Create a new builder with all fields unset, using the default string type, if needed
11507    pub fn new() -> Self {
11508        SystemMessageDataLockConvoBuilder {
11509            _state: PhantomData,
11510            _fields: (None,),
11511            _type: PhantomData,
11512        }
11513    }
11514}
11515
11516impl<S: BosStr> SystemMessageDataLockConvoBuilder<system_message_data_lock_convo_state::Empty, S> {
11517    /// Create a new builder with all fields unset
11518    pub fn builder() -> Self {
11519        SystemMessageDataLockConvoBuilder {
11520            _state: PhantomData,
11521            _fields: (None,),
11522            _type: PhantomData,
11523        }
11524    }
11525}
11526
11527impl<St, S: BosStr> SystemMessageDataLockConvoBuilder<St, S>
11528where
11529    St: system_message_data_lock_convo_state::State,
11530    St::LockedBy: system_message_data_lock_convo_state::IsUnset,
11531{
11532    /// Set the `lockedBy` field (required)
11533    pub fn locked_by(
11534        mut self,
11535        value: impl Into<convo::SystemMessageReferredUser<S>>,
11536    ) -> SystemMessageDataLockConvoBuilder<system_message_data_lock_convo_state::SetLockedBy<St>, S>
11537    {
11538        self._fields.0 = Option::Some(value.into());
11539        SystemMessageDataLockConvoBuilder {
11540            _state: PhantomData,
11541            _fields: self._fields,
11542            _type: PhantomData,
11543        }
11544    }
11545}
11546
11547impl<St, S: BosStr> SystemMessageDataLockConvoBuilder<St, S>
11548where
11549    St: system_message_data_lock_convo_state::State,
11550    St::LockedBy: system_message_data_lock_convo_state::IsSet,
11551{
11552    /// Build the final struct.
11553    pub fn build(self) -> SystemMessageDataLockConvo<S> {
11554        SystemMessageDataLockConvo {
11555            locked_by: self._fields.0.unwrap(),
11556            extra_data: Default::default(),
11557        }
11558    }
11559    /// Build the final struct with custom extra_data.
11560    pub fn build_with_data(
11561        self,
11562        extra_data: BTreeMap<SmolStr, Data<S>>,
11563    ) -> SystemMessageDataLockConvo<S> {
11564        SystemMessageDataLockConvo {
11565            locked_by: self._fields.0.unwrap(),
11566            extra_data: Some(extra_data),
11567        }
11568    }
11569}
11570
11571pub mod system_message_data_lock_convo_permanently_state {
11572
11573    pub use crate::builder_types::{IsSet, IsUnset, Set, Unset};
11574    #[allow(unused)]
11575    use ::core::marker::PhantomData;
11576    mod sealed {
11577        pub trait Sealed {}
11578    }
11579    /// State trait tracking which required fields have been set
11580    pub trait State: sealed::Sealed {
11581        type LockedBy;
11582    }
11583    /// Empty state - all required fields are unset
11584    pub struct Empty(());
11585    impl sealed::Sealed for Empty {}
11586    impl State for Empty {
11587        type LockedBy = Unset;
11588    }
11589    ///State transition - sets the `locked_by` field to Set
11590    pub struct SetLockedBy<St: State = Empty>(PhantomData<fn() -> St>);
11591    impl<St: State> sealed::Sealed for SetLockedBy<St> {}
11592    impl<St: State> State for SetLockedBy<St> {
11593        type LockedBy = Set<members::locked_by>;
11594    }
11595    /// Marker types for field names
11596    #[allow(non_camel_case_types)]
11597    pub mod members {
11598        ///Marker type for the `locked_by` field
11599        pub struct locked_by(());
11600    }
11601}
11602
11603/// Builder for constructing an instance of this type.
11604pub struct SystemMessageDataLockConvoPermanentlyBuilder<
11605    St: system_message_data_lock_convo_permanently_state::State,
11606    S: BosStr = DefaultStr,
11607> {
11608    _state: PhantomData<fn() -> St>,
11609    _fields: (Option<convo::SystemMessageReferredUser<S>>,),
11610    _type: PhantomData<fn() -> S>,
11611}
11612
11613impl SystemMessageDataLockConvoPermanently<DefaultStr> {
11614    /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed
11615    pub fn new() -> SystemMessageDataLockConvoPermanentlyBuilder<
11616        system_message_data_lock_convo_permanently_state::Empty,
11617        DefaultStr,
11618    > {
11619        SystemMessageDataLockConvoPermanentlyBuilder::new()
11620    }
11621}
11622
11623impl<S: BosStr> SystemMessageDataLockConvoPermanently<S> {
11624    /// Create a new builder for this type
11625    pub fn builder() -> SystemMessageDataLockConvoPermanentlyBuilder<
11626        system_message_data_lock_convo_permanently_state::Empty,
11627        S,
11628    > {
11629        SystemMessageDataLockConvoPermanentlyBuilder::builder()
11630    }
11631}
11632
11633impl
11634    SystemMessageDataLockConvoPermanentlyBuilder<
11635        system_message_data_lock_convo_permanently_state::Empty,
11636        DefaultStr,
11637    >
11638{
11639    /// Create a new builder with all fields unset, using the default string type, if needed
11640    pub fn new() -> Self {
11641        SystemMessageDataLockConvoPermanentlyBuilder {
11642            _state: PhantomData,
11643            _fields: (None,),
11644            _type: PhantomData,
11645        }
11646    }
11647}
11648
11649impl<S: BosStr>
11650    SystemMessageDataLockConvoPermanentlyBuilder<
11651        system_message_data_lock_convo_permanently_state::Empty,
11652        S,
11653    >
11654{
11655    /// Create a new builder with all fields unset
11656    pub fn builder() -> Self {
11657        SystemMessageDataLockConvoPermanentlyBuilder {
11658            _state: PhantomData,
11659            _fields: (None,),
11660            _type: PhantomData,
11661        }
11662    }
11663}
11664
11665impl<St, S: BosStr> SystemMessageDataLockConvoPermanentlyBuilder<St, S>
11666where
11667    St: system_message_data_lock_convo_permanently_state::State,
11668    St::LockedBy: system_message_data_lock_convo_permanently_state::IsUnset,
11669{
11670    /// Set the `lockedBy` field (required)
11671    pub fn locked_by(
11672        mut self,
11673        value: impl Into<convo::SystemMessageReferredUser<S>>,
11674    ) -> SystemMessageDataLockConvoPermanentlyBuilder<
11675        system_message_data_lock_convo_permanently_state::SetLockedBy<St>,
11676        S,
11677    > {
11678        self._fields.0 = Option::Some(value.into());
11679        SystemMessageDataLockConvoPermanentlyBuilder {
11680            _state: PhantomData,
11681            _fields: self._fields,
11682            _type: PhantomData,
11683        }
11684    }
11685}
11686
11687impl<St, S: BosStr> SystemMessageDataLockConvoPermanentlyBuilder<St, S>
11688where
11689    St: system_message_data_lock_convo_permanently_state::State,
11690    St::LockedBy: system_message_data_lock_convo_permanently_state::IsSet,
11691{
11692    /// Build the final struct.
11693    pub fn build(self) -> SystemMessageDataLockConvoPermanently<S> {
11694        SystemMessageDataLockConvoPermanently {
11695            locked_by: self._fields.0.unwrap(),
11696            extra_data: Default::default(),
11697        }
11698    }
11699    /// Build the final struct with custom extra_data.
11700    pub fn build_with_data(
11701        self,
11702        extra_data: BTreeMap<SmolStr, Data<S>>,
11703    ) -> SystemMessageDataLockConvoPermanently<S> {
11704        SystemMessageDataLockConvoPermanently {
11705            locked_by: self._fields.0.unwrap(),
11706            extra_data: Some(extra_data),
11707        }
11708    }
11709}
11710
11711pub mod system_message_data_member_join_state {
11712
11713    pub use crate::builder_types::{IsSet, IsUnset, Set, Unset};
11714    #[allow(unused)]
11715    use ::core::marker::PhantomData;
11716    mod sealed {
11717        pub trait Sealed {}
11718    }
11719    /// State trait tracking which required fields have been set
11720    pub trait State: sealed::Sealed {
11721        type Member;
11722        type Role;
11723    }
11724    /// Empty state - all required fields are unset
11725    pub struct Empty(());
11726    impl sealed::Sealed for Empty {}
11727    impl State for Empty {
11728        type Member = Unset;
11729        type Role = Unset;
11730    }
11731    ///State transition - sets the `member` field to Set
11732    pub struct SetMember<St: State = Empty>(PhantomData<fn() -> St>);
11733    impl<St: State> sealed::Sealed for SetMember<St> {}
11734    impl<St: State> State for SetMember<St> {
11735        type Member = Set<members::member>;
11736        type Role = St::Role;
11737    }
11738    ///State transition - sets the `role` field to Set
11739    pub struct SetRole<St: State = Empty>(PhantomData<fn() -> St>);
11740    impl<St: State> sealed::Sealed for SetRole<St> {}
11741    impl<St: State> State for SetRole<St> {
11742        type Member = St::Member;
11743        type Role = Set<members::role>;
11744    }
11745    /// Marker types for field names
11746    #[allow(non_camel_case_types)]
11747    pub mod members {
11748        ///Marker type for the `member` field
11749        pub struct member(());
11750        ///Marker type for the `role` field
11751        pub struct role(());
11752    }
11753}
11754
11755/// Builder for constructing an instance of this type.
11756pub struct SystemMessageDataMemberJoinBuilder<
11757    St: system_message_data_member_join_state::State,
11758    S: BosStr = DefaultStr,
11759> {
11760    _state: PhantomData<fn() -> St>,
11761    _fields: (
11762        Option<convo::SystemMessageReferredUser<S>>,
11763        Option<convo::SystemMessageReferredUser<S>>,
11764        Option<MemberRole<S>>,
11765    ),
11766    _type: PhantomData<fn() -> S>,
11767}
11768
11769impl SystemMessageDataMemberJoin<DefaultStr> {
11770    /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed
11771    pub fn new()
11772    -> SystemMessageDataMemberJoinBuilder<system_message_data_member_join_state::Empty, DefaultStr>
11773    {
11774        SystemMessageDataMemberJoinBuilder::new()
11775    }
11776}
11777
11778impl<S: BosStr> SystemMessageDataMemberJoin<S> {
11779    /// Create a new builder for this type
11780    pub fn builder()
11781    -> SystemMessageDataMemberJoinBuilder<system_message_data_member_join_state::Empty, S> {
11782        SystemMessageDataMemberJoinBuilder::builder()
11783    }
11784}
11785
11786impl SystemMessageDataMemberJoinBuilder<system_message_data_member_join_state::Empty, DefaultStr> {
11787    /// Create a new builder with all fields unset, using the default string type, if needed
11788    pub fn new() -> Self {
11789        SystemMessageDataMemberJoinBuilder {
11790            _state: PhantomData,
11791            _fields: (None, None, None),
11792            _type: PhantomData,
11793        }
11794    }
11795}
11796
11797impl<S: BosStr>
11798    SystemMessageDataMemberJoinBuilder<system_message_data_member_join_state::Empty, S>
11799{
11800    /// Create a new builder with all fields unset
11801    pub fn builder() -> Self {
11802        SystemMessageDataMemberJoinBuilder {
11803            _state: PhantomData,
11804            _fields: (None, None, None),
11805            _type: PhantomData,
11806        }
11807    }
11808}
11809
11810impl<St: system_message_data_member_join_state::State, S: BosStr>
11811    SystemMessageDataMemberJoinBuilder<St, S>
11812{
11813    /// Set the `approvedBy` field (optional)
11814    pub fn approved_by(
11815        mut self,
11816        value: impl Into<Option<convo::SystemMessageReferredUser<S>>>,
11817    ) -> Self {
11818        self._fields.0 = value.into();
11819        self
11820    }
11821    /// Set the `approvedBy` field to an Option value (optional)
11822    pub fn maybe_approved_by(mut self, value: Option<convo::SystemMessageReferredUser<S>>) -> Self {
11823        self._fields.0 = value;
11824        self
11825    }
11826}
11827
11828impl<St, S: BosStr> SystemMessageDataMemberJoinBuilder<St, S>
11829where
11830    St: system_message_data_member_join_state::State,
11831    St::Member: system_message_data_member_join_state::IsUnset,
11832{
11833    /// Set the `member` field (required)
11834    pub fn member(
11835        mut self,
11836        value: impl Into<convo::SystemMessageReferredUser<S>>,
11837    ) -> SystemMessageDataMemberJoinBuilder<system_message_data_member_join_state::SetMember<St>, S>
11838    {
11839        self._fields.1 = Option::Some(value.into());
11840        SystemMessageDataMemberJoinBuilder {
11841            _state: PhantomData,
11842            _fields: self._fields,
11843            _type: PhantomData,
11844        }
11845    }
11846}
11847
11848impl<St, S: BosStr> SystemMessageDataMemberJoinBuilder<St, S>
11849where
11850    St: system_message_data_member_join_state::State,
11851    St::Role: system_message_data_member_join_state::IsUnset,
11852{
11853    /// Set the `role` field (required)
11854    pub fn role(
11855        mut self,
11856        value: impl Into<MemberRole<S>>,
11857    ) -> SystemMessageDataMemberJoinBuilder<system_message_data_member_join_state::SetRole<St>, S>
11858    {
11859        self._fields.2 = Option::Some(value.into());
11860        SystemMessageDataMemberJoinBuilder {
11861            _state: PhantomData,
11862            _fields: self._fields,
11863            _type: PhantomData,
11864        }
11865    }
11866}
11867
11868impl<St, S: BosStr> SystemMessageDataMemberJoinBuilder<St, S>
11869where
11870    St: system_message_data_member_join_state::State,
11871    St::Member: system_message_data_member_join_state::IsSet,
11872    St::Role: system_message_data_member_join_state::IsSet,
11873{
11874    /// Build the final struct.
11875    pub fn build(self) -> SystemMessageDataMemberJoin<S> {
11876        SystemMessageDataMemberJoin {
11877            approved_by: self._fields.0,
11878            member: self._fields.1.unwrap(),
11879            role: self._fields.2.unwrap(),
11880            extra_data: Default::default(),
11881        }
11882    }
11883    /// Build the final struct with custom extra_data.
11884    pub fn build_with_data(
11885        self,
11886        extra_data: BTreeMap<SmolStr, Data<S>>,
11887    ) -> SystemMessageDataMemberJoin<S> {
11888        SystemMessageDataMemberJoin {
11889            approved_by: self._fields.0,
11890            member: self._fields.1.unwrap(),
11891            role: self._fields.2.unwrap(),
11892            extra_data: Some(extra_data),
11893        }
11894    }
11895}
11896
11897pub mod system_message_data_member_leave_state {
11898
11899    pub use crate::builder_types::{IsSet, IsUnset, Set, Unset};
11900    #[allow(unused)]
11901    use ::core::marker::PhantomData;
11902    mod sealed {
11903        pub trait Sealed {}
11904    }
11905    /// State trait tracking which required fields have been set
11906    pub trait State: sealed::Sealed {
11907        type Member;
11908    }
11909    /// Empty state - all required fields are unset
11910    pub struct Empty(());
11911    impl sealed::Sealed for Empty {}
11912    impl State for Empty {
11913        type Member = Unset;
11914    }
11915    ///State transition - sets the `member` field to Set
11916    pub struct SetMember<St: State = Empty>(PhantomData<fn() -> St>);
11917    impl<St: State> sealed::Sealed for SetMember<St> {}
11918    impl<St: State> State for SetMember<St> {
11919        type Member = Set<members::member>;
11920    }
11921    /// Marker types for field names
11922    #[allow(non_camel_case_types)]
11923    pub mod members {
11924        ///Marker type for the `member` field
11925        pub struct member(());
11926    }
11927}
11928
11929/// Builder for constructing an instance of this type.
11930pub struct SystemMessageDataMemberLeaveBuilder<
11931    St: system_message_data_member_leave_state::State,
11932    S: BosStr = DefaultStr,
11933> {
11934    _state: PhantomData<fn() -> St>,
11935    _fields: (Option<convo::SystemMessageReferredUser<S>>,),
11936    _type: PhantomData<fn() -> S>,
11937}
11938
11939impl SystemMessageDataMemberLeave<DefaultStr> {
11940    /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed
11941    pub fn new() -> SystemMessageDataMemberLeaveBuilder<
11942        system_message_data_member_leave_state::Empty,
11943        DefaultStr,
11944    > {
11945        SystemMessageDataMemberLeaveBuilder::new()
11946    }
11947}
11948
11949impl<S: BosStr> SystemMessageDataMemberLeave<S> {
11950    /// Create a new builder for this type
11951    pub fn builder()
11952    -> SystemMessageDataMemberLeaveBuilder<system_message_data_member_leave_state::Empty, S> {
11953        SystemMessageDataMemberLeaveBuilder::builder()
11954    }
11955}
11956
11957impl
11958    SystemMessageDataMemberLeaveBuilder<system_message_data_member_leave_state::Empty, DefaultStr>
11959{
11960    /// Create a new builder with all fields unset, using the default string type, if needed
11961    pub fn new() -> Self {
11962        SystemMessageDataMemberLeaveBuilder {
11963            _state: PhantomData,
11964            _fields: (None,),
11965            _type: PhantomData,
11966        }
11967    }
11968}
11969
11970impl<S: BosStr>
11971    SystemMessageDataMemberLeaveBuilder<system_message_data_member_leave_state::Empty, S>
11972{
11973    /// Create a new builder with all fields unset
11974    pub fn builder() -> Self {
11975        SystemMessageDataMemberLeaveBuilder {
11976            _state: PhantomData,
11977            _fields: (None,),
11978            _type: PhantomData,
11979        }
11980    }
11981}
11982
11983impl<St, S: BosStr> SystemMessageDataMemberLeaveBuilder<St, S>
11984where
11985    St: system_message_data_member_leave_state::State,
11986    St::Member: system_message_data_member_leave_state::IsUnset,
11987{
11988    /// Set the `member` field (required)
11989    pub fn member(
11990        mut self,
11991        value: impl Into<convo::SystemMessageReferredUser<S>>,
11992    ) -> SystemMessageDataMemberLeaveBuilder<system_message_data_member_leave_state::SetMember<St>, S>
11993    {
11994        self._fields.0 = Option::Some(value.into());
11995        SystemMessageDataMemberLeaveBuilder {
11996            _state: PhantomData,
11997            _fields: self._fields,
11998            _type: PhantomData,
11999        }
12000    }
12001}
12002
12003impl<St, S: BosStr> SystemMessageDataMemberLeaveBuilder<St, S>
12004where
12005    St: system_message_data_member_leave_state::State,
12006    St::Member: system_message_data_member_leave_state::IsSet,
12007{
12008    /// Build the final struct.
12009    pub fn build(self) -> SystemMessageDataMemberLeave<S> {
12010        SystemMessageDataMemberLeave {
12011            member: self._fields.0.unwrap(),
12012            extra_data: Default::default(),
12013        }
12014    }
12015    /// Build the final struct with custom extra_data.
12016    pub fn build_with_data(
12017        self,
12018        extra_data: BTreeMap<SmolStr, Data<S>>,
12019    ) -> SystemMessageDataMemberLeave<S> {
12020        SystemMessageDataMemberLeave {
12021            member: self._fields.0.unwrap(),
12022            extra_data: Some(extra_data),
12023        }
12024    }
12025}
12026
12027pub mod system_message_data_remove_member_state {
12028
12029    pub use crate::builder_types::{IsSet, IsUnset, Set, Unset};
12030    #[allow(unused)]
12031    use ::core::marker::PhantomData;
12032    mod sealed {
12033        pub trait Sealed {}
12034    }
12035    /// State trait tracking which required fields have been set
12036    pub trait State: sealed::Sealed {
12037        type Member;
12038        type RemovedBy;
12039    }
12040    /// Empty state - all required fields are unset
12041    pub struct Empty(());
12042    impl sealed::Sealed for Empty {}
12043    impl State for Empty {
12044        type Member = Unset;
12045        type RemovedBy = Unset;
12046    }
12047    ///State transition - sets the `member` field to Set
12048    pub struct SetMember<St: State = Empty>(PhantomData<fn() -> St>);
12049    impl<St: State> sealed::Sealed for SetMember<St> {}
12050    impl<St: State> State for SetMember<St> {
12051        type Member = Set<members::member>;
12052        type RemovedBy = St::RemovedBy;
12053    }
12054    ///State transition - sets the `removed_by` field to Set
12055    pub struct SetRemovedBy<St: State = Empty>(PhantomData<fn() -> St>);
12056    impl<St: State> sealed::Sealed for SetRemovedBy<St> {}
12057    impl<St: State> State for SetRemovedBy<St> {
12058        type Member = St::Member;
12059        type RemovedBy = Set<members::removed_by>;
12060    }
12061    /// Marker types for field names
12062    #[allow(non_camel_case_types)]
12063    pub mod members {
12064        ///Marker type for the `member` field
12065        pub struct member(());
12066        ///Marker type for the `removed_by` field
12067        pub struct removed_by(());
12068    }
12069}
12070
12071/// Builder for constructing an instance of this type.
12072pub struct SystemMessageDataRemoveMemberBuilder<
12073    St: system_message_data_remove_member_state::State,
12074    S: BosStr = DefaultStr,
12075> {
12076    _state: PhantomData<fn() -> St>,
12077    _fields: (
12078        Option<convo::SystemMessageReferredUser<S>>,
12079        Option<convo::SystemMessageReferredUser<S>>,
12080    ),
12081    _type: PhantomData<fn() -> S>,
12082}
12083
12084impl SystemMessageDataRemoveMember<DefaultStr> {
12085    /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed
12086    pub fn new() -> SystemMessageDataRemoveMemberBuilder<
12087        system_message_data_remove_member_state::Empty,
12088        DefaultStr,
12089    > {
12090        SystemMessageDataRemoveMemberBuilder::new()
12091    }
12092}
12093
12094impl<S: BosStr> SystemMessageDataRemoveMember<S> {
12095    /// Create a new builder for this type
12096    pub fn builder()
12097    -> SystemMessageDataRemoveMemberBuilder<system_message_data_remove_member_state::Empty, S> {
12098        SystemMessageDataRemoveMemberBuilder::builder()
12099    }
12100}
12101
12102impl
12103    SystemMessageDataRemoveMemberBuilder<system_message_data_remove_member_state::Empty, DefaultStr>
12104{
12105    /// Create a new builder with all fields unset, using the default string type, if needed
12106    pub fn new() -> Self {
12107        SystemMessageDataRemoveMemberBuilder {
12108            _state: PhantomData,
12109            _fields: (None, None),
12110            _type: PhantomData,
12111        }
12112    }
12113}
12114
12115impl<S: BosStr>
12116    SystemMessageDataRemoveMemberBuilder<system_message_data_remove_member_state::Empty, S>
12117{
12118    /// Create a new builder with all fields unset
12119    pub fn builder() -> Self {
12120        SystemMessageDataRemoveMemberBuilder {
12121            _state: PhantomData,
12122            _fields: (None, None),
12123            _type: PhantomData,
12124        }
12125    }
12126}
12127
12128impl<St, S: BosStr> SystemMessageDataRemoveMemberBuilder<St, S>
12129where
12130    St: system_message_data_remove_member_state::State,
12131    St::Member: system_message_data_remove_member_state::IsUnset,
12132{
12133    /// Set the `member` field (required)
12134    pub fn member(
12135        mut self,
12136        value: impl Into<convo::SystemMessageReferredUser<S>>,
12137    ) -> SystemMessageDataRemoveMemberBuilder<
12138        system_message_data_remove_member_state::SetMember<St>,
12139        S,
12140    > {
12141        self._fields.0 = Option::Some(value.into());
12142        SystemMessageDataRemoveMemberBuilder {
12143            _state: PhantomData,
12144            _fields: self._fields,
12145            _type: PhantomData,
12146        }
12147    }
12148}
12149
12150impl<St, S: BosStr> SystemMessageDataRemoveMemberBuilder<St, S>
12151where
12152    St: system_message_data_remove_member_state::State,
12153    St::RemovedBy: system_message_data_remove_member_state::IsUnset,
12154{
12155    /// Set the `removedBy` field (required)
12156    pub fn removed_by(
12157        mut self,
12158        value: impl Into<convo::SystemMessageReferredUser<S>>,
12159    ) -> SystemMessageDataRemoveMemberBuilder<
12160        system_message_data_remove_member_state::SetRemovedBy<St>,
12161        S,
12162    > {
12163        self._fields.1 = Option::Some(value.into());
12164        SystemMessageDataRemoveMemberBuilder {
12165            _state: PhantomData,
12166            _fields: self._fields,
12167            _type: PhantomData,
12168        }
12169    }
12170}
12171
12172impl<St, S: BosStr> SystemMessageDataRemoveMemberBuilder<St, S>
12173where
12174    St: system_message_data_remove_member_state::State,
12175    St::Member: system_message_data_remove_member_state::IsSet,
12176    St::RemovedBy: system_message_data_remove_member_state::IsSet,
12177{
12178    /// Build the final struct.
12179    pub fn build(self) -> SystemMessageDataRemoveMember<S> {
12180        SystemMessageDataRemoveMember {
12181            member: self._fields.0.unwrap(),
12182            removed_by: self._fields.1.unwrap(),
12183            extra_data: Default::default(),
12184        }
12185    }
12186    /// Build the final struct with custom extra_data.
12187    pub fn build_with_data(
12188        self,
12189        extra_data: BTreeMap<SmolStr, Data<S>>,
12190    ) -> SystemMessageDataRemoveMember<S> {
12191        SystemMessageDataRemoveMember {
12192            member: self._fields.0.unwrap(),
12193            removed_by: self._fields.1.unwrap(),
12194            extra_data: Some(extra_data),
12195        }
12196    }
12197}
12198
12199pub mod system_message_data_unlock_convo_state {
12200
12201    pub use crate::builder_types::{IsSet, IsUnset, Set, Unset};
12202    #[allow(unused)]
12203    use ::core::marker::PhantomData;
12204    mod sealed {
12205        pub trait Sealed {}
12206    }
12207    /// State trait tracking which required fields have been set
12208    pub trait State: sealed::Sealed {
12209        type UnlockedBy;
12210    }
12211    /// Empty state - all required fields are unset
12212    pub struct Empty(());
12213    impl sealed::Sealed for Empty {}
12214    impl State for Empty {
12215        type UnlockedBy = Unset;
12216    }
12217    ///State transition - sets the `unlocked_by` field to Set
12218    pub struct SetUnlockedBy<St: State = Empty>(PhantomData<fn() -> St>);
12219    impl<St: State> sealed::Sealed for SetUnlockedBy<St> {}
12220    impl<St: State> State for SetUnlockedBy<St> {
12221        type UnlockedBy = Set<members::unlocked_by>;
12222    }
12223    /// Marker types for field names
12224    #[allow(non_camel_case_types)]
12225    pub mod members {
12226        ///Marker type for the `unlocked_by` field
12227        pub struct unlocked_by(());
12228    }
12229}
12230
12231/// Builder for constructing an instance of this type.
12232pub struct SystemMessageDataUnlockConvoBuilder<
12233    St: system_message_data_unlock_convo_state::State,
12234    S: BosStr = DefaultStr,
12235> {
12236    _state: PhantomData<fn() -> St>,
12237    _fields: (Option<convo::SystemMessageReferredUser<S>>,),
12238    _type: PhantomData<fn() -> S>,
12239}
12240
12241impl SystemMessageDataUnlockConvo<DefaultStr> {
12242    /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed
12243    pub fn new() -> SystemMessageDataUnlockConvoBuilder<
12244        system_message_data_unlock_convo_state::Empty,
12245        DefaultStr,
12246    > {
12247        SystemMessageDataUnlockConvoBuilder::new()
12248    }
12249}
12250
12251impl<S: BosStr> SystemMessageDataUnlockConvo<S> {
12252    /// Create a new builder for this type
12253    pub fn builder()
12254    -> SystemMessageDataUnlockConvoBuilder<system_message_data_unlock_convo_state::Empty, S> {
12255        SystemMessageDataUnlockConvoBuilder::builder()
12256    }
12257}
12258
12259impl
12260    SystemMessageDataUnlockConvoBuilder<system_message_data_unlock_convo_state::Empty, DefaultStr>
12261{
12262    /// Create a new builder with all fields unset, using the default string type, if needed
12263    pub fn new() -> Self {
12264        SystemMessageDataUnlockConvoBuilder {
12265            _state: PhantomData,
12266            _fields: (None,),
12267            _type: PhantomData,
12268        }
12269    }
12270}
12271
12272impl<S: BosStr>
12273    SystemMessageDataUnlockConvoBuilder<system_message_data_unlock_convo_state::Empty, S>
12274{
12275    /// Create a new builder with all fields unset
12276    pub fn builder() -> Self {
12277        SystemMessageDataUnlockConvoBuilder {
12278            _state: PhantomData,
12279            _fields: (None,),
12280            _type: PhantomData,
12281        }
12282    }
12283}
12284
12285impl<St, S: BosStr> SystemMessageDataUnlockConvoBuilder<St, S>
12286where
12287    St: system_message_data_unlock_convo_state::State,
12288    St::UnlockedBy: system_message_data_unlock_convo_state::IsUnset,
12289{
12290    /// Set the `unlockedBy` field (required)
12291    pub fn unlocked_by(
12292        mut self,
12293        value: impl Into<convo::SystemMessageReferredUser<S>>,
12294    ) -> SystemMessageDataUnlockConvoBuilder<
12295        system_message_data_unlock_convo_state::SetUnlockedBy<St>,
12296        S,
12297    > {
12298        self._fields.0 = Option::Some(value.into());
12299        SystemMessageDataUnlockConvoBuilder {
12300            _state: PhantomData,
12301            _fields: self._fields,
12302            _type: PhantomData,
12303        }
12304    }
12305}
12306
12307impl<St, S: BosStr> SystemMessageDataUnlockConvoBuilder<St, S>
12308where
12309    St: system_message_data_unlock_convo_state::State,
12310    St::UnlockedBy: system_message_data_unlock_convo_state::IsSet,
12311{
12312    /// Build the final struct.
12313    pub fn build(self) -> SystemMessageDataUnlockConvo<S> {
12314        SystemMessageDataUnlockConvo {
12315            unlocked_by: self._fields.0.unwrap(),
12316            extra_data: Default::default(),
12317        }
12318    }
12319    /// Build the final struct with custom extra_data.
12320    pub fn build_with_data(
12321        self,
12322        extra_data: BTreeMap<SmolStr, Data<S>>,
12323    ) -> SystemMessageDataUnlockConvo<S> {
12324        SystemMessageDataUnlockConvo {
12325            unlocked_by: self._fields.0.unwrap(),
12326            extra_data: Some(extra_data),
12327        }
12328    }
12329}
12330
12331pub mod system_message_referred_user_state {
12332
12333    pub use crate::builder_types::{IsSet, IsUnset, Set, Unset};
12334    #[allow(unused)]
12335    use ::core::marker::PhantomData;
12336    mod sealed {
12337        pub trait Sealed {}
12338    }
12339    /// State trait tracking which required fields have been set
12340    pub trait State: sealed::Sealed {
12341        type Did;
12342    }
12343    /// Empty state - all required fields are unset
12344    pub struct Empty(());
12345    impl sealed::Sealed for Empty {}
12346    impl State for Empty {
12347        type Did = Unset;
12348    }
12349    ///State transition - sets the `did` field to Set
12350    pub struct SetDid<St: State = Empty>(PhantomData<fn() -> St>);
12351    impl<St: State> sealed::Sealed for SetDid<St> {}
12352    impl<St: State> State for SetDid<St> {
12353        type Did = Set<members::did>;
12354    }
12355    /// Marker types for field names
12356    #[allow(non_camel_case_types)]
12357    pub mod members {
12358        ///Marker type for the `did` field
12359        pub struct did(());
12360    }
12361}
12362
12363/// Builder for constructing an instance of this type.
12364pub struct SystemMessageReferredUserBuilder<
12365    St: system_message_referred_user_state::State,
12366    S: BosStr = DefaultStr,
12367> {
12368    _state: PhantomData<fn() -> St>,
12369    _fields: (Option<Did<S>>,),
12370    _type: PhantomData<fn() -> S>,
12371}
12372
12373impl SystemMessageReferredUser<DefaultStr> {
12374    /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed
12375    pub fn new()
12376    -> SystemMessageReferredUserBuilder<system_message_referred_user_state::Empty, DefaultStr> {
12377        SystemMessageReferredUserBuilder::new()
12378    }
12379}
12380
12381impl<S: BosStr> SystemMessageReferredUser<S> {
12382    /// Create a new builder for this type
12383    pub fn builder()
12384    -> SystemMessageReferredUserBuilder<system_message_referred_user_state::Empty, S> {
12385        SystemMessageReferredUserBuilder::builder()
12386    }
12387}
12388
12389impl SystemMessageReferredUserBuilder<system_message_referred_user_state::Empty, DefaultStr> {
12390    /// Create a new builder with all fields unset, using the default string type, if needed
12391    pub fn new() -> Self {
12392        SystemMessageReferredUserBuilder {
12393            _state: PhantomData,
12394            _fields: (None,),
12395            _type: PhantomData,
12396        }
12397    }
12398}
12399
12400impl<S: BosStr> SystemMessageReferredUserBuilder<system_message_referred_user_state::Empty, S> {
12401    /// Create a new builder with all fields unset
12402    pub fn builder() -> Self {
12403        SystemMessageReferredUserBuilder {
12404            _state: PhantomData,
12405            _fields: (None,),
12406            _type: PhantomData,
12407        }
12408    }
12409}
12410
12411impl<St, S: BosStr> SystemMessageReferredUserBuilder<St, S>
12412where
12413    St: system_message_referred_user_state::State,
12414    St::Did: system_message_referred_user_state::IsUnset,
12415{
12416    /// Set the `did` field (required)
12417    pub fn did(
12418        mut self,
12419        value: impl Into<Did<S>>,
12420    ) -> SystemMessageReferredUserBuilder<system_message_referred_user_state::SetDid<St>, S> {
12421        self._fields.0 = Option::Some(value.into());
12422        SystemMessageReferredUserBuilder {
12423            _state: PhantomData,
12424            _fields: self._fields,
12425            _type: PhantomData,
12426        }
12427    }
12428}
12429
12430impl<St, S: BosStr> SystemMessageReferredUserBuilder<St, S>
12431where
12432    St: system_message_referred_user_state::State,
12433    St::Did: system_message_referred_user_state::IsSet,
12434{
12435    /// Build the final struct.
12436    pub fn build(self) -> SystemMessageReferredUser<S> {
12437        SystemMessageReferredUser {
12438            did: self._fields.0.unwrap(),
12439            extra_data: Default::default(),
12440        }
12441    }
12442    /// Build the final struct with custom extra_data.
12443    pub fn build_with_data(
12444        self,
12445        extra_data: BTreeMap<SmolStr, Data<S>>,
12446    ) -> SystemMessageReferredUser<S> {
12447        SystemMessageReferredUser {
12448            did: self._fields.0.unwrap(),
12449            extra_data: Some(extra_data),
12450        }
12451    }
12452}
12453
12454pub mod system_message_view_state {
12455
12456    pub use crate::builder_types::{IsSet, IsUnset, Set, Unset};
12457    #[allow(unused)]
12458    use ::core::marker::PhantomData;
12459    mod sealed {
12460        pub trait Sealed {}
12461    }
12462    /// State trait tracking which required fields have been set
12463    pub trait State: sealed::Sealed {
12464        type Data;
12465        type Id;
12466        type Rev;
12467        type SentAt;
12468    }
12469    /// Empty state - all required fields are unset
12470    pub struct Empty(());
12471    impl sealed::Sealed for Empty {}
12472    impl State for Empty {
12473        type Data = Unset;
12474        type Id = Unset;
12475        type Rev = Unset;
12476        type SentAt = Unset;
12477    }
12478    ///State transition - sets the `data` field to Set
12479    pub struct SetData<St: State = Empty>(PhantomData<fn() -> St>);
12480    impl<St: State> sealed::Sealed for SetData<St> {}
12481    impl<St: State> State for SetData<St> {
12482        type Data = Set<members::data>;
12483        type Id = St::Id;
12484        type Rev = St::Rev;
12485        type SentAt = St::SentAt;
12486    }
12487    ///State transition - sets the `id` field to Set
12488    pub struct SetId<St: State = Empty>(PhantomData<fn() -> St>);
12489    impl<St: State> sealed::Sealed for SetId<St> {}
12490    impl<St: State> State for SetId<St> {
12491        type Data = St::Data;
12492        type Id = Set<members::id>;
12493        type Rev = St::Rev;
12494        type SentAt = St::SentAt;
12495    }
12496    ///State transition - sets the `rev` field to Set
12497    pub struct SetRev<St: State = Empty>(PhantomData<fn() -> St>);
12498    impl<St: State> sealed::Sealed for SetRev<St> {}
12499    impl<St: State> State for SetRev<St> {
12500        type Data = St::Data;
12501        type Id = St::Id;
12502        type Rev = Set<members::rev>;
12503        type SentAt = St::SentAt;
12504    }
12505    ///State transition - sets the `sent_at` field to Set
12506    pub struct SetSentAt<St: State = Empty>(PhantomData<fn() -> St>);
12507    impl<St: State> sealed::Sealed for SetSentAt<St> {}
12508    impl<St: State> State for SetSentAt<St> {
12509        type Data = St::Data;
12510        type Id = St::Id;
12511        type Rev = St::Rev;
12512        type SentAt = Set<members::sent_at>;
12513    }
12514    /// Marker types for field names
12515    #[allow(non_camel_case_types)]
12516    pub mod members {
12517        ///Marker type for the `data` field
12518        pub struct data(());
12519        ///Marker type for the `id` field
12520        pub struct id(());
12521        ///Marker type for the `rev` field
12522        pub struct rev(());
12523        ///Marker type for the `sent_at` field
12524        pub struct sent_at(());
12525    }
12526}
12527
12528/// Builder for constructing an instance of this type.
12529pub struct SystemMessageViewBuilder<St: system_message_view_state::State, S: BosStr = DefaultStr> {
12530    _state: PhantomData<fn() -> St>,
12531    _fields: (
12532        Option<SystemMessageViewData<S>>,
12533        Option<S>,
12534        Option<S>,
12535        Option<Datetime>,
12536    ),
12537    _type: PhantomData<fn() -> S>,
12538}
12539
12540impl SystemMessageView<DefaultStr> {
12541    /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed
12542    pub fn new() -> SystemMessageViewBuilder<system_message_view_state::Empty, DefaultStr> {
12543        SystemMessageViewBuilder::new()
12544    }
12545}
12546
12547impl<S: BosStr> SystemMessageView<S> {
12548    /// Create a new builder for this type
12549    pub fn builder() -> SystemMessageViewBuilder<system_message_view_state::Empty, S> {
12550        SystemMessageViewBuilder::builder()
12551    }
12552}
12553
12554impl SystemMessageViewBuilder<system_message_view_state::Empty, DefaultStr> {
12555    /// Create a new builder with all fields unset, using the default string type, if needed
12556    pub fn new() -> Self {
12557        SystemMessageViewBuilder {
12558            _state: PhantomData,
12559            _fields: (None, None, None, None),
12560            _type: PhantomData,
12561        }
12562    }
12563}
12564
12565impl<S: BosStr> SystemMessageViewBuilder<system_message_view_state::Empty, S> {
12566    /// Create a new builder with all fields unset
12567    pub fn builder() -> Self {
12568        SystemMessageViewBuilder {
12569            _state: PhantomData,
12570            _fields: (None, None, None, None),
12571            _type: PhantomData,
12572        }
12573    }
12574}
12575
12576impl<St, S: BosStr> SystemMessageViewBuilder<St, S>
12577where
12578    St: system_message_view_state::State,
12579    St::Data: system_message_view_state::IsUnset,
12580{
12581    /// Set the `data` field (required)
12582    pub fn data(
12583        mut self,
12584        value: impl Into<SystemMessageViewData<S>>,
12585    ) -> SystemMessageViewBuilder<system_message_view_state::SetData<St>, S> {
12586        self._fields.0 = Option::Some(value.into());
12587        SystemMessageViewBuilder {
12588            _state: PhantomData,
12589            _fields: self._fields,
12590            _type: PhantomData,
12591        }
12592    }
12593}
12594
12595impl<St, S: BosStr> SystemMessageViewBuilder<St, S>
12596where
12597    St: system_message_view_state::State,
12598    St::Id: system_message_view_state::IsUnset,
12599{
12600    /// Set the `id` field (required)
12601    pub fn id(
12602        mut self,
12603        value: impl Into<S>,
12604    ) -> SystemMessageViewBuilder<system_message_view_state::SetId<St>, S> {
12605        self._fields.1 = Option::Some(value.into());
12606        SystemMessageViewBuilder {
12607            _state: PhantomData,
12608            _fields: self._fields,
12609            _type: PhantomData,
12610        }
12611    }
12612}
12613
12614impl<St, S: BosStr> SystemMessageViewBuilder<St, S>
12615where
12616    St: system_message_view_state::State,
12617    St::Rev: system_message_view_state::IsUnset,
12618{
12619    /// Set the `rev` field (required)
12620    pub fn rev(
12621        mut self,
12622        value: impl Into<S>,
12623    ) -> SystemMessageViewBuilder<system_message_view_state::SetRev<St>, S> {
12624        self._fields.2 = Option::Some(value.into());
12625        SystemMessageViewBuilder {
12626            _state: PhantomData,
12627            _fields: self._fields,
12628            _type: PhantomData,
12629        }
12630    }
12631}
12632
12633impl<St, S: BosStr> SystemMessageViewBuilder<St, S>
12634where
12635    St: system_message_view_state::State,
12636    St::SentAt: system_message_view_state::IsUnset,
12637{
12638    /// Set the `sentAt` field (required)
12639    pub fn sent_at(
12640        mut self,
12641        value: impl Into<Datetime>,
12642    ) -> SystemMessageViewBuilder<system_message_view_state::SetSentAt<St>, S> {
12643        self._fields.3 = Option::Some(value.into());
12644        SystemMessageViewBuilder {
12645            _state: PhantomData,
12646            _fields: self._fields,
12647            _type: PhantomData,
12648        }
12649    }
12650}
12651
12652impl<St, S: BosStr> SystemMessageViewBuilder<St, S>
12653where
12654    St: system_message_view_state::State,
12655    St::Data: system_message_view_state::IsSet,
12656    St::Id: system_message_view_state::IsSet,
12657    St::Rev: system_message_view_state::IsSet,
12658    St::SentAt: system_message_view_state::IsSet,
12659{
12660    /// Build the final struct.
12661    pub fn build(self) -> SystemMessageView<S> {
12662        SystemMessageView {
12663            data: self._fields.0.unwrap(),
12664            id: self._fields.1.unwrap(),
12665            rev: self._fields.2.unwrap(),
12666            sent_at: self._fields.3.unwrap(),
12667            extra_data: Default::default(),
12668        }
12669    }
12670    /// Build the final struct with custom extra_data.
12671    pub fn build_with_data(self, extra_data: BTreeMap<SmolStr, Data<S>>) -> SystemMessageView<S> {
12672        SystemMessageView {
12673            data: self._fields.0.unwrap(),
12674            id: self._fields.1.unwrap(),
12675            rev: self._fields.2.unwrap(),
12676            sent_at: self._fields.3.unwrap(),
12677            extra_data: Some(extra_data),
12678        }
12679    }
12680}