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