A better Rust ATProto crate
at main 3.5 kB view raw
1// @generated by jacquard-lexicon. DO NOT EDIT. 2// 3// Lexicon: social.clippr.feed.clip 4// 5// This file was automatically generated from Lexicon schemas. 6// Any manual changes will be overwritten on the next regeneration. 7 8/// Record containing a bookmarked item, or 'clip'. 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 Clip<'a> { 22 /// Client-declared timestamp when the bookmark is created 23 pub created_at: jacquard_common::types::string::Datetime, 24 /// A description of the bookmark's content. This should be ripped from the URL metadata and be static for all records using the URL. 25 #[serde(borrow)] 26 #[builder(into)] 27 pub description: jacquard_common::CowStr<'a>, 28 /// Indicates human language of the given URL 29 #[serde(skip_serializing_if = "std::option::Option::is_none")] 30 #[builder(into)] 31 pub languages: Option<Vec<jacquard_common::types::string::Language>>, 32 /// User-written notes for the bookmark. Public and personal. 33 #[serde(skip_serializing_if = "std::option::Option::is_none")] 34 #[builder(into)] 35 #[serde(borrow)] 36 pub notes: Option<jacquard_common::CowStr<'a>>, 37 /// An array of tags. A format of solely alphanumeric characters and dashes should be used. 38 #[serde(skip_serializing_if = "std::option::Option::is_none")] 39 #[builder(into)] 40 #[serde(borrow)] 41 pub tags: Option<Vec<crate::com_atproto::repo::strong_ref::StrongRef<'a>>>, 42 /// The title of the bookmark. If left empty, reuse the URL. 43 #[serde(borrow)] 44 #[builder(into)] 45 pub title: jacquard_common::CowStr<'a>, 46 /// Whether the bookmark can be used for feed indexing and aggregation 47 pub unlisted: bool, 48 /// Whether the bookmark has been read by the user 49 #[serde(skip_serializing_if = "std::option::Option::is_none")] 50 #[builder(into)] 51 pub unread: Option<bool>, 52 /// The URL of the bookmark. Cannot be left empty or be modified after creation. 53 #[serde(borrow)] 54 pub url: jacquard_common::types::string::Uri<'a>, 55} 56 57/// Typed wrapper for GetRecord response with this collection's record type. 58#[derive( 59 serde::Serialize, 60 serde::Deserialize, 61 Debug, 62 Clone, 63 PartialEq, 64 Eq, 65 jacquard_derive::IntoStatic 66)] 67#[serde(rename_all = "camelCase")] 68pub struct ClipGetRecordOutput<'a> { 69 #[serde(skip_serializing_if = "std::option::Option::is_none")] 70 #[serde(borrow)] 71 pub cid: std::option::Option<jacquard_common::types::string::Cid<'a>>, 72 #[serde(borrow)] 73 pub uri: jacquard_common::types::string::AtUri<'a>, 74 #[serde(borrow)] 75 pub value: Clip<'a>, 76} 77 78/// Marker type for deserializing records from this collection. 79pub struct ClipRecord; 80impl jacquard_common::xrpc::XrpcResp for ClipRecord { 81 const NSID: &'static str = "social.clippr.feed.clip"; 82 const ENCODING: &'static str = "application/json"; 83 type Output<'de> = ClipGetRecordOutput<'de>; 84 type Err<'de> = jacquard_common::types::collection::RecordError<'de>; 85} 86 87impl jacquard_common::types::collection::Collection for Clip<'_> { 88 const NSID: &'static str = "social.clippr.feed.clip"; 89 type Record = ClipRecord; 90} 91 92impl From<ClipGetRecordOutput<'_>> for Clip<'_> { 93 fn from(output: ClipGetRecordOutput<'_>) -> Self { 94 use jacquard_common::IntoStatic; 95 output.value.into_static() 96 } 97}