1// @generated by jacquard-lexicon. DO NOT EDIT.
2//
3// Lexicon: sh.weaver.notebook.entry
4//
5// This file was automatically generated from Lexicon schemas.
6// Any manual changes will be overwritten on the next regeneration.
7
8///A notebook entry
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 Entry<'a> {
21 ///The content of the notebook entry. This should be some flavor of Markdown.
22 #[serde(borrow)]
23 pub content: jacquard_common::CowStr<'a>,
24 ///Client-declared timestamp when this was originally created.
25 pub created_at: jacquard_common::types::string::Datetime,
26 ///The set of images, if any, embedded in the notebook entry.
27 #[serde(skip_serializing_if = "std::option::Option::is_none")]
28 #[serde(borrow)]
29 pub images: std::option::Option<crate::sh_weaver::embed::images::Images<'a>>,
30 #[serde(skip_serializing_if = "std::option::Option::is_none")]
31 #[serde(borrow)]
32 pub tags: std::option::Option<crate::sh_weaver::notebook::Tags<'a>>,
33 #[serde(borrow)]
34 pub title: crate::sh_weaver::notebook::Title<'a>,
35}
36
37/// Typed wrapper for GetRecord response with this collection's record type.
38#[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 EntryGetRecordOutput<'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: Entry<'a>,
56}
57
58/// Marker type for deserializing records from this collection.
59pub struct EntryRecord;
60impl jacquard_common::xrpc::XrpcResp for EntryRecord {
61 const NSID: &'static str = "sh.weaver.notebook.entry";
62 const ENCODING: &'static str = "application/json";
63 type Output<'de> = EntryGetRecordOutput<'de>;
64 type Err<'de> = jacquard_common::types::collection::RecordError<'de>;
65}
66
67impl jacquard_common::types::collection::Collection for Entry<'_> {
68 const NSID: &'static str = "sh.weaver.notebook.entry";
69 type Record = EntryRecord;
70}
71
72impl From<EntryGetRecordOutput<'_>> for Entry<'_> {
73 fn from(output: EntryGetRecordOutput<'_>) -> Self {
74 use jacquard_common::IntoStatic;
75 output.value.into_static()
76 }
77}