1// @generated by jacquard-lexicon. DO NOT EDIT.
2//
3// Lexicon: app.rocksky.like
4//
5// This file was automatically generated from Lexicon schemas.
6// Any manual changes will be overwritten on the next regeneration.
7
8pub mod dislike_shout;
9pub mod dislike_song;
10pub mod like_shout;
11pub mod like_song;
12
13/// A declaration of a like.
14#[jacquard_derive::lexicon]
15#[derive(
16 serde::Serialize,
17 serde::Deserialize,
18 Debug,
19 Clone,
20 PartialEq,
21 Eq,
22 jacquard_derive::IntoStatic,
23 bon::Builder
24)]
25#[serde(rename_all = "camelCase")]
26pub struct Like<'a> {
27 /// The date when the like was created.
28 pub created_at: jacquard_common::types::string::Datetime,
29 #[serde(borrow)]
30 pub subject: crate::com_atproto::repo::strong_ref::StrongRef<'a>,
31}
32
33/// Typed wrapper for GetRecord response with this collection's record type.
34#[derive(
35 serde::Serialize,
36 serde::Deserialize,
37 Debug,
38 Clone,
39 PartialEq,
40 Eq,
41 jacquard_derive::IntoStatic
42)]
43#[serde(rename_all = "camelCase")]
44pub struct LikeGetRecordOutput<'a> {
45 #[serde(skip_serializing_if = "std::option::Option::is_none")]
46 #[serde(borrow)]
47 pub cid: std::option::Option<jacquard_common::types::string::Cid<'a>>,
48 #[serde(borrow)]
49 pub uri: jacquard_common::types::string::AtUri<'a>,
50 #[serde(borrow)]
51 pub value: Like<'a>,
52}
53
54/// Marker type for deserializing records from this collection.
55pub struct LikeRecord;
56impl jacquard_common::xrpc::XrpcResp for LikeRecord {
57 const NSID: &'static str = "app.rocksky.like";
58 const ENCODING: &'static str = "application/json";
59 type Output<'de> = LikeGetRecordOutput<'de>;
60 type Err<'de> = jacquard_common::types::collection::RecordError<'de>;
61}
62
63impl jacquard_common::types::collection::Collection for Like<'_> {
64 const NSID: &'static str = "app.rocksky.like";
65 type Record = LikeRecord;
66}
67
68impl From<LikeGetRecordOutput<'_>> for Like<'_> {
69 fn from(output: LikeGetRecordOutput<'_>) -> Self {
70 use jacquard_common::IntoStatic;
71 output.value.into_static()
72 }
73}