1// @generated by jacquard-lexicon. DO NOT EDIT.
2//
3// Lexicon: sh.weaver.notebook.book
4//
5// This file was automatically generated from Lexicon schemas.
6// Any manual changes will be overwritten on the next regeneration.
7
8/// Authors of a Weaver 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 bon::Builder
19)]
20#[serde(rename_all = "camelCase")]
21pub struct Book<'a> {
22 #[serde(borrow)]
23 pub authors: Vec<crate::sh_weaver::actor::Author<'a>>,
24 /// Client-declared timestamp when this was originally created.
25 #[serde(skip_serializing_if = "std::option::Option::is_none")]
26 #[builder(into)]
27 pub created_at: Option<jacquard_common::types::string::Datetime>,
28 #[serde(borrow)]
29 pub entry_list: Vec<crate::com_atproto::repo::strong_ref::StrongRef<'a>>,
30 #[serde(skip_serializing_if = "std::option::Option::is_none")]
31 #[builder(into)]
32 #[serde(borrow)]
33 pub tags: Option<crate::sh_weaver::notebook::Tags<'a>>,
34 #[serde(skip_serializing_if = "std::option::Option::is_none")]
35 #[builder(into)]
36 #[serde(borrow)]
37 pub title: Option<crate::sh_weaver::notebook::Title<'a>>,
38}
39
40/// Typed wrapper for GetRecord response with this collection's record type.
41#[derive(
42 serde::Serialize,
43 serde::Deserialize,
44 Debug,
45 Clone,
46 PartialEq,
47 Eq,
48 jacquard_derive::IntoStatic
49)]
50#[serde(rename_all = "camelCase")]
51pub struct BookGetRecordOutput<'a> {
52 #[serde(skip_serializing_if = "std::option::Option::is_none")]
53 #[serde(borrow)]
54 pub cid: std::option::Option<jacquard_common::types::string::Cid<'a>>,
55 #[serde(borrow)]
56 pub uri: jacquard_common::types::string::AtUri<'a>,
57 #[serde(borrow)]
58 pub value: Book<'a>,
59}
60
61/// Marker type for deserializing records from this collection.
62pub struct BookRecord;
63impl jacquard_common::xrpc::XrpcResp for BookRecord {
64 const NSID: &'static str = "sh.weaver.notebook.book";
65 const ENCODING: &'static str = "application/json";
66 type Output<'de> = BookGetRecordOutput<'de>;
67 type Err<'de> = jacquard_common::types::collection::RecordError<'de>;
68}
69
70impl jacquard_common::types::collection::Collection for Book<'_> {
71 const NSID: &'static str = "sh.weaver.notebook.book";
72 type Record = BookRecord;
73}
74
75impl From<BookGetRecordOutput<'_>> for Book<'_> {
76 fn from(output: BookGetRecordOutput<'_>) -> Self {
77 use jacquard_common::IntoStatic;
78 output.value.into_static()
79 }
80}