1// @generated by jacquard-lexicon. DO NOT EDIT.
2//
3// Lexicon: app.bsky.graph.verification
4//
5// This file was automatically generated from Lexicon schemas.
6// Any manual changes will be overwritten on the next regeneration.
7
8/// Record declaring a verification relationship between two accounts. Verifications are only considered valid by an app if issued by an account the app considers trusted.
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 Verification<'a> {
22 /// Date of when the verification was created.
23 pub created_at: jacquard_common::types::string::Datetime,
24 /// Display name of the subject the verification applies to at the moment of verifying, which might not be the same at the time of viewing. The verification is only valid if the current displayName matches the one at the time of verifying.
25 #[serde(borrow)]
26 #[builder(into)]
27 pub display_name: jacquard_common::CowStr<'a>,
28 /// Handle of the subject the verification applies to at the moment of verifying, which might not be the same at the time of viewing. The verification is only valid if the current handle matches the one at the time of verifying.
29 #[serde(borrow)]
30 pub handle: jacquard_common::types::string::Handle<'a>,
31 /// DID of the subject the verification applies to.
32 #[serde(borrow)]
33 pub subject: jacquard_common::types::string::Did<'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 VerificationGetRecordOutput<'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: Verification<'a>,
55}
56
57/// Marker type for deserializing records from this collection.
58pub struct VerificationRecord;
59impl jacquard_common::xrpc::XrpcResp for VerificationRecord {
60 const NSID: &'static str = "app.bsky.graph.verification";
61 const ENCODING: &'static str = "application/json";
62 type Output<'de> = VerificationGetRecordOutput<'de>;
63 type Err<'de> = jacquard_common::types::collection::RecordError<'de>;
64}
65
66impl jacquard_common::types::collection::Collection for Verification<'_> {
67 const NSID: &'static str = "app.bsky.graph.verification";
68 type Record = VerificationRecord;
69}
70
71impl From<VerificationGetRecordOutput<'_>> for Verification<'_> {
72 fn from(output: VerificationGetRecordOutput<'_>) -> Self {
73 use jacquard_common::IntoStatic;
74 output.value.into_static()
75 }
76}