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 bon::Builder
43)]
44#[serde(rename_all = "camelCase")]
45pub struct Activity<'a> {
46 pub created_at: jacquard_common::types::string::Datetime,
47 /// The hive id of the book
48 #[serde(borrow)]
49 #[builder(into)]
50 pub hive_id: jacquard_common::CowStr<'a>,
51 /// The title of the book
52 #[serde(borrow)]
53 #[builder(into)]
54 pub title: jacquard_common::CowStr<'a>,
55 #[serde(borrow)]
56 #[builder(into)]
57 pub r#type: jacquard_common::CowStr<'a>,
58}
59
60#[jacquard_derive::lexicon]
61#[derive(
62 serde::Serialize,
63 serde::Deserialize,
64 Debug,
65 Clone,
66 PartialEq,
67 Eq,
68 jacquard_derive::IntoStatic,
69 bon::Builder
70)]
71#[serde(rename_all = "camelCase")]
72pub struct Comment<'a> {
73 #[serde(borrow)]
74 pub book: crate::com_atproto::repo::strong_ref::StrongRef<'a>,
75 /// The content of the comment.
76 #[serde(borrow)]
77 #[builder(into)]
78 pub comment: jacquard_common::CowStr<'a>,
79 /// Client-declared timestamp when this comment was originally created.
80 pub created_at: jacquard_common::types::string::Datetime,
81 /// The DID of the user who made the comment
82 #[serde(borrow)]
83 #[builder(into)]
84 pub did: jacquard_common::CowStr<'a>,
85 /// The handle of the user who made the comment
86 #[serde(borrow)]
87 #[builder(into)]
88 pub handle: jacquard_common::CowStr<'a>,
89 #[serde(borrow)]
90 pub parent: crate::com_atproto::repo::strong_ref::StrongRef<'a>,
91}
92
93/// User has finished reading the book
94#[derive(
95 serde::Serialize,
96 serde::Deserialize,
97 Debug,
98 Clone,
99 PartialEq,
100 Eq,
101 Hash,
102 jacquard_derive::IntoStatic
103)]
104pub struct Finished;
105impl std::fmt::Display for Finished {
106 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
107 write!(f, "finished")
108 }
109}
110
111/// User owns the book
112#[derive(
113 serde::Serialize,
114 serde::Deserialize,
115 Debug,
116 Clone,
117 PartialEq,
118 Eq,
119 Hash,
120 jacquard_derive::IntoStatic
121)]
122pub struct Owned;
123impl std::fmt::Display for Owned {
124 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
125 write!(f, "owned")
126 }
127}
128
129#[jacquard_derive::lexicon]
130#[derive(
131 serde::Serialize,
132 serde::Deserialize,
133 Debug,
134 Clone,
135 PartialEq,
136 Eq,
137 jacquard_derive::IntoStatic,
138 bon::Builder
139)]
140#[serde(rename_all = "camelCase")]
141pub struct Profile<'a> {
142 #[serde(skip_serializing_if = "std::option::Option::is_none")]
143 #[builder(into)]
144 #[serde(borrow)]
145 pub avatar: Option<jacquard_common::CowStr<'a>>,
146 pub books_read: i64,
147 #[serde(skip_serializing_if = "std::option::Option::is_none")]
148 #[builder(into)]
149 #[serde(borrow)]
150 pub description: Option<jacquard_common::CowStr<'a>>,
151 #[serde(borrow)]
152 #[builder(into)]
153 pub display_name: jacquard_common::CowStr<'a>,
154 #[serde(borrow)]
155 #[builder(into)]
156 pub handle: jacquard_common::CowStr<'a>,
157 pub reviews: i64,
158}
159
160/// User is currently reading the book
161#[derive(
162 serde::Serialize,
163 serde::Deserialize,
164 Debug,
165 Clone,
166 PartialEq,
167 Eq,
168 Hash,
169 jacquard_derive::IntoStatic
170)]
171pub struct Reading;
172impl std::fmt::Display for Reading {
173 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
174 write!(f, "reading")
175 }
176}
177
178#[jacquard_derive::lexicon]
179#[derive(
180 serde::Serialize,
181 serde::Deserialize,
182 Debug,
183 Clone,
184 PartialEq,
185 Eq,
186 jacquard_derive::IntoStatic,
187 bon::Builder
188)]
189#[serde(rename_all = "camelCase")]
190pub struct Review<'a> {
191 /// The date the review was created
192 pub created_at: jacquard_common::types::string::Datetime,
193 /// The DID of the user who made the review
194 #[serde(borrow)]
195 #[builder(into)]
196 pub did: jacquard_common::CowStr<'a>,
197 /// The handle of the user who made the review
198 #[serde(borrow)]
199 #[builder(into)]
200 pub handle: jacquard_common::CowStr<'a>,
201 /// The review content
202 #[serde(borrow)]
203 #[builder(into)]
204 pub review: jacquard_common::CowStr<'a>,
205 /// The number of stars given to the book
206 #[serde(skip_serializing_if = "std::option::Option::is_none")]
207 #[builder(into)]
208 pub stars: Option<i64>,
209}
210
211#[jacquard_derive::lexicon]
212#[derive(
213 serde::Serialize,
214 serde::Deserialize,
215 Debug,
216 Clone,
217 PartialEq,
218 Eq,
219 jacquard_derive::IntoStatic,
220 bon::Builder
221)]
222#[serde(rename_all = "camelCase")]
223pub struct UserBook<'a> {
224 /// The authors of the book (tab separated)
225 #[serde(borrow)]
226 #[builder(into)]
227 pub authors: jacquard_common::CowStr<'a>,
228 /// Cover image of the book
229 #[serde(skip_serializing_if = "std::option::Option::is_none")]
230 #[builder(into)]
231 #[serde(borrow)]
232 pub cover: Option<jacquard_common::CowStr<'a>>,
233 pub created_at: jacquard_common::types::string::Datetime,
234 /// Book description/summary
235 #[serde(skip_serializing_if = "std::option::Option::is_none")]
236 #[builder(into)]
237 #[serde(borrow)]
238 pub description: Option<jacquard_common::CowStr<'a>>,
239 /// The date the user finished reading the book
240 #[serde(skip_serializing_if = "std::option::Option::is_none")]
241 #[builder(into)]
242 pub finished_at: Option<jacquard_common::types::string::Datetime>,
243 /// The book's hive id, used to correlate user's books with the hive
244 #[serde(borrow)]
245 #[builder(into)]
246 pub hive_id: jacquard_common::CowStr<'a>,
247 /// Average rating (0-1000)
248 #[serde(skip_serializing_if = "std::option::Option::is_none")]
249 #[builder(into)]
250 pub rating: Option<i64>,
251 /// The book's review
252 #[serde(skip_serializing_if = "std::option::Option::is_none")]
253 #[builder(into)]
254 #[serde(borrow)]
255 pub review: Option<jacquard_common::CowStr<'a>>,
256 /// Number of stars given to the book (1-10) which will be mapped to 1-5 stars
257 #[serde(skip_serializing_if = "std::option::Option::is_none")]
258 #[builder(into)]
259 pub stars: Option<i64>,
260 /// The date the user started reading the book
261 #[serde(skip_serializing_if = "std::option::Option::is_none")]
262 #[builder(into)]
263 pub started_at: Option<jacquard_common::types::string::Datetime>,
264 #[serde(skip_serializing_if = "std::option::Option::is_none")]
265 #[builder(into)]
266 #[serde(borrow)]
267 pub status: Option<jacquard_common::CowStr<'a>>,
268 /// Cover image of the book
269 #[serde(borrow)]
270 #[builder(into)]
271 pub thumbnail: jacquard_common::CowStr<'a>,
272 /// The title of the book
273 #[serde(borrow)]
274 #[builder(into)]
275 pub title: jacquard_common::CowStr<'a>,
276}
277
278/// User wants to read the book
279#[derive(
280 serde::Serialize,
281 serde::Deserialize,
282 Debug,
283 Clone,
284 PartialEq,
285 Eq,
286 Hash,
287 jacquard_derive::IntoStatic
288)]
289pub struct WantToRead;
290impl std::fmt::Display for WantToRead {
291 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
292 write!(f, "wantToRead")
293 }
294}