atproto blogging
at main 786 lines 30 kB view raw
1// @generated by jacquard-lexicon. DO NOT EDIT. 2// 3// Lexicon: com.atproto.server.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 activate_account; 9pub mod check_account_status; 10pub mod confirm_email; 11pub mod create_account; 12pub mod create_app_password; 13pub mod create_invite_code; 14pub mod create_invite_codes; 15pub mod create_session; 16pub mod deactivate_account; 17pub mod delete_account; 18pub mod delete_session; 19pub mod describe_server; 20pub mod get_account_invite_codes; 21pub mod get_service_auth; 22pub mod get_session; 23pub mod list_app_passwords; 24pub mod refresh_session; 25pub mod request_account_delete; 26pub mod request_email_confirmation; 27pub mod request_email_update; 28pub mod request_password_reset; 29pub mod reserve_signing_key; 30pub mod reset_password; 31pub mod revoke_app_password; 32pub mod update_email; 33 34#[jacquard_derive::lexicon] 35#[derive( 36 serde::Serialize, 37 serde::Deserialize, 38 Debug, 39 Clone, 40 PartialEq, 41 Eq, 42 jacquard_derive::IntoStatic 43)] 44#[serde(rename_all = "camelCase")] 45pub struct InviteCode<'a> { 46 pub available: i64, 47 #[serde(borrow)] 48 pub code: jacquard_common::CowStr<'a>, 49 pub created_at: jacquard_common::types::string::Datetime, 50 #[serde(borrow)] 51 pub created_by: jacquard_common::CowStr<'a>, 52 pub disabled: bool, 53 #[serde(borrow)] 54 pub for_account: jacquard_common::CowStr<'a>, 55 #[serde(borrow)] 56 pub uses: Vec<crate::com_atproto::server::InviteCodeUse<'a>>, 57} 58 59pub mod invite_code_state { 60 61 pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; 62 #[allow(unused)] 63 use ::core::marker::PhantomData; 64 mod sealed { 65 pub trait Sealed {} 66 } 67 /// State trait tracking which required fields have been set 68 pub trait State: sealed::Sealed { 69 type Code; 70 type ForAccount; 71 type CreatedBy; 72 type CreatedAt; 73 type Uses; 74 type Available; 75 type Disabled; 76 } 77 /// Empty state - all required fields are unset 78 pub struct Empty(()); 79 impl sealed::Sealed for Empty {} 80 impl State for Empty { 81 type Code = Unset; 82 type ForAccount = Unset; 83 type CreatedBy = Unset; 84 type CreatedAt = Unset; 85 type Uses = Unset; 86 type Available = Unset; 87 type Disabled = Unset; 88 } 89 ///State transition - sets the `code` field to Set 90 pub struct SetCode<S: State = Empty>(PhantomData<fn() -> S>); 91 impl<S: State> sealed::Sealed for SetCode<S> {} 92 impl<S: State> State for SetCode<S> { 93 type Code = Set<members::code>; 94 type ForAccount = S::ForAccount; 95 type CreatedBy = S::CreatedBy; 96 type CreatedAt = S::CreatedAt; 97 type Uses = S::Uses; 98 type Available = S::Available; 99 type Disabled = S::Disabled; 100 } 101 ///State transition - sets the `for_account` field to Set 102 pub struct SetForAccount<S: State = Empty>(PhantomData<fn() -> S>); 103 impl<S: State> sealed::Sealed for SetForAccount<S> {} 104 impl<S: State> State for SetForAccount<S> { 105 type Code = S::Code; 106 type ForAccount = Set<members::for_account>; 107 type CreatedBy = S::CreatedBy; 108 type CreatedAt = S::CreatedAt; 109 type Uses = S::Uses; 110 type Available = S::Available; 111 type Disabled = S::Disabled; 112 } 113 ///State transition - sets the `created_by` field to Set 114 pub struct SetCreatedBy<S: State = Empty>(PhantomData<fn() -> S>); 115 impl<S: State> sealed::Sealed for SetCreatedBy<S> {} 116 impl<S: State> State for SetCreatedBy<S> { 117 type Code = S::Code; 118 type ForAccount = S::ForAccount; 119 type CreatedBy = Set<members::created_by>; 120 type CreatedAt = S::CreatedAt; 121 type Uses = S::Uses; 122 type Available = S::Available; 123 type Disabled = S::Disabled; 124 } 125 ///State transition - sets the `created_at` field to Set 126 pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 127 impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 128 impl<S: State> State for SetCreatedAt<S> { 129 type Code = S::Code; 130 type ForAccount = S::ForAccount; 131 type CreatedBy = S::CreatedBy; 132 type CreatedAt = Set<members::created_at>; 133 type Uses = S::Uses; 134 type Available = S::Available; 135 type Disabled = S::Disabled; 136 } 137 ///State transition - sets the `uses` field to Set 138 pub struct SetUses<S: State = Empty>(PhantomData<fn() -> S>); 139 impl<S: State> sealed::Sealed for SetUses<S> {} 140 impl<S: State> State for SetUses<S> { 141 type Code = S::Code; 142 type ForAccount = S::ForAccount; 143 type CreatedBy = S::CreatedBy; 144 type CreatedAt = S::CreatedAt; 145 type Uses = Set<members::uses>; 146 type Available = S::Available; 147 type Disabled = S::Disabled; 148 } 149 ///State transition - sets the `available` field to Set 150 pub struct SetAvailable<S: State = Empty>(PhantomData<fn() -> S>); 151 impl<S: State> sealed::Sealed for SetAvailable<S> {} 152 impl<S: State> State for SetAvailable<S> { 153 type Code = S::Code; 154 type ForAccount = S::ForAccount; 155 type CreatedBy = S::CreatedBy; 156 type CreatedAt = S::CreatedAt; 157 type Uses = S::Uses; 158 type Available = Set<members::available>; 159 type Disabled = S::Disabled; 160 } 161 ///State transition - sets the `disabled` field to Set 162 pub struct SetDisabled<S: State = Empty>(PhantomData<fn() -> S>); 163 impl<S: State> sealed::Sealed for SetDisabled<S> {} 164 impl<S: State> State for SetDisabled<S> { 165 type Code = S::Code; 166 type ForAccount = S::ForAccount; 167 type CreatedBy = S::CreatedBy; 168 type CreatedAt = S::CreatedAt; 169 type Uses = S::Uses; 170 type Available = S::Available; 171 type Disabled = Set<members::disabled>; 172 } 173 /// Marker types for field names 174 #[allow(non_camel_case_types)] 175 pub mod members { 176 ///Marker type for the `code` field 177 pub struct code(()); 178 ///Marker type for the `for_account` field 179 pub struct for_account(()); 180 ///Marker type for the `created_by` field 181 pub struct created_by(()); 182 ///Marker type for the `created_at` field 183 pub struct created_at(()); 184 ///Marker type for the `uses` field 185 pub struct uses(()); 186 ///Marker type for the `available` field 187 pub struct available(()); 188 ///Marker type for the `disabled` field 189 pub struct disabled(()); 190 } 191} 192 193/// Builder for constructing an instance of this type 194pub struct InviteCodeBuilder<'a, S: invite_code_state::State> { 195 _phantom_state: ::core::marker::PhantomData<fn() -> S>, 196 __unsafe_private_named: ( 197 ::core::option::Option<i64>, 198 ::core::option::Option<jacquard_common::CowStr<'a>>, 199 ::core::option::Option<jacquard_common::types::string::Datetime>, 200 ::core::option::Option<jacquard_common::CowStr<'a>>, 201 ::core::option::Option<bool>, 202 ::core::option::Option<jacquard_common::CowStr<'a>>, 203 ::core::option::Option<Vec<crate::com_atproto::server::InviteCodeUse<'a>>>, 204 ), 205 _phantom: ::core::marker::PhantomData<&'a ()>, 206} 207 208impl<'a> InviteCode<'a> { 209 /// Create a new builder for this type 210 pub fn new() -> InviteCodeBuilder<'a, invite_code_state::Empty> { 211 InviteCodeBuilder::new() 212 } 213} 214 215impl<'a> InviteCodeBuilder<'a, invite_code_state::Empty> { 216 /// Create a new builder with all fields unset 217 pub fn new() -> Self { 218 InviteCodeBuilder { 219 _phantom_state: ::core::marker::PhantomData, 220 __unsafe_private_named: (None, None, None, None, None, None, None), 221 _phantom: ::core::marker::PhantomData, 222 } 223 } 224} 225 226impl<'a, S> InviteCodeBuilder<'a, S> 227where 228 S: invite_code_state::State, 229 S::Available: invite_code_state::IsUnset, 230{ 231 /// Set the `available` field (required) 232 pub fn available( 233 mut self, 234 value: impl Into<i64>, 235 ) -> InviteCodeBuilder<'a, invite_code_state::SetAvailable<S>> { 236 self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); 237 InviteCodeBuilder { 238 _phantom_state: ::core::marker::PhantomData, 239 __unsafe_private_named: self.__unsafe_private_named, 240 _phantom: ::core::marker::PhantomData, 241 } 242 } 243} 244 245impl<'a, S> InviteCodeBuilder<'a, S> 246where 247 S: invite_code_state::State, 248 S::Code: invite_code_state::IsUnset, 249{ 250 /// Set the `code` field (required) 251 pub fn code( 252 mut self, 253 value: impl Into<jacquard_common::CowStr<'a>>, 254 ) -> InviteCodeBuilder<'a, invite_code_state::SetCode<S>> { 255 self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); 256 InviteCodeBuilder { 257 _phantom_state: ::core::marker::PhantomData, 258 __unsafe_private_named: self.__unsafe_private_named, 259 _phantom: ::core::marker::PhantomData, 260 } 261 } 262} 263 264impl<'a, S> InviteCodeBuilder<'a, S> 265where 266 S: invite_code_state::State, 267 S::CreatedAt: invite_code_state::IsUnset, 268{ 269 /// Set the `createdAt` field (required) 270 pub fn created_at( 271 mut self, 272 value: impl Into<jacquard_common::types::string::Datetime>, 273 ) -> InviteCodeBuilder<'a, invite_code_state::SetCreatedAt<S>> { 274 self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); 275 InviteCodeBuilder { 276 _phantom_state: ::core::marker::PhantomData, 277 __unsafe_private_named: self.__unsafe_private_named, 278 _phantom: ::core::marker::PhantomData, 279 } 280 } 281} 282 283impl<'a, S> InviteCodeBuilder<'a, S> 284where 285 S: invite_code_state::State, 286 S::CreatedBy: invite_code_state::IsUnset, 287{ 288 /// Set the `createdBy` field (required) 289 pub fn created_by( 290 mut self, 291 value: impl Into<jacquard_common::CowStr<'a>>, 292 ) -> InviteCodeBuilder<'a, invite_code_state::SetCreatedBy<S>> { 293 self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); 294 InviteCodeBuilder { 295 _phantom_state: ::core::marker::PhantomData, 296 __unsafe_private_named: self.__unsafe_private_named, 297 _phantom: ::core::marker::PhantomData, 298 } 299 } 300} 301 302impl<'a, S> InviteCodeBuilder<'a, S> 303where 304 S: invite_code_state::State, 305 S::Disabled: invite_code_state::IsUnset, 306{ 307 /// Set the `disabled` field (required) 308 pub fn disabled( 309 mut self, 310 value: impl Into<bool>, 311 ) -> InviteCodeBuilder<'a, invite_code_state::SetDisabled<S>> { 312 self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into()); 313 InviteCodeBuilder { 314 _phantom_state: ::core::marker::PhantomData, 315 __unsafe_private_named: self.__unsafe_private_named, 316 _phantom: ::core::marker::PhantomData, 317 } 318 } 319} 320 321impl<'a, S> InviteCodeBuilder<'a, S> 322where 323 S: invite_code_state::State, 324 S::ForAccount: invite_code_state::IsUnset, 325{ 326 /// Set the `forAccount` field (required) 327 pub fn for_account( 328 mut self, 329 value: impl Into<jacquard_common::CowStr<'a>>, 330 ) -> InviteCodeBuilder<'a, invite_code_state::SetForAccount<S>> { 331 self.__unsafe_private_named.5 = ::core::option::Option::Some(value.into()); 332 InviteCodeBuilder { 333 _phantom_state: ::core::marker::PhantomData, 334 __unsafe_private_named: self.__unsafe_private_named, 335 _phantom: ::core::marker::PhantomData, 336 } 337 } 338} 339 340impl<'a, S> InviteCodeBuilder<'a, S> 341where 342 S: invite_code_state::State, 343 S::Uses: invite_code_state::IsUnset, 344{ 345 /// Set the `uses` field (required) 346 pub fn uses( 347 mut self, 348 value: impl Into<Vec<crate::com_atproto::server::InviteCodeUse<'a>>>, 349 ) -> InviteCodeBuilder<'a, invite_code_state::SetUses<S>> { 350 self.__unsafe_private_named.6 = ::core::option::Option::Some(value.into()); 351 InviteCodeBuilder { 352 _phantom_state: ::core::marker::PhantomData, 353 __unsafe_private_named: self.__unsafe_private_named, 354 _phantom: ::core::marker::PhantomData, 355 } 356 } 357} 358 359impl<'a, S> InviteCodeBuilder<'a, S> 360where 361 S: invite_code_state::State, 362 S::Code: invite_code_state::IsSet, 363 S::ForAccount: invite_code_state::IsSet, 364 S::CreatedBy: invite_code_state::IsSet, 365 S::CreatedAt: invite_code_state::IsSet, 366 S::Uses: invite_code_state::IsSet, 367 S::Available: invite_code_state::IsSet, 368 S::Disabled: invite_code_state::IsSet, 369{ 370 /// Build the final struct 371 pub fn build(self) -> InviteCode<'a> { 372 InviteCode { 373 available: self.__unsafe_private_named.0.unwrap(), 374 code: self.__unsafe_private_named.1.unwrap(), 375 created_at: self.__unsafe_private_named.2.unwrap(), 376 created_by: self.__unsafe_private_named.3.unwrap(), 377 disabled: self.__unsafe_private_named.4.unwrap(), 378 for_account: self.__unsafe_private_named.5.unwrap(), 379 uses: self.__unsafe_private_named.6.unwrap(), 380 extra_data: Default::default(), 381 } 382 } 383 /// Build the final struct with custom extra_data 384 pub fn build_with_data( 385 self, 386 extra_data: std::collections::BTreeMap< 387 jacquard_common::smol_str::SmolStr, 388 jacquard_common::types::value::Data<'a>, 389 >, 390 ) -> InviteCode<'a> { 391 InviteCode { 392 available: self.__unsafe_private_named.0.unwrap(), 393 code: self.__unsafe_private_named.1.unwrap(), 394 created_at: self.__unsafe_private_named.2.unwrap(), 395 created_by: self.__unsafe_private_named.3.unwrap(), 396 disabled: self.__unsafe_private_named.4.unwrap(), 397 for_account: self.__unsafe_private_named.5.unwrap(), 398 uses: self.__unsafe_private_named.6.unwrap(), 399 extra_data: Some(extra_data), 400 } 401 } 402} 403 404fn lexicon_doc_com_atproto_server_defs() -> ::jacquard_lexicon::lexicon::LexiconDoc< 405 'static, 406> { 407 ::jacquard_lexicon::lexicon::LexiconDoc { 408 lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, 409 id: ::jacquard_common::CowStr::new_static("com.atproto.server.defs"), 410 revision: None, 411 description: None, 412 defs: { 413 let mut map = ::alloc::collections::BTreeMap::new(); 414 map.insert( 415 ::jacquard_common::smol_str::SmolStr::new_static("inviteCode"), 416 ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { 417 description: None, 418 required: Some( 419 vec![ 420 ::jacquard_common::smol_str::SmolStr::new_static("code"), 421 ::jacquard_common::smol_str::SmolStr::new_static("available"), 422 ::jacquard_common::smol_str::SmolStr::new_static("disabled"), 423 ::jacquard_common::smol_str::SmolStr::new_static("forAccount"), 424 ::jacquard_common::smol_str::SmolStr::new_static("createdBy"), 425 ::jacquard_common::smol_str::SmolStr::new_static("createdAt"), 426 ::jacquard_common::smol_str::SmolStr::new_static("uses") 427 ], 428 ), 429 nullable: None, 430 properties: { 431 #[allow(unused_mut)] 432 let mut map = ::alloc::collections::BTreeMap::new(); 433 map.insert( 434 ::jacquard_common::smol_str::SmolStr::new_static( 435 "available", 436 ), 437 ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { 438 description: None, 439 default: None, 440 minimum: None, 441 maximum: None, 442 r#enum: None, 443 r#const: None, 444 }), 445 ); 446 map.insert( 447 ::jacquard_common::smol_str::SmolStr::new_static("code"), 448 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 449 description: None, 450 format: None, 451 default: None, 452 min_length: None, 453 max_length: None, 454 min_graphemes: None, 455 max_graphemes: None, 456 r#enum: None, 457 r#const: None, 458 known_values: None, 459 }), 460 ); 461 map.insert( 462 ::jacquard_common::smol_str::SmolStr::new_static( 463 "createdAt", 464 ), 465 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 466 description: None, 467 format: Some( 468 ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, 469 ), 470 default: None, 471 min_length: None, 472 max_length: None, 473 min_graphemes: None, 474 max_graphemes: None, 475 r#enum: None, 476 r#const: None, 477 known_values: None, 478 }), 479 ); 480 map.insert( 481 ::jacquard_common::smol_str::SmolStr::new_static( 482 "createdBy", 483 ), 484 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 485 description: None, 486 format: None, 487 default: None, 488 min_length: None, 489 max_length: None, 490 min_graphemes: None, 491 max_graphemes: None, 492 r#enum: None, 493 r#const: None, 494 known_values: None, 495 }), 496 ); 497 map.insert( 498 ::jacquard_common::smol_str::SmolStr::new_static("disabled"), 499 ::jacquard_lexicon::lexicon::LexObjectProperty::Boolean(::jacquard_lexicon::lexicon::LexBoolean { 500 description: None, 501 default: None, 502 r#const: None, 503 }), 504 ); 505 map.insert( 506 ::jacquard_common::smol_str::SmolStr::new_static( 507 "forAccount", 508 ), 509 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 510 description: None, 511 format: None, 512 default: None, 513 min_length: None, 514 max_length: None, 515 min_graphemes: None, 516 max_graphemes: None, 517 r#enum: None, 518 r#const: None, 519 known_values: None, 520 }), 521 ); 522 map.insert( 523 ::jacquard_common::smol_str::SmolStr::new_static("uses"), 524 ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { 525 description: None, 526 items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef { 527 description: None, 528 r#ref: ::jacquard_common::CowStr::new_static( 529 "#inviteCodeUse", 530 ), 531 }), 532 min_length: None, 533 max_length: None, 534 }), 535 ); 536 map 537 }, 538 }), 539 ); 540 map.insert( 541 ::jacquard_common::smol_str::SmolStr::new_static("inviteCodeUse"), 542 ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { 543 description: None, 544 required: Some( 545 vec![ 546 ::jacquard_common::smol_str::SmolStr::new_static("usedBy"), 547 ::jacquard_common::smol_str::SmolStr::new_static("usedAt") 548 ], 549 ), 550 nullable: None, 551 properties: { 552 #[allow(unused_mut)] 553 let mut map = ::alloc::collections::BTreeMap::new(); 554 map.insert( 555 ::jacquard_common::smol_str::SmolStr::new_static("usedAt"), 556 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 557 description: None, 558 format: Some( 559 ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, 560 ), 561 default: None, 562 min_length: None, 563 max_length: None, 564 min_graphemes: None, 565 max_graphemes: None, 566 r#enum: None, 567 r#const: None, 568 known_values: None, 569 }), 570 ); 571 map.insert( 572 ::jacquard_common::smol_str::SmolStr::new_static("usedBy"), 573 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 574 description: None, 575 format: Some( 576 ::jacquard_lexicon::lexicon::LexStringFormat::Did, 577 ), 578 default: None, 579 min_length: None, 580 max_length: None, 581 min_graphemes: None, 582 max_graphemes: None, 583 r#enum: None, 584 r#const: None, 585 known_values: None, 586 }), 587 ); 588 map 589 }, 590 }), 591 ); 592 map 593 }, 594 } 595} 596 597impl<'a> ::jacquard_lexicon::schema::LexiconSchema for InviteCode<'a> { 598 fn nsid() -> &'static str { 599 "com.atproto.server.defs" 600 } 601 fn def_name() -> &'static str { 602 "inviteCode" 603 } 604 fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 605 lexicon_doc_com_atproto_server_defs() 606 } 607 fn validate( 608 &self, 609 ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { 610 Ok(()) 611 } 612} 613 614#[jacquard_derive::lexicon] 615#[derive( 616 serde::Serialize, 617 serde::Deserialize, 618 Debug, 619 Clone, 620 PartialEq, 621 Eq, 622 jacquard_derive::IntoStatic 623)] 624#[serde(rename_all = "camelCase")] 625pub struct InviteCodeUse<'a> { 626 pub used_at: jacquard_common::types::string::Datetime, 627 #[serde(borrow)] 628 pub used_by: jacquard_common::types::string::Did<'a>, 629} 630 631pub mod invite_code_use_state { 632 633 pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; 634 #[allow(unused)] 635 use ::core::marker::PhantomData; 636 mod sealed { 637 pub trait Sealed {} 638 } 639 /// State trait tracking which required fields have been set 640 pub trait State: sealed::Sealed { 641 type UsedBy; 642 type UsedAt; 643 } 644 /// Empty state - all required fields are unset 645 pub struct Empty(()); 646 impl sealed::Sealed for Empty {} 647 impl State for Empty { 648 type UsedBy = Unset; 649 type UsedAt = Unset; 650 } 651 ///State transition - sets the `used_by` field to Set 652 pub struct SetUsedBy<S: State = Empty>(PhantomData<fn() -> S>); 653 impl<S: State> sealed::Sealed for SetUsedBy<S> {} 654 impl<S: State> State for SetUsedBy<S> { 655 type UsedBy = Set<members::used_by>; 656 type UsedAt = S::UsedAt; 657 } 658 ///State transition - sets the `used_at` field to Set 659 pub struct SetUsedAt<S: State = Empty>(PhantomData<fn() -> S>); 660 impl<S: State> sealed::Sealed for SetUsedAt<S> {} 661 impl<S: State> State for SetUsedAt<S> { 662 type UsedBy = S::UsedBy; 663 type UsedAt = Set<members::used_at>; 664 } 665 /// Marker types for field names 666 #[allow(non_camel_case_types)] 667 pub mod members { 668 ///Marker type for the `used_by` field 669 pub struct used_by(()); 670 ///Marker type for the `used_at` field 671 pub struct used_at(()); 672 } 673} 674 675/// Builder for constructing an instance of this type 676pub struct InviteCodeUseBuilder<'a, S: invite_code_use_state::State> { 677 _phantom_state: ::core::marker::PhantomData<fn() -> S>, 678 __unsafe_private_named: ( 679 ::core::option::Option<jacquard_common::types::string::Datetime>, 680 ::core::option::Option<jacquard_common::types::string::Did<'a>>, 681 ), 682 _phantom: ::core::marker::PhantomData<&'a ()>, 683} 684 685impl<'a> InviteCodeUse<'a> { 686 /// Create a new builder for this type 687 pub fn new() -> InviteCodeUseBuilder<'a, invite_code_use_state::Empty> { 688 InviteCodeUseBuilder::new() 689 } 690} 691 692impl<'a> InviteCodeUseBuilder<'a, invite_code_use_state::Empty> { 693 /// Create a new builder with all fields unset 694 pub fn new() -> Self { 695 InviteCodeUseBuilder { 696 _phantom_state: ::core::marker::PhantomData, 697 __unsafe_private_named: (None, None), 698 _phantom: ::core::marker::PhantomData, 699 } 700 } 701} 702 703impl<'a, S> InviteCodeUseBuilder<'a, S> 704where 705 S: invite_code_use_state::State, 706 S::UsedAt: invite_code_use_state::IsUnset, 707{ 708 /// Set the `usedAt` field (required) 709 pub fn used_at( 710 mut self, 711 value: impl Into<jacquard_common::types::string::Datetime>, 712 ) -> InviteCodeUseBuilder<'a, invite_code_use_state::SetUsedAt<S>> { 713 self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); 714 InviteCodeUseBuilder { 715 _phantom_state: ::core::marker::PhantomData, 716 __unsafe_private_named: self.__unsafe_private_named, 717 _phantom: ::core::marker::PhantomData, 718 } 719 } 720} 721 722impl<'a, S> InviteCodeUseBuilder<'a, S> 723where 724 S: invite_code_use_state::State, 725 S::UsedBy: invite_code_use_state::IsUnset, 726{ 727 /// Set the `usedBy` field (required) 728 pub fn used_by( 729 mut self, 730 value: impl Into<jacquard_common::types::string::Did<'a>>, 731 ) -> InviteCodeUseBuilder<'a, invite_code_use_state::SetUsedBy<S>> { 732 self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); 733 InviteCodeUseBuilder { 734 _phantom_state: ::core::marker::PhantomData, 735 __unsafe_private_named: self.__unsafe_private_named, 736 _phantom: ::core::marker::PhantomData, 737 } 738 } 739} 740 741impl<'a, S> InviteCodeUseBuilder<'a, S> 742where 743 S: invite_code_use_state::State, 744 S::UsedBy: invite_code_use_state::IsSet, 745 S::UsedAt: invite_code_use_state::IsSet, 746{ 747 /// Build the final struct 748 pub fn build(self) -> InviteCodeUse<'a> { 749 InviteCodeUse { 750 used_at: self.__unsafe_private_named.0.unwrap(), 751 used_by: self.__unsafe_private_named.1.unwrap(), 752 extra_data: Default::default(), 753 } 754 } 755 /// Build the final struct with custom extra_data 756 pub fn build_with_data( 757 self, 758 extra_data: std::collections::BTreeMap< 759 jacquard_common::smol_str::SmolStr, 760 jacquard_common::types::value::Data<'a>, 761 >, 762 ) -> InviteCodeUse<'a> { 763 InviteCodeUse { 764 used_at: self.__unsafe_private_named.0.unwrap(), 765 used_by: self.__unsafe_private_named.1.unwrap(), 766 extra_data: Some(extra_data), 767 } 768 } 769} 770 771impl<'a> ::jacquard_lexicon::schema::LexiconSchema for InviteCodeUse<'a> { 772 fn nsid() -> &'static str { 773 "com.atproto.server.defs" 774 } 775 fn def_name() -> &'static str { 776 "inviteCodeUse" 777 } 778 fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 779 lexicon_doc_com_atproto_server_defs() 780 } 781 fn validate( 782 &self, 783 ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { 784 Ok(()) 785 } 786}