jacquard_api/sh_weaver/edit/
root.rs

1// @generated by jacquard-lexicon. DO NOT EDIT.
2//
3// Lexicon: sh.weaver.edit.root
4//
5// This file was automatically generated from Lexicon schemas.
6// Any manual changes will be overwritten on the next regeneration.
7
8///The starting point for edit history on a notebook.
9#[jacquard_derive::lexicon]
10#[derive(
11    serde::Serialize,
12    serde::Deserialize,
13    Debug,
14    Clone,
15    PartialEq,
16    Eq,
17    jacquard_derive::IntoStatic
18)]
19#[serde(rename_all = "camelCase")]
20pub struct Root<'a> {
21    #[serde(borrow)]
22    pub cid: jacquard_common::types::string::Cid<'a>,
23    #[serde(borrow)]
24    pub doc: crate::sh_weaver::edit::DocRef<'a>,
25    #[serde(borrow)]
26    pub snapshot: jacquard_common::types::blob::Blob<'a>,
27    #[serde(borrow)]
28    pub uri: jacquard_common::types::string::AtUri<'a>,
29}
30
31/// Typed wrapper for GetRecord response with this collection's record type.
32#[derive(
33    serde::Serialize,
34    serde::Deserialize,
35    Debug,
36    Clone,
37    PartialEq,
38    Eq,
39    jacquard_derive::IntoStatic
40)]
41#[serde(rename_all = "camelCase")]
42pub struct RootGetRecordOutput<'a> {
43    #[serde(skip_serializing_if = "std::option::Option::is_none")]
44    #[serde(borrow)]
45    pub cid: std::option::Option<jacquard_common::types::string::Cid<'a>>,
46    #[serde(borrow)]
47    pub uri: jacquard_common::types::string::AtUri<'a>,
48    #[serde(borrow)]
49    pub value: Root<'a>,
50}
51
52/// Marker type for deserializing records from this collection.
53pub struct RootRecord;
54impl jacquard_common::xrpc::XrpcResp for RootRecord {
55    const NSID: &'static str = "sh.weaver.edit.root";
56    const ENCODING: &'static str = "application/json";
57    type Output<'de> = RootGetRecordOutput<'de>;
58    type Err<'de> = jacquard_common::types::collection::RecordError<'de>;
59}
60
61impl jacquard_common::types::collection::Collection for Root<'_> {
62    const NSID: &'static str = "sh.weaver.edit.root";
63    type Record = RootRecord;
64}
65
66impl From<RootGetRecordOutput<'_>> for Root<'_> {
67    fn from(output: RootGetRecordOutput<'_>) -> Self {
68        use jacquard_common::IntoStatic;
69        output.value.into_static()
70    }
71}