1// @generated by jacquard-lexicon. DO NOT EDIT.
2//
3// Lexicon: app.ocho.edu.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 an account and a .edu domain. 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 /// The domain the subject is verified under.
25 #[serde(borrow)]
26 #[builder(into)]
27 pub domain: jacquard_common::CowStr<'a>,
28 /// DID of the subject the verification applies to.
29 #[serde(borrow)]
30 pub subject: jacquard_common::types::string::Did<'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 VerificationGetRecordOutput<'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: Verification<'a>,
52}
53
54/// Marker type for deserializing records from this collection.
55pub struct VerificationRecord;
56impl jacquard_common::xrpc::XrpcResp for VerificationRecord {
57 const NSID: &'static str = "app.ocho.edu.verification";
58 const ENCODING: &'static str = "application/json";
59 type Output<'de> = VerificationGetRecordOutput<'de>;
60 type Err<'de> = jacquard_common::types::collection::RecordError<'de>;
61}
62
63impl jacquard_common::types::collection::Collection for Verification<'_> {
64 const NSID: &'static str = "app.ocho.edu.verification";
65 type Record = VerificationRecord;
66}
67
68impl From<VerificationGetRecordOutput<'_>> for Verification<'_> {
69 fn from(output: VerificationGetRecordOutput<'_>) -> Self {
70 use jacquard_common::IntoStatic;
71 output.value.into_static()
72 }
73}