1pub mod get_actor_entries;
9pub mod get_actor_notebooks;
10pub mod get_profile;
11pub mod get_suggested_authors;
12pub mod profile;
13pub mod search_actors;
14pub mod search_actors_typeahead;
15
16
17#[allow(unused_imports)]
18use alloc::collections::BTreeMap;
19
20#[allow(unused_imports)]
21use core::marker::PhantomData;
22use jacquard_common::CowStr;
23use jacquard_common::deps::bytes::Bytes;
24
25#[allow(unused_imports)]
26use jacquard_common::deps::codegen::unicode_segmentation::UnicodeSegmentation;
27use jacquard_common::types::string::{Did, Handle, AtUri, Datetime, UriValue};
28use jacquard_derive::{IntoStatic, lexicon, open_union};
29use jacquard_lexicon::lexicon::LexiconDoc;
30use jacquard_lexicon::schema::LexiconSchema;
31
32#[allow(unused_imports)]
33use jacquard_lexicon::validation::{ConstraintError, ValidationPath};
34use serde::{Serialize, Deserialize};
35use crate::app_bsky::actor::ProfileViewDetailed;
36use crate::com_atproto::label::Label;
37use crate::com_atproto::repo::strong_ref::StrongRef;
38use crate::sh_weaver::actor;
39#[lexicon]
42#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
43#[serde(rename_all = "camelCase")]
44pub struct Author<'a> {
45 #[serde(borrow)]
46 pub did: Did<'a>,
47 #[serde(skip_serializing_if = "Option::is_none")]
49 #[serde(default, with = "jacquard_common::opt_serde_bytes_helper")]
50 pub signature: Option<Bytes>,
51}
52
53pub type PinnedList<'a> = Vec<StrongRef<'a>>;
54
55#[lexicon]
56#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
57#[serde(rename_all = "camelCase")]
58pub struct ProfileDataView<'a> {
59 #[serde(skip_serializing_if = "Option::is_none")]
60 pub collaboration_count: Option<i64>,
61 #[serde(skip_serializing_if = "Option::is_none")]
62 pub entry_count: Option<i64>,
63 #[serde(skip_serializing_if = "Option::is_none")]
64 pub follower_count: Option<i64>,
65 #[serde(skip_serializing_if = "Option::is_none")]
66 pub following_count: Option<i64>,
67 #[serde(borrow)]
68 pub inner: ProfileDataViewInner<'a>,
69 #[serde(skip_serializing_if = "Option::is_none")]
70 pub notebook_count: Option<i64>,
71 #[serde(skip_serializing_if = "Option::is_none")]
72 #[serde(borrow)]
73 pub viewer: Option<actor::ViewerState<'a>>,
74}
75
76
77#[open_union]
78#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
79#[serde(tag = "$type", bound(deserialize = "'de: 'a"))]
80pub enum ProfileDataViewInner<'a> {
81 #[serde(rename = "sh.weaver.actor.defs#profileView")]
82 ProfileView(Box<actor::ProfileView<'a>>),
83 #[serde(rename = "app.bsky.actor.defs#profileViewDetailed")]
84 ProfileViewDetailed(Box<ProfileViewDetailed<'a>>),
85 #[serde(rename = "sh.weaver.actor.defs#tangledProfileView")]
86 TangledProfileView(Box<actor::TangledProfileView<'a>>),
87}
88
89
90#[lexicon]
91#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
92#[serde(rename_all = "camelCase")]
93pub struct ProfileDataViewBasic<'a> {
94 #[serde(skip_serializing_if = "Option::is_none")]
95 pub follower_count: Option<i64>,
96 #[serde(skip_serializing_if = "Option::is_none")]
97 pub following_count: Option<i64>,
98 #[serde(borrow)]
99 pub inner: ProfileDataViewBasicInner<'a>,
100 #[serde(skip_serializing_if = "Option::is_none")]
101 #[serde(borrow)]
102 pub viewer: Option<actor::ViewerStateBasic<'a>>,
103}
104
105
106#[open_union]
107#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
108#[serde(tag = "$type", bound(deserialize = "'de: 'a"))]
109pub enum ProfileDataViewBasicInner<'a> {
110 #[serde(rename = "sh.weaver.actor.defs#profileViewBasic")]
111 ProfileViewBasic(Box<crate::sh_weaver::actor::ProfileViewBasic<'a>>),
112 #[serde(rename = "app.bsky.actor.defs#profileViewBasic")]
113 BskyProfileViewBasic(Box<crate::app_bsky::actor::ProfileViewBasic<'a>>),
114 #[serde(rename = "sh.weaver.actor.defs#tangledProfileView")]
115 TangledProfileView(Box<actor::TangledProfileView<'a>>),
116}
117
118
119#[lexicon]
120#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
121#[serde(rename_all = "camelCase")]
122pub struct ProfileView<'a> {
123 #[serde(skip_serializing_if = "Option::is_none")]
124 #[serde(borrow)]
125 pub avatar: Option<UriValue<'a>>,
126 #[serde(skip_serializing_if = "Option::is_none")]
127 #[serde(borrow)]
128 pub banner: Option<UriValue<'a>>,
129 #[serde(skip_serializing_if = "Option::is_none")]
131 pub bluesky: Option<bool>,
132 #[serde(skip_serializing_if = "Option::is_none")]
133 pub created_at: Option<Datetime>,
134 #[serde(skip_serializing_if = "Option::is_none")]
135 #[serde(borrow)]
136 pub description: Option<CowStr<'a>>,
137 #[serde(borrow)]
138 pub did: Did<'a>,
139 #[serde(skip_serializing_if = "Option::is_none")]
140 #[serde(borrow)]
141 pub display_name: Option<CowStr<'a>>,
142 #[serde(borrow)]
143 pub handle: Handle<'a>,
144 #[serde(skip_serializing_if = "Option::is_none")]
145 pub indexed_at: Option<Datetime>,
146 #[serde(skip_serializing_if = "Option::is_none")]
147 #[serde(borrow)]
148 pub labels: Option<Vec<Label<'a>>>,
149 #[serde(skip_serializing_if = "Option::is_none")]
150 #[serde(borrow)]
151 pub links: Option<Vec<UriValue<'a>>>,
152 #[serde(skip_serializing_if = "Option::is_none")]
154 #[serde(borrow)]
155 pub location: Option<CowStr<'a>>,
156 #[serde(skip_serializing_if = "Option::is_none")]
158 #[serde(borrow)]
159 pub pinned: Option<actor::PinnedList<'a>>,
160 #[serde(skip_serializing_if = "Option::is_none")]
162 #[serde(borrow)]
163 pub pronouns: Option<actor::PronounsList<'a>>,
164 #[serde(skip_serializing_if = "Option::is_none")]
166 pub streamplace: Option<bool>,
167 #[serde(skip_serializing_if = "Option::is_none")]
168 pub subscribed_count: Option<i64>,
169 #[serde(skip_serializing_if = "Option::is_none")]
170 pub subscriber_count: Option<i64>,
171 #[serde(skip_serializing_if = "Option::is_none")]
173 pub tangled: Option<bool>,
174}
175
176
177#[lexicon]
178#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
179#[serde(rename_all = "camelCase")]
180pub struct ProfileViewBasic<'a> {
181 #[serde(skip_serializing_if = "Option::is_none")]
182 #[serde(borrow)]
183 pub avatar: Option<UriValue<'a>>,
184 #[serde(skip_serializing_if = "Option::is_none")]
185 pub created_at: Option<Datetime>,
186 #[serde(borrow)]
187 pub did: Did<'a>,
188 #[serde(skip_serializing_if = "Option::is_none")]
189 #[serde(borrow)]
190 pub display_name: Option<CowStr<'a>>,
191 #[serde(borrow)]
192 pub handle: Handle<'a>,
193 #[serde(skip_serializing_if = "Option::is_none")]
194 pub indexed_at: Option<Datetime>,
195 #[serde(skip_serializing_if = "Option::is_none")]
196 #[serde(borrow)]
197 pub labels: Option<Vec<Label<'a>>>,
198 #[serde(skip_serializing_if = "Option::is_none")]
200 #[serde(borrow)]
201 pub pronouns: Option<actor::PronounsList<'a>>,
202}
203
204pub type PronounsList<'a> = Vec<CowStr<'a>>;
205#[lexicon]
208#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
209#[serde(rename_all = "camelCase")]
210pub struct SubscribedNotebook<'a> {
211 #[serde(skip_serializing_if = "Option::is_none")]
212 #[serde(borrow)]
213 pub path: Option<CowStr<'a>>,
214 #[serde(skip_serializing_if = "Option::is_none")]
215 #[serde(borrow)]
216 pub title: Option<CowStr<'a>>,
217 #[serde(borrow)]
218 pub uri: AtUri<'a>,
219}
220
221
222#[lexicon]
223#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
224#[serde(rename_all = "camelCase")]
225pub struct TangledProfileView<'a> {
226 pub bluesky: bool,
228 #[serde(skip_serializing_if = "Option::is_none")]
230 #[serde(borrow)]
231 pub description: Option<CowStr<'a>>,
232 #[serde(borrow)]
233 pub did: Did<'a>,
234 #[serde(borrow)]
235 pub handle: Handle<'a>,
236 #[serde(skip_serializing_if = "Option::is_none")]
237 #[serde(borrow)]
238 pub links: Option<Vec<UriValue<'a>>>,
239 #[serde(skip_serializing_if = "Option::is_none")]
241 #[serde(borrow)]
242 pub location: Option<CowStr<'a>>,
243 #[serde(skip_serializing_if = "Option::is_none")]
245 #[serde(borrow)]
246 pub pinned_repositories: Option<Vec<AtUri<'a>>>,
247 #[serde(skip_serializing_if = "Option::is_none")]
248 #[serde(borrow)]
249 pub stats: Option<Vec<CowStr<'a>>>,
250}
251
252#[lexicon]
255#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
256#[serde(rename_all = "camelCase")]
257pub struct ViewerState<'a> {
258 #[serde(skip_serializing_if = "Option::is_none")]
259 #[serde(borrow)]
260 pub blocked: Option<AtUri<'a>>,
261 #[serde(skip_serializing_if = "Option::is_none")]
262 pub blocked_by: Option<bool>,
263 #[serde(skip_serializing_if = "Option::is_none")]
264 #[serde(borrow)]
265 pub follow_requested: Option<AtUri<'a>>,
266 #[serde(skip_serializing_if = "Option::is_none")]
267 #[serde(borrow)]
268 pub follow_requested_by: Option<AtUri<'a>>,
269 #[serde(skip_serializing_if = "Option::is_none")]
270 #[serde(borrow)]
271 pub followed_by: Option<AtUri<'a>>,
272 #[serde(skip_serializing_if = "Option::is_none")]
273 #[serde(borrow)]
274 pub following: Option<AtUri<'a>>,
275 #[serde(skip_serializing_if = "Option::is_none")]
276 #[serde(borrow)]
277 pub muted: Option<AtUri<'a>>,
278 #[serde(skip_serializing_if = "Option::is_none")]
279 #[serde(borrow)]
280 pub subscribed_notebooks: Option<Vec<actor::SubscribedNotebook<'a>>>,
281}
282
283#[lexicon]
286#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
287#[serde(rename_all = "camelCase")]
288pub struct ViewerStateBasic<'a> {
289 #[serde(skip_serializing_if = "Option::is_none")]
290 #[serde(borrow)]
291 pub blocked: Option<AtUri<'a>>,
292 #[serde(skip_serializing_if = "Option::is_none")]
293 pub blocked_by: Option<bool>,
294 #[serde(skip_serializing_if = "Option::is_none")]
295 #[serde(borrow)]
296 pub follow_requested: Option<AtUri<'a>>,
297 #[serde(skip_serializing_if = "Option::is_none")]
298 #[serde(borrow)]
299 pub follow_requested_by: Option<AtUri<'a>>,
300 #[serde(skip_serializing_if = "Option::is_none")]
301 #[serde(borrow)]
302 pub followed_by: Option<AtUri<'a>>,
303 #[serde(skip_serializing_if = "Option::is_none")]
304 #[serde(borrow)]
305 pub following: Option<AtUri<'a>>,
306 #[serde(skip_serializing_if = "Option::is_none")]
307 #[serde(borrow)]
308 pub muted: Option<AtUri<'a>>,
309 #[serde(skip_serializing_if = "Option::is_none")]
310 pub subscribed_notebook_count: Option<i64>,
311}
312
313impl<'a> LexiconSchema for Author<'a> {
314 fn nsid() -> &'static str {
315 "sh.weaver.actor.defs"
316 }
317 fn def_name() -> &'static str {
318 "author"
319 }
320 fn lexicon_doc() -> LexiconDoc<'static> {
321 lexicon_doc_sh_weaver_actor_defs()
322 }
323 fn validate(&self) -> Result<(), ConstraintError> {
324 Ok(())
325 }
326}
327
328impl<'a> LexiconSchema for ProfileDataView<'a> {
329 fn nsid() -> &'static str {
330 "sh.weaver.actor.defs"
331 }
332 fn def_name() -> &'static str {
333 "profileDataView"
334 }
335 fn lexicon_doc() -> LexiconDoc<'static> {
336 lexicon_doc_sh_weaver_actor_defs()
337 }
338 fn validate(&self) -> Result<(), ConstraintError> {
339 Ok(())
340 }
341}
342
343impl<'a> LexiconSchema for ProfileDataViewBasic<'a> {
344 fn nsid() -> &'static str {
345 "sh.weaver.actor.defs"
346 }
347 fn def_name() -> &'static str {
348 "profileDataViewBasic"
349 }
350 fn lexicon_doc() -> LexiconDoc<'static> {
351 lexicon_doc_sh_weaver_actor_defs()
352 }
353 fn validate(&self) -> Result<(), ConstraintError> {
354 Ok(())
355 }
356}
357
358impl<'a> LexiconSchema for ProfileView<'a> {
359 fn nsid() -> &'static str {
360 "sh.weaver.actor.defs"
361 }
362 fn def_name() -> &'static str {
363 "profileView"
364 }
365 fn lexicon_doc() -> LexiconDoc<'static> {
366 lexicon_doc_sh_weaver_actor_defs()
367 }
368 fn validate(&self) -> Result<(), ConstraintError> {
369 if let Some(ref value) = self.description {
370 #[allow(unused_comparisons)]
371 if <str>::len(value.as_ref()) > 10240usize {
372 return Err(ConstraintError::MaxLength {
373 path: ValidationPath::from_field("description"),
374 max: 10240usize,
375 actual: <str>::len(value.as_ref()),
376 });
377 }
378 }
379 if let Some(ref value) = self.description {
380 {
381 let count = UnicodeSegmentation::graphemes(value.as_ref(), true).count();
382 if count > 1024usize {
383 return Err(ConstraintError::MaxGraphemes {
384 path: ValidationPath::from_field("description"),
385 max: 1024usize,
386 actual: count,
387 });
388 }
389 }
390 }
391 if let Some(ref value) = self.display_name {
392 #[allow(unused_comparisons)]
393 if <str>::len(value.as_ref()) > 640usize {
394 return Err(ConstraintError::MaxLength {
395 path: ValidationPath::from_field("display_name"),
396 max: 640usize,
397 actual: <str>::len(value.as_ref()),
398 });
399 }
400 }
401 if let Some(ref value) = self.display_name {
402 {
403 let count = UnicodeSegmentation::graphemes(value.as_ref(), true).count();
404 if count > 64usize {
405 return Err(ConstraintError::MaxGraphemes {
406 path: ValidationPath::from_field("display_name"),
407 max: 64usize,
408 actual: count,
409 });
410 }
411 }
412 }
413 if let Some(ref value) = self.links {
414 #[allow(unused_comparisons)]
415 if value.len() > 5usize {
416 return Err(ConstraintError::MaxLength {
417 path: ValidationPath::from_field("links"),
418 max: 5usize,
419 actual: value.len(),
420 });
421 }
422 }
423 if let Some(ref value) = self.links {
424 #[allow(unused_comparisons)]
425 if value.len() < 0usize {
426 return Err(ConstraintError::MinLength {
427 path: ValidationPath::from_field("links"),
428 min: 0usize,
429 actual: value.len(),
430 });
431 }
432 }
433 if let Some(ref value) = self.location {
434 #[allow(unused_comparisons)]
435 if <str>::len(value.as_ref()) > 400usize {
436 return Err(ConstraintError::MaxLength {
437 path: ValidationPath::from_field("location"),
438 max: 400usize,
439 actual: <str>::len(value.as_ref()),
440 });
441 }
442 }
443 if let Some(ref value) = self.location {
444 {
445 let count = UnicodeSegmentation::graphemes(value.as_ref(), true).count();
446 if count > 40usize {
447 return Err(ConstraintError::MaxGraphemes {
448 path: ValidationPath::from_field("location"),
449 max: 40usize,
450 actual: count,
451 });
452 }
453 }
454 }
455 Ok(())
456 }
457}
458
459impl<'a> LexiconSchema for ProfileViewBasic<'a> {
460 fn nsid() -> &'static str {
461 "sh.weaver.actor.defs"
462 }
463 fn def_name() -> &'static str {
464 "profileViewBasic"
465 }
466 fn lexicon_doc() -> LexiconDoc<'static> {
467 lexicon_doc_sh_weaver_actor_defs()
468 }
469 fn validate(&self) -> Result<(), ConstraintError> {
470 if let Some(ref value) = self.display_name {
471 #[allow(unused_comparisons)]
472 if <str>::len(value.as_ref()) > 640usize {
473 return Err(ConstraintError::MaxLength {
474 path: ValidationPath::from_field("display_name"),
475 max: 640usize,
476 actual: <str>::len(value.as_ref()),
477 });
478 }
479 }
480 if let Some(ref value) = self.display_name {
481 {
482 let count = UnicodeSegmentation::graphemes(value.as_ref(), true).count();
483 if count > 64usize {
484 return Err(ConstraintError::MaxGraphemes {
485 path: ValidationPath::from_field("display_name"),
486 max: 64usize,
487 actual: count,
488 });
489 }
490 }
491 }
492 Ok(())
493 }
494}
495
496impl<'a> LexiconSchema for SubscribedNotebook<'a> {
497 fn nsid() -> &'static str {
498 "sh.weaver.actor.defs"
499 }
500 fn def_name() -> &'static str {
501 "subscribedNotebook"
502 }
503 fn lexicon_doc() -> LexiconDoc<'static> {
504 lexicon_doc_sh_weaver_actor_defs()
505 }
506 fn validate(&self) -> Result<(), ConstraintError> {
507 Ok(())
508 }
509}
510
511impl<'a> LexiconSchema for TangledProfileView<'a> {
512 fn nsid() -> &'static str {
513 "sh.weaver.actor.defs"
514 }
515 fn def_name() -> &'static str {
516 "tangledProfileView"
517 }
518 fn lexicon_doc() -> LexiconDoc<'static> {
519 lexicon_doc_sh_weaver_actor_defs()
520 }
521 fn validate(&self) -> Result<(), ConstraintError> {
522 if let Some(ref value) = self.description {
523 #[allow(unused_comparisons)]
524 if <str>::len(value.as_ref()) > 2560usize {
525 return Err(ConstraintError::MaxLength {
526 path: ValidationPath::from_field("description"),
527 max: 2560usize,
528 actual: <str>::len(value.as_ref()),
529 });
530 }
531 }
532 if let Some(ref value) = self.description {
533 {
534 let count = UnicodeSegmentation::graphemes(value.as_ref(), true).count();
535 if count > 256usize {
536 return Err(ConstraintError::MaxGraphemes {
537 path: ValidationPath::from_field("description"),
538 max: 256usize,
539 actual: count,
540 });
541 }
542 }
543 }
544 if let Some(ref value) = self.links {
545 #[allow(unused_comparisons)]
546 if value.len() > 5usize {
547 return Err(ConstraintError::MaxLength {
548 path: ValidationPath::from_field("links"),
549 max: 5usize,
550 actual: value.len(),
551 });
552 }
553 }
554 if let Some(ref value) = self.links {
555 #[allow(unused_comparisons)]
556 if value.len() < 0usize {
557 return Err(ConstraintError::MinLength {
558 path: ValidationPath::from_field("links"),
559 min: 0usize,
560 actual: value.len(),
561 });
562 }
563 }
564 if let Some(ref value) = self.location {
565 #[allow(unused_comparisons)]
566 if <str>::len(value.as_ref()) > 400usize {
567 return Err(ConstraintError::MaxLength {
568 path: ValidationPath::from_field("location"),
569 max: 400usize,
570 actual: <str>::len(value.as_ref()),
571 });
572 }
573 }
574 if let Some(ref value) = self.location {
575 {
576 let count = UnicodeSegmentation::graphemes(value.as_ref(), true).count();
577 if count > 40usize {
578 return Err(ConstraintError::MaxGraphemes {
579 path: ValidationPath::from_field("location"),
580 max: 40usize,
581 actual: count,
582 });
583 }
584 }
585 }
586 if let Some(ref value) = self.pinned_repositories {
587 #[allow(unused_comparisons)]
588 if value.len() > 6usize {
589 return Err(ConstraintError::MaxLength {
590 path: ValidationPath::from_field("pinned_repositories"),
591 max: 6usize,
592 actual: value.len(),
593 });
594 }
595 }
596 if let Some(ref value) = self.pinned_repositories {
597 #[allow(unused_comparisons)]
598 if value.len() < 0usize {
599 return Err(ConstraintError::MinLength {
600 path: ValidationPath::from_field("pinned_repositories"),
601 min: 0usize,
602 actual: value.len(),
603 });
604 }
605 }
606 if let Some(ref value) = self.stats {
607 #[allow(unused_comparisons)]
608 if value.len() > 2usize {
609 return Err(ConstraintError::MaxLength {
610 path: ValidationPath::from_field("stats"),
611 max: 2usize,
612 actual: value.len(),
613 });
614 }
615 }
616 if let Some(ref value) = self.stats {
617 #[allow(unused_comparisons)]
618 if value.len() < 0usize {
619 return Err(ConstraintError::MinLength {
620 path: ValidationPath::from_field("stats"),
621 min: 0usize,
622 actual: value.len(),
623 });
624 }
625 }
626 Ok(())
627 }
628}
629
630impl<'a> LexiconSchema for ViewerState<'a> {
631 fn nsid() -> &'static str {
632 "sh.weaver.actor.defs"
633 }
634 fn def_name() -> &'static str {
635 "viewerState"
636 }
637 fn lexicon_doc() -> LexiconDoc<'static> {
638 lexicon_doc_sh_weaver_actor_defs()
639 }
640 fn validate(&self) -> Result<(), ConstraintError> {
641 Ok(())
642 }
643}
644
645impl<'a> LexiconSchema for ViewerStateBasic<'a> {
646 fn nsid() -> &'static str {
647 "sh.weaver.actor.defs"
648 }
649 fn def_name() -> &'static str {
650 "viewerStateBasic"
651 }
652 fn lexicon_doc() -> LexiconDoc<'static> {
653 lexicon_doc_sh_weaver_actor_defs()
654 }
655 fn validate(&self) -> Result<(), ConstraintError> {
656 Ok(())
657 }
658}
659
660pub mod author_state {
661
662 pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
663 #[allow(unused)]
664 use ::core::marker::PhantomData;
665 mod sealed {
666 pub trait Sealed {}
667 }
668 pub trait State: sealed::Sealed {
670 type Did;
671 }
672 pub struct Empty(());
674 impl sealed::Sealed for Empty {}
675 impl State for Empty {
676 type Did = Unset;
677 }
678 pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>);
680 impl<S: State> sealed::Sealed for SetDid<S> {}
681 impl<S: State> State for SetDid<S> {
682 type Did = Set<members::did>;
683 }
684 #[allow(non_camel_case_types)]
686 pub mod members {
687 pub struct did(());
689 }
690}
691
692pub struct AuthorBuilder<'a, S: author_state::State> {
694 _state: PhantomData<fn() -> S>,
695 _fields: (Option<Did<'a>>, Option<Bytes>),
696 _lifetime: PhantomData<&'a ()>,
697}
698
699impl<'a> Author<'a> {
700 pub fn new() -> AuthorBuilder<'a, author_state::Empty> {
702 AuthorBuilder::new()
703 }
704}
705
706impl<'a> AuthorBuilder<'a, author_state::Empty> {
707 pub fn new() -> Self {
709 AuthorBuilder {
710 _state: PhantomData,
711 _fields: (None, None),
712 _lifetime: PhantomData,
713 }
714 }
715}
716
717impl<'a, S> AuthorBuilder<'a, S>
718where
719 S: author_state::State,
720 S::Did: author_state::IsUnset,
721{
722 pub fn did(
724 mut self,
725 value: impl Into<Did<'a>>,
726 ) -> AuthorBuilder<'a, author_state::SetDid<S>> {
727 self._fields.0 = Option::Some(value.into());
728 AuthorBuilder {
729 _state: PhantomData,
730 _fields: self._fields,
731 _lifetime: PhantomData,
732 }
733 }
734}
735
736impl<'a, S: author_state::State> AuthorBuilder<'a, S> {
737 pub fn signature(mut self, value: impl Into<Option<Bytes>>) -> Self {
739 self._fields.1 = value.into();
740 self
741 }
742 pub fn maybe_signature(mut self, value: Option<Bytes>) -> Self {
744 self._fields.1 = value;
745 self
746 }
747}
748
749impl<'a, S> AuthorBuilder<'a, S>
750where
751 S: author_state::State,
752 S::Did: author_state::IsSet,
753{
754 pub fn build(self) -> Author<'a> {
756 Author {
757 did: self._fields.0.unwrap(),
758 signature: self._fields.1,
759 extra_data: Default::default(),
760 }
761 }
762 pub fn build_with_data(
764 self,
765 extra_data: BTreeMap<
766 jacquard_common::deps::smol_str::SmolStr,
767 jacquard_common::types::value::Data<'a>,
768 >,
769 ) -> Author<'a> {
770 Author {
771 did: self._fields.0.unwrap(),
772 signature: self._fields.1,
773 extra_data: Some(extra_data),
774 }
775 }
776}
777
778fn lexicon_doc_sh_weaver_actor_defs() -> LexiconDoc<'static> {
779 #[allow(unused_imports)]
780 use jacquard_common::{CowStr, deps::smol_str::SmolStr, types::blob::MimeType};
781 use jacquard_lexicon::lexicon::*;
782 use alloc::collections::BTreeMap;
783 LexiconDoc {
784 lexicon: Lexicon::Lexicon1,
785 id: CowStr::new_static("sh.weaver.actor.defs"),
786 defs: {
787 let mut map = BTreeMap::new();
788 map.insert(
789 SmolStr::new_static("author"),
790 LexUserType::Object(LexObject {
791 description: Some(
792 CowStr::new_static("A single author in a Weaver notebook."),
793 ),
794 required: Some(vec![SmolStr::new_static("did")]),
795 properties: {
796 #[allow(unused_mut)]
797 let mut map = BTreeMap::new();
798 map.insert(
799 SmolStr::new_static("did"),
800 LexObjectProperty::String(LexString {
801 format: Some(LexStringFormat::Did),
802 ..Default::default()
803 }),
804 );
805 map.insert(
806 SmolStr::new_static("signature"),
807 LexObjectProperty::Bytes(LexBytes { ..Default::default() }),
808 );
809 map
810 },
811 ..Default::default()
812 }),
813 );
814 map.insert(
815 SmolStr::new_static("pinnedList"),
816 LexUserType::Array(LexArray {
817 items: LexArrayItem::Ref(LexRef {
818 r#ref: CowStr::new_static("com.atproto.repo.strongRef"),
819 ..Default::default()
820 }),
821 ..Default::default()
822 }),
823 );
824 map.insert(
825 SmolStr::new_static("profileDataView"),
826 LexUserType::Object(LexObject {
827 required: Some(vec![SmolStr::new_static("inner")]),
828 properties: {
829 #[allow(unused_mut)]
830 let mut map = BTreeMap::new();
831 map.insert(
832 SmolStr::new_static("collaborationCount"),
833 LexObjectProperty::Integer(LexInteger {
834 ..Default::default()
835 }),
836 );
837 map.insert(
838 SmolStr::new_static("entryCount"),
839 LexObjectProperty::Integer(LexInteger {
840 ..Default::default()
841 }),
842 );
843 map.insert(
844 SmolStr::new_static("followerCount"),
845 LexObjectProperty::Integer(LexInteger {
846 ..Default::default()
847 }),
848 );
849 map.insert(
850 SmolStr::new_static("followingCount"),
851 LexObjectProperty::Integer(LexInteger {
852 ..Default::default()
853 }),
854 );
855 map.insert(
856 SmolStr::new_static("inner"),
857 LexObjectProperty::Union(LexRefUnion {
858 refs: vec![
859 CowStr::new_static("#profileView"),
860 CowStr::new_static("app.bsky.actor.defs#profileViewDetailed"),
861 CowStr::new_static("#tangledProfileView")
862 ],
863 ..Default::default()
864 }),
865 );
866 map.insert(
867 SmolStr::new_static("notebookCount"),
868 LexObjectProperty::Integer(LexInteger {
869 ..Default::default()
870 }),
871 );
872 map.insert(
873 SmolStr::new_static("viewer"),
874 LexObjectProperty::Ref(LexRef {
875 r#ref: CowStr::new_static("#viewerState"),
876 ..Default::default()
877 }),
878 );
879 map
880 },
881 ..Default::default()
882 }),
883 );
884 map.insert(
885 SmolStr::new_static("profileDataViewBasic"),
886 LexUserType::Object(LexObject {
887 required: Some(vec![SmolStr::new_static("inner")]),
888 properties: {
889 #[allow(unused_mut)]
890 let mut map = BTreeMap::new();
891 map.insert(
892 SmolStr::new_static("followerCount"),
893 LexObjectProperty::Integer(LexInteger {
894 ..Default::default()
895 }),
896 );
897 map.insert(
898 SmolStr::new_static("followingCount"),
899 LexObjectProperty::Integer(LexInteger {
900 ..Default::default()
901 }),
902 );
903 map.insert(
904 SmolStr::new_static("inner"),
905 LexObjectProperty::Union(LexRefUnion {
906 refs: vec![
907 CowStr::new_static("#profileViewBasic"),
908 CowStr::new_static("app.bsky.actor.defs#profileViewBasic"),
909 CowStr::new_static("#tangledProfileView")
910 ],
911 ..Default::default()
912 }),
913 );
914 map.insert(
915 SmolStr::new_static("viewer"),
916 LexObjectProperty::Ref(LexRef {
917 r#ref: CowStr::new_static("#viewerStateBasic"),
918 ..Default::default()
919 }),
920 );
921 map
922 },
923 ..Default::default()
924 }),
925 );
926 map.insert(
927 SmolStr::new_static("profileView"),
928 LexUserType::Object(LexObject {
929 required: Some(
930 vec![SmolStr::new_static("did"), SmolStr::new_static("handle")],
931 ),
932 properties: {
933 #[allow(unused_mut)]
934 let mut map = BTreeMap::new();
935 map.insert(
936 SmolStr::new_static("avatar"),
937 LexObjectProperty::String(LexString {
938 format: Some(LexStringFormat::Uri),
939 ..Default::default()
940 }),
941 );
942 map.insert(
943 SmolStr::new_static("banner"),
944 LexObjectProperty::String(LexString {
945 format: Some(LexStringFormat::Uri),
946 ..Default::default()
947 }),
948 );
949 map.insert(
950 SmolStr::new_static("bluesky"),
951 LexObjectProperty::Boolean(LexBoolean {
952 ..Default::default()
953 }),
954 );
955 map.insert(
956 SmolStr::new_static("createdAt"),
957 LexObjectProperty::String(LexString {
958 format: Some(LexStringFormat::Datetime),
959 ..Default::default()
960 }),
961 );
962 map.insert(
963 SmolStr::new_static("description"),
964 LexObjectProperty::String(LexString {
965 max_length: Some(10240usize),
966 max_graphemes: Some(1024usize),
967 ..Default::default()
968 }),
969 );
970 map.insert(
971 SmolStr::new_static("did"),
972 LexObjectProperty::String(LexString {
973 format: Some(LexStringFormat::Did),
974 ..Default::default()
975 }),
976 );
977 map.insert(
978 SmolStr::new_static("displayName"),
979 LexObjectProperty::String(LexString {
980 max_length: Some(640usize),
981 max_graphemes: Some(64usize),
982 ..Default::default()
983 }),
984 );
985 map.insert(
986 SmolStr::new_static("handle"),
987 LexObjectProperty::String(LexString {
988 format: Some(LexStringFormat::Handle),
989 ..Default::default()
990 }),
991 );
992 map.insert(
993 SmolStr::new_static("indexedAt"),
994 LexObjectProperty::String(LexString {
995 format: Some(LexStringFormat::Datetime),
996 ..Default::default()
997 }),
998 );
999 map.insert(
1000 SmolStr::new_static("labels"),
1001 LexObjectProperty::Array(LexArray {
1002 items: LexArrayItem::Ref(LexRef {
1003 r#ref: CowStr::new_static("com.atproto.label.defs#label"),
1004 ..Default::default()
1005 }),
1006 ..Default::default()
1007 }),
1008 );
1009 map.insert(
1010 SmolStr::new_static("links"),
1011 LexObjectProperty::Array(LexArray {
1012 items: LexArrayItem::String(LexString {
1013 description: Some(
1014 CowStr::new_static(
1015 "Any URI, intended for social profiles or websites, can be used to link DIDs/AT-URIs too.",
1016 ),
1017 ),
1018 format: Some(LexStringFormat::Uri),
1019 ..Default::default()
1020 }),
1021 min_length: Some(0usize),
1022 max_length: Some(5usize),
1023 ..Default::default()
1024 }),
1025 );
1026 map.insert(
1027 SmolStr::new_static("location"),
1028 LexObjectProperty::String(LexString {
1029 description: Some(
1030 CowStr::new_static("Free-form location text."),
1031 ),
1032 max_length: Some(400usize),
1033 max_graphemes: Some(40usize),
1034 ..Default::default()
1035 }),
1036 );
1037 map.insert(
1038 SmolStr::new_static("pinned"),
1039 LexObjectProperty::Ref(LexRef {
1040 r#ref: CowStr::new_static("#pinnedList"),
1041 ..Default::default()
1042 }),
1043 );
1044 map.insert(
1045 SmolStr::new_static("pronouns"),
1046 LexObjectProperty::Ref(LexRef {
1047 r#ref: CowStr::new_static("#pronounsList"),
1048 ..Default::default()
1049 }),
1050 );
1051 map.insert(
1052 SmolStr::new_static("streamplace"),
1053 LexObjectProperty::Boolean(LexBoolean {
1054 ..Default::default()
1055 }),
1056 );
1057 map.insert(
1058 SmolStr::new_static("subscribedCount"),
1059 LexObjectProperty::Integer(LexInteger {
1060 ..Default::default()
1061 }),
1062 );
1063 map.insert(
1064 SmolStr::new_static("subscriberCount"),
1065 LexObjectProperty::Integer(LexInteger {
1066 ..Default::default()
1067 }),
1068 );
1069 map.insert(
1070 SmolStr::new_static("tangled"),
1071 LexObjectProperty::Boolean(LexBoolean {
1072 ..Default::default()
1073 }),
1074 );
1075 map
1076 },
1077 ..Default::default()
1078 }),
1079 );
1080 map.insert(
1081 SmolStr::new_static("profileViewBasic"),
1082 LexUserType::Object(LexObject {
1083 required: Some(
1084 vec![SmolStr::new_static("did"), SmolStr::new_static("handle")],
1085 ),
1086 properties: {
1087 #[allow(unused_mut)]
1088 let mut map = BTreeMap::new();
1089 map.insert(
1090 SmolStr::new_static("avatar"),
1091 LexObjectProperty::String(LexString {
1092 format: Some(LexStringFormat::Uri),
1093 ..Default::default()
1094 }),
1095 );
1096 map.insert(
1097 SmolStr::new_static("createdAt"),
1098 LexObjectProperty::String(LexString {
1099 format: Some(LexStringFormat::Datetime),
1100 ..Default::default()
1101 }),
1102 );
1103 map.insert(
1104 SmolStr::new_static("did"),
1105 LexObjectProperty::String(LexString {
1106 format: Some(LexStringFormat::Did),
1107 ..Default::default()
1108 }),
1109 );
1110 map.insert(
1111 SmolStr::new_static("displayName"),
1112 LexObjectProperty::String(LexString {
1113 max_length: Some(640usize),
1114 max_graphemes: Some(64usize),
1115 ..Default::default()
1116 }),
1117 );
1118 map.insert(
1119 SmolStr::new_static("handle"),
1120 LexObjectProperty::String(LexString {
1121 format: Some(LexStringFormat::Handle),
1122 ..Default::default()
1123 }),
1124 );
1125 map.insert(
1126 SmolStr::new_static("indexedAt"),
1127 LexObjectProperty::String(LexString {
1128 format: Some(LexStringFormat::Datetime),
1129 ..Default::default()
1130 }),
1131 );
1132 map.insert(
1133 SmolStr::new_static("labels"),
1134 LexObjectProperty::Array(LexArray {
1135 items: LexArrayItem::Ref(LexRef {
1136 r#ref: CowStr::new_static("com.atproto.label.defs#label"),
1137 ..Default::default()
1138 }),
1139 ..Default::default()
1140 }),
1141 );
1142 map.insert(
1143 SmolStr::new_static("pronouns"),
1144 LexObjectProperty::Ref(LexRef {
1145 r#ref: CowStr::new_static("#pronounsList"),
1146 ..Default::default()
1147 }),
1148 );
1149 map
1150 },
1151 ..Default::default()
1152 }),
1153 );
1154 map.insert(
1155 SmolStr::new_static("pronounsList"),
1156 LexUserType::Array(LexArray {
1157 items: LexArrayItem::String(LexString {
1158 max_length: Some(500usize),
1159 max_graphemes: Some(50usize),
1160 ..Default::default()
1161 }),
1162 max_length: Some(5usize),
1163 ..Default::default()
1164 }),
1165 );
1166 map.insert(
1167 SmolStr::new_static("subscribedNotebook"),
1168 LexUserType::Object(LexObject {
1169 description: Some(
1170 CowStr::new_static(
1171 "A notebook the viewer subscribes to without a global follow.",
1172 ),
1173 ),
1174 required: Some(vec![SmolStr::new_static("uri")]),
1175 properties: {
1176 #[allow(unused_mut)]
1177 let mut map = BTreeMap::new();
1178 map.insert(
1179 SmolStr::new_static("path"),
1180 LexObjectProperty::String(LexString { ..Default::default() }),
1181 );
1182 map.insert(
1183 SmolStr::new_static("title"),
1184 LexObjectProperty::String(LexString { ..Default::default() }),
1185 );
1186 map.insert(
1187 SmolStr::new_static("uri"),
1188 LexObjectProperty::String(LexString {
1189 format: Some(LexStringFormat::AtUri),
1190 ..Default::default()
1191 }),
1192 );
1193 map
1194 },
1195 ..Default::default()
1196 }),
1197 );
1198 map.insert(
1199 SmolStr::new_static("tangledProfileView"),
1200 LexUserType::Object(LexObject {
1201 required: Some(
1202 vec![
1203 SmolStr::new_static("bluesky"), SmolStr::new_static("did"),
1204 SmolStr::new_static("handle")
1205 ],
1206 ),
1207 properties: {
1208 #[allow(unused_mut)]
1209 let mut map = BTreeMap::new();
1210 map.insert(
1211 SmolStr::new_static("bluesky"),
1212 LexObjectProperty::Boolean(LexBoolean {
1213 ..Default::default()
1214 }),
1215 );
1216 map.insert(
1217 SmolStr::new_static("description"),
1218 LexObjectProperty::String(LexString {
1219 description: Some(
1220 CowStr::new_static("Free-form profile description text."),
1221 ),
1222 max_length: Some(2560usize),
1223 max_graphemes: Some(256usize),
1224 ..Default::default()
1225 }),
1226 );
1227 map.insert(
1228 SmolStr::new_static("did"),
1229 LexObjectProperty::String(LexString {
1230 format: Some(LexStringFormat::Did),
1231 ..Default::default()
1232 }),
1233 );
1234 map.insert(
1235 SmolStr::new_static("handle"),
1236 LexObjectProperty::String(LexString {
1237 format: Some(LexStringFormat::Handle),
1238 ..Default::default()
1239 }),
1240 );
1241 map.insert(
1242 SmolStr::new_static("links"),
1243 LexObjectProperty::Array(LexArray {
1244 items: LexArrayItem::String(LexString {
1245 description: Some(
1246 CowStr::new_static(
1247 "Any URI, intended for social profiles or websites, can be used to link DIDs/AT-URIs too.",
1248 ),
1249 ),
1250 format: Some(LexStringFormat::Uri),
1251 ..Default::default()
1252 }),
1253 min_length: Some(0usize),
1254 max_length: Some(5usize),
1255 ..Default::default()
1256 }),
1257 );
1258 map.insert(
1259 SmolStr::new_static("location"),
1260 LexObjectProperty::String(LexString {
1261 description: Some(
1262 CowStr::new_static("Free-form location text."),
1263 ),
1264 max_length: Some(400usize),
1265 max_graphemes: Some(40usize),
1266 ..Default::default()
1267 }),
1268 );
1269 map.insert(
1270 SmolStr::new_static("pinnedRepositories"),
1271 LexObjectProperty::Array(LexArray {
1272 description: Some(
1273 CowStr::new_static(
1274 "Any ATURI, it is up to appviews to validate these fields.",
1275 ),
1276 ),
1277 items: LexArrayItem::String(LexString {
1278 format: Some(LexStringFormat::AtUri),
1279 ..Default::default()
1280 }),
1281 min_length: Some(0usize),
1282 max_length: Some(6usize),
1283 ..Default::default()
1284 }),
1285 );
1286 map.insert(
1287 SmolStr::new_static("stats"),
1288 LexObjectProperty::Array(LexArray {
1289 items: LexArrayItem::String(LexString {
1290 description: Some(CowStr::new_static("Vanity stats.")),
1291 ..Default::default()
1292 }),
1293 min_length: Some(0usize),
1294 max_length: Some(2usize),
1295 ..Default::default()
1296 }),
1297 );
1298 map
1299 },
1300 ..Default::default()
1301 }),
1302 );
1303 map.insert(
1304 SmolStr::new_static("viewerState"),
1305 LexUserType::Object(LexObject {
1306 description: Some(
1307 CowStr::new_static(
1308 "Viewer's relationship state with an actor (detailed version).",
1309 ),
1310 ),
1311 properties: {
1312 #[allow(unused_mut)]
1313 let mut map = BTreeMap::new();
1314 map.insert(
1315 SmolStr::new_static("blocked"),
1316 LexObjectProperty::String(LexString {
1317 format: Some(LexStringFormat::AtUri),
1318 ..Default::default()
1319 }),
1320 );
1321 map.insert(
1322 SmolStr::new_static("blockedBy"),
1323 LexObjectProperty::Boolean(LexBoolean {
1324 ..Default::default()
1325 }),
1326 );
1327 map.insert(
1328 SmolStr::new_static("followRequested"),
1329 LexObjectProperty::String(LexString {
1330 format: Some(LexStringFormat::AtUri),
1331 ..Default::default()
1332 }),
1333 );
1334 map.insert(
1335 SmolStr::new_static("followRequestedBy"),
1336 LexObjectProperty::String(LexString {
1337 format: Some(LexStringFormat::AtUri),
1338 ..Default::default()
1339 }),
1340 );
1341 map.insert(
1342 SmolStr::new_static("followedBy"),
1343 LexObjectProperty::String(LexString {
1344 format: Some(LexStringFormat::AtUri),
1345 ..Default::default()
1346 }),
1347 );
1348 map.insert(
1349 SmolStr::new_static("following"),
1350 LexObjectProperty::String(LexString {
1351 format: Some(LexStringFormat::AtUri),
1352 ..Default::default()
1353 }),
1354 );
1355 map.insert(
1356 SmolStr::new_static("muted"),
1357 LexObjectProperty::String(LexString {
1358 format: Some(LexStringFormat::AtUri),
1359 ..Default::default()
1360 }),
1361 );
1362 map.insert(
1363 SmolStr::new_static("subscribedNotebooks"),
1364 LexObjectProperty::Array(LexArray {
1365 items: LexArrayItem::Ref(LexRef {
1366 r#ref: CowStr::new_static("#subscribedNotebook"),
1367 ..Default::default()
1368 }),
1369 ..Default::default()
1370 }),
1371 );
1372 map
1373 },
1374 ..Default::default()
1375 }),
1376 );
1377 map.insert(
1378 SmolStr::new_static("viewerStateBasic"),
1379 LexUserType::Object(LexObject {
1380 description: Some(
1381 CowStr::new_static(
1382 "Viewer's relationship state with an actor (basic version).",
1383 ),
1384 ),
1385 properties: {
1386 #[allow(unused_mut)]
1387 let mut map = BTreeMap::new();
1388 map.insert(
1389 SmolStr::new_static("blocked"),
1390 LexObjectProperty::String(LexString {
1391 format: Some(LexStringFormat::AtUri),
1392 ..Default::default()
1393 }),
1394 );
1395 map.insert(
1396 SmolStr::new_static("blockedBy"),
1397 LexObjectProperty::Boolean(LexBoolean {
1398 ..Default::default()
1399 }),
1400 );
1401 map.insert(
1402 SmolStr::new_static("followRequested"),
1403 LexObjectProperty::String(LexString {
1404 format: Some(LexStringFormat::AtUri),
1405 ..Default::default()
1406 }),
1407 );
1408 map.insert(
1409 SmolStr::new_static("followRequestedBy"),
1410 LexObjectProperty::String(LexString {
1411 format: Some(LexStringFormat::AtUri),
1412 ..Default::default()
1413 }),
1414 );
1415 map.insert(
1416 SmolStr::new_static("followedBy"),
1417 LexObjectProperty::String(LexString {
1418 format: Some(LexStringFormat::AtUri),
1419 ..Default::default()
1420 }),
1421 );
1422 map.insert(
1423 SmolStr::new_static("following"),
1424 LexObjectProperty::String(LexString {
1425 format: Some(LexStringFormat::AtUri),
1426 ..Default::default()
1427 }),
1428 );
1429 map.insert(
1430 SmolStr::new_static("muted"),
1431 LexObjectProperty::String(LexString {
1432 format: Some(LexStringFormat::AtUri),
1433 ..Default::default()
1434 }),
1435 );
1436 map.insert(
1437 SmolStr::new_static("subscribedNotebookCount"),
1438 LexObjectProperty::Integer(LexInteger {
1439 ..Default::default()
1440 }),
1441 );
1442 map
1443 },
1444 ..Default::default()
1445 }),
1446 );
1447 map
1448 },
1449 ..Default::default()
1450 }
1451}
1452
1453pub mod profile_data_view_state {
1454
1455 pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
1456 #[allow(unused)]
1457 use ::core::marker::PhantomData;
1458 mod sealed {
1459 pub trait Sealed {}
1460 }
1461 pub trait State: sealed::Sealed {
1463 type Inner;
1464 }
1465 pub struct Empty(());
1467 impl sealed::Sealed for Empty {}
1468 impl State for Empty {
1469 type Inner = Unset;
1470 }
1471 pub struct SetInner<S: State = Empty>(PhantomData<fn() -> S>);
1473 impl<S: State> sealed::Sealed for SetInner<S> {}
1474 impl<S: State> State for SetInner<S> {
1475 type Inner = Set<members::inner>;
1476 }
1477 #[allow(non_camel_case_types)]
1479 pub mod members {
1480 pub struct inner(());
1482 }
1483}
1484
1485pub struct ProfileDataViewBuilder<'a, S: profile_data_view_state::State> {
1487 _state: PhantomData<fn() -> S>,
1488 _fields: (
1489 Option<i64>,
1490 Option<i64>,
1491 Option<i64>,
1492 Option<i64>,
1493 Option<ProfileDataViewInner<'a>>,
1494 Option<i64>,
1495 Option<actor::ViewerState<'a>>,
1496 ),
1497 _lifetime: PhantomData<&'a ()>,
1498}
1499
1500impl<'a> ProfileDataView<'a> {
1501 pub fn new() -> ProfileDataViewBuilder<'a, profile_data_view_state::Empty> {
1503 ProfileDataViewBuilder::new()
1504 }
1505}
1506
1507impl<'a> ProfileDataViewBuilder<'a, profile_data_view_state::Empty> {
1508 pub fn new() -> Self {
1510 ProfileDataViewBuilder {
1511 _state: PhantomData,
1512 _fields: (None, None, None, None, None, None, None),
1513 _lifetime: PhantomData,
1514 }
1515 }
1516}
1517
1518impl<'a, S: profile_data_view_state::State> ProfileDataViewBuilder<'a, S> {
1519 pub fn collaboration_count(mut self, value: impl Into<Option<i64>>) -> Self {
1521 self._fields.0 = value.into();
1522 self
1523 }
1524 pub fn maybe_collaboration_count(mut self, value: Option<i64>) -> Self {
1526 self._fields.0 = value;
1527 self
1528 }
1529}
1530
1531impl<'a, S: profile_data_view_state::State> ProfileDataViewBuilder<'a, S> {
1532 pub fn entry_count(mut self, value: impl Into<Option<i64>>) -> Self {
1534 self._fields.1 = value.into();
1535 self
1536 }
1537 pub fn maybe_entry_count(mut self, value: Option<i64>) -> Self {
1539 self._fields.1 = value;
1540 self
1541 }
1542}
1543
1544impl<'a, S: profile_data_view_state::State> ProfileDataViewBuilder<'a, S> {
1545 pub fn follower_count(mut self, value: impl Into<Option<i64>>) -> Self {
1547 self._fields.2 = value.into();
1548 self
1549 }
1550 pub fn maybe_follower_count(mut self, value: Option<i64>) -> Self {
1552 self._fields.2 = value;
1553 self
1554 }
1555}
1556
1557impl<'a, S: profile_data_view_state::State> ProfileDataViewBuilder<'a, S> {
1558 pub fn following_count(mut self, value: impl Into<Option<i64>>) -> Self {
1560 self._fields.3 = value.into();
1561 self
1562 }
1563 pub fn maybe_following_count(mut self, value: Option<i64>) -> Self {
1565 self._fields.3 = value;
1566 self
1567 }
1568}
1569
1570impl<'a, S> ProfileDataViewBuilder<'a, S>
1571where
1572 S: profile_data_view_state::State,
1573 S::Inner: profile_data_view_state::IsUnset,
1574{
1575 pub fn inner(
1577 mut self,
1578 value: impl Into<ProfileDataViewInner<'a>>,
1579 ) -> ProfileDataViewBuilder<'a, profile_data_view_state::SetInner<S>> {
1580 self._fields.4 = Option::Some(value.into());
1581 ProfileDataViewBuilder {
1582 _state: PhantomData,
1583 _fields: self._fields,
1584 _lifetime: PhantomData,
1585 }
1586 }
1587}
1588
1589impl<'a, S: profile_data_view_state::State> ProfileDataViewBuilder<'a, S> {
1590 pub fn notebook_count(mut self, value: impl Into<Option<i64>>) -> Self {
1592 self._fields.5 = value.into();
1593 self
1594 }
1595 pub fn maybe_notebook_count(mut self, value: Option<i64>) -> Self {
1597 self._fields.5 = value;
1598 self
1599 }
1600}
1601
1602impl<'a, S: profile_data_view_state::State> ProfileDataViewBuilder<'a, S> {
1603 pub fn viewer(mut self, value: impl Into<Option<actor::ViewerState<'a>>>) -> Self {
1605 self._fields.6 = value.into();
1606 self
1607 }
1608 pub fn maybe_viewer(mut self, value: Option<actor::ViewerState<'a>>) -> Self {
1610 self._fields.6 = value;
1611 self
1612 }
1613}
1614
1615impl<'a, S> ProfileDataViewBuilder<'a, S>
1616where
1617 S: profile_data_view_state::State,
1618 S::Inner: profile_data_view_state::IsSet,
1619{
1620 pub fn build(self) -> ProfileDataView<'a> {
1622 ProfileDataView {
1623 collaboration_count: self._fields.0,
1624 entry_count: self._fields.1,
1625 follower_count: self._fields.2,
1626 following_count: self._fields.3,
1627 inner: self._fields.4.unwrap(),
1628 notebook_count: self._fields.5,
1629 viewer: self._fields.6,
1630 extra_data: Default::default(),
1631 }
1632 }
1633 pub fn build_with_data(
1635 self,
1636 extra_data: BTreeMap<
1637 jacquard_common::deps::smol_str::SmolStr,
1638 jacquard_common::types::value::Data<'a>,
1639 >,
1640 ) -> ProfileDataView<'a> {
1641 ProfileDataView {
1642 collaboration_count: self._fields.0,
1643 entry_count: self._fields.1,
1644 follower_count: self._fields.2,
1645 following_count: self._fields.3,
1646 inner: self._fields.4.unwrap(),
1647 notebook_count: self._fields.5,
1648 viewer: self._fields.6,
1649 extra_data: Some(extra_data),
1650 }
1651 }
1652}
1653
1654pub mod profile_data_view_basic_state {
1655
1656 pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
1657 #[allow(unused)]
1658 use ::core::marker::PhantomData;
1659 mod sealed {
1660 pub trait Sealed {}
1661 }
1662 pub trait State: sealed::Sealed {
1664 type Inner;
1665 }
1666 pub struct Empty(());
1668 impl sealed::Sealed for Empty {}
1669 impl State for Empty {
1670 type Inner = Unset;
1671 }
1672 pub struct SetInner<S: State = Empty>(PhantomData<fn() -> S>);
1674 impl<S: State> sealed::Sealed for SetInner<S> {}
1675 impl<S: State> State for SetInner<S> {
1676 type Inner = Set<members::inner>;
1677 }
1678 #[allow(non_camel_case_types)]
1680 pub mod members {
1681 pub struct inner(());
1683 }
1684}
1685
1686pub struct ProfileDataViewBasicBuilder<'a, S: profile_data_view_basic_state::State> {
1688 _state: PhantomData<fn() -> S>,
1689 _fields: (
1690 Option<i64>,
1691 Option<i64>,
1692 Option<ProfileDataViewBasicInner<'a>>,
1693 Option<actor::ViewerStateBasic<'a>>,
1694 ),
1695 _lifetime: PhantomData<&'a ()>,
1696}
1697
1698impl<'a> ProfileDataViewBasic<'a> {
1699 pub fn new() -> ProfileDataViewBasicBuilder<
1701 'a,
1702 profile_data_view_basic_state::Empty,
1703 > {
1704 ProfileDataViewBasicBuilder::new()
1705 }
1706}
1707
1708impl<'a> ProfileDataViewBasicBuilder<'a, profile_data_view_basic_state::Empty> {
1709 pub fn new() -> Self {
1711 ProfileDataViewBasicBuilder {
1712 _state: PhantomData,
1713 _fields: (None, None, None, None),
1714 _lifetime: PhantomData,
1715 }
1716 }
1717}
1718
1719impl<'a, S: profile_data_view_basic_state::State> ProfileDataViewBasicBuilder<'a, S> {
1720 pub fn follower_count(mut self, value: impl Into<Option<i64>>) -> Self {
1722 self._fields.0 = value.into();
1723 self
1724 }
1725 pub fn maybe_follower_count(mut self, value: Option<i64>) -> Self {
1727 self._fields.0 = value;
1728 self
1729 }
1730}
1731
1732impl<'a, S: profile_data_view_basic_state::State> ProfileDataViewBasicBuilder<'a, S> {
1733 pub fn following_count(mut self, value: impl Into<Option<i64>>) -> Self {
1735 self._fields.1 = value.into();
1736 self
1737 }
1738 pub fn maybe_following_count(mut self, value: Option<i64>) -> Self {
1740 self._fields.1 = value;
1741 self
1742 }
1743}
1744
1745impl<'a, S> ProfileDataViewBasicBuilder<'a, S>
1746where
1747 S: profile_data_view_basic_state::State,
1748 S::Inner: profile_data_view_basic_state::IsUnset,
1749{
1750 pub fn inner(
1752 mut self,
1753 value: impl Into<ProfileDataViewBasicInner<'a>>,
1754 ) -> ProfileDataViewBasicBuilder<'a, profile_data_view_basic_state::SetInner<S>> {
1755 self._fields.2 = Option::Some(value.into());
1756 ProfileDataViewBasicBuilder {
1757 _state: PhantomData,
1758 _fields: self._fields,
1759 _lifetime: PhantomData,
1760 }
1761 }
1762}
1763
1764impl<'a, S: profile_data_view_basic_state::State> ProfileDataViewBasicBuilder<'a, S> {
1765 pub fn viewer(
1767 mut self,
1768 value: impl Into<Option<actor::ViewerStateBasic<'a>>>,
1769 ) -> Self {
1770 self._fields.3 = value.into();
1771 self
1772 }
1773 pub fn maybe_viewer(mut self, value: Option<actor::ViewerStateBasic<'a>>) -> Self {
1775 self._fields.3 = value;
1776 self
1777 }
1778}
1779
1780impl<'a, S> ProfileDataViewBasicBuilder<'a, S>
1781where
1782 S: profile_data_view_basic_state::State,
1783 S::Inner: profile_data_view_basic_state::IsSet,
1784{
1785 pub fn build(self) -> ProfileDataViewBasic<'a> {
1787 ProfileDataViewBasic {
1788 follower_count: self._fields.0,
1789 following_count: self._fields.1,
1790 inner: self._fields.2.unwrap(),
1791 viewer: self._fields.3,
1792 extra_data: Default::default(),
1793 }
1794 }
1795 pub fn build_with_data(
1797 self,
1798 extra_data: BTreeMap<
1799 jacquard_common::deps::smol_str::SmolStr,
1800 jacquard_common::types::value::Data<'a>,
1801 >,
1802 ) -> ProfileDataViewBasic<'a> {
1803 ProfileDataViewBasic {
1804 follower_count: self._fields.0,
1805 following_count: self._fields.1,
1806 inner: self._fields.2.unwrap(),
1807 viewer: self._fields.3,
1808 extra_data: Some(extra_data),
1809 }
1810 }
1811}
1812
1813pub mod profile_view_state {
1814
1815 pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
1816 #[allow(unused)]
1817 use ::core::marker::PhantomData;
1818 mod sealed {
1819 pub trait Sealed {}
1820 }
1821 pub trait State: sealed::Sealed {
1823 type Handle;
1824 type Did;
1825 }
1826 pub struct Empty(());
1828 impl sealed::Sealed for Empty {}
1829 impl State for Empty {
1830 type Handle = Unset;
1831 type Did = Unset;
1832 }
1833 pub struct SetHandle<S: State = Empty>(PhantomData<fn() -> S>);
1835 impl<S: State> sealed::Sealed for SetHandle<S> {}
1836 impl<S: State> State for SetHandle<S> {
1837 type Handle = Set<members::handle>;
1838 type Did = S::Did;
1839 }
1840 pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>);
1842 impl<S: State> sealed::Sealed for SetDid<S> {}
1843 impl<S: State> State for SetDid<S> {
1844 type Handle = S::Handle;
1845 type Did = Set<members::did>;
1846 }
1847 #[allow(non_camel_case_types)]
1849 pub mod members {
1850 pub struct handle(());
1852 pub struct did(());
1854 }
1855}
1856
1857pub struct ProfileViewBuilder<'a, S: profile_view_state::State> {
1859 _state: PhantomData<fn() -> S>,
1860 _fields: (
1861 Option<UriValue<'a>>,
1862 Option<UriValue<'a>>,
1863 Option<bool>,
1864 Option<Datetime>,
1865 Option<CowStr<'a>>,
1866 Option<Did<'a>>,
1867 Option<CowStr<'a>>,
1868 Option<Handle<'a>>,
1869 Option<Datetime>,
1870 Option<Vec<Label<'a>>>,
1871 Option<Vec<UriValue<'a>>>,
1872 Option<CowStr<'a>>,
1873 Option<actor::PinnedList<'a>>,
1874 Option<actor::PronounsList<'a>>,
1875 Option<bool>,
1876 Option<i64>,
1877 Option<i64>,
1878 Option<bool>,
1879 ),
1880 _lifetime: PhantomData<&'a ()>,
1881}
1882
1883impl<'a> ProfileView<'a> {
1884 pub fn new() -> ProfileViewBuilder<'a, profile_view_state::Empty> {
1886 ProfileViewBuilder::new()
1887 }
1888}
1889
1890impl<'a> ProfileViewBuilder<'a, profile_view_state::Empty> {
1891 pub fn new() -> Self {
1893 ProfileViewBuilder {
1894 _state: PhantomData,
1895 _fields: (
1896 None,
1897 None,
1898 None,
1899 None,
1900 None,
1901 None,
1902 None,
1903 None,
1904 None,
1905 None,
1906 None,
1907 None,
1908 None,
1909 None,
1910 None,
1911 None,
1912 None,
1913 None,
1914 ),
1915 _lifetime: PhantomData,
1916 }
1917 }
1918}
1919
1920impl<'a, S: profile_view_state::State> ProfileViewBuilder<'a, S> {
1921 pub fn avatar(mut self, value: impl Into<Option<UriValue<'a>>>) -> Self {
1923 self._fields.0 = value.into();
1924 self
1925 }
1926 pub fn maybe_avatar(mut self, value: Option<UriValue<'a>>) -> Self {
1928 self._fields.0 = value;
1929 self
1930 }
1931}
1932
1933impl<'a, S: profile_view_state::State> ProfileViewBuilder<'a, S> {
1934 pub fn banner(mut self, value: impl Into<Option<UriValue<'a>>>) -> Self {
1936 self._fields.1 = value.into();
1937 self
1938 }
1939 pub fn maybe_banner(mut self, value: Option<UriValue<'a>>) -> Self {
1941 self._fields.1 = value;
1942 self
1943 }
1944}
1945
1946impl<'a, S: profile_view_state::State> ProfileViewBuilder<'a, S> {
1947 pub fn bluesky(mut self, value: impl Into<Option<bool>>) -> Self {
1949 self._fields.2 = value.into();
1950 self
1951 }
1952 pub fn maybe_bluesky(mut self, value: Option<bool>) -> Self {
1954 self._fields.2 = value;
1955 self
1956 }
1957}
1958
1959impl<'a, S: profile_view_state::State> ProfileViewBuilder<'a, S> {
1960 pub fn created_at(mut self, value: impl Into<Option<Datetime>>) -> Self {
1962 self._fields.3 = value.into();
1963 self
1964 }
1965 pub fn maybe_created_at(mut self, value: Option<Datetime>) -> Self {
1967 self._fields.3 = value;
1968 self
1969 }
1970}
1971
1972impl<'a, S: profile_view_state::State> ProfileViewBuilder<'a, S> {
1973 pub fn description(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
1975 self._fields.4 = value.into();
1976 self
1977 }
1978 pub fn maybe_description(mut self, value: Option<CowStr<'a>>) -> Self {
1980 self._fields.4 = value;
1981 self
1982 }
1983}
1984
1985impl<'a, S> ProfileViewBuilder<'a, S>
1986where
1987 S: profile_view_state::State,
1988 S::Did: profile_view_state::IsUnset,
1989{
1990 pub fn did(
1992 mut self,
1993 value: impl Into<Did<'a>>,
1994 ) -> ProfileViewBuilder<'a, profile_view_state::SetDid<S>> {
1995 self._fields.5 = Option::Some(value.into());
1996 ProfileViewBuilder {
1997 _state: PhantomData,
1998 _fields: self._fields,
1999 _lifetime: PhantomData,
2000 }
2001 }
2002}
2003
2004impl<'a, S: profile_view_state::State> ProfileViewBuilder<'a, S> {
2005 pub fn display_name(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
2007 self._fields.6 = value.into();
2008 self
2009 }
2010 pub fn maybe_display_name(mut self, value: Option<CowStr<'a>>) -> Self {
2012 self._fields.6 = value;
2013 self
2014 }
2015}
2016
2017impl<'a, S> ProfileViewBuilder<'a, S>
2018where
2019 S: profile_view_state::State,
2020 S::Handle: profile_view_state::IsUnset,
2021{
2022 pub fn handle(
2024 mut self,
2025 value: impl Into<Handle<'a>>,
2026 ) -> ProfileViewBuilder<'a, profile_view_state::SetHandle<S>> {
2027 self._fields.7 = Option::Some(value.into());
2028 ProfileViewBuilder {
2029 _state: PhantomData,
2030 _fields: self._fields,
2031 _lifetime: PhantomData,
2032 }
2033 }
2034}
2035
2036impl<'a, S: profile_view_state::State> ProfileViewBuilder<'a, S> {
2037 pub fn indexed_at(mut self, value: impl Into<Option<Datetime>>) -> Self {
2039 self._fields.8 = value.into();
2040 self
2041 }
2042 pub fn maybe_indexed_at(mut self, value: Option<Datetime>) -> Self {
2044 self._fields.8 = value;
2045 self
2046 }
2047}
2048
2049impl<'a, S: profile_view_state::State> ProfileViewBuilder<'a, S> {
2050 pub fn labels(mut self, value: impl Into<Option<Vec<Label<'a>>>>) -> Self {
2052 self._fields.9 = value.into();
2053 self
2054 }
2055 pub fn maybe_labels(mut self, value: Option<Vec<Label<'a>>>) -> Self {
2057 self._fields.9 = value;
2058 self
2059 }
2060}
2061
2062impl<'a, S: profile_view_state::State> ProfileViewBuilder<'a, S> {
2063 pub fn links(mut self, value: impl Into<Option<Vec<UriValue<'a>>>>) -> Self {
2065 self._fields.10 = value.into();
2066 self
2067 }
2068 pub fn maybe_links(mut self, value: Option<Vec<UriValue<'a>>>) -> Self {
2070 self._fields.10 = value;
2071 self
2072 }
2073}
2074
2075impl<'a, S: profile_view_state::State> ProfileViewBuilder<'a, S> {
2076 pub fn location(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
2078 self._fields.11 = value.into();
2079 self
2080 }
2081 pub fn maybe_location(mut self, value: Option<CowStr<'a>>) -> Self {
2083 self._fields.11 = value;
2084 self
2085 }
2086}
2087
2088impl<'a, S: profile_view_state::State> ProfileViewBuilder<'a, S> {
2089 pub fn pinned(mut self, value: impl Into<Option<actor::PinnedList<'a>>>) -> Self {
2091 self._fields.12 = value.into();
2092 self
2093 }
2094 pub fn maybe_pinned(mut self, value: Option<actor::PinnedList<'a>>) -> Self {
2096 self._fields.12 = value;
2097 self
2098 }
2099}
2100
2101impl<'a, S: profile_view_state::State> ProfileViewBuilder<'a, S> {
2102 pub fn pronouns(
2104 mut self,
2105 value: impl Into<Option<actor::PronounsList<'a>>>,
2106 ) -> Self {
2107 self._fields.13 = value.into();
2108 self
2109 }
2110 pub fn maybe_pronouns(mut self, value: Option<actor::PronounsList<'a>>) -> Self {
2112 self._fields.13 = value;
2113 self
2114 }
2115}
2116
2117impl<'a, S: profile_view_state::State> ProfileViewBuilder<'a, S> {
2118 pub fn streamplace(mut self, value: impl Into<Option<bool>>) -> Self {
2120 self._fields.14 = value.into();
2121 self
2122 }
2123 pub fn maybe_streamplace(mut self, value: Option<bool>) -> Self {
2125 self._fields.14 = value;
2126 self
2127 }
2128}
2129
2130impl<'a, S: profile_view_state::State> ProfileViewBuilder<'a, S> {
2131 pub fn subscribed_count(mut self, value: impl Into<Option<i64>>) -> Self {
2133 self._fields.15 = value.into();
2134 self
2135 }
2136 pub fn maybe_subscribed_count(mut self, value: Option<i64>) -> Self {
2138 self._fields.15 = value;
2139 self
2140 }
2141}
2142
2143impl<'a, S: profile_view_state::State> ProfileViewBuilder<'a, S> {
2144 pub fn subscriber_count(mut self, value: impl Into<Option<i64>>) -> Self {
2146 self._fields.16 = value.into();
2147 self
2148 }
2149 pub fn maybe_subscriber_count(mut self, value: Option<i64>) -> Self {
2151 self._fields.16 = value;
2152 self
2153 }
2154}
2155
2156impl<'a, S: profile_view_state::State> ProfileViewBuilder<'a, S> {
2157 pub fn tangled(mut self, value: impl Into<Option<bool>>) -> Self {
2159 self._fields.17 = value.into();
2160 self
2161 }
2162 pub fn maybe_tangled(mut self, value: Option<bool>) -> Self {
2164 self._fields.17 = value;
2165 self
2166 }
2167}
2168
2169impl<'a, S> ProfileViewBuilder<'a, S>
2170where
2171 S: profile_view_state::State,
2172 S::Handle: profile_view_state::IsSet,
2173 S::Did: profile_view_state::IsSet,
2174{
2175 pub fn build(self) -> ProfileView<'a> {
2177 ProfileView {
2178 avatar: self._fields.0,
2179 banner: self._fields.1,
2180 bluesky: self._fields.2,
2181 created_at: self._fields.3,
2182 description: self._fields.4,
2183 did: self._fields.5.unwrap(),
2184 display_name: self._fields.6,
2185 handle: self._fields.7.unwrap(),
2186 indexed_at: self._fields.8,
2187 labels: self._fields.9,
2188 links: self._fields.10,
2189 location: self._fields.11,
2190 pinned: self._fields.12,
2191 pronouns: self._fields.13,
2192 streamplace: self._fields.14,
2193 subscribed_count: self._fields.15,
2194 subscriber_count: self._fields.16,
2195 tangled: self._fields.17,
2196 extra_data: Default::default(),
2197 }
2198 }
2199 pub fn build_with_data(
2201 self,
2202 extra_data: BTreeMap<
2203 jacquard_common::deps::smol_str::SmolStr,
2204 jacquard_common::types::value::Data<'a>,
2205 >,
2206 ) -> ProfileView<'a> {
2207 ProfileView {
2208 avatar: self._fields.0,
2209 banner: self._fields.1,
2210 bluesky: self._fields.2,
2211 created_at: self._fields.3,
2212 description: self._fields.4,
2213 did: self._fields.5.unwrap(),
2214 display_name: self._fields.6,
2215 handle: self._fields.7.unwrap(),
2216 indexed_at: self._fields.8,
2217 labels: self._fields.9,
2218 links: self._fields.10,
2219 location: self._fields.11,
2220 pinned: self._fields.12,
2221 pronouns: self._fields.13,
2222 streamplace: self._fields.14,
2223 subscribed_count: self._fields.15,
2224 subscriber_count: self._fields.16,
2225 tangled: self._fields.17,
2226 extra_data: Some(extra_data),
2227 }
2228 }
2229}
2230
2231pub mod profile_view_basic_state {
2232
2233 pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
2234 #[allow(unused)]
2235 use ::core::marker::PhantomData;
2236 mod sealed {
2237 pub trait Sealed {}
2238 }
2239 pub trait State: sealed::Sealed {
2241 type Did;
2242 type Handle;
2243 }
2244 pub struct Empty(());
2246 impl sealed::Sealed for Empty {}
2247 impl State for Empty {
2248 type Did = Unset;
2249 type Handle = Unset;
2250 }
2251 pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>);
2253 impl<S: State> sealed::Sealed for SetDid<S> {}
2254 impl<S: State> State for SetDid<S> {
2255 type Did = Set<members::did>;
2256 type Handle = S::Handle;
2257 }
2258 pub struct SetHandle<S: State = Empty>(PhantomData<fn() -> S>);
2260 impl<S: State> sealed::Sealed for SetHandle<S> {}
2261 impl<S: State> State for SetHandle<S> {
2262 type Did = S::Did;
2263 type Handle = Set<members::handle>;
2264 }
2265 #[allow(non_camel_case_types)]
2267 pub mod members {
2268 pub struct did(());
2270 pub struct handle(());
2272 }
2273}
2274
2275pub struct ProfileViewBasicBuilder<'a, S: profile_view_basic_state::State> {
2277 _state: PhantomData<fn() -> S>,
2278 _fields: (
2279 Option<UriValue<'a>>,
2280 Option<Datetime>,
2281 Option<Did<'a>>,
2282 Option<CowStr<'a>>,
2283 Option<Handle<'a>>,
2284 Option<Datetime>,
2285 Option<Vec<Label<'a>>>,
2286 Option<actor::PronounsList<'a>>,
2287 ),
2288 _lifetime: PhantomData<&'a ()>,
2289}
2290
2291impl<'a> ProfileViewBasic<'a> {
2292 pub fn new() -> ProfileViewBasicBuilder<'a, profile_view_basic_state::Empty> {
2294 ProfileViewBasicBuilder::new()
2295 }
2296}
2297
2298impl<'a> ProfileViewBasicBuilder<'a, profile_view_basic_state::Empty> {
2299 pub fn new() -> Self {
2301 ProfileViewBasicBuilder {
2302 _state: PhantomData,
2303 _fields: (None, None, None, None, None, None, None, None),
2304 _lifetime: PhantomData,
2305 }
2306 }
2307}
2308
2309impl<'a, S: profile_view_basic_state::State> ProfileViewBasicBuilder<'a, S> {
2310 pub fn avatar(mut self, value: impl Into<Option<UriValue<'a>>>) -> Self {
2312 self._fields.0 = value.into();
2313 self
2314 }
2315 pub fn maybe_avatar(mut self, value: Option<UriValue<'a>>) -> Self {
2317 self._fields.0 = value;
2318 self
2319 }
2320}
2321
2322impl<'a, S: profile_view_basic_state::State> ProfileViewBasicBuilder<'a, S> {
2323 pub fn created_at(mut self, value: impl Into<Option<Datetime>>) -> Self {
2325 self._fields.1 = value.into();
2326 self
2327 }
2328 pub fn maybe_created_at(mut self, value: Option<Datetime>) -> Self {
2330 self._fields.1 = value;
2331 self
2332 }
2333}
2334
2335impl<'a, S> ProfileViewBasicBuilder<'a, S>
2336where
2337 S: profile_view_basic_state::State,
2338 S::Did: profile_view_basic_state::IsUnset,
2339{
2340 pub fn did(
2342 mut self,
2343 value: impl Into<Did<'a>>,
2344 ) -> ProfileViewBasicBuilder<'a, profile_view_basic_state::SetDid<S>> {
2345 self._fields.2 = Option::Some(value.into());
2346 ProfileViewBasicBuilder {
2347 _state: PhantomData,
2348 _fields: self._fields,
2349 _lifetime: PhantomData,
2350 }
2351 }
2352}
2353
2354impl<'a, S: profile_view_basic_state::State> ProfileViewBasicBuilder<'a, S> {
2355 pub fn display_name(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
2357 self._fields.3 = value.into();
2358 self
2359 }
2360 pub fn maybe_display_name(mut self, value: Option<CowStr<'a>>) -> Self {
2362 self._fields.3 = value;
2363 self
2364 }
2365}
2366
2367impl<'a, S> ProfileViewBasicBuilder<'a, S>
2368where
2369 S: profile_view_basic_state::State,
2370 S::Handle: profile_view_basic_state::IsUnset,
2371{
2372 pub fn handle(
2374 mut self,
2375 value: impl Into<Handle<'a>>,
2376 ) -> ProfileViewBasicBuilder<'a, profile_view_basic_state::SetHandle<S>> {
2377 self._fields.4 = Option::Some(value.into());
2378 ProfileViewBasicBuilder {
2379 _state: PhantomData,
2380 _fields: self._fields,
2381 _lifetime: PhantomData,
2382 }
2383 }
2384}
2385
2386impl<'a, S: profile_view_basic_state::State> ProfileViewBasicBuilder<'a, S> {
2387 pub fn indexed_at(mut self, value: impl Into<Option<Datetime>>) -> Self {
2389 self._fields.5 = value.into();
2390 self
2391 }
2392 pub fn maybe_indexed_at(mut self, value: Option<Datetime>) -> Self {
2394 self._fields.5 = value;
2395 self
2396 }
2397}
2398
2399impl<'a, S: profile_view_basic_state::State> ProfileViewBasicBuilder<'a, S> {
2400 pub fn labels(mut self, value: impl Into<Option<Vec<Label<'a>>>>) -> Self {
2402 self._fields.6 = value.into();
2403 self
2404 }
2405 pub fn maybe_labels(mut self, value: Option<Vec<Label<'a>>>) -> Self {
2407 self._fields.6 = value;
2408 self
2409 }
2410}
2411
2412impl<'a, S: profile_view_basic_state::State> ProfileViewBasicBuilder<'a, S> {
2413 pub fn pronouns(
2415 mut self,
2416 value: impl Into<Option<actor::PronounsList<'a>>>,
2417 ) -> Self {
2418 self._fields.7 = value.into();
2419 self
2420 }
2421 pub fn maybe_pronouns(mut self, value: Option<actor::PronounsList<'a>>) -> Self {
2423 self._fields.7 = value;
2424 self
2425 }
2426}
2427
2428impl<'a, S> ProfileViewBasicBuilder<'a, S>
2429where
2430 S: profile_view_basic_state::State,
2431 S::Did: profile_view_basic_state::IsSet,
2432 S::Handle: profile_view_basic_state::IsSet,
2433{
2434 pub fn build(self) -> ProfileViewBasic<'a> {
2436 ProfileViewBasic {
2437 avatar: self._fields.0,
2438 created_at: self._fields.1,
2439 did: self._fields.2.unwrap(),
2440 display_name: self._fields.3,
2441 handle: self._fields.4.unwrap(),
2442 indexed_at: self._fields.5,
2443 labels: self._fields.6,
2444 pronouns: self._fields.7,
2445 extra_data: Default::default(),
2446 }
2447 }
2448 pub fn build_with_data(
2450 self,
2451 extra_data: BTreeMap<
2452 jacquard_common::deps::smol_str::SmolStr,
2453 jacquard_common::types::value::Data<'a>,
2454 >,
2455 ) -> ProfileViewBasic<'a> {
2456 ProfileViewBasic {
2457 avatar: self._fields.0,
2458 created_at: self._fields.1,
2459 did: self._fields.2.unwrap(),
2460 display_name: self._fields.3,
2461 handle: self._fields.4.unwrap(),
2462 indexed_at: self._fields.5,
2463 labels: self._fields.6,
2464 pronouns: self._fields.7,
2465 extra_data: Some(extra_data),
2466 }
2467 }
2468}
2469
2470pub mod subscribed_notebook_state {
2471
2472 pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
2473 #[allow(unused)]
2474 use ::core::marker::PhantomData;
2475 mod sealed {
2476 pub trait Sealed {}
2477 }
2478 pub trait State: sealed::Sealed {
2480 type Uri;
2481 }
2482 pub struct Empty(());
2484 impl sealed::Sealed for Empty {}
2485 impl State for Empty {
2486 type Uri = Unset;
2487 }
2488 pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>);
2490 impl<S: State> sealed::Sealed for SetUri<S> {}
2491 impl<S: State> State for SetUri<S> {
2492 type Uri = Set<members::uri>;
2493 }
2494 #[allow(non_camel_case_types)]
2496 pub mod members {
2497 pub struct uri(());
2499 }
2500}
2501
2502pub struct SubscribedNotebookBuilder<'a, S: subscribed_notebook_state::State> {
2504 _state: PhantomData<fn() -> S>,
2505 _fields: (Option<CowStr<'a>>, Option<CowStr<'a>>, Option<AtUri<'a>>),
2506 _lifetime: PhantomData<&'a ()>,
2507}
2508
2509impl<'a> SubscribedNotebook<'a> {
2510 pub fn new() -> SubscribedNotebookBuilder<'a, subscribed_notebook_state::Empty> {
2512 SubscribedNotebookBuilder::new()
2513 }
2514}
2515
2516impl<'a> SubscribedNotebookBuilder<'a, subscribed_notebook_state::Empty> {
2517 pub fn new() -> Self {
2519 SubscribedNotebookBuilder {
2520 _state: PhantomData,
2521 _fields: (None, None, None),
2522 _lifetime: PhantomData,
2523 }
2524 }
2525}
2526
2527impl<'a, S: subscribed_notebook_state::State> SubscribedNotebookBuilder<'a, S> {
2528 pub fn path(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
2530 self._fields.0 = value.into();
2531 self
2532 }
2533 pub fn maybe_path(mut self, value: Option<CowStr<'a>>) -> Self {
2535 self._fields.0 = value;
2536 self
2537 }
2538}
2539
2540impl<'a, S: subscribed_notebook_state::State> SubscribedNotebookBuilder<'a, S> {
2541 pub fn title(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
2543 self._fields.1 = value.into();
2544 self
2545 }
2546 pub fn maybe_title(mut self, value: Option<CowStr<'a>>) -> Self {
2548 self._fields.1 = value;
2549 self
2550 }
2551}
2552
2553impl<'a, S> SubscribedNotebookBuilder<'a, S>
2554where
2555 S: subscribed_notebook_state::State,
2556 S::Uri: subscribed_notebook_state::IsUnset,
2557{
2558 pub fn uri(
2560 mut self,
2561 value: impl Into<AtUri<'a>>,
2562 ) -> SubscribedNotebookBuilder<'a, subscribed_notebook_state::SetUri<S>> {
2563 self._fields.2 = Option::Some(value.into());
2564 SubscribedNotebookBuilder {
2565 _state: PhantomData,
2566 _fields: self._fields,
2567 _lifetime: PhantomData,
2568 }
2569 }
2570}
2571
2572impl<'a, S> SubscribedNotebookBuilder<'a, S>
2573where
2574 S: subscribed_notebook_state::State,
2575 S::Uri: subscribed_notebook_state::IsSet,
2576{
2577 pub fn build(self) -> SubscribedNotebook<'a> {
2579 SubscribedNotebook {
2580 path: self._fields.0,
2581 title: self._fields.1,
2582 uri: self._fields.2.unwrap(),
2583 extra_data: Default::default(),
2584 }
2585 }
2586 pub fn build_with_data(
2588 self,
2589 extra_data: BTreeMap<
2590 jacquard_common::deps::smol_str::SmolStr,
2591 jacquard_common::types::value::Data<'a>,
2592 >,
2593 ) -> SubscribedNotebook<'a> {
2594 SubscribedNotebook {
2595 path: self._fields.0,
2596 title: self._fields.1,
2597 uri: self._fields.2.unwrap(),
2598 extra_data: Some(extra_data),
2599 }
2600 }
2601}
2602
2603pub mod tangled_profile_view_state {
2604
2605 pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
2606 #[allow(unused)]
2607 use ::core::marker::PhantomData;
2608 mod sealed {
2609 pub trait Sealed {}
2610 }
2611 pub trait State: sealed::Sealed {
2613 type Bluesky;
2614 type Did;
2615 type Handle;
2616 }
2617 pub struct Empty(());
2619 impl sealed::Sealed for Empty {}
2620 impl State for Empty {
2621 type Bluesky = Unset;
2622 type Did = Unset;
2623 type Handle = Unset;
2624 }
2625 pub struct SetBluesky<S: State = Empty>(PhantomData<fn() -> S>);
2627 impl<S: State> sealed::Sealed for SetBluesky<S> {}
2628 impl<S: State> State for SetBluesky<S> {
2629 type Bluesky = Set<members::bluesky>;
2630 type Did = S::Did;
2631 type Handle = S::Handle;
2632 }
2633 pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>);
2635 impl<S: State> sealed::Sealed for SetDid<S> {}
2636 impl<S: State> State for SetDid<S> {
2637 type Bluesky = S::Bluesky;
2638 type Did = Set<members::did>;
2639 type Handle = S::Handle;
2640 }
2641 pub struct SetHandle<S: State = Empty>(PhantomData<fn() -> S>);
2643 impl<S: State> sealed::Sealed for SetHandle<S> {}
2644 impl<S: State> State for SetHandle<S> {
2645 type Bluesky = S::Bluesky;
2646 type Did = S::Did;
2647 type Handle = Set<members::handle>;
2648 }
2649 #[allow(non_camel_case_types)]
2651 pub mod members {
2652 pub struct bluesky(());
2654 pub struct did(());
2656 pub struct handle(());
2658 }
2659}
2660
2661pub struct TangledProfileViewBuilder<'a, S: tangled_profile_view_state::State> {
2663 _state: PhantomData<fn() -> S>,
2664 _fields: (
2665 Option<bool>,
2666 Option<CowStr<'a>>,
2667 Option<Did<'a>>,
2668 Option<Handle<'a>>,
2669 Option<Vec<UriValue<'a>>>,
2670 Option<CowStr<'a>>,
2671 Option<Vec<AtUri<'a>>>,
2672 Option<Vec<CowStr<'a>>>,
2673 ),
2674 _lifetime: PhantomData<&'a ()>,
2675}
2676
2677impl<'a> TangledProfileView<'a> {
2678 pub fn new() -> TangledProfileViewBuilder<'a, tangled_profile_view_state::Empty> {
2680 TangledProfileViewBuilder::new()
2681 }
2682}
2683
2684impl<'a> TangledProfileViewBuilder<'a, tangled_profile_view_state::Empty> {
2685 pub fn new() -> Self {
2687 TangledProfileViewBuilder {
2688 _state: PhantomData,
2689 _fields: (None, None, None, None, None, None, None, None),
2690 _lifetime: PhantomData,
2691 }
2692 }
2693}
2694
2695impl<'a, S> TangledProfileViewBuilder<'a, S>
2696where
2697 S: tangled_profile_view_state::State,
2698 S::Bluesky: tangled_profile_view_state::IsUnset,
2699{
2700 pub fn bluesky(
2702 mut self,
2703 value: impl Into<bool>,
2704 ) -> TangledProfileViewBuilder<'a, tangled_profile_view_state::SetBluesky<S>> {
2705 self._fields.0 = Option::Some(value.into());
2706 TangledProfileViewBuilder {
2707 _state: PhantomData,
2708 _fields: self._fields,
2709 _lifetime: PhantomData,
2710 }
2711 }
2712}
2713
2714impl<'a, S: tangled_profile_view_state::State> TangledProfileViewBuilder<'a, S> {
2715 pub fn description(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
2717 self._fields.1 = value.into();
2718 self
2719 }
2720 pub fn maybe_description(mut self, value: Option<CowStr<'a>>) -> Self {
2722 self._fields.1 = value;
2723 self
2724 }
2725}
2726
2727impl<'a, S> TangledProfileViewBuilder<'a, S>
2728where
2729 S: tangled_profile_view_state::State,
2730 S::Did: tangled_profile_view_state::IsUnset,
2731{
2732 pub fn did(
2734 mut self,
2735 value: impl Into<Did<'a>>,
2736 ) -> TangledProfileViewBuilder<'a, tangled_profile_view_state::SetDid<S>> {
2737 self._fields.2 = Option::Some(value.into());
2738 TangledProfileViewBuilder {
2739 _state: PhantomData,
2740 _fields: self._fields,
2741 _lifetime: PhantomData,
2742 }
2743 }
2744}
2745
2746impl<'a, S> TangledProfileViewBuilder<'a, S>
2747where
2748 S: tangled_profile_view_state::State,
2749 S::Handle: tangled_profile_view_state::IsUnset,
2750{
2751 pub fn handle(
2753 mut self,
2754 value: impl Into<Handle<'a>>,
2755 ) -> TangledProfileViewBuilder<'a, tangled_profile_view_state::SetHandle<S>> {
2756 self._fields.3 = Option::Some(value.into());
2757 TangledProfileViewBuilder {
2758 _state: PhantomData,
2759 _fields: self._fields,
2760 _lifetime: PhantomData,
2761 }
2762 }
2763}
2764
2765impl<'a, S: tangled_profile_view_state::State> TangledProfileViewBuilder<'a, S> {
2766 pub fn links(mut self, value: impl Into<Option<Vec<UriValue<'a>>>>) -> Self {
2768 self._fields.4 = value.into();
2769 self
2770 }
2771 pub fn maybe_links(mut self, value: Option<Vec<UriValue<'a>>>) -> Self {
2773 self._fields.4 = value;
2774 self
2775 }
2776}
2777
2778impl<'a, S: tangled_profile_view_state::State> TangledProfileViewBuilder<'a, S> {
2779 pub fn location(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
2781 self._fields.5 = value.into();
2782 self
2783 }
2784 pub fn maybe_location(mut self, value: Option<CowStr<'a>>) -> Self {
2786 self._fields.5 = value;
2787 self
2788 }
2789}
2790
2791impl<'a, S: tangled_profile_view_state::State> TangledProfileViewBuilder<'a, S> {
2792 pub fn pinned_repositories(
2794 mut self,
2795 value: impl Into<Option<Vec<AtUri<'a>>>>,
2796 ) -> Self {
2797 self._fields.6 = value.into();
2798 self
2799 }
2800 pub fn maybe_pinned_repositories(mut self, value: Option<Vec<AtUri<'a>>>) -> Self {
2802 self._fields.6 = value;
2803 self
2804 }
2805}
2806
2807impl<'a, S: tangled_profile_view_state::State> TangledProfileViewBuilder<'a, S> {
2808 pub fn stats(mut self, value: impl Into<Option<Vec<CowStr<'a>>>>) -> Self {
2810 self._fields.7 = value.into();
2811 self
2812 }
2813 pub fn maybe_stats(mut self, value: Option<Vec<CowStr<'a>>>) -> Self {
2815 self._fields.7 = value;
2816 self
2817 }
2818}
2819
2820impl<'a, S> TangledProfileViewBuilder<'a, S>
2821where
2822 S: tangled_profile_view_state::State,
2823 S::Bluesky: tangled_profile_view_state::IsSet,
2824 S::Did: tangled_profile_view_state::IsSet,
2825 S::Handle: tangled_profile_view_state::IsSet,
2826{
2827 pub fn build(self) -> TangledProfileView<'a> {
2829 TangledProfileView {
2830 bluesky: self._fields.0.unwrap(),
2831 description: self._fields.1,
2832 did: self._fields.2.unwrap(),
2833 handle: self._fields.3.unwrap(),
2834 links: self._fields.4,
2835 location: self._fields.5,
2836 pinned_repositories: self._fields.6,
2837 stats: self._fields.7,
2838 extra_data: Default::default(),
2839 }
2840 }
2841 pub fn build_with_data(
2843 self,
2844 extra_data: BTreeMap<
2845 jacquard_common::deps::smol_str::SmolStr,
2846 jacquard_common::types::value::Data<'a>,
2847 >,
2848 ) -> TangledProfileView<'a> {
2849 TangledProfileView {
2850 bluesky: self._fields.0.unwrap(),
2851 description: self._fields.1,
2852 did: self._fields.2.unwrap(),
2853 handle: self._fields.3.unwrap(),
2854 links: self._fields.4,
2855 location: self._fields.5,
2856 pinned_repositories: self._fields.6,
2857 stats: self._fields.7,
2858 extra_data: Some(extra_data),
2859 }
2860 }
2861}