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 bon::Builder
18)]
19#[serde(rename_all = "camelCase")]
20pub struct Rel<'a> {
21 #[serde(skip_serializing_if = "std::option::Option::is_none")]
22 #[builder(into)]
23 pub finished_at: Option<Vec<jacquard_common::types::string::Datetime>>,
24 #[serde(borrow)]
25 pub item: crate::my_skylights::Item<'a>,
26 #[serde(skip_serializing_if = "std::option::Option::is_none")]
27 #[builder(into)]
28 #[serde(borrow)]
29 pub note: Option<crate::my_skylights::rel::Note<'a>>,
30 #[serde(skip_serializing_if = "std::option::Option::is_none")]
31 #[builder(into)]
32 #[serde(borrow)]
33 pub rating: Option<crate::my_skylights::rel::Rating<'a>>,
34}
35
36/// Typed wrapper for GetRecord response with this collection's record type.
37#[derive(
38 serde::Serialize,
39 serde::Deserialize,
40 Debug,
41 Clone,
42 PartialEq,
43 Eq,
44 jacquard_derive::IntoStatic
45)]
46#[serde(rename_all = "camelCase")]
47pub struct RelGetRecordOutput<'a> {
48 #[serde(skip_serializing_if = "std::option::Option::is_none")]
49 #[serde(borrow)]
50 pub cid: std::option::Option<jacquard_common::types::string::Cid<'a>>,
51 #[serde(borrow)]
52 pub uri: jacquard_common::types::string::AtUri<'a>,
53 #[serde(borrow)]
54 pub value: Rel<'a>,
55}
56
57/// Marker type for deserializing records from this collection.
58pub struct RelRecord;
59impl jacquard_common::xrpc::XrpcResp for RelRecord {
60 const NSID: &'static str = "my.skylights.rel";
61 const ENCODING: &'static str = "application/json";
62 type Output<'de> = RelGetRecordOutput<'de>;
63 type Err<'de> = jacquard_common::types::collection::RecordError<'de>;
64}
65
66impl jacquard_common::types::collection::Collection for Rel<'_> {
67 const NSID: &'static str = "my.skylights.rel";
68 type Record = RelRecord;
69}
70
71impl From<RelGetRecordOutput<'_>> for Rel<'_> {
72 fn from(output: RelGetRecordOutput<'_>) -> Self {
73 use jacquard_common::IntoStatic;
74 output.value.into_static()
75 }
76}
77
78#[jacquard_derive::lexicon]
79#[derive(
80 serde::Serialize,
81 serde::Deserialize,
82 Debug,
83 Clone,
84 PartialEq,
85 Eq,
86 jacquard_derive::IntoStatic,
87 bon::Builder
88)]
89#[serde(rename_all = "camelCase")]
90pub struct Note<'a> {
91 pub created_at: jacquard_common::types::string::Datetime,
92 pub updated_at: jacquard_common::types::string::Datetime,
93 #[serde(borrow)]
94 #[builder(into)]
95 pub value: jacquard_common::CowStr<'a>,
96}
97
98#[jacquard_derive::lexicon]
99#[derive(
100 serde::Serialize,
101 serde::Deserialize,
102 Debug,
103 Clone,
104 PartialEq,
105 Eq,
106 jacquard_derive::IntoStatic,
107 bon::Builder
108)]
109#[serde(rename_all = "camelCase")]
110pub struct Rating<'a> {
111 pub created_at: jacquard_common::types::string::Datetime,
112 pub value: i64,
113}