jacquard_api/
buzz_bookhive.rs

1// @generated by jacquard-lexicon. DO NOT EDIT.
2//
3// Lexicon: buzz.bookhive.defs
4//
5// This file was automatically generated from Lexicon schemas.
6// Any manual changes will be overwritten on the next regeneration.
7
8pub mod book;
9pub mod buzz;
10pub mod get_book;
11pub mod get_profile;
12pub mod hive_book;
13pub mod search_books;
14
15///User has abandoned the book
16#[derive(
17    serde::Serialize,
18    serde::Deserialize,
19    Debug,
20    Clone,
21    PartialEq,
22    Eq,
23    Hash,
24    jacquard_derive::IntoStatic
25)]
26pub struct Abandoned;
27impl std::fmt::Display for Abandoned {
28    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
29        write!(f, "abandoned")
30    }
31}
32
33#[jacquard_derive::lexicon]
34#[derive(
35    serde::Serialize,
36    serde::Deserialize,
37    Debug,
38    Clone,
39    PartialEq,
40    Eq,
41    jacquard_derive::IntoStatic
42)]
43#[serde(rename_all = "camelCase")]
44pub struct Activity<'a> {
45    pub created_at: jacquard_common::types::string::Datetime,
46    ///The hive id of the book
47    #[serde(borrow)]
48    pub hive_id: jacquard_common::CowStr<'a>,
49    ///The title of the book
50    #[serde(borrow)]
51    pub title: jacquard_common::CowStr<'a>,
52    #[serde(borrow)]
53    pub r#type: jacquard_common::CowStr<'a>,
54}
55
56#[jacquard_derive::lexicon]
57#[derive(
58    serde::Serialize,
59    serde::Deserialize,
60    Debug,
61    Clone,
62    PartialEq,
63    Eq,
64    jacquard_derive::IntoStatic
65)]
66#[serde(rename_all = "camelCase")]
67pub struct Comment<'a> {
68    #[serde(borrow)]
69    pub book: crate::com_atproto::repo::strong_ref::StrongRef<'a>,
70    ///The content of the comment.
71    #[serde(borrow)]
72    pub comment: jacquard_common::CowStr<'a>,
73    ///Client-declared timestamp when this comment was originally created.
74    pub created_at: jacquard_common::types::string::Datetime,
75    ///The DID of the user who made the comment
76    #[serde(borrow)]
77    pub did: jacquard_common::CowStr<'a>,
78    ///The handle of the user who made the comment
79    #[serde(borrow)]
80    pub handle: jacquard_common::CowStr<'a>,
81    #[serde(borrow)]
82    pub parent: crate::com_atproto::repo::strong_ref::StrongRef<'a>,
83}
84
85///User has finished reading the book
86#[derive(
87    serde::Serialize,
88    serde::Deserialize,
89    Debug,
90    Clone,
91    PartialEq,
92    Eq,
93    Hash,
94    jacquard_derive::IntoStatic
95)]
96pub struct Finished;
97impl std::fmt::Display for Finished {
98    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
99        write!(f, "finished")
100    }
101}
102
103///User owns the book
104#[derive(
105    serde::Serialize,
106    serde::Deserialize,
107    Debug,
108    Clone,
109    PartialEq,
110    Eq,
111    Hash,
112    jacquard_derive::IntoStatic
113)]
114pub struct Owned;
115impl std::fmt::Display for Owned {
116    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
117        write!(f, "owned")
118    }
119}
120
121#[jacquard_derive::lexicon]
122#[derive(
123    serde::Serialize,
124    serde::Deserialize,
125    Debug,
126    Clone,
127    PartialEq,
128    Eq,
129    jacquard_derive::IntoStatic
130)]
131#[serde(rename_all = "camelCase")]
132pub struct Profile<'a> {
133    #[serde(skip_serializing_if = "std::option::Option::is_none")]
134    #[serde(borrow)]
135    pub avatar: std::option::Option<jacquard_common::CowStr<'a>>,
136    pub books_read: i64,
137    #[serde(skip_serializing_if = "std::option::Option::is_none")]
138    #[serde(borrow)]
139    pub description: std::option::Option<jacquard_common::CowStr<'a>>,
140    #[serde(borrow)]
141    pub display_name: jacquard_common::CowStr<'a>,
142    #[serde(borrow)]
143    pub handle: jacquard_common::CowStr<'a>,
144    pub reviews: i64,
145}
146
147///User is currently reading the book
148#[derive(
149    serde::Serialize,
150    serde::Deserialize,
151    Debug,
152    Clone,
153    PartialEq,
154    Eq,
155    Hash,
156    jacquard_derive::IntoStatic
157)]
158pub struct Reading;
159impl std::fmt::Display for Reading {
160    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
161        write!(f, "reading")
162    }
163}
164
165#[jacquard_derive::lexicon]
166#[derive(
167    serde::Serialize,
168    serde::Deserialize,
169    Debug,
170    Clone,
171    PartialEq,
172    Eq,
173    jacquard_derive::IntoStatic
174)]
175#[serde(rename_all = "camelCase")]
176pub struct Review<'a> {
177    ///The date the review was created
178    pub created_at: jacquard_common::types::string::Datetime,
179    ///The DID of the user who made the review
180    #[serde(borrow)]
181    pub did: jacquard_common::CowStr<'a>,
182    ///The handle of the user who made the review
183    #[serde(borrow)]
184    pub handle: jacquard_common::CowStr<'a>,
185    ///The review content
186    #[serde(borrow)]
187    pub review: jacquard_common::CowStr<'a>,
188    ///The number of stars given to the book
189    #[serde(skip_serializing_if = "std::option::Option::is_none")]
190    pub stars: std::option::Option<i64>,
191}
192
193#[jacquard_derive::lexicon]
194#[derive(
195    serde::Serialize,
196    serde::Deserialize,
197    Debug,
198    Clone,
199    PartialEq,
200    Eq,
201    jacquard_derive::IntoStatic
202)]
203#[serde(rename_all = "camelCase")]
204pub struct UserBook<'a> {
205    ///The authors of the book (tab separated)
206    #[serde(borrow)]
207    pub authors: jacquard_common::CowStr<'a>,
208    ///Cover image of the book
209    #[serde(skip_serializing_if = "std::option::Option::is_none")]
210    #[serde(borrow)]
211    pub cover: std::option::Option<jacquard_common::CowStr<'a>>,
212    pub created_at: jacquard_common::types::string::Datetime,
213    ///Book description/summary
214    #[serde(skip_serializing_if = "std::option::Option::is_none")]
215    #[serde(borrow)]
216    pub description: std::option::Option<jacquard_common::CowStr<'a>>,
217    ///The date the user finished reading the book
218    #[serde(skip_serializing_if = "std::option::Option::is_none")]
219    pub finished_at: std::option::Option<jacquard_common::types::string::Datetime>,
220    ///The book's hive id, used to correlate user's books with the hive
221    #[serde(borrow)]
222    pub hive_id: jacquard_common::CowStr<'a>,
223    ///Average rating (0-1000)
224    #[serde(skip_serializing_if = "std::option::Option::is_none")]
225    pub rating: std::option::Option<i64>,
226    ///The book's review
227    #[serde(skip_serializing_if = "std::option::Option::is_none")]
228    #[serde(borrow)]
229    pub review: std::option::Option<jacquard_common::CowStr<'a>>,
230    ///Number of stars given to the book (1-10) which will be mapped to 1-5 stars
231    #[serde(skip_serializing_if = "std::option::Option::is_none")]
232    pub stars: std::option::Option<i64>,
233    ///The date the user started reading the book
234    #[serde(skip_serializing_if = "std::option::Option::is_none")]
235    pub started_at: std::option::Option<jacquard_common::types::string::Datetime>,
236    #[serde(skip_serializing_if = "std::option::Option::is_none")]
237    #[serde(borrow)]
238    pub status: std::option::Option<jacquard_common::CowStr<'a>>,
239    ///Cover image of the book
240    #[serde(borrow)]
241    pub thumbnail: jacquard_common::CowStr<'a>,
242    ///The title of the book
243    #[serde(borrow)]
244    pub title: jacquard_common::CowStr<'a>,
245}
246
247///User wants to read the book
248#[derive(
249    serde::Serialize,
250    serde::Deserialize,
251    Debug,
252    Clone,
253    PartialEq,
254    Eq,
255    Hash,
256    jacquard_derive::IntoStatic
257)]
258pub struct WantToRead;
259impl std::fmt::Display for WantToRead {
260    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
261        write!(f, "wantToRead")
262    }
263}