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