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