Skip to main content

jacquard_api/chat_bsky/
group.rs

1// @generated by jacquard-lexicon. DO NOT EDIT.
2//
3// Lexicon: chat.bsky.group.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.group` Lexicon namespace/module.
9pub mod add_members;
10pub mod approve_join_request;
11pub mod create_group;
12pub mod create_join_link;
13pub mod disable_join_link;
14pub mod edit_group;
15pub mod edit_join_link;
16pub mod enable_join_link;
17pub mod get_join_link_previews;
18pub mod list_join_requests;
19pub mod list_mutual_groups;
20pub mod reject_join_request;
21pub mod remove_members;
22pub mod request_join;
23pub mod update_join_requests_read;
24pub mod withdraw_join_request;
25
26#[allow(unused_imports)]
27use alloc::collections::BTreeMap;
28
29#[allow(unused_imports)]
30use core::marker::PhantomData;
31use jacquard_common::{BosStr, CowStr, DefaultStr, FromStaticStr};
32
33#[allow(unused_imports)]
34use jacquard_common::deps::codegen::unicode_segmentation::UnicodeSegmentation;
35use jacquard_common::deps::smol_str::SmolStr;
36use jacquard_common::types::string::Datetime;
37use jacquard_common::types::value::Data;
38use jacquard_derive::IntoStatic;
39use jacquard_lexicon::lexicon::LexiconDoc;
40use jacquard_lexicon::schema::LexiconSchema;
41
42use crate::chat_bsky::actor::ProfileViewBasic;
43use crate::chat_bsky::convo::ConvoView;
44use crate::chat_bsky::group;
45#[allow(unused_imports)]
46use jacquard_lexicon::validation::{ConstraintError, ValidationPath};
47use serde::{Deserialize, Serialize};
48/// Preview for a disabled join link. Carries only the code so clients can correlate with the input and render a disabled state.
49
50#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
51#[serde(
52    rename_all = "camelCase",
53    bound(deserialize = "S: Deserialize<'de> + BosStr")
54)]
55pub struct DisabledJoinLinkPreviewView<S: BosStr = DefaultStr> {
56    pub code: S,
57    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
58    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
59}
60
61/// Preview for a join link code that does not map to an existing link. Carries only the code so clients can correlate with the input and render an invalid state.
62
63#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
64#[serde(
65    rename_all = "camelCase",
66    bound(deserialize = "S: Deserialize<'de> + BosStr")
67)]
68pub struct InvalidJoinLinkPreviewView<S: BosStr = DefaultStr> {
69    pub code: S,
70    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
71    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
72}
73
74/// Preview that can be shown in feeds, including to unauthenticated viewers.
75
76#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
77#[serde(
78    rename_all = "camelCase",
79    bound(deserialize = "S: Deserialize<'de> + BosStr")
80)]
81pub struct JoinLinkPreviewView<S: BosStr = DefaultStr> {
82    pub code: S,
83    ///Present only if the request is authenticated and the user is a member of the group.
84    #[serde(skip_serializing_if = "Option::is_none")]
85    pub convo: Option<ConvoView<S>>,
86    pub convo_id: S,
87    pub join_rule: group::JoinRule<S>,
88    pub member_count: i64,
89    pub member_limit: i64,
90    pub name: S,
91    pub owner: ProfileViewBasic<S>,
92    pub require_approval: bool,
93    #[serde(skip_serializing_if = "Option::is_none")]
94    pub viewer: Option<group::JoinLinkViewerState<S>>,
95    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
96    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
97}
98
99/// Join link view to be used within a group view, so the convo is surrounding, not specified inside this view.
100
101#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
102#[serde(
103    rename_all = "camelCase",
104    bound(deserialize = "S: Deserialize<'de> + BosStr")
105)]
106pub struct JoinLinkView<S: BosStr = DefaultStr> {
107    pub code: S,
108    pub created_at: Datetime,
109    pub enabled_status: group::LinkEnabledStatus<S>,
110    pub join_rule: group::JoinRule<S>,
111    pub require_approval: bool,
112    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
113    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
114}
115
116#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
117#[serde(
118    rename_all = "camelCase",
119    bound(deserialize = "S: Deserialize<'de> + BosStr")
120)]
121pub struct JoinLinkViewerState<S: BosStr = DefaultStr> {
122    #[serde(skip_serializing_if = "Option::is_none")]
123    pub requested_at: Option<Datetime>,
124    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
125    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
126}
127
128/// A join request from the perspective of the requester, including enough group context to render the request in a list (e.g. group name, owner, member count).
129
130#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
131#[serde(
132    rename_all = "camelCase",
133    bound(deserialize = "S: Deserialize<'de> + BosStr")
134)]
135pub struct JoinRequestConvoView<S: BosStr = DefaultStr> {
136    pub convo_id: S,
137    pub member_count: i64,
138    pub member_limit: i64,
139    pub name: S,
140    pub owner: ProfileViewBasic<S>,
141    pub viewer: group::JoinLinkViewerState<S>,
142    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
143    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
144}
145
146/// A join request from the perspective of the group owner.
147
148#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
149#[serde(
150    rename_all = "camelCase",
151    bound(deserialize = "S: Deserialize<'de> + BosStr")
152)]
153pub struct JoinRequestView<S: BosStr = DefaultStr> {
154    pub convo_id: S,
155    pub requested_at: Datetime,
156    pub requested_by: ProfileViewBasic<S>,
157    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
158    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
159}
160
161#[derive(Debug, Clone, PartialEq, Eq, Hash)]
162pub enum JoinRule<S: BosStr = DefaultStr> {
163    Anyone,
164    FollowedByOwner,
165    Other(S),
166}
167
168impl<S: BosStr> JoinRule<S> {
169    pub fn as_str(&self) -> &str {
170        match self {
171            Self::Anyone => "anyone",
172            Self::FollowedByOwner => "followedByOwner",
173            Self::Other(s) => s.as_ref(),
174        }
175    }
176    /// Construct from a string-like value, matching known values.
177    pub fn from_value(s: S) -> Self {
178        match s.as_ref() {
179            "anyone" => Self::Anyone,
180            "followedByOwner" => Self::FollowedByOwner,
181            _ => Self::Other(s),
182        }
183    }
184}
185
186impl<S: BosStr> AsRef<str> for JoinRule<S> {
187    fn as_ref(&self) -> &str {
188        self.as_str()
189    }
190}
191
192impl<S: BosStr> core::fmt::Display for JoinRule<S> {
193    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
194        write!(f, "{}", self.as_str())
195    }
196}
197
198impl<S: BosStr> Serialize for JoinRule<S> {
199    fn serialize<Ser>(&self, serializer: Ser) -> Result<Ser::Ok, Ser::Error>
200    where
201        Ser: serde::Serializer,
202    {
203        serializer.serialize_str(self.as_str())
204    }
205}
206
207impl<'de, S: Deserialize<'de> + BosStr> Deserialize<'de> for JoinRule<S> {
208    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
209    where
210        D: serde::Deserializer<'de>,
211    {
212        let s = S::deserialize(deserializer)?;
213        Ok(Self::from_value(s))
214    }
215}
216
217impl<S: BosStr> jacquard_common::IntoStatic for JoinRule<S>
218where
219    S: BosStr + jacquard_common::IntoStatic,
220    S::Output: BosStr,
221{
222    type Output = JoinRule<S::Output>;
223    fn into_static(self) -> Self::Output {
224        match self {
225            JoinRule::Anyone => JoinRule::Anyone,
226            JoinRule::FollowedByOwner => JoinRule::FollowedByOwner,
227            JoinRule::Other(v) => JoinRule::Other(v.into_static()),
228        }
229    }
230}
231
232#[derive(Debug, Clone, PartialEq, Eq, Hash)]
233pub enum LinkEnabledStatus<S: BosStr = DefaultStr> {
234    Enabled,
235    Disabled,
236    Other(S),
237}
238
239impl<S: BosStr> LinkEnabledStatus<S> {
240    pub fn as_str(&self) -> &str {
241        match self {
242            Self::Enabled => "enabled",
243            Self::Disabled => "disabled",
244            Self::Other(s) => s.as_ref(),
245        }
246    }
247    /// Construct from a string-like value, matching known values.
248    pub fn from_value(s: S) -> Self {
249        match s.as_ref() {
250            "enabled" => Self::Enabled,
251            "disabled" => Self::Disabled,
252            _ => Self::Other(s),
253        }
254    }
255}
256
257impl<S: BosStr> AsRef<str> for LinkEnabledStatus<S> {
258    fn as_ref(&self) -> &str {
259        self.as_str()
260    }
261}
262
263impl<S: BosStr> core::fmt::Display for LinkEnabledStatus<S> {
264    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
265        write!(f, "{}", self.as_str())
266    }
267}
268
269impl<S: BosStr> Serialize for LinkEnabledStatus<S> {
270    fn serialize<Ser>(&self, serializer: Ser) -> Result<Ser::Ok, Ser::Error>
271    where
272        Ser: serde::Serializer,
273    {
274        serializer.serialize_str(self.as_str())
275    }
276}
277
278impl<'de, S: Deserialize<'de> + BosStr> Deserialize<'de> for LinkEnabledStatus<S> {
279    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
280    where
281        D: serde::Deserializer<'de>,
282    {
283        let s = S::deserialize(deserializer)?;
284        Ok(Self::from_value(s))
285    }
286}
287
288impl<S: BosStr> jacquard_common::IntoStatic for LinkEnabledStatus<S>
289where
290    S: BosStr + jacquard_common::IntoStatic,
291    S::Output: BosStr,
292{
293    type Output = LinkEnabledStatus<S::Output>;
294    fn into_static(self) -> Self::Output {
295        match self {
296            LinkEnabledStatus::Enabled => LinkEnabledStatus::Enabled,
297            LinkEnabledStatus::Disabled => LinkEnabledStatus::Disabled,
298            LinkEnabledStatus::Other(v) => LinkEnabledStatus::Other(v.into_static()),
299        }
300    }
301}
302
303impl<S: BosStr> LexiconSchema for DisabledJoinLinkPreviewView<S> {
304    fn nsid() -> &'static str {
305        "chat.bsky.group.defs"
306    }
307    fn def_name() -> &'static str {
308        "disabledJoinLinkPreviewView"
309    }
310    fn lexicon_doc() -> LexiconDoc<'static> {
311        lexicon_doc_chat_bsky_group_defs()
312    }
313    fn validate(&self) -> Result<(), ConstraintError> {
314        Ok(())
315    }
316}
317
318impl<S: BosStr> LexiconSchema for InvalidJoinLinkPreviewView<S> {
319    fn nsid() -> &'static str {
320        "chat.bsky.group.defs"
321    }
322    fn def_name() -> &'static str {
323        "invalidJoinLinkPreviewView"
324    }
325    fn lexicon_doc() -> LexiconDoc<'static> {
326        lexicon_doc_chat_bsky_group_defs()
327    }
328    fn validate(&self) -> Result<(), ConstraintError> {
329        Ok(())
330    }
331}
332
333impl<S: BosStr> LexiconSchema for JoinLinkPreviewView<S> {
334    fn nsid() -> &'static str {
335        "chat.bsky.group.defs"
336    }
337    fn def_name() -> &'static str {
338        "joinLinkPreviewView"
339    }
340    fn lexicon_doc() -> LexiconDoc<'static> {
341        lexicon_doc_chat_bsky_group_defs()
342    }
343    fn validate(&self) -> Result<(), ConstraintError> {
344        Ok(())
345    }
346}
347
348impl<S: BosStr> LexiconSchema for JoinLinkView<S> {
349    fn nsid() -> &'static str {
350        "chat.bsky.group.defs"
351    }
352    fn def_name() -> &'static str {
353        "joinLinkView"
354    }
355    fn lexicon_doc() -> LexiconDoc<'static> {
356        lexicon_doc_chat_bsky_group_defs()
357    }
358    fn validate(&self) -> Result<(), ConstraintError> {
359        Ok(())
360    }
361}
362
363impl<S: BosStr> LexiconSchema for JoinLinkViewerState<S> {
364    fn nsid() -> &'static str {
365        "chat.bsky.group.defs"
366    }
367    fn def_name() -> &'static str {
368        "joinLinkViewerState"
369    }
370    fn lexicon_doc() -> LexiconDoc<'static> {
371        lexicon_doc_chat_bsky_group_defs()
372    }
373    fn validate(&self) -> Result<(), ConstraintError> {
374        Ok(())
375    }
376}
377
378impl<S: BosStr> LexiconSchema for JoinRequestConvoView<S> {
379    fn nsid() -> &'static str {
380        "chat.bsky.group.defs"
381    }
382    fn def_name() -> &'static str {
383        "joinRequestConvoView"
384    }
385    fn lexicon_doc() -> LexiconDoc<'static> {
386        lexicon_doc_chat_bsky_group_defs()
387    }
388    fn validate(&self) -> Result<(), ConstraintError> {
389        Ok(())
390    }
391}
392
393impl<S: BosStr> LexiconSchema for JoinRequestView<S> {
394    fn nsid() -> &'static str {
395        "chat.bsky.group.defs"
396    }
397    fn def_name() -> &'static str {
398        "joinRequestView"
399    }
400    fn lexicon_doc() -> LexiconDoc<'static> {
401        lexicon_doc_chat_bsky_group_defs()
402    }
403    fn validate(&self) -> Result<(), ConstraintError> {
404        Ok(())
405    }
406}
407
408fn lexicon_doc_chat_bsky_group_defs() -> LexiconDoc<'static> {
409    use alloc::collections::BTreeMap;
410    #[allow(unused_imports)]
411    use jacquard_common::{CowStr, deps::smol_str::SmolStr, types::blob::MimeType};
412    use jacquard_lexicon::lexicon::*;
413    LexiconDoc {
414        lexicon: Lexicon::Lexicon1,
415        id: CowStr::new_static("chat.bsky.group.defs"),
416        defs: {
417            let mut map = BTreeMap::new();
418            map.insert(
419                SmolStr::new_static("disabledJoinLinkPreviewView"),
420                LexUserType::Object(LexObject {
421                    description: Some(
422                        CowStr::new_static(
423                            "Preview for a disabled join link. Carries only the code so clients can correlate with the input and render a disabled state.",
424                        ),
425                    ),
426                    required: Some(vec![SmolStr::new_static("code")]),
427                    properties: {
428                        #[allow(unused_mut)]
429                        let mut map = BTreeMap::new();
430                        map.insert(
431                            SmolStr::new_static("code"),
432                            LexObjectProperty::String(LexString { ..Default::default() }),
433                        );
434                        map
435                    },
436                    ..Default::default()
437                }),
438            );
439            map.insert(
440                SmolStr::new_static("invalidJoinLinkPreviewView"),
441                LexUserType::Object(LexObject {
442                    description: Some(
443                        CowStr::new_static(
444                            "Preview for a join link code that does not map to an existing link. Carries only the code so clients can correlate with the input and render an invalid state.",
445                        ),
446                    ),
447                    required: Some(vec![SmolStr::new_static("code")]),
448                    properties: {
449                        #[allow(unused_mut)]
450                        let mut map = BTreeMap::new();
451                        map.insert(
452                            SmolStr::new_static("code"),
453                            LexObjectProperty::String(LexString { ..Default::default() }),
454                        );
455                        map
456                    },
457                    ..Default::default()
458                }),
459            );
460            map.insert(
461                SmolStr::new_static("joinLinkPreviewView"),
462                LexUserType::Object(LexObject {
463                    description: Some(CowStr::new_static(
464                        "Preview that can be shown in feeds, including to unauthenticated viewers.",
465                    )),
466                    required: Some(vec![
467                        SmolStr::new_static("convoId"),
468                        SmolStr::new_static("code"),
469                        SmolStr::new_static("name"),
470                        SmolStr::new_static("owner"),
471                        SmolStr::new_static("memberCount"),
472                        SmolStr::new_static("memberLimit"),
473                        SmolStr::new_static("requireApproval"),
474                        SmolStr::new_static("joinRule"),
475                    ]),
476                    properties: {
477                        #[allow(unused_mut)]
478                        let mut map = BTreeMap::new();
479                        map.insert(
480                            SmolStr::new_static("code"),
481                            LexObjectProperty::String(LexString {
482                                ..Default::default()
483                            }),
484                        );
485                        map.insert(
486                            SmolStr::new_static("convo"),
487                            LexObjectProperty::Ref(LexRef {
488                                r#ref: CowStr::new_static("chat.bsky.convo.defs#convoView"),
489                                ..Default::default()
490                            }),
491                        );
492                        map.insert(
493                            SmolStr::new_static("convoId"),
494                            LexObjectProperty::String(LexString {
495                                ..Default::default()
496                            }),
497                        );
498                        map.insert(
499                            SmolStr::new_static("joinRule"),
500                            LexObjectProperty::Ref(LexRef {
501                                r#ref: CowStr::new_static("#joinRule"),
502                                ..Default::default()
503                            }),
504                        );
505                        map.insert(
506                            SmolStr::new_static("memberCount"),
507                            LexObjectProperty::Integer(LexInteger {
508                                ..Default::default()
509                            }),
510                        );
511                        map.insert(
512                            SmolStr::new_static("memberLimit"),
513                            LexObjectProperty::Integer(LexInteger {
514                                ..Default::default()
515                            }),
516                        );
517                        map.insert(
518                            SmolStr::new_static("name"),
519                            LexObjectProperty::String(LexString {
520                                ..Default::default()
521                            }),
522                        );
523                        map.insert(
524                            SmolStr::new_static("owner"),
525                            LexObjectProperty::Ref(LexRef {
526                                r#ref: CowStr::new_static("chat.bsky.actor.defs#profileViewBasic"),
527                                ..Default::default()
528                            }),
529                        );
530                        map.insert(
531                            SmolStr::new_static("requireApproval"),
532                            LexObjectProperty::Boolean(LexBoolean {
533                                ..Default::default()
534                            }),
535                        );
536                        map.insert(
537                            SmolStr::new_static("viewer"),
538                            LexObjectProperty::Ref(LexRef {
539                                r#ref: CowStr::new_static("#joinLinkViewerState"),
540                                ..Default::default()
541                            }),
542                        );
543                        map
544                    },
545                    ..Default::default()
546                }),
547            );
548            map.insert(
549                SmolStr::new_static("joinLinkView"),
550                LexUserType::Object(LexObject {
551                    description: Some(
552                        CowStr::new_static(
553                            "Join link view to be used within a group view, so the convo is surrounding, not specified inside this view.",
554                        ),
555                    ),
556                    required: Some(
557                        vec![
558                            SmolStr::new_static("code"),
559                            SmolStr::new_static("enabledStatus"),
560                            SmolStr::new_static("requireApproval"),
561                            SmolStr::new_static("joinRule"),
562                            SmolStr::new_static("createdAt")
563                        ],
564                    ),
565                    properties: {
566                        #[allow(unused_mut)]
567                        let mut map = BTreeMap::new();
568                        map.insert(
569                            SmolStr::new_static("code"),
570                            LexObjectProperty::String(LexString { ..Default::default() }),
571                        );
572                        map.insert(
573                            SmolStr::new_static("createdAt"),
574                            LexObjectProperty::String(LexString {
575                                format: Some(LexStringFormat::Datetime),
576                                ..Default::default()
577                            }),
578                        );
579                        map.insert(
580                            SmolStr::new_static("enabledStatus"),
581                            LexObjectProperty::Ref(LexRef {
582                                r#ref: CowStr::new_static("#linkEnabledStatus"),
583                                ..Default::default()
584                            }),
585                        );
586                        map.insert(
587                            SmolStr::new_static("joinRule"),
588                            LexObjectProperty::Ref(LexRef {
589                                r#ref: CowStr::new_static("#joinRule"),
590                                ..Default::default()
591                            }),
592                        );
593                        map.insert(
594                            SmolStr::new_static("requireApproval"),
595                            LexObjectProperty::Boolean(LexBoolean {
596                                ..Default::default()
597                            }),
598                        );
599                        map
600                    },
601                    ..Default::default()
602                }),
603            );
604            map.insert(
605                SmolStr::new_static("joinLinkViewerState"),
606                LexUserType::Object(LexObject {
607                    properties: {
608                        #[allow(unused_mut)]
609                        let mut map = BTreeMap::new();
610                        map.insert(
611                            SmolStr::new_static("requestedAt"),
612                            LexObjectProperty::String(LexString {
613                                format: Some(LexStringFormat::Datetime),
614                                ..Default::default()
615                            }),
616                        );
617                        map
618                    },
619                    ..Default::default()
620                }),
621            );
622            map.insert(
623                SmolStr::new_static("joinRequestConvoView"),
624                LexUserType::Object(LexObject {
625                    description: Some(
626                        CowStr::new_static(
627                            "A join request from the perspective of the requester, including enough group context to render the request in a list (e.g. group name, owner, member count).",
628                        ),
629                    ),
630                    required: Some(
631                        vec![
632                            SmolStr::new_static("convoId"), SmolStr::new_static("name"),
633                            SmolStr::new_static("owner"),
634                            SmolStr::new_static("memberCount"),
635                            SmolStr::new_static("memberLimit"),
636                            SmolStr::new_static("viewer")
637                        ],
638                    ),
639                    properties: {
640                        #[allow(unused_mut)]
641                        let mut map = BTreeMap::new();
642                        map.insert(
643                            SmolStr::new_static("convoId"),
644                            LexObjectProperty::String(LexString { ..Default::default() }),
645                        );
646                        map.insert(
647                            SmolStr::new_static("memberCount"),
648                            LexObjectProperty::Integer(LexInteger {
649                                ..Default::default()
650                            }),
651                        );
652                        map.insert(
653                            SmolStr::new_static("memberLimit"),
654                            LexObjectProperty::Integer(LexInteger {
655                                ..Default::default()
656                            }),
657                        );
658                        map.insert(
659                            SmolStr::new_static("name"),
660                            LexObjectProperty::String(LexString { ..Default::default() }),
661                        );
662                        map.insert(
663                            SmolStr::new_static("owner"),
664                            LexObjectProperty::Ref(LexRef {
665                                r#ref: CowStr::new_static(
666                                    "chat.bsky.actor.defs#profileViewBasic",
667                                ),
668                                ..Default::default()
669                            }),
670                        );
671                        map.insert(
672                            SmolStr::new_static("viewer"),
673                            LexObjectProperty::Ref(LexRef {
674                                r#ref: CowStr::new_static("#joinLinkViewerState"),
675                                ..Default::default()
676                            }),
677                        );
678                        map
679                    },
680                    ..Default::default()
681                }),
682            );
683            map.insert(
684                SmolStr::new_static("joinRequestView"),
685                LexUserType::Object(LexObject {
686                    description: Some(CowStr::new_static(
687                        "A join request from the perspective of the group owner.",
688                    )),
689                    required: Some(vec![
690                        SmolStr::new_static("convoId"),
691                        SmolStr::new_static("requestedBy"),
692                        SmolStr::new_static("requestedAt"),
693                    ]),
694                    properties: {
695                        #[allow(unused_mut)]
696                        let mut map = BTreeMap::new();
697                        map.insert(
698                            SmolStr::new_static("convoId"),
699                            LexObjectProperty::String(LexString {
700                                ..Default::default()
701                            }),
702                        );
703                        map.insert(
704                            SmolStr::new_static("requestedAt"),
705                            LexObjectProperty::String(LexString {
706                                format: Some(LexStringFormat::Datetime),
707                                ..Default::default()
708                            }),
709                        );
710                        map.insert(
711                            SmolStr::new_static("requestedBy"),
712                            LexObjectProperty::Ref(LexRef {
713                                r#ref: CowStr::new_static("chat.bsky.actor.defs#profileViewBasic"),
714                                ..Default::default()
715                            }),
716                        );
717                        map
718                    },
719                    ..Default::default()
720                }),
721            );
722            map.insert(
723                SmolStr::new_static("joinRule"),
724                LexUserType::String(LexString {
725                    ..Default::default()
726                }),
727            );
728            map.insert(
729                SmolStr::new_static("linkEnabledStatus"),
730                LexUserType::String(LexString {
731                    ..Default::default()
732                }),
733            );
734            map
735        },
736        ..Default::default()
737    }
738}
739
740pub mod join_link_preview_view_state {
741
742    pub use crate::builder_types::{IsSet, IsUnset, Set, Unset};
743    #[allow(unused)]
744    use ::core::marker::PhantomData;
745    mod sealed {
746        pub trait Sealed {}
747    }
748    /// State trait tracking which required fields have been set
749    pub trait State: sealed::Sealed {
750        type Code;
751        type ConvoId;
752        type JoinRule;
753        type MemberCount;
754        type MemberLimit;
755        type Name;
756        type Owner;
757        type RequireApproval;
758    }
759    /// Empty state - all required fields are unset
760    pub struct Empty(());
761    impl sealed::Sealed for Empty {}
762    impl State for Empty {
763        type Code = Unset;
764        type ConvoId = Unset;
765        type JoinRule = Unset;
766        type MemberCount = Unset;
767        type MemberLimit = Unset;
768        type Name = Unset;
769        type Owner = Unset;
770        type RequireApproval = Unset;
771    }
772    ///State transition - sets the `code` field to Set
773    pub struct SetCode<St: State = Empty>(PhantomData<fn() -> St>);
774    impl<St: State> sealed::Sealed for SetCode<St> {}
775    impl<St: State> State for SetCode<St> {
776        type Code = Set<members::code>;
777        type ConvoId = St::ConvoId;
778        type JoinRule = St::JoinRule;
779        type MemberCount = St::MemberCount;
780        type MemberLimit = St::MemberLimit;
781        type Name = St::Name;
782        type Owner = St::Owner;
783        type RequireApproval = St::RequireApproval;
784    }
785    ///State transition - sets the `convo_id` field to Set
786    pub struct SetConvoId<St: State = Empty>(PhantomData<fn() -> St>);
787    impl<St: State> sealed::Sealed for SetConvoId<St> {}
788    impl<St: State> State for SetConvoId<St> {
789        type Code = St::Code;
790        type ConvoId = Set<members::convo_id>;
791        type JoinRule = St::JoinRule;
792        type MemberCount = St::MemberCount;
793        type MemberLimit = St::MemberLimit;
794        type Name = St::Name;
795        type Owner = St::Owner;
796        type RequireApproval = St::RequireApproval;
797    }
798    ///State transition - sets the `join_rule` field to Set
799    pub struct SetJoinRule<St: State = Empty>(PhantomData<fn() -> St>);
800    impl<St: State> sealed::Sealed for SetJoinRule<St> {}
801    impl<St: State> State for SetJoinRule<St> {
802        type Code = St::Code;
803        type ConvoId = St::ConvoId;
804        type JoinRule = Set<members::join_rule>;
805        type MemberCount = St::MemberCount;
806        type MemberLimit = St::MemberLimit;
807        type Name = St::Name;
808        type Owner = St::Owner;
809        type RequireApproval = St::RequireApproval;
810    }
811    ///State transition - sets the `member_count` field to Set
812    pub struct SetMemberCount<St: State = Empty>(PhantomData<fn() -> St>);
813    impl<St: State> sealed::Sealed for SetMemberCount<St> {}
814    impl<St: State> State for SetMemberCount<St> {
815        type Code = St::Code;
816        type ConvoId = St::ConvoId;
817        type JoinRule = St::JoinRule;
818        type MemberCount = Set<members::member_count>;
819        type MemberLimit = St::MemberLimit;
820        type Name = St::Name;
821        type Owner = St::Owner;
822        type RequireApproval = St::RequireApproval;
823    }
824    ///State transition - sets the `member_limit` field to Set
825    pub struct SetMemberLimit<St: State = Empty>(PhantomData<fn() -> St>);
826    impl<St: State> sealed::Sealed for SetMemberLimit<St> {}
827    impl<St: State> State for SetMemberLimit<St> {
828        type Code = St::Code;
829        type ConvoId = St::ConvoId;
830        type JoinRule = St::JoinRule;
831        type MemberCount = St::MemberCount;
832        type MemberLimit = Set<members::member_limit>;
833        type Name = St::Name;
834        type Owner = St::Owner;
835        type RequireApproval = St::RequireApproval;
836    }
837    ///State transition - sets the `name` field to Set
838    pub struct SetName<St: State = Empty>(PhantomData<fn() -> St>);
839    impl<St: State> sealed::Sealed for SetName<St> {}
840    impl<St: State> State for SetName<St> {
841        type Code = St::Code;
842        type ConvoId = St::ConvoId;
843        type JoinRule = St::JoinRule;
844        type MemberCount = St::MemberCount;
845        type MemberLimit = St::MemberLimit;
846        type Name = Set<members::name>;
847        type Owner = St::Owner;
848        type RequireApproval = St::RequireApproval;
849    }
850    ///State transition - sets the `owner` field to Set
851    pub struct SetOwner<St: State = Empty>(PhantomData<fn() -> St>);
852    impl<St: State> sealed::Sealed for SetOwner<St> {}
853    impl<St: State> State for SetOwner<St> {
854        type Code = St::Code;
855        type ConvoId = St::ConvoId;
856        type JoinRule = St::JoinRule;
857        type MemberCount = St::MemberCount;
858        type MemberLimit = St::MemberLimit;
859        type Name = St::Name;
860        type Owner = Set<members::owner>;
861        type RequireApproval = St::RequireApproval;
862    }
863    ///State transition - sets the `require_approval` field to Set
864    pub struct SetRequireApproval<St: State = Empty>(PhantomData<fn() -> St>);
865    impl<St: State> sealed::Sealed for SetRequireApproval<St> {}
866    impl<St: State> State for SetRequireApproval<St> {
867        type Code = St::Code;
868        type ConvoId = St::ConvoId;
869        type JoinRule = St::JoinRule;
870        type MemberCount = St::MemberCount;
871        type MemberLimit = St::MemberLimit;
872        type Name = St::Name;
873        type Owner = St::Owner;
874        type RequireApproval = Set<members::require_approval>;
875    }
876    /// Marker types for field names
877    #[allow(non_camel_case_types)]
878    pub mod members {
879        ///Marker type for the `code` field
880        pub struct code(());
881        ///Marker type for the `convo_id` field
882        pub struct convo_id(());
883        ///Marker type for the `join_rule` field
884        pub struct join_rule(());
885        ///Marker type for the `member_count` field
886        pub struct member_count(());
887        ///Marker type for the `member_limit` field
888        pub struct member_limit(());
889        ///Marker type for the `name` field
890        pub struct name(());
891        ///Marker type for the `owner` field
892        pub struct owner(());
893        ///Marker type for the `require_approval` field
894        pub struct require_approval(());
895    }
896}
897
898/// Builder for constructing an instance of this type.
899pub struct JoinLinkPreviewViewBuilder<
900    St: join_link_preview_view_state::State,
901    S: BosStr = DefaultStr,
902> {
903    _state: PhantomData<fn() -> St>,
904    _fields: (
905        Option<S>,
906        Option<ConvoView<S>>,
907        Option<S>,
908        Option<group::JoinRule<S>>,
909        Option<i64>,
910        Option<i64>,
911        Option<S>,
912        Option<ProfileViewBasic<S>>,
913        Option<bool>,
914        Option<group::JoinLinkViewerState<S>>,
915    ),
916    _type: PhantomData<fn() -> S>,
917}
918
919impl JoinLinkPreviewView<DefaultStr> {
920    /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed
921    pub fn new() -> JoinLinkPreviewViewBuilder<join_link_preview_view_state::Empty, DefaultStr> {
922        JoinLinkPreviewViewBuilder::new()
923    }
924}
925
926impl<S: BosStr> JoinLinkPreviewView<S> {
927    /// Create a new builder for this type
928    pub fn builder() -> JoinLinkPreviewViewBuilder<join_link_preview_view_state::Empty, S> {
929        JoinLinkPreviewViewBuilder::builder()
930    }
931}
932
933impl JoinLinkPreviewViewBuilder<join_link_preview_view_state::Empty, DefaultStr> {
934    /// Create a new builder with all fields unset, using the default string type, if needed
935    pub fn new() -> Self {
936        JoinLinkPreviewViewBuilder {
937            _state: PhantomData,
938            _fields: (None, None, None, None, None, None, None, None, None, None),
939            _type: PhantomData,
940        }
941    }
942}
943
944impl<S: BosStr> JoinLinkPreviewViewBuilder<join_link_preview_view_state::Empty, S> {
945    /// Create a new builder with all fields unset
946    pub fn builder() -> Self {
947        JoinLinkPreviewViewBuilder {
948            _state: PhantomData,
949            _fields: (None, None, None, None, None, None, None, None, None, None),
950            _type: PhantomData,
951        }
952    }
953}
954
955impl<St, S: BosStr> JoinLinkPreviewViewBuilder<St, S>
956where
957    St: join_link_preview_view_state::State,
958    St::Code: join_link_preview_view_state::IsUnset,
959{
960    /// Set the `code` field (required)
961    pub fn code(
962        mut self,
963        value: impl Into<S>,
964    ) -> JoinLinkPreviewViewBuilder<join_link_preview_view_state::SetCode<St>, S> {
965        self._fields.0 = Option::Some(value.into());
966        JoinLinkPreviewViewBuilder {
967            _state: PhantomData,
968            _fields: self._fields,
969            _type: PhantomData,
970        }
971    }
972}
973
974impl<St: join_link_preview_view_state::State, S: BosStr> JoinLinkPreviewViewBuilder<St, S> {
975    /// Set the `convo` field (optional)
976    pub fn convo(mut self, value: impl Into<Option<ConvoView<S>>>) -> Self {
977        self._fields.1 = value.into();
978        self
979    }
980    /// Set the `convo` field to an Option value (optional)
981    pub fn maybe_convo(mut self, value: Option<ConvoView<S>>) -> Self {
982        self._fields.1 = value;
983        self
984    }
985}
986
987impl<St, S: BosStr> JoinLinkPreviewViewBuilder<St, S>
988where
989    St: join_link_preview_view_state::State,
990    St::ConvoId: join_link_preview_view_state::IsUnset,
991{
992    /// Set the `convoId` field (required)
993    pub fn convo_id(
994        mut self,
995        value: impl Into<S>,
996    ) -> JoinLinkPreviewViewBuilder<join_link_preview_view_state::SetConvoId<St>, S> {
997        self._fields.2 = Option::Some(value.into());
998        JoinLinkPreviewViewBuilder {
999            _state: PhantomData,
1000            _fields: self._fields,
1001            _type: PhantomData,
1002        }
1003    }
1004}
1005
1006impl<St, S: BosStr> JoinLinkPreviewViewBuilder<St, S>
1007where
1008    St: join_link_preview_view_state::State,
1009    St::JoinRule: join_link_preview_view_state::IsUnset,
1010{
1011    /// Set the `joinRule` field (required)
1012    pub fn join_rule(
1013        mut self,
1014        value: impl Into<group::JoinRule<S>>,
1015    ) -> JoinLinkPreviewViewBuilder<join_link_preview_view_state::SetJoinRule<St>, S> {
1016        self._fields.3 = Option::Some(value.into());
1017        JoinLinkPreviewViewBuilder {
1018            _state: PhantomData,
1019            _fields: self._fields,
1020            _type: PhantomData,
1021        }
1022    }
1023}
1024
1025impl<St, S: BosStr> JoinLinkPreviewViewBuilder<St, S>
1026where
1027    St: join_link_preview_view_state::State,
1028    St::MemberCount: join_link_preview_view_state::IsUnset,
1029{
1030    /// Set the `memberCount` field (required)
1031    pub fn member_count(
1032        mut self,
1033        value: impl Into<i64>,
1034    ) -> JoinLinkPreviewViewBuilder<join_link_preview_view_state::SetMemberCount<St>, S> {
1035        self._fields.4 = Option::Some(value.into());
1036        JoinLinkPreviewViewBuilder {
1037            _state: PhantomData,
1038            _fields: self._fields,
1039            _type: PhantomData,
1040        }
1041    }
1042}
1043
1044impl<St, S: BosStr> JoinLinkPreviewViewBuilder<St, S>
1045where
1046    St: join_link_preview_view_state::State,
1047    St::MemberLimit: join_link_preview_view_state::IsUnset,
1048{
1049    /// Set the `memberLimit` field (required)
1050    pub fn member_limit(
1051        mut self,
1052        value: impl Into<i64>,
1053    ) -> JoinLinkPreviewViewBuilder<join_link_preview_view_state::SetMemberLimit<St>, S> {
1054        self._fields.5 = Option::Some(value.into());
1055        JoinLinkPreviewViewBuilder {
1056            _state: PhantomData,
1057            _fields: self._fields,
1058            _type: PhantomData,
1059        }
1060    }
1061}
1062
1063impl<St, S: BosStr> JoinLinkPreviewViewBuilder<St, S>
1064where
1065    St: join_link_preview_view_state::State,
1066    St::Name: join_link_preview_view_state::IsUnset,
1067{
1068    /// Set the `name` field (required)
1069    pub fn name(
1070        mut self,
1071        value: impl Into<S>,
1072    ) -> JoinLinkPreviewViewBuilder<join_link_preview_view_state::SetName<St>, S> {
1073        self._fields.6 = Option::Some(value.into());
1074        JoinLinkPreviewViewBuilder {
1075            _state: PhantomData,
1076            _fields: self._fields,
1077            _type: PhantomData,
1078        }
1079    }
1080}
1081
1082impl<St, S: BosStr> JoinLinkPreviewViewBuilder<St, S>
1083where
1084    St: join_link_preview_view_state::State,
1085    St::Owner: join_link_preview_view_state::IsUnset,
1086{
1087    /// Set the `owner` field (required)
1088    pub fn owner(
1089        mut self,
1090        value: impl Into<ProfileViewBasic<S>>,
1091    ) -> JoinLinkPreviewViewBuilder<join_link_preview_view_state::SetOwner<St>, S> {
1092        self._fields.7 = Option::Some(value.into());
1093        JoinLinkPreviewViewBuilder {
1094            _state: PhantomData,
1095            _fields: self._fields,
1096            _type: PhantomData,
1097        }
1098    }
1099}
1100
1101impl<St, S: BosStr> JoinLinkPreviewViewBuilder<St, S>
1102where
1103    St: join_link_preview_view_state::State,
1104    St::RequireApproval: join_link_preview_view_state::IsUnset,
1105{
1106    /// Set the `requireApproval` field (required)
1107    pub fn require_approval(
1108        mut self,
1109        value: impl Into<bool>,
1110    ) -> JoinLinkPreviewViewBuilder<join_link_preview_view_state::SetRequireApproval<St>, S> {
1111        self._fields.8 = Option::Some(value.into());
1112        JoinLinkPreviewViewBuilder {
1113            _state: PhantomData,
1114            _fields: self._fields,
1115            _type: PhantomData,
1116        }
1117    }
1118}
1119
1120impl<St: join_link_preview_view_state::State, S: BosStr> JoinLinkPreviewViewBuilder<St, S> {
1121    /// Set the `viewer` field (optional)
1122    pub fn viewer(mut self, value: impl Into<Option<group::JoinLinkViewerState<S>>>) -> Self {
1123        self._fields.9 = value.into();
1124        self
1125    }
1126    /// Set the `viewer` field to an Option value (optional)
1127    pub fn maybe_viewer(mut self, value: Option<group::JoinLinkViewerState<S>>) -> Self {
1128        self._fields.9 = value;
1129        self
1130    }
1131}
1132
1133impl<St, S: BosStr> JoinLinkPreviewViewBuilder<St, S>
1134where
1135    St: join_link_preview_view_state::State,
1136    St::Code: join_link_preview_view_state::IsSet,
1137    St::ConvoId: join_link_preview_view_state::IsSet,
1138    St::JoinRule: join_link_preview_view_state::IsSet,
1139    St::MemberCount: join_link_preview_view_state::IsSet,
1140    St::MemberLimit: join_link_preview_view_state::IsSet,
1141    St::Name: join_link_preview_view_state::IsSet,
1142    St::Owner: join_link_preview_view_state::IsSet,
1143    St::RequireApproval: join_link_preview_view_state::IsSet,
1144{
1145    /// Build the final struct.
1146    pub fn build(self) -> JoinLinkPreviewView<S> {
1147        JoinLinkPreviewView {
1148            code: self._fields.0.unwrap(),
1149            convo: self._fields.1,
1150            convo_id: self._fields.2.unwrap(),
1151            join_rule: self._fields.3.unwrap(),
1152            member_count: self._fields.4.unwrap(),
1153            member_limit: self._fields.5.unwrap(),
1154            name: self._fields.6.unwrap(),
1155            owner: self._fields.7.unwrap(),
1156            require_approval: self._fields.8.unwrap(),
1157            viewer: self._fields.9,
1158            extra_data: Default::default(),
1159        }
1160    }
1161    /// Build the final struct with custom extra_data.
1162    pub fn build_with_data(self, extra_data: BTreeMap<SmolStr, Data<S>>) -> JoinLinkPreviewView<S> {
1163        JoinLinkPreviewView {
1164            code: self._fields.0.unwrap(),
1165            convo: self._fields.1,
1166            convo_id: self._fields.2.unwrap(),
1167            join_rule: self._fields.3.unwrap(),
1168            member_count: self._fields.4.unwrap(),
1169            member_limit: self._fields.5.unwrap(),
1170            name: self._fields.6.unwrap(),
1171            owner: self._fields.7.unwrap(),
1172            require_approval: self._fields.8.unwrap(),
1173            viewer: self._fields.9,
1174            extra_data: Some(extra_data),
1175        }
1176    }
1177}
1178
1179pub mod join_link_view_state {
1180
1181    pub use crate::builder_types::{IsSet, IsUnset, Set, Unset};
1182    #[allow(unused)]
1183    use ::core::marker::PhantomData;
1184    mod sealed {
1185        pub trait Sealed {}
1186    }
1187    /// State trait tracking which required fields have been set
1188    pub trait State: sealed::Sealed {
1189        type Code;
1190        type CreatedAt;
1191        type EnabledStatus;
1192        type JoinRule;
1193        type RequireApproval;
1194    }
1195    /// Empty state - all required fields are unset
1196    pub struct Empty(());
1197    impl sealed::Sealed for Empty {}
1198    impl State for Empty {
1199        type Code = Unset;
1200        type CreatedAt = Unset;
1201        type EnabledStatus = Unset;
1202        type JoinRule = Unset;
1203        type RequireApproval = Unset;
1204    }
1205    ///State transition - sets the `code` field to Set
1206    pub struct SetCode<St: State = Empty>(PhantomData<fn() -> St>);
1207    impl<St: State> sealed::Sealed for SetCode<St> {}
1208    impl<St: State> State for SetCode<St> {
1209        type Code = Set<members::code>;
1210        type CreatedAt = St::CreatedAt;
1211        type EnabledStatus = St::EnabledStatus;
1212        type JoinRule = St::JoinRule;
1213        type RequireApproval = St::RequireApproval;
1214    }
1215    ///State transition - sets the `created_at` field to Set
1216    pub struct SetCreatedAt<St: State = Empty>(PhantomData<fn() -> St>);
1217    impl<St: State> sealed::Sealed for SetCreatedAt<St> {}
1218    impl<St: State> State for SetCreatedAt<St> {
1219        type Code = St::Code;
1220        type CreatedAt = Set<members::created_at>;
1221        type EnabledStatus = St::EnabledStatus;
1222        type JoinRule = St::JoinRule;
1223        type RequireApproval = St::RequireApproval;
1224    }
1225    ///State transition - sets the `enabled_status` field to Set
1226    pub struct SetEnabledStatus<St: State = Empty>(PhantomData<fn() -> St>);
1227    impl<St: State> sealed::Sealed for SetEnabledStatus<St> {}
1228    impl<St: State> State for SetEnabledStatus<St> {
1229        type Code = St::Code;
1230        type CreatedAt = St::CreatedAt;
1231        type EnabledStatus = Set<members::enabled_status>;
1232        type JoinRule = St::JoinRule;
1233        type RequireApproval = St::RequireApproval;
1234    }
1235    ///State transition - sets the `join_rule` field to Set
1236    pub struct SetJoinRule<St: State = Empty>(PhantomData<fn() -> St>);
1237    impl<St: State> sealed::Sealed for SetJoinRule<St> {}
1238    impl<St: State> State for SetJoinRule<St> {
1239        type Code = St::Code;
1240        type CreatedAt = St::CreatedAt;
1241        type EnabledStatus = St::EnabledStatus;
1242        type JoinRule = Set<members::join_rule>;
1243        type RequireApproval = St::RequireApproval;
1244    }
1245    ///State transition - sets the `require_approval` field to Set
1246    pub struct SetRequireApproval<St: State = Empty>(PhantomData<fn() -> St>);
1247    impl<St: State> sealed::Sealed for SetRequireApproval<St> {}
1248    impl<St: State> State for SetRequireApproval<St> {
1249        type Code = St::Code;
1250        type CreatedAt = St::CreatedAt;
1251        type EnabledStatus = St::EnabledStatus;
1252        type JoinRule = St::JoinRule;
1253        type RequireApproval = Set<members::require_approval>;
1254    }
1255    /// Marker types for field names
1256    #[allow(non_camel_case_types)]
1257    pub mod members {
1258        ///Marker type for the `code` field
1259        pub struct code(());
1260        ///Marker type for the `created_at` field
1261        pub struct created_at(());
1262        ///Marker type for the `enabled_status` field
1263        pub struct enabled_status(());
1264        ///Marker type for the `join_rule` field
1265        pub struct join_rule(());
1266        ///Marker type for the `require_approval` field
1267        pub struct require_approval(());
1268    }
1269}
1270
1271/// Builder for constructing an instance of this type.
1272pub struct JoinLinkViewBuilder<St: join_link_view_state::State, S: BosStr = DefaultStr> {
1273    _state: PhantomData<fn() -> St>,
1274    _fields: (
1275        Option<S>,
1276        Option<Datetime>,
1277        Option<group::LinkEnabledStatus<S>>,
1278        Option<group::JoinRule<S>>,
1279        Option<bool>,
1280    ),
1281    _type: PhantomData<fn() -> S>,
1282}
1283
1284impl JoinLinkView<DefaultStr> {
1285    /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed
1286    pub fn new() -> JoinLinkViewBuilder<join_link_view_state::Empty, DefaultStr> {
1287        JoinLinkViewBuilder::new()
1288    }
1289}
1290
1291impl<S: BosStr> JoinLinkView<S> {
1292    /// Create a new builder for this type
1293    pub fn builder() -> JoinLinkViewBuilder<join_link_view_state::Empty, S> {
1294        JoinLinkViewBuilder::builder()
1295    }
1296}
1297
1298impl JoinLinkViewBuilder<join_link_view_state::Empty, DefaultStr> {
1299    /// Create a new builder with all fields unset, using the default string type, if needed
1300    pub fn new() -> Self {
1301        JoinLinkViewBuilder {
1302            _state: PhantomData,
1303            _fields: (None, None, None, None, None),
1304            _type: PhantomData,
1305        }
1306    }
1307}
1308
1309impl<S: BosStr> JoinLinkViewBuilder<join_link_view_state::Empty, S> {
1310    /// Create a new builder with all fields unset
1311    pub fn builder() -> Self {
1312        JoinLinkViewBuilder {
1313            _state: PhantomData,
1314            _fields: (None, None, None, None, None),
1315            _type: PhantomData,
1316        }
1317    }
1318}
1319
1320impl<St, S: BosStr> JoinLinkViewBuilder<St, S>
1321where
1322    St: join_link_view_state::State,
1323    St::Code: join_link_view_state::IsUnset,
1324{
1325    /// Set the `code` field (required)
1326    pub fn code(
1327        mut self,
1328        value: impl Into<S>,
1329    ) -> JoinLinkViewBuilder<join_link_view_state::SetCode<St>, S> {
1330        self._fields.0 = Option::Some(value.into());
1331        JoinLinkViewBuilder {
1332            _state: PhantomData,
1333            _fields: self._fields,
1334            _type: PhantomData,
1335        }
1336    }
1337}
1338
1339impl<St, S: BosStr> JoinLinkViewBuilder<St, S>
1340where
1341    St: join_link_view_state::State,
1342    St::CreatedAt: join_link_view_state::IsUnset,
1343{
1344    /// Set the `createdAt` field (required)
1345    pub fn created_at(
1346        mut self,
1347        value: impl Into<Datetime>,
1348    ) -> JoinLinkViewBuilder<join_link_view_state::SetCreatedAt<St>, S> {
1349        self._fields.1 = Option::Some(value.into());
1350        JoinLinkViewBuilder {
1351            _state: PhantomData,
1352            _fields: self._fields,
1353            _type: PhantomData,
1354        }
1355    }
1356}
1357
1358impl<St, S: BosStr> JoinLinkViewBuilder<St, S>
1359where
1360    St: join_link_view_state::State,
1361    St::EnabledStatus: join_link_view_state::IsUnset,
1362{
1363    /// Set the `enabledStatus` field (required)
1364    pub fn enabled_status(
1365        mut self,
1366        value: impl Into<group::LinkEnabledStatus<S>>,
1367    ) -> JoinLinkViewBuilder<join_link_view_state::SetEnabledStatus<St>, S> {
1368        self._fields.2 = Option::Some(value.into());
1369        JoinLinkViewBuilder {
1370            _state: PhantomData,
1371            _fields: self._fields,
1372            _type: PhantomData,
1373        }
1374    }
1375}
1376
1377impl<St, S: BosStr> JoinLinkViewBuilder<St, S>
1378where
1379    St: join_link_view_state::State,
1380    St::JoinRule: join_link_view_state::IsUnset,
1381{
1382    /// Set the `joinRule` field (required)
1383    pub fn join_rule(
1384        mut self,
1385        value: impl Into<group::JoinRule<S>>,
1386    ) -> JoinLinkViewBuilder<join_link_view_state::SetJoinRule<St>, S> {
1387        self._fields.3 = Option::Some(value.into());
1388        JoinLinkViewBuilder {
1389            _state: PhantomData,
1390            _fields: self._fields,
1391            _type: PhantomData,
1392        }
1393    }
1394}
1395
1396impl<St, S: BosStr> JoinLinkViewBuilder<St, S>
1397where
1398    St: join_link_view_state::State,
1399    St::RequireApproval: join_link_view_state::IsUnset,
1400{
1401    /// Set the `requireApproval` field (required)
1402    pub fn require_approval(
1403        mut self,
1404        value: impl Into<bool>,
1405    ) -> JoinLinkViewBuilder<join_link_view_state::SetRequireApproval<St>, S> {
1406        self._fields.4 = Option::Some(value.into());
1407        JoinLinkViewBuilder {
1408            _state: PhantomData,
1409            _fields: self._fields,
1410            _type: PhantomData,
1411        }
1412    }
1413}
1414
1415impl<St, S: BosStr> JoinLinkViewBuilder<St, S>
1416where
1417    St: join_link_view_state::State,
1418    St::Code: join_link_view_state::IsSet,
1419    St::CreatedAt: join_link_view_state::IsSet,
1420    St::EnabledStatus: join_link_view_state::IsSet,
1421    St::JoinRule: join_link_view_state::IsSet,
1422    St::RequireApproval: join_link_view_state::IsSet,
1423{
1424    /// Build the final struct.
1425    pub fn build(self) -> JoinLinkView<S> {
1426        JoinLinkView {
1427            code: self._fields.0.unwrap(),
1428            created_at: self._fields.1.unwrap(),
1429            enabled_status: self._fields.2.unwrap(),
1430            join_rule: self._fields.3.unwrap(),
1431            require_approval: self._fields.4.unwrap(),
1432            extra_data: Default::default(),
1433        }
1434    }
1435    /// Build the final struct with custom extra_data.
1436    pub fn build_with_data(self, extra_data: BTreeMap<SmolStr, Data<S>>) -> JoinLinkView<S> {
1437        JoinLinkView {
1438            code: self._fields.0.unwrap(),
1439            created_at: self._fields.1.unwrap(),
1440            enabled_status: self._fields.2.unwrap(),
1441            join_rule: self._fields.3.unwrap(),
1442            require_approval: self._fields.4.unwrap(),
1443            extra_data: Some(extra_data),
1444        }
1445    }
1446}
1447
1448pub mod join_request_convo_view_state {
1449
1450    pub use crate::builder_types::{IsSet, IsUnset, Set, Unset};
1451    #[allow(unused)]
1452    use ::core::marker::PhantomData;
1453    mod sealed {
1454        pub trait Sealed {}
1455    }
1456    /// State trait tracking which required fields have been set
1457    pub trait State: sealed::Sealed {
1458        type ConvoId;
1459        type MemberCount;
1460        type MemberLimit;
1461        type Name;
1462        type Owner;
1463        type Viewer;
1464    }
1465    /// Empty state - all required fields are unset
1466    pub struct Empty(());
1467    impl sealed::Sealed for Empty {}
1468    impl State for Empty {
1469        type ConvoId = Unset;
1470        type MemberCount = Unset;
1471        type MemberLimit = Unset;
1472        type Name = Unset;
1473        type Owner = Unset;
1474        type Viewer = Unset;
1475    }
1476    ///State transition - sets the `convo_id` field to Set
1477    pub struct SetConvoId<St: State = Empty>(PhantomData<fn() -> St>);
1478    impl<St: State> sealed::Sealed for SetConvoId<St> {}
1479    impl<St: State> State for SetConvoId<St> {
1480        type ConvoId = Set<members::convo_id>;
1481        type MemberCount = St::MemberCount;
1482        type MemberLimit = St::MemberLimit;
1483        type Name = St::Name;
1484        type Owner = St::Owner;
1485        type Viewer = St::Viewer;
1486    }
1487    ///State transition - sets the `member_count` field to Set
1488    pub struct SetMemberCount<St: State = Empty>(PhantomData<fn() -> St>);
1489    impl<St: State> sealed::Sealed for SetMemberCount<St> {}
1490    impl<St: State> State for SetMemberCount<St> {
1491        type ConvoId = St::ConvoId;
1492        type MemberCount = Set<members::member_count>;
1493        type MemberLimit = St::MemberLimit;
1494        type Name = St::Name;
1495        type Owner = St::Owner;
1496        type Viewer = St::Viewer;
1497    }
1498    ///State transition - sets the `member_limit` field to Set
1499    pub struct SetMemberLimit<St: State = Empty>(PhantomData<fn() -> St>);
1500    impl<St: State> sealed::Sealed for SetMemberLimit<St> {}
1501    impl<St: State> State for SetMemberLimit<St> {
1502        type ConvoId = St::ConvoId;
1503        type MemberCount = St::MemberCount;
1504        type MemberLimit = Set<members::member_limit>;
1505        type Name = St::Name;
1506        type Owner = St::Owner;
1507        type Viewer = St::Viewer;
1508    }
1509    ///State transition - sets the `name` field to Set
1510    pub struct SetName<St: State = Empty>(PhantomData<fn() -> St>);
1511    impl<St: State> sealed::Sealed for SetName<St> {}
1512    impl<St: State> State for SetName<St> {
1513        type ConvoId = St::ConvoId;
1514        type MemberCount = St::MemberCount;
1515        type MemberLimit = St::MemberLimit;
1516        type Name = Set<members::name>;
1517        type Owner = St::Owner;
1518        type Viewer = St::Viewer;
1519    }
1520    ///State transition - sets the `owner` field to Set
1521    pub struct SetOwner<St: State = Empty>(PhantomData<fn() -> St>);
1522    impl<St: State> sealed::Sealed for SetOwner<St> {}
1523    impl<St: State> State for SetOwner<St> {
1524        type ConvoId = St::ConvoId;
1525        type MemberCount = St::MemberCount;
1526        type MemberLimit = St::MemberLimit;
1527        type Name = St::Name;
1528        type Owner = Set<members::owner>;
1529        type Viewer = St::Viewer;
1530    }
1531    ///State transition - sets the `viewer` field to Set
1532    pub struct SetViewer<St: State = Empty>(PhantomData<fn() -> St>);
1533    impl<St: State> sealed::Sealed for SetViewer<St> {}
1534    impl<St: State> State for SetViewer<St> {
1535        type ConvoId = St::ConvoId;
1536        type MemberCount = St::MemberCount;
1537        type MemberLimit = St::MemberLimit;
1538        type Name = St::Name;
1539        type Owner = St::Owner;
1540        type Viewer = Set<members::viewer>;
1541    }
1542    /// Marker types for field names
1543    #[allow(non_camel_case_types)]
1544    pub mod members {
1545        ///Marker type for the `convo_id` field
1546        pub struct convo_id(());
1547        ///Marker type for the `member_count` field
1548        pub struct member_count(());
1549        ///Marker type for the `member_limit` field
1550        pub struct member_limit(());
1551        ///Marker type for the `name` field
1552        pub struct name(());
1553        ///Marker type for the `owner` field
1554        pub struct owner(());
1555        ///Marker type for the `viewer` field
1556        pub struct viewer(());
1557    }
1558}
1559
1560/// Builder for constructing an instance of this type.
1561pub struct JoinRequestConvoViewBuilder<
1562    St: join_request_convo_view_state::State,
1563    S: BosStr = DefaultStr,
1564> {
1565    _state: PhantomData<fn() -> St>,
1566    _fields: (
1567        Option<S>,
1568        Option<i64>,
1569        Option<i64>,
1570        Option<S>,
1571        Option<ProfileViewBasic<S>>,
1572        Option<group::JoinLinkViewerState<S>>,
1573    ),
1574    _type: PhantomData<fn() -> S>,
1575}
1576
1577impl JoinRequestConvoView<DefaultStr> {
1578    /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed
1579    pub fn new() -> JoinRequestConvoViewBuilder<join_request_convo_view_state::Empty, DefaultStr> {
1580        JoinRequestConvoViewBuilder::new()
1581    }
1582}
1583
1584impl<S: BosStr> JoinRequestConvoView<S> {
1585    /// Create a new builder for this type
1586    pub fn builder() -> JoinRequestConvoViewBuilder<join_request_convo_view_state::Empty, S> {
1587        JoinRequestConvoViewBuilder::builder()
1588    }
1589}
1590
1591impl JoinRequestConvoViewBuilder<join_request_convo_view_state::Empty, DefaultStr> {
1592    /// Create a new builder with all fields unset, using the default string type, if needed
1593    pub fn new() -> Self {
1594        JoinRequestConvoViewBuilder {
1595            _state: PhantomData,
1596            _fields: (None, None, None, None, None, None),
1597            _type: PhantomData,
1598        }
1599    }
1600}
1601
1602impl<S: BosStr> JoinRequestConvoViewBuilder<join_request_convo_view_state::Empty, S> {
1603    /// Create a new builder with all fields unset
1604    pub fn builder() -> Self {
1605        JoinRequestConvoViewBuilder {
1606            _state: PhantomData,
1607            _fields: (None, None, None, None, None, None),
1608            _type: PhantomData,
1609        }
1610    }
1611}
1612
1613impl<St, S: BosStr> JoinRequestConvoViewBuilder<St, S>
1614where
1615    St: join_request_convo_view_state::State,
1616    St::ConvoId: join_request_convo_view_state::IsUnset,
1617{
1618    /// Set the `convoId` field (required)
1619    pub fn convo_id(
1620        mut self,
1621        value: impl Into<S>,
1622    ) -> JoinRequestConvoViewBuilder<join_request_convo_view_state::SetConvoId<St>, S> {
1623        self._fields.0 = Option::Some(value.into());
1624        JoinRequestConvoViewBuilder {
1625            _state: PhantomData,
1626            _fields: self._fields,
1627            _type: PhantomData,
1628        }
1629    }
1630}
1631
1632impl<St, S: BosStr> JoinRequestConvoViewBuilder<St, S>
1633where
1634    St: join_request_convo_view_state::State,
1635    St::MemberCount: join_request_convo_view_state::IsUnset,
1636{
1637    /// Set the `memberCount` field (required)
1638    pub fn member_count(
1639        mut self,
1640        value: impl Into<i64>,
1641    ) -> JoinRequestConvoViewBuilder<join_request_convo_view_state::SetMemberCount<St>, S> {
1642        self._fields.1 = Option::Some(value.into());
1643        JoinRequestConvoViewBuilder {
1644            _state: PhantomData,
1645            _fields: self._fields,
1646            _type: PhantomData,
1647        }
1648    }
1649}
1650
1651impl<St, S: BosStr> JoinRequestConvoViewBuilder<St, S>
1652where
1653    St: join_request_convo_view_state::State,
1654    St::MemberLimit: join_request_convo_view_state::IsUnset,
1655{
1656    /// Set the `memberLimit` field (required)
1657    pub fn member_limit(
1658        mut self,
1659        value: impl Into<i64>,
1660    ) -> JoinRequestConvoViewBuilder<join_request_convo_view_state::SetMemberLimit<St>, S> {
1661        self._fields.2 = Option::Some(value.into());
1662        JoinRequestConvoViewBuilder {
1663            _state: PhantomData,
1664            _fields: self._fields,
1665            _type: PhantomData,
1666        }
1667    }
1668}
1669
1670impl<St, S: BosStr> JoinRequestConvoViewBuilder<St, S>
1671where
1672    St: join_request_convo_view_state::State,
1673    St::Name: join_request_convo_view_state::IsUnset,
1674{
1675    /// Set the `name` field (required)
1676    pub fn name(
1677        mut self,
1678        value: impl Into<S>,
1679    ) -> JoinRequestConvoViewBuilder<join_request_convo_view_state::SetName<St>, S> {
1680        self._fields.3 = Option::Some(value.into());
1681        JoinRequestConvoViewBuilder {
1682            _state: PhantomData,
1683            _fields: self._fields,
1684            _type: PhantomData,
1685        }
1686    }
1687}
1688
1689impl<St, S: BosStr> JoinRequestConvoViewBuilder<St, S>
1690where
1691    St: join_request_convo_view_state::State,
1692    St::Owner: join_request_convo_view_state::IsUnset,
1693{
1694    /// Set the `owner` field (required)
1695    pub fn owner(
1696        mut self,
1697        value: impl Into<ProfileViewBasic<S>>,
1698    ) -> JoinRequestConvoViewBuilder<join_request_convo_view_state::SetOwner<St>, S> {
1699        self._fields.4 = Option::Some(value.into());
1700        JoinRequestConvoViewBuilder {
1701            _state: PhantomData,
1702            _fields: self._fields,
1703            _type: PhantomData,
1704        }
1705    }
1706}
1707
1708impl<St, S: BosStr> JoinRequestConvoViewBuilder<St, S>
1709where
1710    St: join_request_convo_view_state::State,
1711    St::Viewer: join_request_convo_view_state::IsUnset,
1712{
1713    /// Set the `viewer` field (required)
1714    pub fn viewer(
1715        mut self,
1716        value: impl Into<group::JoinLinkViewerState<S>>,
1717    ) -> JoinRequestConvoViewBuilder<join_request_convo_view_state::SetViewer<St>, S> {
1718        self._fields.5 = Option::Some(value.into());
1719        JoinRequestConvoViewBuilder {
1720            _state: PhantomData,
1721            _fields: self._fields,
1722            _type: PhantomData,
1723        }
1724    }
1725}
1726
1727impl<St, S: BosStr> JoinRequestConvoViewBuilder<St, S>
1728where
1729    St: join_request_convo_view_state::State,
1730    St::ConvoId: join_request_convo_view_state::IsSet,
1731    St::MemberCount: join_request_convo_view_state::IsSet,
1732    St::MemberLimit: join_request_convo_view_state::IsSet,
1733    St::Name: join_request_convo_view_state::IsSet,
1734    St::Owner: join_request_convo_view_state::IsSet,
1735    St::Viewer: join_request_convo_view_state::IsSet,
1736{
1737    /// Build the final struct.
1738    pub fn build(self) -> JoinRequestConvoView<S> {
1739        JoinRequestConvoView {
1740            convo_id: self._fields.0.unwrap(),
1741            member_count: self._fields.1.unwrap(),
1742            member_limit: self._fields.2.unwrap(),
1743            name: self._fields.3.unwrap(),
1744            owner: self._fields.4.unwrap(),
1745            viewer: self._fields.5.unwrap(),
1746            extra_data: Default::default(),
1747        }
1748    }
1749    /// Build the final struct with custom extra_data.
1750    pub fn build_with_data(
1751        self,
1752        extra_data: BTreeMap<SmolStr, Data<S>>,
1753    ) -> JoinRequestConvoView<S> {
1754        JoinRequestConvoView {
1755            convo_id: self._fields.0.unwrap(),
1756            member_count: self._fields.1.unwrap(),
1757            member_limit: self._fields.2.unwrap(),
1758            name: self._fields.3.unwrap(),
1759            owner: self._fields.4.unwrap(),
1760            viewer: self._fields.5.unwrap(),
1761            extra_data: Some(extra_data),
1762        }
1763    }
1764}
1765
1766pub mod join_request_view_state {
1767
1768    pub use crate::builder_types::{IsSet, IsUnset, Set, Unset};
1769    #[allow(unused)]
1770    use ::core::marker::PhantomData;
1771    mod sealed {
1772        pub trait Sealed {}
1773    }
1774    /// State trait tracking which required fields have been set
1775    pub trait State: sealed::Sealed {
1776        type ConvoId;
1777        type RequestedAt;
1778        type RequestedBy;
1779    }
1780    /// Empty state - all required fields are unset
1781    pub struct Empty(());
1782    impl sealed::Sealed for Empty {}
1783    impl State for Empty {
1784        type ConvoId = Unset;
1785        type RequestedAt = Unset;
1786        type RequestedBy = Unset;
1787    }
1788    ///State transition - sets the `convo_id` field to Set
1789    pub struct SetConvoId<St: State = Empty>(PhantomData<fn() -> St>);
1790    impl<St: State> sealed::Sealed for SetConvoId<St> {}
1791    impl<St: State> State for SetConvoId<St> {
1792        type ConvoId = Set<members::convo_id>;
1793        type RequestedAt = St::RequestedAt;
1794        type RequestedBy = St::RequestedBy;
1795    }
1796    ///State transition - sets the `requested_at` field to Set
1797    pub struct SetRequestedAt<St: State = Empty>(PhantomData<fn() -> St>);
1798    impl<St: State> sealed::Sealed for SetRequestedAt<St> {}
1799    impl<St: State> State for SetRequestedAt<St> {
1800        type ConvoId = St::ConvoId;
1801        type RequestedAt = Set<members::requested_at>;
1802        type RequestedBy = St::RequestedBy;
1803    }
1804    ///State transition - sets the `requested_by` field to Set
1805    pub struct SetRequestedBy<St: State = Empty>(PhantomData<fn() -> St>);
1806    impl<St: State> sealed::Sealed for SetRequestedBy<St> {}
1807    impl<St: State> State for SetRequestedBy<St> {
1808        type ConvoId = St::ConvoId;
1809        type RequestedAt = St::RequestedAt;
1810        type RequestedBy = Set<members::requested_by>;
1811    }
1812    /// Marker types for field names
1813    #[allow(non_camel_case_types)]
1814    pub mod members {
1815        ///Marker type for the `convo_id` field
1816        pub struct convo_id(());
1817        ///Marker type for the `requested_at` field
1818        pub struct requested_at(());
1819        ///Marker type for the `requested_by` field
1820        pub struct requested_by(());
1821    }
1822}
1823
1824/// Builder for constructing an instance of this type.
1825pub struct JoinRequestViewBuilder<St: join_request_view_state::State, S: BosStr = DefaultStr> {
1826    _state: PhantomData<fn() -> St>,
1827    _fields: (Option<S>, Option<Datetime>, Option<ProfileViewBasic<S>>),
1828    _type: PhantomData<fn() -> S>,
1829}
1830
1831impl JoinRequestView<DefaultStr> {
1832    /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed
1833    pub fn new() -> JoinRequestViewBuilder<join_request_view_state::Empty, DefaultStr> {
1834        JoinRequestViewBuilder::new()
1835    }
1836}
1837
1838impl<S: BosStr> JoinRequestView<S> {
1839    /// Create a new builder for this type
1840    pub fn builder() -> JoinRequestViewBuilder<join_request_view_state::Empty, S> {
1841        JoinRequestViewBuilder::builder()
1842    }
1843}
1844
1845impl JoinRequestViewBuilder<join_request_view_state::Empty, DefaultStr> {
1846    /// Create a new builder with all fields unset, using the default string type, if needed
1847    pub fn new() -> Self {
1848        JoinRequestViewBuilder {
1849            _state: PhantomData,
1850            _fields: (None, None, None),
1851            _type: PhantomData,
1852        }
1853    }
1854}
1855
1856impl<S: BosStr> JoinRequestViewBuilder<join_request_view_state::Empty, S> {
1857    /// Create a new builder with all fields unset
1858    pub fn builder() -> Self {
1859        JoinRequestViewBuilder {
1860            _state: PhantomData,
1861            _fields: (None, None, None),
1862            _type: PhantomData,
1863        }
1864    }
1865}
1866
1867impl<St, S: BosStr> JoinRequestViewBuilder<St, S>
1868where
1869    St: join_request_view_state::State,
1870    St::ConvoId: join_request_view_state::IsUnset,
1871{
1872    /// Set the `convoId` field (required)
1873    pub fn convo_id(
1874        mut self,
1875        value: impl Into<S>,
1876    ) -> JoinRequestViewBuilder<join_request_view_state::SetConvoId<St>, S> {
1877        self._fields.0 = Option::Some(value.into());
1878        JoinRequestViewBuilder {
1879            _state: PhantomData,
1880            _fields: self._fields,
1881            _type: PhantomData,
1882        }
1883    }
1884}
1885
1886impl<St, S: BosStr> JoinRequestViewBuilder<St, S>
1887where
1888    St: join_request_view_state::State,
1889    St::RequestedAt: join_request_view_state::IsUnset,
1890{
1891    /// Set the `requestedAt` field (required)
1892    pub fn requested_at(
1893        mut self,
1894        value: impl Into<Datetime>,
1895    ) -> JoinRequestViewBuilder<join_request_view_state::SetRequestedAt<St>, S> {
1896        self._fields.1 = Option::Some(value.into());
1897        JoinRequestViewBuilder {
1898            _state: PhantomData,
1899            _fields: self._fields,
1900            _type: PhantomData,
1901        }
1902    }
1903}
1904
1905impl<St, S: BosStr> JoinRequestViewBuilder<St, S>
1906where
1907    St: join_request_view_state::State,
1908    St::RequestedBy: join_request_view_state::IsUnset,
1909{
1910    /// Set the `requestedBy` field (required)
1911    pub fn requested_by(
1912        mut self,
1913        value: impl Into<ProfileViewBasic<S>>,
1914    ) -> JoinRequestViewBuilder<join_request_view_state::SetRequestedBy<St>, S> {
1915        self._fields.2 = Option::Some(value.into());
1916        JoinRequestViewBuilder {
1917            _state: PhantomData,
1918            _fields: self._fields,
1919            _type: PhantomData,
1920        }
1921    }
1922}
1923
1924impl<St, S: BosStr> JoinRequestViewBuilder<St, S>
1925where
1926    St: join_request_view_state::State,
1927    St::ConvoId: join_request_view_state::IsSet,
1928    St::RequestedAt: join_request_view_state::IsSet,
1929    St::RequestedBy: join_request_view_state::IsSet,
1930{
1931    /// Build the final struct.
1932    pub fn build(self) -> JoinRequestView<S> {
1933        JoinRequestView {
1934            convo_id: self._fields.0.unwrap(),
1935            requested_at: self._fields.1.unwrap(),
1936            requested_by: self._fields.2.unwrap(),
1937            extra_data: Default::default(),
1938        }
1939    }
1940    /// Build the final struct with custom extra_data.
1941    pub fn build_with_data(self, extra_data: BTreeMap<SmolStr, Data<S>>) -> JoinRequestView<S> {
1942        JoinRequestView {
1943            convo_id: self._fields.0.unwrap(),
1944            requested_at: self._fields.1.unwrap(),
1945            requested_by: self._fields.2.unwrap(),
1946            extra_data: Some(extra_data),
1947        }
1948    }
1949}