Skip to main content

jacquard_api/sh_weaver/
graph.rs

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