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 bon::Builder
19)]
20#[serde(rename_all = "camelCase")]
21pub struct Entry<'a> {
22 /// The content of the notebook entry. This should be some flavor of Markdown.
23 #[serde(borrow)]
24 #[builder(into)]
25 pub content: jacquard_common::CowStr<'a>,
26 /// Client-declared timestamp when this was originally created.
27 pub created_at: jacquard_common::types::string::Datetime,
28 /// The set of images, if any, embedded in the notebook entry.
29 #[serde(skip_serializing_if = "std::option::Option::is_none")]
30 #[builder(into)]
31 #[serde(borrow)]
32 pub images: Option<crate::sh_weaver::embed::images::Images<'a>>,
33 #[serde(skip_serializing_if = "std::option::Option::is_none")]
34 #[builder(into)]
35 #[serde(borrow)]
36 pub tags: Option<crate::sh_weaver::notebook::Tags<'a>>,
37 #[serde(borrow)]
38 pub title: crate::sh_weaver::notebook::Title<'a>,
39}
40
41/// Typed wrapper for GetRecord response with this collection's record type.
42#[derive(
43 serde::Serialize,
44 serde::Deserialize,
45 Debug,
46 Clone,
47 PartialEq,
48 Eq,
49 jacquard_derive::IntoStatic
50)]
51#[serde(rename_all = "camelCase")]
52pub struct EntryGetRecordOutput<'a> {
53 #[serde(skip_serializing_if = "std::option::Option::is_none")]
54 #[serde(borrow)]
55 pub cid: std::option::Option<jacquard_common::types::string::Cid<'a>>,
56 #[serde(borrow)]
57 pub uri: jacquard_common::types::string::AtUri<'a>,
58 #[serde(borrow)]
59 pub value: Entry<'a>,
60}
61
62/// Marker type for deserializing records from this collection.
63pub struct EntryRecord;
64impl jacquard_common::xrpc::XrpcResp for EntryRecord {
65 const NSID: &'static str = "sh.weaver.notebook.entry";
66 const ENCODING: &'static str = "application/json";
67 type Output<'de> = EntryGetRecordOutput<'de>;
68 type Err<'de> = jacquard_common::types::collection::RecordError<'de>;
69}
70
71impl jacquard_common::types::collection::Collection for Entry<'_> {
72 const NSID: &'static str = "sh.weaver.notebook.entry";
73 type Record = EntryRecord;
74}
75
76impl From<EntryGetRecordOutput<'_>> for Entry<'_> {
77 fn from(output: EntryGetRecordOutput<'_>) -> Self {
78 use jacquard_common::IntoStatic;
79 output.value.into_static()
80 }
81}