// @generated by jacquard-lexicon. DO NOT EDIT. // // Lexicon: sh.weaver.notebook.defs // // This file was automatically generated from Lexicon schemas. // Any manual changes will be overwritten on the next regeneration. pub mod authors; pub mod book; pub mod chapter; pub mod colour_scheme; pub mod entry; pub mod get_book_entry; pub mod get_chapter; pub mod get_continue_reading; pub mod get_entry; pub mod get_entry_by_title; pub mod get_entry_detail; pub mod get_entry_feed; pub mod get_entry_notebooks; pub mod get_notebook; pub mod get_notebook_by_title; pub mod get_notebook_chapters; pub mod get_notebook_detail; pub mod get_notebook_feed; pub mod get_page; pub mod get_published_versions; pub mod get_reading_history; pub mod get_similar_notebooks; pub mod get_suggested_notebooks; pub mod page; pub mod resolve_entry; pub mod resolve_global_notebook; pub mod resolve_notebook; pub mod resolve_version_conflict; pub mod search_entries; pub mod search_notebooks; pub mod theme; pub mod update_reading_progress; #[jacquard_derive::lexicon] #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic )] #[serde(rename_all = "camelCase")] pub struct AuthorListView<'a> { pub index: i64, #[serde(borrow)] pub record: crate::sh_weaver::actor::ProfileDataView<'a>, #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub uri: std::option::Option>, } pub mod author_list_view_state { pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; #[allow(unused)] use ::core::marker::PhantomData; mod sealed { pub trait Sealed {} } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Record; type Index; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Record = Unset; type Index = Unset; } ///State transition - sets the `record` field to Set pub struct SetRecord(PhantomData S>); impl sealed::Sealed for SetRecord {} impl State for SetRecord { type Record = Set; type Index = S::Index; } ///State transition - sets the `index` field to Set pub struct SetIndex(PhantomData S>); impl sealed::Sealed for SetIndex {} impl State for SetIndex { type Record = S::Record; type Index = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `record` field pub struct record(()); ///Marker type for the `index` field pub struct index(()); } } /// Builder for constructing an instance of this type pub struct AuthorListViewBuilder<'a, S: author_list_view_state::State> { _phantom_state: ::core::marker::PhantomData S>, __unsafe_private_named: ( ::core::option::Option, ::core::option::Option>, ::core::option::Option>, ), _phantom: ::core::marker::PhantomData<&'a ()>, } impl<'a> AuthorListView<'a> { /// Create a new builder for this type pub fn new() -> AuthorListViewBuilder<'a, author_list_view_state::Empty> { AuthorListViewBuilder::new() } } impl<'a> AuthorListViewBuilder<'a, author_list_view_state::Empty> { /// Create a new builder with all fields unset pub fn new() -> Self { AuthorListViewBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: (None, None, None), _phantom: ::core::marker::PhantomData, } } } impl<'a, S> AuthorListViewBuilder<'a, S> where S: author_list_view_state::State, S::Index: author_list_view_state::IsUnset, { /// Set the `index` field (required) pub fn index( mut self, value: impl Into, ) -> AuthorListViewBuilder<'a, author_list_view_state::SetIndex> { self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); AuthorListViewBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S> AuthorListViewBuilder<'a, S> where S: author_list_view_state::State, S::Record: author_list_view_state::IsUnset, { /// Set the `record` field (required) pub fn record( mut self, value: impl Into>, ) -> AuthorListViewBuilder<'a, author_list_view_state::SetRecord> { self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); AuthorListViewBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S: author_list_view_state::State> AuthorListViewBuilder<'a, S> { /// Set the `uri` field (optional) pub fn uri( mut self, value: impl Into>>, ) -> Self { self.__unsafe_private_named.2 = value.into(); self } /// Set the `uri` field to an Option value (optional) pub fn maybe_uri( mut self, value: Option>, ) -> Self { self.__unsafe_private_named.2 = value; self } } impl<'a, S> AuthorListViewBuilder<'a, S> where S: author_list_view_state::State, S::Record: author_list_view_state::IsSet, S::Index: author_list_view_state::IsSet, { /// Build the final struct pub fn build(self) -> AuthorListView<'a> { AuthorListView { index: self.__unsafe_private_named.0.unwrap(), record: self.__unsafe_private_named.1.unwrap(), uri: self.__unsafe_private_named.2, extra_data: Default::default(), } } /// Build the final struct with custom extra_data pub fn build_with_data( self, extra_data: std::collections::BTreeMap< jacquard_common::smol_str::SmolStr, jacquard_common::types::value::Data<'a>, >, ) -> AuthorListView<'a> { AuthorListView { index: self.__unsafe_private_named.0.unwrap(), record: self.__unsafe_private_named.1.unwrap(), uri: self.__unsafe_private_named.2, extra_data: Some(extra_data), } } } fn lexicon_doc_sh_weaver_notebook_defs() -> ::jacquard_lexicon::lexicon::LexiconDoc< 'static, > { ::jacquard_lexicon::lexicon::LexiconDoc { lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, id: ::jacquard_common::CowStr::new_static("sh.weaver.notebook.defs"), revision: None, description: None, defs: { let mut map = ::alloc::collections::BTreeMap::new(); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("authorListView"), ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { description: None, required: Some( vec![ ::jacquard_common::smol_str::SmolStr::new_static("record"), ::jacquard_common::smol_str::SmolStr::new_static("index") ], ), nullable: None, properties: { #[allow(unused_mut)] let mut map = ::alloc::collections::BTreeMap::new(); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("index"), ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { description: None, default: None, minimum: None, maximum: None, r#enum: None, r#const: None, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("record"), ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { description: None, r#ref: ::jacquard_common::CowStr::new_static( "sh.weaver.actor.defs#profileDataView", ), }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("uri"), ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { description: None, format: Some( ::jacquard_lexicon::lexicon::LexStringFormat::AtUri, ), default: None, min_length: None, max_length: None, min_graphemes: None, max_graphemes: None, r#enum: None, r#const: None, known_values: None, }), ); map }, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("bookEntryRef"), ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { description: None, required: Some( vec![::jacquard_common::smol_str::SmolStr::new_static("entry")], ), nullable: None, properties: { #[allow(unused_mut)] let mut map = ::alloc::collections::BTreeMap::new(); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("entry"), ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { description: None, r#ref: ::jacquard_common::CowStr::new_static("#entryView"), }), ); map }, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("bookEntryView"), ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { description: Some( ::jacquard_common::CowStr::new_static( "An ordered entry in a Weaver notebook.", ), ), required: Some( vec![ ::jacquard_common::smol_str::SmolStr::new_static("entry"), ::jacquard_common::smol_str::SmolStr::new_static("index") ], ), nullable: None, properties: { #[allow(unused_mut)] let mut map = ::alloc::collections::BTreeMap::new(); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("entry"), ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { description: None, r#ref: ::jacquard_common::CowStr::new_static("#entryView"), }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("index"), ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { description: None, default: None, minimum: None, maximum: None, r#enum: None, r#const: None, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("next"), ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { description: None, r#ref: ::jacquard_common::CowStr::new_static( "#bookEntryRef", ), }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("prev"), ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { description: None, r#ref: ::jacquard_common::CowStr::new_static( "#bookEntryRef", ), }), ); map }, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("chapterEntryView"), ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { description: Some( ::jacquard_common::CowStr::new_static( "An entry within a chapter context.", ), ), required: Some( vec![ ::jacquard_common::smol_str::SmolStr::new_static("entry"), ::jacquard_common::smol_str::SmolStr::new_static("index") ], ), nullable: None, properties: { #[allow(unused_mut)] let mut map = ::alloc::collections::BTreeMap::new(); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("entry"), ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { description: None, r#ref: ::jacquard_common::CowStr::new_static("#entryView"), }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("index"), ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { description: None, default: None, minimum: None, maximum: None, r#enum: None, r#const: None, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("next"), ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { description: None, r#ref: ::jacquard_common::CowStr::new_static( "#bookEntryRef", ), }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("prev"), ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { description: None, r#ref: ::jacquard_common::CowStr::new_static( "#bookEntryRef", ), }), ); map }, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("chapterView"), ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { description: Some( ::jacquard_common::CowStr::new_static( "Hydrated view of a chapter.", ), ), required: Some( vec![ ::jacquard_common::smol_str::SmolStr::new_static("uri"), ::jacquard_common::smol_str::SmolStr::new_static("cid"), ::jacquard_common::smol_str::SmolStr::new_static("notebook"), ::jacquard_common::smol_str::SmolStr::new_static("authors"), ::jacquard_common::smol_str::SmolStr::new_static("record"), ::jacquard_common::smol_str::SmolStr::new_static("indexedAt") ], ), nullable: None, properties: { #[allow(unused_mut)] let mut map = ::alloc::collections::BTreeMap::new(); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("authors"), ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { description: None, items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef { description: None, r#ref: ::jacquard_common::CowStr::new_static( "#authorListView", ), }), min_length: None, max_length: None, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("cid"), ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { description: None, format: Some( ::jacquard_lexicon::lexicon::LexStringFormat::Cid, ), default: None, min_length: None, max_length: None, min_graphemes: None, max_graphemes: None, r#enum: None, r#const: None, known_values: None, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static( "entryCount", ), ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { description: None, default: None, minimum: None, maximum: None, r#enum: None, r#const: None, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static( "indexedAt", ), ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { description: None, format: Some( ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, ), default: None, min_length: None, max_length: None, min_graphemes: None, max_graphemes: None, r#enum: None, r#const: None, known_values: None, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("notebook"), ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { description: None, r#ref: ::jacquard_common::CowStr::new_static( "#notebookView", ), }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("record"), ::jacquard_lexicon::lexicon::LexObjectProperty::Unknown(::jacquard_lexicon::lexicon::LexUnknown { description: None, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("tags"), ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { description: None, r#ref: ::jacquard_common::CowStr::new_static("#tags"), }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("title"), ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { description: None, r#ref: ::jacquard_common::CowStr::new_static("#title"), }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("uri"), ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { description: None, format: Some( ::jacquard_lexicon::lexicon::LexStringFormat::AtUri, ), default: None, min_length: None, max_length: None, min_graphemes: None, max_graphemes: None, r#enum: None, r#const: None, known_values: None, }), ); map }, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("contentFormat"), ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { description: Some( ::jacquard_common::CowStr::new_static( "The format of the content. This is used to determine how to render the content.", ), ), required: None, nullable: None, properties: { #[allow(unused_mut)] let mut map = ::alloc::collections::BTreeMap::new(); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("markdown"), ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { description: Some( ::jacquard_common::CowStr::new_static( "The format of the content. This is used to determine how to render the content.", ), ), format: None, default: None, min_length: None, max_length: None, min_graphemes: None, max_graphemes: None, r#enum: None, r#const: None, known_values: None, }), ); map }, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("contentRating"), ::jacquard_lexicon::lexicon::LexUserType::String(::jacquard_lexicon::lexicon::LexString { description: Some( ::jacquard_common::CowStr::new_static( "Author-applied content rating.", ), ), format: None, default: None, min_length: None, max_length: None, min_graphemes: None, max_graphemes: None, r#enum: None, r#const: None, known_values: None, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("contentWarning"), ::jacquard_lexicon::lexicon::LexUserType::String(::jacquard_lexicon::lexicon::LexString { description: Some( ::jacquard_common::CowStr::new_static( "Author-applied content warning.", ), ), format: None, default: None, min_length: None, max_length: None, min_graphemes: None, max_graphemes: None, r#enum: None, r#const: None, known_values: None, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("contentWarnings"), ::jacquard_lexicon::lexicon::LexUserType::Array(::jacquard_lexicon::lexicon::LexArray { description: None, items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef { description: None, r#ref: ::jacquard_common::CowStr::new_static("#contentWarning"), }), min_length: None, max_length: Some(10usize), }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("entryView"), ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { description: None, required: Some( vec![ ::jacquard_common::smol_str::SmolStr::new_static("uri"), ::jacquard_common::smol_str::SmolStr::new_static("cid"), ::jacquard_common::smol_str::SmolStr::new_static("authors"), ::jacquard_common::smol_str::SmolStr::new_static("record"), ::jacquard_common::smol_str::SmolStr::new_static("indexedAt") ], ), nullable: None, properties: { #[allow(unused_mut)] let mut map = ::alloc::collections::BTreeMap::new(); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("authors"), ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { description: None, items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef { description: None, r#ref: ::jacquard_common::CowStr::new_static( "#authorListView", ), }), min_length: None, max_length: None, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static( "bookmarkCount", ), ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { description: None, default: None, minimum: None, maximum: None, r#enum: None, r#const: None, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("cid"), ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { description: None, format: Some( ::jacquard_lexicon::lexicon::LexStringFormat::Cid, ), default: None, min_length: None, max_length: None, min_graphemes: None, max_graphemes: None, r#enum: None, r#const: None, known_values: None, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static( "indexedAt", ), ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { description: None, format: Some( ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, ), default: None, min_length: None, max_length: None, min_graphemes: None, max_graphemes: None, r#enum: None, r#const: None, known_values: None, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static( "likeCount", ), ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { description: None, default: None, minimum: None, maximum: None, r#enum: None, r#const: None, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("path"), ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { description: None, r#ref: ::jacquard_common::CowStr::new_static("#path"), }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static( "permissions", ), ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { description: None, r#ref: ::jacquard_common::CowStr::new_static( "#permissionsState", ), }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("record"), ::jacquard_lexicon::lexicon::LexObjectProperty::Unknown(::jacquard_lexicon::lexicon::LexUnknown { description: None, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static( "renderedView", ), ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { description: None, r#ref: ::jacquard_common::CowStr::new_static( "#renderedView", ), }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("tags"), ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { description: None, r#ref: ::jacquard_common::CowStr::new_static("#tags"), }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("title"), ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { description: None, r#ref: ::jacquard_common::CowStr::new_static("#title"), }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("uri"), ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { description: None, format: Some( ::jacquard_lexicon::lexicon::LexStringFormat::AtUri, ), default: None, min_length: None, max_length: None, min_graphemes: None, max_graphemes: None, r#enum: None, r#const: None, known_values: None, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static( "viewerBookmark", ), ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { description: None, format: Some( ::jacquard_lexicon::lexicon::LexStringFormat::AtUri, ), default: None, min_length: None, max_length: None, min_graphemes: None, max_graphemes: None, r#enum: None, r#const: None, known_values: None, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static( "viewerLike", ), ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { description: None, format: Some( ::jacquard_lexicon::lexicon::LexStringFormat::AtUri, ), default: None, min_length: None, max_length: None, min_graphemes: None, max_graphemes: None, r#enum: None, r#const: None, known_values: None, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static( "viewerReadingProgress", ), ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { description: None, r#ref: ::jacquard_common::CowStr::new_static( "#readingProgress", ), }), ); map }, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("feedEntryView"), ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { description: Some( ::jacquard_common::CowStr::new_static( "Entry with feed-specific context (discovery reason, notebook context).", ), ), required: Some( vec![::jacquard_common::smol_str::SmolStr::new_static("entry")], ), nullable: None, properties: { #[allow(unused_mut)] let mut map = ::alloc::collections::BTreeMap::new(); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("entry"), ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { description: None, r#ref: ::jacquard_common::CowStr::new_static("#entryView"), }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static( "notebookContext", ), ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { description: None, r#ref: ::jacquard_common::CowStr::new_static( "#feedNotebookContext", ), }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("reason"), ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { description: None, r#ref: ::jacquard_common::CowStr::new_static("#feedReason"), }), ); map }, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("feedNotebookContext"), ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { description: Some( ::jacquard_common::CowStr::new_static( "Minimal notebook context for feed display.", ), ), required: Some( vec![ ::jacquard_common::smol_str::SmolStr::new_static("uri"), ::jacquard_common::smol_str::SmolStr::new_static("title") ], ), nullable: None, properties: { #[allow(unused_mut)] let mut map = ::alloc::collections::BTreeMap::new(); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("path"), ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { description: None, format: None, default: None, min_length: None, max_length: None, min_graphemes: None, max_graphemes: None, r#enum: None, r#const: None, known_values: None, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("title"), ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { description: None, format: None, default: None, min_length: None, max_length: None, min_graphemes: None, max_graphemes: None, r#enum: None, r#const: None, known_values: None, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("uri"), ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { description: None, format: Some( ::jacquard_lexicon::lexicon::LexStringFormat::AtUri, ), default: None, min_length: None, max_length: None, min_graphemes: None, max_graphemes: None, r#enum: None, r#const: None, known_values: None, }), ); map }, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("feedReason"), ::jacquard_lexicon::lexicon::LexUserType::Union(::jacquard_lexicon::lexicon::LexRefUnion { description: None, refs: vec![ ::jacquard_common::CowStr::new_static("#reasonLike"), ::jacquard_common::CowStr::new_static("#reasonBookmark"), ::jacquard_common::CowStr::new_static("#reasonSubscription") ], closed: None, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("notebookView"), ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { description: None, required: Some( vec![ ::jacquard_common::smol_str::SmolStr::new_static("uri"), ::jacquard_common::smol_str::SmolStr::new_static("cid"), ::jacquard_common::smol_str::SmolStr::new_static("authors"), ::jacquard_common::smol_str::SmolStr::new_static("record"), ::jacquard_common::smol_str::SmolStr::new_static("indexedAt") ], ), nullable: None, properties: { #[allow(unused_mut)] let mut map = ::alloc::collections::BTreeMap::new(); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("authors"), ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { description: None, items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef { description: None, r#ref: ::jacquard_common::CowStr::new_static( "#authorListView", ), }), min_length: None, max_length: None, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static( "bookmarkCount", ), ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { description: None, default: None, minimum: None, maximum: None, r#enum: None, r#const: None, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("cid"), ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { description: None, format: Some( ::jacquard_lexicon::lexicon::LexStringFormat::Cid, ), default: None, min_length: None, max_length: None, min_graphemes: None, max_graphemes: None, r#enum: None, r#const: None, known_values: None, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static( "entryCount", ), ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { description: None, default: None, minimum: None, maximum: None, r#enum: None, r#const: None, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static( "indexedAt", ), ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { description: None, format: Some( ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, ), default: None, min_length: None, max_length: None, min_graphemes: None, max_graphemes: None, r#enum: None, r#const: None, known_values: None, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static( "likeCount", ), ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { description: None, default: None, minimum: None, maximum: None, r#enum: None, r#const: None, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("path"), ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { description: None, r#ref: ::jacquard_common::CowStr::new_static("#path"), }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static( "permissions", ), ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { description: None, r#ref: ::jacquard_common::CowStr::new_static( "#permissionsState", ), }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("record"), ::jacquard_lexicon::lexicon::LexObjectProperty::Unknown(::jacquard_lexicon::lexicon::LexUnknown { description: None, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static( "subscriberCount", ), ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { description: None, default: None, minimum: None, maximum: None, r#enum: None, r#const: None, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("tags"), ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { description: None, r#ref: ::jacquard_common::CowStr::new_static("#tags"), }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("title"), ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { description: None, r#ref: ::jacquard_common::CowStr::new_static("#title"), }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("uri"), ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { description: None, format: Some( ::jacquard_lexicon::lexicon::LexStringFormat::AtUri, ), default: None, min_length: None, max_length: None, min_graphemes: None, max_graphemes: None, r#enum: None, r#const: None, known_values: None, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static( "viewerBookmark", ), ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { description: None, format: Some( ::jacquard_lexicon::lexicon::LexStringFormat::AtUri, ), default: None, min_length: None, max_length: None, min_graphemes: None, max_graphemes: None, r#enum: None, r#const: None, known_values: None, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static( "viewerLike", ), ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { description: None, format: Some( ::jacquard_lexicon::lexicon::LexStringFormat::AtUri, ), default: None, min_length: None, max_length: None, min_graphemes: None, max_graphemes: None, r#enum: None, r#const: None, known_values: None, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static( "viewerReadingProgress", ), ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { description: None, r#ref: ::jacquard_common::CowStr::new_static( "#readingProgress", ), }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static( "viewerSubscription", ), ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { description: None, format: Some( ::jacquard_lexicon::lexicon::LexStringFormat::AtUri, ), default: None, min_length: None, max_length: None, min_graphemes: None, max_graphemes: None, r#enum: None, r#const: None, known_values: None, }), ); map }, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("pageView"), ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { description: Some( ::jacquard_common::CowStr::new_static( "Hydrated view of a page (entries displayed together).", ), ), required: Some( vec![ ::jacquard_common::smol_str::SmolStr::new_static("uri"), ::jacquard_common::smol_str::SmolStr::new_static("cid"), ::jacquard_common::smol_str::SmolStr::new_static("notebook"), ::jacquard_common::smol_str::SmolStr::new_static("record"), ::jacquard_common::smol_str::SmolStr::new_static("indexedAt") ], ), nullable: None, properties: { #[allow(unused_mut)] let mut map = ::alloc::collections::BTreeMap::new(); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("cid"), ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { description: None, format: Some( ::jacquard_lexicon::lexicon::LexStringFormat::Cid, ), default: None, min_length: None, max_length: None, min_graphemes: None, max_graphemes: None, r#enum: None, r#const: None, known_values: None, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static( "entryCount", ), ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { description: None, default: None, minimum: None, maximum: None, r#enum: None, r#const: None, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static( "indexedAt", ), ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { description: None, format: Some( ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, ), default: None, min_length: None, max_length: None, min_graphemes: None, max_graphemes: None, r#enum: None, r#const: None, known_values: None, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("notebook"), ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { description: None, r#ref: ::jacquard_common::CowStr::new_static( "#notebookView", ), }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("record"), ::jacquard_lexicon::lexicon::LexObjectProperty::Unknown(::jacquard_lexicon::lexicon::LexUnknown { description: None, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("tags"), ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { description: None, r#ref: ::jacquard_common::CowStr::new_static("#tags"), }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("title"), ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { description: None, r#ref: ::jacquard_common::CowStr::new_static("#title"), }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("uri"), ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { description: None, format: Some( ::jacquard_lexicon::lexicon::LexStringFormat::AtUri, ), default: None, min_length: None, max_length: None, min_graphemes: None, max_graphemes: None, r#enum: None, r#const: None, known_values: None, }), ); map }, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("path"), ::jacquard_lexicon::lexicon::LexUserType::String(::jacquard_lexicon::lexicon::LexString { description: Some( ::jacquard_common::CowStr::new_static( "The path of the notebook.", ), ), format: None, default: None, min_length: None, max_length: Some(100usize), min_graphemes: None, max_graphemes: None, r#enum: None, r#const: None, known_values: None, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("permissionGrant"), ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { description: Some( ::jacquard_common::CowStr::new_static( "A single permission grant. For resource authority: source=resource URI, grantedAt=createdAt. For invitees: source=invite URI, grantedAt=accept createdAt.", ), ), required: Some( vec![ ::jacquard_common::smol_str::SmolStr::new_static("did"), ::jacquard_common::smol_str::SmolStr::new_static("scope"), ::jacquard_common::smol_str::SmolStr::new_static("source"), ::jacquard_common::smol_str::SmolStr::new_static("grantedAt") ], ), nullable: None, properties: { #[allow(unused_mut)] let mut map = ::alloc::collections::BTreeMap::new(); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("did"), ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { description: None, format: Some( ::jacquard_lexicon::lexicon::LexStringFormat::Did, ), default: None, min_length: None, max_length: None, min_graphemes: None, max_graphemes: None, r#enum: None, r#const: None, known_values: None, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static( "grantedAt", ), ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { description: Some( ::jacquard_common::CowStr::new_static( "For authority: record createdAt. For invitees: accept createdAt", ), ), format: Some( ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, ), default: None, min_length: None, max_length: None, min_graphemes: None, max_graphemes: None, r#enum: None, r#const: None, known_values: None, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("scope"), ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { description: Some( ::jacquard_common::CowStr::new_static( "direct = this resource (includes authority), inherited = via notebook invite", ), ), format: None, default: None, min_length: None, max_length: None, min_graphemes: None, max_graphemes: None, r#enum: None, r#const: None, known_values: None, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("source"), ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { description: Some( ::jacquard_common::CowStr::new_static( "For authority: resource URI. For invitees: invite URI", ), ), format: Some( ::jacquard_lexicon::lexicon::LexStringFormat::AtUri, ), default: None, min_length: None, max_length: None, min_graphemes: None, max_graphemes: None, r#enum: None, r#const: None, known_values: None, }), ); map }, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("permissionsState"), ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { description: Some( ::jacquard_common::CowStr::new_static( "ACL-style permissions for a resource. Separate from authors (who contributed).", ), ), required: Some( vec![::jacquard_common::smol_str::SmolStr::new_static("editors")], ), nullable: None, properties: { #[allow(unused_mut)] let mut map = ::alloc::collections::BTreeMap::new(); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("editors"), ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { description: Some( ::jacquard_common::CowStr::new_static( "DIDs that can edit this resource", ), ), items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef { description: None, r#ref: ::jacquard_common::CowStr::new_static( "#permissionGrant", ), }), min_length: None, max_length: None, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("viewers"), ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { description: Some( ::jacquard_common::CowStr::new_static( "DIDs that can view (future use)", ), ), items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef { description: None, r#ref: ::jacquard_common::CowStr::new_static( "#permissionGrant", ), }), min_length: None, max_length: None, }), ); map }, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("publishedVersionView"), ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { description: Some( ::jacquard_common::CowStr::new_static( "A published version of an entry in a collaborator's repo.", ), ), required: Some( vec![ ::jacquard_common::smol_str::SmolStr::new_static("uri"), ::jacquard_common::smol_str::SmolStr::new_static("cid"), ::jacquard_common::smol_str::SmolStr::new_static("publisher"), ::jacquard_common::smol_str::SmolStr::new_static("publishedAt") ], ), nullable: None, properties: { #[allow(unused_mut)] let mut map = ::alloc::collections::BTreeMap::new(); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("cid"), ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { description: None, format: Some( ::jacquard_lexicon::lexicon::LexStringFormat::Cid, ), default: None, min_length: None, max_length: None, min_graphemes: None, max_graphemes: None, r#enum: None, r#const: None, known_values: None, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static( "divergedFrom", ), ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { description: None, r#ref: ::jacquard_common::CowStr::new_static( "com.atproto.repo.strongRef", ), }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static( "isCanonical", ), ::jacquard_lexicon::lexicon::LexObjectProperty::Boolean(::jacquard_lexicon::lexicon::LexBoolean { description: None, default: None, r#const: None, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static( "publishedAt", ), ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { description: None, format: Some( ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, ), default: None, min_length: None, max_length: None, min_graphemes: None, max_graphemes: None, r#enum: None, r#const: None, known_values: None, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static( "publisher", ), ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { description: None, r#ref: ::jacquard_common::CowStr::new_static( "sh.weaver.actor.defs#profileViewBasic", ), }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static( "updatedAt", ), ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { description: None, format: Some( ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, ), default: None, min_length: None, max_length: None, min_graphemes: None, max_graphemes: None, r#enum: None, r#const: None, known_values: None, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("uri"), ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { description: None, format: Some( ::jacquard_lexicon::lexicon::LexStringFormat::AtUri, ), default: None, min_length: None, max_length: None, min_graphemes: None, max_graphemes: None, r#enum: None, r#const: None, known_values: None, }), ); map }, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("readingProgress"), ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { description: Some( ::jacquard_common::CowStr::new_static( "Viewer's reading progress (appview-side state, not a record).", ), ), required: None, nullable: None, properties: { #[allow(unused_mut)] let mut map = ::alloc::collections::BTreeMap::new(); map.insert( ::jacquard_common::smol_str::SmolStr::new_static( "currentEntry", ), ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { description: Some( ::jacquard_common::CowStr::new_static( "Last entry the viewer was reading.", ), ), format: Some( ::jacquard_lexicon::lexicon::LexStringFormat::AtUri, ), default: None, min_length: None, max_length: None, min_graphemes: None, max_graphemes: None, r#enum: None, r#const: None, known_values: None, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static( "finishedAt", ), ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { description: None, format: Some( ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, ), default: None, min_length: None, max_length: None, min_graphemes: None, max_graphemes: None, r#enum: None, r#const: None, known_values: None, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static( "lastReadAt", ), ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { description: None, format: Some( ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, ), default: None, min_length: None, max_length: None, min_graphemes: None, max_graphemes: None, r#enum: None, r#const: None, known_values: None, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static( "percentComplete", ), ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { description: None, default: None, minimum: Some(0i64), maximum: Some(100i64), r#enum: None, r#const: None, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static( "startedAt", ), ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { description: None, format: Some( ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, ), default: None, min_length: None, max_length: None, min_graphemes: None, max_graphemes: None, r#enum: None, r#const: None, known_values: None, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("status"), ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { description: None, format: None, default: None, min_length: None, max_length: None, min_graphemes: None, max_graphemes: None, r#enum: None, r#const: None, known_values: None, }), ); map }, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("reasonBookmark"), ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { description: None, required: Some( vec![ ::jacquard_common::smol_str::SmolStr::new_static("by"), ::jacquard_common::smol_str::SmolStr::new_static("indexedAt") ], ), nullable: None, properties: { #[allow(unused_mut)] let mut map = ::alloc::collections::BTreeMap::new(); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("by"), ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { description: None, r#ref: ::jacquard_common::CowStr::new_static( "sh.weaver.actor.defs#profileViewBasic", ), }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static( "indexedAt", ), ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { description: None, format: Some( ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, ), default: None, min_length: None, max_length: None, min_graphemes: None, max_graphemes: None, r#enum: None, r#const: None, known_values: None, }), ); map }, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("reasonLike"), ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { description: None, required: Some( vec![ ::jacquard_common::smol_str::SmolStr::new_static("by"), ::jacquard_common::smol_str::SmolStr::new_static("indexedAt") ], ), nullable: None, properties: { #[allow(unused_mut)] let mut map = ::alloc::collections::BTreeMap::new(); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("by"), ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { description: None, r#ref: ::jacquard_common::CowStr::new_static( "sh.weaver.actor.defs#profileViewBasic", ), }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static( "indexedAt", ), ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { description: None, format: Some( ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, ), default: None, min_length: None, max_length: None, min_graphemes: None, max_graphemes: None, r#enum: None, r#const: None, known_values: None, }), ); map }, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("reasonSubscription"), ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { description: None, required: Some( vec![ ::jacquard_common::smol_str::SmolStr::new_static("indexedAt") ], ), nullable: None, properties: { #[allow(unused_mut)] let mut map = ::alloc::collections::BTreeMap::new(); map.insert( ::jacquard_common::smol_str::SmolStr::new_static( "indexedAt", ), ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { description: None, format: Some( ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, ), default: None, min_length: None, max_length: None, min_graphemes: None, max_graphemes: None, r#enum: None, r#const: None, known_values: None, }), ); map }, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("renderedView"), ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { description: Some( ::jacquard_common::CowStr::new_static( "View of a rendered and cached notebook entry", ), ), required: Some( vec![::jacquard_common::smol_str::SmolStr::new_static("html")], ), nullable: None, properties: { #[allow(unused_mut)] let mut map = ::alloc::collections::BTreeMap::new(); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("css"), ::jacquard_lexicon::lexicon::LexObjectProperty::Blob(::jacquard_lexicon::lexicon::LexBlob { description: None, accept: None, max_size: None, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("html"), ::jacquard_lexicon::lexicon::LexObjectProperty::Blob(::jacquard_lexicon::lexicon::LexBlob { description: None, accept: None, max_size: None, }), ); map }, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("tags"), ::jacquard_lexicon::lexicon::LexUserType::Array(::jacquard_lexicon::lexicon::LexArray { description: None, items: ::jacquard_lexicon::lexicon::LexArrayItem::String(::jacquard_lexicon::lexicon::LexString { description: None, format: None, default: None, min_length: None, max_length: Some(64usize), min_graphemes: None, max_graphemes: None, r#enum: None, r#const: None, known_values: None, }), min_length: None, max_length: Some(10usize), }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("title"), ::jacquard_lexicon::lexicon::LexUserType::String(::jacquard_lexicon::lexicon::LexString { description: Some( ::jacquard_common::CowStr::new_static( "The title of the notebook entry.", ), ), format: None, default: None, min_length: None, max_length: Some(300usize), min_graphemes: None, max_graphemes: None, r#enum: None, r#const: None, known_values: None, }), ); map }, } } impl<'a> ::jacquard_lexicon::schema::LexiconSchema for AuthorListView<'a> { fn nsid() -> &'static str { "sh.weaver.notebook.defs" } fn def_name() -> &'static str { "authorListView" } fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { lexicon_doc_sh_weaver_notebook_defs() } fn validate( &self, ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { Ok(()) } } #[jacquard_derive::lexicon] #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic )] #[serde(rename_all = "camelCase")] pub struct BookEntryRef<'a> { #[serde(borrow)] pub entry: crate::sh_weaver::notebook::EntryView<'a>, } pub mod book_entry_ref_state { pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; #[allow(unused)] use ::core::marker::PhantomData; mod sealed { pub trait Sealed {} } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Entry; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Entry = Unset; } ///State transition - sets the `entry` field to Set pub struct SetEntry(PhantomData S>); impl sealed::Sealed for SetEntry {} impl State for SetEntry { type Entry = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `entry` field pub struct entry(()); } } /// Builder for constructing an instance of this type pub struct BookEntryRefBuilder<'a, S: book_entry_ref_state::State> { _phantom_state: ::core::marker::PhantomData S>, __unsafe_private_named: ( ::core::option::Option>, ), _phantom: ::core::marker::PhantomData<&'a ()>, } impl<'a> BookEntryRef<'a> { /// Create a new builder for this type pub fn new() -> BookEntryRefBuilder<'a, book_entry_ref_state::Empty> { BookEntryRefBuilder::new() } } impl<'a> BookEntryRefBuilder<'a, book_entry_ref_state::Empty> { /// Create a new builder with all fields unset pub fn new() -> Self { BookEntryRefBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: (None,), _phantom: ::core::marker::PhantomData, } } } impl<'a, S> BookEntryRefBuilder<'a, S> where S: book_entry_ref_state::State, S::Entry: book_entry_ref_state::IsUnset, { /// Set the `entry` field (required) pub fn entry( mut self, value: impl Into>, ) -> BookEntryRefBuilder<'a, book_entry_ref_state::SetEntry> { self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); BookEntryRefBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S> BookEntryRefBuilder<'a, S> where S: book_entry_ref_state::State, S::Entry: book_entry_ref_state::IsSet, { /// Build the final struct pub fn build(self) -> BookEntryRef<'a> { BookEntryRef { entry: self.__unsafe_private_named.0.unwrap(), extra_data: Default::default(), } } /// Build the final struct with custom extra_data pub fn build_with_data( self, extra_data: std::collections::BTreeMap< jacquard_common::smol_str::SmolStr, jacquard_common::types::value::Data<'a>, >, ) -> BookEntryRef<'a> { BookEntryRef { entry: self.__unsafe_private_named.0.unwrap(), extra_data: Some(extra_data), } } } impl<'a> ::jacquard_lexicon::schema::LexiconSchema for BookEntryRef<'a> { fn nsid() -> &'static str { "sh.weaver.notebook.defs" } fn def_name() -> &'static str { "bookEntryRef" } fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { lexicon_doc_sh_weaver_notebook_defs() } fn validate( &self, ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { Ok(()) } } /// An ordered entry in a Weaver notebook. #[jacquard_derive::lexicon] #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic )] #[serde(rename_all = "camelCase")] pub struct BookEntryView<'a> { #[serde(borrow)] pub entry: crate::sh_weaver::notebook::EntryView<'a>, pub index: i64, #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub next: std::option::Option>, #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub prev: std::option::Option>, } pub mod book_entry_view_state { pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; #[allow(unused)] use ::core::marker::PhantomData; mod sealed { pub trait Sealed {} } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Entry; type Index; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Entry = Unset; type Index = Unset; } ///State transition - sets the `entry` field to Set pub struct SetEntry(PhantomData S>); impl sealed::Sealed for SetEntry {} impl State for SetEntry { type Entry = Set; type Index = S::Index; } ///State transition - sets the `index` field to Set pub struct SetIndex(PhantomData S>); impl sealed::Sealed for SetIndex {} impl State for SetIndex { type Entry = S::Entry; type Index = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `entry` field pub struct entry(()); ///Marker type for the `index` field pub struct index(()); } } /// Builder for constructing an instance of this type pub struct BookEntryViewBuilder<'a, S: book_entry_view_state::State> { _phantom_state: ::core::marker::PhantomData S>, __unsafe_private_named: ( ::core::option::Option>, ::core::option::Option, ::core::option::Option>, ::core::option::Option>, ), _phantom: ::core::marker::PhantomData<&'a ()>, } impl<'a> BookEntryView<'a> { /// Create a new builder for this type pub fn new() -> BookEntryViewBuilder<'a, book_entry_view_state::Empty> { BookEntryViewBuilder::new() } } impl<'a> BookEntryViewBuilder<'a, book_entry_view_state::Empty> { /// Create a new builder with all fields unset pub fn new() -> Self { BookEntryViewBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: (None, None, None, None), _phantom: ::core::marker::PhantomData, } } } impl<'a, S> BookEntryViewBuilder<'a, S> where S: book_entry_view_state::State, S::Entry: book_entry_view_state::IsUnset, { /// Set the `entry` field (required) pub fn entry( mut self, value: impl Into>, ) -> BookEntryViewBuilder<'a, book_entry_view_state::SetEntry> { self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); BookEntryViewBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S> BookEntryViewBuilder<'a, S> where S: book_entry_view_state::State, S::Index: book_entry_view_state::IsUnset, { /// Set the `index` field (required) pub fn index( mut self, value: impl Into, ) -> BookEntryViewBuilder<'a, book_entry_view_state::SetIndex> { self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); BookEntryViewBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S: book_entry_view_state::State> BookEntryViewBuilder<'a, S> { /// Set the `next` field (optional) pub fn next( mut self, value: impl Into>>, ) -> Self { self.__unsafe_private_named.2 = value.into(); self } /// Set the `next` field to an Option value (optional) pub fn maybe_next( mut self, value: Option>, ) -> Self { self.__unsafe_private_named.2 = value; self } } impl<'a, S: book_entry_view_state::State> BookEntryViewBuilder<'a, S> { /// Set the `prev` field (optional) pub fn prev( mut self, value: impl Into>>, ) -> Self { self.__unsafe_private_named.3 = value.into(); self } /// Set the `prev` field to an Option value (optional) pub fn maybe_prev( mut self, value: Option>, ) -> Self { self.__unsafe_private_named.3 = value; self } } impl<'a, S> BookEntryViewBuilder<'a, S> where S: book_entry_view_state::State, S::Entry: book_entry_view_state::IsSet, S::Index: book_entry_view_state::IsSet, { /// Build the final struct pub fn build(self) -> BookEntryView<'a> { BookEntryView { entry: self.__unsafe_private_named.0.unwrap(), index: self.__unsafe_private_named.1.unwrap(), next: self.__unsafe_private_named.2, prev: self.__unsafe_private_named.3, extra_data: Default::default(), } } /// Build the final struct with custom extra_data pub fn build_with_data( self, extra_data: std::collections::BTreeMap< jacquard_common::smol_str::SmolStr, jacquard_common::types::value::Data<'a>, >, ) -> BookEntryView<'a> { BookEntryView { entry: self.__unsafe_private_named.0.unwrap(), index: self.__unsafe_private_named.1.unwrap(), next: self.__unsafe_private_named.2, prev: self.__unsafe_private_named.3, extra_data: Some(extra_data), } } } impl<'a> ::jacquard_lexicon::schema::LexiconSchema for BookEntryView<'a> { fn nsid() -> &'static str { "sh.weaver.notebook.defs" } fn def_name() -> &'static str { "bookEntryView" } fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { lexicon_doc_sh_weaver_notebook_defs() } fn validate( &self, ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { Ok(()) } } /// An entry within a chapter context. #[jacquard_derive::lexicon] #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic )] #[serde(rename_all = "camelCase")] pub struct ChapterEntryView<'a> { #[serde(borrow)] pub entry: crate::sh_weaver::notebook::EntryView<'a>, pub index: i64, #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub next: std::option::Option>, #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub prev: std::option::Option>, } pub mod chapter_entry_view_state { pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; #[allow(unused)] use ::core::marker::PhantomData; mod sealed { pub trait Sealed {} } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Index; type Entry; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Index = Unset; type Entry = Unset; } ///State transition - sets the `index` field to Set pub struct SetIndex(PhantomData S>); impl sealed::Sealed for SetIndex {} impl State for SetIndex { type Index = Set; type Entry = S::Entry; } ///State transition - sets the `entry` field to Set pub struct SetEntry(PhantomData S>); impl sealed::Sealed for SetEntry {} impl State for SetEntry { type Index = S::Index; type Entry = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `index` field pub struct index(()); ///Marker type for the `entry` field pub struct entry(()); } } /// Builder for constructing an instance of this type pub struct ChapterEntryViewBuilder<'a, S: chapter_entry_view_state::State> { _phantom_state: ::core::marker::PhantomData S>, __unsafe_private_named: ( ::core::option::Option>, ::core::option::Option, ::core::option::Option>, ::core::option::Option>, ), _phantom: ::core::marker::PhantomData<&'a ()>, } impl<'a> ChapterEntryView<'a> { /// Create a new builder for this type pub fn new() -> ChapterEntryViewBuilder<'a, chapter_entry_view_state::Empty> { ChapterEntryViewBuilder::new() } } impl<'a> ChapterEntryViewBuilder<'a, chapter_entry_view_state::Empty> { /// Create a new builder with all fields unset pub fn new() -> Self { ChapterEntryViewBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: (None, None, None, None), _phantom: ::core::marker::PhantomData, } } } impl<'a, S> ChapterEntryViewBuilder<'a, S> where S: chapter_entry_view_state::State, S::Entry: chapter_entry_view_state::IsUnset, { /// Set the `entry` field (required) pub fn entry( mut self, value: impl Into>, ) -> ChapterEntryViewBuilder<'a, chapter_entry_view_state::SetEntry> { self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); ChapterEntryViewBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S> ChapterEntryViewBuilder<'a, S> where S: chapter_entry_view_state::State, S::Index: chapter_entry_view_state::IsUnset, { /// Set the `index` field (required) pub fn index( mut self, value: impl Into, ) -> ChapterEntryViewBuilder<'a, chapter_entry_view_state::SetIndex> { self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); ChapterEntryViewBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S: chapter_entry_view_state::State> ChapterEntryViewBuilder<'a, S> { /// Set the `next` field (optional) pub fn next( mut self, value: impl Into>>, ) -> Self { self.__unsafe_private_named.2 = value.into(); self } /// Set the `next` field to an Option value (optional) pub fn maybe_next( mut self, value: Option>, ) -> Self { self.__unsafe_private_named.2 = value; self } } impl<'a, S: chapter_entry_view_state::State> ChapterEntryViewBuilder<'a, S> { /// Set the `prev` field (optional) pub fn prev( mut self, value: impl Into>>, ) -> Self { self.__unsafe_private_named.3 = value.into(); self } /// Set the `prev` field to an Option value (optional) pub fn maybe_prev( mut self, value: Option>, ) -> Self { self.__unsafe_private_named.3 = value; self } } impl<'a, S> ChapterEntryViewBuilder<'a, S> where S: chapter_entry_view_state::State, S::Index: chapter_entry_view_state::IsSet, S::Entry: chapter_entry_view_state::IsSet, { /// Build the final struct pub fn build(self) -> ChapterEntryView<'a> { ChapterEntryView { entry: self.__unsafe_private_named.0.unwrap(), index: self.__unsafe_private_named.1.unwrap(), next: self.__unsafe_private_named.2, prev: self.__unsafe_private_named.3, extra_data: Default::default(), } } /// Build the final struct with custom extra_data pub fn build_with_data( self, extra_data: std::collections::BTreeMap< jacquard_common::smol_str::SmolStr, jacquard_common::types::value::Data<'a>, >, ) -> ChapterEntryView<'a> { ChapterEntryView { entry: self.__unsafe_private_named.0.unwrap(), index: self.__unsafe_private_named.1.unwrap(), next: self.__unsafe_private_named.2, prev: self.__unsafe_private_named.3, extra_data: Some(extra_data), } } } impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ChapterEntryView<'a> { fn nsid() -> &'static str { "sh.weaver.notebook.defs" } fn def_name() -> &'static str { "chapterEntryView" } fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { lexicon_doc_sh_weaver_notebook_defs() } fn validate( &self, ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { Ok(()) } } /// Hydrated view of a chapter. #[jacquard_derive::lexicon] #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic )] #[serde(rename_all = "camelCase")] pub struct ChapterView<'a> { #[serde(borrow)] pub authors: Vec>, #[serde(borrow)] pub cid: jacquard_common::types::string::Cid<'a>, #[serde(skip_serializing_if = "std::option::Option::is_none")] pub entry_count: std::option::Option, pub indexed_at: jacquard_common::types::string::Datetime, #[serde(borrow)] pub notebook: crate::sh_weaver::notebook::NotebookView<'a>, #[serde(borrow)] pub record: jacquard_common::types::value::Data<'a>, #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub tags: std::option::Option>, #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub title: std::option::Option>, #[serde(borrow)] pub uri: jacquard_common::types::string::AtUri<'a>, } pub mod chapter_view_state { pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; #[allow(unused)] use ::core::marker::PhantomData; mod sealed { pub trait Sealed {} } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Record; type IndexedAt; type Authors; type Notebook; type Cid; type Uri; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Record = Unset; type IndexedAt = Unset; type Authors = Unset; type Notebook = Unset; type Cid = Unset; type Uri = Unset; } ///State transition - sets the `record` field to Set pub struct SetRecord(PhantomData S>); impl sealed::Sealed for SetRecord {} impl State for SetRecord { type Record = Set; type IndexedAt = S::IndexedAt; type Authors = S::Authors; type Notebook = S::Notebook; type Cid = S::Cid; type Uri = S::Uri; } ///State transition - sets the `indexed_at` field to Set pub struct SetIndexedAt(PhantomData S>); impl sealed::Sealed for SetIndexedAt {} impl State for SetIndexedAt { type Record = S::Record; type IndexedAt = Set; type Authors = S::Authors; type Notebook = S::Notebook; type Cid = S::Cid; type Uri = S::Uri; } ///State transition - sets the `authors` field to Set pub struct SetAuthors(PhantomData S>); impl sealed::Sealed for SetAuthors {} impl State for SetAuthors { type Record = S::Record; type IndexedAt = S::IndexedAt; type Authors = Set; type Notebook = S::Notebook; type Cid = S::Cid; type Uri = S::Uri; } ///State transition - sets the `notebook` field to Set pub struct SetNotebook(PhantomData S>); impl sealed::Sealed for SetNotebook {} impl State for SetNotebook { type Record = S::Record; type IndexedAt = S::IndexedAt; type Authors = S::Authors; type Notebook = Set; type Cid = S::Cid; type Uri = S::Uri; } ///State transition - sets the `cid` field to Set pub struct SetCid(PhantomData S>); impl sealed::Sealed for SetCid {} impl State for SetCid { type Record = S::Record; type IndexedAt = S::IndexedAt; type Authors = S::Authors; type Notebook = S::Notebook; type Cid = Set; type Uri = S::Uri; } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData S>); impl sealed::Sealed for SetUri {} impl State for SetUri { type Record = S::Record; type IndexedAt = S::IndexedAt; type Authors = S::Authors; type Notebook = S::Notebook; type Cid = S::Cid; type Uri = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `record` field pub struct record(()); ///Marker type for the `indexed_at` field pub struct indexed_at(()); ///Marker type for the `authors` field pub struct authors(()); ///Marker type for the `notebook` field pub struct notebook(()); ///Marker type for the `cid` field pub struct cid(()); ///Marker type for the `uri` field pub struct uri(()); } } /// Builder for constructing an instance of this type pub struct ChapterViewBuilder<'a, S: chapter_view_state::State> { _phantom_state: ::core::marker::PhantomData S>, __unsafe_private_named: ( ::core::option::Option>>, ::core::option::Option>, ::core::option::Option, ::core::option::Option, ::core::option::Option>, ::core::option::Option>, ::core::option::Option>, ::core::option::Option>, ::core::option::Option>, ), _phantom: ::core::marker::PhantomData<&'a ()>, } impl<'a> ChapterView<'a> { /// Create a new builder for this type pub fn new() -> ChapterViewBuilder<'a, chapter_view_state::Empty> { ChapterViewBuilder::new() } } impl<'a> ChapterViewBuilder<'a, chapter_view_state::Empty> { /// Create a new builder with all fields unset pub fn new() -> Self { ChapterViewBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: ( None, None, None, None, None, None, None, None, None, ), _phantom: ::core::marker::PhantomData, } } } impl<'a, S> ChapterViewBuilder<'a, S> where S: chapter_view_state::State, S::Authors: chapter_view_state::IsUnset, { /// Set the `authors` field (required) pub fn authors( mut self, value: impl Into>>, ) -> ChapterViewBuilder<'a, chapter_view_state::SetAuthors> { self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); ChapterViewBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S> ChapterViewBuilder<'a, S> where S: chapter_view_state::State, S::Cid: chapter_view_state::IsUnset, { /// Set the `cid` field (required) pub fn cid( mut self, value: impl Into>, ) -> ChapterViewBuilder<'a, chapter_view_state::SetCid> { self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); ChapterViewBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S: chapter_view_state::State> ChapterViewBuilder<'a, S> { /// Set the `entryCount` field (optional) pub fn entry_count(mut self, value: impl Into>) -> Self { self.__unsafe_private_named.2 = value.into(); self } /// Set the `entryCount` field to an Option value (optional) pub fn maybe_entry_count(mut self, value: Option) -> Self { self.__unsafe_private_named.2 = value; self } } impl<'a, S> ChapterViewBuilder<'a, S> where S: chapter_view_state::State, S::IndexedAt: chapter_view_state::IsUnset, { /// Set the `indexedAt` field (required) pub fn indexed_at( mut self, value: impl Into, ) -> ChapterViewBuilder<'a, chapter_view_state::SetIndexedAt> { self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); ChapterViewBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S> ChapterViewBuilder<'a, S> where S: chapter_view_state::State, S::Notebook: chapter_view_state::IsUnset, { /// Set the `notebook` field (required) pub fn notebook( mut self, value: impl Into>, ) -> ChapterViewBuilder<'a, chapter_view_state::SetNotebook> { self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into()); ChapterViewBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S> ChapterViewBuilder<'a, S> where S: chapter_view_state::State, S::Record: chapter_view_state::IsUnset, { /// Set the `record` field (required) pub fn record( mut self, value: impl Into>, ) -> ChapterViewBuilder<'a, chapter_view_state::SetRecord> { self.__unsafe_private_named.5 = ::core::option::Option::Some(value.into()); ChapterViewBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S: chapter_view_state::State> ChapterViewBuilder<'a, S> { /// Set the `tags` field (optional) pub fn tags( mut self, value: impl Into>>, ) -> Self { self.__unsafe_private_named.6 = value.into(); self } /// Set the `tags` field to an Option value (optional) pub fn maybe_tags( mut self, value: Option>, ) -> Self { self.__unsafe_private_named.6 = value; self } } impl<'a, S: chapter_view_state::State> ChapterViewBuilder<'a, S> { /// Set the `title` field (optional) pub fn title( mut self, value: impl Into>>, ) -> Self { self.__unsafe_private_named.7 = value.into(); self } /// Set the `title` field to an Option value (optional) pub fn maybe_title( mut self, value: Option>, ) -> Self { self.__unsafe_private_named.7 = value; self } } impl<'a, S> ChapterViewBuilder<'a, S> where S: chapter_view_state::State, S::Uri: chapter_view_state::IsUnset, { /// Set the `uri` field (required) pub fn uri( mut self, value: impl Into>, ) -> ChapterViewBuilder<'a, chapter_view_state::SetUri> { self.__unsafe_private_named.8 = ::core::option::Option::Some(value.into()); ChapterViewBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S> ChapterViewBuilder<'a, S> where S: chapter_view_state::State, S::Record: chapter_view_state::IsSet, S::IndexedAt: chapter_view_state::IsSet, S::Authors: chapter_view_state::IsSet, S::Notebook: chapter_view_state::IsSet, S::Cid: chapter_view_state::IsSet, S::Uri: chapter_view_state::IsSet, { /// Build the final struct pub fn build(self) -> ChapterView<'a> { ChapterView { authors: self.__unsafe_private_named.0.unwrap(), cid: self.__unsafe_private_named.1.unwrap(), entry_count: self.__unsafe_private_named.2, indexed_at: self.__unsafe_private_named.3.unwrap(), notebook: self.__unsafe_private_named.4.unwrap(), record: self.__unsafe_private_named.5.unwrap(), tags: self.__unsafe_private_named.6, title: self.__unsafe_private_named.7, uri: self.__unsafe_private_named.8.unwrap(), extra_data: Default::default(), } } /// Build the final struct with custom extra_data pub fn build_with_data( self, extra_data: std::collections::BTreeMap< jacquard_common::smol_str::SmolStr, jacquard_common::types::value::Data<'a>, >, ) -> ChapterView<'a> { ChapterView { authors: self.__unsafe_private_named.0.unwrap(), cid: self.__unsafe_private_named.1.unwrap(), entry_count: self.__unsafe_private_named.2, indexed_at: self.__unsafe_private_named.3.unwrap(), notebook: self.__unsafe_private_named.4.unwrap(), record: self.__unsafe_private_named.5.unwrap(), tags: self.__unsafe_private_named.6, title: self.__unsafe_private_named.7, uri: self.__unsafe_private_named.8.unwrap(), extra_data: Some(extra_data), } } } impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ChapterView<'a> { fn nsid() -> &'static str { "sh.weaver.notebook.defs" } fn def_name() -> &'static str { "chapterView" } fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { lexicon_doc_sh_weaver_notebook_defs() } fn validate( &self, ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { Ok(()) } } /// The format of the content. This is used to determine how to render the content. #[jacquard_derive::lexicon] #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, Default )] #[serde(rename_all = "camelCase")] pub struct ContentFormat<'a> { /// The format of the content. This is used to determine how to render the content. #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub markdown: std::option::Option>, } impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ContentFormat<'a> { fn nsid() -> &'static str { "sh.weaver.notebook.defs" } fn def_name() -> &'static str { "contentFormat" } fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { lexicon_doc_sh_weaver_notebook_defs() } fn validate( &self, ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { Ok(()) } } /// Author-applied content rating. #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub enum ContentRating<'a> { General, Teen, Mature, Explicit, Other(jacquard_common::CowStr<'a>), } impl<'a> ContentRating<'a> { pub fn as_str(&self) -> &str { match self { Self::General => "general", Self::Teen => "teen", Self::Mature => "mature", Self::Explicit => "explicit", Self::Other(s) => s.as_ref(), } } } impl<'a> From<&'a str> for ContentRating<'a> { fn from(s: &'a str) -> Self { match s { "general" => Self::General, "teen" => Self::Teen, "mature" => Self::Mature, "explicit" => Self::Explicit, _ => Self::Other(jacquard_common::CowStr::from(s)), } } } impl<'a> From for ContentRating<'a> { fn from(s: String) -> Self { match s.as_str() { "general" => Self::General, "teen" => Self::Teen, "mature" => Self::Mature, "explicit" => Self::Explicit, _ => Self::Other(jacquard_common::CowStr::from(s)), } } } impl<'a> AsRef for ContentRating<'a> { fn as_ref(&self) -> &str { self.as_str() } } impl<'a> core::fmt::Display for ContentRating<'a> { fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { write!(f, "{}", self.as_str()) } } impl<'a> serde::Serialize for ContentRating<'a> { fn serialize(&self, serializer: S) -> Result where S: serde::Serializer, { serializer.serialize_str(self.as_str()) } } impl<'de, 'a> serde::Deserialize<'de> for ContentRating<'a> where 'de: 'a, { fn deserialize(deserializer: D) -> Result where D: serde::Deserializer<'de>, { let s = <&'de str>::deserialize(deserializer)?; Ok(Self::from(s)) } } impl jacquard_common::IntoStatic for ContentRating<'_> { type Output = ContentRating<'static>; fn into_static(self) -> Self::Output { match self { ContentRating::General => ContentRating::General, ContentRating::Teen => ContentRating::Teen, ContentRating::Mature => ContentRating::Mature, ContentRating::Explicit => ContentRating::Explicit, ContentRating::Other(v) => ContentRating::Other(v.into_static()), } } } /// Author-applied content warning. #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub enum ContentWarning<'a> { Violence, GraphicViolence, Death, MajorCharacterDeath, SexualContent, ExplicitSexualContent, Language, SubstanceUse, SelfHarm, Abuse, DisturbingImagery, Other(jacquard_common::CowStr<'a>), } impl<'a> ContentWarning<'a> { pub fn as_str(&self) -> &str { match self { Self::Violence => "violence", Self::GraphicViolence => "graphic-violence", Self::Death => "death", Self::MajorCharacterDeath => "major-character-death", Self::SexualContent => "sexual-content", Self::ExplicitSexualContent => "explicit-sexual-content", Self::Language => "language", Self::SubstanceUse => "substance-use", Self::SelfHarm => "self-harm", Self::Abuse => "abuse", Self::DisturbingImagery => "disturbing-imagery", Self::Other(s) => s.as_ref(), } } } impl<'a> From<&'a str> for ContentWarning<'a> { fn from(s: &'a str) -> Self { match s { "violence" => Self::Violence, "graphic-violence" => Self::GraphicViolence, "death" => Self::Death, "major-character-death" => Self::MajorCharacterDeath, "sexual-content" => Self::SexualContent, "explicit-sexual-content" => Self::ExplicitSexualContent, "language" => Self::Language, "substance-use" => Self::SubstanceUse, "self-harm" => Self::SelfHarm, "abuse" => Self::Abuse, "disturbing-imagery" => Self::DisturbingImagery, _ => Self::Other(jacquard_common::CowStr::from(s)), } } } impl<'a> From for ContentWarning<'a> { fn from(s: String) -> Self { match s.as_str() { "violence" => Self::Violence, "graphic-violence" => Self::GraphicViolence, "death" => Self::Death, "major-character-death" => Self::MajorCharacterDeath, "sexual-content" => Self::SexualContent, "explicit-sexual-content" => Self::ExplicitSexualContent, "language" => Self::Language, "substance-use" => Self::SubstanceUse, "self-harm" => Self::SelfHarm, "abuse" => Self::Abuse, "disturbing-imagery" => Self::DisturbingImagery, _ => Self::Other(jacquard_common::CowStr::from(s)), } } } impl<'a> AsRef for ContentWarning<'a> { fn as_ref(&self) -> &str { self.as_str() } } impl<'a> core::fmt::Display for ContentWarning<'a> { fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { write!(f, "{}", self.as_str()) } } impl<'a> serde::Serialize for ContentWarning<'a> { fn serialize(&self, serializer: S) -> Result where S: serde::Serializer, { serializer.serialize_str(self.as_str()) } } impl<'de, 'a> serde::Deserialize<'de> for ContentWarning<'a> where 'de: 'a, { fn deserialize(deserializer: D) -> Result where D: serde::Deserializer<'de>, { let s = <&'de str>::deserialize(deserializer)?; Ok(Self::from(s)) } } impl jacquard_common::IntoStatic for ContentWarning<'_> { type Output = ContentWarning<'static>; fn into_static(self) -> Self::Output { match self { ContentWarning::Violence => ContentWarning::Violence, ContentWarning::GraphicViolence => ContentWarning::GraphicViolence, ContentWarning::Death => ContentWarning::Death, ContentWarning::MajorCharacterDeath => ContentWarning::MajorCharacterDeath, ContentWarning::SexualContent => ContentWarning::SexualContent, ContentWarning::ExplicitSexualContent => { ContentWarning::ExplicitSexualContent } ContentWarning::Language => ContentWarning::Language, ContentWarning::SubstanceUse => ContentWarning::SubstanceUse, ContentWarning::SelfHarm => ContentWarning::SelfHarm, ContentWarning::Abuse => ContentWarning::Abuse, ContentWarning::DisturbingImagery => ContentWarning::DisturbingImagery, ContentWarning::Other(v) => ContentWarning::Other(v.into_static()), } } } /// Author-applied content warnings. pub type ContentWarnings<'a> = Vec>; #[jacquard_derive::lexicon] #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic )] #[serde(rename_all = "camelCase")] pub struct EntryView<'a> { #[serde(borrow)] pub authors: Vec>, #[serde(skip_serializing_if = "std::option::Option::is_none")] pub bookmark_count: std::option::Option, #[serde(borrow)] pub cid: jacquard_common::types::string::Cid<'a>, pub indexed_at: jacquard_common::types::string::Datetime, #[serde(skip_serializing_if = "std::option::Option::is_none")] pub like_count: std::option::Option, #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub path: std::option::Option>, #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub permissions: std::option::Option< crate::sh_weaver::notebook::PermissionsState<'a>, >, #[serde(borrow)] pub record: jacquard_common::types::value::Data<'a>, #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub rendered_view: std::option::Option>, #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub tags: std::option::Option>, #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub title: std::option::Option>, #[serde(borrow)] pub uri: jacquard_common::types::string::AtUri<'a>, #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub viewer_bookmark: std::option::Option>, #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub viewer_like: std::option::Option>, #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub viewer_reading_progress: std::option::Option< crate::sh_weaver::notebook::ReadingProgress<'a>, >, } pub mod entry_view_state { pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; #[allow(unused)] use ::core::marker::PhantomData; mod sealed { pub trait Sealed {} } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Authors; type Uri; type Cid; type IndexedAt; type Record; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Authors = Unset; type Uri = Unset; type Cid = Unset; type IndexedAt = Unset; type Record = Unset; } ///State transition - sets the `authors` field to Set pub struct SetAuthors(PhantomData S>); impl sealed::Sealed for SetAuthors {} impl State for SetAuthors { type Authors = Set; type Uri = S::Uri; type Cid = S::Cid; type IndexedAt = S::IndexedAt; type Record = S::Record; } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData S>); impl sealed::Sealed for SetUri {} impl State for SetUri { type Authors = S::Authors; type Uri = Set; type Cid = S::Cid; type IndexedAt = S::IndexedAt; type Record = S::Record; } ///State transition - sets the `cid` field to Set pub struct SetCid(PhantomData S>); impl sealed::Sealed for SetCid {} impl State for SetCid { type Authors = S::Authors; type Uri = S::Uri; type Cid = Set; type IndexedAt = S::IndexedAt; type Record = S::Record; } ///State transition - sets the `indexed_at` field to Set pub struct SetIndexedAt(PhantomData S>); impl sealed::Sealed for SetIndexedAt {} impl State for SetIndexedAt { type Authors = S::Authors; type Uri = S::Uri; type Cid = S::Cid; type IndexedAt = Set; type Record = S::Record; } ///State transition - sets the `record` field to Set pub struct SetRecord(PhantomData S>); impl sealed::Sealed for SetRecord {} impl State for SetRecord { type Authors = S::Authors; type Uri = S::Uri; type Cid = S::Cid; type IndexedAt = S::IndexedAt; type Record = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `authors` field pub struct authors(()); ///Marker type for the `uri` field pub struct uri(()); ///Marker type for the `cid` field pub struct cid(()); ///Marker type for the `indexed_at` field pub struct indexed_at(()); ///Marker type for the `record` field pub struct record(()); } } /// Builder for constructing an instance of this type pub struct EntryViewBuilder<'a, S: entry_view_state::State> { _phantom_state: ::core::marker::PhantomData S>, __unsafe_private_named: ( ::core::option::Option>>, ::core::option::Option, ::core::option::Option>, ::core::option::Option, ::core::option::Option, ::core::option::Option>, ::core::option::Option>, ::core::option::Option>, ::core::option::Option>, ::core::option::Option>, ::core::option::Option>, ::core::option::Option>, ::core::option::Option>, ::core::option::Option>, ::core::option::Option>, ), _phantom: ::core::marker::PhantomData<&'a ()>, } impl<'a> EntryView<'a> { /// Create a new builder for this type pub fn new() -> EntryViewBuilder<'a, entry_view_state::Empty> { EntryViewBuilder::new() } } impl<'a> EntryViewBuilder<'a, entry_view_state::Empty> { /// Create a new builder with all fields unset pub fn new() -> Self { EntryViewBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: ( None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, ), _phantom: ::core::marker::PhantomData, } } } impl<'a, S> EntryViewBuilder<'a, S> where S: entry_view_state::State, S::Authors: entry_view_state::IsUnset, { /// Set the `authors` field (required) pub fn authors( mut self, value: impl Into>>, ) -> EntryViewBuilder<'a, entry_view_state::SetAuthors> { self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); EntryViewBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S: entry_view_state::State> EntryViewBuilder<'a, S> { /// Set the `bookmarkCount` field (optional) pub fn bookmark_count(mut self, value: impl Into>) -> Self { self.__unsafe_private_named.1 = value.into(); self } /// Set the `bookmarkCount` field to an Option value (optional) pub fn maybe_bookmark_count(mut self, value: Option) -> Self { self.__unsafe_private_named.1 = value; self } } impl<'a, S> EntryViewBuilder<'a, S> where S: entry_view_state::State, S::Cid: entry_view_state::IsUnset, { /// Set the `cid` field (required) pub fn cid( mut self, value: impl Into>, ) -> EntryViewBuilder<'a, entry_view_state::SetCid> { self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); EntryViewBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S> EntryViewBuilder<'a, S> where S: entry_view_state::State, S::IndexedAt: entry_view_state::IsUnset, { /// Set the `indexedAt` field (required) pub fn indexed_at( mut self, value: impl Into, ) -> EntryViewBuilder<'a, entry_view_state::SetIndexedAt> { self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); EntryViewBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S: entry_view_state::State> EntryViewBuilder<'a, S> { /// Set the `likeCount` field (optional) pub fn like_count(mut self, value: impl Into>) -> Self { self.__unsafe_private_named.4 = value.into(); self } /// Set the `likeCount` field to an Option value (optional) pub fn maybe_like_count(mut self, value: Option) -> Self { self.__unsafe_private_named.4 = value; self } } impl<'a, S: entry_view_state::State> EntryViewBuilder<'a, S> { /// Set the `path` field (optional) pub fn path( mut self, value: impl Into>>, ) -> Self { self.__unsafe_private_named.5 = value.into(); self } /// Set the `path` field to an Option value (optional) pub fn maybe_path( mut self, value: Option>, ) -> Self { self.__unsafe_private_named.5 = value; self } } impl<'a, S: entry_view_state::State> EntryViewBuilder<'a, S> { /// Set the `permissions` field (optional) pub fn permissions( mut self, value: impl Into>>, ) -> Self { self.__unsafe_private_named.6 = value.into(); self } /// Set the `permissions` field to an Option value (optional) pub fn maybe_permissions( mut self, value: Option>, ) -> Self { self.__unsafe_private_named.6 = value; self } } impl<'a, S> EntryViewBuilder<'a, S> where S: entry_view_state::State, S::Record: entry_view_state::IsUnset, { /// Set the `record` field (required) pub fn record( mut self, value: impl Into>, ) -> EntryViewBuilder<'a, entry_view_state::SetRecord> { self.__unsafe_private_named.7 = ::core::option::Option::Some(value.into()); EntryViewBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S: entry_view_state::State> EntryViewBuilder<'a, S> { /// Set the `renderedView` field (optional) pub fn rendered_view( mut self, value: impl Into>>, ) -> Self { self.__unsafe_private_named.8 = value.into(); self } /// Set the `renderedView` field to an Option value (optional) pub fn maybe_rendered_view( mut self, value: Option>, ) -> Self { self.__unsafe_private_named.8 = value; self } } impl<'a, S: entry_view_state::State> EntryViewBuilder<'a, S> { /// Set the `tags` field (optional) pub fn tags( mut self, value: impl Into>>, ) -> Self { self.__unsafe_private_named.9 = value.into(); self } /// Set the `tags` field to an Option value (optional) pub fn maybe_tags( mut self, value: Option>, ) -> Self { self.__unsafe_private_named.9 = value; self } } impl<'a, S: entry_view_state::State> EntryViewBuilder<'a, S> { /// Set the `title` field (optional) pub fn title( mut self, value: impl Into>>, ) -> Self { self.__unsafe_private_named.10 = value.into(); self } /// Set the `title` field to an Option value (optional) pub fn maybe_title( mut self, value: Option>, ) -> Self { self.__unsafe_private_named.10 = value; self } } impl<'a, S> EntryViewBuilder<'a, S> where S: entry_view_state::State, S::Uri: entry_view_state::IsUnset, { /// Set the `uri` field (required) pub fn uri( mut self, value: impl Into>, ) -> EntryViewBuilder<'a, entry_view_state::SetUri> { self.__unsafe_private_named.11 = ::core::option::Option::Some(value.into()); EntryViewBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S: entry_view_state::State> EntryViewBuilder<'a, S> { /// Set the `viewerBookmark` field (optional) pub fn viewer_bookmark( mut self, value: impl Into>>, ) -> Self { self.__unsafe_private_named.12 = value.into(); self } /// Set the `viewerBookmark` field to an Option value (optional) pub fn maybe_viewer_bookmark( mut self, value: Option>, ) -> Self { self.__unsafe_private_named.12 = value; self } } impl<'a, S: entry_view_state::State> EntryViewBuilder<'a, S> { /// Set the `viewerLike` field (optional) pub fn viewer_like( mut self, value: impl Into>>, ) -> Self { self.__unsafe_private_named.13 = value.into(); self } /// Set the `viewerLike` field to an Option value (optional) pub fn maybe_viewer_like( mut self, value: Option>, ) -> Self { self.__unsafe_private_named.13 = value; self } } impl<'a, S: entry_view_state::State> EntryViewBuilder<'a, S> { /// Set the `viewerReadingProgress` field (optional) pub fn viewer_reading_progress( mut self, value: impl Into>>, ) -> Self { self.__unsafe_private_named.14 = value.into(); self } /// Set the `viewerReadingProgress` field to an Option value (optional) pub fn maybe_viewer_reading_progress( mut self, value: Option>, ) -> Self { self.__unsafe_private_named.14 = value; self } } impl<'a, S> EntryViewBuilder<'a, S> where S: entry_view_state::State, S::Authors: entry_view_state::IsSet, S::Uri: entry_view_state::IsSet, S::Cid: entry_view_state::IsSet, S::IndexedAt: entry_view_state::IsSet, S::Record: entry_view_state::IsSet, { /// Build the final struct pub fn build(self) -> EntryView<'a> { EntryView { authors: self.__unsafe_private_named.0.unwrap(), bookmark_count: self.__unsafe_private_named.1, cid: self.__unsafe_private_named.2.unwrap(), indexed_at: self.__unsafe_private_named.3.unwrap(), like_count: self.__unsafe_private_named.4, path: self.__unsafe_private_named.5, permissions: self.__unsafe_private_named.6, record: self.__unsafe_private_named.7.unwrap(), rendered_view: self.__unsafe_private_named.8, tags: self.__unsafe_private_named.9, title: self.__unsafe_private_named.10, uri: self.__unsafe_private_named.11.unwrap(), viewer_bookmark: self.__unsafe_private_named.12, viewer_like: self.__unsafe_private_named.13, viewer_reading_progress: self.__unsafe_private_named.14, extra_data: Default::default(), } } /// Build the final struct with custom extra_data pub fn build_with_data( self, extra_data: std::collections::BTreeMap< jacquard_common::smol_str::SmolStr, jacquard_common::types::value::Data<'a>, >, ) -> EntryView<'a> { EntryView { authors: self.__unsafe_private_named.0.unwrap(), bookmark_count: self.__unsafe_private_named.1, cid: self.__unsafe_private_named.2.unwrap(), indexed_at: self.__unsafe_private_named.3.unwrap(), like_count: self.__unsafe_private_named.4, path: self.__unsafe_private_named.5, permissions: self.__unsafe_private_named.6, record: self.__unsafe_private_named.7.unwrap(), rendered_view: self.__unsafe_private_named.8, tags: self.__unsafe_private_named.9, title: self.__unsafe_private_named.10, uri: self.__unsafe_private_named.11.unwrap(), viewer_bookmark: self.__unsafe_private_named.12, viewer_like: self.__unsafe_private_named.13, viewer_reading_progress: self.__unsafe_private_named.14, extra_data: Some(extra_data), } } } impl<'a> ::jacquard_lexicon::schema::LexiconSchema for EntryView<'a> { fn nsid() -> &'static str { "sh.weaver.notebook.defs" } fn def_name() -> &'static str { "entryView" } fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { lexicon_doc_sh_weaver_notebook_defs() } fn validate( &self, ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { Ok(()) } } /// Entry with feed-specific context (discovery reason, notebook context). #[jacquard_derive::lexicon] #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic )] #[serde(rename_all = "camelCase")] pub struct FeedEntryView<'a> { #[serde(borrow)] pub entry: crate::sh_weaver::notebook::EntryView<'a>, #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub notebook_context: std::option::Option< crate::sh_weaver::notebook::FeedNotebookContext<'a>, >, #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub reason: std::option::Option>, } pub mod feed_entry_view_state { pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; #[allow(unused)] use ::core::marker::PhantomData; mod sealed { pub trait Sealed {} } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Entry; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Entry = Unset; } ///State transition - sets the `entry` field to Set pub struct SetEntry(PhantomData S>); impl sealed::Sealed for SetEntry {} impl State for SetEntry { type Entry = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `entry` field pub struct entry(()); } } /// Builder for constructing an instance of this type pub struct FeedEntryViewBuilder<'a, S: feed_entry_view_state::State> { _phantom_state: ::core::marker::PhantomData S>, __unsafe_private_named: ( ::core::option::Option>, ::core::option::Option>, ::core::option::Option>, ), _phantom: ::core::marker::PhantomData<&'a ()>, } impl<'a> FeedEntryView<'a> { /// Create a new builder for this type pub fn new() -> FeedEntryViewBuilder<'a, feed_entry_view_state::Empty> { FeedEntryViewBuilder::new() } } impl<'a> FeedEntryViewBuilder<'a, feed_entry_view_state::Empty> { /// Create a new builder with all fields unset pub fn new() -> Self { FeedEntryViewBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: (None, None, None), _phantom: ::core::marker::PhantomData, } } } impl<'a, S> FeedEntryViewBuilder<'a, S> where S: feed_entry_view_state::State, S::Entry: feed_entry_view_state::IsUnset, { /// Set the `entry` field (required) pub fn entry( mut self, value: impl Into>, ) -> FeedEntryViewBuilder<'a, feed_entry_view_state::SetEntry> { self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); FeedEntryViewBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S: feed_entry_view_state::State> FeedEntryViewBuilder<'a, S> { /// Set the `notebookContext` field (optional) pub fn notebook_context( mut self, value: impl Into>>, ) -> Self { self.__unsafe_private_named.1 = value.into(); self } /// Set the `notebookContext` field to an Option value (optional) pub fn maybe_notebook_context( mut self, value: Option>, ) -> Self { self.__unsafe_private_named.1 = value; self } } impl<'a, S: feed_entry_view_state::State> FeedEntryViewBuilder<'a, S> { /// Set the `reason` field (optional) pub fn reason( mut self, value: impl Into>>, ) -> Self { self.__unsafe_private_named.2 = value.into(); self } /// Set the `reason` field to an Option value (optional) pub fn maybe_reason( mut self, value: Option>, ) -> Self { self.__unsafe_private_named.2 = value; self } } impl<'a, S> FeedEntryViewBuilder<'a, S> where S: feed_entry_view_state::State, S::Entry: feed_entry_view_state::IsSet, { /// Build the final struct pub fn build(self) -> FeedEntryView<'a> { FeedEntryView { entry: self.__unsafe_private_named.0.unwrap(), notebook_context: self.__unsafe_private_named.1, reason: self.__unsafe_private_named.2, extra_data: Default::default(), } } /// Build the final struct with custom extra_data pub fn build_with_data( self, extra_data: std::collections::BTreeMap< jacquard_common::smol_str::SmolStr, jacquard_common::types::value::Data<'a>, >, ) -> FeedEntryView<'a> { FeedEntryView { entry: self.__unsafe_private_named.0.unwrap(), notebook_context: self.__unsafe_private_named.1, reason: self.__unsafe_private_named.2, extra_data: Some(extra_data), } } } impl<'a> ::jacquard_lexicon::schema::LexiconSchema for FeedEntryView<'a> { fn nsid() -> &'static str { "sh.weaver.notebook.defs" } fn def_name() -> &'static str { "feedEntryView" } fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { lexicon_doc_sh_weaver_notebook_defs() } fn validate( &self, ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { Ok(()) } } /// Minimal notebook context for feed display. #[jacquard_derive::lexicon] #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic )] #[serde(rename_all = "camelCase")] pub struct FeedNotebookContext<'a> { #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub path: std::option::Option>, #[serde(borrow)] pub title: jacquard_common::CowStr<'a>, #[serde(borrow)] pub uri: jacquard_common::types::string::AtUri<'a>, } pub mod feed_notebook_context_state { pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; #[allow(unused)] use ::core::marker::PhantomData; mod sealed { pub trait Sealed {} } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Title; type Uri; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Title = Unset; type Uri = Unset; } ///State transition - sets the `title` field to Set pub struct SetTitle(PhantomData S>); impl sealed::Sealed for SetTitle {} impl State for SetTitle { type Title = Set; type Uri = S::Uri; } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData S>); impl sealed::Sealed for SetUri {} impl State for SetUri { type Title = S::Title; type Uri = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `title` field pub struct title(()); ///Marker type for the `uri` field pub struct uri(()); } } /// Builder for constructing an instance of this type pub struct FeedNotebookContextBuilder<'a, S: feed_notebook_context_state::State> { _phantom_state: ::core::marker::PhantomData S>, __unsafe_private_named: ( ::core::option::Option>, ::core::option::Option>, ::core::option::Option>, ), _phantom: ::core::marker::PhantomData<&'a ()>, } impl<'a> FeedNotebookContext<'a> { /// Create a new builder for this type pub fn new() -> FeedNotebookContextBuilder<'a, feed_notebook_context_state::Empty> { FeedNotebookContextBuilder::new() } } impl<'a> FeedNotebookContextBuilder<'a, feed_notebook_context_state::Empty> { /// Create a new builder with all fields unset pub fn new() -> Self { FeedNotebookContextBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: (None, None, None), _phantom: ::core::marker::PhantomData, } } } impl<'a, S: feed_notebook_context_state::State> FeedNotebookContextBuilder<'a, S> { /// Set the `path` field (optional) pub fn path( mut self, value: impl Into>>, ) -> Self { self.__unsafe_private_named.0 = value.into(); self } /// Set the `path` field to an Option value (optional) pub fn maybe_path(mut self, value: Option>) -> Self { self.__unsafe_private_named.0 = value; self } } impl<'a, S> FeedNotebookContextBuilder<'a, S> where S: feed_notebook_context_state::State, S::Title: feed_notebook_context_state::IsUnset, { /// Set the `title` field (required) pub fn title( mut self, value: impl Into>, ) -> FeedNotebookContextBuilder<'a, feed_notebook_context_state::SetTitle> { self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); FeedNotebookContextBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S> FeedNotebookContextBuilder<'a, S> where S: feed_notebook_context_state::State, S::Uri: feed_notebook_context_state::IsUnset, { /// Set the `uri` field (required) pub fn uri( mut self, value: impl Into>, ) -> FeedNotebookContextBuilder<'a, feed_notebook_context_state::SetUri> { self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); FeedNotebookContextBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S> FeedNotebookContextBuilder<'a, S> where S: feed_notebook_context_state::State, S::Title: feed_notebook_context_state::IsSet, S::Uri: feed_notebook_context_state::IsSet, { /// Build the final struct pub fn build(self) -> FeedNotebookContext<'a> { FeedNotebookContext { path: self.__unsafe_private_named.0, title: self.__unsafe_private_named.1.unwrap(), uri: self.__unsafe_private_named.2.unwrap(), extra_data: Default::default(), } } /// Build the final struct with custom extra_data pub fn build_with_data( self, extra_data: std::collections::BTreeMap< jacquard_common::smol_str::SmolStr, jacquard_common::types::value::Data<'a>, >, ) -> FeedNotebookContext<'a> { FeedNotebookContext { path: self.__unsafe_private_named.0, title: self.__unsafe_private_named.1.unwrap(), uri: self.__unsafe_private_named.2.unwrap(), extra_data: Some(extra_data), } } } impl<'a> ::jacquard_lexicon::schema::LexiconSchema for FeedNotebookContext<'a> { fn nsid() -> &'static str { "sh.weaver.notebook.defs" } fn def_name() -> &'static str { "feedNotebookContext" } fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { lexicon_doc_sh_weaver_notebook_defs() } fn validate( &self, ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { Ok(()) } } ///Why this entry appeared in the feed. #[jacquard_derive::open_union] #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic )] #[serde(tag = "$type")] #[serde(bound(deserialize = "'de: 'a"))] pub enum FeedReason<'a> { #[serde(rename = "sh.weaver.notebook.defs#reasonLike")] ReasonLike(Box>), #[serde(rename = "sh.weaver.notebook.defs#reasonBookmark")] ReasonBookmark(Box>), #[serde(rename = "sh.weaver.notebook.defs#reasonSubscription")] ReasonSubscription(Box>), } #[jacquard_derive::lexicon] #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic )] #[serde(rename_all = "camelCase")] pub struct NotebookView<'a> { #[serde(borrow)] pub authors: Vec>, #[serde(skip_serializing_if = "std::option::Option::is_none")] pub bookmark_count: std::option::Option, #[serde(borrow)] pub cid: jacquard_common::types::string::Cid<'a>, #[serde(skip_serializing_if = "std::option::Option::is_none")] pub entry_count: std::option::Option, pub indexed_at: jacquard_common::types::string::Datetime, #[serde(skip_serializing_if = "std::option::Option::is_none")] pub like_count: std::option::Option, #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub path: std::option::Option>, #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub permissions: std::option::Option< crate::sh_weaver::notebook::PermissionsState<'a>, >, #[serde(borrow)] pub record: jacquard_common::types::value::Data<'a>, #[serde(skip_serializing_if = "std::option::Option::is_none")] pub subscriber_count: std::option::Option, #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub tags: std::option::Option>, #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub title: std::option::Option>, #[serde(borrow)] pub uri: jacquard_common::types::string::AtUri<'a>, #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub viewer_bookmark: std::option::Option>, #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub viewer_like: std::option::Option>, #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub viewer_reading_progress: std::option::Option< crate::sh_weaver::notebook::ReadingProgress<'a>, >, #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub viewer_subscription: std::option::Option< jacquard_common::types::string::AtUri<'a>, >, } pub mod notebook_view_state { pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; #[allow(unused)] use ::core::marker::PhantomData; mod sealed { pub trait Sealed {} } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Record; type Authors; type Cid; type Uri; type IndexedAt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Record = Unset; type Authors = Unset; type Cid = Unset; type Uri = Unset; type IndexedAt = Unset; } ///State transition - sets the `record` field to Set pub struct SetRecord(PhantomData S>); impl sealed::Sealed for SetRecord {} impl State for SetRecord { type Record = Set; type Authors = S::Authors; type Cid = S::Cid; type Uri = S::Uri; type IndexedAt = S::IndexedAt; } ///State transition - sets the `authors` field to Set pub struct SetAuthors(PhantomData S>); impl sealed::Sealed for SetAuthors {} impl State for SetAuthors { type Record = S::Record; type Authors = Set; type Cid = S::Cid; type Uri = S::Uri; type IndexedAt = S::IndexedAt; } ///State transition - sets the `cid` field to Set pub struct SetCid(PhantomData S>); impl sealed::Sealed for SetCid {} impl State for SetCid { type Record = S::Record; type Authors = S::Authors; type Cid = Set; type Uri = S::Uri; type IndexedAt = S::IndexedAt; } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData S>); impl sealed::Sealed for SetUri {} impl State for SetUri { type Record = S::Record; type Authors = S::Authors; type Cid = S::Cid; type Uri = Set; type IndexedAt = S::IndexedAt; } ///State transition - sets the `indexed_at` field to Set pub struct SetIndexedAt(PhantomData S>); impl sealed::Sealed for SetIndexedAt {} impl State for SetIndexedAt { type Record = S::Record; type Authors = S::Authors; type Cid = S::Cid; type Uri = S::Uri; type IndexedAt = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `record` field pub struct record(()); ///Marker type for the `authors` field pub struct authors(()); ///Marker type for the `cid` field pub struct cid(()); ///Marker type for the `uri` field pub struct uri(()); ///Marker type for the `indexed_at` field pub struct indexed_at(()); } } /// Builder for constructing an instance of this type pub struct NotebookViewBuilder<'a, S: notebook_view_state::State> { _phantom_state: ::core::marker::PhantomData S>, __unsafe_private_named: ( ::core::option::Option>>, ::core::option::Option, ::core::option::Option>, ::core::option::Option, ::core::option::Option, ::core::option::Option, ::core::option::Option>, ::core::option::Option>, ::core::option::Option>, ::core::option::Option, ::core::option::Option>, ::core::option::Option>, ::core::option::Option>, ::core::option::Option>, ::core::option::Option>, ::core::option::Option>, ::core::option::Option>, ), _phantom: ::core::marker::PhantomData<&'a ()>, } impl<'a> NotebookView<'a> { /// Create a new builder for this type pub fn new() -> NotebookViewBuilder<'a, notebook_view_state::Empty> { NotebookViewBuilder::new() } } impl<'a> NotebookViewBuilder<'a, notebook_view_state::Empty> { /// Create a new builder with all fields unset pub fn new() -> Self { NotebookViewBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: ( None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, None, ), _phantom: ::core::marker::PhantomData, } } } impl<'a, S> NotebookViewBuilder<'a, S> where S: notebook_view_state::State, S::Authors: notebook_view_state::IsUnset, { /// Set the `authors` field (required) pub fn authors( mut self, value: impl Into>>, ) -> NotebookViewBuilder<'a, notebook_view_state::SetAuthors> { self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); NotebookViewBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S: notebook_view_state::State> NotebookViewBuilder<'a, S> { /// Set the `bookmarkCount` field (optional) pub fn bookmark_count(mut self, value: impl Into>) -> Self { self.__unsafe_private_named.1 = value.into(); self } /// Set the `bookmarkCount` field to an Option value (optional) pub fn maybe_bookmark_count(mut self, value: Option) -> Self { self.__unsafe_private_named.1 = value; self } } impl<'a, S> NotebookViewBuilder<'a, S> where S: notebook_view_state::State, S::Cid: notebook_view_state::IsUnset, { /// Set the `cid` field (required) pub fn cid( mut self, value: impl Into>, ) -> NotebookViewBuilder<'a, notebook_view_state::SetCid> { self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); NotebookViewBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S: notebook_view_state::State> NotebookViewBuilder<'a, S> { /// Set the `entryCount` field (optional) pub fn entry_count(mut self, value: impl Into>) -> Self { self.__unsafe_private_named.3 = value.into(); self } /// Set the `entryCount` field to an Option value (optional) pub fn maybe_entry_count(mut self, value: Option) -> Self { self.__unsafe_private_named.3 = value; self } } impl<'a, S> NotebookViewBuilder<'a, S> where S: notebook_view_state::State, S::IndexedAt: notebook_view_state::IsUnset, { /// Set the `indexedAt` field (required) pub fn indexed_at( mut self, value: impl Into, ) -> NotebookViewBuilder<'a, notebook_view_state::SetIndexedAt> { self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into()); NotebookViewBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S: notebook_view_state::State> NotebookViewBuilder<'a, S> { /// Set the `likeCount` field (optional) pub fn like_count(mut self, value: impl Into>) -> Self { self.__unsafe_private_named.5 = value.into(); self } /// Set the `likeCount` field to an Option value (optional) pub fn maybe_like_count(mut self, value: Option) -> Self { self.__unsafe_private_named.5 = value; self } } impl<'a, S: notebook_view_state::State> NotebookViewBuilder<'a, S> { /// Set the `path` field (optional) pub fn path( mut self, value: impl Into>>, ) -> Self { self.__unsafe_private_named.6 = value.into(); self } /// Set the `path` field to an Option value (optional) pub fn maybe_path( mut self, value: Option>, ) -> Self { self.__unsafe_private_named.6 = value; self } } impl<'a, S: notebook_view_state::State> NotebookViewBuilder<'a, S> { /// Set the `permissions` field (optional) pub fn permissions( mut self, value: impl Into>>, ) -> Self { self.__unsafe_private_named.7 = value.into(); self } /// Set the `permissions` field to an Option value (optional) pub fn maybe_permissions( mut self, value: Option>, ) -> Self { self.__unsafe_private_named.7 = value; self } } impl<'a, S> NotebookViewBuilder<'a, S> where S: notebook_view_state::State, S::Record: notebook_view_state::IsUnset, { /// Set the `record` field (required) pub fn record( mut self, value: impl Into>, ) -> NotebookViewBuilder<'a, notebook_view_state::SetRecord> { self.__unsafe_private_named.8 = ::core::option::Option::Some(value.into()); NotebookViewBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S: notebook_view_state::State> NotebookViewBuilder<'a, S> { /// Set the `subscriberCount` field (optional) pub fn subscriber_count(mut self, value: impl Into>) -> Self { self.__unsafe_private_named.9 = value.into(); self } /// Set the `subscriberCount` field to an Option value (optional) pub fn maybe_subscriber_count(mut self, value: Option) -> Self { self.__unsafe_private_named.9 = value; self } } impl<'a, S: notebook_view_state::State> NotebookViewBuilder<'a, S> { /// Set the `tags` field (optional) pub fn tags( mut self, value: impl Into>>, ) -> Self { self.__unsafe_private_named.10 = value.into(); self } /// Set the `tags` field to an Option value (optional) pub fn maybe_tags( mut self, value: Option>, ) -> Self { self.__unsafe_private_named.10 = value; self } } impl<'a, S: notebook_view_state::State> NotebookViewBuilder<'a, S> { /// Set the `title` field (optional) pub fn title( mut self, value: impl Into>>, ) -> Self { self.__unsafe_private_named.11 = value.into(); self } /// Set the `title` field to an Option value (optional) pub fn maybe_title( mut self, value: Option>, ) -> Self { self.__unsafe_private_named.11 = value; self } } impl<'a, S> NotebookViewBuilder<'a, S> where S: notebook_view_state::State, S::Uri: notebook_view_state::IsUnset, { /// Set the `uri` field (required) pub fn uri( mut self, value: impl Into>, ) -> NotebookViewBuilder<'a, notebook_view_state::SetUri> { self.__unsafe_private_named.12 = ::core::option::Option::Some(value.into()); NotebookViewBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S: notebook_view_state::State> NotebookViewBuilder<'a, S> { /// Set the `viewerBookmark` field (optional) pub fn viewer_bookmark( mut self, value: impl Into>>, ) -> Self { self.__unsafe_private_named.13 = value.into(); self } /// Set the `viewerBookmark` field to an Option value (optional) pub fn maybe_viewer_bookmark( mut self, value: Option>, ) -> Self { self.__unsafe_private_named.13 = value; self } } impl<'a, S: notebook_view_state::State> NotebookViewBuilder<'a, S> { /// Set the `viewerLike` field (optional) pub fn viewer_like( mut self, value: impl Into>>, ) -> Self { self.__unsafe_private_named.14 = value.into(); self } /// Set the `viewerLike` field to an Option value (optional) pub fn maybe_viewer_like( mut self, value: Option>, ) -> Self { self.__unsafe_private_named.14 = value; self } } impl<'a, S: notebook_view_state::State> NotebookViewBuilder<'a, S> { /// Set the `viewerReadingProgress` field (optional) pub fn viewer_reading_progress( mut self, value: impl Into>>, ) -> Self { self.__unsafe_private_named.15 = value.into(); self } /// Set the `viewerReadingProgress` field to an Option value (optional) pub fn maybe_viewer_reading_progress( mut self, value: Option>, ) -> Self { self.__unsafe_private_named.15 = value; self } } impl<'a, S: notebook_view_state::State> NotebookViewBuilder<'a, S> { /// Set the `viewerSubscription` field (optional) pub fn viewer_subscription( mut self, value: impl Into>>, ) -> Self { self.__unsafe_private_named.16 = value.into(); self } /// Set the `viewerSubscription` field to an Option value (optional) pub fn maybe_viewer_subscription( mut self, value: Option>, ) -> Self { self.__unsafe_private_named.16 = value; self } } impl<'a, S> NotebookViewBuilder<'a, S> where S: notebook_view_state::State, S::Record: notebook_view_state::IsSet, S::Authors: notebook_view_state::IsSet, S::Cid: notebook_view_state::IsSet, S::Uri: notebook_view_state::IsSet, S::IndexedAt: notebook_view_state::IsSet, { /// Build the final struct pub fn build(self) -> NotebookView<'a> { NotebookView { authors: self.__unsafe_private_named.0.unwrap(), bookmark_count: self.__unsafe_private_named.1, cid: self.__unsafe_private_named.2.unwrap(), entry_count: self.__unsafe_private_named.3, indexed_at: self.__unsafe_private_named.4.unwrap(), like_count: self.__unsafe_private_named.5, path: self.__unsafe_private_named.6, permissions: self.__unsafe_private_named.7, record: self.__unsafe_private_named.8.unwrap(), subscriber_count: self.__unsafe_private_named.9, tags: self.__unsafe_private_named.10, title: self.__unsafe_private_named.11, uri: self.__unsafe_private_named.12.unwrap(), viewer_bookmark: self.__unsafe_private_named.13, viewer_like: self.__unsafe_private_named.14, viewer_reading_progress: self.__unsafe_private_named.15, viewer_subscription: self.__unsafe_private_named.16, extra_data: Default::default(), } } /// Build the final struct with custom extra_data pub fn build_with_data( self, extra_data: std::collections::BTreeMap< jacquard_common::smol_str::SmolStr, jacquard_common::types::value::Data<'a>, >, ) -> NotebookView<'a> { NotebookView { authors: self.__unsafe_private_named.0.unwrap(), bookmark_count: self.__unsafe_private_named.1, cid: self.__unsafe_private_named.2.unwrap(), entry_count: self.__unsafe_private_named.3, indexed_at: self.__unsafe_private_named.4.unwrap(), like_count: self.__unsafe_private_named.5, path: self.__unsafe_private_named.6, permissions: self.__unsafe_private_named.7, record: self.__unsafe_private_named.8.unwrap(), subscriber_count: self.__unsafe_private_named.9, tags: self.__unsafe_private_named.10, title: self.__unsafe_private_named.11, uri: self.__unsafe_private_named.12.unwrap(), viewer_bookmark: self.__unsafe_private_named.13, viewer_like: self.__unsafe_private_named.14, viewer_reading_progress: self.__unsafe_private_named.15, viewer_subscription: self.__unsafe_private_named.16, extra_data: Some(extra_data), } } } impl<'a> ::jacquard_lexicon::schema::LexiconSchema for NotebookView<'a> { fn nsid() -> &'static str { "sh.weaver.notebook.defs" } fn def_name() -> &'static str { "notebookView" } fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { lexicon_doc_sh_weaver_notebook_defs() } fn validate( &self, ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { Ok(()) } } /// Hydrated view of a page (entries displayed together). #[jacquard_derive::lexicon] #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic )] #[serde(rename_all = "camelCase")] pub struct PageView<'a> { #[serde(borrow)] pub cid: jacquard_common::types::string::Cid<'a>, #[serde(skip_serializing_if = "std::option::Option::is_none")] pub entry_count: std::option::Option, pub indexed_at: jacquard_common::types::string::Datetime, #[serde(borrow)] pub notebook: crate::sh_weaver::notebook::NotebookView<'a>, #[serde(borrow)] pub record: jacquard_common::types::value::Data<'a>, #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub tags: std::option::Option>, #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub title: std::option::Option>, #[serde(borrow)] pub uri: jacquard_common::types::string::AtUri<'a>, } pub mod page_view_state { pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; #[allow(unused)] use ::core::marker::PhantomData; mod sealed { pub trait Sealed {} } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Notebook; type Uri; type IndexedAt; type Cid; type Record; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Notebook = Unset; type Uri = Unset; type IndexedAt = Unset; type Cid = Unset; type Record = Unset; } ///State transition - sets the `notebook` field to Set pub struct SetNotebook(PhantomData S>); impl sealed::Sealed for SetNotebook {} impl State for SetNotebook { type Notebook = Set; type Uri = S::Uri; type IndexedAt = S::IndexedAt; type Cid = S::Cid; type Record = S::Record; } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData S>); impl sealed::Sealed for SetUri {} impl State for SetUri { type Notebook = S::Notebook; type Uri = Set; type IndexedAt = S::IndexedAt; type Cid = S::Cid; type Record = S::Record; } ///State transition - sets the `indexed_at` field to Set pub struct SetIndexedAt(PhantomData S>); impl sealed::Sealed for SetIndexedAt {} impl State for SetIndexedAt { type Notebook = S::Notebook; type Uri = S::Uri; type IndexedAt = Set; type Cid = S::Cid; type Record = S::Record; } ///State transition - sets the `cid` field to Set pub struct SetCid(PhantomData S>); impl sealed::Sealed for SetCid {} impl State for SetCid { type Notebook = S::Notebook; type Uri = S::Uri; type IndexedAt = S::IndexedAt; type Cid = Set; type Record = S::Record; } ///State transition - sets the `record` field to Set pub struct SetRecord(PhantomData S>); impl sealed::Sealed for SetRecord {} impl State for SetRecord { type Notebook = S::Notebook; type Uri = S::Uri; type IndexedAt = S::IndexedAt; type Cid = S::Cid; type Record = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `notebook` field pub struct notebook(()); ///Marker type for the `uri` field pub struct uri(()); ///Marker type for the `indexed_at` field pub struct indexed_at(()); ///Marker type for the `cid` field pub struct cid(()); ///Marker type for the `record` field pub struct record(()); } } /// Builder for constructing an instance of this type pub struct PageViewBuilder<'a, S: page_view_state::State> { _phantom_state: ::core::marker::PhantomData S>, __unsafe_private_named: ( ::core::option::Option>, ::core::option::Option, ::core::option::Option, ::core::option::Option>, ::core::option::Option>, ::core::option::Option>, ::core::option::Option>, ::core::option::Option>, ), _phantom: ::core::marker::PhantomData<&'a ()>, } impl<'a> PageView<'a> { /// Create a new builder for this type pub fn new() -> PageViewBuilder<'a, page_view_state::Empty> { PageViewBuilder::new() } } impl<'a> PageViewBuilder<'a, page_view_state::Empty> { /// Create a new builder with all fields unset pub fn new() -> Self { PageViewBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: (None, None, None, None, None, None, None, None), _phantom: ::core::marker::PhantomData, } } } impl<'a, S> PageViewBuilder<'a, S> where S: page_view_state::State, S::Cid: page_view_state::IsUnset, { /// Set the `cid` field (required) pub fn cid( mut self, value: impl Into>, ) -> PageViewBuilder<'a, page_view_state::SetCid> { self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); PageViewBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S: page_view_state::State> PageViewBuilder<'a, S> { /// Set the `entryCount` field (optional) pub fn entry_count(mut self, value: impl Into>) -> Self { self.__unsafe_private_named.1 = value.into(); self } /// Set the `entryCount` field to an Option value (optional) pub fn maybe_entry_count(mut self, value: Option) -> Self { self.__unsafe_private_named.1 = value; self } } impl<'a, S> PageViewBuilder<'a, S> where S: page_view_state::State, S::IndexedAt: page_view_state::IsUnset, { /// Set the `indexedAt` field (required) pub fn indexed_at( mut self, value: impl Into, ) -> PageViewBuilder<'a, page_view_state::SetIndexedAt> { self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); PageViewBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S> PageViewBuilder<'a, S> where S: page_view_state::State, S::Notebook: page_view_state::IsUnset, { /// Set the `notebook` field (required) pub fn notebook( mut self, value: impl Into>, ) -> PageViewBuilder<'a, page_view_state::SetNotebook> { self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); PageViewBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S> PageViewBuilder<'a, S> where S: page_view_state::State, S::Record: page_view_state::IsUnset, { /// Set the `record` field (required) pub fn record( mut self, value: impl Into>, ) -> PageViewBuilder<'a, page_view_state::SetRecord> { self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into()); PageViewBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S: page_view_state::State> PageViewBuilder<'a, S> { /// Set the `tags` field (optional) pub fn tags( mut self, value: impl Into>>, ) -> Self { self.__unsafe_private_named.5 = value.into(); self } /// Set the `tags` field to an Option value (optional) pub fn maybe_tags( mut self, value: Option>, ) -> Self { self.__unsafe_private_named.5 = value; self } } impl<'a, S: page_view_state::State> PageViewBuilder<'a, S> { /// Set the `title` field (optional) pub fn title( mut self, value: impl Into>>, ) -> Self { self.__unsafe_private_named.6 = value.into(); self } /// Set the `title` field to an Option value (optional) pub fn maybe_title( mut self, value: Option>, ) -> Self { self.__unsafe_private_named.6 = value; self } } impl<'a, S> PageViewBuilder<'a, S> where S: page_view_state::State, S::Uri: page_view_state::IsUnset, { /// Set the `uri` field (required) pub fn uri( mut self, value: impl Into>, ) -> PageViewBuilder<'a, page_view_state::SetUri> { self.__unsafe_private_named.7 = ::core::option::Option::Some(value.into()); PageViewBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S> PageViewBuilder<'a, S> where S: page_view_state::State, S::Notebook: page_view_state::IsSet, S::Uri: page_view_state::IsSet, S::IndexedAt: page_view_state::IsSet, S::Cid: page_view_state::IsSet, S::Record: page_view_state::IsSet, { /// Build the final struct pub fn build(self) -> PageView<'a> { PageView { cid: self.__unsafe_private_named.0.unwrap(), entry_count: self.__unsafe_private_named.1, indexed_at: self.__unsafe_private_named.2.unwrap(), notebook: self.__unsafe_private_named.3.unwrap(), record: self.__unsafe_private_named.4.unwrap(), tags: self.__unsafe_private_named.5, title: self.__unsafe_private_named.6, uri: self.__unsafe_private_named.7.unwrap(), extra_data: Default::default(), } } /// Build the final struct with custom extra_data pub fn build_with_data( self, extra_data: std::collections::BTreeMap< jacquard_common::smol_str::SmolStr, jacquard_common::types::value::Data<'a>, >, ) -> PageView<'a> { PageView { cid: self.__unsafe_private_named.0.unwrap(), entry_count: self.__unsafe_private_named.1, indexed_at: self.__unsafe_private_named.2.unwrap(), notebook: self.__unsafe_private_named.3.unwrap(), record: self.__unsafe_private_named.4.unwrap(), tags: self.__unsafe_private_named.5, title: self.__unsafe_private_named.6, uri: self.__unsafe_private_named.7.unwrap(), extra_data: Some(extra_data), } } } impl<'a> ::jacquard_lexicon::schema::LexiconSchema for PageView<'a> { fn nsid() -> &'static str { "sh.weaver.notebook.defs" } fn def_name() -> &'static str { "pageView" } fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { lexicon_doc_sh_weaver_notebook_defs() } fn validate( &self, ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { Ok(()) } } /// The path of the notebook. pub type Path<'a> = jacquard_common::CowStr<'a>; /// A single permission grant. For resource authority: source=resource URI, grantedAt=createdAt. For invitees: source=invite URI, grantedAt=accept createdAt. #[jacquard_derive::lexicon] #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic )] #[serde(rename_all = "camelCase")] pub struct PermissionGrant<'a> { #[serde(borrow)] pub did: jacquard_common::types::string::Did<'a>, /// For authority: record createdAt. For invitees: accept createdAt pub granted_at: jacquard_common::types::string::Datetime, /// direct = this resource (includes authority), inherited = via notebook invite #[serde(borrow)] pub scope: PermissionGrantScope<'a>, /// For authority: resource URI. For invitees: invite URI #[serde(borrow)] pub source: jacquard_common::types::string::AtUri<'a>, } pub mod permission_grant_state { pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; #[allow(unused)] use ::core::marker::PhantomData; mod sealed { pub trait Sealed {} } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Scope; type Did; type Source; type GrantedAt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Scope = Unset; type Did = Unset; type Source = Unset; type GrantedAt = Unset; } ///State transition - sets the `scope` field to Set pub struct SetScope(PhantomData S>); impl sealed::Sealed for SetScope {} impl State for SetScope { type Scope = Set; type Did = S::Did; type Source = S::Source; type GrantedAt = S::GrantedAt; } ///State transition - sets the `did` field to Set pub struct SetDid(PhantomData S>); impl sealed::Sealed for SetDid {} impl State for SetDid { type Scope = S::Scope; type Did = Set; type Source = S::Source; type GrantedAt = S::GrantedAt; } ///State transition - sets the `source` field to Set pub struct SetSource(PhantomData S>); impl sealed::Sealed for SetSource {} impl State for SetSource { type Scope = S::Scope; type Did = S::Did; type Source = Set; type GrantedAt = S::GrantedAt; } ///State transition - sets the `granted_at` field to Set pub struct SetGrantedAt(PhantomData S>); impl sealed::Sealed for SetGrantedAt {} impl State for SetGrantedAt { type Scope = S::Scope; type Did = S::Did; type Source = S::Source; type GrantedAt = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `scope` field pub struct scope(()); ///Marker type for the `did` field pub struct did(()); ///Marker type for the `source` field pub struct source(()); ///Marker type for the `granted_at` field pub struct granted_at(()); } } /// Builder for constructing an instance of this type pub struct PermissionGrantBuilder<'a, S: permission_grant_state::State> { _phantom_state: ::core::marker::PhantomData S>, __unsafe_private_named: ( ::core::option::Option>, ::core::option::Option, ::core::option::Option>, ::core::option::Option>, ), _phantom: ::core::marker::PhantomData<&'a ()>, } impl<'a> PermissionGrant<'a> { /// Create a new builder for this type pub fn new() -> PermissionGrantBuilder<'a, permission_grant_state::Empty> { PermissionGrantBuilder::new() } } impl<'a> PermissionGrantBuilder<'a, permission_grant_state::Empty> { /// Create a new builder with all fields unset pub fn new() -> Self { PermissionGrantBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: (None, None, None, None), _phantom: ::core::marker::PhantomData, } } } impl<'a, S> PermissionGrantBuilder<'a, S> where S: permission_grant_state::State, S::Did: permission_grant_state::IsUnset, { /// Set the `did` field (required) pub fn did( mut self, value: impl Into>, ) -> PermissionGrantBuilder<'a, permission_grant_state::SetDid> { self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); PermissionGrantBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S> PermissionGrantBuilder<'a, S> where S: permission_grant_state::State, S::GrantedAt: permission_grant_state::IsUnset, { /// Set the `grantedAt` field (required) pub fn granted_at( mut self, value: impl Into, ) -> PermissionGrantBuilder<'a, permission_grant_state::SetGrantedAt> { self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); PermissionGrantBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S> PermissionGrantBuilder<'a, S> where S: permission_grant_state::State, S::Scope: permission_grant_state::IsUnset, { /// Set the `scope` field (required) pub fn scope( mut self, value: impl Into>, ) -> PermissionGrantBuilder<'a, permission_grant_state::SetScope> { self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); PermissionGrantBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S> PermissionGrantBuilder<'a, S> where S: permission_grant_state::State, S::Source: permission_grant_state::IsUnset, { /// Set the `source` field (required) pub fn source( mut self, value: impl Into>, ) -> PermissionGrantBuilder<'a, permission_grant_state::SetSource> { self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); PermissionGrantBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S> PermissionGrantBuilder<'a, S> where S: permission_grant_state::State, S::Scope: permission_grant_state::IsSet, S::Did: permission_grant_state::IsSet, S::Source: permission_grant_state::IsSet, S::GrantedAt: permission_grant_state::IsSet, { /// Build the final struct pub fn build(self) -> PermissionGrant<'a> { PermissionGrant { did: self.__unsafe_private_named.0.unwrap(), granted_at: self.__unsafe_private_named.1.unwrap(), scope: self.__unsafe_private_named.2.unwrap(), source: self.__unsafe_private_named.3.unwrap(), extra_data: Default::default(), } } /// Build the final struct with custom extra_data pub fn build_with_data( self, extra_data: std::collections::BTreeMap< jacquard_common::smol_str::SmolStr, jacquard_common::types::value::Data<'a>, >, ) -> PermissionGrant<'a> { PermissionGrant { did: self.__unsafe_private_named.0.unwrap(), granted_at: self.__unsafe_private_named.1.unwrap(), scope: self.__unsafe_private_named.2.unwrap(), source: self.__unsafe_private_named.3.unwrap(), extra_data: Some(extra_data), } } } /// direct = this resource (includes authority), inherited = via notebook invite #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub enum PermissionGrantScope<'a> { Direct, Inherited, Other(jacquard_common::CowStr<'a>), } impl<'a> PermissionGrantScope<'a> { pub fn as_str(&self) -> &str { match self { Self::Direct => "direct", Self::Inherited => "inherited", Self::Other(s) => s.as_ref(), } } } impl<'a> From<&'a str> for PermissionGrantScope<'a> { fn from(s: &'a str) -> Self { match s { "direct" => Self::Direct, "inherited" => Self::Inherited, _ => Self::Other(jacquard_common::CowStr::from(s)), } } } impl<'a> From for PermissionGrantScope<'a> { fn from(s: String) -> Self { match s.as_str() { "direct" => Self::Direct, "inherited" => Self::Inherited, _ => Self::Other(jacquard_common::CowStr::from(s)), } } } impl<'a> core::fmt::Display for PermissionGrantScope<'a> { fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { write!(f, "{}", self.as_str()) } } impl<'a> AsRef for PermissionGrantScope<'a> { fn as_ref(&self) -> &str { self.as_str() } } impl<'a> serde::Serialize for PermissionGrantScope<'a> { fn serialize(&self, serializer: S) -> Result where S: serde::Serializer, { serializer.serialize_str(self.as_str()) } } impl<'de, 'a> serde::Deserialize<'de> for PermissionGrantScope<'a> where 'de: 'a, { fn deserialize(deserializer: D) -> Result where D: serde::Deserializer<'de>, { let s = <&'de str>::deserialize(deserializer)?; Ok(Self::from(s)) } } impl<'a> Default for PermissionGrantScope<'a> { fn default() -> Self { Self::Other(Default::default()) } } impl jacquard_common::IntoStatic for PermissionGrantScope<'_> { type Output = PermissionGrantScope<'static>; fn into_static(self) -> Self::Output { match self { PermissionGrantScope::Direct => PermissionGrantScope::Direct, PermissionGrantScope::Inherited => PermissionGrantScope::Inherited, PermissionGrantScope::Other(v) => { PermissionGrantScope::Other(v.into_static()) } } } } impl<'a> ::jacquard_lexicon::schema::LexiconSchema for PermissionGrant<'a> { fn nsid() -> &'static str { "sh.weaver.notebook.defs" } fn def_name() -> &'static str { "permissionGrant" } fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { lexicon_doc_sh_weaver_notebook_defs() } fn validate( &self, ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { Ok(()) } } /// ACL-style permissions for a resource. Separate from authors (who contributed). #[jacquard_derive::lexicon] #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic )] #[serde(rename_all = "camelCase")] pub struct PermissionsState<'a> { /// DIDs that can edit this resource #[serde(borrow)] pub editors: Vec>, /// DIDs that can view (future use) #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub viewers: std::option::Option< Vec>, >, } pub mod permissions_state_state { pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; #[allow(unused)] use ::core::marker::PhantomData; mod sealed { pub trait Sealed {} } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Editors; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Editors = Unset; } ///State transition - sets the `editors` field to Set pub struct SetEditors(PhantomData S>); impl sealed::Sealed for SetEditors {} impl State for SetEditors { type Editors = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `editors` field pub struct editors(()); } } /// Builder for constructing an instance of this type pub struct PermissionsStateBuilder<'a, S: permissions_state_state::State> { _phantom_state: ::core::marker::PhantomData S>, __unsafe_private_named: ( ::core::option::Option>>, ::core::option::Option>>, ), _phantom: ::core::marker::PhantomData<&'a ()>, } impl<'a> PermissionsState<'a> { /// Create a new builder for this type pub fn new() -> PermissionsStateBuilder<'a, permissions_state_state::Empty> { PermissionsStateBuilder::new() } } impl<'a> PermissionsStateBuilder<'a, permissions_state_state::Empty> { /// Create a new builder with all fields unset pub fn new() -> Self { PermissionsStateBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: (None, None), _phantom: ::core::marker::PhantomData, } } } impl<'a, S> PermissionsStateBuilder<'a, S> where S: permissions_state_state::State, S::Editors: permissions_state_state::IsUnset, { /// Set the `editors` field (required) pub fn editors( mut self, value: impl Into>>, ) -> PermissionsStateBuilder<'a, permissions_state_state::SetEditors> { self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); PermissionsStateBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S: permissions_state_state::State> PermissionsStateBuilder<'a, S> { /// Set the `viewers` field (optional) pub fn viewers( mut self, value: impl Into>>>, ) -> Self { self.__unsafe_private_named.1 = value.into(); self } /// Set the `viewers` field to an Option value (optional) pub fn maybe_viewers( mut self, value: Option>>, ) -> Self { self.__unsafe_private_named.1 = value; self } } impl<'a, S> PermissionsStateBuilder<'a, S> where S: permissions_state_state::State, S::Editors: permissions_state_state::IsSet, { /// Build the final struct pub fn build(self) -> PermissionsState<'a> { PermissionsState { editors: self.__unsafe_private_named.0.unwrap(), viewers: self.__unsafe_private_named.1, extra_data: Default::default(), } } /// Build the final struct with custom extra_data pub fn build_with_data( self, extra_data: std::collections::BTreeMap< jacquard_common::smol_str::SmolStr, jacquard_common::types::value::Data<'a>, >, ) -> PermissionsState<'a> { PermissionsState { editors: self.__unsafe_private_named.0.unwrap(), viewers: self.__unsafe_private_named.1, extra_data: Some(extra_data), } } } impl<'a> ::jacquard_lexicon::schema::LexiconSchema for PermissionsState<'a> { fn nsid() -> &'static str { "sh.weaver.notebook.defs" } fn def_name() -> &'static str { "permissionsState" } fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { lexicon_doc_sh_weaver_notebook_defs() } fn validate( &self, ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { Ok(()) } } /// A published version of an entry in a collaborator's repo. #[jacquard_derive::lexicon] #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic )] #[serde(rename_all = "camelCase")] pub struct PublishedVersionView<'a> { #[serde(borrow)] pub cid: jacquard_common::types::string::Cid<'a>, /// If content differs, the version it diverged from #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub diverged_from: std::option::Option< crate::com_atproto::repo::strong_ref::StrongRef<'a>, >, /// True if this is the 'primary' version (owner's repo) #[serde(skip_serializing_if = "std::option::Option::is_none")] pub is_canonical: std::option::Option, pub published_at: jacquard_common::types::string::Datetime, #[serde(borrow)] pub publisher: crate::sh_weaver::actor::ProfileViewBasic<'a>, #[serde(skip_serializing_if = "std::option::Option::is_none")] pub updated_at: std::option::Option, #[serde(borrow)] pub uri: jacquard_common::types::string::AtUri<'a>, } pub mod published_version_view_state { pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; #[allow(unused)] use ::core::marker::PhantomData; mod sealed { pub trait Sealed {} } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Cid; type Publisher; type Uri; type PublishedAt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Cid = Unset; type Publisher = Unset; type Uri = Unset; type PublishedAt = Unset; } ///State transition - sets the `cid` field to Set pub struct SetCid(PhantomData S>); impl sealed::Sealed for SetCid {} impl State for SetCid { type Cid = Set; type Publisher = S::Publisher; type Uri = S::Uri; type PublishedAt = S::PublishedAt; } ///State transition - sets the `publisher` field to Set pub struct SetPublisher(PhantomData S>); impl sealed::Sealed for SetPublisher {} impl State for SetPublisher { type Cid = S::Cid; type Publisher = Set; type Uri = S::Uri; type PublishedAt = S::PublishedAt; } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData S>); impl sealed::Sealed for SetUri {} impl State for SetUri { type Cid = S::Cid; type Publisher = S::Publisher; type Uri = Set; type PublishedAt = S::PublishedAt; } ///State transition - sets the `published_at` field to Set pub struct SetPublishedAt(PhantomData S>); impl sealed::Sealed for SetPublishedAt {} impl State for SetPublishedAt { type Cid = S::Cid; type Publisher = S::Publisher; type Uri = S::Uri; type PublishedAt = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `cid` field pub struct cid(()); ///Marker type for the `publisher` field pub struct publisher(()); ///Marker type for the `uri` field pub struct uri(()); ///Marker type for the `published_at` field pub struct published_at(()); } } /// Builder for constructing an instance of this type pub struct PublishedVersionViewBuilder<'a, S: published_version_view_state::State> { _phantom_state: ::core::marker::PhantomData S>, __unsafe_private_named: ( ::core::option::Option>, ::core::option::Option>, ::core::option::Option, ::core::option::Option, ::core::option::Option>, ::core::option::Option, ::core::option::Option>, ), _phantom: ::core::marker::PhantomData<&'a ()>, } impl<'a> PublishedVersionView<'a> { /// Create a new builder for this type pub fn new() -> PublishedVersionViewBuilder< 'a, published_version_view_state::Empty, > { PublishedVersionViewBuilder::new() } } impl<'a> PublishedVersionViewBuilder<'a, published_version_view_state::Empty> { /// Create a new builder with all fields unset pub fn new() -> Self { PublishedVersionViewBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: (None, None, None, None, None, None, None), _phantom: ::core::marker::PhantomData, } } } impl<'a, S> PublishedVersionViewBuilder<'a, S> where S: published_version_view_state::State, S::Cid: published_version_view_state::IsUnset, { /// Set the `cid` field (required) pub fn cid( mut self, value: impl Into>, ) -> PublishedVersionViewBuilder<'a, published_version_view_state::SetCid> { self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); PublishedVersionViewBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S: published_version_view_state::State> PublishedVersionViewBuilder<'a, S> { /// Set the `divergedFrom` field (optional) pub fn diverged_from( mut self, value: impl Into>>, ) -> Self { self.__unsafe_private_named.1 = value.into(); self } /// Set the `divergedFrom` field to an Option value (optional) pub fn maybe_diverged_from( mut self, value: Option>, ) -> Self { self.__unsafe_private_named.1 = value; self } } impl<'a, S: published_version_view_state::State> PublishedVersionViewBuilder<'a, S> { /// Set the `isCanonical` field (optional) pub fn is_canonical(mut self, value: impl Into>) -> Self { self.__unsafe_private_named.2 = value.into(); self } /// Set the `isCanonical` field to an Option value (optional) pub fn maybe_is_canonical(mut self, value: Option) -> Self { self.__unsafe_private_named.2 = value; self } } impl<'a, S> PublishedVersionViewBuilder<'a, S> where S: published_version_view_state::State, S::PublishedAt: published_version_view_state::IsUnset, { /// Set the `publishedAt` field (required) pub fn published_at( mut self, value: impl Into, ) -> PublishedVersionViewBuilder< 'a, published_version_view_state::SetPublishedAt, > { self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); PublishedVersionViewBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S> PublishedVersionViewBuilder<'a, S> where S: published_version_view_state::State, S::Publisher: published_version_view_state::IsUnset, { /// Set the `publisher` field (required) pub fn publisher( mut self, value: impl Into>, ) -> PublishedVersionViewBuilder<'a, published_version_view_state::SetPublisher> { self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into()); PublishedVersionViewBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S: published_version_view_state::State> PublishedVersionViewBuilder<'a, S> { /// Set the `updatedAt` field (optional) pub fn updated_at( mut self, value: impl Into>, ) -> Self { self.__unsafe_private_named.5 = value.into(); self } /// Set the `updatedAt` field to an Option value (optional) pub fn maybe_updated_at( mut self, value: Option, ) -> Self { self.__unsafe_private_named.5 = value; self } } impl<'a, S> PublishedVersionViewBuilder<'a, S> where S: published_version_view_state::State, S::Uri: published_version_view_state::IsUnset, { /// Set the `uri` field (required) pub fn uri( mut self, value: impl Into>, ) -> PublishedVersionViewBuilder<'a, published_version_view_state::SetUri> { self.__unsafe_private_named.6 = ::core::option::Option::Some(value.into()); PublishedVersionViewBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S> PublishedVersionViewBuilder<'a, S> where S: published_version_view_state::State, S::Cid: published_version_view_state::IsSet, S::Publisher: published_version_view_state::IsSet, S::Uri: published_version_view_state::IsSet, S::PublishedAt: published_version_view_state::IsSet, { /// Build the final struct pub fn build(self) -> PublishedVersionView<'a> { PublishedVersionView { cid: self.__unsafe_private_named.0.unwrap(), diverged_from: self.__unsafe_private_named.1, is_canonical: self.__unsafe_private_named.2, published_at: self.__unsafe_private_named.3.unwrap(), publisher: self.__unsafe_private_named.4.unwrap(), updated_at: self.__unsafe_private_named.5, uri: self.__unsafe_private_named.6.unwrap(), extra_data: Default::default(), } } /// Build the final struct with custom extra_data pub fn build_with_data( self, extra_data: std::collections::BTreeMap< jacquard_common::smol_str::SmolStr, jacquard_common::types::value::Data<'a>, >, ) -> PublishedVersionView<'a> { PublishedVersionView { cid: self.__unsafe_private_named.0.unwrap(), diverged_from: self.__unsafe_private_named.1, is_canonical: self.__unsafe_private_named.2, published_at: self.__unsafe_private_named.3.unwrap(), publisher: self.__unsafe_private_named.4.unwrap(), updated_at: self.__unsafe_private_named.5, uri: self.__unsafe_private_named.6.unwrap(), extra_data: Some(extra_data), } } } impl<'a> ::jacquard_lexicon::schema::LexiconSchema for PublishedVersionView<'a> { fn nsid() -> &'static str { "sh.weaver.notebook.defs" } fn def_name() -> &'static str { "publishedVersionView" } fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { lexicon_doc_sh_weaver_notebook_defs() } fn validate( &self, ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { Ok(()) } } /// Viewer's reading progress (appview-side state, not a record). #[jacquard_derive::lexicon] #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, Default )] #[serde(rename_all = "camelCase")] pub struct ReadingProgress<'a> { /// Last entry the viewer was reading. #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub current_entry: std::option::Option>, #[serde(skip_serializing_if = "std::option::Option::is_none")] pub finished_at: std::option::Option, #[serde(skip_serializing_if = "std::option::Option::is_none")] pub last_read_at: std::option::Option, #[serde(skip_serializing_if = "std::option::Option::is_none")] pub percent_complete: std::option::Option, #[serde(skip_serializing_if = "std::option::Option::is_none")] pub started_at: std::option::Option, #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub status: std::option::Option>, } #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub enum ReadingProgressStatus<'a> { Reading, Finished, Abandoned, WantToRead, Other(jacquard_common::CowStr<'a>), } impl<'a> ReadingProgressStatus<'a> { pub fn as_str(&self) -> &str { match self { Self::Reading => "reading", Self::Finished => "finished", Self::Abandoned => "abandoned", Self::WantToRead => "want-to-read", Self::Other(s) => s.as_ref(), } } } impl<'a> From<&'a str> for ReadingProgressStatus<'a> { fn from(s: &'a str) -> Self { match s { "reading" => Self::Reading, "finished" => Self::Finished, "abandoned" => Self::Abandoned, "want-to-read" => Self::WantToRead, _ => Self::Other(jacquard_common::CowStr::from(s)), } } } impl<'a> From for ReadingProgressStatus<'a> { fn from(s: String) -> Self { match s.as_str() { "reading" => Self::Reading, "finished" => Self::Finished, "abandoned" => Self::Abandoned, "want-to-read" => Self::WantToRead, _ => Self::Other(jacquard_common::CowStr::from(s)), } } } impl<'a> core::fmt::Display for ReadingProgressStatus<'a> { fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { write!(f, "{}", self.as_str()) } } impl<'a> AsRef for ReadingProgressStatus<'a> { fn as_ref(&self) -> &str { self.as_str() } } impl<'a> serde::Serialize for ReadingProgressStatus<'a> { fn serialize(&self, serializer: S) -> Result where S: serde::Serializer, { serializer.serialize_str(self.as_str()) } } impl<'de, 'a> serde::Deserialize<'de> for ReadingProgressStatus<'a> where 'de: 'a, { fn deserialize(deserializer: D) -> Result where D: serde::Deserializer<'de>, { let s = <&'de str>::deserialize(deserializer)?; Ok(Self::from(s)) } } impl<'a> Default for ReadingProgressStatus<'a> { fn default() -> Self { Self::Other(Default::default()) } } impl jacquard_common::IntoStatic for ReadingProgressStatus<'_> { type Output = ReadingProgressStatus<'static>; fn into_static(self) -> Self::Output { match self { ReadingProgressStatus::Reading => ReadingProgressStatus::Reading, ReadingProgressStatus::Finished => ReadingProgressStatus::Finished, ReadingProgressStatus::Abandoned => ReadingProgressStatus::Abandoned, ReadingProgressStatus::WantToRead => ReadingProgressStatus::WantToRead, ReadingProgressStatus::Other(v) => { ReadingProgressStatus::Other(v.into_static()) } } } } impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ReadingProgress<'a> { fn nsid() -> &'static str { "sh.weaver.notebook.defs" } fn def_name() -> &'static str { "readingProgress" } fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { lexicon_doc_sh_weaver_notebook_defs() } fn validate( &self, ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { if let Some(ref value) = self.percent_complete { if *value > 100i64 { return Err(::jacquard_lexicon::validation::ConstraintError::Maximum { path: ::jacquard_lexicon::validation::ValidationPath::from_field( "percent_complete", ), max: 100i64, actual: *value, }); } } if let Some(ref value) = self.percent_complete { if *value < 0i64 { return Err(::jacquard_lexicon::validation::ConstraintError::Minimum { path: ::jacquard_lexicon::validation::ValidationPath::from_field( "percent_complete", ), min: 0i64, actual: *value, }); } } Ok(()) } } #[jacquard_derive::lexicon] #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic )] #[serde(rename_all = "camelCase")] pub struct ReasonBookmark<'a> { #[serde(borrow)] pub by: crate::sh_weaver::actor::ProfileViewBasic<'a>, pub indexed_at: jacquard_common::types::string::Datetime, } pub mod reason_bookmark_state { pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; #[allow(unused)] use ::core::marker::PhantomData; mod sealed { pub trait Sealed {} } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type By; type IndexedAt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type By = Unset; type IndexedAt = Unset; } ///State transition - sets the `by` field to Set pub struct SetBy(PhantomData S>); impl sealed::Sealed for SetBy {} impl State for SetBy { type By = Set; type IndexedAt = S::IndexedAt; } ///State transition - sets the `indexed_at` field to Set pub struct SetIndexedAt(PhantomData S>); impl sealed::Sealed for SetIndexedAt {} impl State for SetIndexedAt { type By = S::By; type IndexedAt = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `by` field pub struct by(()); ///Marker type for the `indexed_at` field pub struct indexed_at(()); } } /// Builder for constructing an instance of this type pub struct ReasonBookmarkBuilder<'a, S: reason_bookmark_state::State> { _phantom_state: ::core::marker::PhantomData S>, __unsafe_private_named: ( ::core::option::Option>, ::core::option::Option, ), _phantom: ::core::marker::PhantomData<&'a ()>, } impl<'a> ReasonBookmark<'a> { /// Create a new builder for this type pub fn new() -> ReasonBookmarkBuilder<'a, reason_bookmark_state::Empty> { ReasonBookmarkBuilder::new() } } impl<'a> ReasonBookmarkBuilder<'a, reason_bookmark_state::Empty> { /// Create a new builder with all fields unset pub fn new() -> Self { ReasonBookmarkBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: (None, None), _phantom: ::core::marker::PhantomData, } } } impl<'a, S> ReasonBookmarkBuilder<'a, S> where S: reason_bookmark_state::State, S::By: reason_bookmark_state::IsUnset, { /// Set the `by` field (required) pub fn by( mut self, value: impl Into>, ) -> ReasonBookmarkBuilder<'a, reason_bookmark_state::SetBy> { self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); ReasonBookmarkBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S> ReasonBookmarkBuilder<'a, S> where S: reason_bookmark_state::State, S::IndexedAt: reason_bookmark_state::IsUnset, { /// Set the `indexedAt` field (required) pub fn indexed_at( mut self, value: impl Into, ) -> ReasonBookmarkBuilder<'a, reason_bookmark_state::SetIndexedAt> { self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); ReasonBookmarkBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S> ReasonBookmarkBuilder<'a, S> where S: reason_bookmark_state::State, S::By: reason_bookmark_state::IsSet, S::IndexedAt: reason_bookmark_state::IsSet, { /// Build the final struct pub fn build(self) -> ReasonBookmark<'a> { ReasonBookmark { by: self.__unsafe_private_named.0.unwrap(), indexed_at: self.__unsafe_private_named.1.unwrap(), extra_data: Default::default(), } } /// Build the final struct with custom extra_data pub fn build_with_data( self, extra_data: std::collections::BTreeMap< jacquard_common::smol_str::SmolStr, jacquard_common::types::value::Data<'a>, >, ) -> ReasonBookmark<'a> { ReasonBookmark { by: self.__unsafe_private_named.0.unwrap(), indexed_at: self.__unsafe_private_named.1.unwrap(), extra_data: Some(extra_data), } } } impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ReasonBookmark<'a> { fn nsid() -> &'static str { "sh.weaver.notebook.defs" } fn def_name() -> &'static str { "reasonBookmark" } fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { lexicon_doc_sh_weaver_notebook_defs() } fn validate( &self, ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { Ok(()) } } #[jacquard_derive::lexicon] #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic )] #[serde(rename_all = "camelCase")] pub struct ReasonLike<'a> { #[serde(borrow)] pub by: crate::sh_weaver::actor::ProfileViewBasic<'a>, pub indexed_at: jacquard_common::types::string::Datetime, } pub mod reason_like_state { pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; #[allow(unused)] use ::core::marker::PhantomData; mod sealed { pub trait Sealed {} } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type By; type IndexedAt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type By = Unset; type IndexedAt = Unset; } ///State transition - sets the `by` field to Set pub struct SetBy(PhantomData S>); impl sealed::Sealed for SetBy {} impl State for SetBy { type By = Set; type IndexedAt = S::IndexedAt; } ///State transition - sets the `indexed_at` field to Set pub struct SetIndexedAt(PhantomData S>); impl sealed::Sealed for SetIndexedAt {} impl State for SetIndexedAt { type By = S::By; type IndexedAt = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `by` field pub struct by(()); ///Marker type for the `indexed_at` field pub struct indexed_at(()); } } /// Builder for constructing an instance of this type pub struct ReasonLikeBuilder<'a, S: reason_like_state::State> { _phantom_state: ::core::marker::PhantomData S>, __unsafe_private_named: ( ::core::option::Option>, ::core::option::Option, ), _phantom: ::core::marker::PhantomData<&'a ()>, } impl<'a> ReasonLike<'a> { /// Create a new builder for this type pub fn new() -> ReasonLikeBuilder<'a, reason_like_state::Empty> { ReasonLikeBuilder::new() } } impl<'a> ReasonLikeBuilder<'a, reason_like_state::Empty> { /// Create a new builder with all fields unset pub fn new() -> Self { ReasonLikeBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: (None, None), _phantom: ::core::marker::PhantomData, } } } impl<'a, S> ReasonLikeBuilder<'a, S> where S: reason_like_state::State, S::By: reason_like_state::IsUnset, { /// Set the `by` field (required) pub fn by( mut self, value: impl Into>, ) -> ReasonLikeBuilder<'a, reason_like_state::SetBy> { self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); ReasonLikeBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S> ReasonLikeBuilder<'a, S> where S: reason_like_state::State, S::IndexedAt: reason_like_state::IsUnset, { /// Set the `indexedAt` field (required) pub fn indexed_at( mut self, value: impl Into, ) -> ReasonLikeBuilder<'a, reason_like_state::SetIndexedAt> { self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); ReasonLikeBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S> ReasonLikeBuilder<'a, S> where S: reason_like_state::State, S::By: reason_like_state::IsSet, S::IndexedAt: reason_like_state::IsSet, { /// Build the final struct pub fn build(self) -> ReasonLike<'a> { ReasonLike { by: self.__unsafe_private_named.0.unwrap(), indexed_at: self.__unsafe_private_named.1.unwrap(), extra_data: Default::default(), } } /// Build the final struct with custom extra_data pub fn build_with_data( self, extra_data: std::collections::BTreeMap< jacquard_common::smol_str::SmolStr, jacquard_common::types::value::Data<'a>, >, ) -> ReasonLike<'a> { ReasonLike { by: self.__unsafe_private_named.0.unwrap(), indexed_at: self.__unsafe_private_named.1.unwrap(), extra_data: Some(extra_data), } } } impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ReasonLike<'a> { fn nsid() -> &'static str { "sh.weaver.notebook.defs" } fn def_name() -> &'static str { "reasonLike" } fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { lexicon_doc_sh_weaver_notebook_defs() } fn validate( &self, ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { Ok(()) } } #[jacquard_derive::lexicon] #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic )] #[serde(rename_all = "camelCase")] pub struct ReasonSubscription<'a> { pub indexed_at: jacquard_common::types::string::Datetime, } pub mod reason_subscription_state { pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; #[allow(unused)] use ::core::marker::PhantomData; mod sealed { pub trait Sealed {} } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type IndexedAt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type IndexedAt = Unset; } ///State transition - sets the `indexed_at` field to Set pub struct SetIndexedAt(PhantomData S>); impl sealed::Sealed for SetIndexedAt {} impl State for SetIndexedAt { type IndexedAt = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `indexed_at` field pub struct indexed_at(()); } } /// Builder for constructing an instance of this type pub struct ReasonSubscriptionBuilder<'a, S: reason_subscription_state::State> { _phantom_state: ::core::marker::PhantomData S>, __unsafe_private_named: ( ::core::option::Option, ), _phantom: ::core::marker::PhantomData<&'a ()>, } impl<'a> ReasonSubscription<'a> { /// Create a new builder for this type pub fn new() -> ReasonSubscriptionBuilder<'a, reason_subscription_state::Empty> { ReasonSubscriptionBuilder::new() } } impl<'a> ReasonSubscriptionBuilder<'a, reason_subscription_state::Empty> { /// Create a new builder with all fields unset pub fn new() -> Self { ReasonSubscriptionBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: (None,), _phantom: ::core::marker::PhantomData, } } } impl<'a, S> ReasonSubscriptionBuilder<'a, S> where S: reason_subscription_state::State, S::IndexedAt: reason_subscription_state::IsUnset, { /// Set the `indexedAt` field (required) pub fn indexed_at( mut self, value: impl Into, ) -> ReasonSubscriptionBuilder<'a, reason_subscription_state::SetIndexedAt> { self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); ReasonSubscriptionBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S> ReasonSubscriptionBuilder<'a, S> where S: reason_subscription_state::State, S::IndexedAt: reason_subscription_state::IsSet, { /// Build the final struct pub fn build(self) -> ReasonSubscription<'a> { ReasonSubscription { indexed_at: self.__unsafe_private_named.0.unwrap(), extra_data: Default::default(), } } /// Build the final struct with custom extra_data pub fn build_with_data( self, extra_data: std::collections::BTreeMap< jacquard_common::smol_str::SmolStr, jacquard_common::types::value::Data<'a>, >, ) -> ReasonSubscription<'a> { ReasonSubscription { indexed_at: self.__unsafe_private_named.0.unwrap(), extra_data: Some(extra_data), } } } impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ReasonSubscription<'a> { fn nsid() -> &'static str { "sh.weaver.notebook.defs" } fn def_name() -> &'static str { "reasonSubscription" } fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { lexicon_doc_sh_weaver_notebook_defs() } fn validate( &self, ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { Ok(()) } } /// View of a rendered and cached notebook entry #[jacquard_derive::lexicon] #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic )] #[serde(rename_all = "camelCase")] pub struct RenderedView<'a> { #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub css: std::option::Option>, #[serde(borrow)] pub html: jacquard_common::types::blob::BlobRef<'a>, } pub mod rendered_view_state { pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; #[allow(unused)] use ::core::marker::PhantomData; mod sealed { pub trait Sealed {} } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Html; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Html = Unset; } ///State transition - sets the `html` field to Set pub struct SetHtml(PhantomData S>); impl sealed::Sealed for SetHtml {} impl State for SetHtml { type Html = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `html` field pub struct html(()); } } /// Builder for constructing an instance of this type pub struct RenderedViewBuilder<'a, S: rendered_view_state::State> { _phantom_state: ::core::marker::PhantomData S>, __unsafe_private_named: ( ::core::option::Option>, ::core::option::Option>, ), _phantom: ::core::marker::PhantomData<&'a ()>, } impl<'a> RenderedView<'a> { /// Create a new builder for this type pub fn new() -> RenderedViewBuilder<'a, rendered_view_state::Empty> { RenderedViewBuilder::new() } } impl<'a> RenderedViewBuilder<'a, rendered_view_state::Empty> { /// Create a new builder with all fields unset pub fn new() -> Self { RenderedViewBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: (None, None), _phantom: ::core::marker::PhantomData, } } } impl<'a, S: rendered_view_state::State> RenderedViewBuilder<'a, S> { /// Set the `css` field (optional) pub fn css( mut self, value: impl Into>>, ) -> Self { self.__unsafe_private_named.0 = value.into(); self } /// Set the `css` field to an Option value (optional) pub fn maybe_css( mut self, value: Option>, ) -> Self { self.__unsafe_private_named.0 = value; self } } impl<'a, S> RenderedViewBuilder<'a, S> where S: rendered_view_state::State, S::Html: rendered_view_state::IsUnset, { /// Set the `html` field (required) pub fn html( mut self, value: impl Into>, ) -> RenderedViewBuilder<'a, rendered_view_state::SetHtml> { self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); RenderedViewBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S> RenderedViewBuilder<'a, S> where S: rendered_view_state::State, S::Html: rendered_view_state::IsSet, { /// Build the final struct pub fn build(self) -> RenderedView<'a> { RenderedView { css: self.__unsafe_private_named.0, html: self.__unsafe_private_named.1.unwrap(), extra_data: Default::default(), } } /// Build the final struct with custom extra_data pub fn build_with_data( self, extra_data: std::collections::BTreeMap< jacquard_common::smol_str::SmolStr, jacquard_common::types::value::Data<'a>, >, ) -> RenderedView<'a> { RenderedView { css: self.__unsafe_private_named.0, html: self.__unsafe_private_named.1.unwrap(), extra_data: Some(extra_data), } } } impl<'a> ::jacquard_lexicon::schema::LexiconSchema for RenderedView<'a> { fn nsid() -> &'static str { "sh.weaver.notebook.defs" } fn def_name() -> &'static str { "renderedView" } fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { lexicon_doc_sh_weaver_notebook_defs() } fn validate( &self, ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { Ok(()) } } /// An array of tags associated with the notebook entry. Tags can help categorize and organize entries. pub type Tags<'a> = Vec>; /// The title of the notebook entry. pub type Title<'a> = jacquard_common::CowStr<'a>;