jacquard_api/sh_weaver/notebook/
chapter.rs1#[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 Chapter<'a> {
21 #[serde(skip_serializing_if = "std::option::Option::is_none")]
23 pub created_at: std::option::Option<jacquard_common::types::string::Datetime>,
24 #[serde(borrow)]
25 pub entry_list: Vec<crate::com_atproto::repo::strong_ref::StrongRef<'a>>,
26 #[serde(borrow)]
28 pub notebook: crate::com_atproto::repo::strong_ref::StrongRef<'a>,
29 #[serde(skip_serializing_if = "std::option::Option::is_none")]
30 #[serde(borrow)]
31 pub tags: std::option::Option<crate::sh_weaver::notebook::Tags<'a>>,
32 #[serde(skip_serializing_if = "std::option::Option::is_none")]
33 #[serde(borrow)]
34 pub title: std::option::Option<crate::sh_weaver::notebook::Title<'a>>,
35}
36
37#[derive(
39 serde::Serialize,
40 serde::Deserialize,
41 Debug,
42 Clone,
43 PartialEq,
44 Eq,
45 jacquard_derive::IntoStatic
46)]
47#[serde(rename_all = "camelCase")]
48pub struct ChapterGetRecordOutput<'a> {
49 #[serde(skip_serializing_if = "std::option::Option::is_none")]
50 #[serde(borrow)]
51 pub cid: std::option::Option<jacquard_common::types::string::Cid<'a>>,
52 #[serde(borrow)]
53 pub uri: jacquard_common::types::string::AtUri<'a>,
54 #[serde(borrow)]
55 pub value: Chapter<'a>,
56}
57
58pub struct ChapterRecord;
60impl jacquard_common::xrpc::XrpcResp for ChapterRecord {
61 const NSID: &'static str = "sh.weaver.notebook.chapter";
62 const ENCODING: &'static str = "application/json";
63 type Output<'de> = ChapterGetRecordOutput<'de>;
64 type Err<'de> = jacquard_common::types::collection::RecordError<'de>;
65}
66
67impl jacquard_common::types::collection::Collection for Chapter<'_> {
68 const NSID: &'static str = "sh.weaver.notebook.chapter";
69 type Record = ChapterRecord;
70}
71
72impl From<ChapterGetRecordOutput<'_>> for Chapter<'_> {
73 fn from(output: ChapterGetRecordOutput<'_>) -> Self {
74 use jacquard_common::IntoStatic;
75 output.value.into_static()
76 }
77}