1// @generated by jacquard-lexicon. DO NOT EDIT.
2//
3// Lexicon: app.bsky.feed.repost
4//
5// This file was automatically generated from Lexicon schemas.
6// Any manual changes will be overwritten on the next regeneration.
7
8/// Record representing a 'repost' of an existing Bluesky post.
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 Repost<'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 RepostGetRecordOutput<'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: Repost<'a>,
50}
51
52/// Marker type for deserializing records from this collection.
53pub struct RepostRecord;
54impl jacquard_common::xrpc::XrpcResp for RepostRecord {
55 const NSID: &'static str = "app.bsky.feed.repost";
56 const ENCODING: &'static str = "application/json";
57 type Output<'de> = RepostGetRecordOutput<'de>;
58 type Err<'de> = jacquard_common::types::collection::RecordError<'de>;
59}
60
61impl jacquard_common::types::collection::Collection for Repost<'_> {
62 const NSID: &'static str = "app.bsky.feed.repost";
63 type Record = RepostRecord;
64}
65
66impl From<RepostGetRecordOutput<'_>> for Repost<'_> {
67 fn from(output: RepostGetRecordOutput<'_>) -> Self {
68 use jacquard_common::IntoStatic;
69 output.value.into_static()
70 }
71}