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