Skip to main content

jacquard_api/app_bsky/
graph.rs

1// @generated by jacquard-lexicon. DO NOT EDIT.
2//
3// Lexicon: app.bsky.graph.defs
4//
5// This file was automatically generated from Lexicon schemas.
6// Any manual changes will be overwritten on the next regeneration.
7
8pub mod block;
9pub mod follow;
10pub mod get_actor_starter_packs;
11pub mod get_blocks;
12pub mod get_followers;
13pub mod get_follows;
14pub mod get_known_followers;
15pub mod get_list;
16pub mod get_list_blocks;
17pub mod get_list_mutes;
18pub mod get_lists;
19pub mod get_lists_with_membership;
20pub mod get_mutes;
21pub mod get_relationships;
22pub mod get_starter_pack;
23pub mod get_starter_packs;
24pub mod get_starter_packs_with_membership;
25pub mod get_suggested_follows_by_actor;
26pub mod list;
27pub mod listblock;
28pub mod listitem;
29pub mod mute_actor;
30pub mod mute_actor_list;
31pub mod mute_thread;
32pub mod search_starter_packs;
33pub mod starterpack;
34pub mod unmute_actor;
35pub mod unmute_actor_list;
36pub mod unmute_thread;
37pub mod verification;
38
39
40#[allow(unused_imports)]
41use alloc::collections::BTreeMap;
42
43#[allow(unused_imports)]
44use core::marker::PhantomData;
45use jacquard_common::CowStr;
46
47#[allow(unused_imports)]
48use jacquard_common::deps::codegen::unicode_segmentation::UnicodeSegmentation;
49use jacquard_common::types::ident::AtIdentifier;
50use jacquard_common::types::string::{Did, AtUri, Cid, Datetime, UriValue};
51use jacquard_common::types::value::Data;
52use jacquard_derive::{IntoStatic, lexicon};
53use jacquard_lexicon::lexicon::LexiconDoc;
54use jacquard_lexicon::schema::LexiconSchema;
55
56#[allow(unused_imports)]
57use jacquard_lexicon::validation::{ConstraintError, ValidationPath};
58use serde::{Serialize, Deserialize};
59use crate::app_bsky::actor::ProfileView;
60use crate::app_bsky::actor::ProfileViewBasic;
61use crate::app_bsky::feed::GeneratorView;
62use crate::app_bsky::richtext::facet::Facet;
63use crate::com_atproto::label::Label;
64use crate::app_bsky::graph;
65/// A list of actors used for curation purposes such as list feeds or interaction gating.
66
67#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)]
68pub struct Curatelist;
69impl core::fmt::Display for Curatelist {
70    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
71        write!(f, "curatelist")
72    }
73}
74
75
76#[lexicon]
77#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
78#[serde(rename_all = "camelCase")]
79pub struct ListItemView<'a> {
80    #[serde(borrow)]
81    pub subject: ProfileView<'a>,
82    #[serde(borrow)]
83    pub uri: AtUri<'a>,
84}
85
86
87#[derive(Debug, Clone, PartialEq, Eq, Hash)]
88pub enum ListPurpose<'a> {
89    AppBskyGraphDefsModlist,
90    AppBskyGraphDefsCuratelist,
91    AppBskyGraphDefsReferencelist,
92    Other(CowStr<'a>),
93}
94
95impl<'a> ListPurpose<'a> {
96    pub fn as_str(&self) -> &str {
97        match self {
98            Self::AppBskyGraphDefsModlist => "app.bsky.graph.defs#modlist",
99            Self::AppBskyGraphDefsCuratelist => "app.bsky.graph.defs#curatelist",
100            Self::AppBskyGraphDefsReferencelist => "app.bsky.graph.defs#referencelist",
101            Self::Other(s) => s.as_ref(),
102        }
103    }
104}
105
106impl<'a> From<&'a str> for ListPurpose<'a> {
107    fn from(s: &'a str) -> Self {
108        match s {
109            "app.bsky.graph.defs#modlist" => Self::AppBskyGraphDefsModlist,
110            "app.bsky.graph.defs#curatelist" => Self::AppBskyGraphDefsCuratelist,
111            "app.bsky.graph.defs#referencelist" => Self::AppBskyGraphDefsReferencelist,
112            _ => Self::Other(CowStr::from(s)),
113        }
114    }
115}
116
117impl<'a> From<String> for ListPurpose<'a> {
118    fn from(s: String) -> Self {
119        match s.as_str() {
120            "app.bsky.graph.defs#modlist" => Self::AppBskyGraphDefsModlist,
121            "app.bsky.graph.defs#curatelist" => Self::AppBskyGraphDefsCuratelist,
122            "app.bsky.graph.defs#referencelist" => Self::AppBskyGraphDefsReferencelist,
123            _ => Self::Other(CowStr::from(s)),
124        }
125    }
126}
127
128impl<'a> AsRef<str> for ListPurpose<'a> {
129    fn as_ref(&self) -> &str {
130        self.as_str()
131    }
132}
133
134impl<'a> core::fmt::Display for ListPurpose<'a> {
135    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
136        write!(f, "{}", self.as_str())
137    }
138}
139
140impl<'a> serde::Serialize for ListPurpose<'a> {
141    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
142    where
143        S: serde::Serializer,
144    {
145        serializer.serialize_str(self.as_str())
146    }
147}
148
149impl<'de, 'a> serde::Deserialize<'de> for ListPurpose<'a>
150where
151    'de: 'a,
152{
153    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
154    where
155        D: serde::Deserializer<'de>,
156    {
157        let s = <&'de str>::deserialize(deserializer)?;
158        Ok(Self::from(s))
159    }
160}
161
162impl jacquard_common::IntoStatic for ListPurpose<'_> {
163    type Output = ListPurpose<'static>;
164    fn into_static(self) -> Self::Output {
165        match self {
166            ListPurpose::AppBskyGraphDefsModlist => ListPurpose::AppBskyGraphDefsModlist,
167            ListPurpose::AppBskyGraphDefsCuratelist => {
168                ListPurpose::AppBskyGraphDefsCuratelist
169            }
170            ListPurpose::AppBskyGraphDefsReferencelist => {
171                ListPurpose::AppBskyGraphDefsReferencelist
172            }
173            ListPurpose::Other(v) => ListPurpose::Other(v.into_static()),
174        }
175    }
176}
177
178
179#[lexicon]
180#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
181#[serde(rename_all = "camelCase")]
182pub struct ListView<'a> {
183    #[serde(skip_serializing_if = "Option::is_none")]
184    #[serde(borrow)]
185    pub avatar: Option<UriValue<'a>>,
186    #[serde(borrow)]
187    pub cid: Cid<'a>,
188    #[serde(borrow)]
189    pub creator: ProfileView<'a>,
190    #[serde(skip_serializing_if = "Option::is_none")]
191    #[serde(borrow)]
192    pub description: Option<CowStr<'a>>,
193    #[serde(skip_serializing_if = "Option::is_none")]
194    #[serde(borrow)]
195    pub description_facets: Option<Vec<Facet<'a>>>,
196    pub indexed_at: Datetime,
197    #[serde(skip_serializing_if = "Option::is_none")]
198    #[serde(borrow)]
199    pub labels: Option<Vec<Label<'a>>>,
200    #[serde(skip_serializing_if = "Option::is_none")]
201    pub list_item_count: Option<i64>,
202    #[serde(borrow)]
203    pub name: CowStr<'a>,
204    #[serde(borrow)]
205    pub purpose: graph::ListPurpose<'a>,
206    #[serde(borrow)]
207    pub uri: AtUri<'a>,
208    #[serde(skip_serializing_if = "Option::is_none")]
209    #[serde(borrow)]
210    pub viewer: Option<graph::ListViewerState<'a>>,
211}
212
213
214#[lexicon]
215#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
216#[serde(rename_all = "camelCase")]
217pub struct ListViewBasic<'a> {
218    #[serde(skip_serializing_if = "Option::is_none")]
219    #[serde(borrow)]
220    pub avatar: Option<UriValue<'a>>,
221    #[serde(borrow)]
222    pub cid: Cid<'a>,
223    #[serde(skip_serializing_if = "Option::is_none")]
224    pub indexed_at: Option<Datetime>,
225    #[serde(skip_serializing_if = "Option::is_none")]
226    #[serde(borrow)]
227    pub labels: Option<Vec<Label<'a>>>,
228    #[serde(skip_serializing_if = "Option::is_none")]
229    pub list_item_count: Option<i64>,
230    #[serde(borrow)]
231    pub name: CowStr<'a>,
232    #[serde(borrow)]
233    pub purpose: graph::ListPurpose<'a>,
234    #[serde(borrow)]
235    pub uri: AtUri<'a>,
236    #[serde(skip_serializing_if = "Option::is_none")]
237    #[serde(borrow)]
238    pub viewer: Option<graph::ListViewerState<'a>>,
239}
240
241
242#[lexicon]
243#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
244#[serde(rename_all = "camelCase")]
245pub struct ListViewerState<'a> {
246    #[serde(skip_serializing_if = "Option::is_none")]
247    #[serde(borrow)]
248    pub blocked: Option<AtUri<'a>>,
249    #[serde(skip_serializing_if = "Option::is_none")]
250    pub muted: Option<bool>,
251}
252
253/// A list of actors to apply an aggregate moderation action (mute/block) on.
254
255#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)]
256pub struct Modlist;
257impl core::fmt::Display for Modlist {
258    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
259        write!(f, "modlist")
260    }
261}
262
263/// indicates that a handle or DID could not be resolved
264
265#[lexicon]
266#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
267#[serde(rename_all = "camelCase")]
268pub struct NotFoundActor<'a> {
269    #[serde(borrow)]
270    pub actor: AtIdentifier<'a>,
271    pub not_found: bool,
272}
273
274/// A list of actors used for only for reference purposes such as within a starter pack.
275
276#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)]
277pub struct Referencelist;
278impl core::fmt::Display for Referencelist {
279    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
280        write!(f, "referencelist")
281    }
282}
283
284/// lists the bi-directional graph relationships between one actor (not indicated in the object), and the target actors (the DID included in the object)
285
286#[lexicon]
287#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
288#[serde(rename_all = "camelCase")]
289pub struct Relationship<'a> {
290    ///if the actor is blocked by this DID, contains the AT-URI of the block record
291    #[serde(skip_serializing_if = "Option::is_none")]
292    #[serde(borrow)]
293    pub blocked_by: Option<AtUri<'a>>,
294    ///if the actor is blocked by this DID via a block list, contains the AT-URI of the listblock record
295    #[serde(skip_serializing_if = "Option::is_none")]
296    #[serde(borrow)]
297    pub blocked_by_list: Option<AtUri<'a>>,
298    ///if the actor blocks this DID, this is the AT-URI of the block record
299    #[serde(skip_serializing_if = "Option::is_none")]
300    #[serde(borrow)]
301    pub blocking: Option<AtUri<'a>>,
302    ///if the actor blocks this DID via a block list, this is the AT-URI of the listblock record
303    #[serde(skip_serializing_if = "Option::is_none")]
304    #[serde(borrow)]
305    pub blocking_by_list: Option<AtUri<'a>>,
306    #[serde(borrow)]
307    pub did: Did<'a>,
308    ///if the actor is followed by this DID, contains the AT-URI of the follow record
309    #[serde(skip_serializing_if = "Option::is_none")]
310    #[serde(borrow)]
311    pub followed_by: Option<AtUri<'a>>,
312    ///if the actor follows this DID, this is the AT-URI of the follow record
313    #[serde(skip_serializing_if = "Option::is_none")]
314    #[serde(borrow)]
315    pub following: Option<AtUri<'a>>,
316}
317
318
319#[lexicon]
320#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
321#[serde(rename_all = "camelCase")]
322pub struct StarterPackView<'a> {
323    #[serde(borrow)]
324    pub cid: Cid<'a>,
325    #[serde(borrow)]
326    pub creator: ProfileViewBasic<'a>,
327    #[serde(skip_serializing_if = "Option::is_none")]
328    #[serde(borrow)]
329    pub feeds: Option<Vec<GeneratorView<'a>>>,
330    pub indexed_at: Datetime,
331    #[serde(skip_serializing_if = "Option::is_none")]
332    pub joined_all_time_count: Option<i64>,
333    #[serde(skip_serializing_if = "Option::is_none")]
334    pub joined_week_count: Option<i64>,
335    #[serde(skip_serializing_if = "Option::is_none")]
336    #[serde(borrow)]
337    pub labels: Option<Vec<Label<'a>>>,
338    #[serde(skip_serializing_if = "Option::is_none")]
339    #[serde(borrow)]
340    pub list: Option<graph::ListViewBasic<'a>>,
341    #[serde(skip_serializing_if = "Option::is_none")]
342    #[serde(borrow)]
343    pub list_items_sample: Option<Vec<graph::ListItemView<'a>>>,
344    #[serde(borrow)]
345    pub record: Data<'a>,
346    #[serde(borrow)]
347    pub uri: AtUri<'a>,
348}
349
350
351#[lexicon]
352#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
353#[serde(rename_all = "camelCase")]
354pub struct StarterPackViewBasic<'a> {
355    #[serde(borrow)]
356    pub cid: Cid<'a>,
357    #[serde(borrow)]
358    pub creator: ProfileViewBasic<'a>,
359    pub indexed_at: Datetime,
360    #[serde(skip_serializing_if = "Option::is_none")]
361    pub joined_all_time_count: Option<i64>,
362    #[serde(skip_serializing_if = "Option::is_none")]
363    pub joined_week_count: Option<i64>,
364    #[serde(skip_serializing_if = "Option::is_none")]
365    #[serde(borrow)]
366    pub labels: Option<Vec<Label<'a>>>,
367    #[serde(skip_serializing_if = "Option::is_none")]
368    pub list_item_count: Option<i64>,
369    #[serde(borrow)]
370    pub record: Data<'a>,
371    #[serde(borrow)]
372    pub uri: AtUri<'a>,
373}
374
375impl<'a> LexiconSchema for ListItemView<'a> {
376    fn nsid() -> &'static str {
377        "app.bsky.graph.defs"
378    }
379    fn def_name() -> &'static str {
380        "listItemView"
381    }
382    fn lexicon_doc() -> LexiconDoc<'static> {
383        lexicon_doc_app_bsky_graph_defs()
384    }
385    fn validate(&self) -> Result<(), ConstraintError> {
386        Ok(())
387    }
388}
389
390impl<'a> LexiconSchema for ListView<'a> {
391    fn nsid() -> &'static str {
392        "app.bsky.graph.defs"
393    }
394    fn def_name() -> &'static str {
395        "listView"
396    }
397    fn lexicon_doc() -> LexiconDoc<'static> {
398        lexicon_doc_app_bsky_graph_defs()
399    }
400    fn validate(&self) -> Result<(), ConstraintError> {
401        if let Some(ref value) = self.description {
402            #[allow(unused_comparisons)]
403            if <str>::len(value.as_ref()) > 3000usize {
404                return Err(ConstraintError::MaxLength {
405                    path: ValidationPath::from_field("description"),
406                    max: 3000usize,
407                    actual: <str>::len(value.as_ref()),
408                });
409            }
410        }
411        if let Some(ref value) = self.description {
412            {
413                let count = UnicodeSegmentation::graphemes(value.as_ref(), true).count();
414                if count > 300usize {
415                    return Err(ConstraintError::MaxGraphemes {
416                        path: ValidationPath::from_field("description"),
417                        max: 300usize,
418                        actual: count,
419                    });
420                }
421            }
422        }
423        if let Some(ref value) = self.list_item_count {
424            if *value < 0i64 {
425                return Err(ConstraintError::Minimum {
426                    path: ValidationPath::from_field("list_item_count"),
427                    min: 0i64,
428                    actual: *value,
429                });
430            }
431        }
432        {
433            let value = &self.name;
434            #[allow(unused_comparisons)]
435            if <str>::len(value.as_ref()) > 64usize {
436                return Err(ConstraintError::MaxLength {
437                    path: ValidationPath::from_field("name"),
438                    max: 64usize,
439                    actual: <str>::len(value.as_ref()),
440                });
441            }
442        }
443        {
444            let value = &self.name;
445            #[allow(unused_comparisons)]
446            if <str>::len(value.as_ref()) < 1usize {
447                return Err(ConstraintError::MinLength {
448                    path: ValidationPath::from_field("name"),
449                    min: 1usize,
450                    actual: <str>::len(value.as_ref()),
451                });
452            }
453        }
454        Ok(())
455    }
456}
457
458impl<'a> LexiconSchema for ListViewBasic<'a> {
459    fn nsid() -> &'static str {
460        "app.bsky.graph.defs"
461    }
462    fn def_name() -> &'static str {
463        "listViewBasic"
464    }
465    fn lexicon_doc() -> LexiconDoc<'static> {
466        lexicon_doc_app_bsky_graph_defs()
467    }
468    fn validate(&self) -> Result<(), ConstraintError> {
469        if let Some(ref value) = self.list_item_count {
470            if *value < 0i64 {
471                return Err(ConstraintError::Minimum {
472                    path: ValidationPath::from_field("list_item_count"),
473                    min: 0i64,
474                    actual: *value,
475                });
476            }
477        }
478        {
479            let value = &self.name;
480            #[allow(unused_comparisons)]
481            if <str>::len(value.as_ref()) > 64usize {
482                return Err(ConstraintError::MaxLength {
483                    path: ValidationPath::from_field("name"),
484                    max: 64usize,
485                    actual: <str>::len(value.as_ref()),
486                });
487            }
488        }
489        {
490            let value = &self.name;
491            #[allow(unused_comparisons)]
492            if <str>::len(value.as_ref()) < 1usize {
493                return Err(ConstraintError::MinLength {
494                    path: ValidationPath::from_field("name"),
495                    min: 1usize,
496                    actual: <str>::len(value.as_ref()),
497                });
498            }
499        }
500        Ok(())
501    }
502}
503
504impl<'a> LexiconSchema for ListViewerState<'a> {
505    fn nsid() -> &'static str {
506        "app.bsky.graph.defs"
507    }
508    fn def_name() -> &'static str {
509        "listViewerState"
510    }
511    fn lexicon_doc() -> LexiconDoc<'static> {
512        lexicon_doc_app_bsky_graph_defs()
513    }
514    fn validate(&self) -> Result<(), ConstraintError> {
515        Ok(())
516    }
517}
518
519impl<'a> LexiconSchema for NotFoundActor<'a> {
520    fn nsid() -> &'static str {
521        "app.bsky.graph.defs"
522    }
523    fn def_name() -> &'static str {
524        "notFoundActor"
525    }
526    fn lexicon_doc() -> LexiconDoc<'static> {
527        lexicon_doc_app_bsky_graph_defs()
528    }
529    fn validate(&self) -> Result<(), ConstraintError> {
530        Ok(())
531    }
532}
533
534impl<'a> LexiconSchema for Relationship<'a> {
535    fn nsid() -> &'static str {
536        "app.bsky.graph.defs"
537    }
538    fn def_name() -> &'static str {
539        "relationship"
540    }
541    fn lexicon_doc() -> LexiconDoc<'static> {
542        lexicon_doc_app_bsky_graph_defs()
543    }
544    fn validate(&self) -> Result<(), ConstraintError> {
545        Ok(())
546    }
547}
548
549impl<'a> LexiconSchema for StarterPackView<'a> {
550    fn nsid() -> &'static str {
551        "app.bsky.graph.defs"
552    }
553    fn def_name() -> &'static str {
554        "starterPackView"
555    }
556    fn lexicon_doc() -> LexiconDoc<'static> {
557        lexicon_doc_app_bsky_graph_defs()
558    }
559    fn validate(&self) -> Result<(), ConstraintError> {
560        if let Some(ref value) = self.feeds {
561            #[allow(unused_comparisons)]
562            if value.len() > 3usize {
563                return Err(ConstraintError::MaxLength {
564                    path: ValidationPath::from_field("feeds"),
565                    max: 3usize,
566                    actual: value.len(),
567                });
568            }
569        }
570        if let Some(ref value) = self.joined_all_time_count {
571            if *value < 0i64 {
572                return Err(ConstraintError::Minimum {
573                    path: ValidationPath::from_field("joined_all_time_count"),
574                    min: 0i64,
575                    actual: *value,
576                });
577            }
578        }
579        if let Some(ref value) = self.joined_week_count {
580            if *value < 0i64 {
581                return Err(ConstraintError::Minimum {
582                    path: ValidationPath::from_field("joined_week_count"),
583                    min: 0i64,
584                    actual: *value,
585                });
586            }
587        }
588        if let Some(ref value) = self.list_items_sample {
589            #[allow(unused_comparisons)]
590            if value.len() > 12usize {
591                return Err(ConstraintError::MaxLength {
592                    path: ValidationPath::from_field("list_items_sample"),
593                    max: 12usize,
594                    actual: value.len(),
595                });
596            }
597        }
598        Ok(())
599    }
600}
601
602impl<'a> LexiconSchema for StarterPackViewBasic<'a> {
603    fn nsid() -> &'static str {
604        "app.bsky.graph.defs"
605    }
606    fn def_name() -> &'static str {
607        "starterPackViewBasic"
608    }
609    fn lexicon_doc() -> LexiconDoc<'static> {
610        lexicon_doc_app_bsky_graph_defs()
611    }
612    fn validate(&self) -> Result<(), ConstraintError> {
613        if let Some(ref value) = self.joined_all_time_count {
614            if *value < 0i64 {
615                return Err(ConstraintError::Minimum {
616                    path: ValidationPath::from_field("joined_all_time_count"),
617                    min: 0i64,
618                    actual: *value,
619                });
620            }
621        }
622        if let Some(ref value) = self.joined_week_count {
623            if *value < 0i64 {
624                return Err(ConstraintError::Minimum {
625                    path: ValidationPath::from_field("joined_week_count"),
626                    min: 0i64,
627                    actual: *value,
628                });
629            }
630        }
631        if let Some(ref value) = self.list_item_count {
632            if *value < 0i64 {
633                return Err(ConstraintError::Minimum {
634                    path: ValidationPath::from_field("list_item_count"),
635                    min: 0i64,
636                    actual: *value,
637                });
638            }
639        }
640        Ok(())
641    }
642}
643
644pub mod list_item_view_state {
645
646    pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
647    #[allow(unused)]
648    use ::core::marker::PhantomData;
649    mod sealed {
650        pub trait Sealed {}
651    }
652    /// State trait tracking which required fields have been set
653    pub trait State: sealed::Sealed {
654        type Subject;
655        type Uri;
656    }
657    /// Empty state - all required fields are unset
658    pub struct Empty(());
659    impl sealed::Sealed for Empty {}
660    impl State for Empty {
661        type Subject = Unset;
662        type Uri = Unset;
663    }
664    ///State transition - sets the `subject` field to Set
665    pub struct SetSubject<S: State = Empty>(PhantomData<fn() -> S>);
666    impl<S: State> sealed::Sealed for SetSubject<S> {}
667    impl<S: State> State for SetSubject<S> {
668        type Subject = Set<members::subject>;
669        type Uri = S::Uri;
670    }
671    ///State transition - sets the `uri` field to Set
672    pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>);
673    impl<S: State> sealed::Sealed for SetUri<S> {}
674    impl<S: State> State for SetUri<S> {
675        type Subject = S::Subject;
676        type Uri = Set<members::uri>;
677    }
678    /// Marker types for field names
679    #[allow(non_camel_case_types)]
680    pub mod members {
681        ///Marker type for the `subject` field
682        pub struct subject(());
683        ///Marker type for the `uri` field
684        pub struct uri(());
685    }
686}
687
688/// Builder for constructing an instance of this type
689pub struct ListItemViewBuilder<'a, S: list_item_view_state::State> {
690    _state: PhantomData<fn() -> S>,
691    _fields: (Option<ProfileView<'a>>, Option<AtUri<'a>>),
692    _lifetime: PhantomData<&'a ()>,
693}
694
695impl<'a> ListItemView<'a> {
696    /// Create a new builder for this type
697    pub fn new() -> ListItemViewBuilder<'a, list_item_view_state::Empty> {
698        ListItemViewBuilder::new()
699    }
700}
701
702impl<'a> ListItemViewBuilder<'a, list_item_view_state::Empty> {
703    /// Create a new builder with all fields unset
704    pub fn new() -> Self {
705        ListItemViewBuilder {
706            _state: PhantomData,
707            _fields: (None, None),
708            _lifetime: PhantomData,
709        }
710    }
711}
712
713impl<'a, S> ListItemViewBuilder<'a, S>
714where
715    S: list_item_view_state::State,
716    S::Subject: list_item_view_state::IsUnset,
717{
718    /// Set the `subject` field (required)
719    pub fn subject(
720        mut self,
721        value: impl Into<ProfileView<'a>>,
722    ) -> ListItemViewBuilder<'a, list_item_view_state::SetSubject<S>> {
723        self._fields.0 = Option::Some(value.into());
724        ListItemViewBuilder {
725            _state: PhantomData,
726            _fields: self._fields,
727            _lifetime: PhantomData,
728        }
729    }
730}
731
732impl<'a, S> ListItemViewBuilder<'a, S>
733where
734    S: list_item_view_state::State,
735    S::Uri: list_item_view_state::IsUnset,
736{
737    /// Set the `uri` field (required)
738    pub fn uri(
739        mut self,
740        value: impl Into<AtUri<'a>>,
741    ) -> ListItemViewBuilder<'a, list_item_view_state::SetUri<S>> {
742        self._fields.1 = Option::Some(value.into());
743        ListItemViewBuilder {
744            _state: PhantomData,
745            _fields: self._fields,
746            _lifetime: PhantomData,
747        }
748    }
749}
750
751impl<'a, S> ListItemViewBuilder<'a, S>
752where
753    S: list_item_view_state::State,
754    S::Subject: list_item_view_state::IsSet,
755    S::Uri: list_item_view_state::IsSet,
756{
757    /// Build the final struct
758    pub fn build(self) -> ListItemView<'a> {
759        ListItemView {
760            subject: self._fields.0.unwrap(),
761            uri: self._fields.1.unwrap(),
762            extra_data: Default::default(),
763        }
764    }
765    /// Build the final struct with custom extra_data
766    pub fn build_with_data(
767        self,
768        extra_data: BTreeMap<jacquard_common::deps::smol_str::SmolStr, Data<'a>>,
769    ) -> ListItemView<'a> {
770        ListItemView {
771            subject: self._fields.0.unwrap(),
772            uri: self._fields.1.unwrap(),
773            extra_data: Some(extra_data),
774        }
775    }
776}
777
778fn lexicon_doc_app_bsky_graph_defs() -> LexiconDoc<'static> {
779    #[allow(unused_imports)]
780    use jacquard_common::{CowStr, deps::smol_str::SmolStr, types::blob::MimeType};
781    use jacquard_lexicon::lexicon::*;
782    use alloc::collections::BTreeMap;
783    LexiconDoc {
784        lexicon: Lexicon::Lexicon1,
785        id: CowStr::new_static("app.bsky.graph.defs"),
786        defs: {
787            let mut map = BTreeMap::new();
788            map.insert(
789                SmolStr::new_static("curatelist"),
790                LexUserType::Token(LexToken { ..Default::default() }),
791            );
792            map.insert(
793                SmolStr::new_static("listItemView"),
794                LexUserType::Object(LexObject {
795                    required: Some(
796                        vec![SmolStr::new_static("uri"), SmolStr::new_static("subject")],
797                    ),
798                    properties: {
799                        #[allow(unused_mut)]
800                        let mut map = BTreeMap::new();
801                        map.insert(
802                            SmolStr::new_static("subject"),
803                            LexObjectProperty::Ref(LexRef {
804                                r#ref: CowStr::new_static(
805                                    "app.bsky.actor.defs#profileView",
806                                ),
807                                ..Default::default()
808                            }),
809                        );
810                        map.insert(
811                            SmolStr::new_static("uri"),
812                            LexObjectProperty::String(LexString {
813                                format: Some(LexStringFormat::AtUri),
814                                ..Default::default()
815                            }),
816                        );
817                        map
818                    },
819                    ..Default::default()
820                }),
821            );
822            map.insert(
823                SmolStr::new_static("listPurpose"),
824                LexUserType::String(LexString { ..Default::default() }),
825            );
826            map.insert(
827                SmolStr::new_static("listView"),
828                LexUserType::Object(LexObject {
829                    required: Some(
830                        vec![
831                            SmolStr::new_static("uri"), SmolStr::new_static("cid"),
832                            SmolStr::new_static("creator"), SmolStr::new_static("name"),
833                            SmolStr::new_static("purpose"),
834                            SmolStr::new_static("indexedAt")
835                        ],
836                    ),
837                    properties: {
838                        #[allow(unused_mut)]
839                        let mut map = BTreeMap::new();
840                        map.insert(
841                            SmolStr::new_static("avatar"),
842                            LexObjectProperty::String(LexString {
843                                format: Some(LexStringFormat::Uri),
844                                ..Default::default()
845                            }),
846                        );
847                        map.insert(
848                            SmolStr::new_static("cid"),
849                            LexObjectProperty::String(LexString {
850                                format: Some(LexStringFormat::Cid),
851                                ..Default::default()
852                            }),
853                        );
854                        map.insert(
855                            SmolStr::new_static("creator"),
856                            LexObjectProperty::Ref(LexRef {
857                                r#ref: CowStr::new_static(
858                                    "app.bsky.actor.defs#profileView",
859                                ),
860                                ..Default::default()
861                            }),
862                        );
863                        map.insert(
864                            SmolStr::new_static("description"),
865                            LexObjectProperty::String(LexString {
866                                max_length: Some(3000usize),
867                                max_graphemes: Some(300usize),
868                                ..Default::default()
869                            }),
870                        );
871                        map.insert(
872                            SmolStr::new_static("descriptionFacets"),
873                            LexObjectProperty::Array(LexArray {
874                                items: LexArrayItem::Ref(LexRef {
875                                    r#ref: CowStr::new_static("app.bsky.richtext.facet"),
876                                    ..Default::default()
877                                }),
878                                ..Default::default()
879                            }),
880                        );
881                        map.insert(
882                            SmolStr::new_static("indexedAt"),
883                            LexObjectProperty::String(LexString {
884                                format: Some(LexStringFormat::Datetime),
885                                ..Default::default()
886                            }),
887                        );
888                        map.insert(
889                            SmolStr::new_static("labels"),
890                            LexObjectProperty::Array(LexArray {
891                                items: LexArrayItem::Ref(LexRef {
892                                    r#ref: CowStr::new_static("com.atproto.label.defs#label"),
893                                    ..Default::default()
894                                }),
895                                ..Default::default()
896                            }),
897                        );
898                        map.insert(
899                            SmolStr::new_static("listItemCount"),
900                            LexObjectProperty::Integer(LexInteger {
901                                minimum: Some(0i64),
902                                ..Default::default()
903                            }),
904                        );
905                        map.insert(
906                            SmolStr::new_static("name"),
907                            LexObjectProperty::String(LexString {
908                                min_length: Some(1usize),
909                                max_length: Some(64usize),
910                                ..Default::default()
911                            }),
912                        );
913                        map.insert(
914                            SmolStr::new_static("purpose"),
915                            LexObjectProperty::Ref(LexRef {
916                                r#ref: CowStr::new_static("#listPurpose"),
917                                ..Default::default()
918                            }),
919                        );
920                        map.insert(
921                            SmolStr::new_static("uri"),
922                            LexObjectProperty::String(LexString {
923                                format: Some(LexStringFormat::AtUri),
924                                ..Default::default()
925                            }),
926                        );
927                        map.insert(
928                            SmolStr::new_static("viewer"),
929                            LexObjectProperty::Ref(LexRef {
930                                r#ref: CowStr::new_static("#listViewerState"),
931                                ..Default::default()
932                            }),
933                        );
934                        map
935                    },
936                    ..Default::default()
937                }),
938            );
939            map.insert(
940                SmolStr::new_static("listViewBasic"),
941                LexUserType::Object(LexObject {
942                    required: Some(
943                        vec![
944                            SmolStr::new_static("uri"), SmolStr::new_static("cid"),
945                            SmolStr::new_static("name"), SmolStr::new_static("purpose")
946                        ],
947                    ),
948                    properties: {
949                        #[allow(unused_mut)]
950                        let mut map = BTreeMap::new();
951                        map.insert(
952                            SmolStr::new_static("avatar"),
953                            LexObjectProperty::String(LexString {
954                                format: Some(LexStringFormat::Uri),
955                                ..Default::default()
956                            }),
957                        );
958                        map.insert(
959                            SmolStr::new_static("cid"),
960                            LexObjectProperty::String(LexString {
961                                format: Some(LexStringFormat::Cid),
962                                ..Default::default()
963                            }),
964                        );
965                        map.insert(
966                            SmolStr::new_static("indexedAt"),
967                            LexObjectProperty::String(LexString {
968                                format: Some(LexStringFormat::Datetime),
969                                ..Default::default()
970                            }),
971                        );
972                        map.insert(
973                            SmolStr::new_static("labels"),
974                            LexObjectProperty::Array(LexArray {
975                                items: LexArrayItem::Ref(LexRef {
976                                    r#ref: CowStr::new_static("com.atproto.label.defs#label"),
977                                    ..Default::default()
978                                }),
979                                ..Default::default()
980                            }),
981                        );
982                        map.insert(
983                            SmolStr::new_static("listItemCount"),
984                            LexObjectProperty::Integer(LexInteger {
985                                minimum: Some(0i64),
986                                ..Default::default()
987                            }),
988                        );
989                        map.insert(
990                            SmolStr::new_static("name"),
991                            LexObjectProperty::String(LexString {
992                                min_length: Some(1usize),
993                                max_length: Some(64usize),
994                                ..Default::default()
995                            }),
996                        );
997                        map.insert(
998                            SmolStr::new_static("purpose"),
999                            LexObjectProperty::Ref(LexRef {
1000                                r#ref: CowStr::new_static("#listPurpose"),
1001                                ..Default::default()
1002                            }),
1003                        );
1004                        map.insert(
1005                            SmolStr::new_static("uri"),
1006                            LexObjectProperty::String(LexString {
1007                                format: Some(LexStringFormat::AtUri),
1008                                ..Default::default()
1009                            }),
1010                        );
1011                        map.insert(
1012                            SmolStr::new_static("viewer"),
1013                            LexObjectProperty::Ref(LexRef {
1014                                r#ref: CowStr::new_static("#listViewerState"),
1015                                ..Default::default()
1016                            }),
1017                        );
1018                        map
1019                    },
1020                    ..Default::default()
1021                }),
1022            );
1023            map.insert(
1024                SmolStr::new_static("listViewerState"),
1025                LexUserType::Object(LexObject {
1026                    properties: {
1027                        #[allow(unused_mut)]
1028                        let mut map = BTreeMap::new();
1029                        map.insert(
1030                            SmolStr::new_static("blocked"),
1031                            LexObjectProperty::String(LexString {
1032                                format: Some(LexStringFormat::AtUri),
1033                                ..Default::default()
1034                            }),
1035                        );
1036                        map.insert(
1037                            SmolStr::new_static("muted"),
1038                            LexObjectProperty::Boolean(LexBoolean {
1039                                ..Default::default()
1040                            }),
1041                        );
1042                        map
1043                    },
1044                    ..Default::default()
1045                }),
1046            );
1047            map.insert(
1048                SmolStr::new_static("modlist"),
1049                LexUserType::Token(LexToken { ..Default::default() }),
1050            );
1051            map.insert(
1052                SmolStr::new_static("notFoundActor"),
1053                LexUserType::Object(LexObject {
1054                    description: Some(
1055                        CowStr::new_static(
1056                            "indicates that a handle or DID could not be resolved",
1057                        ),
1058                    ),
1059                    required: Some(
1060                        vec![
1061                            SmolStr::new_static("actor"), SmolStr::new_static("notFound")
1062                        ],
1063                    ),
1064                    properties: {
1065                        #[allow(unused_mut)]
1066                        let mut map = BTreeMap::new();
1067                        map.insert(
1068                            SmolStr::new_static("actor"),
1069                            LexObjectProperty::String(LexString {
1070                                format: Some(LexStringFormat::AtIdentifier),
1071                                ..Default::default()
1072                            }),
1073                        );
1074                        map.insert(
1075                            SmolStr::new_static("notFound"),
1076                            LexObjectProperty::Boolean(LexBoolean {
1077                                ..Default::default()
1078                            }),
1079                        );
1080                        map
1081                    },
1082                    ..Default::default()
1083                }),
1084            );
1085            map.insert(
1086                SmolStr::new_static("referencelist"),
1087                LexUserType::Token(LexToken { ..Default::default() }),
1088            );
1089            map.insert(
1090                SmolStr::new_static("relationship"),
1091                LexUserType::Object(LexObject {
1092                    description: Some(
1093                        CowStr::new_static(
1094                            "lists the bi-directional graph relationships between one actor (not indicated in the object), and the target actors (the DID included in the object)",
1095                        ),
1096                    ),
1097                    required: Some(vec![SmolStr::new_static("did")]),
1098                    properties: {
1099                        #[allow(unused_mut)]
1100                        let mut map = BTreeMap::new();
1101                        map.insert(
1102                            SmolStr::new_static("blockedBy"),
1103                            LexObjectProperty::String(LexString {
1104                                description: Some(
1105                                    CowStr::new_static(
1106                                        "if the actor is blocked by this DID, contains the AT-URI of the block record",
1107                                    ),
1108                                ),
1109                                format: Some(LexStringFormat::AtUri),
1110                                ..Default::default()
1111                            }),
1112                        );
1113                        map.insert(
1114                            SmolStr::new_static("blockedByList"),
1115                            LexObjectProperty::String(LexString {
1116                                description: Some(
1117                                    CowStr::new_static(
1118                                        "if the actor is blocked by this DID via a block list, contains the AT-URI of the listblock record",
1119                                    ),
1120                                ),
1121                                format: Some(LexStringFormat::AtUri),
1122                                ..Default::default()
1123                            }),
1124                        );
1125                        map.insert(
1126                            SmolStr::new_static("blocking"),
1127                            LexObjectProperty::String(LexString {
1128                                description: Some(
1129                                    CowStr::new_static(
1130                                        "if the actor blocks this DID, this is the AT-URI of the block record",
1131                                    ),
1132                                ),
1133                                format: Some(LexStringFormat::AtUri),
1134                                ..Default::default()
1135                            }),
1136                        );
1137                        map.insert(
1138                            SmolStr::new_static("blockingByList"),
1139                            LexObjectProperty::String(LexString {
1140                                description: Some(
1141                                    CowStr::new_static(
1142                                        "if the actor blocks this DID via a block list, this is the AT-URI of the listblock record",
1143                                    ),
1144                                ),
1145                                format: Some(LexStringFormat::AtUri),
1146                                ..Default::default()
1147                            }),
1148                        );
1149                        map.insert(
1150                            SmolStr::new_static("did"),
1151                            LexObjectProperty::String(LexString {
1152                                format: Some(LexStringFormat::Did),
1153                                ..Default::default()
1154                            }),
1155                        );
1156                        map.insert(
1157                            SmolStr::new_static("followedBy"),
1158                            LexObjectProperty::String(LexString {
1159                                description: Some(
1160                                    CowStr::new_static(
1161                                        "if the actor is followed by this DID, contains the AT-URI of the follow record",
1162                                    ),
1163                                ),
1164                                format: Some(LexStringFormat::AtUri),
1165                                ..Default::default()
1166                            }),
1167                        );
1168                        map.insert(
1169                            SmolStr::new_static("following"),
1170                            LexObjectProperty::String(LexString {
1171                                description: Some(
1172                                    CowStr::new_static(
1173                                        "if the actor follows this DID, this is the AT-URI of the follow record",
1174                                    ),
1175                                ),
1176                                format: Some(LexStringFormat::AtUri),
1177                                ..Default::default()
1178                            }),
1179                        );
1180                        map
1181                    },
1182                    ..Default::default()
1183                }),
1184            );
1185            map.insert(
1186                SmolStr::new_static("starterPackView"),
1187                LexUserType::Object(LexObject {
1188                    required: Some(
1189                        vec![
1190                            SmolStr::new_static("uri"), SmolStr::new_static("cid"),
1191                            SmolStr::new_static("record"),
1192                            SmolStr::new_static("creator"),
1193                            SmolStr::new_static("indexedAt")
1194                        ],
1195                    ),
1196                    properties: {
1197                        #[allow(unused_mut)]
1198                        let mut map = BTreeMap::new();
1199                        map.insert(
1200                            SmolStr::new_static("cid"),
1201                            LexObjectProperty::String(LexString {
1202                                format: Some(LexStringFormat::Cid),
1203                                ..Default::default()
1204                            }),
1205                        );
1206                        map.insert(
1207                            SmolStr::new_static("creator"),
1208                            LexObjectProperty::Ref(LexRef {
1209                                r#ref: CowStr::new_static(
1210                                    "app.bsky.actor.defs#profileViewBasic",
1211                                ),
1212                                ..Default::default()
1213                            }),
1214                        );
1215                        map.insert(
1216                            SmolStr::new_static("feeds"),
1217                            LexObjectProperty::Array(LexArray {
1218                                items: LexArrayItem::Ref(LexRef {
1219                                    r#ref: CowStr::new_static(
1220                                        "app.bsky.feed.defs#generatorView",
1221                                    ),
1222                                    ..Default::default()
1223                                }),
1224                                max_length: Some(3usize),
1225                                ..Default::default()
1226                            }),
1227                        );
1228                        map.insert(
1229                            SmolStr::new_static("indexedAt"),
1230                            LexObjectProperty::String(LexString {
1231                                format: Some(LexStringFormat::Datetime),
1232                                ..Default::default()
1233                            }),
1234                        );
1235                        map.insert(
1236                            SmolStr::new_static("joinedAllTimeCount"),
1237                            LexObjectProperty::Integer(LexInteger {
1238                                minimum: Some(0i64),
1239                                ..Default::default()
1240                            }),
1241                        );
1242                        map.insert(
1243                            SmolStr::new_static("joinedWeekCount"),
1244                            LexObjectProperty::Integer(LexInteger {
1245                                minimum: Some(0i64),
1246                                ..Default::default()
1247                            }),
1248                        );
1249                        map.insert(
1250                            SmolStr::new_static("labels"),
1251                            LexObjectProperty::Array(LexArray {
1252                                items: LexArrayItem::Ref(LexRef {
1253                                    r#ref: CowStr::new_static("com.atproto.label.defs#label"),
1254                                    ..Default::default()
1255                                }),
1256                                ..Default::default()
1257                            }),
1258                        );
1259                        map.insert(
1260                            SmolStr::new_static("list"),
1261                            LexObjectProperty::Ref(LexRef {
1262                                r#ref: CowStr::new_static("#listViewBasic"),
1263                                ..Default::default()
1264                            }),
1265                        );
1266                        map.insert(
1267                            SmolStr::new_static("listItemsSample"),
1268                            LexObjectProperty::Array(LexArray {
1269                                items: LexArrayItem::Ref(LexRef {
1270                                    r#ref: CowStr::new_static("#listItemView"),
1271                                    ..Default::default()
1272                                }),
1273                                max_length: Some(12usize),
1274                                ..Default::default()
1275                            }),
1276                        );
1277                        map.insert(
1278                            SmolStr::new_static("record"),
1279                            LexObjectProperty::Unknown(LexUnknown {
1280                                ..Default::default()
1281                            }),
1282                        );
1283                        map.insert(
1284                            SmolStr::new_static("uri"),
1285                            LexObjectProperty::String(LexString {
1286                                format: Some(LexStringFormat::AtUri),
1287                                ..Default::default()
1288                            }),
1289                        );
1290                        map
1291                    },
1292                    ..Default::default()
1293                }),
1294            );
1295            map.insert(
1296                SmolStr::new_static("starterPackViewBasic"),
1297                LexUserType::Object(LexObject {
1298                    required: Some(
1299                        vec![
1300                            SmolStr::new_static("uri"), SmolStr::new_static("cid"),
1301                            SmolStr::new_static("record"),
1302                            SmolStr::new_static("creator"),
1303                            SmolStr::new_static("indexedAt")
1304                        ],
1305                    ),
1306                    properties: {
1307                        #[allow(unused_mut)]
1308                        let mut map = BTreeMap::new();
1309                        map.insert(
1310                            SmolStr::new_static("cid"),
1311                            LexObjectProperty::String(LexString {
1312                                format: Some(LexStringFormat::Cid),
1313                                ..Default::default()
1314                            }),
1315                        );
1316                        map.insert(
1317                            SmolStr::new_static("creator"),
1318                            LexObjectProperty::Ref(LexRef {
1319                                r#ref: CowStr::new_static(
1320                                    "app.bsky.actor.defs#profileViewBasic",
1321                                ),
1322                                ..Default::default()
1323                            }),
1324                        );
1325                        map.insert(
1326                            SmolStr::new_static("indexedAt"),
1327                            LexObjectProperty::String(LexString {
1328                                format: Some(LexStringFormat::Datetime),
1329                                ..Default::default()
1330                            }),
1331                        );
1332                        map.insert(
1333                            SmolStr::new_static("joinedAllTimeCount"),
1334                            LexObjectProperty::Integer(LexInteger {
1335                                minimum: Some(0i64),
1336                                ..Default::default()
1337                            }),
1338                        );
1339                        map.insert(
1340                            SmolStr::new_static("joinedWeekCount"),
1341                            LexObjectProperty::Integer(LexInteger {
1342                                minimum: Some(0i64),
1343                                ..Default::default()
1344                            }),
1345                        );
1346                        map.insert(
1347                            SmolStr::new_static("labels"),
1348                            LexObjectProperty::Array(LexArray {
1349                                items: LexArrayItem::Ref(LexRef {
1350                                    r#ref: CowStr::new_static("com.atproto.label.defs#label"),
1351                                    ..Default::default()
1352                                }),
1353                                ..Default::default()
1354                            }),
1355                        );
1356                        map.insert(
1357                            SmolStr::new_static("listItemCount"),
1358                            LexObjectProperty::Integer(LexInteger {
1359                                minimum: Some(0i64),
1360                                ..Default::default()
1361                            }),
1362                        );
1363                        map.insert(
1364                            SmolStr::new_static("record"),
1365                            LexObjectProperty::Unknown(LexUnknown {
1366                                ..Default::default()
1367                            }),
1368                        );
1369                        map.insert(
1370                            SmolStr::new_static("uri"),
1371                            LexObjectProperty::String(LexString {
1372                                format: Some(LexStringFormat::AtUri),
1373                                ..Default::default()
1374                            }),
1375                        );
1376                        map
1377                    },
1378                    ..Default::default()
1379                }),
1380            );
1381            map
1382        },
1383        ..Default::default()
1384    }
1385}
1386
1387pub mod list_view_state {
1388
1389    pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
1390    #[allow(unused)]
1391    use ::core::marker::PhantomData;
1392    mod sealed {
1393        pub trait Sealed {}
1394    }
1395    /// State trait tracking which required fields have been set
1396    pub trait State: sealed::Sealed {
1397        type Creator;
1398        type Name;
1399        type Uri;
1400        type Cid;
1401        type Purpose;
1402        type IndexedAt;
1403    }
1404    /// Empty state - all required fields are unset
1405    pub struct Empty(());
1406    impl sealed::Sealed for Empty {}
1407    impl State for Empty {
1408        type Creator = Unset;
1409        type Name = Unset;
1410        type Uri = Unset;
1411        type Cid = Unset;
1412        type Purpose = Unset;
1413        type IndexedAt = Unset;
1414    }
1415    ///State transition - sets the `creator` field to Set
1416    pub struct SetCreator<S: State = Empty>(PhantomData<fn() -> S>);
1417    impl<S: State> sealed::Sealed for SetCreator<S> {}
1418    impl<S: State> State for SetCreator<S> {
1419        type Creator = Set<members::creator>;
1420        type Name = S::Name;
1421        type Uri = S::Uri;
1422        type Cid = S::Cid;
1423        type Purpose = S::Purpose;
1424        type IndexedAt = S::IndexedAt;
1425    }
1426    ///State transition - sets the `name` field to Set
1427    pub struct SetName<S: State = Empty>(PhantomData<fn() -> S>);
1428    impl<S: State> sealed::Sealed for SetName<S> {}
1429    impl<S: State> State for SetName<S> {
1430        type Creator = S::Creator;
1431        type Name = Set<members::name>;
1432        type Uri = S::Uri;
1433        type Cid = S::Cid;
1434        type Purpose = S::Purpose;
1435        type IndexedAt = S::IndexedAt;
1436    }
1437    ///State transition - sets the `uri` field to Set
1438    pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>);
1439    impl<S: State> sealed::Sealed for SetUri<S> {}
1440    impl<S: State> State for SetUri<S> {
1441        type Creator = S::Creator;
1442        type Name = S::Name;
1443        type Uri = Set<members::uri>;
1444        type Cid = S::Cid;
1445        type Purpose = S::Purpose;
1446        type IndexedAt = S::IndexedAt;
1447    }
1448    ///State transition - sets the `cid` field to Set
1449    pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>);
1450    impl<S: State> sealed::Sealed for SetCid<S> {}
1451    impl<S: State> State for SetCid<S> {
1452        type Creator = S::Creator;
1453        type Name = S::Name;
1454        type Uri = S::Uri;
1455        type Cid = Set<members::cid>;
1456        type Purpose = S::Purpose;
1457        type IndexedAt = S::IndexedAt;
1458    }
1459    ///State transition - sets the `purpose` field to Set
1460    pub struct SetPurpose<S: State = Empty>(PhantomData<fn() -> S>);
1461    impl<S: State> sealed::Sealed for SetPurpose<S> {}
1462    impl<S: State> State for SetPurpose<S> {
1463        type Creator = S::Creator;
1464        type Name = S::Name;
1465        type Uri = S::Uri;
1466        type Cid = S::Cid;
1467        type Purpose = Set<members::purpose>;
1468        type IndexedAt = S::IndexedAt;
1469    }
1470    ///State transition - sets the `indexed_at` field to Set
1471    pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>);
1472    impl<S: State> sealed::Sealed for SetIndexedAt<S> {}
1473    impl<S: State> State for SetIndexedAt<S> {
1474        type Creator = S::Creator;
1475        type Name = S::Name;
1476        type Uri = S::Uri;
1477        type Cid = S::Cid;
1478        type Purpose = S::Purpose;
1479        type IndexedAt = Set<members::indexed_at>;
1480    }
1481    /// Marker types for field names
1482    #[allow(non_camel_case_types)]
1483    pub mod members {
1484        ///Marker type for the `creator` field
1485        pub struct creator(());
1486        ///Marker type for the `name` field
1487        pub struct name(());
1488        ///Marker type for the `uri` field
1489        pub struct uri(());
1490        ///Marker type for the `cid` field
1491        pub struct cid(());
1492        ///Marker type for the `purpose` field
1493        pub struct purpose(());
1494        ///Marker type for the `indexed_at` field
1495        pub struct indexed_at(());
1496    }
1497}
1498
1499/// Builder for constructing an instance of this type
1500pub struct ListViewBuilder<'a, S: list_view_state::State> {
1501    _state: PhantomData<fn() -> S>,
1502    _fields: (
1503        Option<UriValue<'a>>,
1504        Option<Cid<'a>>,
1505        Option<ProfileView<'a>>,
1506        Option<CowStr<'a>>,
1507        Option<Vec<Facet<'a>>>,
1508        Option<Datetime>,
1509        Option<Vec<Label<'a>>>,
1510        Option<i64>,
1511        Option<CowStr<'a>>,
1512        Option<graph::ListPurpose<'a>>,
1513        Option<AtUri<'a>>,
1514        Option<graph::ListViewerState<'a>>,
1515    ),
1516    _lifetime: PhantomData<&'a ()>,
1517}
1518
1519impl<'a> ListView<'a> {
1520    /// Create a new builder for this type
1521    pub fn new() -> ListViewBuilder<'a, list_view_state::Empty> {
1522        ListViewBuilder::new()
1523    }
1524}
1525
1526impl<'a> ListViewBuilder<'a, list_view_state::Empty> {
1527    /// Create a new builder with all fields unset
1528    pub fn new() -> Self {
1529        ListViewBuilder {
1530            _state: PhantomData,
1531            _fields: (
1532                None,
1533                None,
1534                None,
1535                None,
1536                None,
1537                None,
1538                None,
1539                None,
1540                None,
1541                None,
1542                None,
1543                None,
1544            ),
1545            _lifetime: PhantomData,
1546        }
1547    }
1548}
1549
1550impl<'a, S: list_view_state::State> ListViewBuilder<'a, S> {
1551    /// Set the `avatar` field (optional)
1552    pub fn avatar(mut self, value: impl Into<Option<UriValue<'a>>>) -> Self {
1553        self._fields.0 = value.into();
1554        self
1555    }
1556    /// Set the `avatar` field to an Option value (optional)
1557    pub fn maybe_avatar(mut self, value: Option<UriValue<'a>>) -> Self {
1558        self._fields.0 = value;
1559        self
1560    }
1561}
1562
1563impl<'a, S> ListViewBuilder<'a, S>
1564where
1565    S: list_view_state::State,
1566    S::Cid: list_view_state::IsUnset,
1567{
1568    /// Set the `cid` field (required)
1569    pub fn cid(
1570        mut self,
1571        value: impl Into<Cid<'a>>,
1572    ) -> ListViewBuilder<'a, list_view_state::SetCid<S>> {
1573        self._fields.1 = Option::Some(value.into());
1574        ListViewBuilder {
1575            _state: PhantomData,
1576            _fields: self._fields,
1577            _lifetime: PhantomData,
1578        }
1579    }
1580}
1581
1582impl<'a, S> ListViewBuilder<'a, S>
1583where
1584    S: list_view_state::State,
1585    S::Creator: list_view_state::IsUnset,
1586{
1587    /// Set the `creator` field (required)
1588    pub fn creator(
1589        mut self,
1590        value: impl Into<ProfileView<'a>>,
1591    ) -> ListViewBuilder<'a, list_view_state::SetCreator<S>> {
1592        self._fields.2 = Option::Some(value.into());
1593        ListViewBuilder {
1594            _state: PhantomData,
1595            _fields: self._fields,
1596            _lifetime: PhantomData,
1597        }
1598    }
1599}
1600
1601impl<'a, S: list_view_state::State> ListViewBuilder<'a, S> {
1602    /// Set the `description` field (optional)
1603    pub fn description(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
1604        self._fields.3 = value.into();
1605        self
1606    }
1607    /// Set the `description` field to an Option value (optional)
1608    pub fn maybe_description(mut self, value: Option<CowStr<'a>>) -> Self {
1609        self._fields.3 = value;
1610        self
1611    }
1612}
1613
1614impl<'a, S: list_view_state::State> ListViewBuilder<'a, S> {
1615    /// Set the `descriptionFacets` field (optional)
1616    pub fn description_facets(
1617        mut self,
1618        value: impl Into<Option<Vec<Facet<'a>>>>,
1619    ) -> Self {
1620        self._fields.4 = value.into();
1621        self
1622    }
1623    /// Set the `descriptionFacets` field to an Option value (optional)
1624    pub fn maybe_description_facets(mut self, value: Option<Vec<Facet<'a>>>) -> Self {
1625        self._fields.4 = value;
1626        self
1627    }
1628}
1629
1630impl<'a, S> ListViewBuilder<'a, S>
1631where
1632    S: list_view_state::State,
1633    S::IndexedAt: list_view_state::IsUnset,
1634{
1635    /// Set the `indexedAt` field (required)
1636    pub fn indexed_at(
1637        mut self,
1638        value: impl Into<Datetime>,
1639    ) -> ListViewBuilder<'a, list_view_state::SetIndexedAt<S>> {
1640        self._fields.5 = Option::Some(value.into());
1641        ListViewBuilder {
1642            _state: PhantomData,
1643            _fields: self._fields,
1644            _lifetime: PhantomData,
1645        }
1646    }
1647}
1648
1649impl<'a, S: list_view_state::State> ListViewBuilder<'a, S> {
1650    /// Set the `labels` field (optional)
1651    pub fn labels(mut self, value: impl Into<Option<Vec<Label<'a>>>>) -> Self {
1652        self._fields.6 = value.into();
1653        self
1654    }
1655    /// Set the `labels` field to an Option value (optional)
1656    pub fn maybe_labels(mut self, value: Option<Vec<Label<'a>>>) -> Self {
1657        self._fields.6 = value;
1658        self
1659    }
1660}
1661
1662impl<'a, S: list_view_state::State> ListViewBuilder<'a, S> {
1663    /// Set the `listItemCount` field (optional)
1664    pub fn list_item_count(mut self, value: impl Into<Option<i64>>) -> Self {
1665        self._fields.7 = value.into();
1666        self
1667    }
1668    /// Set the `listItemCount` field to an Option value (optional)
1669    pub fn maybe_list_item_count(mut self, value: Option<i64>) -> Self {
1670        self._fields.7 = value;
1671        self
1672    }
1673}
1674
1675impl<'a, S> ListViewBuilder<'a, S>
1676where
1677    S: list_view_state::State,
1678    S::Name: list_view_state::IsUnset,
1679{
1680    /// Set the `name` field (required)
1681    pub fn name(
1682        mut self,
1683        value: impl Into<CowStr<'a>>,
1684    ) -> ListViewBuilder<'a, list_view_state::SetName<S>> {
1685        self._fields.8 = Option::Some(value.into());
1686        ListViewBuilder {
1687            _state: PhantomData,
1688            _fields: self._fields,
1689            _lifetime: PhantomData,
1690        }
1691    }
1692}
1693
1694impl<'a, S> ListViewBuilder<'a, S>
1695where
1696    S: list_view_state::State,
1697    S::Purpose: list_view_state::IsUnset,
1698{
1699    /// Set the `purpose` field (required)
1700    pub fn purpose(
1701        mut self,
1702        value: impl Into<graph::ListPurpose<'a>>,
1703    ) -> ListViewBuilder<'a, list_view_state::SetPurpose<S>> {
1704        self._fields.9 = Option::Some(value.into());
1705        ListViewBuilder {
1706            _state: PhantomData,
1707            _fields: self._fields,
1708            _lifetime: PhantomData,
1709        }
1710    }
1711}
1712
1713impl<'a, S> ListViewBuilder<'a, S>
1714where
1715    S: list_view_state::State,
1716    S::Uri: list_view_state::IsUnset,
1717{
1718    /// Set the `uri` field (required)
1719    pub fn uri(
1720        mut self,
1721        value: impl Into<AtUri<'a>>,
1722    ) -> ListViewBuilder<'a, list_view_state::SetUri<S>> {
1723        self._fields.10 = Option::Some(value.into());
1724        ListViewBuilder {
1725            _state: PhantomData,
1726            _fields: self._fields,
1727            _lifetime: PhantomData,
1728        }
1729    }
1730}
1731
1732impl<'a, S: list_view_state::State> ListViewBuilder<'a, S> {
1733    /// Set the `viewer` field (optional)
1734    pub fn viewer(
1735        mut self,
1736        value: impl Into<Option<graph::ListViewerState<'a>>>,
1737    ) -> Self {
1738        self._fields.11 = value.into();
1739        self
1740    }
1741    /// Set the `viewer` field to an Option value (optional)
1742    pub fn maybe_viewer(mut self, value: Option<graph::ListViewerState<'a>>) -> Self {
1743        self._fields.11 = value;
1744        self
1745    }
1746}
1747
1748impl<'a, S> ListViewBuilder<'a, S>
1749where
1750    S: list_view_state::State,
1751    S::Creator: list_view_state::IsSet,
1752    S::Name: list_view_state::IsSet,
1753    S::Uri: list_view_state::IsSet,
1754    S::Cid: list_view_state::IsSet,
1755    S::Purpose: list_view_state::IsSet,
1756    S::IndexedAt: list_view_state::IsSet,
1757{
1758    /// Build the final struct
1759    pub fn build(self) -> ListView<'a> {
1760        ListView {
1761            avatar: self._fields.0,
1762            cid: self._fields.1.unwrap(),
1763            creator: self._fields.2.unwrap(),
1764            description: self._fields.3,
1765            description_facets: self._fields.4,
1766            indexed_at: self._fields.5.unwrap(),
1767            labels: self._fields.6,
1768            list_item_count: self._fields.7,
1769            name: self._fields.8.unwrap(),
1770            purpose: self._fields.9.unwrap(),
1771            uri: self._fields.10.unwrap(),
1772            viewer: self._fields.11,
1773            extra_data: Default::default(),
1774        }
1775    }
1776    /// Build the final struct with custom extra_data
1777    pub fn build_with_data(
1778        self,
1779        extra_data: BTreeMap<jacquard_common::deps::smol_str::SmolStr, Data<'a>>,
1780    ) -> ListView<'a> {
1781        ListView {
1782            avatar: self._fields.0,
1783            cid: self._fields.1.unwrap(),
1784            creator: self._fields.2.unwrap(),
1785            description: self._fields.3,
1786            description_facets: self._fields.4,
1787            indexed_at: self._fields.5.unwrap(),
1788            labels: self._fields.6,
1789            list_item_count: self._fields.7,
1790            name: self._fields.8.unwrap(),
1791            purpose: self._fields.9.unwrap(),
1792            uri: self._fields.10.unwrap(),
1793            viewer: self._fields.11,
1794            extra_data: Some(extra_data),
1795        }
1796    }
1797}
1798
1799pub mod list_view_basic_state {
1800
1801    pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
1802    #[allow(unused)]
1803    use ::core::marker::PhantomData;
1804    mod sealed {
1805        pub trait Sealed {}
1806    }
1807    /// State trait tracking which required fields have been set
1808    pub trait State: sealed::Sealed {
1809        type Cid;
1810        type Uri;
1811        type Name;
1812        type Purpose;
1813    }
1814    /// Empty state - all required fields are unset
1815    pub struct Empty(());
1816    impl sealed::Sealed for Empty {}
1817    impl State for Empty {
1818        type Cid = Unset;
1819        type Uri = Unset;
1820        type Name = Unset;
1821        type Purpose = Unset;
1822    }
1823    ///State transition - sets the `cid` field to Set
1824    pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>);
1825    impl<S: State> sealed::Sealed for SetCid<S> {}
1826    impl<S: State> State for SetCid<S> {
1827        type Cid = Set<members::cid>;
1828        type Uri = S::Uri;
1829        type Name = S::Name;
1830        type Purpose = S::Purpose;
1831    }
1832    ///State transition - sets the `uri` field to Set
1833    pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>);
1834    impl<S: State> sealed::Sealed for SetUri<S> {}
1835    impl<S: State> State for SetUri<S> {
1836        type Cid = S::Cid;
1837        type Uri = Set<members::uri>;
1838        type Name = S::Name;
1839        type Purpose = S::Purpose;
1840    }
1841    ///State transition - sets the `name` field to Set
1842    pub struct SetName<S: State = Empty>(PhantomData<fn() -> S>);
1843    impl<S: State> sealed::Sealed for SetName<S> {}
1844    impl<S: State> State for SetName<S> {
1845        type Cid = S::Cid;
1846        type Uri = S::Uri;
1847        type Name = Set<members::name>;
1848        type Purpose = S::Purpose;
1849    }
1850    ///State transition - sets the `purpose` field to Set
1851    pub struct SetPurpose<S: State = Empty>(PhantomData<fn() -> S>);
1852    impl<S: State> sealed::Sealed for SetPurpose<S> {}
1853    impl<S: State> State for SetPurpose<S> {
1854        type Cid = S::Cid;
1855        type Uri = S::Uri;
1856        type Name = S::Name;
1857        type Purpose = Set<members::purpose>;
1858    }
1859    /// Marker types for field names
1860    #[allow(non_camel_case_types)]
1861    pub mod members {
1862        ///Marker type for the `cid` field
1863        pub struct cid(());
1864        ///Marker type for the `uri` field
1865        pub struct uri(());
1866        ///Marker type for the `name` field
1867        pub struct name(());
1868        ///Marker type for the `purpose` field
1869        pub struct purpose(());
1870    }
1871}
1872
1873/// Builder for constructing an instance of this type
1874pub struct ListViewBasicBuilder<'a, S: list_view_basic_state::State> {
1875    _state: PhantomData<fn() -> S>,
1876    _fields: (
1877        Option<UriValue<'a>>,
1878        Option<Cid<'a>>,
1879        Option<Datetime>,
1880        Option<Vec<Label<'a>>>,
1881        Option<i64>,
1882        Option<CowStr<'a>>,
1883        Option<graph::ListPurpose<'a>>,
1884        Option<AtUri<'a>>,
1885        Option<graph::ListViewerState<'a>>,
1886    ),
1887    _lifetime: PhantomData<&'a ()>,
1888}
1889
1890impl<'a> ListViewBasic<'a> {
1891    /// Create a new builder for this type
1892    pub fn new() -> ListViewBasicBuilder<'a, list_view_basic_state::Empty> {
1893        ListViewBasicBuilder::new()
1894    }
1895}
1896
1897impl<'a> ListViewBasicBuilder<'a, list_view_basic_state::Empty> {
1898    /// Create a new builder with all fields unset
1899    pub fn new() -> Self {
1900        ListViewBasicBuilder {
1901            _state: PhantomData,
1902            _fields: (None, None, None, None, None, None, None, None, None),
1903            _lifetime: PhantomData,
1904        }
1905    }
1906}
1907
1908impl<'a, S: list_view_basic_state::State> ListViewBasicBuilder<'a, S> {
1909    /// Set the `avatar` field (optional)
1910    pub fn avatar(mut self, value: impl Into<Option<UriValue<'a>>>) -> Self {
1911        self._fields.0 = value.into();
1912        self
1913    }
1914    /// Set the `avatar` field to an Option value (optional)
1915    pub fn maybe_avatar(mut self, value: Option<UriValue<'a>>) -> Self {
1916        self._fields.0 = value;
1917        self
1918    }
1919}
1920
1921impl<'a, S> ListViewBasicBuilder<'a, S>
1922where
1923    S: list_view_basic_state::State,
1924    S::Cid: list_view_basic_state::IsUnset,
1925{
1926    /// Set the `cid` field (required)
1927    pub fn cid(
1928        mut self,
1929        value: impl Into<Cid<'a>>,
1930    ) -> ListViewBasicBuilder<'a, list_view_basic_state::SetCid<S>> {
1931        self._fields.1 = Option::Some(value.into());
1932        ListViewBasicBuilder {
1933            _state: PhantomData,
1934            _fields: self._fields,
1935            _lifetime: PhantomData,
1936        }
1937    }
1938}
1939
1940impl<'a, S: list_view_basic_state::State> ListViewBasicBuilder<'a, S> {
1941    /// Set the `indexedAt` field (optional)
1942    pub fn indexed_at(mut self, value: impl Into<Option<Datetime>>) -> Self {
1943        self._fields.2 = value.into();
1944        self
1945    }
1946    /// Set the `indexedAt` field to an Option value (optional)
1947    pub fn maybe_indexed_at(mut self, value: Option<Datetime>) -> Self {
1948        self._fields.2 = value;
1949        self
1950    }
1951}
1952
1953impl<'a, S: list_view_basic_state::State> ListViewBasicBuilder<'a, S> {
1954    /// Set the `labels` field (optional)
1955    pub fn labels(mut self, value: impl Into<Option<Vec<Label<'a>>>>) -> Self {
1956        self._fields.3 = value.into();
1957        self
1958    }
1959    /// Set the `labels` field to an Option value (optional)
1960    pub fn maybe_labels(mut self, value: Option<Vec<Label<'a>>>) -> Self {
1961        self._fields.3 = value;
1962        self
1963    }
1964}
1965
1966impl<'a, S: list_view_basic_state::State> ListViewBasicBuilder<'a, S> {
1967    /// Set the `listItemCount` field (optional)
1968    pub fn list_item_count(mut self, value: impl Into<Option<i64>>) -> Self {
1969        self._fields.4 = value.into();
1970        self
1971    }
1972    /// Set the `listItemCount` field to an Option value (optional)
1973    pub fn maybe_list_item_count(mut self, value: Option<i64>) -> Self {
1974        self._fields.4 = value;
1975        self
1976    }
1977}
1978
1979impl<'a, S> ListViewBasicBuilder<'a, S>
1980where
1981    S: list_view_basic_state::State,
1982    S::Name: list_view_basic_state::IsUnset,
1983{
1984    /// Set the `name` field (required)
1985    pub fn name(
1986        mut self,
1987        value: impl Into<CowStr<'a>>,
1988    ) -> ListViewBasicBuilder<'a, list_view_basic_state::SetName<S>> {
1989        self._fields.5 = Option::Some(value.into());
1990        ListViewBasicBuilder {
1991            _state: PhantomData,
1992            _fields: self._fields,
1993            _lifetime: PhantomData,
1994        }
1995    }
1996}
1997
1998impl<'a, S> ListViewBasicBuilder<'a, S>
1999where
2000    S: list_view_basic_state::State,
2001    S::Purpose: list_view_basic_state::IsUnset,
2002{
2003    /// Set the `purpose` field (required)
2004    pub fn purpose(
2005        mut self,
2006        value: impl Into<graph::ListPurpose<'a>>,
2007    ) -> ListViewBasicBuilder<'a, list_view_basic_state::SetPurpose<S>> {
2008        self._fields.6 = Option::Some(value.into());
2009        ListViewBasicBuilder {
2010            _state: PhantomData,
2011            _fields: self._fields,
2012            _lifetime: PhantomData,
2013        }
2014    }
2015}
2016
2017impl<'a, S> ListViewBasicBuilder<'a, S>
2018where
2019    S: list_view_basic_state::State,
2020    S::Uri: list_view_basic_state::IsUnset,
2021{
2022    /// Set the `uri` field (required)
2023    pub fn uri(
2024        mut self,
2025        value: impl Into<AtUri<'a>>,
2026    ) -> ListViewBasicBuilder<'a, list_view_basic_state::SetUri<S>> {
2027        self._fields.7 = Option::Some(value.into());
2028        ListViewBasicBuilder {
2029            _state: PhantomData,
2030            _fields: self._fields,
2031            _lifetime: PhantomData,
2032        }
2033    }
2034}
2035
2036impl<'a, S: list_view_basic_state::State> ListViewBasicBuilder<'a, S> {
2037    /// Set the `viewer` field (optional)
2038    pub fn viewer(
2039        mut self,
2040        value: impl Into<Option<graph::ListViewerState<'a>>>,
2041    ) -> Self {
2042        self._fields.8 = value.into();
2043        self
2044    }
2045    /// Set the `viewer` field to an Option value (optional)
2046    pub fn maybe_viewer(mut self, value: Option<graph::ListViewerState<'a>>) -> Self {
2047        self._fields.8 = value;
2048        self
2049    }
2050}
2051
2052impl<'a, S> ListViewBasicBuilder<'a, S>
2053where
2054    S: list_view_basic_state::State,
2055    S::Cid: list_view_basic_state::IsSet,
2056    S::Uri: list_view_basic_state::IsSet,
2057    S::Name: list_view_basic_state::IsSet,
2058    S::Purpose: list_view_basic_state::IsSet,
2059{
2060    /// Build the final struct
2061    pub fn build(self) -> ListViewBasic<'a> {
2062        ListViewBasic {
2063            avatar: self._fields.0,
2064            cid: self._fields.1.unwrap(),
2065            indexed_at: self._fields.2,
2066            labels: self._fields.3,
2067            list_item_count: self._fields.4,
2068            name: self._fields.5.unwrap(),
2069            purpose: self._fields.6.unwrap(),
2070            uri: self._fields.7.unwrap(),
2071            viewer: self._fields.8,
2072            extra_data: Default::default(),
2073        }
2074    }
2075    /// Build the final struct with custom extra_data
2076    pub fn build_with_data(
2077        self,
2078        extra_data: BTreeMap<jacquard_common::deps::smol_str::SmolStr, Data<'a>>,
2079    ) -> ListViewBasic<'a> {
2080        ListViewBasic {
2081            avatar: self._fields.0,
2082            cid: self._fields.1.unwrap(),
2083            indexed_at: self._fields.2,
2084            labels: self._fields.3,
2085            list_item_count: self._fields.4,
2086            name: self._fields.5.unwrap(),
2087            purpose: self._fields.6.unwrap(),
2088            uri: self._fields.7.unwrap(),
2089            viewer: self._fields.8,
2090            extra_data: Some(extra_data),
2091        }
2092    }
2093}
2094
2095pub mod not_found_actor_state {
2096
2097    pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
2098    #[allow(unused)]
2099    use ::core::marker::PhantomData;
2100    mod sealed {
2101        pub trait Sealed {}
2102    }
2103    /// State trait tracking which required fields have been set
2104    pub trait State: sealed::Sealed {
2105        type Actor;
2106        type NotFound;
2107    }
2108    /// Empty state - all required fields are unset
2109    pub struct Empty(());
2110    impl sealed::Sealed for Empty {}
2111    impl State for Empty {
2112        type Actor = Unset;
2113        type NotFound = Unset;
2114    }
2115    ///State transition - sets the `actor` field to Set
2116    pub struct SetActor<S: State = Empty>(PhantomData<fn() -> S>);
2117    impl<S: State> sealed::Sealed for SetActor<S> {}
2118    impl<S: State> State for SetActor<S> {
2119        type Actor = Set<members::actor>;
2120        type NotFound = S::NotFound;
2121    }
2122    ///State transition - sets the `not_found` field to Set
2123    pub struct SetNotFound<S: State = Empty>(PhantomData<fn() -> S>);
2124    impl<S: State> sealed::Sealed for SetNotFound<S> {}
2125    impl<S: State> State for SetNotFound<S> {
2126        type Actor = S::Actor;
2127        type NotFound = Set<members::not_found>;
2128    }
2129    /// Marker types for field names
2130    #[allow(non_camel_case_types)]
2131    pub mod members {
2132        ///Marker type for the `actor` field
2133        pub struct actor(());
2134        ///Marker type for the `not_found` field
2135        pub struct not_found(());
2136    }
2137}
2138
2139/// Builder for constructing an instance of this type
2140pub struct NotFoundActorBuilder<'a, S: not_found_actor_state::State> {
2141    _state: PhantomData<fn() -> S>,
2142    _fields: (Option<AtIdentifier<'a>>, Option<bool>),
2143    _lifetime: PhantomData<&'a ()>,
2144}
2145
2146impl<'a> NotFoundActor<'a> {
2147    /// Create a new builder for this type
2148    pub fn new() -> NotFoundActorBuilder<'a, not_found_actor_state::Empty> {
2149        NotFoundActorBuilder::new()
2150    }
2151}
2152
2153impl<'a> NotFoundActorBuilder<'a, not_found_actor_state::Empty> {
2154    /// Create a new builder with all fields unset
2155    pub fn new() -> Self {
2156        NotFoundActorBuilder {
2157            _state: PhantomData,
2158            _fields: (None, None),
2159            _lifetime: PhantomData,
2160        }
2161    }
2162}
2163
2164impl<'a, S> NotFoundActorBuilder<'a, S>
2165where
2166    S: not_found_actor_state::State,
2167    S::Actor: not_found_actor_state::IsUnset,
2168{
2169    /// Set the `actor` field (required)
2170    pub fn actor(
2171        mut self,
2172        value: impl Into<AtIdentifier<'a>>,
2173    ) -> NotFoundActorBuilder<'a, not_found_actor_state::SetActor<S>> {
2174        self._fields.0 = Option::Some(value.into());
2175        NotFoundActorBuilder {
2176            _state: PhantomData,
2177            _fields: self._fields,
2178            _lifetime: PhantomData,
2179        }
2180    }
2181}
2182
2183impl<'a, S> NotFoundActorBuilder<'a, S>
2184where
2185    S: not_found_actor_state::State,
2186    S::NotFound: not_found_actor_state::IsUnset,
2187{
2188    /// Set the `notFound` field (required)
2189    pub fn not_found(
2190        mut self,
2191        value: impl Into<bool>,
2192    ) -> NotFoundActorBuilder<'a, not_found_actor_state::SetNotFound<S>> {
2193        self._fields.1 = Option::Some(value.into());
2194        NotFoundActorBuilder {
2195            _state: PhantomData,
2196            _fields: self._fields,
2197            _lifetime: PhantomData,
2198        }
2199    }
2200}
2201
2202impl<'a, S> NotFoundActorBuilder<'a, S>
2203where
2204    S: not_found_actor_state::State,
2205    S::Actor: not_found_actor_state::IsSet,
2206    S::NotFound: not_found_actor_state::IsSet,
2207{
2208    /// Build the final struct
2209    pub fn build(self) -> NotFoundActor<'a> {
2210        NotFoundActor {
2211            actor: self._fields.0.unwrap(),
2212            not_found: self._fields.1.unwrap(),
2213            extra_data: Default::default(),
2214        }
2215    }
2216    /// Build the final struct with custom extra_data
2217    pub fn build_with_data(
2218        self,
2219        extra_data: BTreeMap<jacquard_common::deps::smol_str::SmolStr, Data<'a>>,
2220    ) -> NotFoundActor<'a> {
2221        NotFoundActor {
2222            actor: self._fields.0.unwrap(),
2223            not_found: self._fields.1.unwrap(),
2224            extra_data: Some(extra_data),
2225        }
2226    }
2227}
2228
2229pub mod relationship_state {
2230
2231    pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
2232    #[allow(unused)]
2233    use ::core::marker::PhantomData;
2234    mod sealed {
2235        pub trait Sealed {}
2236    }
2237    /// State trait tracking which required fields have been set
2238    pub trait State: sealed::Sealed {
2239        type Did;
2240    }
2241    /// Empty state - all required fields are unset
2242    pub struct Empty(());
2243    impl sealed::Sealed for Empty {}
2244    impl State for Empty {
2245        type Did = Unset;
2246    }
2247    ///State transition - sets the `did` field to Set
2248    pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>);
2249    impl<S: State> sealed::Sealed for SetDid<S> {}
2250    impl<S: State> State for SetDid<S> {
2251        type Did = Set<members::did>;
2252    }
2253    /// Marker types for field names
2254    #[allow(non_camel_case_types)]
2255    pub mod members {
2256        ///Marker type for the `did` field
2257        pub struct did(());
2258    }
2259}
2260
2261/// Builder for constructing an instance of this type
2262pub struct RelationshipBuilder<'a, S: relationship_state::State> {
2263    _state: PhantomData<fn() -> S>,
2264    _fields: (
2265        Option<AtUri<'a>>,
2266        Option<AtUri<'a>>,
2267        Option<AtUri<'a>>,
2268        Option<AtUri<'a>>,
2269        Option<Did<'a>>,
2270        Option<AtUri<'a>>,
2271        Option<AtUri<'a>>,
2272    ),
2273    _lifetime: PhantomData<&'a ()>,
2274}
2275
2276impl<'a> Relationship<'a> {
2277    /// Create a new builder for this type
2278    pub fn new() -> RelationshipBuilder<'a, relationship_state::Empty> {
2279        RelationshipBuilder::new()
2280    }
2281}
2282
2283impl<'a> RelationshipBuilder<'a, relationship_state::Empty> {
2284    /// Create a new builder with all fields unset
2285    pub fn new() -> Self {
2286        RelationshipBuilder {
2287            _state: PhantomData,
2288            _fields: (None, None, None, None, None, None, None),
2289            _lifetime: PhantomData,
2290        }
2291    }
2292}
2293
2294impl<'a, S: relationship_state::State> RelationshipBuilder<'a, S> {
2295    /// Set the `blockedBy` field (optional)
2296    pub fn blocked_by(mut self, value: impl Into<Option<AtUri<'a>>>) -> Self {
2297        self._fields.0 = value.into();
2298        self
2299    }
2300    /// Set the `blockedBy` field to an Option value (optional)
2301    pub fn maybe_blocked_by(mut self, value: Option<AtUri<'a>>) -> Self {
2302        self._fields.0 = value;
2303        self
2304    }
2305}
2306
2307impl<'a, S: relationship_state::State> RelationshipBuilder<'a, S> {
2308    /// Set the `blockedByList` field (optional)
2309    pub fn blocked_by_list(mut self, value: impl Into<Option<AtUri<'a>>>) -> Self {
2310        self._fields.1 = value.into();
2311        self
2312    }
2313    /// Set the `blockedByList` field to an Option value (optional)
2314    pub fn maybe_blocked_by_list(mut self, value: Option<AtUri<'a>>) -> Self {
2315        self._fields.1 = value;
2316        self
2317    }
2318}
2319
2320impl<'a, S: relationship_state::State> RelationshipBuilder<'a, S> {
2321    /// Set the `blocking` field (optional)
2322    pub fn blocking(mut self, value: impl Into<Option<AtUri<'a>>>) -> Self {
2323        self._fields.2 = value.into();
2324        self
2325    }
2326    /// Set the `blocking` field to an Option value (optional)
2327    pub fn maybe_blocking(mut self, value: Option<AtUri<'a>>) -> Self {
2328        self._fields.2 = value;
2329        self
2330    }
2331}
2332
2333impl<'a, S: relationship_state::State> RelationshipBuilder<'a, S> {
2334    /// Set the `blockingByList` field (optional)
2335    pub fn blocking_by_list(mut self, value: impl Into<Option<AtUri<'a>>>) -> Self {
2336        self._fields.3 = value.into();
2337        self
2338    }
2339    /// Set the `blockingByList` field to an Option value (optional)
2340    pub fn maybe_blocking_by_list(mut self, value: Option<AtUri<'a>>) -> Self {
2341        self._fields.3 = value;
2342        self
2343    }
2344}
2345
2346impl<'a, S> RelationshipBuilder<'a, S>
2347where
2348    S: relationship_state::State,
2349    S::Did: relationship_state::IsUnset,
2350{
2351    /// Set the `did` field (required)
2352    pub fn did(
2353        mut self,
2354        value: impl Into<Did<'a>>,
2355    ) -> RelationshipBuilder<'a, relationship_state::SetDid<S>> {
2356        self._fields.4 = Option::Some(value.into());
2357        RelationshipBuilder {
2358            _state: PhantomData,
2359            _fields: self._fields,
2360            _lifetime: PhantomData,
2361        }
2362    }
2363}
2364
2365impl<'a, S: relationship_state::State> RelationshipBuilder<'a, S> {
2366    /// Set the `followedBy` field (optional)
2367    pub fn followed_by(mut self, value: impl Into<Option<AtUri<'a>>>) -> Self {
2368        self._fields.5 = value.into();
2369        self
2370    }
2371    /// Set the `followedBy` field to an Option value (optional)
2372    pub fn maybe_followed_by(mut self, value: Option<AtUri<'a>>) -> Self {
2373        self._fields.5 = value;
2374        self
2375    }
2376}
2377
2378impl<'a, S: relationship_state::State> RelationshipBuilder<'a, S> {
2379    /// Set the `following` field (optional)
2380    pub fn following(mut self, value: impl Into<Option<AtUri<'a>>>) -> Self {
2381        self._fields.6 = value.into();
2382        self
2383    }
2384    /// Set the `following` field to an Option value (optional)
2385    pub fn maybe_following(mut self, value: Option<AtUri<'a>>) -> Self {
2386        self._fields.6 = value;
2387        self
2388    }
2389}
2390
2391impl<'a, S> RelationshipBuilder<'a, S>
2392where
2393    S: relationship_state::State,
2394    S::Did: relationship_state::IsSet,
2395{
2396    /// Build the final struct
2397    pub fn build(self) -> Relationship<'a> {
2398        Relationship {
2399            blocked_by: self._fields.0,
2400            blocked_by_list: self._fields.1,
2401            blocking: self._fields.2,
2402            blocking_by_list: self._fields.3,
2403            did: self._fields.4.unwrap(),
2404            followed_by: self._fields.5,
2405            following: self._fields.6,
2406            extra_data: Default::default(),
2407        }
2408    }
2409    /// Build the final struct with custom extra_data
2410    pub fn build_with_data(
2411        self,
2412        extra_data: BTreeMap<jacquard_common::deps::smol_str::SmolStr, Data<'a>>,
2413    ) -> Relationship<'a> {
2414        Relationship {
2415            blocked_by: self._fields.0,
2416            blocked_by_list: self._fields.1,
2417            blocking: self._fields.2,
2418            blocking_by_list: self._fields.3,
2419            did: self._fields.4.unwrap(),
2420            followed_by: self._fields.5,
2421            following: self._fields.6,
2422            extra_data: Some(extra_data),
2423        }
2424    }
2425}
2426
2427pub mod starter_pack_view_state {
2428
2429    pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
2430    #[allow(unused)]
2431    use ::core::marker::PhantomData;
2432    mod sealed {
2433        pub trait Sealed {}
2434    }
2435    /// State trait tracking which required fields have been set
2436    pub trait State: sealed::Sealed {
2437        type IndexedAt;
2438        type Cid;
2439        type Uri;
2440        type Record;
2441        type Creator;
2442    }
2443    /// Empty state - all required fields are unset
2444    pub struct Empty(());
2445    impl sealed::Sealed for Empty {}
2446    impl State for Empty {
2447        type IndexedAt = Unset;
2448        type Cid = Unset;
2449        type Uri = Unset;
2450        type Record = Unset;
2451        type Creator = Unset;
2452    }
2453    ///State transition - sets the `indexed_at` field to Set
2454    pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>);
2455    impl<S: State> sealed::Sealed for SetIndexedAt<S> {}
2456    impl<S: State> State for SetIndexedAt<S> {
2457        type IndexedAt = Set<members::indexed_at>;
2458        type Cid = S::Cid;
2459        type Uri = S::Uri;
2460        type Record = S::Record;
2461        type Creator = S::Creator;
2462    }
2463    ///State transition - sets the `cid` field to Set
2464    pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>);
2465    impl<S: State> sealed::Sealed for SetCid<S> {}
2466    impl<S: State> State for SetCid<S> {
2467        type IndexedAt = S::IndexedAt;
2468        type Cid = Set<members::cid>;
2469        type Uri = S::Uri;
2470        type Record = S::Record;
2471        type Creator = S::Creator;
2472    }
2473    ///State transition - sets the `uri` field to Set
2474    pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>);
2475    impl<S: State> sealed::Sealed for SetUri<S> {}
2476    impl<S: State> State for SetUri<S> {
2477        type IndexedAt = S::IndexedAt;
2478        type Cid = S::Cid;
2479        type Uri = Set<members::uri>;
2480        type Record = S::Record;
2481        type Creator = S::Creator;
2482    }
2483    ///State transition - sets the `record` field to Set
2484    pub struct SetRecord<S: State = Empty>(PhantomData<fn() -> S>);
2485    impl<S: State> sealed::Sealed for SetRecord<S> {}
2486    impl<S: State> State for SetRecord<S> {
2487        type IndexedAt = S::IndexedAt;
2488        type Cid = S::Cid;
2489        type Uri = S::Uri;
2490        type Record = Set<members::record>;
2491        type Creator = S::Creator;
2492    }
2493    ///State transition - sets the `creator` field to Set
2494    pub struct SetCreator<S: State = Empty>(PhantomData<fn() -> S>);
2495    impl<S: State> sealed::Sealed for SetCreator<S> {}
2496    impl<S: State> State for SetCreator<S> {
2497        type IndexedAt = S::IndexedAt;
2498        type Cid = S::Cid;
2499        type Uri = S::Uri;
2500        type Record = S::Record;
2501        type Creator = Set<members::creator>;
2502    }
2503    /// Marker types for field names
2504    #[allow(non_camel_case_types)]
2505    pub mod members {
2506        ///Marker type for the `indexed_at` field
2507        pub struct indexed_at(());
2508        ///Marker type for the `cid` field
2509        pub struct cid(());
2510        ///Marker type for the `uri` field
2511        pub struct uri(());
2512        ///Marker type for the `record` field
2513        pub struct record(());
2514        ///Marker type for the `creator` field
2515        pub struct creator(());
2516    }
2517}
2518
2519/// Builder for constructing an instance of this type
2520pub struct StarterPackViewBuilder<'a, S: starter_pack_view_state::State> {
2521    _state: PhantomData<fn() -> S>,
2522    _fields: (
2523        Option<Cid<'a>>,
2524        Option<ProfileViewBasic<'a>>,
2525        Option<Vec<GeneratorView<'a>>>,
2526        Option<Datetime>,
2527        Option<i64>,
2528        Option<i64>,
2529        Option<Vec<Label<'a>>>,
2530        Option<graph::ListViewBasic<'a>>,
2531        Option<Vec<graph::ListItemView<'a>>>,
2532        Option<Data<'a>>,
2533        Option<AtUri<'a>>,
2534    ),
2535    _lifetime: PhantomData<&'a ()>,
2536}
2537
2538impl<'a> StarterPackView<'a> {
2539    /// Create a new builder for this type
2540    pub fn new() -> StarterPackViewBuilder<'a, starter_pack_view_state::Empty> {
2541        StarterPackViewBuilder::new()
2542    }
2543}
2544
2545impl<'a> StarterPackViewBuilder<'a, starter_pack_view_state::Empty> {
2546    /// Create a new builder with all fields unset
2547    pub fn new() -> Self {
2548        StarterPackViewBuilder {
2549            _state: PhantomData,
2550            _fields: (None, None, None, None, None, None, None, None, None, None, None),
2551            _lifetime: PhantomData,
2552        }
2553    }
2554}
2555
2556impl<'a, S> StarterPackViewBuilder<'a, S>
2557where
2558    S: starter_pack_view_state::State,
2559    S::Cid: starter_pack_view_state::IsUnset,
2560{
2561    /// Set the `cid` field (required)
2562    pub fn cid(
2563        mut self,
2564        value: impl Into<Cid<'a>>,
2565    ) -> StarterPackViewBuilder<'a, starter_pack_view_state::SetCid<S>> {
2566        self._fields.0 = Option::Some(value.into());
2567        StarterPackViewBuilder {
2568            _state: PhantomData,
2569            _fields: self._fields,
2570            _lifetime: PhantomData,
2571        }
2572    }
2573}
2574
2575impl<'a, S> StarterPackViewBuilder<'a, S>
2576where
2577    S: starter_pack_view_state::State,
2578    S::Creator: starter_pack_view_state::IsUnset,
2579{
2580    /// Set the `creator` field (required)
2581    pub fn creator(
2582        mut self,
2583        value: impl Into<ProfileViewBasic<'a>>,
2584    ) -> StarterPackViewBuilder<'a, starter_pack_view_state::SetCreator<S>> {
2585        self._fields.1 = Option::Some(value.into());
2586        StarterPackViewBuilder {
2587            _state: PhantomData,
2588            _fields: self._fields,
2589            _lifetime: PhantomData,
2590        }
2591    }
2592}
2593
2594impl<'a, S: starter_pack_view_state::State> StarterPackViewBuilder<'a, S> {
2595    /// Set the `feeds` field (optional)
2596    pub fn feeds(mut self, value: impl Into<Option<Vec<GeneratorView<'a>>>>) -> Self {
2597        self._fields.2 = value.into();
2598        self
2599    }
2600    /// Set the `feeds` field to an Option value (optional)
2601    pub fn maybe_feeds(mut self, value: Option<Vec<GeneratorView<'a>>>) -> Self {
2602        self._fields.2 = value;
2603        self
2604    }
2605}
2606
2607impl<'a, S> StarterPackViewBuilder<'a, S>
2608where
2609    S: starter_pack_view_state::State,
2610    S::IndexedAt: starter_pack_view_state::IsUnset,
2611{
2612    /// Set the `indexedAt` field (required)
2613    pub fn indexed_at(
2614        mut self,
2615        value: impl Into<Datetime>,
2616    ) -> StarterPackViewBuilder<'a, starter_pack_view_state::SetIndexedAt<S>> {
2617        self._fields.3 = Option::Some(value.into());
2618        StarterPackViewBuilder {
2619            _state: PhantomData,
2620            _fields: self._fields,
2621            _lifetime: PhantomData,
2622        }
2623    }
2624}
2625
2626impl<'a, S: starter_pack_view_state::State> StarterPackViewBuilder<'a, S> {
2627    /// Set the `joinedAllTimeCount` field (optional)
2628    pub fn joined_all_time_count(mut self, value: impl Into<Option<i64>>) -> Self {
2629        self._fields.4 = value.into();
2630        self
2631    }
2632    /// Set the `joinedAllTimeCount` field to an Option value (optional)
2633    pub fn maybe_joined_all_time_count(mut self, value: Option<i64>) -> Self {
2634        self._fields.4 = value;
2635        self
2636    }
2637}
2638
2639impl<'a, S: starter_pack_view_state::State> StarterPackViewBuilder<'a, S> {
2640    /// Set the `joinedWeekCount` field (optional)
2641    pub fn joined_week_count(mut self, value: impl Into<Option<i64>>) -> Self {
2642        self._fields.5 = value.into();
2643        self
2644    }
2645    /// Set the `joinedWeekCount` field to an Option value (optional)
2646    pub fn maybe_joined_week_count(mut self, value: Option<i64>) -> Self {
2647        self._fields.5 = value;
2648        self
2649    }
2650}
2651
2652impl<'a, S: starter_pack_view_state::State> StarterPackViewBuilder<'a, S> {
2653    /// Set the `labels` field (optional)
2654    pub fn labels(mut self, value: impl Into<Option<Vec<Label<'a>>>>) -> Self {
2655        self._fields.6 = value.into();
2656        self
2657    }
2658    /// Set the `labels` field to an Option value (optional)
2659    pub fn maybe_labels(mut self, value: Option<Vec<Label<'a>>>) -> Self {
2660        self._fields.6 = value;
2661        self
2662    }
2663}
2664
2665impl<'a, S: starter_pack_view_state::State> StarterPackViewBuilder<'a, S> {
2666    /// Set the `list` field (optional)
2667    pub fn list(mut self, value: impl Into<Option<graph::ListViewBasic<'a>>>) -> Self {
2668        self._fields.7 = value.into();
2669        self
2670    }
2671    /// Set the `list` field to an Option value (optional)
2672    pub fn maybe_list(mut self, value: Option<graph::ListViewBasic<'a>>) -> Self {
2673        self._fields.7 = value;
2674        self
2675    }
2676}
2677
2678impl<'a, S: starter_pack_view_state::State> StarterPackViewBuilder<'a, S> {
2679    /// Set the `listItemsSample` field (optional)
2680    pub fn list_items_sample(
2681        mut self,
2682        value: impl Into<Option<Vec<graph::ListItemView<'a>>>>,
2683    ) -> Self {
2684        self._fields.8 = value.into();
2685        self
2686    }
2687    /// Set the `listItemsSample` field to an Option value (optional)
2688    pub fn maybe_list_items_sample(
2689        mut self,
2690        value: Option<Vec<graph::ListItemView<'a>>>,
2691    ) -> Self {
2692        self._fields.8 = value;
2693        self
2694    }
2695}
2696
2697impl<'a, S> StarterPackViewBuilder<'a, S>
2698where
2699    S: starter_pack_view_state::State,
2700    S::Record: starter_pack_view_state::IsUnset,
2701{
2702    /// Set the `record` field (required)
2703    pub fn record(
2704        mut self,
2705        value: impl Into<Data<'a>>,
2706    ) -> StarterPackViewBuilder<'a, starter_pack_view_state::SetRecord<S>> {
2707        self._fields.9 = Option::Some(value.into());
2708        StarterPackViewBuilder {
2709            _state: PhantomData,
2710            _fields: self._fields,
2711            _lifetime: PhantomData,
2712        }
2713    }
2714}
2715
2716impl<'a, S> StarterPackViewBuilder<'a, S>
2717where
2718    S: starter_pack_view_state::State,
2719    S::Uri: starter_pack_view_state::IsUnset,
2720{
2721    /// Set the `uri` field (required)
2722    pub fn uri(
2723        mut self,
2724        value: impl Into<AtUri<'a>>,
2725    ) -> StarterPackViewBuilder<'a, starter_pack_view_state::SetUri<S>> {
2726        self._fields.10 = Option::Some(value.into());
2727        StarterPackViewBuilder {
2728            _state: PhantomData,
2729            _fields: self._fields,
2730            _lifetime: PhantomData,
2731        }
2732    }
2733}
2734
2735impl<'a, S> StarterPackViewBuilder<'a, S>
2736where
2737    S: starter_pack_view_state::State,
2738    S::IndexedAt: starter_pack_view_state::IsSet,
2739    S::Cid: starter_pack_view_state::IsSet,
2740    S::Uri: starter_pack_view_state::IsSet,
2741    S::Record: starter_pack_view_state::IsSet,
2742    S::Creator: starter_pack_view_state::IsSet,
2743{
2744    /// Build the final struct
2745    pub fn build(self) -> StarterPackView<'a> {
2746        StarterPackView {
2747            cid: self._fields.0.unwrap(),
2748            creator: self._fields.1.unwrap(),
2749            feeds: self._fields.2,
2750            indexed_at: self._fields.3.unwrap(),
2751            joined_all_time_count: self._fields.4,
2752            joined_week_count: self._fields.5,
2753            labels: self._fields.6,
2754            list: self._fields.7,
2755            list_items_sample: self._fields.8,
2756            record: self._fields.9.unwrap(),
2757            uri: self._fields.10.unwrap(),
2758            extra_data: Default::default(),
2759        }
2760    }
2761    /// Build the final struct with custom extra_data
2762    pub fn build_with_data(
2763        self,
2764        extra_data: BTreeMap<jacquard_common::deps::smol_str::SmolStr, Data<'a>>,
2765    ) -> StarterPackView<'a> {
2766        StarterPackView {
2767            cid: self._fields.0.unwrap(),
2768            creator: self._fields.1.unwrap(),
2769            feeds: self._fields.2,
2770            indexed_at: self._fields.3.unwrap(),
2771            joined_all_time_count: self._fields.4,
2772            joined_week_count: self._fields.5,
2773            labels: self._fields.6,
2774            list: self._fields.7,
2775            list_items_sample: self._fields.8,
2776            record: self._fields.9.unwrap(),
2777            uri: self._fields.10.unwrap(),
2778            extra_data: Some(extra_data),
2779        }
2780    }
2781}
2782
2783pub mod starter_pack_view_basic_state {
2784
2785    pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
2786    #[allow(unused)]
2787    use ::core::marker::PhantomData;
2788    mod sealed {
2789        pub trait Sealed {}
2790    }
2791    /// State trait tracking which required fields have been set
2792    pub trait State: sealed::Sealed {
2793        type Creator;
2794        type Record;
2795        type Cid;
2796        type IndexedAt;
2797        type Uri;
2798    }
2799    /// Empty state - all required fields are unset
2800    pub struct Empty(());
2801    impl sealed::Sealed for Empty {}
2802    impl State for Empty {
2803        type Creator = Unset;
2804        type Record = Unset;
2805        type Cid = Unset;
2806        type IndexedAt = Unset;
2807        type Uri = Unset;
2808    }
2809    ///State transition - sets the `creator` field to Set
2810    pub struct SetCreator<S: State = Empty>(PhantomData<fn() -> S>);
2811    impl<S: State> sealed::Sealed for SetCreator<S> {}
2812    impl<S: State> State for SetCreator<S> {
2813        type Creator = Set<members::creator>;
2814        type Record = S::Record;
2815        type Cid = S::Cid;
2816        type IndexedAt = S::IndexedAt;
2817        type Uri = S::Uri;
2818    }
2819    ///State transition - sets the `record` field to Set
2820    pub struct SetRecord<S: State = Empty>(PhantomData<fn() -> S>);
2821    impl<S: State> sealed::Sealed for SetRecord<S> {}
2822    impl<S: State> State for SetRecord<S> {
2823        type Creator = S::Creator;
2824        type Record = Set<members::record>;
2825        type Cid = S::Cid;
2826        type IndexedAt = S::IndexedAt;
2827        type Uri = S::Uri;
2828    }
2829    ///State transition - sets the `cid` field to Set
2830    pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>);
2831    impl<S: State> sealed::Sealed for SetCid<S> {}
2832    impl<S: State> State for SetCid<S> {
2833        type Creator = S::Creator;
2834        type Record = S::Record;
2835        type Cid = Set<members::cid>;
2836        type IndexedAt = S::IndexedAt;
2837        type Uri = S::Uri;
2838    }
2839    ///State transition - sets the `indexed_at` field to Set
2840    pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>);
2841    impl<S: State> sealed::Sealed for SetIndexedAt<S> {}
2842    impl<S: State> State for SetIndexedAt<S> {
2843        type Creator = S::Creator;
2844        type Record = S::Record;
2845        type Cid = S::Cid;
2846        type IndexedAt = Set<members::indexed_at>;
2847        type Uri = S::Uri;
2848    }
2849    ///State transition - sets the `uri` field to Set
2850    pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>);
2851    impl<S: State> sealed::Sealed for SetUri<S> {}
2852    impl<S: State> State for SetUri<S> {
2853        type Creator = S::Creator;
2854        type Record = S::Record;
2855        type Cid = S::Cid;
2856        type IndexedAt = S::IndexedAt;
2857        type Uri = Set<members::uri>;
2858    }
2859    /// Marker types for field names
2860    #[allow(non_camel_case_types)]
2861    pub mod members {
2862        ///Marker type for the `creator` field
2863        pub struct creator(());
2864        ///Marker type for the `record` field
2865        pub struct record(());
2866        ///Marker type for the `cid` field
2867        pub struct cid(());
2868        ///Marker type for the `indexed_at` field
2869        pub struct indexed_at(());
2870        ///Marker type for the `uri` field
2871        pub struct uri(());
2872    }
2873}
2874
2875/// Builder for constructing an instance of this type
2876pub struct StarterPackViewBasicBuilder<'a, S: starter_pack_view_basic_state::State> {
2877    _state: PhantomData<fn() -> S>,
2878    _fields: (
2879        Option<Cid<'a>>,
2880        Option<ProfileViewBasic<'a>>,
2881        Option<Datetime>,
2882        Option<i64>,
2883        Option<i64>,
2884        Option<Vec<Label<'a>>>,
2885        Option<i64>,
2886        Option<Data<'a>>,
2887        Option<AtUri<'a>>,
2888    ),
2889    _lifetime: PhantomData<&'a ()>,
2890}
2891
2892impl<'a> StarterPackViewBasic<'a> {
2893    /// Create a new builder for this type
2894    pub fn new() -> StarterPackViewBasicBuilder<
2895        'a,
2896        starter_pack_view_basic_state::Empty,
2897    > {
2898        StarterPackViewBasicBuilder::new()
2899    }
2900}
2901
2902impl<'a> StarterPackViewBasicBuilder<'a, starter_pack_view_basic_state::Empty> {
2903    /// Create a new builder with all fields unset
2904    pub fn new() -> Self {
2905        StarterPackViewBasicBuilder {
2906            _state: PhantomData,
2907            _fields: (None, None, None, None, None, None, None, None, None),
2908            _lifetime: PhantomData,
2909        }
2910    }
2911}
2912
2913impl<'a, S> StarterPackViewBasicBuilder<'a, S>
2914where
2915    S: starter_pack_view_basic_state::State,
2916    S::Cid: starter_pack_view_basic_state::IsUnset,
2917{
2918    /// Set the `cid` field (required)
2919    pub fn cid(
2920        mut self,
2921        value: impl Into<Cid<'a>>,
2922    ) -> StarterPackViewBasicBuilder<'a, starter_pack_view_basic_state::SetCid<S>> {
2923        self._fields.0 = Option::Some(value.into());
2924        StarterPackViewBasicBuilder {
2925            _state: PhantomData,
2926            _fields: self._fields,
2927            _lifetime: PhantomData,
2928        }
2929    }
2930}
2931
2932impl<'a, S> StarterPackViewBasicBuilder<'a, S>
2933where
2934    S: starter_pack_view_basic_state::State,
2935    S::Creator: starter_pack_view_basic_state::IsUnset,
2936{
2937    /// Set the `creator` field (required)
2938    pub fn creator(
2939        mut self,
2940        value: impl Into<ProfileViewBasic<'a>>,
2941    ) -> StarterPackViewBasicBuilder<'a, starter_pack_view_basic_state::SetCreator<S>> {
2942        self._fields.1 = Option::Some(value.into());
2943        StarterPackViewBasicBuilder {
2944            _state: PhantomData,
2945            _fields: self._fields,
2946            _lifetime: PhantomData,
2947        }
2948    }
2949}
2950
2951impl<'a, S> StarterPackViewBasicBuilder<'a, S>
2952where
2953    S: starter_pack_view_basic_state::State,
2954    S::IndexedAt: starter_pack_view_basic_state::IsUnset,
2955{
2956    /// Set the `indexedAt` field (required)
2957    pub fn indexed_at(
2958        mut self,
2959        value: impl Into<Datetime>,
2960    ) -> StarterPackViewBasicBuilder<
2961        'a,
2962        starter_pack_view_basic_state::SetIndexedAt<S>,
2963    > {
2964        self._fields.2 = Option::Some(value.into());
2965        StarterPackViewBasicBuilder {
2966            _state: PhantomData,
2967            _fields: self._fields,
2968            _lifetime: PhantomData,
2969        }
2970    }
2971}
2972
2973impl<'a, S: starter_pack_view_basic_state::State> StarterPackViewBasicBuilder<'a, S> {
2974    /// Set the `joinedAllTimeCount` field (optional)
2975    pub fn joined_all_time_count(mut self, value: impl Into<Option<i64>>) -> Self {
2976        self._fields.3 = value.into();
2977        self
2978    }
2979    /// Set the `joinedAllTimeCount` field to an Option value (optional)
2980    pub fn maybe_joined_all_time_count(mut self, value: Option<i64>) -> Self {
2981        self._fields.3 = value;
2982        self
2983    }
2984}
2985
2986impl<'a, S: starter_pack_view_basic_state::State> StarterPackViewBasicBuilder<'a, S> {
2987    /// Set the `joinedWeekCount` field (optional)
2988    pub fn joined_week_count(mut self, value: impl Into<Option<i64>>) -> Self {
2989        self._fields.4 = value.into();
2990        self
2991    }
2992    /// Set the `joinedWeekCount` field to an Option value (optional)
2993    pub fn maybe_joined_week_count(mut self, value: Option<i64>) -> Self {
2994        self._fields.4 = value;
2995        self
2996    }
2997}
2998
2999impl<'a, S: starter_pack_view_basic_state::State> StarterPackViewBasicBuilder<'a, S> {
3000    /// Set the `labels` field (optional)
3001    pub fn labels(mut self, value: impl Into<Option<Vec<Label<'a>>>>) -> Self {
3002        self._fields.5 = value.into();
3003        self
3004    }
3005    /// Set the `labels` field to an Option value (optional)
3006    pub fn maybe_labels(mut self, value: Option<Vec<Label<'a>>>) -> Self {
3007        self._fields.5 = value;
3008        self
3009    }
3010}
3011
3012impl<'a, S: starter_pack_view_basic_state::State> StarterPackViewBasicBuilder<'a, S> {
3013    /// Set the `listItemCount` field (optional)
3014    pub fn list_item_count(mut self, value: impl Into<Option<i64>>) -> Self {
3015        self._fields.6 = value.into();
3016        self
3017    }
3018    /// Set the `listItemCount` field to an Option value (optional)
3019    pub fn maybe_list_item_count(mut self, value: Option<i64>) -> Self {
3020        self._fields.6 = value;
3021        self
3022    }
3023}
3024
3025impl<'a, S> StarterPackViewBasicBuilder<'a, S>
3026where
3027    S: starter_pack_view_basic_state::State,
3028    S::Record: starter_pack_view_basic_state::IsUnset,
3029{
3030    /// Set the `record` field (required)
3031    pub fn record(
3032        mut self,
3033        value: impl Into<Data<'a>>,
3034    ) -> StarterPackViewBasicBuilder<'a, starter_pack_view_basic_state::SetRecord<S>> {
3035        self._fields.7 = Option::Some(value.into());
3036        StarterPackViewBasicBuilder {
3037            _state: PhantomData,
3038            _fields: self._fields,
3039            _lifetime: PhantomData,
3040        }
3041    }
3042}
3043
3044impl<'a, S> StarterPackViewBasicBuilder<'a, S>
3045where
3046    S: starter_pack_view_basic_state::State,
3047    S::Uri: starter_pack_view_basic_state::IsUnset,
3048{
3049    /// Set the `uri` field (required)
3050    pub fn uri(
3051        mut self,
3052        value: impl Into<AtUri<'a>>,
3053    ) -> StarterPackViewBasicBuilder<'a, starter_pack_view_basic_state::SetUri<S>> {
3054        self._fields.8 = Option::Some(value.into());
3055        StarterPackViewBasicBuilder {
3056            _state: PhantomData,
3057            _fields: self._fields,
3058            _lifetime: PhantomData,
3059        }
3060    }
3061}
3062
3063impl<'a, S> StarterPackViewBasicBuilder<'a, S>
3064where
3065    S: starter_pack_view_basic_state::State,
3066    S::Creator: starter_pack_view_basic_state::IsSet,
3067    S::Record: starter_pack_view_basic_state::IsSet,
3068    S::Cid: starter_pack_view_basic_state::IsSet,
3069    S::IndexedAt: starter_pack_view_basic_state::IsSet,
3070    S::Uri: starter_pack_view_basic_state::IsSet,
3071{
3072    /// Build the final struct
3073    pub fn build(self) -> StarterPackViewBasic<'a> {
3074        StarterPackViewBasic {
3075            cid: self._fields.0.unwrap(),
3076            creator: self._fields.1.unwrap(),
3077            indexed_at: self._fields.2.unwrap(),
3078            joined_all_time_count: self._fields.3,
3079            joined_week_count: self._fields.4,
3080            labels: self._fields.5,
3081            list_item_count: self._fields.6,
3082            record: self._fields.7.unwrap(),
3083            uri: self._fields.8.unwrap(),
3084            extra_data: Default::default(),
3085        }
3086    }
3087    /// Build the final struct with custom extra_data
3088    pub fn build_with_data(
3089        self,
3090        extra_data: BTreeMap<jacquard_common::deps::smol_str::SmolStr, Data<'a>>,
3091    ) -> StarterPackViewBasic<'a> {
3092        StarterPackViewBasic {
3093            cid: self._fields.0.unwrap(),
3094            creator: self._fields.1.unwrap(),
3095            indexed_at: self._fields.2.unwrap(),
3096            joined_all_time_count: self._fields.3,
3097            joined_week_count: self._fields.4,
3098            labels: self._fields.5,
3099            list_item_count: self._fields.6,
3100            record: self._fields.7.unwrap(),
3101            uri: self._fields.8.unwrap(),
3102            extra_data: Some(extra_data),
3103        }
3104    }
3105}