Skip to main content

jacquard_api/games_gamesgamesgamesgames/feed/
get_list.rs

1// @generated by jacquard-lexicon. DO NOT EDIT.
2//
3// Lexicon: games.gamesgamesgamesgames.feed.getList
4//
5// This file was automatically generated from Lexicon schemas.
6// Any manual changes will be overwritten on the next regeneration.
7
8#[allow(unused_imports)]
9use alloc::collections::BTreeMap;
10
11#[allow(unused_imports)]
12use core::marker::PhantomData;
13use jacquard_common::{BosStr, CowStr, DefaultStr, FromStaticStr};
14
15#[allow(unused_imports)]
16use jacquard_common::deps::codegen::unicode_segmentation::UnicodeSegmentation;
17use jacquard_common::deps::smol_str::SmolStr;
18use jacquard_common::types::string::{AtUri, Datetime, Did};
19use jacquard_common::types::value::Data;
20use jacquard_derive::IntoStatic;
21use jacquard_lexicon::lexicon::LexiconDoc;
22use jacquard_lexicon::schema::LexiconSchema;
23
24use crate::games_gamesgamesgamesgames::feed::get_list;
25#[allow(unused_imports)]
26use jacquard_lexicon::validation::{ConstraintError, ValidationPath};
27use serde::{Deserialize, Serialize};
28
29#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
30#[serde(
31    rename_all = "camelCase",
32    bound(deserialize = "S: Deserialize<'de> + BosStr")
33)]
34pub struct CreatorView<S: BosStr = DefaultStr> {
35    #[serde(skip_serializing_if = "Option::is_none")]
36    pub avatar: Option<Data<S>>,
37    pub did: Did<S>,
38    #[serde(skip_serializing_if = "Option::is_none")]
39    pub display_name: Option<S>,
40    pub handle: S,
41    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
42    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
43}
44
45#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
46#[serde(
47    rename_all = "camelCase",
48    bound(deserialize = "S: Deserialize<'de> + BosStr")
49)]
50pub struct ListDetailView<S: BosStr = DefaultStr> {
51    pub created_at: Datetime,
52    pub creator: get_list::CreatorView<S>,
53    #[serde(skip_serializing_if = "Option::is_none")]
54    pub description: Option<S>,
55    pub item_count: i64,
56    pub name: S,
57    pub uri: AtUri<S>,
58    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
59    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
60}
61
62#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
63#[serde(
64    rename_all = "camelCase",
65    bound(deserialize = "S: Deserialize<'de> + BosStr")
66)]
67pub struct GetList<S: BosStr = DefaultStr> {
68    pub uri: AtUri<S>,
69}
70
71#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
72#[serde(
73    rename_all = "camelCase",
74    bound(deserialize = "S: Deserialize<'de> + BosStr")
75)]
76pub struct GetListOutput<S: BosStr = DefaultStr> {
77    pub list: get_list::ListDetailView<S>,
78    #[serde(flatten, default, skip_serializing_if = "Option::is_none")]
79    pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
80}
81
82impl<S: BosStr> LexiconSchema for CreatorView<S> {
83    fn nsid() -> &'static str {
84        "games.gamesgamesgamesgames.feed.getList"
85    }
86    fn def_name() -> &'static str {
87        "creatorView"
88    }
89    fn lexicon_doc() -> LexiconDoc<'static> {
90        lexicon_doc_games_gamesgamesgamesgames_feed_getList()
91    }
92    fn validate(&self) -> Result<(), ConstraintError> {
93        Ok(())
94    }
95}
96
97impl<S: BosStr> LexiconSchema for ListDetailView<S> {
98    fn nsid() -> &'static str {
99        "games.gamesgamesgamesgames.feed.getList"
100    }
101    fn def_name() -> &'static str {
102        "listDetailView"
103    }
104    fn lexicon_doc() -> LexiconDoc<'static> {
105        lexicon_doc_games_gamesgamesgamesgames_feed_getList()
106    }
107    fn validate(&self) -> Result<(), ConstraintError> {
108        Ok(())
109    }
110}
111
112/** Response marker for the `games.gamesgamesgamesgames.feed.getList` query.
113
114Implements `jacquard_common::xrpc::XrpcResp`; successful bodies decode as `Self::Output<S>`, which is `GetListOutput<S>` for this endpoint.*/
115pub struct GetListResponse;
116impl jacquard_common::xrpc::XrpcResp for GetListResponse {
117    const NSID: &'static str = "games.gamesgamesgamesgames.feed.getList";
118    const ENCODING: &'static str = "application/json";
119    type Output<S: BosStr> = GetListOutput<S>;
120    type Err = jacquard_common::xrpc::GenericError;
121}
122
123impl<S: BosStr> jacquard_common::xrpc::XrpcRequest for GetList<S> {
124    const NSID: &'static str = "games.gamesgamesgamesgames.feed.getList";
125    const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query;
126    type Response = GetListResponse;
127}
128
129/** Endpoint marker for the `games.gamesgamesgamesgames.feed.getList` query.
130
131Path: `/xrpc/games.gamesgamesgamesgames.feed.getList`. The request payload type is `GetList<S>`; send that request with `jacquard::Client` or use this marker through lower-level `XrpcEndpoint` APIs.*/
132pub struct GetListRequest;
133impl jacquard_common::xrpc::XrpcEndpoint for GetListRequest {
134    const PATH: &'static str = "/xrpc/games.gamesgamesgamesgames.feed.getList";
135    const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query;
136    type Request<S: BosStr> = GetList<S>;
137    type Response = GetListResponse;
138}
139
140pub mod creator_view_state {
141
142    pub use crate::builder_types::{IsSet, IsUnset, Set, Unset};
143    #[allow(unused)]
144    use ::core::marker::PhantomData;
145    mod sealed {
146        pub trait Sealed {}
147    }
148    /// State trait tracking which required fields have been set
149    pub trait State: sealed::Sealed {
150        type Did;
151        type Handle;
152    }
153    /// Empty state - all required fields are unset
154    pub struct Empty(());
155    impl sealed::Sealed for Empty {}
156    impl State for Empty {
157        type Did = Unset;
158        type Handle = Unset;
159    }
160    ///State transition - sets the `did` field to Set
161    pub struct SetDid<St: State = Empty>(PhantomData<fn() -> St>);
162    impl<St: State> sealed::Sealed for SetDid<St> {}
163    impl<St: State> State for SetDid<St> {
164        type Did = Set<members::did>;
165        type Handle = St::Handle;
166    }
167    ///State transition - sets the `handle` field to Set
168    pub struct SetHandle<St: State = Empty>(PhantomData<fn() -> St>);
169    impl<St: State> sealed::Sealed for SetHandle<St> {}
170    impl<St: State> State for SetHandle<St> {
171        type Did = St::Did;
172        type Handle = Set<members::handle>;
173    }
174    /// Marker types for field names
175    #[allow(non_camel_case_types)]
176    pub mod members {
177        ///Marker type for the `did` field
178        pub struct did(());
179        ///Marker type for the `handle` field
180        pub struct handle(());
181    }
182}
183
184/// Builder for constructing an instance of this type.
185pub struct CreatorViewBuilder<St: creator_view_state::State, S: BosStr = DefaultStr> {
186    _state: PhantomData<fn() -> St>,
187    _fields: (Option<Data<S>>, Option<Did<S>>, Option<S>, Option<S>),
188    _type: PhantomData<fn() -> S>,
189}
190
191impl CreatorView<DefaultStr> {
192    /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed
193    pub fn new() -> CreatorViewBuilder<creator_view_state::Empty, DefaultStr> {
194        CreatorViewBuilder::new()
195    }
196}
197
198impl<S: BosStr> CreatorView<S> {
199    /// Create a new builder for this type
200    pub fn builder() -> CreatorViewBuilder<creator_view_state::Empty, S> {
201        CreatorViewBuilder::builder()
202    }
203}
204
205impl CreatorViewBuilder<creator_view_state::Empty, DefaultStr> {
206    /// Create a new builder with all fields unset, using the default string type, if needed
207    pub fn new() -> Self {
208        CreatorViewBuilder {
209            _state: PhantomData,
210            _fields: (None, None, None, None),
211            _type: PhantomData,
212        }
213    }
214}
215
216impl<S: BosStr> CreatorViewBuilder<creator_view_state::Empty, S> {
217    /// Create a new builder with all fields unset
218    pub fn builder() -> Self {
219        CreatorViewBuilder {
220            _state: PhantomData,
221            _fields: (None, None, None, None),
222            _type: PhantomData,
223        }
224    }
225}
226
227impl<St: creator_view_state::State, S: BosStr> CreatorViewBuilder<St, S> {
228    /// Set the `avatar` field (optional)
229    pub fn avatar(mut self, value: impl Into<Option<Data<S>>>) -> Self {
230        self._fields.0 = value.into();
231        self
232    }
233    /// Set the `avatar` field to an Option value (optional)
234    pub fn maybe_avatar(mut self, value: Option<Data<S>>) -> Self {
235        self._fields.0 = value;
236        self
237    }
238}
239
240impl<St, S: BosStr> CreatorViewBuilder<St, S>
241where
242    St: creator_view_state::State,
243    St::Did: creator_view_state::IsUnset,
244{
245    /// Set the `did` field (required)
246    pub fn did(
247        mut self,
248        value: impl Into<Did<S>>,
249    ) -> CreatorViewBuilder<creator_view_state::SetDid<St>, S> {
250        self._fields.1 = Option::Some(value.into());
251        CreatorViewBuilder {
252            _state: PhantomData,
253            _fields: self._fields,
254            _type: PhantomData,
255        }
256    }
257}
258
259impl<St: creator_view_state::State, S: BosStr> CreatorViewBuilder<St, S> {
260    /// Set the `displayName` field (optional)
261    pub fn display_name(mut self, value: impl Into<Option<S>>) -> Self {
262        self._fields.2 = value.into();
263        self
264    }
265    /// Set the `displayName` field to an Option value (optional)
266    pub fn maybe_display_name(mut self, value: Option<S>) -> Self {
267        self._fields.2 = value;
268        self
269    }
270}
271
272impl<St, S: BosStr> CreatorViewBuilder<St, S>
273where
274    St: creator_view_state::State,
275    St::Handle: creator_view_state::IsUnset,
276{
277    /// Set the `handle` field (required)
278    pub fn handle(
279        mut self,
280        value: impl Into<S>,
281    ) -> CreatorViewBuilder<creator_view_state::SetHandle<St>, S> {
282        self._fields.3 = Option::Some(value.into());
283        CreatorViewBuilder {
284            _state: PhantomData,
285            _fields: self._fields,
286            _type: PhantomData,
287        }
288    }
289}
290
291impl<St, S: BosStr> CreatorViewBuilder<St, S>
292where
293    St: creator_view_state::State,
294    St::Did: creator_view_state::IsSet,
295    St::Handle: creator_view_state::IsSet,
296{
297    /// Build the final struct.
298    pub fn build(self) -> CreatorView<S> {
299        CreatorView {
300            avatar: self._fields.0,
301            did: self._fields.1.unwrap(),
302            display_name: self._fields.2,
303            handle: self._fields.3.unwrap(),
304            extra_data: Default::default(),
305        }
306    }
307    /// Build the final struct with custom extra_data.
308    pub fn build_with_data(self, extra_data: BTreeMap<SmolStr, Data<S>>) -> CreatorView<S> {
309        CreatorView {
310            avatar: self._fields.0,
311            did: self._fields.1.unwrap(),
312            display_name: self._fields.2,
313            handle: self._fields.3.unwrap(),
314            extra_data: Some(extra_data),
315        }
316    }
317}
318
319fn lexicon_doc_games_gamesgamesgamesgames_feed_getList() -> LexiconDoc<'static> {
320    use alloc::collections::BTreeMap;
321    #[allow(unused_imports)]
322    use jacquard_common::{CowStr, deps::smol_str::SmolStr, types::blob::MimeType};
323    use jacquard_lexicon::lexicon::*;
324    LexiconDoc {
325        lexicon: Lexicon::Lexicon1,
326        id: CowStr::new_static("games.gamesgamesgamesgames.feed.getList"),
327        defs: {
328            let mut map = BTreeMap::new();
329            map.insert(
330                SmolStr::new_static("creatorView"),
331                LexUserType::Object(LexObject {
332                    required: Some(vec![
333                        SmolStr::new_static("did"),
334                        SmolStr::new_static("handle"),
335                    ]),
336                    properties: {
337                        #[allow(unused_mut)]
338                        let mut map = BTreeMap::new();
339                        map.insert(
340                            SmolStr::new_static("avatar"),
341                            LexObjectProperty::Unknown(LexUnknown {
342                                ..Default::default()
343                            }),
344                        );
345                        map.insert(
346                            SmolStr::new_static("did"),
347                            LexObjectProperty::String(LexString {
348                                format: Some(LexStringFormat::Did),
349                                ..Default::default()
350                            }),
351                        );
352                        map.insert(
353                            SmolStr::new_static("displayName"),
354                            LexObjectProperty::String(LexString {
355                                ..Default::default()
356                            }),
357                        );
358                        map.insert(
359                            SmolStr::new_static("handle"),
360                            LexObjectProperty::String(LexString {
361                                ..Default::default()
362                            }),
363                        );
364                        map
365                    },
366                    ..Default::default()
367                }),
368            );
369            map.insert(
370                SmolStr::new_static("listDetailView"),
371                LexUserType::Object(LexObject {
372                    required: Some(vec![
373                        SmolStr::new_static("uri"),
374                        SmolStr::new_static("name"),
375                        SmolStr::new_static("itemCount"),
376                        SmolStr::new_static("createdAt"),
377                        SmolStr::new_static("creator"),
378                    ]),
379                    properties: {
380                        #[allow(unused_mut)]
381                        let mut map = BTreeMap::new();
382                        map.insert(
383                            SmolStr::new_static("createdAt"),
384                            LexObjectProperty::String(LexString {
385                                format: Some(LexStringFormat::Datetime),
386                                ..Default::default()
387                            }),
388                        );
389                        map.insert(
390                            SmolStr::new_static("creator"),
391                            LexObjectProperty::Ref(LexRef {
392                                r#ref: CowStr::new_static("#creatorView"),
393                                ..Default::default()
394                            }),
395                        );
396                        map.insert(
397                            SmolStr::new_static("description"),
398                            LexObjectProperty::String(LexString {
399                                ..Default::default()
400                            }),
401                        );
402                        map.insert(
403                            SmolStr::new_static("itemCount"),
404                            LexObjectProperty::Integer(LexInteger {
405                                ..Default::default()
406                            }),
407                        );
408                        map.insert(
409                            SmolStr::new_static("name"),
410                            LexObjectProperty::String(LexString {
411                                ..Default::default()
412                            }),
413                        );
414                        map.insert(
415                            SmolStr::new_static("uri"),
416                            LexObjectProperty::String(LexString {
417                                format: Some(LexStringFormat::AtUri),
418                                ..Default::default()
419                            }),
420                        );
421                        map
422                    },
423                    ..Default::default()
424                }),
425            );
426            map.insert(
427                SmolStr::new_static("main"),
428                LexUserType::XrpcQuery(LexXrpcQuery {
429                    parameters: Some(LexXrpcQueryParameter::Params(LexXrpcParameters {
430                        required: Some(vec![SmolStr::new_static("uri")]),
431                        properties: {
432                            #[allow(unused_mut)]
433                            let mut map = BTreeMap::new();
434                            map.insert(
435                                SmolStr::new_static("uri"),
436                                LexXrpcParametersProperty::String(LexString {
437                                    description: Some(CowStr::new_static(
438                                        "The AT-URI of the list record.",
439                                    )),
440                                    format: Some(LexStringFormat::AtUri),
441                                    ..Default::default()
442                                }),
443                            );
444                            map
445                        },
446                        ..Default::default()
447                    })),
448                    ..Default::default()
449                }),
450            );
451            map
452        },
453        ..Default::default()
454    }
455}
456
457pub mod list_detail_view_state {
458
459    pub use crate::builder_types::{IsSet, IsUnset, Set, Unset};
460    #[allow(unused)]
461    use ::core::marker::PhantomData;
462    mod sealed {
463        pub trait Sealed {}
464    }
465    /// State trait tracking which required fields have been set
466    pub trait State: sealed::Sealed {
467        type CreatedAt;
468        type Creator;
469        type ItemCount;
470        type Name;
471        type Uri;
472    }
473    /// Empty state - all required fields are unset
474    pub struct Empty(());
475    impl sealed::Sealed for Empty {}
476    impl State for Empty {
477        type CreatedAt = Unset;
478        type Creator = Unset;
479        type ItemCount = Unset;
480        type Name = Unset;
481        type Uri = Unset;
482    }
483    ///State transition - sets the `created_at` field to Set
484    pub struct SetCreatedAt<St: State = Empty>(PhantomData<fn() -> St>);
485    impl<St: State> sealed::Sealed for SetCreatedAt<St> {}
486    impl<St: State> State for SetCreatedAt<St> {
487        type CreatedAt = Set<members::created_at>;
488        type Creator = St::Creator;
489        type ItemCount = St::ItemCount;
490        type Name = St::Name;
491        type Uri = St::Uri;
492    }
493    ///State transition - sets the `creator` field to Set
494    pub struct SetCreator<St: State = Empty>(PhantomData<fn() -> St>);
495    impl<St: State> sealed::Sealed for SetCreator<St> {}
496    impl<St: State> State for SetCreator<St> {
497        type CreatedAt = St::CreatedAt;
498        type Creator = Set<members::creator>;
499        type ItemCount = St::ItemCount;
500        type Name = St::Name;
501        type Uri = St::Uri;
502    }
503    ///State transition - sets the `item_count` field to Set
504    pub struct SetItemCount<St: State = Empty>(PhantomData<fn() -> St>);
505    impl<St: State> sealed::Sealed for SetItemCount<St> {}
506    impl<St: State> State for SetItemCount<St> {
507        type CreatedAt = St::CreatedAt;
508        type Creator = St::Creator;
509        type ItemCount = Set<members::item_count>;
510        type Name = St::Name;
511        type Uri = St::Uri;
512    }
513    ///State transition - sets the `name` field to Set
514    pub struct SetName<St: State = Empty>(PhantomData<fn() -> St>);
515    impl<St: State> sealed::Sealed for SetName<St> {}
516    impl<St: State> State for SetName<St> {
517        type CreatedAt = St::CreatedAt;
518        type Creator = St::Creator;
519        type ItemCount = St::ItemCount;
520        type Name = Set<members::name>;
521        type Uri = St::Uri;
522    }
523    ///State transition - sets the `uri` field to Set
524    pub struct SetUri<St: State = Empty>(PhantomData<fn() -> St>);
525    impl<St: State> sealed::Sealed for SetUri<St> {}
526    impl<St: State> State for SetUri<St> {
527        type CreatedAt = St::CreatedAt;
528        type Creator = St::Creator;
529        type ItemCount = St::ItemCount;
530        type Name = St::Name;
531        type Uri = Set<members::uri>;
532    }
533    /// Marker types for field names
534    #[allow(non_camel_case_types)]
535    pub mod members {
536        ///Marker type for the `created_at` field
537        pub struct created_at(());
538        ///Marker type for the `creator` field
539        pub struct creator(());
540        ///Marker type for the `item_count` field
541        pub struct item_count(());
542        ///Marker type for the `name` field
543        pub struct name(());
544        ///Marker type for the `uri` field
545        pub struct uri(());
546    }
547}
548
549/// Builder for constructing an instance of this type.
550pub struct ListDetailViewBuilder<St: list_detail_view_state::State, S: BosStr = DefaultStr> {
551    _state: PhantomData<fn() -> St>,
552    _fields: (
553        Option<Datetime>,
554        Option<get_list::CreatorView<S>>,
555        Option<S>,
556        Option<i64>,
557        Option<S>,
558        Option<AtUri<S>>,
559    ),
560    _type: PhantomData<fn() -> S>,
561}
562
563impl ListDetailView<DefaultStr> {
564    /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed
565    pub fn new() -> ListDetailViewBuilder<list_detail_view_state::Empty, DefaultStr> {
566        ListDetailViewBuilder::new()
567    }
568}
569
570impl<S: BosStr> ListDetailView<S> {
571    /// Create a new builder for this type
572    pub fn builder() -> ListDetailViewBuilder<list_detail_view_state::Empty, S> {
573        ListDetailViewBuilder::builder()
574    }
575}
576
577impl ListDetailViewBuilder<list_detail_view_state::Empty, DefaultStr> {
578    /// Create a new builder with all fields unset, using the default string type, if needed
579    pub fn new() -> Self {
580        ListDetailViewBuilder {
581            _state: PhantomData,
582            _fields: (None, None, None, None, None, None),
583            _type: PhantomData,
584        }
585    }
586}
587
588impl<S: BosStr> ListDetailViewBuilder<list_detail_view_state::Empty, S> {
589    /// Create a new builder with all fields unset
590    pub fn builder() -> Self {
591        ListDetailViewBuilder {
592            _state: PhantomData,
593            _fields: (None, None, None, None, None, None),
594            _type: PhantomData,
595        }
596    }
597}
598
599impl<St, S: BosStr> ListDetailViewBuilder<St, S>
600where
601    St: list_detail_view_state::State,
602    St::CreatedAt: list_detail_view_state::IsUnset,
603{
604    /// Set the `createdAt` field (required)
605    pub fn created_at(
606        mut self,
607        value: impl Into<Datetime>,
608    ) -> ListDetailViewBuilder<list_detail_view_state::SetCreatedAt<St>, S> {
609        self._fields.0 = Option::Some(value.into());
610        ListDetailViewBuilder {
611            _state: PhantomData,
612            _fields: self._fields,
613            _type: PhantomData,
614        }
615    }
616}
617
618impl<St, S: BosStr> ListDetailViewBuilder<St, S>
619where
620    St: list_detail_view_state::State,
621    St::Creator: list_detail_view_state::IsUnset,
622{
623    /// Set the `creator` field (required)
624    pub fn creator(
625        mut self,
626        value: impl Into<get_list::CreatorView<S>>,
627    ) -> ListDetailViewBuilder<list_detail_view_state::SetCreator<St>, S> {
628        self._fields.1 = Option::Some(value.into());
629        ListDetailViewBuilder {
630            _state: PhantomData,
631            _fields: self._fields,
632            _type: PhantomData,
633        }
634    }
635}
636
637impl<St: list_detail_view_state::State, S: BosStr> ListDetailViewBuilder<St, S> {
638    /// Set the `description` field (optional)
639    pub fn description(mut self, value: impl Into<Option<S>>) -> Self {
640        self._fields.2 = value.into();
641        self
642    }
643    /// Set the `description` field to an Option value (optional)
644    pub fn maybe_description(mut self, value: Option<S>) -> Self {
645        self._fields.2 = value;
646        self
647    }
648}
649
650impl<St, S: BosStr> ListDetailViewBuilder<St, S>
651where
652    St: list_detail_view_state::State,
653    St::ItemCount: list_detail_view_state::IsUnset,
654{
655    /// Set the `itemCount` field (required)
656    pub fn item_count(
657        mut self,
658        value: impl Into<i64>,
659    ) -> ListDetailViewBuilder<list_detail_view_state::SetItemCount<St>, S> {
660        self._fields.3 = Option::Some(value.into());
661        ListDetailViewBuilder {
662            _state: PhantomData,
663            _fields: self._fields,
664            _type: PhantomData,
665        }
666    }
667}
668
669impl<St, S: BosStr> ListDetailViewBuilder<St, S>
670where
671    St: list_detail_view_state::State,
672    St::Name: list_detail_view_state::IsUnset,
673{
674    /// Set the `name` field (required)
675    pub fn name(
676        mut self,
677        value: impl Into<S>,
678    ) -> ListDetailViewBuilder<list_detail_view_state::SetName<St>, S> {
679        self._fields.4 = Option::Some(value.into());
680        ListDetailViewBuilder {
681            _state: PhantomData,
682            _fields: self._fields,
683            _type: PhantomData,
684        }
685    }
686}
687
688impl<St, S: BosStr> ListDetailViewBuilder<St, S>
689where
690    St: list_detail_view_state::State,
691    St::Uri: list_detail_view_state::IsUnset,
692{
693    /// Set the `uri` field (required)
694    pub fn uri(
695        mut self,
696        value: impl Into<AtUri<S>>,
697    ) -> ListDetailViewBuilder<list_detail_view_state::SetUri<St>, S> {
698        self._fields.5 = Option::Some(value.into());
699        ListDetailViewBuilder {
700            _state: PhantomData,
701            _fields: self._fields,
702            _type: PhantomData,
703        }
704    }
705}
706
707impl<St, S: BosStr> ListDetailViewBuilder<St, S>
708where
709    St: list_detail_view_state::State,
710    St::CreatedAt: list_detail_view_state::IsSet,
711    St::Creator: list_detail_view_state::IsSet,
712    St::ItemCount: list_detail_view_state::IsSet,
713    St::Name: list_detail_view_state::IsSet,
714    St::Uri: list_detail_view_state::IsSet,
715{
716    /// Build the final struct.
717    pub fn build(self) -> ListDetailView<S> {
718        ListDetailView {
719            created_at: self._fields.0.unwrap(),
720            creator: self._fields.1.unwrap(),
721            description: self._fields.2,
722            item_count: self._fields.3.unwrap(),
723            name: self._fields.4.unwrap(),
724            uri: self._fields.5.unwrap(),
725            extra_data: Default::default(),
726        }
727    }
728    /// Build the final struct with custom extra_data.
729    pub fn build_with_data(self, extra_data: BTreeMap<SmolStr, Data<S>>) -> ListDetailView<S> {
730        ListDetailView {
731            created_at: self._fields.0.unwrap(),
732            creator: self._fields.1.unwrap(),
733            description: self._fields.2,
734            item_count: self._fields.3.unwrap(),
735            name: self._fields.4.unwrap(),
736            uri: self._fields.5.unwrap(),
737            extra_data: Some(extra_data),
738        }
739    }
740}
741
742pub mod get_list_state {
743
744    pub use crate::builder_types::{IsSet, IsUnset, Set, Unset};
745    #[allow(unused)]
746    use ::core::marker::PhantomData;
747    mod sealed {
748        pub trait Sealed {}
749    }
750    /// State trait tracking which required fields have been set
751    pub trait State: sealed::Sealed {
752        type Uri;
753    }
754    /// Empty state - all required fields are unset
755    pub struct Empty(());
756    impl sealed::Sealed for Empty {}
757    impl State for Empty {
758        type Uri = Unset;
759    }
760    ///State transition - sets the `uri` field to Set
761    pub struct SetUri<St: State = Empty>(PhantomData<fn() -> St>);
762    impl<St: State> sealed::Sealed for SetUri<St> {}
763    impl<St: State> State for SetUri<St> {
764        type Uri = Set<members::uri>;
765    }
766    /// Marker types for field names
767    #[allow(non_camel_case_types)]
768    pub mod members {
769        ///Marker type for the `uri` field
770        pub struct uri(());
771    }
772}
773
774/// Builder for constructing an instance of this type.
775pub struct GetListBuilder<St: get_list_state::State, S: BosStr = DefaultStr> {
776    _state: PhantomData<fn() -> St>,
777    _fields: (Option<AtUri<S>>,),
778    _type: PhantomData<fn() -> S>,
779}
780
781impl GetList<DefaultStr> {
782    /// Create a new builder for this type, using the default string type (DefaultStr = SmolStr) if needed
783    pub fn new() -> GetListBuilder<get_list_state::Empty, DefaultStr> {
784        GetListBuilder::new()
785    }
786}
787
788impl<S: BosStr> GetList<S> {
789    /// Create a new builder for this type
790    pub fn builder() -> GetListBuilder<get_list_state::Empty, S> {
791        GetListBuilder::builder()
792    }
793}
794
795impl GetListBuilder<get_list_state::Empty, DefaultStr> {
796    /// Create a new builder with all fields unset, using the default string type, if needed
797    pub fn new() -> Self {
798        GetListBuilder {
799            _state: PhantomData,
800            _fields: (None,),
801            _type: PhantomData,
802        }
803    }
804}
805
806impl<S: BosStr> GetListBuilder<get_list_state::Empty, S> {
807    /// Create a new builder with all fields unset
808    pub fn builder() -> Self {
809        GetListBuilder {
810            _state: PhantomData,
811            _fields: (None,),
812            _type: PhantomData,
813        }
814    }
815}
816
817impl<St, S: BosStr> GetListBuilder<St, S>
818where
819    St: get_list_state::State,
820    St::Uri: get_list_state::IsUnset,
821{
822    /// Set the `uri` field (required)
823    pub fn uri(
824        mut self,
825        value: impl Into<AtUri<S>>,
826    ) -> GetListBuilder<get_list_state::SetUri<St>, S> {
827        self._fields.0 = Option::Some(value.into());
828        GetListBuilder {
829            _state: PhantomData,
830            _fields: self._fields,
831            _type: PhantomData,
832        }
833    }
834}
835
836impl<St, S: BosStr> GetListBuilder<St, S>
837where
838    St: get_list_state::State,
839    St::Uri: get_list_state::IsSet,
840{
841    /// Build the final struct.
842    pub fn build(self) -> GetList<S> {
843        GetList {
844            uri: self._fields.0.unwrap(),
845        }
846    }
847}