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