A better Rust ATProto crate
1// @generated by jacquard-lexicon. DO NOT EDIT. 2// 3// Lexicon: net.anisota.feed.like 4// 5// This file was automatically generated from Lexicon schemas. 6// Any manual changes will be overwritten on the next regeneration. 7 8/// Record declaring a 'like' of a piece of content published in the Anisota feed. The target of the like is the 'subject' of the record. 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 Like<'a> { 22 /// Client-declared timestamp when this like was created. 23 pub created_at: jacquard_common::types::string::Datetime, 24 /// The subject of the like. 25 #[serde(borrow)] 26 pub subject: crate::com_atproto::repo::strong_ref::StrongRef<'a>, 27} 28 29/// Typed wrapper for GetRecord response with this collection's record type. 30#[derive( 31 serde::Serialize, 32 serde::Deserialize, 33 Debug, 34 Clone, 35 PartialEq, 36 Eq, 37 jacquard_derive::IntoStatic 38)] 39#[serde(rename_all = "camelCase")] 40pub struct LikeGetRecordOutput<'a> { 41 #[serde(skip_serializing_if = "std::option::Option::is_none")] 42 #[serde(borrow)] 43 pub cid: std::option::Option<jacquard_common::types::string::Cid<'a>>, 44 #[serde(borrow)] 45 pub uri: jacquard_common::types::string::AtUri<'a>, 46 #[serde(borrow)] 47 pub value: Like<'a>, 48} 49 50/// Marker type for deserializing records from this collection. 51pub struct LikeRecord; 52impl jacquard_common::xrpc::XrpcResp for LikeRecord { 53 const NSID: &'static str = "net.anisota.feed.like"; 54 const ENCODING: &'static str = "application/json"; 55 type Output<'de> = LikeGetRecordOutput<'de>; 56 type Err<'de> = jacquard_common::types::collection::RecordError<'de>; 57} 58 59impl jacquard_common::types::collection::Collection for Like<'_> { 60 const NSID: &'static str = "net.anisota.feed.like"; 61 type Record = LikeRecord; 62} 63 64impl From<LikeGetRecordOutput<'_>> for Like<'_> { 65 fn from(output: LikeGetRecordOutput<'_>) -> Self { 66 use jacquard_common::IntoStatic; 67 output.value.into_static() 68 } 69}