jacquard_api/my_skylights/
rel.rs

1// @generated by jacquard-lexicon. DO NOT EDIT.
2//
3// Lexicon: my.skylights.rel
4//
5// This file was automatically generated from Lexicon schemas.
6// Any manual changes will be overwritten on the next regeneration.
7
8#[jacquard_derive::lexicon]
9#[derive(
10    serde::Serialize,
11    serde::Deserialize,
12    Debug,
13    Clone,
14    PartialEq,
15    Eq,
16    jacquard_derive::IntoStatic
17)]
18#[serde(rename_all = "camelCase")]
19pub struct Rel<'a> {
20    #[serde(skip_serializing_if = "std::option::Option::is_none")]
21    pub finished_at: std::option::Option<Vec<jacquard_common::types::string::Datetime>>,
22    #[serde(borrow)]
23    pub item: crate::my_skylights::Item<'a>,
24    #[serde(skip_serializing_if = "std::option::Option::is_none")]
25    #[serde(borrow)]
26    pub note: std::option::Option<crate::my_skylights::rel::Note<'a>>,
27    #[serde(skip_serializing_if = "std::option::Option::is_none")]
28    #[serde(borrow)]
29    pub rating: std::option::Option<crate::my_skylights::rel::Rating<'a>>,
30}
31
32/// Typed wrapper for GetRecord response with this collection's record type.
33#[derive(
34    serde::Serialize,
35    serde::Deserialize,
36    Debug,
37    Clone,
38    PartialEq,
39    Eq,
40    jacquard_derive::IntoStatic
41)]
42#[serde(rename_all = "camelCase")]
43pub struct RelGetRecordOutput<'a> {
44    #[serde(skip_serializing_if = "std::option::Option::is_none")]
45    #[serde(borrow)]
46    pub cid: std::option::Option<jacquard_common::types::string::Cid<'a>>,
47    #[serde(borrow)]
48    pub uri: jacquard_common::types::string::AtUri<'a>,
49    #[serde(borrow)]
50    pub value: Rel<'a>,
51}
52
53/// Marker type for deserializing records from this collection.
54pub struct RelRecord;
55impl jacquard_common::xrpc::XrpcResp for RelRecord {
56    const NSID: &'static str = "my.skylights.rel";
57    const ENCODING: &'static str = "application/json";
58    type Output<'de> = RelGetRecordOutput<'de>;
59    type Err<'de> = jacquard_common::types::collection::RecordError<'de>;
60}
61
62impl jacquard_common::types::collection::Collection for Rel<'_> {
63    const NSID: &'static str = "my.skylights.rel";
64    type Record = RelRecord;
65}
66
67impl From<RelGetRecordOutput<'_>> for Rel<'_> {
68    fn from(output: RelGetRecordOutput<'_>) -> Self {
69        use jacquard_common::IntoStatic;
70        output.value.into_static()
71    }
72}
73
74#[jacquard_derive::lexicon]
75#[derive(
76    serde::Serialize,
77    serde::Deserialize,
78    Debug,
79    Clone,
80    PartialEq,
81    Eq,
82    jacquard_derive::IntoStatic
83)]
84#[serde(rename_all = "camelCase")]
85pub struct Note<'a> {
86    pub created_at: jacquard_common::types::string::Datetime,
87    pub updated_at: jacquard_common::types::string::Datetime,
88    #[serde(borrow)]
89    pub value: jacquard_common::CowStr<'a>,
90}
91
92#[jacquard_derive::lexicon]
93#[derive(
94    serde::Serialize,
95    serde::Deserialize,
96    Debug,
97    Clone,
98    PartialEq,
99    Eq,
100    jacquard_derive::IntoStatic
101)]
102#[serde(rename_all = "camelCase")]
103pub struct Rating<'a> {
104    pub created_at: jacquard_common::types::string::Datetime,
105    pub value: i64,
106}