#[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 {}
}
pub trait State: sealed::Sealed {
type Entry;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Entry = Unset;
}
pub struct SetEntry<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetEntry<S> {}
impl<S: State> State for SetEntry<S> {
type Entry = Set<members::entry>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct entry(());
}
}
pub struct GetEntryNotebooksBuilder<'a, S: get_entry_notebooks_state::State> {
_phantom_state: ::core::marker::PhantomData<fn() -> S>,
__unsafe_private_named: (
::core::option::Option<jacquard_common::types::string::AtUri<'a>>,
),
_phantom: ::core::marker::PhantomData<&'a ()>,
}
impl<'a> GetEntryNotebooks<'a> {
pub fn new() -> GetEntryNotebooksBuilder<'a, get_entry_notebooks_state::Empty> {
GetEntryNotebooksBuilder::new()
}
}
impl<'a> GetEntryNotebooksBuilder<'a, get_entry_notebooks_state::Empty> {
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,
{
pub fn entry(
mut self,
value: impl Into<jacquard_common::types::string::AtUri<'a>>,
) -> GetEntryNotebooksBuilder<'a, get_entry_notebooks_state::SetEntry<S>> {
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,
{
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<crate::sh_weaver::notebook::get_entry_notebooks::NotebookRef<'a>>,
}
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;
}
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;
}
#[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<crate::sh_weaver::actor::ProfileViewBasic<'a>>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub title: std::option::Option<jacquard_common::CowStr<'a>>,
#[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 {}
}
pub trait State: sealed::Sealed {
type Cid;
type Uri;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Cid = Unset;
type Uri = Unset;
}
pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetCid<S> {}
impl<S: State> State for SetCid<S> {
type Cid = Set<members::cid>;
type Uri = S::Uri;
}
pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetUri<S> {}
impl<S: State> State for SetUri<S> {
type Cid = S::Cid;
type Uri = Set<members::uri>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct cid(());
pub struct uri(());
}
}
pub struct NotebookRefBuilder<'a, S: notebook_ref_state::State> {
_phantom_state: ::core::marker::PhantomData<fn() -> S>,
__unsafe_private_named: (
::core::option::Option<jacquard_common::types::string::Cid<'a>>,
::core::option::Option<crate::sh_weaver::actor::ProfileViewBasic<'a>>,
::core::option::Option<jacquard_common::CowStr<'a>>,
::core::option::Option<jacquard_common::types::string::AtUri<'a>>,
),
_phantom: ::core::marker::PhantomData<&'a ()>,
}
impl<'a> NotebookRef<'a> {
pub fn new() -> NotebookRefBuilder<'a, notebook_ref_state::Empty> {
NotebookRefBuilder::new()
}
}
impl<'a> NotebookRefBuilder<'a, notebook_ref_state::Empty> {
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,
{
pub fn cid(
mut self,
value: impl Into<jacquard_common::types::string::Cid<'a>>,
) -> NotebookRefBuilder<'a, notebook_ref_state::SetCid<S>> {
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> {
pub fn owner(
mut self,
value: impl Into<Option<crate::sh_weaver::actor::ProfileViewBasic<'a>>>,
) -> Self {
self.__unsafe_private_named.1 = value.into();
self
}
pub fn maybe_owner(
mut self,
value: Option<crate::sh_weaver::actor::ProfileViewBasic<'a>>,
) -> Self {
self.__unsafe_private_named.1 = value;
self
}
}
impl<'a, S: notebook_ref_state::State> NotebookRefBuilder<'a, S> {
pub fn title(
mut self,
value: impl Into<Option<jacquard_common::CowStr<'a>>>,
) -> Self {
self.__unsafe_private_named.2 = value.into();
self
}
pub fn maybe_title(mut self, value: Option<jacquard_common::CowStr<'a>>) -> 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,
{
pub fn uri(
mut self,
value: impl Into<jacquard_common::types::string::AtUri<'a>>,
) -> NotebookRefBuilder<'a, notebook_ref_state::SetUri<S>> {
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::Cid: notebook_ref_state::IsSet,
S::Uri: notebook_ref_state::IsSet,
{
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(),
}
}
pub fn build_with_data(
self,
extra_data: std::collections::BTreeMap<
jacquard_common::deps::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::deps::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::deps::smol_str::SmolStr::new_static("entry")
],
),
properties: {
#[allow(unused_mut)]
let mut map = ::alloc::collections::BTreeMap::new();
map.insert(
::jacquard_common::deps::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::deps::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::deps::smol_str::SmolStr::new_static("uri"),
::jacquard_common::deps::smol_str::SmolStr::new_static("cid")
],
),
nullable: None,
properties: {
#[allow(unused_mut)]
let mut map = ::alloc::collections::BTreeMap::new();
map.insert(
::jacquard_common::deps::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::deps::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::deps::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::deps::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(())
}
}