atproto blogging
at main 3707 lines 152 kB view raw
1// @generated by jacquard-lexicon. DO NOT EDIT. 2// 3// Lexicon: sh.weaver.actor.defs 4// 5// This file was automatically generated from Lexicon schemas. 6// Any manual changes will be overwritten on the next regeneration. 7 8pub 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/// A single author in a Weaver notebook. 17#[jacquard_derive::lexicon] 18#[derive( 19 serde::Serialize, 20 serde::Deserialize, 21 Debug, 22 Clone, 23 PartialEq, 24 Eq, 25 jacquard_derive::IntoStatic 26)] 27#[serde(rename_all = "camelCase")] 28pub struct Author<'a> { 29 #[serde(borrow)] 30 pub did: jacquard_common::types::string::Did<'a>, 31 /// signed bytes of the corresponding notebook record in the author's repo 32 #[serde(skip_serializing_if = "std::option::Option::is_none")] 33 #[serde(default, with = "jacquard_common::opt_serde_bytes_helper")] 34 pub signature: std::option::Option<bytes::Bytes>, 35} 36 37pub mod author_state { 38 39 pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; 40 #[allow(unused)] 41 use ::core::marker::PhantomData; 42 mod sealed { 43 pub trait Sealed {} 44 } 45 /// State trait tracking which required fields have been set 46 pub trait State: sealed::Sealed { 47 type Did; 48 } 49 /// Empty state - all required fields are unset 50 pub struct Empty(()); 51 impl sealed::Sealed for Empty {} 52 impl State for Empty { 53 type Did = Unset; 54 } 55 ///State transition - sets the `did` field to Set 56 pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 57 impl<S: State> sealed::Sealed for SetDid<S> {} 58 impl<S: State> State for SetDid<S> { 59 type Did = Set<members::did>; 60 } 61 /// Marker types for field names 62 #[allow(non_camel_case_types)] 63 pub mod members { 64 ///Marker type for the `did` field 65 pub struct did(()); 66 } 67} 68 69/// Builder for constructing an instance of this type 70pub struct AuthorBuilder<'a, S: author_state::State> { 71 _phantom_state: ::core::marker::PhantomData<fn() -> S>, 72 __unsafe_private_named: ( 73 ::core::option::Option<jacquard_common::types::string::Did<'a>>, 74 ::core::option::Option<bytes::Bytes>, 75 ), 76 _phantom: ::core::marker::PhantomData<&'a ()>, 77} 78 79impl<'a> Author<'a> { 80 /// Create a new builder for this type 81 pub fn new() -> AuthorBuilder<'a, author_state::Empty> { 82 AuthorBuilder::new() 83 } 84} 85 86impl<'a> AuthorBuilder<'a, author_state::Empty> { 87 /// Create a new builder with all fields unset 88 pub fn new() -> Self { 89 AuthorBuilder { 90 _phantom_state: ::core::marker::PhantomData, 91 __unsafe_private_named: (None, None), 92 _phantom: ::core::marker::PhantomData, 93 } 94 } 95} 96 97impl<'a, S> AuthorBuilder<'a, S> 98where 99 S: author_state::State, 100 S::Did: author_state::IsUnset, 101{ 102 /// Set the `did` field (required) 103 pub fn did( 104 mut self, 105 value: impl Into<jacquard_common::types::string::Did<'a>>, 106 ) -> AuthorBuilder<'a, author_state::SetDid<S>> { 107 self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); 108 AuthorBuilder { 109 _phantom_state: ::core::marker::PhantomData, 110 __unsafe_private_named: self.__unsafe_private_named, 111 _phantom: ::core::marker::PhantomData, 112 } 113 } 114} 115 116impl<'a, S: author_state::State> AuthorBuilder<'a, S> { 117 /// Set the `signature` field (optional) 118 pub fn signature(mut self, value: impl Into<Option<bytes::Bytes>>) -> Self { 119 self.__unsafe_private_named.1 = value.into(); 120 self 121 } 122 /// Set the `signature` field to an Option value (optional) 123 pub fn maybe_signature(mut self, value: Option<bytes::Bytes>) -> Self { 124 self.__unsafe_private_named.1 = value; 125 self 126 } 127} 128 129impl<'a, S> AuthorBuilder<'a, S> 130where 131 S: author_state::State, 132 S::Did: author_state::IsSet, 133{ 134 /// Build the final struct 135 pub fn build(self) -> Author<'a> { 136 Author { 137 did: self.__unsafe_private_named.0.unwrap(), 138 signature: self.__unsafe_private_named.1, 139 extra_data: Default::default(), 140 } 141 } 142 /// Build the final struct with custom extra_data 143 pub fn build_with_data( 144 self, 145 extra_data: std::collections::BTreeMap< 146 jacquard_common::smol_str::SmolStr, 147 jacquard_common::types::value::Data<'a>, 148 >, 149 ) -> Author<'a> { 150 Author { 151 did: self.__unsafe_private_named.0.unwrap(), 152 signature: self.__unsafe_private_named.1, 153 extra_data: Some(extra_data), 154 } 155 } 156} 157 158fn lexicon_doc_sh_weaver_actor_defs() -> ::jacquard_lexicon::lexicon::LexiconDoc< 159 'static, 160> { 161 ::jacquard_lexicon::lexicon::LexiconDoc { 162 lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, 163 id: ::jacquard_common::CowStr::new_static("sh.weaver.actor.defs"), 164 revision: None, 165 description: None, 166 defs: { 167 let mut map = ::alloc::collections::BTreeMap::new(); 168 map.insert( 169 ::jacquard_common::smol_str::SmolStr::new_static("author"), 170 ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { 171 description: Some( 172 ::jacquard_common::CowStr::new_static( 173 "A single author in a Weaver notebook.", 174 ), 175 ), 176 required: Some( 177 vec![::jacquard_common::smol_str::SmolStr::new_static("did")], 178 ), 179 nullable: None, 180 properties: { 181 #[allow(unused_mut)] 182 let mut map = ::alloc::collections::BTreeMap::new(); 183 map.insert( 184 ::jacquard_common::smol_str::SmolStr::new_static("did"), 185 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 186 description: None, 187 format: Some( 188 ::jacquard_lexicon::lexicon::LexStringFormat::Did, 189 ), 190 default: None, 191 min_length: None, 192 max_length: None, 193 min_graphemes: None, 194 max_graphemes: None, 195 r#enum: None, 196 r#const: None, 197 known_values: None, 198 }), 199 ); 200 map.insert( 201 ::jacquard_common::smol_str::SmolStr::new_static( 202 "signature", 203 ), 204 ::jacquard_lexicon::lexicon::LexObjectProperty::Bytes(::jacquard_lexicon::lexicon::LexBytes { 205 description: None, 206 max_length: None, 207 min_length: None, 208 }), 209 ); 210 map 211 }, 212 }), 213 ); 214 map.insert( 215 ::jacquard_common::smol_str::SmolStr::new_static("pinnedList"), 216 ::jacquard_lexicon::lexicon::LexUserType::Array(::jacquard_lexicon::lexicon::LexArray { 217 description: None, 218 items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef { 219 description: None, 220 r#ref: ::jacquard_common::CowStr::new_static( 221 "com.atproto.repo.strongRef", 222 ), 223 }), 224 min_length: None, 225 max_length: None, 226 }), 227 ); 228 map.insert( 229 ::jacquard_common::smol_str::SmolStr::new_static("profileDataView"), 230 ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { 231 description: None, 232 required: Some( 233 vec![::jacquard_common::smol_str::SmolStr::new_static("inner")], 234 ), 235 nullable: None, 236 properties: { 237 #[allow(unused_mut)] 238 let mut map = ::alloc::collections::BTreeMap::new(); 239 map.insert( 240 ::jacquard_common::smol_str::SmolStr::new_static( 241 "collaborationCount", 242 ), 243 ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { 244 description: None, 245 default: None, 246 minimum: None, 247 maximum: None, 248 r#enum: None, 249 r#const: None, 250 }), 251 ); 252 map.insert( 253 ::jacquard_common::smol_str::SmolStr::new_static( 254 "entryCount", 255 ), 256 ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { 257 description: None, 258 default: None, 259 minimum: None, 260 maximum: None, 261 r#enum: None, 262 r#const: None, 263 }), 264 ); 265 map.insert( 266 ::jacquard_common::smol_str::SmolStr::new_static( 267 "followerCount", 268 ), 269 ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { 270 description: None, 271 default: None, 272 minimum: None, 273 maximum: None, 274 r#enum: None, 275 r#const: None, 276 }), 277 ); 278 map.insert( 279 ::jacquard_common::smol_str::SmolStr::new_static( 280 "followingCount", 281 ), 282 ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { 283 description: None, 284 default: None, 285 minimum: None, 286 maximum: None, 287 r#enum: None, 288 r#const: None, 289 }), 290 ); 291 map.insert( 292 ::jacquard_common::smol_str::SmolStr::new_static("inner"), 293 ::jacquard_lexicon::lexicon::LexObjectProperty::Union(::jacquard_lexicon::lexicon::LexRefUnion { 294 description: None, 295 refs: vec![ 296 ::jacquard_common::CowStr::new_static("#profileView"), 297 ::jacquard_common::CowStr::new_static("app.bsky.actor.defs#profileViewDetailed"), 298 ::jacquard_common::CowStr::new_static("#tangledProfileView") 299 ], 300 closed: None, 301 }), 302 ); 303 map.insert( 304 ::jacquard_common::smol_str::SmolStr::new_static( 305 "notebookCount", 306 ), 307 ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { 308 description: None, 309 default: None, 310 minimum: None, 311 maximum: None, 312 r#enum: None, 313 r#const: None, 314 }), 315 ); 316 map.insert( 317 ::jacquard_common::smol_str::SmolStr::new_static("viewer"), 318 ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { 319 description: None, 320 r#ref: ::jacquard_common::CowStr::new_static("#viewerState"), 321 }), 322 ); 323 map 324 }, 325 }), 326 ); 327 map.insert( 328 ::jacquard_common::smol_str::SmolStr::new_static("profileDataViewBasic"), 329 ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { 330 description: None, 331 required: Some( 332 vec![::jacquard_common::smol_str::SmolStr::new_static("inner")], 333 ), 334 nullable: None, 335 properties: { 336 #[allow(unused_mut)] 337 let mut map = ::alloc::collections::BTreeMap::new(); 338 map.insert( 339 ::jacquard_common::smol_str::SmolStr::new_static( 340 "followerCount", 341 ), 342 ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { 343 description: None, 344 default: None, 345 minimum: None, 346 maximum: None, 347 r#enum: None, 348 r#const: None, 349 }), 350 ); 351 map.insert( 352 ::jacquard_common::smol_str::SmolStr::new_static( 353 "followingCount", 354 ), 355 ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { 356 description: None, 357 default: None, 358 minimum: None, 359 maximum: None, 360 r#enum: None, 361 r#const: None, 362 }), 363 ); 364 map.insert( 365 ::jacquard_common::smol_str::SmolStr::new_static("inner"), 366 ::jacquard_lexicon::lexicon::LexObjectProperty::Union(::jacquard_lexicon::lexicon::LexRefUnion { 367 description: None, 368 refs: vec![ 369 ::jacquard_common::CowStr::new_static("#profileViewBasic"), 370 ::jacquard_common::CowStr::new_static("app.bsky.actor.defs#profileViewBasic"), 371 ::jacquard_common::CowStr::new_static("#tangledProfileView") 372 ], 373 closed: None, 374 }), 375 ); 376 map.insert( 377 ::jacquard_common::smol_str::SmolStr::new_static("viewer"), 378 ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { 379 description: None, 380 r#ref: ::jacquard_common::CowStr::new_static( 381 "#viewerStateBasic", 382 ), 383 }), 384 ); 385 map 386 }, 387 }), 388 ); 389 map.insert( 390 ::jacquard_common::smol_str::SmolStr::new_static("profileView"), 391 ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { 392 description: None, 393 required: Some( 394 vec![ 395 ::jacquard_common::smol_str::SmolStr::new_static("did"), 396 ::jacquard_common::smol_str::SmolStr::new_static("handle") 397 ], 398 ), 399 nullable: None, 400 properties: { 401 #[allow(unused_mut)] 402 let mut map = ::alloc::collections::BTreeMap::new(); 403 map.insert( 404 ::jacquard_common::smol_str::SmolStr::new_static("avatar"), 405 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 406 description: None, 407 format: Some( 408 ::jacquard_lexicon::lexicon::LexStringFormat::Uri, 409 ), 410 default: None, 411 min_length: None, 412 max_length: None, 413 min_graphemes: None, 414 max_graphemes: None, 415 r#enum: None, 416 r#const: None, 417 known_values: None, 418 }), 419 ); 420 map.insert( 421 ::jacquard_common::smol_str::SmolStr::new_static("banner"), 422 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 423 description: None, 424 format: Some( 425 ::jacquard_lexicon::lexicon::LexStringFormat::Uri, 426 ), 427 default: None, 428 min_length: None, 429 max_length: None, 430 min_graphemes: None, 431 max_graphemes: None, 432 r#enum: None, 433 r#const: None, 434 known_values: None, 435 }), 436 ); 437 map.insert( 438 ::jacquard_common::smol_str::SmolStr::new_static("bluesky"), 439 ::jacquard_lexicon::lexicon::LexObjectProperty::Boolean(::jacquard_lexicon::lexicon::LexBoolean { 440 description: None, 441 default: None, 442 r#const: None, 443 }), 444 ); 445 map.insert( 446 ::jacquard_common::smol_str::SmolStr::new_static( 447 "createdAt", 448 ), 449 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 450 description: None, 451 format: Some( 452 ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, 453 ), 454 default: None, 455 min_length: None, 456 max_length: None, 457 min_graphemes: None, 458 max_graphemes: None, 459 r#enum: None, 460 r#const: None, 461 known_values: None, 462 }), 463 ); 464 map.insert( 465 ::jacquard_common::smol_str::SmolStr::new_static( 466 "description", 467 ), 468 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 469 description: None, 470 format: None, 471 default: None, 472 min_length: None, 473 max_length: Some(10240usize), 474 min_graphemes: None, 475 max_graphemes: Some(1024usize), 476 r#enum: None, 477 r#const: None, 478 known_values: None, 479 }), 480 ); 481 map.insert( 482 ::jacquard_common::smol_str::SmolStr::new_static("did"), 483 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 484 description: None, 485 format: Some( 486 ::jacquard_lexicon::lexicon::LexStringFormat::Did, 487 ), 488 default: None, 489 min_length: None, 490 max_length: None, 491 min_graphemes: None, 492 max_graphemes: None, 493 r#enum: None, 494 r#const: None, 495 known_values: None, 496 }), 497 ); 498 map.insert( 499 ::jacquard_common::smol_str::SmolStr::new_static( 500 "displayName", 501 ), 502 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 503 description: None, 504 format: None, 505 default: None, 506 min_length: None, 507 max_length: Some(640usize), 508 min_graphemes: None, 509 max_graphemes: Some(64usize), 510 r#enum: None, 511 r#const: None, 512 known_values: None, 513 }), 514 ); 515 map.insert( 516 ::jacquard_common::smol_str::SmolStr::new_static("handle"), 517 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 518 description: None, 519 format: Some( 520 ::jacquard_lexicon::lexicon::LexStringFormat::Handle, 521 ), 522 default: None, 523 min_length: None, 524 max_length: None, 525 min_graphemes: None, 526 max_graphemes: None, 527 r#enum: None, 528 r#const: None, 529 known_values: None, 530 }), 531 ); 532 map.insert( 533 ::jacquard_common::smol_str::SmolStr::new_static( 534 "indexedAt", 535 ), 536 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 537 description: None, 538 format: Some( 539 ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, 540 ), 541 default: None, 542 min_length: None, 543 max_length: None, 544 min_graphemes: None, 545 max_graphemes: None, 546 r#enum: None, 547 r#const: None, 548 known_values: None, 549 }), 550 ); 551 map.insert( 552 ::jacquard_common::smol_str::SmolStr::new_static("labels"), 553 ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { 554 description: None, 555 items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef { 556 description: None, 557 r#ref: ::jacquard_common::CowStr::new_static( 558 "com.atproto.label.defs#label", 559 ), 560 }), 561 min_length: None, 562 max_length: None, 563 }), 564 ); 565 map.insert( 566 ::jacquard_common::smol_str::SmolStr::new_static("links"), 567 ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { 568 description: None, 569 items: ::jacquard_lexicon::lexicon::LexArrayItem::String(::jacquard_lexicon::lexicon::LexString { 570 description: Some( 571 ::jacquard_common::CowStr::new_static( 572 "Any URI, intended for social profiles or websites, can be used to link DIDs/AT-URIs too.", 573 ), 574 ), 575 format: Some( 576 ::jacquard_lexicon::lexicon::LexStringFormat::Uri, 577 ), 578 default: None, 579 min_length: None, 580 max_length: None, 581 min_graphemes: None, 582 max_graphemes: None, 583 r#enum: None, 584 r#const: None, 585 known_values: None, 586 }), 587 min_length: Some(0usize), 588 max_length: Some(5usize), 589 }), 590 ); 591 map.insert( 592 ::jacquard_common::smol_str::SmolStr::new_static("location"), 593 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 594 description: Some( 595 ::jacquard_common::CowStr::new_static( 596 "Free-form location text.", 597 ), 598 ), 599 format: None, 600 default: None, 601 min_length: None, 602 max_length: Some(400usize), 603 min_graphemes: None, 604 max_graphemes: Some(40usize), 605 r#enum: None, 606 r#const: None, 607 known_values: None, 608 }), 609 ); 610 map.insert( 611 ::jacquard_common::smol_str::SmolStr::new_static("pinned"), 612 ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { 613 description: None, 614 r#ref: ::jacquard_common::CowStr::new_static("#pinnedList"), 615 }), 616 ); 617 map.insert( 618 ::jacquard_common::smol_str::SmolStr::new_static("pronouns"), 619 ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { 620 description: None, 621 r#ref: ::jacquard_common::CowStr::new_static( 622 "#pronounsList", 623 ), 624 }), 625 ); 626 map.insert( 627 ::jacquard_common::smol_str::SmolStr::new_static( 628 "streamplace", 629 ), 630 ::jacquard_lexicon::lexicon::LexObjectProperty::Boolean(::jacquard_lexicon::lexicon::LexBoolean { 631 description: None, 632 default: None, 633 r#const: None, 634 }), 635 ); 636 map.insert( 637 ::jacquard_common::smol_str::SmolStr::new_static( 638 "subscribedCount", 639 ), 640 ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { 641 description: None, 642 default: None, 643 minimum: None, 644 maximum: None, 645 r#enum: None, 646 r#const: None, 647 }), 648 ); 649 map.insert( 650 ::jacquard_common::smol_str::SmolStr::new_static( 651 "subscriberCount", 652 ), 653 ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { 654 description: None, 655 default: None, 656 minimum: None, 657 maximum: None, 658 r#enum: None, 659 r#const: None, 660 }), 661 ); 662 map.insert( 663 ::jacquard_common::smol_str::SmolStr::new_static("tangled"), 664 ::jacquard_lexicon::lexicon::LexObjectProperty::Boolean(::jacquard_lexicon::lexicon::LexBoolean { 665 description: None, 666 default: None, 667 r#const: None, 668 }), 669 ); 670 map 671 }, 672 }), 673 ); 674 map.insert( 675 ::jacquard_common::smol_str::SmolStr::new_static("profileViewBasic"), 676 ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { 677 description: None, 678 required: Some( 679 vec![ 680 ::jacquard_common::smol_str::SmolStr::new_static("did"), 681 ::jacquard_common::smol_str::SmolStr::new_static("handle") 682 ], 683 ), 684 nullable: None, 685 properties: { 686 #[allow(unused_mut)] 687 let mut map = ::alloc::collections::BTreeMap::new(); 688 map.insert( 689 ::jacquard_common::smol_str::SmolStr::new_static("avatar"), 690 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 691 description: None, 692 format: Some( 693 ::jacquard_lexicon::lexicon::LexStringFormat::Uri, 694 ), 695 default: None, 696 min_length: None, 697 max_length: None, 698 min_graphemes: None, 699 max_graphemes: None, 700 r#enum: None, 701 r#const: None, 702 known_values: None, 703 }), 704 ); 705 map.insert( 706 ::jacquard_common::smol_str::SmolStr::new_static( 707 "createdAt", 708 ), 709 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 710 description: None, 711 format: Some( 712 ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, 713 ), 714 default: None, 715 min_length: None, 716 max_length: None, 717 min_graphemes: None, 718 max_graphemes: None, 719 r#enum: None, 720 r#const: None, 721 known_values: None, 722 }), 723 ); 724 map.insert( 725 ::jacquard_common::smol_str::SmolStr::new_static("did"), 726 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 727 description: None, 728 format: Some( 729 ::jacquard_lexicon::lexicon::LexStringFormat::Did, 730 ), 731 default: None, 732 min_length: None, 733 max_length: None, 734 min_graphemes: None, 735 max_graphemes: None, 736 r#enum: None, 737 r#const: None, 738 known_values: None, 739 }), 740 ); 741 map.insert( 742 ::jacquard_common::smol_str::SmolStr::new_static( 743 "displayName", 744 ), 745 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 746 description: None, 747 format: None, 748 default: None, 749 min_length: None, 750 max_length: Some(640usize), 751 min_graphemes: None, 752 max_graphemes: Some(64usize), 753 r#enum: None, 754 r#const: None, 755 known_values: None, 756 }), 757 ); 758 map.insert( 759 ::jacquard_common::smol_str::SmolStr::new_static("handle"), 760 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 761 description: None, 762 format: Some( 763 ::jacquard_lexicon::lexicon::LexStringFormat::Handle, 764 ), 765 default: None, 766 min_length: None, 767 max_length: None, 768 min_graphemes: None, 769 max_graphemes: None, 770 r#enum: None, 771 r#const: None, 772 known_values: None, 773 }), 774 ); 775 map.insert( 776 ::jacquard_common::smol_str::SmolStr::new_static( 777 "indexedAt", 778 ), 779 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 780 description: None, 781 format: Some( 782 ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, 783 ), 784 default: None, 785 min_length: None, 786 max_length: None, 787 min_graphemes: None, 788 max_graphemes: None, 789 r#enum: None, 790 r#const: None, 791 known_values: None, 792 }), 793 ); 794 map.insert( 795 ::jacquard_common::smol_str::SmolStr::new_static("labels"), 796 ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { 797 description: None, 798 items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef { 799 description: None, 800 r#ref: ::jacquard_common::CowStr::new_static( 801 "com.atproto.label.defs#label", 802 ), 803 }), 804 min_length: None, 805 max_length: None, 806 }), 807 ); 808 map.insert( 809 ::jacquard_common::smol_str::SmolStr::new_static("pronouns"), 810 ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { 811 description: None, 812 r#ref: ::jacquard_common::CowStr::new_static( 813 "#pronounsList", 814 ), 815 }), 816 ); 817 map 818 }, 819 }), 820 ); 821 map.insert( 822 ::jacquard_common::smol_str::SmolStr::new_static("pronounsList"), 823 ::jacquard_lexicon::lexicon::LexUserType::Array(::jacquard_lexicon::lexicon::LexArray { 824 description: None, 825 items: ::jacquard_lexicon::lexicon::LexArrayItem::String(::jacquard_lexicon::lexicon::LexString { 826 description: None, 827 format: None, 828 default: None, 829 min_length: None, 830 max_length: Some(500usize), 831 min_graphemes: None, 832 max_graphemes: Some(50usize), 833 r#enum: None, 834 r#const: None, 835 known_values: None, 836 }), 837 min_length: None, 838 max_length: Some(5usize), 839 }), 840 ); 841 map.insert( 842 ::jacquard_common::smol_str::SmolStr::new_static("subscribedNotebook"), 843 ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { 844 description: Some( 845 ::jacquard_common::CowStr::new_static( 846 "A notebook the viewer subscribes to without a global follow.", 847 ), 848 ), 849 required: Some( 850 vec![::jacquard_common::smol_str::SmolStr::new_static("uri")], 851 ), 852 nullable: None, 853 properties: { 854 #[allow(unused_mut)] 855 let mut map = ::alloc::collections::BTreeMap::new(); 856 map.insert( 857 ::jacquard_common::smol_str::SmolStr::new_static("path"), 858 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 859 description: None, 860 format: None, 861 default: None, 862 min_length: None, 863 max_length: None, 864 min_graphemes: None, 865 max_graphemes: None, 866 r#enum: None, 867 r#const: None, 868 known_values: None, 869 }), 870 ); 871 map.insert( 872 ::jacquard_common::smol_str::SmolStr::new_static("title"), 873 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 874 description: None, 875 format: None, 876 default: None, 877 min_length: None, 878 max_length: None, 879 min_graphemes: None, 880 max_graphemes: None, 881 r#enum: None, 882 r#const: None, 883 known_values: None, 884 }), 885 ); 886 map.insert( 887 ::jacquard_common::smol_str::SmolStr::new_static("uri"), 888 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 889 description: None, 890 format: Some( 891 ::jacquard_lexicon::lexicon::LexStringFormat::AtUri, 892 ), 893 default: None, 894 min_length: None, 895 max_length: None, 896 min_graphemes: None, 897 max_graphemes: None, 898 r#enum: None, 899 r#const: None, 900 known_values: None, 901 }), 902 ); 903 map 904 }, 905 }), 906 ); 907 map.insert( 908 ::jacquard_common::smol_str::SmolStr::new_static("tangledProfileView"), 909 ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { 910 description: None, 911 required: Some( 912 vec![ 913 ::jacquard_common::smol_str::SmolStr::new_static("bluesky"), 914 ::jacquard_common::smol_str::SmolStr::new_static("did"), 915 ::jacquard_common::smol_str::SmolStr::new_static("handle") 916 ], 917 ), 918 nullable: None, 919 properties: { 920 #[allow(unused_mut)] 921 let mut map = ::alloc::collections::BTreeMap::new(); 922 map.insert( 923 ::jacquard_common::smol_str::SmolStr::new_static("bluesky"), 924 ::jacquard_lexicon::lexicon::LexObjectProperty::Boolean(::jacquard_lexicon::lexicon::LexBoolean { 925 description: None, 926 default: None, 927 r#const: None, 928 }), 929 ); 930 map.insert( 931 ::jacquard_common::smol_str::SmolStr::new_static( 932 "description", 933 ), 934 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 935 description: Some( 936 ::jacquard_common::CowStr::new_static( 937 "Free-form profile description text.", 938 ), 939 ), 940 format: None, 941 default: None, 942 min_length: None, 943 max_length: Some(2560usize), 944 min_graphemes: None, 945 max_graphemes: Some(256usize), 946 r#enum: None, 947 r#const: None, 948 known_values: None, 949 }), 950 ); 951 map.insert( 952 ::jacquard_common::smol_str::SmolStr::new_static("did"), 953 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 954 description: None, 955 format: Some( 956 ::jacquard_lexicon::lexicon::LexStringFormat::Did, 957 ), 958 default: None, 959 min_length: None, 960 max_length: None, 961 min_graphemes: None, 962 max_graphemes: None, 963 r#enum: None, 964 r#const: None, 965 known_values: None, 966 }), 967 ); 968 map.insert( 969 ::jacquard_common::smol_str::SmolStr::new_static("handle"), 970 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 971 description: None, 972 format: Some( 973 ::jacquard_lexicon::lexicon::LexStringFormat::Handle, 974 ), 975 default: None, 976 min_length: None, 977 max_length: None, 978 min_graphemes: None, 979 max_graphemes: None, 980 r#enum: None, 981 r#const: None, 982 known_values: None, 983 }), 984 ); 985 map.insert( 986 ::jacquard_common::smol_str::SmolStr::new_static("links"), 987 ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { 988 description: None, 989 items: ::jacquard_lexicon::lexicon::LexArrayItem::String(::jacquard_lexicon::lexicon::LexString { 990 description: Some( 991 ::jacquard_common::CowStr::new_static( 992 "Any URI, intended for social profiles or websites, can be used to link DIDs/AT-URIs too.", 993 ), 994 ), 995 format: Some( 996 ::jacquard_lexicon::lexicon::LexStringFormat::Uri, 997 ), 998 default: None, 999 min_length: None, 1000 max_length: None, 1001 min_graphemes: None, 1002 max_graphemes: None, 1003 r#enum: None, 1004 r#const: None, 1005 known_values: None, 1006 }), 1007 min_length: Some(0usize), 1008 max_length: Some(5usize), 1009 }), 1010 ); 1011 map.insert( 1012 ::jacquard_common::smol_str::SmolStr::new_static("location"), 1013 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 1014 description: Some( 1015 ::jacquard_common::CowStr::new_static( 1016 "Free-form location text.", 1017 ), 1018 ), 1019 format: None, 1020 default: None, 1021 min_length: None, 1022 max_length: Some(400usize), 1023 min_graphemes: None, 1024 max_graphemes: Some(40usize), 1025 r#enum: None, 1026 r#const: None, 1027 known_values: None, 1028 }), 1029 ); 1030 map.insert( 1031 ::jacquard_common::smol_str::SmolStr::new_static( 1032 "pinnedRepositories", 1033 ), 1034 ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { 1035 description: Some( 1036 ::jacquard_common::CowStr::new_static( 1037 "Any ATURI, it is up to appviews to validate these fields.", 1038 ), 1039 ), 1040 items: ::jacquard_lexicon::lexicon::LexArrayItem::String(::jacquard_lexicon::lexicon::LexString { 1041 description: None, 1042 format: Some( 1043 ::jacquard_lexicon::lexicon::LexStringFormat::AtUri, 1044 ), 1045 default: None, 1046 min_length: None, 1047 max_length: None, 1048 min_graphemes: None, 1049 max_graphemes: None, 1050 r#enum: None, 1051 r#const: None, 1052 known_values: None, 1053 }), 1054 min_length: Some(0usize), 1055 max_length: Some(6usize), 1056 }), 1057 ); 1058 map.insert( 1059 ::jacquard_common::smol_str::SmolStr::new_static("stats"), 1060 ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { 1061 description: None, 1062 items: ::jacquard_lexicon::lexicon::LexArrayItem::String(::jacquard_lexicon::lexicon::LexString { 1063 description: Some( 1064 ::jacquard_common::CowStr::new_static("Vanity stats."), 1065 ), 1066 format: None, 1067 default: None, 1068 min_length: None, 1069 max_length: None, 1070 min_graphemes: None, 1071 max_graphemes: None, 1072 r#enum: None, 1073 r#const: None, 1074 known_values: None, 1075 }), 1076 min_length: Some(0usize), 1077 max_length: Some(2usize), 1078 }), 1079 ); 1080 map 1081 }, 1082 }), 1083 ); 1084 map.insert( 1085 ::jacquard_common::smol_str::SmolStr::new_static("viewerState"), 1086 ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { 1087 description: Some( 1088 ::jacquard_common::CowStr::new_static( 1089 "Viewer's relationship state with an actor (detailed version).", 1090 ), 1091 ), 1092 required: None, 1093 nullable: None, 1094 properties: { 1095 #[allow(unused_mut)] 1096 let mut map = ::alloc::collections::BTreeMap::new(); 1097 map.insert( 1098 ::jacquard_common::smol_str::SmolStr::new_static("blocked"), 1099 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 1100 description: None, 1101 format: Some( 1102 ::jacquard_lexicon::lexicon::LexStringFormat::AtUri, 1103 ), 1104 default: None, 1105 min_length: None, 1106 max_length: None, 1107 min_graphemes: None, 1108 max_graphemes: None, 1109 r#enum: None, 1110 r#const: None, 1111 known_values: None, 1112 }), 1113 ); 1114 map.insert( 1115 ::jacquard_common::smol_str::SmolStr::new_static( 1116 "blockedBy", 1117 ), 1118 ::jacquard_lexicon::lexicon::LexObjectProperty::Boolean(::jacquard_lexicon::lexicon::LexBoolean { 1119 description: None, 1120 default: None, 1121 r#const: None, 1122 }), 1123 ); 1124 map.insert( 1125 ::jacquard_common::smol_str::SmolStr::new_static( 1126 "followRequested", 1127 ), 1128 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 1129 description: None, 1130 format: Some( 1131 ::jacquard_lexicon::lexicon::LexStringFormat::AtUri, 1132 ), 1133 default: None, 1134 min_length: None, 1135 max_length: None, 1136 min_graphemes: None, 1137 max_graphemes: None, 1138 r#enum: None, 1139 r#const: None, 1140 known_values: None, 1141 }), 1142 ); 1143 map.insert( 1144 ::jacquard_common::smol_str::SmolStr::new_static( 1145 "followRequestedBy", 1146 ), 1147 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 1148 description: None, 1149 format: Some( 1150 ::jacquard_lexicon::lexicon::LexStringFormat::AtUri, 1151 ), 1152 default: None, 1153 min_length: None, 1154 max_length: None, 1155 min_graphemes: None, 1156 max_graphemes: None, 1157 r#enum: None, 1158 r#const: None, 1159 known_values: None, 1160 }), 1161 ); 1162 map.insert( 1163 ::jacquard_common::smol_str::SmolStr::new_static( 1164 "followedBy", 1165 ), 1166 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 1167 description: None, 1168 format: Some( 1169 ::jacquard_lexicon::lexicon::LexStringFormat::AtUri, 1170 ), 1171 default: None, 1172 min_length: None, 1173 max_length: None, 1174 min_graphemes: None, 1175 max_graphemes: None, 1176 r#enum: None, 1177 r#const: None, 1178 known_values: None, 1179 }), 1180 ); 1181 map.insert( 1182 ::jacquard_common::smol_str::SmolStr::new_static( 1183 "following", 1184 ), 1185 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 1186 description: None, 1187 format: Some( 1188 ::jacquard_lexicon::lexicon::LexStringFormat::AtUri, 1189 ), 1190 default: None, 1191 min_length: None, 1192 max_length: None, 1193 min_graphemes: None, 1194 max_graphemes: None, 1195 r#enum: None, 1196 r#const: None, 1197 known_values: None, 1198 }), 1199 ); 1200 map.insert( 1201 ::jacquard_common::smol_str::SmolStr::new_static("muted"), 1202 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 1203 description: None, 1204 format: Some( 1205 ::jacquard_lexicon::lexicon::LexStringFormat::AtUri, 1206 ), 1207 default: None, 1208 min_length: None, 1209 max_length: None, 1210 min_graphemes: None, 1211 max_graphemes: None, 1212 r#enum: None, 1213 r#const: None, 1214 known_values: None, 1215 }), 1216 ); 1217 map.insert( 1218 ::jacquard_common::smol_str::SmolStr::new_static( 1219 "subscribedNotebooks", 1220 ), 1221 ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { 1222 description: None, 1223 items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef { 1224 description: None, 1225 r#ref: ::jacquard_common::CowStr::new_static( 1226 "#subscribedNotebook", 1227 ), 1228 }), 1229 min_length: None, 1230 max_length: None, 1231 }), 1232 ); 1233 map 1234 }, 1235 }), 1236 ); 1237 map.insert( 1238 ::jacquard_common::smol_str::SmolStr::new_static("viewerStateBasic"), 1239 ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { 1240 description: Some( 1241 ::jacquard_common::CowStr::new_static( 1242 "Viewer's relationship state with an actor (basic version).", 1243 ), 1244 ), 1245 required: None, 1246 nullable: None, 1247 properties: { 1248 #[allow(unused_mut)] 1249 let mut map = ::alloc::collections::BTreeMap::new(); 1250 map.insert( 1251 ::jacquard_common::smol_str::SmolStr::new_static("blocked"), 1252 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 1253 description: None, 1254 format: Some( 1255 ::jacquard_lexicon::lexicon::LexStringFormat::AtUri, 1256 ), 1257 default: None, 1258 min_length: None, 1259 max_length: None, 1260 min_graphemes: None, 1261 max_graphemes: None, 1262 r#enum: None, 1263 r#const: None, 1264 known_values: None, 1265 }), 1266 ); 1267 map.insert( 1268 ::jacquard_common::smol_str::SmolStr::new_static( 1269 "blockedBy", 1270 ), 1271 ::jacquard_lexicon::lexicon::LexObjectProperty::Boolean(::jacquard_lexicon::lexicon::LexBoolean { 1272 description: None, 1273 default: None, 1274 r#const: None, 1275 }), 1276 ); 1277 map.insert( 1278 ::jacquard_common::smol_str::SmolStr::new_static( 1279 "followRequested", 1280 ), 1281 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 1282 description: None, 1283 format: Some( 1284 ::jacquard_lexicon::lexicon::LexStringFormat::AtUri, 1285 ), 1286 default: None, 1287 min_length: None, 1288 max_length: None, 1289 min_graphemes: None, 1290 max_graphemes: None, 1291 r#enum: None, 1292 r#const: None, 1293 known_values: None, 1294 }), 1295 ); 1296 map.insert( 1297 ::jacquard_common::smol_str::SmolStr::new_static( 1298 "followRequestedBy", 1299 ), 1300 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 1301 description: None, 1302 format: Some( 1303 ::jacquard_lexicon::lexicon::LexStringFormat::AtUri, 1304 ), 1305 default: None, 1306 min_length: None, 1307 max_length: None, 1308 min_graphemes: None, 1309 max_graphemes: None, 1310 r#enum: None, 1311 r#const: None, 1312 known_values: None, 1313 }), 1314 ); 1315 map.insert( 1316 ::jacquard_common::smol_str::SmolStr::new_static( 1317 "followedBy", 1318 ), 1319 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 1320 description: None, 1321 format: Some( 1322 ::jacquard_lexicon::lexicon::LexStringFormat::AtUri, 1323 ), 1324 default: None, 1325 min_length: None, 1326 max_length: None, 1327 min_graphemes: None, 1328 max_graphemes: None, 1329 r#enum: None, 1330 r#const: None, 1331 known_values: None, 1332 }), 1333 ); 1334 map.insert( 1335 ::jacquard_common::smol_str::SmolStr::new_static( 1336 "following", 1337 ), 1338 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 1339 description: None, 1340 format: Some( 1341 ::jacquard_lexicon::lexicon::LexStringFormat::AtUri, 1342 ), 1343 default: None, 1344 min_length: None, 1345 max_length: None, 1346 min_graphemes: None, 1347 max_graphemes: None, 1348 r#enum: None, 1349 r#const: None, 1350 known_values: None, 1351 }), 1352 ); 1353 map.insert( 1354 ::jacquard_common::smol_str::SmolStr::new_static("muted"), 1355 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 1356 description: None, 1357 format: Some( 1358 ::jacquard_lexicon::lexicon::LexStringFormat::AtUri, 1359 ), 1360 default: None, 1361 min_length: None, 1362 max_length: None, 1363 min_graphemes: None, 1364 max_graphemes: None, 1365 r#enum: None, 1366 r#const: None, 1367 known_values: None, 1368 }), 1369 ); 1370 map.insert( 1371 ::jacquard_common::smol_str::SmolStr::new_static( 1372 "subscribedNotebookCount", 1373 ), 1374 ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { 1375 description: None, 1376 default: None, 1377 minimum: None, 1378 maximum: None, 1379 r#enum: None, 1380 r#const: None, 1381 }), 1382 ); 1383 map 1384 }, 1385 }), 1386 ); 1387 map 1388 }, 1389 } 1390} 1391 1392impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Author<'a> { 1393 fn nsid() -> &'static str { 1394 "sh.weaver.actor.defs" 1395 } 1396 fn def_name() -> &'static str { 1397 "author" 1398 } 1399 fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 1400 lexicon_doc_sh_weaver_actor_defs() 1401 } 1402 fn validate( 1403 &self, 1404 ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { 1405 Ok(()) 1406 } 1407} 1408 1409pub type PinnedList<'a> = Vec<crate::com_atproto::repo::strong_ref::StrongRef<'a>>; 1410#[jacquard_derive::lexicon] 1411#[derive( 1412 serde::Serialize, 1413 serde::Deserialize, 1414 Debug, 1415 Clone, 1416 PartialEq, 1417 Eq, 1418 jacquard_derive::IntoStatic 1419)] 1420#[serde(rename_all = "camelCase")] 1421pub struct ProfileDataView<'a> { 1422 #[serde(skip_serializing_if = "std::option::Option::is_none")] 1423 pub collaboration_count: std::option::Option<i64>, 1424 #[serde(skip_serializing_if = "std::option::Option::is_none")] 1425 pub entry_count: std::option::Option<i64>, 1426 #[serde(skip_serializing_if = "std::option::Option::is_none")] 1427 pub follower_count: std::option::Option<i64>, 1428 #[serde(skip_serializing_if = "std::option::Option::is_none")] 1429 pub following_count: std::option::Option<i64>, 1430 #[serde(borrow)] 1431 pub inner: ProfileDataViewInner<'a>, 1432 #[serde(skip_serializing_if = "std::option::Option::is_none")] 1433 pub notebook_count: std::option::Option<i64>, 1434 #[serde(skip_serializing_if = "std::option::Option::is_none")] 1435 #[serde(borrow)] 1436 pub viewer: std::option::Option<crate::sh_weaver::actor::ViewerState<'a>>, 1437} 1438 1439pub mod profile_data_view_state { 1440 1441 pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; 1442 #[allow(unused)] 1443 use ::core::marker::PhantomData; 1444 mod sealed { 1445 pub trait Sealed {} 1446 } 1447 /// State trait tracking which required fields have been set 1448 pub trait State: sealed::Sealed { 1449 type Inner; 1450 } 1451 /// Empty state - all required fields are unset 1452 pub struct Empty(()); 1453 impl sealed::Sealed for Empty {} 1454 impl State for Empty { 1455 type Inner = Unset; 1456 } 1457 ///State transition - sets the `inner` field to Set 1458 pub struct SetInner<S: State = Empty>(PhantomData<fn() -> S>); 1459 impl<S: State> sealed::Sealed for SetInner<S> {} 1460 impl<S: State> State for SetInner<S> { 1461 type Inner = Set<members::inner>; 1462 } 1463 /// Marker types for field names 1464 #[allow(non_camel_case_types)] 1465 pub mod members { 1466 ///Marker type for the `inner` field 1467 pub struct inner(()); 1468 } 1469} 1470 1471/// Builder for constructing an instance of this type 1472pub struct ProfileDataViewBuilder<'a, S: profile_data_view_state::State> { 1473 _phantom_state: ::core::marker::PhantomData<fn() -> S>, 1474 __unsafe_private_named: ( 1475 ::core::option::Option<i64>, 1476 ::core::option::Option<i64>, 1477 ::core::option::Option<i64>, 1478 ::core::option::Option<i64>, 1479 ::core::option::Option<ProfileDataViewInner<'a>>, 1480 ::core::option::Option<i64>, 1481 ::core::option::Option<crate::sh_weaver::actor::ViewerState<'a>>, 1482 ), 1483 _phantom: ::core::marker::PhantomData<&'a ()>, 1484} 1485 1486impl<'a> ProfileDataView<'a> { 1487 /// Create a new builder for this type 1488 pub fn new() -> ProfileDataViewBuilder<'a, profile_data_view_state::Empty> { 1489 ProfileDataViewBuilder::new() 1490 } 1491} 1492 1493impl<'a> ProfileDataViewBuilder<'a, profile_data_view_state::Empty> { 1494 /// Create a new builder with all fields unset 1495 pub fn new() -> Self { 1496 ProfileDataViewBuilder { 1497 _phantom_state: ::core::marker::PhantomData, 1498 __unsafe_private_named: (None, None, None, None, None, None, None), 1499 _phantom: ::core::marker::PhantomData, 1500 } 1501 } 1502} 1503 1504impl<'a, S: profile_data_view_state::State> ProfileDataViewBuilder<'a, S> { 1505 /// Set the `collaborationCount` field (optional) 1506 pub fn collaboration_count(mut self, value: impl Into<Option<i64>>) -> Self { 1507 self.__unsafe_private_named.0 = value.into(); 1508 self 1509 } 1510 /// Set the `collaborationCount` field to an Option value (optional) 1511 pub fn maybe_collaboration_count(mut self, value: Option<i64>) -> Self { 1512 self.__unsafe_private_named.0 = value; 1513 self 1514 } 1515} 1516 1517impl<'a, S: profile_data_view_state::State> ProfileDataViewBuilder<'a, S> { 1518 /// Set the `entryCount` field (optional) 1519 pub fn entry_count(mut self, value: impl Into<Option<i64>>) -> Self { 1520 self.__unsafe_private_named.1 = value.into(); 1521 self 1522 } 1523 /// Set the `entryCount` field to an Option value (optional) 1524 pub fn maybe_entry_count(mut self, value: Option<i64>) -> Self { 1525 self.__unsafe_private_named.1 = value; 1526 self 1527 } 1528} 1529 1530impl<'a, S: profile_data_view_state::State> ProfileDataViewBuilder<'a, S> { 1531 /// Set the `followerCount` field (optional) 1532 pub fn follower_count(mut self, value: impl Into<Option<i64>>) -> Self { 1533 self.__unsafe_private_named.2 = value.into(); 1534 self 1535 } 1536 /// Set the `followerCount` field to an Option value (optional) 1537 pub fn maybe_follower_count(mut self, value: Option<i64>) -> Self { 1538 self.__unsafe_private_named.2 = value; 1539 self 1540 } 1541} 1542 1543impl<'a, S: profile_data_view_state::State> ProfileDataViewBuilder<'a, S> { 1544 /// Set the `followingCount` field (optional) 1545 pub fn following_count(mut self, value: impl Into<Option<i64>>) -> Self { 1546 self.__unsafe_private_named.3 = value.into(); 1547 self 1548 } 1549 /// Set the `followingCount` field to an Option value (optional) 1550 pub fn maybe_following_count(mut self, value: Option<i64>) -> Self { 1551 self.__unsafe_private_named.3 = value; 1552 self 1553 } 1554} 1555 1556impl<'a, S> ProfileDataViewBuilder<'a, S> 1557where 1558 S: profile_data_view_state::State, 1559 S::Inner: profile_data_view_state::IsUnset, 1560{ 1561 /// Set the `inner` field (required) 1562 pub fn inner( 1563 mut self, 1564 value: impl Into<ProfileDataViewInner<'a>>, 1565 ) -> ProfileDataViewBuilder<'a, profile_data_view_state::SetInner<S>> { 1566 self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into()); 1567 ProfileDataViewBuilder { 1568 _phantom_state: ::core::marker::PhantomData, 1569 __unsafe_private_named: self.__unsafe_private_named, 1570 _phantom: ::core::marker::PhantomData, 1571 } 1572 } 1573} 1574 1575impl<'a, S: profile_data_view_state::State> ProfileDataViewBuilder<'a, S> { 1576 /// Set the `notebookCount` field (optional) 1577 pub fn notebook_count(mut self, value: impl Into<Option<i64>>) -> Self { 1578 self.__unsafe_private_named.5 = value.into(); 1579 self 1580 } 1581 /// Set the `notebookCount` field to an Option value (optional) 1582 pub fn maybe_notebook_count(mut self, value: Option<i64>) -> Self { 1583 self.__unsafe_private_named.5 = value; 1584 self 1585 } 1586} 1587 1588impl<'a, S: profile_data_view_state::State> ProfileDataViewBuilder<'a, S> { 1589 /// Set the `viewer` field (optional) 1590 pub fn viewer( 1591 mut self, 1592 value: impl Into<Option<crate::sh_weaver::actor::ViewerState<'a>>>, 1593 ) -> Self { 1594 self.__unsafe_private_named.6 = value.into(); 1595 self 1596 } 1597 /// Set the `viewer` field to an Option value (optional) 1598 pub fn maybe_viewer( 1599 mut self, 1600 value: Option<crate::sh_weaver::actor::ViewerState<'a>>, 1601 ) -> Self { 1602 self.__unsafe_private_named.6 = value; 1603 self 1604 } 1605} 1606 1607impl<'a, S> ProfileDataViewBuilder<'a, S> 1608where 1609 S: profile_data_view_state::State, 1610 S::Inner: profile_data_view_state::IsSet, 1611{ 1612 /// Build the final struct 1613 pub fn build(self) -> ProfileDataView<'a> { 1614 ProfileDataView { 1615 collaboration_count: self.__unsafe_private_named.0, 1616 entry_count: self.__unsafe_private_named.1, 1617 follower_count: self.__unsafe_private_named.2, 1618 following_count: self.__unsafe_private_named.3, 1619 inner: self.__unsafe_private_named.4.unwrap(), 1620 notebook_count: self.__unsafe_private_named.5, 1621 viewer: self.__unsafe_private_named.6, 1622 extra_data: Default::default(), 1623 } 1624 } 1625 /// Build the final struct with custom extra_data 1626 pub fn build_with_data( 1627 self, 1628 extra_data: std::collections::BTreeMap< 1629 jacquard_common::smol_str::SmolStr, 1630 jacquard_common::types::value::Data<'a>, 1631 >, 1632 ) -> ProfileDataView<'a> { 1633 ProfileDataView { 1634 collaboration_count: self.__unsafe_private_named.0, 1635 entry_count: self.__unsafe_private_named.1, 1636 follower_count: self.__unsafe_private_named.2, 1637 following_count: self.__unsafe_private_named.3, 1638 inner: self.__unsafe_private_named.4.unwrap(), 1639 notebook_count: self.__unsafe_private_named.5, 1640 viewer: self.__unsafe_private_named.6, 1641 extra_data: Some(extra_data), 1642 } 1643 } 1644} 1645 1646#[jacquard_derive::open_union] 1647#[derive( 1648 serde::Serialize, 1649 serde::Deserialize, 1650 Debug, 1651 Clone, 1652 PartialEq, 1653 Eq, 1654 jacquard_derive::IntoStatic 1655)] 1656#[serde(tag = "$type")] 1657#[serde(bound(deserialize = "'de: 'a"))] 1658pub enum ProfileDataViewInner<'a> { 1659 #[serde(rename = "sh.weaver.actor.defs#profileView")] 1660 ProfileView(Box<crate::sh_weaver::actor::ProfileView<'a>>), 1661 #[serde(rename = "app.bsky.actor.defs#profileViewDetailed")] 1662 ProfileViewDetailed(Box<crate::app_bsky::actor::ProfileViewDetailed<'a>>), 1663 #[serde(rename = "sh.weaver.actor.defs#tangledProfileView")] 1664 TangledProfileView(Box<crate::sh_weaver::actor::TangledProfileView<'a>>), 1665} 1666 1667impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ProfileDataView<'a> { 1668 fn nsid() -> &'static str { 1669 "sh.weaver.actor.defs" 1670 } 1671 fn def_name() -> &'static str { 1672 "profileDataView" 1673 } 1674 fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 1675 lexicon_doc_sh_weaver_actor_defs() 1676 } 1677 fn validate( 1678 &self, 1679 ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { 1680 Ok(()) 1681 } 1682} 1683 1684#[jacquard_derive::lexicon] 1685#[derive( 1686 serde::Serialize, 1687 serde::Deserialize, 1688 Debug, 1689 Clone, 1690 PartialEq, 1691 Eq, 1692 jacquard_derive::IntoStatic 1693)] 1694#[serde(rename_all = "camelCase")] 1695pub struct ProfileDataViewBasic<'a> { 1696 #[serde(skip_serializing_if = "std::option::Option::is_none")] 1697 pub follower_count: std::option::Option<i64>, 1698 #[serde(skip_serializing_if = "std::option::Option::is_none")] 1699 pub following_count: std::option::Option<i64>, 1700 #[serde(borrow)] 1701 pub inner: ProfileDataViewBasicInner<'a>, 1702 #[serde(skip_serializing_if = "std::option::Option::is_none")] 1703 #[serde(borrow)] 1704 pub viewer: std::option::Option<crate::sh_weaver::actor::ViewerStateBasic<'a>>, 1705} 1706 1707pub mod profile_data_view_basic_state { 1708 1709 pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; 1710 #[allow(unused)] 1711 use ::core::marker::PhantomData; 1712 mod sealed { 1713 pub trait Sealed {} 1714 } 1715 /// State trait tracking which required fields have been set 1716 pub trait State: sealed::Sealed { 1717 type Inner; 1718 } 1719 /// Empty state - all required fields are unset 1720 pub struct Empty(()); 1721 impl sealed::Sealed for Empty {} 1722 impl State for Empty { 1723 type Inner = Unset; 1724 } 1725 ///State transition - sets the `inner` field to Set 1726 pub struct SetInner<S: State = Empty>(PhantomData<fn() -> S>); 1727 impl<S: State> sealed::Sealed for SetInner<S> {} 1728 impl<S: State> State for SetInner<S> { 1729 type Inner = Set<members::inner>; 1730 } 1731 /// Marker types for field names 1732 #[allow(non_camel_case_types)] 1733 pub mod members { 1734 ///Marker type for the `inner` field 1735 pub struct inner(()); 1736 } 1737} 1738 1739/// Builder for constructing an instance of this type 1740pub struct ProfileDataViewBasicBuilder<'a, S: profile_data_view_basic_state::State> { 1741 _phantom_state: ::core::marker::PhantomData<fn() -> S>, 1742 __unsafe_private_named: ( 1743 ::core::option::Option<i64>, 1744 ::core::option::Option<i64>, 1745 ::core::option::Option<ProfileDataViewBasicInner<'a>>, 1746 ::core::option::Option<crate::sh_weaver::actor::ViewerStateBasic<'a>>, 1747 ), 1748 _phantom: ::core::marker::PhantomData<&'a ()>, 1749} 1750 1751impl<'a> ProfileDataViewBasic<'a> { 1752 /// Create a new builder for this type 1753 pub fn new() -> ProfileDataViewBasicBuilder< 1754 'a, 1755 profile_data_view_basic_state::Empty, 1756 > { 1757 ProfileDataViewBasicBuilder::new() 1758 } 1759} 1760 1761impl<'a> ProfileDataViewBasicBuilder<'a, profile_data_view_basic_state::Empty> { 1762 /// Create a new builder with all fields unset 1763 pub fn new() -> Self { 1764 ProfileDataViewBasicBuilder { 1765 _phantom_state: ::core::marker::PhantomData, 1766 __unsafe_private_named: (None, None, None, None), 1767 _phantom: ::core::marker::PhantomData, 1768 } 1769 } 1770} 1771 1772impl<'a, S: profile_data_view_basic_state::State> ProfileDataViewBasicBuilder<'a, S> { 1773 /// Set the `followerCount` field (optional) 1774 pub fn follower_count(mut self, value: impl Into<Option<i64>>) -> Self { 1775 self.__unsafe_private_named.0 = value.into(); 1776 self 1777 } 1778 /// Set the `followerCount` field to an Option value (optional) 1779 pub fn maybe_follower_count(mut self, value: Option<i64>) -> Self { 1780 self.__unsafe_private_named.0 = value; 1781 self 1782 } 1783} 1784 1785impl<'a, S: profile_data_view_basic_state::State> ProfileDataViewBasicBuilder<'a, S> { 1786 /// Set the `followingCount` field (optional) 1787 pub fn following_count(mut self, value: impl Into<Option<i64>>) -> Self { 1788 self.__unsafe_private_named.1 = value.into(); 1789 self 1790 } 1791 /// Set the `followingCount` field to an Option value (optional) 1792 pub fn maybe_following_count(mut self, value: Option<i64>) -> Self { 1793 self.__unsafe_private_named.1 = value; 1794 self 1795 } 1796} 1797 1798impl<'a, S> ProfileDataViewBasicBuilder<'a, S> 1799where 1800 S: profile_data_view_basic_state::State, 1801 S::Inner: profile_data_view_basic_state::IsUnset, 1802{ 1803 /// Set the `inner` field (required) 1804 pub fn inner( 1805 mut self, 1806 value: impl Into<ProfileDataViewBasicInner<'a>>, 1807 ) -> ProfileDataViewBasicBuilder<'a, profile_data_view_basic_state::SetInner<S>> { 1808 self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); 1809 ProfileDataViewBasicBuilder { 1810 _phantom_state: ::core::marker::PhantomData, 1811 __unsafe_private_named: self.__unsafe_private_named, 1812 _phantom: ::core::marker::PhantomData, 1813 } 1814 } 1815} 1816 1817impl<'a, S: profile_data_view_basic_state::State> ProfileDataViewBasicBuilder<'a, S> { 1818 /// Set the `viewer` field (optional) 1819 pub fn viewer( 1820 mut self, 1821 value: impl Into<Option<crate::sh_weaver::actor::ViewerStateBasic<'a>>>, 1822 ) -> Self { 1823 self.__unsafe_private_named.3 = value.into(); 1824 self 1825 } 1826 /// Set the `viewer` field to an Option value (optional) 1827 pub fn maybe_viewer( 1828 mut self, 1829 value: Option<crate::sh_weaver::actor::ViewerStateBasic<'a>>, 1830 ) -> Self { 1831 self.__unsafe_private_named.3 = value; 1832 self 1833 } 1834} 1835 1836impl<'a, S> ProfileDataViewBasicBuilder<'a, S> 1837where 1838 S: profile_data_view_basic_state::State, 1839 S::Inner: profile_data_view_basic_state::IsSet, 1840{ 1841 /// Build the final struct 1842 pub fn build(self) -> ProfileDataViewBasic<'a> { 1843 ProfileDataViewBasic { 1844 follower_count: self.__unsafe_private_named.0, 1845 following_count: self.__unsafe_private_named.1, 1846 inner: self.__unsafe_private_named.2.unwrap(), 1847 viewer: self.__unsafe_private_named.3, 1848 extra_data: Default::default(), 1849 } 1850 } 1851 /// Build the final struct with custom extra_data 1852 pub fn build_with_data( 1853 self, 1854 extra_data: std::collections::BTreeMap< 1855 jacquard_common::smol_str::SmolStr, 1856 jacquard_common::types::value::Data<'a>, 1857 >, 1858 ) -> ProfileDataViewBasic<'a> { 1859 ProfileDataViewBasic { 1860 follower_count: self.__unsafe_private_named.0, 1861 following_count: self.__unsafe_private_named.1, 1862 inner: self.__unsafe_private_named.2.unwrap(), 1863 viewer: self.__unsafe_private_named.3, 1864 extra_data: Some(extra_data), 1865 } 1866 } 1867} 1868 1869#[jacquard_derive::open_union] 1870#[derive( 1871 serde::Serialize, 1872 serde::Deserialize, 1873 Debug, 1874 Clone, 1875 PartialEq, 1876 Eq, 1877 jacquard_derive::IntoStatic 1878)] 1879#[serde(tag = "$type")] 1880#[serde(bound(deserialize = "'de: 'a"))] 1881pub enum ProfileDataViewBasicInner<'a> { 1882 #[serde(rename = "sh.weaver.actor.defs#profileViewBasic")] 1883 ProfileViewBasic(Box<crate::sh_weaver::actor::ProfileViewBasic<'a>>), 1884 #[serde(rename = "app.bsky.actor.defs#profileViewBasic")] 1885 BskyProfileViewBasic(Box<crate::app_bsky::actor::ProfileViewBasic<'a>>), 1886 #[serde(rename = "sh.weaver.actor.defs#tangledProfileView")] 1887 TangledProfileView(Box<crate::sh_weaver::actor::TangledProfileView<'a>>), 1888} 1889 1890impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ProfileDataViewBasic<'a> { 1891 fn nsid() -> &'static str { 1892 "sh.weaver.actor.defs" 1893 } 1894 fn def_name() -> &'static str { 1895 "profileDataViewBasic" 1896 } 1897 fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 1898 lexicon_doc_sh_weaver_actor_defs() 1899 } 1900 fn validate( 1901 &self, 1902 ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { 1903 Ok(()) 1904 } 1905} 1906 1907#[jacquard_derive::lexicon] 1908#[derive( 1909 serde::Serialize, 1910 serde::Deserialize, 1911 Debug, 1912 Clone, 1913 PartialEq, 1914 Eq, 1915 jacquard_derive::IntoStatic 1916)] 1917#[serde(rename_all = "camelCase")] 1918pub struct ProfileView<'a> { 1919 #[serde(skip_serializing_if = "std::option::Option::is_none")] 1920 #[serde(borrow)] 1921 pub avatar: std::option::Option<jacquard_common::types::string::Uri<'a>>, 1922 #[serde(skip_serializing_if = "std::option::Option::is_none")] 1923 #[serde(borrow)] 1924 pub banner: std::option::Option<jacquard_common::types::string::Uri<'a>>, 1925 /// Include link to this account on Bluesky. 1926 #[serde(skip_serializing_if = "std::option::Option::is_none")] 1927 pub bluesky: std::option::Option<bool>, 1928 #[serde(skip_serializing_if = "std::option::Option::is_none")] 1929 pub created_at: std::option::Option<jacquard_common::types::string::Datetime>, 1930 #[serde(skip_serializing_if = "std::option::Option::is_none")] 1931 #[serde(borrow)] 1932 pub description: std::option::Option<jacquard_common::CowStr<'a>>, 1933 #[serde(borrow)] 1934 pub did: jacquard_common::types::string::Did<'a>, 1935 #[serde(skip_serializing_if = "std::option::Option::is_none")] 1936 #[serde(borrow)] 1937 pub display_name: std::option::Option<jacquard_common::CowStr<'a>>, 1938 #[serde(borrow)] 1939 pub handle: jacquard_common::types::string::Handle<'a>, 1940 #[serde(skip_serializing_if = "std::option::Option::is_none")] 1941 pub indexed_at: std::option::Option<jacquard_common::types::string::Datetime>, 1942 #[serde(skip_serializing_if = "std::option::Option::is_none")] 1943 #[serde(borrow)] 1944 pub labels: std::option::Option<Vec<crate::com_atproto::label::Label<'a>>>, 1945 #[serde(skip_serializing_if = "std::option::Option::is_none")] 1946 #[serde(borrow)] 1947 pub links: std::option::Option<Vec<jacquard_common::types::string::Uri<'a>>>, 1948 /// Free-form location text. 1949 #[serde(skip_serializing_if = "std::option::Option::is_none")] 1950 #[serde(borrow)] 1951 pub location: std::option::Option<jacquard_common::CowStr<'a>>, 1952 /// Notebooks or other records pinned for display. 1953 #[serde(skip_serializing_if = "std::option::Option::is_none")] 1954 #[serde(borrow)] 1955 pub pinned: std::option::Option<crate::sh_weaver::actor::PinnedList<'a>>, 1956 /// Pronouns to use in user-generated content. 1957 #[serde(skip_serializing_if = "std::option::Option::is_none")] 1958 #[serde(borrow)] 1959 pub pronouns: std::option::Option<crate::sh_weaver::actor::PronounsList<'a>>, 1960 /// Include link to this account on stream.place. 1961 #[serde(skip_serializing_if = "std::option::Option::is_none")] 1962 pub streamplace: std::option::Option<bool>, 1963 #[serde(skip_serializing_if = "std::option::Option::is_none")] 1964 pub subscribed_count: std::option::Option<i64>, 1965 #[serde(skip_serializing_if = "std::option::Option::is_none")] 1966 pub subscriber_count: std::option::Option<i64>, 1967 /// Include link to this account on Tangled. 1968 #[serde(skip_serializing_if = "std::option::Option::is_none")] 1969 pub tangled: std::option::Option<bool>, 1970} 1971 1972pub mod profile_view_state { 1973 1974 pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; 1975 #[allow(unused)] 1976 use ::core::marker::PhantomData; 1977 mod sealed { 1978 pub trait Sealed {} 1979 } 1980 /// State trait tracking which required fields have been set 1981 pub trait State: sealed::Sealed { 1982 type Did; 1983 type Handle; 1984 } 1985 /// Empty state - all required fields are unset 1986 pub struct Empty(()); 1987 impl sealed::Sealed for Empty {} 1988 impl State for Empty { 1989 type Did = Unset; 1990 type Handle = Unset; 1991 } 1992 ///State transition - sets the `did` field to Set 1993 pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 1994 impl<S: State> sealed::Sealed for SetDid<S> {} 1995 impl<S: State> State for SetDid<S> { 1996 type Did = Set<members::did>; 1997 type Handle = S::Handle; 1998 } 1999 ///State transition - sets the `handle` field to Set 2000 pub struct SetHandle<S: State = Empty>(PhantomData<fn() -> S>); 2001 impl<S: State> sealed::Sealed for SetHandle<S> {} 2002 impl<S: State> State for SetHandle<S> { 2003 type Did = S::Did; 2004 type Handle = Set<members::handle>; 2005 } 2006 /// Marker types for field names 2007 #[allow(non_camel_case_types)] 2008 pub mod members { 2009 ///Marker type for the `did` field 2010 pub struct did(()); 2011 ///Marker type for the `handle` field 2012 pub struct handle(()); 2013 } 2014} 2015 2016/// Builder for constructing an instance of this type 2017pub struct ProfileViewBuilder<'a, S: profile_view_state::State> { 2018 _phantom_state: ::core::marker::PhantomData<fn() -> S>, 2019 __unsafe_private_named: ( 2020 ::core::option::Option<jacquard_common::types::string::Uri<'a>>, 2021 ::core::option::Option<jacquard_common::types::string::Uri<'a>>, 2022 ::core::option::Option<bool>, 2023 ::core::option::Option<jacquard_common::types::string::Datetime>, 2024 ::core::option::Option<jacquard_common::CowStr<'a>>, 2025 ::core::option::Option<jacquard_common::types::string::Did<'a>>, 2026 ::core::option::Option<jacquard_common::CowStr<'a>>, 2027 ::core::option::Option<jacquard_common::types::string::Handle<'a>>, 2028 ::core::option::Option<jacquard_common::types::string::Datetime>, 2029 ::core::option::Option<Vec<crate::com_atproto::label::Label<'a>>>, 2030 ::core::option::Option<Vec<jacquard_common::types::string::Uri<'a>>>, 2031 ::core::option::Option<jacquard_common::CowStr<'a>>, 2032 ::core::option::Option<crate::sh_weaver::actor::PinnedList<'a>>, 2033 ::core::option::Option<crate::sh_weaver::actor::PronounsList<'a>>, 2034 ::core::option::Option<bool>, 2035 ::core::option::Option<i64>, 2036 ::core::option::Option<i64>, 2037 ::core::option::Option<bool>, 2038 ), 2039 _phantom: ::core::marker::PhantomData<&'a ()>, 2040} 2041 2042impl<'a> ProfileView<'a> { 2043 /// Create a new builder for this type 2044 pub fn new() -> ProfileViewBuilder<'a, profile_view_state::Empty> { 2045 ProfileViewBuilder::new() 2046 } 2047} 2048 2049impl<'a> ProfileViewBuilder<'a, profile_view_state::Empty> { 2050 /// Create a new builder with all fields unset 2051 pub fn new() -> Self { 2052 ProfileViewBuilder { 2053 _phantom_state: ::core::marker::PhantomData, 2054 __unsafe_private_named: ( 2055 None, 2056 None, 2057 None, 2058 None, 2059 None, 2060 None, 2061 None, 2062 None, 2063 None, 2064 None, 2065 None, 2066 None, 2067 None, 2068 None, 2069 None, 2070 None, 2071 None, 2072 None, 2073 ), 2074 _phantom: ::core::marker::PhantomData, 2075 } 2076 } 2077} 2078 2079impl<'a, S: profile_view_state::State> ProfileViewBuilder<'a, S> { 2080 /// Set the `avatar` field (optional) 2081 pub fn avatar( 2082 mut self, 2083 value: impl Into<Option<jacquard_common::types::string::Uri<'a>>>, 2084 ) -> Self { 2085 self.__unsafe_private_named.0 = value.into(); 2086 self 2087 } 2088 /// Set the `avatar` field to an Option value (optional) 2089 pub fn maybe_avatar( 2090 mut self, 2091 value: Option<jacquard_common::types::string::Uri<'a>>, 2092 ) -> Self { 2093 self.__unsafe_private_named.0 = value; 2094 self 2095 } 2096} 2097 2098impl<'a, S: profile_view_state::State> ProfileViewBuilder<'a, S> { 2099 /// Set the `banner` field (optional) 2100 pub fn banner( 2101 mut self, 2102 value: impl Into<Option<jacquard_common::types::string::Uri<'a>>>, 2103 ) -> Self { 2104 self.__unsafe_private_named.1 = value.into(); 2105 self 2106 } 2107 /// Set the `banner` field to an Option value (optional) 2108 pub fn maybe_banner( 2109 mut self, 2110 value: Option<jacquard_common::types::string::Uri<'a>>, 2111 ) -> Self { 2112 self.__unsafe_private_named.1 = value; 2113 self 2114 } 2115} 2116 2117impl<'a, S: profile_view_state::State> ProfileViewBuilder<'a, S> { 2118 /// Set the `bluesky` field (optional) 2119 pub fn bluesky(mut self, value: impl Into<Option<bool>>) -> Self { 2120 self.__unsafe_private_named.2 = value.into(); 2121 self 2122 } 2123 /// Set the `bluesky` field to an Option value (optional) 2124 pub fn maybe_bluesky(mut self, value: Option<bool>) -> Self { 2125 self.__unsafe_private_named.2 = value; 2126 self 2127 } 2128} 2129 2130impl<'a, S: profile_view_state::State> ProfileViewBuilder<'a, S> { 2131 /// Set the `createdAt` field (optional) 2132 pub fn created_at( 2133 mut self, 2134 value: impl Into<Option<jacquard_common::types::string::Datetime>>, 2135 ) -> Self { 2136 self.__unsafe_private_named.3 = value.into(); 2137 self 2138 } 2139 /// Set the `createdAt` field to an Option value (optional) 2140 pub fn maybe_created_at( 2141 mut self, 2142 value: Option<jacquard_common::types::string::Datetime>, 2143 ) -> Self { 2144 self.__unsafe_private_named.3 = value; 2145 self 2146 } 2147} 2148 2149impl<'a, S: profile_view_state::State> ProfileViewBuilder<'a, S> { 2150 /// Set the `description` field (optional) 2151 pub fn description( 2152 mut self, 2153 value: impl Into<Option<jacquard_common::CowStr<'a>>>, 2154 ) -> Self { 2155 self.__unsafe_private_named.4 = value.into(); 2156 self 2157 } 2158 /// Set the `description` field to an Option value (optional) 2159 pub fn maybe_description( 2160 mut self, 2161 value: Option<jacquard_common::CowStr<'a>>, 2162 ) -> Self { 2163 self.__unsafe_private_named.4 = value; 2164 self 2165 } 2166} 2167 2168impl<'a, S> ProfileViewBuilder<'a, S> 2169where 2170 S: profile_view_state::State, 2171 S::Did: profile_view_state::IsUnset, 2172{ 2173 /// Set the `did` field (required) 2174 pub fn did( 2175 mut self, 2176 value: impl Into<jacquard_common::types::string::Did<'a>>, 2177 ) -> ProfileViewBuilder<'a, profile_view_state::SetDid<S>> { 2178 self.__unsafe_private_named.5 = ::core::option::Option::Some(value.into()); 2179 ProfileViewBuilder { 2180 _phantom_state: ::core::marker::PhantomData, 2181 __unsafe_private_named: self.__unsafe_private_named, 2182 _phantom: ::core::marker::PhantomData, 2183 } 2184 } 2185} 2186 2187impl<'a, S: profile_view_state::State> ProfileViewBuilder<'a, S> { 2188 /// Set the `displayName` field (optional) 2189 pub fn display_name( 2190 mut self, 2191 value: impl Into<Option<jacquard_common::CowStr<'a>>>, 2192 ) -> Self { 2193 self.__unsafe_private_named.6 = value.into(); 2194 self 2195 } 2196 /// Set the `displayName` field to an Option value (optional) 2197 pub fn maybe_display_name( 2198 mut self, 2199 value: Option<jacquard_common::CowStr<'a>>, 2200 ) -> Self { 2201 self.__unsafe_private_named.6 = value; 2202 self 2203 } 2204} 2205 2206impl<'a, S> ProfileViewBuilder<'a, S> 2207where 2208 S: profile_view_state::State, 2209 S::Handle: profile_view_state::IsUnset, 2210{ 2211 /// Set the `handle` field (required) 2212 pub fn handle( 2213 mut self, 2214 value: impl Into<jacquard_common::types::string::Handle<'a>>, 2215 ) -> ProfileViewBuilder<'a, profile_view_state::SetHandle<S>> { 2216 self.__unsafe_private_named.7 = ::core::option::Option::Some(value.into()); 2217 ProfileViewBuilder { 2218 _phantom_state: ::core::marker::PhantomData, 2219 __unsafe_private_named: self.__unsafe_private_named, 2220 _phantom: ::core::marker::PhantomData, 2221 } 2222 } 2223} 2224 2225impl<'a, S: profile_view_state::State> ProfileViewBuilder<'a, S> { 2226 /// Set the `indexedAt` field (optional) 2227 pub fn indexed_at( 2228 mut self, 2229 value: impl Into<Option<jacquard_common::types::string::Datetime>>, 2230 ) -> Self { 2231 self.__unsafe_private_named.8 = value.into(); 2232 self 2233 } 2234 /// Set the `indexedAt` field to an Option value (optional) 2235 pub fn maybe_indexed_at( 2236 mut self, 2237 value: Option<jacquard_common::types::string::Datetime>, 2238 ) -> Self { 2239 self.__unsafe_private_named.8 = value; 2240 self 2241 } 2242} 2243 2244impl<'a, S: profile_view_state::State> ProfileViewBuilder<'a, S> { 2245 /// Set the `labels` field (optional) 2246 pub fn labels( 2247 mut self, 2248 value: impl Into<Option<Vec<crate::com_atproto::label::Label<'a>>>>, 2249 ) -> Self { 2250 self.__unsafe_private_named.9 = value.into(); 2251 self 2252 } 2253 /// Set the `labels` field to an Option value (optional) 2254 pub fn maybe_labels( 2255 mut self, 2256 value: Option<Vec<crate::com_atproto::label::Label<'a>>>, 2257 ) -> Self { 2258 self.__unsafe_private_named.9 = value; 2259 self 2260 } 2261} 2262 2263impl<'a, S: profile_view_state::State> ProfileViewBuilder<'a, S> { 2264 /// Set the `links` field (optional) 2265 pub fn links( 2266 mut self, 2267 value: impl Into<Option<Vec<jacquard_common::types::string::Uri<'a>>>>, 2268 ) -> Self { 2269 self.__unsafe_private_named.10 = value.into(); 2270 self 2271 } 2272 /// Set the `links` field to an Option value (optional) 2273 pub fn maybe_links( 2274 mut self, 2275 value: Option<Vec<jacquard_common::types::string::Uri<'a>>>, 2276 ) -> Self { 2277 self.__unsafe_private_named.10 = value; 2278 self 2279 } 2280} 2281 2282impl<'a, S: profile_view_state::State> ProfileViewBuilder<'a, S> { 2283 /// Set the `location` field (optional) 2284 pub fn location( 2285 mut self, 2286 value: impl Into<Option<jacquard_common::CowStr<'a>>>, 2287 ) -> Self { 2288 self.__unsafe_private_named.11 = value.into(); 2289 self 2290 } 2291 /// Set the `location` field to an Option value (optional) 2292 pub fn maybe_location(mut self, value: Option<jacquard_common::CowStr<'a>>) -> Self { 2293 self.__unsafe_private_named.11 = value; 2294 self 2295 } 2296} 2297 2298impl<'a, S: profile_view_state::State> ProfileViewBuilder<'a, S> { 2299 /// Set the `pinned` field (optional) 2300 pub fn pinned( 2301 mut self, 2302 value: impl Into<Option<crate::sh_weaver::actor::PinnedList<'a>>>, 2303 ) -> Self { 2304 self.__unsafe_private_named.12 = value.into(); 2305 self 2306 } 2307 /// Set the `pinned` field to an Option value (optional) 2308 pub fn maybe_pinned( 2309 mut self, 2310 value: Option<crate::sh_weaver::actor::PinnedList<'a>>, 2311 ) -> Self { 2312 self.__unsafe_private_named.12 = value; 2313 self 2314 } 2315} 2316 2317impl<'a, S: profile_view_state::State> ProfileViewBuilder<'a, S> { 2318 /// Set the `pronouns` field (optional) 2319 pub fn pronouns( 2320 mut self, 2321 value: impl Into<Option<crate::sh_weaver::actor::PronounsList<'a>>>, 2322 ) -> Self { 2323 self.__unsafe_private_named.13 = value.into(); 2324 self 2325 } 2326 /// Set the `pronouns` field to an Option value (optional) 2327 pub fn maybe_pronouns( 2328 mut self, 2329 value: Option<crate::sh_weaver::actor::PronounsList<'a>>, 2330 ) -> Self { 2331 self.__unsafe_private_named.13 = value; 2332 self 2333 } 2334} 2335 2336impl<'a, S: profile_view_state::State> ProfileViewBuilder<'a, S> { 2337 /// Set the `streamplace` field (optional) 2338 pub fn streamplace(mut self, value: impl Into<Option<bool>>) -> Self { 2339 self.__unsafe_private_named.14 = value.into(); 2340 self 2341 } 2342 /// Set the `streamplace` field to an Option value (optional) 2343 pub fn maybe_streamplace(mut self, value: Option<bool>) -> Self { 2344 self.__unsafe_private_named.14 = value; 2345 self 2346 } 2347} 2348 2349impl<'a, S: profile_view_state::State> ProfileViewBuilder<'a, S> { 2350 /// Set the `subscribedCount` field (optional) 2351 pub fn subscribed_count(mut self, value: impl Into<Option<i64>>) -> Self { 2352 self.__unsafe_private_named.15 = value.into(); 2353 self 2354 } 2355 /// Set the `subscribedCount` field to an Option value (optional) 2356 pub fn maybe_subscribed_count(mut self, value: Option<i64>) -> Self { 2357 self.__unsafe_private_named.15 = value; 2358 self 2359 } 2360} 2361 2362impl<'a, S: profile_view_state::State> ProfileViewBuilder<'a, S> { 2363 /// Set the `subscriberCount` field (optional) 2364 pub fn subscriber_count(mut self, value: impl Into<Option<i64>>) -> Self { 2365 self.__unsafe_private_named.16 = value.into(); 2366 self 2367 } 2368 /// Set the `subscriberCount` field to an Option value (optional) 2369 pub fn maybe_subscriber_count(mut self, value: Option<i64>) -> Self { 2370 self.__unsafe_private_named.16 = value; 2371 self 2372 } 2373} 2374 2375impl<'a, S: profile_view_state::State> ProfileViewBuilder<'a, S> { 2376 /// Set the `tangled` field (optional) 2377 pub fn tangled(mut self, value: impl Into<Option<bool>>) -> Self { 2378 self.__unsafe_private_named.17 = value.into(); 2379 self 2380 } 2381 /// Set the `tangled` field to an Option value (optional) 2382 pub fn maybe_tangled(mut self, value: Option<bool>) -> Self { 2383 self.__unsafe_private_named.17 = value; 2384 self 2385 } 2386} 2387 2388impl<'a, S> ProfileViewBuilder<'a, S> 2389where 2390 S: profile_view_state::State, 2391 S::Did: profile_view_state::IsSet, 2392 S::Handle: profile_view_state::IsSet, 2393{ 2394 /// Build the final struct 2395 pub fn build(self) -> ProfileView<'a> { 2396 ProfileView { 2397 avatar: self.__unsafe_private_named.0, 2398 banner: self.__unsafe_private_named.1, 2399 bluesky: self.__unsafe_private_named.2, 2400 created_at: self.__unsafe_private_named.3, 2401 description: self.__unsafe_private_named.4, 2402 did: self.__unsafe_private_named.5.unwrap(), 2403 display_name: self.__unsafe_private_named.6, 2404 handle: self.__unsafe_private_named.7.unwrap(), 2405 indexed_at: self.__unsafe_private_named.8, 2406 labels: self.__unsafe_private_named.9, 2407 links: self.__unsafe_private_named.10, 2408 location: self.__unsafe_private_named.11, 2409 pinned: self.__unsafe_private_named.12, 2410 pronouns: self.__unsafe_private_named.13, 2411 streamplace: self.__unsafe_private_named.14, 2412 subscribed_count: self.__unsafe_private_named.15, 2413 subscriber_count: self.__unsafe_private_named.16, 2414 tangled: self.__unsafe_private_named.17, 2415 extra_data: Default::default(), 2416 } 2417 } 2418 /// Build the final struct with custom extra_data 2419 pub fn build_with_data( 2420 self, 2421 extra_data: std::collections::BTreeMap< 2422 jacquard_common::smol_str::SmolStr, 2423 jacquard_common::types::value::Data<'a>, 2424 >, 2425 ) -> ProfileView<'a> { 2426 ProfileView { 2427 avatar: self.__unsafe_private_named.0, 2428 banner: self.__unsafe_private_named.1, 2429 bluesky: self.__unsafe_private_named.2, 2430 created_at: self.__unsafe_private_named.3, 2431 description: self.__unsafe_private_named.4, 2432 did: self.__unsafe_private_named.5.unwrap(), 2433 display_name: self.__unsafe_private_named.6, 2434 handle: self.__unsafe_private_named.7.unwrap(), 2435 indexed_at: self.__unsafe_private_named.8, 2436 labels: self.__unsafe_private_named.9, 2437 links: self.__unsafe_private_named.10, 2438 location: self.__unsafe_private_named.11, 2439 pinned: self.__unsafe_private_named.12, 2440 pronouns: self.__unsafe_private_named.13, 2441 streamplace: self.__unsafe_private_named.14, 2442 subscribed_count: self.__unsafe_private_named.15, 2443 subscriber_count: self.__unsafe_private_named.16, 2444 tangled: self.__unsafe_private_named.17, 2445 extra_data: Some(extra_data), 2446 } 2447 } 2448} 2449 2450impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ProfileView<'a> { 2451 fn nsid() -> &'static str { 2452 "sh.weaver.actor.defs" 2453 } 2454 fn def_name() -> &'static str { 2455 "profileView" 2456 } 2457 fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 2458 lexicon_doc_sh_weaver_actor_defs() 2459 } 2460 fn validate( 2461 &self, 2462 ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { 2463 if let Some(ref value) = self.description { 2464 #[allow(unused_comparisons)] 2465 if <str>::len(value.as_ref()) > 10240usize { 2466 return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { 2467 path: ::jacquard_lexicon::validation::ValidationPath::from_field( 2468 "description", 2469 ), 2470 max: 10240usize, 2471 actual: <str>::len(value.as_ref()), 2472 }); 2473 } 2474 } 2475 if let Some(ref value) = self.description { 2476 { 2477 let count = ::unicode_segmentation::UnicodeSegmentation::graphemes( 2478 value.as_ref(), 2479 true, 2480 ) 2481 .count(); 2482 if count > 1024usize { 2483 return Err(::jacquard_lexicon::validation::ConstraintError::MaxGraphemes { 2484 path: ::jacquard_lexicon::validation::ValidationPath::from_field( 2485 "description", 2486 ), 2487 max: 1024usize, 2488 actual: count, 2489 }); 2490 } 2491 } 2492 } 2493 if let Some(ref value) = self.display_name { 2494 #[allow(unused_comparisons)] 2495 if <str>::len(value.as_ref()) > 640usize { 2496 return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { 2497 path: ::jacquard_lexicon::validation::ValidationPath::from_field( 2498 "display_name", 2499 ), 2500 max: 640usize, 2501 actual: <str>::len(value.as_ref()), 2502 }); 2503 } 2504 } 2505 if let Some(ref value) = self.display_name { 2506 { 2507 let count = ::unicode_segmentation::UnicodeSegmentation::graphemes( 2508 value.as_ref(), 2509 true, 2510 ) 2511 .count(); 2512 if count > 64usize { 2513 return Err(::jacquard_lexicon::validation::ConstraintError::MaxGraphemes { 2514 path: ::jacquard_lexicon::validation::ValidationPath::from_field( 2515 "display_name", 2516 ), 2517 max: 64usize, 2518 actual: count, 2519 }); 2520 } 2521 } 2522 } 2523 if let Some(ref value) = self.links { 2524 #[allow(unused_comparisons)] 2525 if value.len() > 5usize { 2526 return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { 2527 path: ::jacquard_lexicon::validation::ValidationPath::from_field( 2528 "links", 2529 ), 2530 max: 5usize, 2531 actual: value.len(), 2532 }); 2533 } 2534 } 2535 if let Some(ref value) = self.links { 2536 #[allow(unused_comparisons)] 2537 if value.len() < 0usize { 2538 return Err(::jacquard_lexicon::validation::ConstraintError::MinLength { 2539 path: ::jacquard_lexicon::validation::ValidationPath::from_field( 2540 "links", 2541 ), 2542 min: 0usize, 2543 actual: value.len(), 2544 }); 2545 } 2546 } 2547 if let Some(ref value) = self.location { 2548 #[allow(unused_comparisons)] 2549 if <str>::len(value.as_ref()) > 400usize { 2550 return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { 2551 path: ::jacquard_lexicon::validation::ValidationPath::from_field( 2552 "location", 2553 ), 2554 max: 400usize, 2555 actual: <str>::len(value.as_ref()), 2556 }); 2557 } 2558 } 2559 if let Some(ref value) = self.location { 2560 { 2561 let count = ::unicode_segmentation::UnicodeSegmentation::graphemes( 2562 value.as_ref(), 2563 true, 2564 ) 2565 .count(); 2566 if count > 40usize { 2567 return Err(::jacquard_lexicon::validation::ConstraintError::MaxGraphemes { 2568 path: ::jacquard_lexicon::validation::ValidationPath::from_field( 2569 "location", 2570 ), 2571 max: 40usize, 2572 actual: count, 2573 }); 2574 } 2575 } 2576 } 2577 Ok(()) 2578 } 2579} 2580 2581#[jacquard_derive::lexicon] 2582#[derive( 2583 serde::Serialize, 2584 serde::Deserialize, 2585 Debug, 2586 Clone, 2587 PartialEq, 2588 Eq, 2589 jacquard_derive::IntoStatic 2590)] 2591#[serde(rename_all = "camelCase")] 2592pub struct ProfileViewBasic<'a> { 2593 #[serde(skip_serializing_if = "std::option::Option::is_none")] 2594 #[serde(borrow)] 2595 pub avatar: std::option::Option<jacquard_common::types::string::Uri<'a>>, 2596 #[serde(skip_serializing_if = "std::option::Option::is_none")] 2597 pub created_at: std::option::Option<jacquard_common::types::string::Datetime>, 2598 #[serde(borrow)] 2599 pub did: jacquard_common::types::string::Did<'a>, 2600 #[serde(skip_serializing_if = "std::option::Option::is_none")] 2601 #[serde(borrow)] 2602 pub display_name: std::option::Option<jacquard_common::CowStr<'a>>, 2603 #[serde(borrow)] 2604 pub handle: jacquard_common::types::string::Handle<'a>, 2605 #[serde(skip_serializing_if = "std::option::Option::is_none")] 2606 pub indexed_at: std::option::Option<jacquard_common::types::string::Datetime>, 2607 #[serde(skip_serializing_if = "std::option::Option::is_none")] 2608 #[serde(borrow)] 2609 pub labels: std::option::Option<Vec<crate::com_atproto::label::Label<'a>>>, 2610 /// Pronouns to use in user-generated content. 2611 #[serde(skip_serializing_if = "std::option::Option::is_none")] 2612 #[serde(borrow)] 2613 pub pronouns: std::option::Option<crate::sh_weaver::actor::PronounsList<'a>>, 2614} 2615 2616pub mod profile_view_basic_state { 2617 2618 pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; 2619 #[allow(unused)] 2620 use ::core::marker::PhantomData; 2621 mod sealed { 2622 pub trait Sealed {} 2623 } 2624 /// State trait tracking which required fields have been set 2625 pub trait State: sealed::Sealed { 2626 type Did; 2627 type Handle; 2628 } 2629 /// Empty state - all required fields are unset 2630 pub struct Empty(()); 2631 impl sealed::Sealed for Empty {} 2632 impl State for Empty { 2633 type Did = Unset; 2634 type Handle = Unset; 2635 } 2636 ///State transition - sets the `did` field to Set 2637 pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 2638 impl<S: State> sealed::Sealed for SetDid<S> {} 2639 impl<S: State> State for SetDid<S> { 2640 type Did = Set<members::did>; 2641 type Handle = S::Handle; 2642 } 2643 ///State transition - sets the `handle` field to Set 2644 pub struct SetHandle<S: State = Empty>(PhantomData<fn() -> S>); 2645 impl<S: State> sealed::Sealed for SetHandle<S> {} 2646 impl<S: State> State for SetHandle<S> { 2647 type Did = S::Did; 2648 type Handle = Set<members::handle>; 2649 } 2650 /// Marker types for field names 2651 #[allow(non_camel_case_types)] 2652 pub mod members { 2653 ///Marker type for the `did` field 2654 pub struct did(()); 2655 ///Marker type for the `handle` field 2656 pub struct handle(()); 2657 } 2658} 2659 2660/// Builder for constructing an instance of this type 2661pub struct ProfileViewBasicBuilder<'a, S: profile_view_basic_state::State> { 2662 _phantom_state: ::core::marker::PhantomData<fn() -> S>, 2663 __unsafe_private_named: ( 2664 ::core::option::Option<jacquard_common::types::string::Uri<'a>>, 2665 ::core::option::Option<jacquard_common::types::string::Datetime>, 2666 ::core::option::Option<jacquard_common::types::string::Did<'a>>, 2667 ::core::option::Option<jacquard_common::CowStr<'a>>, 2668 ::core::option::Option<jacquard_common::types::string::Handle<'a>>, 2669 ::core::option::Option<jacquard_common::types::string::Datetime>, 2670 ::core::option::Option<Vec<crate::com_atproto::label::Label<'a>>>, 2671 ::core::option::Option<crate::sh_weaver::actor::PronounsList<'a>>, 2672 ), 2673 _phantom: ::core::marker::PhantomData<&'a ()>, 2674} 2675 2676impl<'a> ProfileViewBasic<'a> { 2677 /// Create a new builder for this type 2678 pub fn new() -> ProfileViewBasicBuilder<'a, profile_view_basic_state::Empty> { 2679 ProfileViewBasicBuilder::new() 2680 } 2681} 2682 2683impl<'a> ProfileViewBasicBuilder<'a, profile_view_basic_state::Empty> { 2684 /// Create a new builder with all fields unset 2685 pub fn new() -> Self { 2686 ProfileViewBasicBuilder { 2687 _phantom_state: ::core::marker::PhantomData, 2688 __unsafe_private_named: (None, None, None, None, None, None, None, None), 2689 _phantom: ::core::marker::PhantomData, 2690 } 2691 } 2692} 2693 2694impl<'a, S: profile_view_basic_state::State> ProfileViewBasicBuilder<'a, S> { 2695 /// Set the `avatar` field (optional) 2696 pub fn avatar( 2697 mut self, 2698 value: impl Into<Option<jacquard_common::types::string::Uri<'a>>>, 2699 ) -> Self { 2700 self.__unsafe_private_named.0 = value.into(); 2701 self 2702 } 2703 /// Set the `avatar` field to an Option value (optional) 2704 pub fn maybe_avatar( 2705 mut self, 2706 value: Option<jacquard_common::types::string::Uri<'a>>, 2707 ) -> Self { 2708 self.__unsafe_private_named.0 = value; 2709 self 2710 } 2711} 2712 2713impl<'a, S: profile_view_basic_state::State> ProfileViewBasicBuilder<'a, S> { 2714 /// Set the `createdAt` field (optional) 2715 pub fn created_at( 2716 mut self, 2717 value: impl Into<Option<jacquard_common::types::string::Datetime>>, 2718 ) -> Self { 2719 self.__unsafe_private_named.1 = value.into(); 2720 self 2721 } 2722 /// Set the `createdAt` field to an Option value (optional) 2723 pub fn maybe_created_at( 2724 mut self, 2725 value: Option<jacquard_common::types::string::Datetime>, 2726 ) -> Self { 2727 self.__unsafe_private_named.1 = value; 2728 self 2729 } 2730} 2731 2732impl<'a, S> ProfileViewBasicBuilder<'a, S> 2733where 2734 S: profile_view_basic_state::State, 2735 S::Did: profile_view_basic_state::IsUnset, 2736{ 2737 /// Set the `did` field (required) 2738 pub fn did( 2739 mut self, 2740 value: impl Into<jacquard_common::types::string::Did<'a>>, 2741 ) -> ProfileViewBasicBuilder<'a, profile_view_basic_state::SetDid<S>> { 2742 self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); 2743 ProfileViewBasicBuilder { 2744 _phantom_state: ::core::marker::PhantomData, 2745 __unsafe_private_named: self.__unsafe_private_named, 2746 _phantom: ::core::marker::PhantomData, 2747 } 2748 } 2749} 2750 2751impl<'a, S: profile_view_basic_state::State> ProfileViewBasicBuilder<'a, S> { 2752 /// Set the `displayName` field (optional) 2753 pub fn display_name( 2754 mut self, 2755 value: impl Into<Option<jacquard_common::CowStr<'a>>>, 2756 ) -> Self { 2757 self.__unsafe_private_named.3 = value.into(); 2758 self 2759 } 2760 /// Set the `displayName` field to an Option value (optional) 2761 pub fn maybe_display_name( 2762 mut self, 2763 value: Option<jacquard_common::CowStr<'a>>, 2764 ) -> Self { 2765 self.__unsafe_private_named.3 = value; 2766 self 2767 } 2768} 2769 2770impl<'a, S> ProfileViewBasicBuilder<'a, S> 2771where 2772 S: profile_view_basic_state::State, 2773 S::Handle: profile_view_basic_state::IsUnset, 2774{ 2775 /// Set the `handle` field (required) 2776 pub fn handle( 2777 mut self, 2778 value: impl Into<jacquard_common::types::string::Handle<'a>>, 2779 ) -> ProfileViewBasicBuilder<'a, profile_view_basic_state::SetHandle<S>> { 2780 self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into()); 2781 ProfileViewBasicBuilder { 2782 _phantom_state: ::core::marker::PhantomData, 2783 __unsafe_private_named: self.__unsafe_private_named, 2784 _phantom: ::core::marker::PhantomData, 2785 } 2786 } 2787} 2788 2789impl<'a, S: profile_view_basic_state::State> ProfileViewBasicBuilder<'a, S> { 2790 /// Set the `indexedAt` field (optional) 2791 pub fn indexed_at( 2792 mut self, 2793 value: impl Into<Option<jacquard_common::types::string::Datetime>>, 2794 ) -> Self { 2795 self.__unsafe_private_named.5 = value.into(); 2796 self 2797 } 2798 /// Set the `indexedAt` field to an Option value (optional) 2799 pub fn maybe_indexed_at( 2800 mut self, 2801 value: Option<jacquard_common::types::string::Datetime>, 2802 ) -> Self { 2803 self.__unsafe_private_named.5 = value; 2804 self 2805 } 2806} 2807 2808impl<'a, S: profile_view_basic_state::State> ProfileViewBasicBuilder<'a, S> { 2809 /// Set the `labels` field (optional) 2810 pub fn labels( 2811 mut self, 2812 value: impl Into<Option<Vec<crate::com_atproto::label::Label<'a>>>>, 2813 ) -> Self { 2814 self.__unsafe_private_named.6 = value.into(); 2815 self 2816 } 2817 /// Set the `labels` field to an Option value (optional) 2818 pub fn maybe_labels( 2819 mut self, 2820 value: Option<Vec<crate::com_atproto::label::Label<'a>>>, 2821 ) -> Self { 2822 self.__unsafe_private_named.6 = value; 2823 self 2824 } 2825} 2826 2827impl<'a, S: profile_view_basic_state::State> ProfileViewBasicBuilder<'a, S> { 2828 /// Set the `pronouns` field (optional) 2829 pub fn pronouns( 2830 mut self, 2831 value: impl Into<Option<crate::sh_weaver::actor::PronounsList<'a>>>, 2832 ) -> Self { 2833 self.__unsafe_private_named.7 = value.into(); 2834 self 2835 } 2836 /// Set the `pronouns` field to an Option value (optional) 2837 pub fn maybe_pronouns( 2838 mut self, 2839 value: Option<crate::sh_weaver::actor::PronounsList<'a>>, 2840 ) -> Self { 2841 self.__unsafe_private_named.7 = value; 2842 self 2843 } 2844} 2845 2846impl<'a, S> ProfileViewBasicBuilder<'a, S> 2847where 2848 S: profile_view_basic_state::State, 2849 S::Did: profile_view_basic_state::IsSet, 2850 S::Handle: profile_view_basic_state::IsSet, 2851{ 2852 /// Build the final struct 2853 pub fn build(self) -> ProfileViewBasic<'a> { 2854 ProfileViewBasic { 2855 avatar: self.__unsafe_private_named.0, 2856 created_at: self.__unsafe_private_named.1, 2857 did: self.__unsafe_private_named.2.unwrap(), 2858 display_name: self.__unsafe_private_named.3, 2859 handle: self.__unsafe_private_named.4.unwrap(), 2860 indexed_at: self.__unsafe_private_named.5, 2861 labels: self.__unsafe_private_named.6, 2862 pronouns: self.__unsafe_private_named.7, 2863 extra_data: Default::default(), 2864 } 2865 } 2866 /// Build the final struct with custom extra_data 2867 pub fn build_with_data( 2868 self, 2869 extra_data: std::collections::BTreeMap< 2870 jacquard_common::smol_str::SmolStr, 2871 jacquard_common::types::value::Data<'a>, 2872 >, 2873 ) -> ProfileViewBasic<'a> { 2874 ProfileViewBasic { 2875 avatar: self.__unsafe_private_named.0, 2876 created_at: self.__unsafe_private_named.1, 2877 did: self.__unsafe_private_named.2.unwrap(), 2878 display_name: self.__unsafe_private_named.3, 2879 handle: self.__unsafe_private_named.4.unwrap(), 2880 indexed_at: self.__unsafe_private_named.5, 2881 labels: self.__unsafe_private_named.6, 2882 pronouns: self.__unsafe_private_named.7, 2883 extra_data: Some(extra_data), 2884 } 2885 } 2886} 2887 2888impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ProfileViewBasic<'a> { 2889 fn nsid() -> &'static str { 2890 "sh.weaver.actor.defs" 2891 } 2892 fn def_name() -> &'static str { 2893 "profileViewBasic" 2894 } 2895 fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 2896 lexicon_doc_sh_weaver_actor_defs() 2897 } 2898 fn validate( 2899 &self, 2900 ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { 2901 if let Some(ref value) = self.display_name { 2902 #[allow(unused_comparisons)] 2903 if <str>::len(value.as_ref()) > 640usize { 2904 return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { 2905 path: ::jacquard_lexicon::validation::ValidationPath::from_field( 2906 "display_name", 2907 ), 2908 max: 640usize, 2909 actual: <str>::len(value.as_ref()), 2910 }); 2911 } 2912 } 2913 if let Some(ref value) = self.display_name { 2914 { 2915 let count = ::unicode_segmentation::UnicodeSegmentation::graphemes( 2916 value.as_ref(), 2917 true, 2918 ) 2919 .count(); 2920 if count > 64usize { 2921 return Err(::jacquard_lexicon::validation::ConstraintError::MaxGraphemes { 2922 path: ::jacquard_lexicon::validation::ValidationPath::from_field( 2923 "display_name", 2924 ), 2925 max: 64usize, 2926 actual: count, 2927 }); 2928 } 2929 } 2930 } 2931 Ok(()) 2932 } 2933} 2934 2935pub type PronounsList<'a> = Vec<jacquard_common::CowStr<'a>>; 2936/// A notebook the viewer subscribes to without a global follow. 2937#[jacquard_derive::lexicon] 2938#[derive( 2939 serde::Serialize, 2940 serde::Deserialize, 2941 Debug, 2942 Clone, 2943 PartialEq, 2944 Eq, 2945 jacquard_derive::IntoStatic 2946)] 2947#[serde(rename_all = "camelCase")] 2948pub struct SubscribedNotebook<'a> { 2949 #[serde(skip_serializing_if = "std::option::Option::is_none")] 2950 #[serde(borrow)] 2951 pub path: std::option::Option<jacquard_common::CowStr<'a>>, 2952 #[serde(skip_serializing_if = "std::option::Option::is_none")] 2953 #[serde(borrow)] 2954 pub title: std::option::Option<jacquard_common::CowStr<'a>>, 2955 #[serde(borrow)] 2956 pub uri: jacquard_common::types::string::AtUri<'a>, 2957} 2958 2959pub mod subscribed_notebook_state { 2960 2961 pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; 2962 #[allow(unused)] 2963 use ::core::marker::PhantomData; 2964 mod sealed { 2965 pub trait Sealed {} 2966 } 2967 /// State trait tracking which required fields have been set 2968 pub trait State: sealed::Sealed { 2969 type Uri; 2970 } 2971 /// Empty state - all required fields are unset 2972 pub struct Empty(()); 2973 impl sealed::Sealed for Empty {} 2974 impl State for Empty { 2975 type Uri = Unset; 2976 } 2977 ///State transition - sets the `uri` field to Set 2978 pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>); 2979 impl<S: State> sealed::Sealed for SetUri<S> {} 2980 impl<S: State> State for SetUri<S> { 2981 type Uri = Set<members::uri>; 2982 } 2983 /// Marker types for field names 2984 #[allow(non_camel_case_types)] 2985 pub mod members { 2986 ///Marker type for the `uri` field 2987 pub struct uri(()); 2988 } 2989} 2990 2991/// Builder for constructing an instance of this type 2992pub struct SubscribedNotebookBuilder<'a, S: subscribed_notebook_state::State> { 2993 _phantom_state: ::core::marker::PhantomData<fn() -> S>, 2994 __unsafe_private_named: ( 2995 ::core::option::Option<jacquard_common::CowStr<'a>>, 2996 ::core::option::Option<jacquard_common::CowStr<'a>>, 2997 ::core::option::Option<jacquard_common::types::string::AtUri<'a>>, 2998 ), 2999 _phantom: ::core::marker::PhantomData<&'a ()>, 3000} 3001 3002impl<'a> SubscribedNotebook<'a> { 3003 /// Create a new builder for this type 3004 pub fn new() -> SubscribedNotebookBuilder<'a, subscribed_notebook_state::Empty> { 3005 SubscribedNotebookBuilder::new() 3006 } 3007} 3008 3009impl<'a> SubscribedNotebookBuilder<'a, subscribed_notebook_state::Empty> { 3010 /// Create a new builder with all fields unset 3011 pub fn new() -> Self { 3012 SubscribedNotebookBuilder { 3013 _phantom_state: ::core::marker::PhantomData, 3014 __unsafe_private_named: (None, None, None), 3015 _phantom: ::core::marker::PhantomData, 3016 } 3017 } 3018} 3019 3020impl<'a, S: subscribed_notebook_state::State> SubscribedNotebookBuilder<'a, S> { 3021 /// Set the `path` field (optional) 3022 pub fn path( 3023 mut self, 3024 value: impl Into<Option<jacquard_common::CowStr<'a>>>, 3025 ) -> Self { 3026 self.__unsafe_private_named.0 = value.into(); 3027 self 3028 } 3029 /// Set the `path` field to an Option value (optional) 3030 pub fn maybe_path(mut self, value: Option<jacquard_common::CowStr<'a>>) -> Self { 3031 self.__unsafe_private_named.0 = value; 3032 self 3033 } 3034} 3035 3036impl<'a, S: subscribed_notebook_state::State> SubscribedNotebookBuilder<'a, S> { 3037 /// Set the `title` field (optional) 3038 pub fn title( 3039 mut self, 3040 value: impl Into<Option<jacquard_common::CowStr<'a>>>, 3041 ) -> Self { 3042 self.__unsafe_private_named.1 = value.into(); 3043 self 3044 } 3045 /// Set the `title` field to an Option value (optional) 3046 pub fn maybe_title(mut self, value: Option<jacquard_common::CowStr<'a>>) -> Self { 3047 self.__unsafe_private_named.1 = value; 3048 self 3049 } 3050} 3051 3052impl<'a, S> SubscribedNotebookBuilder<'a, S> 3053where 3054 S: subscribed_notebook_state::State, 3055 S::Uri: subscribed_notebook_state::IsUnset, 3056{ 3057 /// Set the `uri` field (required) 3058 pub fn uri( 3059 mut self, 3060 value: impl Into<jacquard_common::types::string::AtUri<'a>>, 3061 ) -> SubscribedNotebookBuilder<'a, subscribed_notebook_state::SetUri<S>> { 3062 self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); 3063 SubscribedNotebookBuilder { 3064 _phantom_state: ::core::marker::PhantomData, 3065 __unsafe_private_named: self.__unsafe_private_named, 3066 _phantom: ::core::marker::PhantomData, 3067 } 3068 } 3069} 3070 3071impl<'a, S> SubscribedNotebookBuilder<'a, S> 3072where 3073 S: subscribed_notebook_state::State, 3074 S::Uri: subscribed_notebook_state::IsSet, 3075{ 3076 /// Build the final struct 3077 pub fn build(self) -> SubscribedNotebook<'a> { 3078 SubscribedNotebook { 3079 path: self.__unsafe_private_named.0, 3080 title: self.__unsafe_private_named.1, 3081 uri: self.__unsafe_private_named.2.unwrap(), 3082 extra_data: Default::default(), 3083 } 3084 } 3085 /// Build the final struct with custom extra_data 3086 pub fn build_with_data( 3087 self, 3088 extra_data: std::collections::BTreeMap< 3089 jacquard_common::smol_str::SmolStr, 3090 jacquard_common::types::value::Data<'a>, 3091 >, 3092 ) -> SubscribedNotebook<'a> { 3093 SubscribedNotebook { 3094 path: self.__unsafe_private_named.0, 3095 title: self.__unsafe_private_named.1, 3096 uri: self.__unsafe_private_named.2.unwrap(), 3097 extra_data: Some(extra_data), 3098 } 3099 } 3100} 3101 3102impl<'a> ::jacquard_lexicon::schema::LexiconSchema for SubscribedNotebook<'a> { 3103 fn nsid() -> &'static str { 3104 "sh.weaver.actor.defs" 3105 } 3106 fn def_name() -> &'static str { 3107 "subscribedNotebook" 3108 } 3109 fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 3110 lexicon_doc_sh_weaver_actor_defs() 3111 } 3112 fn validate( 3113 &self, 3114 ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { 3115 Ok(()) 3116 } 3117} 3118 3119#[jacquard_derive::lexicon] 3120#[derive( 3121 serde::Serialize, 3122 serde::Deserialize, 3123 Debug, 3124 Clone, 3125 PartialEq, 3126 Eq, 3127 jacquard_derive::IntoStatic 3128)] 3129#[serde(rename_all = "camelCase")] 3130pub struct TangledProfileView<'a> { 3131 /// Include link to this account on Bluesky. 3132 pub bluesky: bool, 3133 /// Free-form profile description text. 3134 #[serde(skip_serializing_if = "std::option::Option::is_none")] 3135 #[serde(borrow)] 3136 pub description: std::option::Option<jacquard_common::CowStr<'a>>, 3137 #[serde(borrow)] 3138 pub did: jacquard_common::types::string::Did<'a>, 3139 #[serde(borrow)] 3140 pub handle: jacquard_common::types::string::Handle<'a>, 3141 #[serde(skip_serializing_if = "std::option::Option::is_none")] 3142 #[serde(borrow)] 3143 pub links: std::option::Option<Vec<jacquard_common::types::string::Uri<'a>>>, 3144 /// Free-form location text. 3145 #[serde(skip_serializing_if = "std::option::Option::is_none")] 3146 #[serde(borrow)] 3147 pub location: std::option::Option<jacquard_common::CowStr<'a>>, 3148 /// Any ATURI, it is up to appviews to validate these fields. 3149 #[serde(skip_serializing_if = "std::option::Option::is_none")] 3150 #[serde(borrow)] 3151 pub pinned_repositories: std::option::Option< 3152 Vec<jacquard_common::types::string::AtUri<'a>>, 3153 >, 3154 #[serde(skip_serializing_if = "std::option::Option::is_none")] 3155 #[serde(borrow)] 3156 pub stats: std::option::Option<Vec<jacquard_common::CowStr<'a>>>, 3157} 3158 3159pub mod tangled_profile_view_state { 3160 3161 pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; 3162 #[allow(unused)] 3163 use ::core::marker::PhantomData; 3164 mod sealed { 3165 pub trait Sealed {} 3166 } 3167 /// State trait tracking which required fields have been set 3168 pub trait State: sealed::Sealed { 3169 type Bluesky; 3170 type Did; 3171 type Handle; 3172 } 3173 /// Empty state - all required fields are unset 3174 pub struct Empty(()); 3175 impl sealed::Sealed for Empty {} 3176 impl State for Empty { 3177 type Bluesky = Unset; 3178 type Did = Unset; 3179 type Handle = Unset; 3180 } 3181 ///State transition - sets the `bluesky` field to Set 3182 pub struct SetBluesky<S: State = Empty>(PhantomData<fn() -> S>); 3183 impl<S: State> sealed::Sealed for SetBluesky<S> {} 3184 impl<S: State> State for SetBluesky<S> { 3185 type Bluesky = Set<members::bluesky>; 3186 type Did = S::Did; 3187 type Handle = S::Handle; 3188 } 3189 ///State transition - sets the `did` field to Set 3190 pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 3191 impl<S: State> sealed::Sealed for SetDid<S> {} 3192 impl<S: State> State for SetDid<S> { 3193 type Bluesky = S::Bluesky; 3194 type Did = Set<members::did>; 3195 type Handle = S::Handle; 3196 } 3197 ///State transition - sets the `handle` field to Set 3198 pub struct SetHandle<S: State = Empty>(PhantomData<fn() -> S>); 3199 impl<S: State> sealed::Sealed for SetHandle<S> {} 3200 impl<S: State> State for SetHandle<S> { 3201 type Bluesky = S::Bluesky; 3202 type Did = S::Did; 3203 type Handle = Set<members::handle>; 3204 } 3205 /// Marker types for field names 3206 #[allow(non_camel_case_types)] 3207 pub mod members { 3208 ///Marker type for the `bluesky` field 3209 pub struct bluesky(()); 3210 ///Marker type for the `did` field 3211 pub struct did(()); 3212 ///Marker type for the `handle` field 3213 pub struct handle(()); 3214 } 3215} 3216 3217/// Builder for constructing an instance of this type 3218pub struct TangledProfileViewBuilder<'a, S: tangled_profile_view_state::State> { 3219 _phantom_state: ::core::marker::PhantomData<fn() -> S>, 3220 __unsafe_private_named: ( 3221 ::core::option::Option<bool>, 3222 ::core::option::Option<jacquard_common::CowStr<'a>>, 3223 ::core::option::Option<jacquard_common::types::string::Did<'a>>, 3224 ::core::option::Option<jacquard_common::types::string::Handle<'a>>, 3225 ::core::option::Option<Vec<jacquard_common::types::string::Uri<'a>>>, 3226 ::core::option::Option<jacquard_common::CowStr<'a>>, 3227 ::core::option::Option<Vec<jacquard_common::types::string::AtUri<'a>>>, 3228 ::core::option::Option<Vec<jacquard_common::CowStr<'a>>>, 3229 ), 3230 _phantom: ::core::marker::PhantomData<&'a ()>, 3231} 3232 3233impl<'a> TangledProfileView<'a> { 3234 /// Create a new builder for this type 3235 pub fn new() -> TangledProfileViewBuilder<'a, tangled_profile_view_state::Empty> { 3236 TangledProfileViewBuilder::new() 3237 } 3238} 3239 3240impl<'a> TangledProfileViewBuilder<'a, tangled_profile_view_state::Empty> { 3241 /// Create a new builder with all fields unset 3242 pub fn new() -> Self { 3243 TangledProfileViewBuilder { 3244 _phantom_state: ::core::marker::PhantomData, 3245 __unsafe_private_named: (None, None, None, None, None, None, None, None), 3246 _phantom: ::core::marker::PhantomData, 3247 } 3248 } 3249} 3250 3251impl<'a, S> TangledProfileViewBuilder<'a, S> 3252where 3253 S: tangled_profile_view_state::State, 3254 S::Bluesky: tangled_profile_view_state::IsUnset, 3255{ 3256 /// Set the `bluesky` field (required) 3257 pub fn bluesky( 3258 mut self, 3259 value: impl Into<bool>, 3260 ) -> TangledProfileViewBuilder<'a, tangled_profile_view_state::SetBluesky<S>> { 3261 self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); 3262 TangledProfileViewBuilder { 3263 _phantom_state: ::core::marker::PhantomData, 3264 __unsafe_private_named: self.__unsafe_private_named, 3265 _phantom: ::core::marker::PhantomData, 3266 } 3267 } 3268} 3269 3270impl<'a, S: tangled_profile_view_state::State> TangledProfileViewBuilder<'a, S> { 3271 /// Set the `description` field (optional) 3272 pub fn description( 3273 mut self, 3274 value: impl Into<Option<jacquard_common::CowStr<'a>>>, 3275 ) -> Self { 3276 self.__unsafe_private_named.1 = value.into(); 3277 self 3278 } 3279 /// Set the `description` field to an Option value (optional) 3280 pub fn maybe_description( 3281 mut self, 3282 value: Option<jacquard_common::CowStr<'a>>, 3283 ) -> Self { 3284 self.__unsafe_private_named.1 = value; 3285 self 3286 } 3287} 3288 3289impl<'a, S> TangledProfileViewBuilder<'a, S> 3290where 3291 S: tangled_profile_view_state::State, 3292 S::Did: tangled_profile_view_state::IsUnset, 3293{ 3294 /// Set the `did` field (required) 3295 pub fn did( 3296 mut self, 3297 value: impl Into<jacquard_common::types::string::Did<'a>>, 3298 ) -> TangledProfileViewBuilder<'a, tangled_profile_view_state::SetDid<S>> { 3299 self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); 3300 TangledProfileViewBuilder { 3301 _phantom_state: ::core::marker::PhantomData, 3302 __unsafe_private_named: self.__unsafe_private_named, 3303 _phantom: ::core::marker::PhantomData, 3304 } 3305 } 3306} 3307 3308impl<'a, S> TangledProfileViewBuilder<'a, S> 3309where 3310 S: tangled_profile_view_state::State, 3311 S::Handle: tangled_profile_view_state::IsUnset, 3312{ 3313 /// Set the `handle` field (required) 3314 pub fn handle( 3315 mut self, 3316 value: impl Into<jacquard_common::types::string::Handle<'a>>, 3317 ) -> TangledProfileViewBuilder<'a, tangled_profile_view_state::SetHandle<S>> { 3318 self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); 3319 TangledProfileViewBuilder { 3320 _phantom_state: ::core::marker::PhantomData, 3321 __unsafe_private_named: self.__unsafe_private_named, 3322 _phantom: ::core::marker::PhantomData, 3323 } 3324 } 3325} 3326 3327impl<'a, S: tangled_profile_view_state::State> TangledProfileViewBuilder<'a, S> { 3328 /// Set the `links` field (optional) 3329 pub fn links( 3330 mut self, 3331 value: impl Into<Option<Vec<jacquard_common::types::string::Uri<'a>>>>, 3332 ) -> Self { 3333 self.__unsafe_private_named.4 = value.into(); 3334 self 3335 } 3336 /// Set the `links` field to an Option value (optional) 3337 pub fn maybe_links( 3338 mut self, 3339 value: Option<Vec<jacquard_common::types::string::Uri<'a>>>, 3340 ) -> Self { 3341 self.__unsafe_private_named.4 = value; 3342 self 3343 } 3344} 3345 3346impl<'a, S: tangled_profile_view_state::State> TangledProfileViewBuilder<'a, S> { 3347 /// Set the `location` field (optional) 3348 pub fn location( 3349 mut self, 3350 value: impl Into<Option<jacquard_common::CowStr<'a>>>, 3351 ) -> Self { 3352 self.__unsafe_private_named.5 = value.into(); 3353 self 3354 } 3355 /// Set the `location` field to an Option value (optional) 3356 pub fn maybe_location(mut self, value: Option<jacquard_common::CowStr<'a>>) -> Self { 3357 self.__unsafe_private_named.5 = value; 3358 self 3359 } 3360} 3361 3362impl<'a, S: tangled_profile_view_state::State> TangledProfileViewBuilder<'a, S> { 3363 /// Set the `pinnedRepositories` field (optional) 3364 pub fn pinned_repositories( 3365 mut self, 3366 value: impl Into<Option<Vec<jacquard_common::types::string::AtUri<'a>>>>, 3367 ) -> Self { 3368 self.__unsafe_private_named.6 = value.into(); 3369 self 3370 } 3371 /// Set the `pinnedRepositories` field to an Option value (optional) 3372 pub fn maybe_pinned_repositories( 3373 mut self, 3374 value: Option<Vec<jacquard_common::types::string::AtUri<'a>>>, 3375 ) -> Self { 3376 self.__unsafe_private_named.6 = value; 3377 self 3378 } 3379} 3380 3381impl<'a, S: tangled_profile_view_state::State> TangledProfileViewBuilder<'a, S> { 3382 /// Set the `stats` field (optional) 3383 pub fn stats( 3384 mut self, 3385 value: impl Into<Option<Vec<jacquard_common::CowStr<'a>>>>, 3386 ) -> Self { 3387 self.__unsafe_private_named.7 = value.into(); 3388 self 3389 } 3390 /// Set the `stats` field to an Option value (optional) 3391 pub fn maybe_stats( 3392 mut self, 3393 value: Option<Vec<jacquard_common::CowStr<'a>>>, 3394 ) -> Self { 3395 self.__unsafe_private_named.7 = value; 3396 self 3397 } 3398} 3399 3400impl<'a, S> TangledProfileViewBuilder<'a, S> 3401where 3402 S: tangled_profile_view_state::State, 3403 S::Bluesky: tangled_profile_view_state::IsSet, 3404 S::Did: tangled_profile_view_state::IsSet, 3405 S::Handle: tangled_profile_view_state::IsSet, 3406{ 3407 /// Build the final struct 3408 pub fn build(self) -> TangledProfileView<'a> { 3409 TangledProfileView { 3410 bluesky: self.__unsafe_private_named.0.unwrap(), 3411 description: self.__unsafe_private_named.1, 3412 did: self.__unsafe_private_named.2.unwrap(), 3413 handle: self.__unsafe_private_named.3.unwrap(), 3414 links: self.__unsafe_private_named.4, 3415 location: self.__unsafe_private_named.5, 3416 pinned_repositories: self.__unsafe_private_named.6, 3417 stats: self.__unsafe_private_named.7, 3418 extra_data: Default::default(), 3419 } 3420 } 3421 /// Build the final struct with custom extra_data 3422 pub fn build_with_data( 3423 self, 3424 extra_data: std::collections::BTreeMap< 3425 jacquard_common::smol_str::SmolStr, 3426 jacquard_common::types::value::Data<'a>, 3427 >, 3428 ) -> TangledProfileView<'a> { 3429 TangledProfileView { 3430 bluesky: self.__unsafe_private_named.0.unwrap(), 3431 description: self.__unsafe_private_named.1, 3432 did: self.__unsafe_private_named.2.unwrap(), 3433 handle: self.__unsafe_private_named.3.unwrap(), 3434 links: self.__unsafe_private_named.4, 3435 location: self.__unsafe_private_named.5, 3436 pinned_repositories: self.__unsafe_private_named.6, 3437 stats: self.__unsafe_private_named.7, 3438 extra_data: Some(extra_data), 3439 } 3440 } 3441} 3442 3443impl<'a> ::jacquard_lexicon::schema::LexiconSchema for TangledProfileView<'a> { 3444 fn nsid() -> &'static str { 3445 "sh.weaver.actor.defs" 3446 } 3447 fn def_name() -> &'static str { 3448 "tangledProfileView" 3449 } 3450 fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 3451 lexicon_doc_sh_weaver_actor_defs() 3452 } 3453 fn validate( 3454 &self, 3455 ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { 3456 if let Some(ref value) = self.description { 3457 #[allow(unused_comparisons)] 3458 if <str>::len(value.as_ref()) > 2560usize { 3459 return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { 3460 path: ::jacquard_lexicon::validation::ValidationPath::from_field( 3461 "description", 3462 ), 3463 max: 2560usize, 3464 actual: <str>::len(value.as_ref()), 3465 }); 3466 } 3467 } 3468 if let Some(ref value) = self.description { 3469 { 3470 let count = ::unicode_segmentation::UnicodeSegmentation::graphemes( 3471 value.as_ref(), 3472 true, 3473 ) 3474 .count(); 3475 if count > 256usize { 3476 return Err(::jacquard_lexicon::validation::ConstraintError::MaxGraphemes { 3477 path: ::jacquard_lexicon::validation::ValidationPath::from_field( 3478 "description", 3479 ), 3480 max: 256usize, 3481 actual: count, 3482 }); 3483 } 3484 } 3485 } 3486 if let Some(ref value) = self.links { 3487 #[allow(unused_comparisons)] 3488 if value.len() > 5usize { 3489 return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { 3490 path: ::jacquard_lexicon::validation::ValidationPath::from_field( 3491 "links", 3492 ), 3493 max: 5usize, 3494 actual: value.len(), 3495 }); 3496 } 3497 } 3498 if let Some(ref value) = self.links { 3499 #[allow(unused_comparisons)] 3500 if value.len() < 0usize { 3501 return Err(::jacquard_lexicon::validation::ConstraintError::MinLength { 3502 path: ::jacquard_lexicon::validation::ValidationPath::from_field( 3503 "links", 3504 ), 3505 min: 0usize, 3506 actual: value.len(), 3507 }); 3508 } 3509 } 3510 if let Some(ref value) = self.location { 3511 #[allow(unused_comparisons)] 3512 if <str>::len(value.as_ref()) > 400usize { 3513 return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { 3514 path: ::jacquard_lexicon::validation::ValidationPath::from_field( 3515 "location", 3516 ), 3517 max: 400usize, 3518 actual: <str>::len(value.as_ref()), 3519 }); 3520 } 3521 } 3522 if let Some(ref value) = self.location { 3523 { 3524 let count = ::unicode_segmentation::UnicodeSegmentation::graphemes( 3525 value.as_ref(), 3526 true, 3527 ) 3528 .count(); 3529 if count > 40usize { 3530 return Err(::jacquard_lexicon::validation::ConstraintError::MaxGraphemes { 3531 path: ::jacquard_lexicon::validation::ValidationPath::from_field( 3532 "location", 3533 ), 3534 max: 40usize, 3535 actual: count, 3536 }); 3537 } 3538 } 3539 } 3540 if let Some(ref value) = self.pinned_repositories { 3541 #[allow(unused_comparisons)] 3542 if value.len() > 6usize { 3543 return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { 3544 path: ::jacquard_lexicon::validation::ValidationPath::from_field( 3545 "pinned_repositories", 3546 ), 3547 max: 6usize, 3548 actual: value.len(), 3549 }); 3550 } 3551 } 3552 if let Some(ref value) = self.pinned_repositories { 3553 #[allow(unused_comparisons)] 3554 if value.len() < 0usize { 3555 return Err(::jacquard_lexicon::validation::ConstraintError::MinLength { 3556 path: ::jacquard_lexicon::validation::ValidationPath::from_field( 3557 "pinned_repositories", 3558 ), 3559 min: 0usize, 3560 actual: value.len(), 3561 }); 3562 } 3563 } 3564 if let Some(ref value) = self.stats { 3565 #[allow(unused_comparisons)] 3566 if value.len() > 2usize { 3567 return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { 3568 path: ::jacquard_lexicon::validation::ValidationPath::from_field( 3569 "stats", 3570 ), 3571 max: 2usize, 3572 actual: value.len(), 3573 }); 3574 } 3575 } 3576 if let Some(ref value) = self.stats { 3577 #[allow(unused_comparisons)] 3578 if value.len() < 0usize { 3579 return Err(::jacquard_lexicon::validation::ConstraintError::MinLength { 3580 path: ::jacquard_lexicon::validation::ValidationPath::from_field( 3581 "stats", 3582 ), 3583 min: 0usize, 3584 actual: value.len(), 3585 }); 3586 } 3587 } 3588 Ok(()) 3589 } 3590} 3591 3592/// Viewer's relationship state with an actor (detailed version). 3593#[jacquard_derive::lexicon] 3594#[derive( 3595 serde::Serialize, 3596 serde::Deserialize, 3597 Debug, 3598 Clone, 3599 PartialEq, 3600 Eq, 3601 jacquard_derive::IntoStatic, 3602 Default 3603)] 3604#[serde(rename_all = "camelCase")] 3605pub struct ViewerState<'a> { 3606 #[serde(skip_serializing_if = "std::option::Option::is_none")] 3607 #[serde(borrow)] 3608 pub blocked: std::option::Option<jacquard_common::types::string::AtUri<'a>>, 3609 #[serde(skip_serializing_if = "std::option::Option::is_none")] 3610 pub blocked_by: std::option::Option<bool>, 3611 #[serde(skip_serializing_if = "std::option::Option::is_none")] 3612 #[serde(borrow)] 3613 pub follow_requested: std::option::Option<jacquard_common::types::string::AtUri<'a>>, 3614 #[serde(skip_serializing_if = "std::option::Option::is_none")] 3615 #[serde(borrow)] 3616 pub follow_requested_by: std::option::Option< 3617 jacquard_common::types::string::AtUri<'a>, 3618 >, 3619 #[serde(skip_serializing_if = "std::option::Option::is_none")] 3620 #[serde(borrow)] 3621 pub followed_by: std::option::Option<jacquard_common::types::string::AtUri<'a>>, 3622 #[serde(skip_serializing_if = "std::option::Option::is_none")] 3623 #[serde(borrow)] 3624 pub following: std::option::Option<jacquard_common::types::string::AtUri<'a>>, 3625 #[serde(skip_serializing_if = "std::option::Option::is_none")] 3626 #[serde(borrow)] 3627 pub muted: std::option::Option<jacquard_common::types::string::AtUri<'a>>, 3628 #[serde(skip_serializing_if = "std::option::Option::is_none")] 3629 #[serde(borrow)] 3630 pub subscribed_notebooks: std::option::Option< 3631 Vec<crate::sh_weaver::actor::SubscribedNotebook<'a>>, 3632 >, 3633} 3634 3635impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ViewerState<'a> { 3636 fn nsid() -> &'static str { 3637 "sh.weaver.actor.defs" 3638 } 3639 fn def_name() -> &'static str { 3640 "viewerState" 3641 } 3642 fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 3643 lexicon_doc_sh_weaver_actor_defs() 3644 } 3645 fn validate( 3646 &self, 3647 ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { 3648 Ok(()) 3649 } 3650} 3651 3652/// Viewer's relationship state with an actor (basic version). 3653#[jacquard_derive::lexicon] 3654#[derive( 3655 serde::Serialize, 3656 serde::Deserialize, 3657 Debug, 3658 Clone, 3659 PartialEq, 3660 Eq, 3661 jacquard_derive::IntoStatic, 3662 Default 3663)] 3664#[serde(rename_all = "camelCase")] 3665pub struct ViewerStateBasic<'a> { 3666 #[serde(skip_serializing_if = "std::option::Option::is_none")] 3667 #[serde(borrow)] 3668 pub blocked: std::option::Option<jacquard_common::types::string::AtUri<'a>>, 3669 #[serde(skip_serializing_if = "std::option::Option::is_none")] 3670 pub blocked_by: std::option::Option<bool>, 3671 #[serde(skip_serializing_if = "std::option::Option::is_none")] 3672 #[serde(borrow)] 3673 pub follow_requested: std::option::Option<jacquard_common::types::string::AtUri<'a>>, 3674 #[serde(skip_serializing_if = "std::option::Option::is_none")] 3675 #[serde(borrow)] 3676 pub follow_requested_by: std::option::Option< 3677 jacquard_common::types::string::AtUri<'a>, 3678 >, 3679 #[serde(skip_serializing_if = "std::option::Option::is_none")] 3680 #[serde(borrow)] 3681 pub followed_by: std::option::Option<jacquard_common::types::string::AtUri<'a>>, 3682 #[serde(skip_serializing_if = "std::option::Option::is_none")] 3683 #[serde(borrow)] 3684 pub following: std::option::Option<jacquard_common::types::string::AtUri<'a>>, 3685 #[serde(skip_serializing_if = "std::option::Option::is_none")] 3686 #[serde(borrow)] 3687 pub muted: std::option::Option<jacquard_common::types::string::AtUri<'a>>, 3688 #[serde(skip_serializing_if = "std::option::Option::is_none")] 3689 pub subscribed_notebook_count: std::option::Option<i64>, 3690} 3691 3692impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ViewerStateBasic<'a> { 3693 fn nsid() -> &'static str { 3694 "sh.weaver.actor.defs" 3695 } 3696 fn def_name() -> &'static str { 3697 "viewerStateBasic" 3698 } 3699 fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 3700 lexicon_doc_sh_weaver_actor_defs() 3701 } 3702 fn validate( 3703 &self, 3704 ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { 3705 Ok(()) 3706 } 3707}