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