1// @generated by jacquard-lexicon. DO NOT EDIT.
2//
3// Lexicon: place.atwork.endorsement
4//
5// This file was automatically generated from Lexicon schemas.
6// Any manual changes will be overwritten on the next regeneration.
7
8/// A cryptographically-verified professional endorsement between two identities.
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 Endorsement<'a> {
22 /// Timestamp when the endorsement was created.
23 pub created_at: jacquard_common::types::string::Datetime,
24 /// The DID of the identity giving the endorsement.
25 #[serde(borrow)]
26 pub giver: jacquard_common::types::string::Did<'a>,
27 /// The DID of the identity receiving the endorsement.
28 #[serde(borrow)]
29 pub receiver: jacquard_common::types::string::Did<'a>,
30 /// Verified signatures from endorsement proofs (strong references).
31 #[serde(skip_serializing_if = "std::option::Option::is_none")]
32 #[builder(into)]
33 #[serde(borrow)]
34 pub signatures: Option<Vec<crate::com_atproto::repo::strong_ref::StrongRef<'a>>>,
35 /// The endorsement text content.
36 #[serde(borrow)]
37 #[builder(into)]
38 pub text: jacquard_common::CowStr<'a>,
39}
40
41/// Typed wrapper for GetRecord response with this collection's record type.
42#[derive(
43 serde::Serialize,
44 serde::Deserialize,
45 Debug,
46 Clone,
47 PartialEq,
48 Eq,
49 jacquard_derive::IntoStatic
50)]
51#[serde(rename_all = "camelCase")]
52pub struct EndorsementGetRecordOutput<'a> {
53 #[serde(skip_serializing_if = "std::option::Option::is_none")]
54 #[serde(borrow)]
55 pub cid: std::option::Option<jacquard_common::types::string::Cid<'a>>,
56 #[serde(borrow)]
57 pub uri: jacquard_common::types::string::AtUri<'a>,
58 #[serde(borrow)]
59 pub value: Endorsement<'a>,
60}
61
62/// Marker type for deserializing records from this collection.
63pub struct EndorsementRecord;
64impl jacquard_common::xrpc::XrpcResp for EndorsementRecord {
65 const NSID: &'static str = "place.atwork.endorsement";
66 const ENCODING: &'static str = "application/json";
67 type Output<'de> = EndorsementGetRecordOutput<'de>;
68 type Err<'de> = jacquard_common::types::collection::RecordError<'de>;
69}
70
71impl jacquard_common::types::collection::Collection for Endorsement<'_> {
72 const NSID: &'static str = "place.atwork.endorsement";
73 type Record = EndorsementRecord;
74}
75
76impl From<EndorsementGetRecordOutput<'_>> for Endorsement<'_> {
77 fn from(output: EndorsementGetRecordOutput<'_>) -> Self {
78 use jacquard_common::IntoStatic;
79 output.value.into_static()
80 }
81}