// @generated by jacquard-lexicon. DO NOT EDIT. // // Lexicon: sh.weaver.notebook.getEntryNotebooks // // This file was automatically generated from Lexicon schemas. // Any manual changes will be overwritten on the next regeneration. #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic )] #[serde(rename_all = "camelCase")] pub struct GetEntryNotebooks<'a> { #[serde(borrow)] pub entry: jacquard_common::types::string::AtUri<'a>, } pub mod get_entry_notebooks_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 GetEntryNotebooksBuilder<'a, S: get_entry_notebooks_state::State> { _phantom_state: ::core::marker::PhantomData S>, __unsafe_private_named: ( ::core::option::Option>, ), _phantom: ::core::marker::PhantomData<&'a ()>, } impl<'a> GetEntryNotebooks<'a> { /// Create a new builder for this type pub fn new() -> GetEntryNotebooksBuilder<'a, get_entry_notebooks_state::Empty> { GetEntryNotebooksBuilder::new() } } impl<'a> GetEntryNotebooksBuilder<'a, get_entry_notebooks_state::Empty> { /// Create a new builder with all fields unset pub fn new() -> Self { GetEntryNotebooksBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: (None,), _phantom: ::core::marker::PhantomData, } } } impl<'a, S> GetEntryNotebooksBuilder<'a, S> where S: get_entry_notebooks_state::State, S::Entry: get_entry_notebooks_state::IsUnset, { /// Set the `entry` field (required) pub fn entry( mut self, value: impl Into>, ) -> GetEntryNotebooksBuilder<'a, get_entry_notebooks_state::SetEntry> { self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); GetEntryNotebooksBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S> GetEntryNotebooksBuilder<'a, S> where S: get_entry_notebooks_state::State, S::Entry: get_entry_notebooks_state::IsSet, { /// Build the final struct pub fn build(self) -> GetEntryNotebooks<'a> { GetEntryNotebooks { entry: self.__unsafe_private_named.0.unwrap(), } } } #[jacquard_derive::lexicon] #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic )] #[serde(rename_all = "camelCase")] pub struct GetEntryNotebooksOutput<'a> { #[serde(borrow)] pub notebooks: Vec>, } /// Response type for ///sh.weaver.notebook.getEntryNotebooks pub struct GetEntryNotebooksResponse; impl jacquard_common::xrpc::XrpcResp for GetEntryNotebooksResponse { const NSID: &'static str = "sh.weaver.notebook.getEntryNotebooks"; const ENCODING: &'static str = "application/json"; type Output<'de> = GetEntryNotebooksOutput<'de>; type Err<'de> = jacquard_common::xrpc::GenericError<'de>; } impl<'a> jacquard_common::xrpc::XrpcRequest for GetEntryNotebooks<'a> { const NSID: &'static str = "sh.weaver.notebook.getEntryNotebooks"; const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; type Response = GetEntryNotebooksResponse; } /// Endpoint type for ///sh.weaver.notebook.getEntryNotebooks pub struct GetEntryNotebooksRequest; impl jacquard_common::xrpc::XrpcEndpoint for GetEntryNotebooksRequest { const PATH: &'static str = "/xrpc/sh.weaver.notebook.getEntryNotebooks"; const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; type Request<'de> = GetEntryNotebooks<'de>; type Response = GetEntryNotebooksResponse; } /// Reference to a notebook containing this entry. #[jacquard_derive::lexicon] #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic )] #[serde(rename_all = "camelCase")] pub struct NotebookRef<'a> { #[serde(borrow)] pub cid: jacquard_common::types::string::Cid<'a>, #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub owner: 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 notebook_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 Uri; type Cid; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Uri = Unset; type Cid = Unset; } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData S>); impl sealed::Sealed for SetUri {} impl State for SetUri { type Uri = Set; type Cid = S::Cid; } ///State transition - sets the `cid` field to Set pub struct SetCid(PhantomData S>); impl sealed::Sealed for SetCid {} impl State for SetCid { type Uri = S::Uri; type Cid = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `uri` field pub struct uri(()); ///Marker type for the `cid` field pub struct cid(()); } } /// Builder for constructing an instance of this type pub struct NotebookRefBuilder<'a, S: notebook_ref_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> NotebookRef<'a> { /// Create a new builder for this type pub fn new() -> NotebookRefBuilder<'a, notebook_ref_state::Empty> { NotebookRefBuilder::new() } } impl<'a> NotebookRefBuilder<'a, notebook_ref_state::Empty> { /// Create a new builder with all fields unset pub fn new() -> Self { NotebookRefBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: (None, None, None, None), _phantom: ::core::marker::PhantomData, } } } impl<'a, S> NotebookRefBuilder<'a, S> where S: notebook_ref_state::State, S::Cid: notebook_ref_state::IsUnset, { /// Set the `cid` field (required) pub fn cid( mut self, value: impl Into>, ) -> NotebookRefBuilder<'a, notebook_ref_state::SetCid> { self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); NotebookRefBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S: notebook_ref_state::State> NotebookRefBuilder<'a, S> { /// Set the `owner` field (optional) pub fn owner( mut self, value: impl Into>>, ) -> Self { self.__unsafe_private_named.1 = value.into(); self } /// Set the `owner` field to an Option value (optional) pub fn maybe_owner( mut self, value: Option>, ) -> Self { self.__unsafe_private_named.1 = value; self } } impl<'a, S: notebook_ref_state::State> NotebookRefBuilder<'a, S> { /// Set the `title` field (optional) pub fn title( mut self, value: impl Into>>, ) -> Self { self.__unsafe_private_named.2 = 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.2 = value; self } } impl<'a, S> NotebookRefBuilder<'a, S> where S: notebook_ref_state::State, S::Uri: notebook_ref_state::IsUnset, { /// Set the `uri` field (required) pub fn uri( mut self, value: impl Into>, ) -> NotebookRefBuilder<'a, notebook_ref_state::SetUri> { self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); NotebookRefBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S> NotebookRefBuilder<'a, S> where S: notebook_ref_state::State, S::Uri: notebook_ref_state::IsSet, S::Cid: notebook_ref_state::IsSet, { /// Build the final struct pub fn build(self) -> NotebookRef<'a> { NotebookRef { cid: self.__unsafe_private_named.0.unwrap(), owner: self.__unsafe_private_named.1, title: self.__unsafe_private_named.2, uri: 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>, >, ) -> NotebookRef<'a> { NotebookRef { cid: self.__unsafe_private_named.0.unwrap(), owner: self.__unsafe_private_named.1, title: self.__unsafe_private_named.2, uri: self.__unsafe_private_named.3.unwrap(), extra_data: Some(extra_data), } } } fn lexicon_doc_sh_weaver_notebook_getEntryNotebooks() -> ::jacquard_lexicon::lexicon::LexiconDoc< 'static, > { ::jacquard_lexicon::lexicon::LexiconDoc { lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, id: ::jacquard_common::CowStr::new_static( "sh.weaver.notebook.getEntryNotebooks", ), revision: None, description: None, defs: { let mut map = ::alloc::collections::BTreeMap::new(); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("main"), ::jacquard_lexicon::lexicon::LexUserType::XrpcQuery(::jacquard_lexicon::lexicon::LexXrpcQuery { description: None, parameters: Some( ::jacquard_lexicon::lexicon::LexXrpcQueryParameter::Params(::jacquard_lexicon::lexicon::LexXrpcParameters { description: None, required: Some( vec![ ::jacquard_common::smol_str::SmolStr::new_static("entry") ], ), properties: { #[allow(unused_mut)] let mut map = ::alloc::collections::BTreeMap::new(); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("entry"), ::jacquard_lexicon::lexicon::LexXrpcParametersProperty::String(::jacquard_lexicon::lexicon::LexString { description: Some( ::jacquard_common::CowStr::new_static("AT URI of the entry"), ), 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 }, }), ), output: None, errors: None, }), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("notebookRef"), ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { description: Some( ::jacquard_common::CowStr::new_static( "Reference to a notebook containing this entry.", ), ), required: Some( vec![ ::jacquard_common::smol_str::SmolStr::new_static("uri"), ::jacquard_common::smol_str::SmolStr::new_static("cid") ], ), 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("owner"), ::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("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 }, } } impl<'a> ::jacquard_lexicon::schema::LexiconSchema for NotebookRef<'a> { fn nsid() -> &'static str { "sh.weaver.notebook.getEntryNotebooks" } fn def_name() -> &'static str { "notebookRef" } fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { lexicon_doc_sh_weaver_notebook_getEntryNotebooks() } fn validate( &self, ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { Ok(()) } }