A better Rust ATProto crate
at main 2.1 kB view raw
1// @generated by jacquard-lexicon. DO NOT EDIT. 2// 3// Lexicon: app.bsky.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 subject content. 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 pub created_at: jacquard_common::types::string::Datetime, 23 #[serde(borrow)] 24 pub subject: crate::com_atproto::repo::strong_ref::StrongRef<'a>, 25 #[serde(skip_serializing_if = "std::option::Option::is_none")] 26 #[builder(into)] 27 #[serde(borrow)] 28 pub via: Option<crate::com_atproto::repo::strong_ref::StrongRef<'a>>, 29} 30 31/// Typed wrapper for GetRecord response with this collection's record type. 32#[derive( 33 serde::Serialize, 34 serde::Deserialize, 35 Debug, 36 Clone, 37 PartialEq, 38 Eq, 39 jacquard_derive::IntoStatic 40)] 41#[serde(rename_all = "camelCase")] 42pub struct LikeGetRecordOutput<'a> { 43 #[serde(skip_serializing_if = "std::option::Option::is_none")] 44 #[serde(borrow)] 45 pub cid: std::option::Option<jacquard_common::types::string::Cid<'a>>, 46 #[serde(borrow)] 47 pub uri: jacquard_common::types::string::AtUri<'a>, 48 #[serde(borrow)] 49 pub value: Like<'a>, 50} 51 52/// Marker type for deserializing records from this collection. 53pub struct LikeRecord; 54impl jacquard_common::xrpc::XrpcResp for LikeRecord { 55 const NSID: &'static str = "app.bsky.feed.like"; 56 const ENCODING: &'static str = "application/json"; 57 type Output<'de> = LikeGetRecordOutput<'de>; 58 type Err<'de> = jacquard_common::types::collection::RecordError<'de>; 59} 60 61impl jacquard_common::types::collection::Collection for Like<'_> { 62 const NSID: &'static str = "app.bsky.feed.like"; 63 type Record = LikeRecord; 64} 65 66impl From<LikeGetRecordOutput<'_>> for Like<'_> { 67 fn from(output: LikeGetRecordOutput<'_>) -> Self { 68 use jacquard_common::IntoStatic; 69 output.value.into_static() 70 } 71}