// @generated by jacquard-lexicon. DO NOT EDIT. // // Lexicon: sh.weaver.notebook.resolveGlobalNotebook // // 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 ResolveGlobalNotebook<'a> { #[serde(borrow)] pub path: jacquard_common::CowStr<'a>, } pub mod resolve_global_notebook_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 Path; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Path = Unset; } ///State transition - sets the `path` field to Set pub struct SetPath(PhantomData S>); impl sealed::Sealed for SetPath {} impl State for SetPath { type Path = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `path` field pub struct path(()); } } /// Builder for constructing an instance of this type pub struct ResolveGlobalNotebookBuilder<'a, S: resolve_global_notebook_state::State> { _phantom_state: ::core::marker::PhantomData S>, __unsafe_private_named: (::core::option::Option>,), _phantom: ::core::marker::PhantomData<&'a ()>, } impl<'a> ResolveGlobalNotebook<'a> { /// Create a new builder for this type pub fn new() -> ResolveGlobalNotebookBuilder< 'a, resolve_global_notebook_state::Empty, > { ResolveGlobalNotebookBuilder::new() } } impl<'a> ResolveGlobalNotebookBuilder<'a, resolve_global_notebook_state::Empty> { /// Create a new builder with all fields unset pub fn new() -> Self { ResolveGlobalNotebookBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: (None,), _phantom: ::core::marker::PhantomData, } } } impl<'a, S> ResolveGlobalNotebookBuilder<'a, S> where S: resolve_global_notebook_state::State, S::Path: resolve_global_notebook_state::IsUnset, { /// Set the `path` field (required) pub fn path( mut self, value: impl Into>, ) -> ResolveGlobalNotebookBuilder<'a, resolve_global_notebook_state::SetPath> { self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); ResolveGlobalNotebookBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, } } } impl<'a, S> ResolveGlobalNotebookBuilder<'a, S> where S: resolve_global_notebook_state::State, S::Path: resolve_global_notebook_state::IsSet, { /// Build the final struct pub fn build(self) -> ResolveGlobalNotebook<'a> { ResolveGlobalNotebook { path: 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 ResolveGlobalNotebookOutput<'a> { #[serde(borrow)] pub notebook: crate::sh_weaver::notebook::NotebookView<'a>, } #[jacquard_derive::open_union] #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, thiserror::Error, miette::Diagnostic, jacquard_derive::IntoStatic )] #[serde(tag = "error", content = "message")] #[serde(bound(deserialize = "'de: 'a"))] pub enum ResolveGlobalNotebookError<'a> { #[serde(rename = "NotFound")] NotFound(std::option::Option>), } impl core::fmt::Display for ResolveGlobalNotebookError<'_> { fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { match self { Self::NotFound(msg) => { write!(f, "NotFound")?; if let Some(msg) = msg { write!(f, ": {}", msg)?; } Ok(()) } Self::Unknown(err) => write!(f, "Unknown error: {:?}", err), } } } /// Response type for ///sh.weaver.notebook.resolveGlobalNotebook pub struct ResolveGlobalNotebookResponse; impl jacquard_common::xrpc::XrpcResp for ResolveGlobalNotebookResponse { const NSID: &'static str = "sh.weaver.notebook.resolveGlobalNotebook"; const ENCODING: &'static str = "application/json"; type Output<'de> = ResolveGlobalNotebookOutput<'de>; type Err<'de> = ResolveGlobalNotebookError<'de>; } impl<'a> jacquard_common::xrpc::XrpcRequest for ResolveGlobalNotebook<'a> { const NSID: &'static str = "sh.weaver.notebook.resolveGlobalNotebook"; const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; type Response = ResolveGlobalNotebookResponse; } /// Endpoint type for ///sh.weaver.notebook.resolveGlobalNotebook pub struct ResolveGlobalNotebookRequest; impl jacquard_common::xrpc::XrpcEndpoint for ResolveGlobalNotebookRequest { const PATH: &'static str = "/xrpc/sh.weaver.notebook.resolveGlobalNotebook"; const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; type Request<'de> = ResolveGlobalNotebook<'de>; type Response = ResolveGlobalNotebookResponse; }