// @generated by jacquard-lexicon. DO NOT EDIT. // // Lexicon: buzz.bookhive.book // // This file was automatically generated from Lexicon schemas. // Any manual changes will be overwritten on the next regeneration. ///A book in the user's library #[jacquard_derive::lexicon] #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic )] #[serde(rename_all = "camelCase")] pub struct Book<'a> { ///The authors of the book (tab separated) #[serde(borrow)] pub authors: jacquard_common::CowStr<'a>, ///Cover image of the book #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub cover: std::option::Option>, pub created_at: jacquard_common::types::string::Datetime, ///The date the user finished reading the book #[serde(skip_serializing_if = "std::option::Option::is_none")] pub finished_at: std::option::Option, ///The book's hive id, used to correlate user's books with the hive #[serde(borrow)] pub hive_id: jacquard_common::CowStr<'a>, ///The book's review #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub review: std::option::Option>, ///Number of stars given to the book (1-10) which will be mapped to 1-5 stars #[serde(skip_serializing_if = "std::option::Option::is_none")] pub stars: std::option::Option, ///The date the user started reading the book #[serde(skip_serializing_if = "std::option::Option::is_none")] pub started_at: std::option::Option, #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub status: std::option::Option>, ///The title of the book #[serde(borrow)] pub title: jacquard_common::CowStr<'a>, } /// Typed wrapper for GetRecord response with this collection's record type. #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic )] #[serde(rename_all = "camelCase")] pub struct BookGetRecordOutput<'a> { #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub cid: std::option::Option>, #[serde(borrow)] pub uri: jacquard_common::types::string::AtUri<'a>, #[serde(borrow)] pub value: Book<'a>, } /// Marker type for deserializing records from this collection. pub struct BookRecord; impl jacquard_common::xrpc::XrpcResp for BookRecord { const NSID: &'static str = "buzz.bookhive.book"; const ENCODING: &'static str = "application/json"; type Output<'de> = BookGetRecordOutput<'de>; type Err<'de> = jacquard_common::types::collection::RecordError<'de>; } impl jacquard_common::types::collection::Collection for Book<'_> { const NSID: &'static str = "buzz.bookhive.book"; type Record = BookRecord; } impl From> for Book<'_> { fn from(output: BookGetRecordOutput<'_>) -> Self { use jacquard_common::IntoStatic; output.value.into_static() } }