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