1// @generated by jacquard-lexicon. DO NOT EDIT.
2//
3// Lexicon: network.slices.actor.profile
4//
5// This file was automatically generated from Lexicon schemas.
6// Any manual changes will be overwritten on the next regeneration.
7
8/// A declaration of a basic account profile.
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 Profile<'a> {
22 /// Small image to be displayed next to posts from account. AKA, 'profile picture'
23 #[serde(skip_serializing_if = "std::option::Option::is_none")]
24 #[builder(into)]
25 #[serde(borrow)]
26 pub avatar: Option<jacquard_common::types::blob::Blob<'a>>,
27 #[serde(skip_serializing_if = "std::option::Option::is_none")]
28 #[builder(into)]
29 pub created_at: Option<jacquard_common::types::string::Datetime>,
30 /// Free-form profile description text.
31 #[serde(skip_serializing_if = "std::option::Option::is_none")]
32 #[builder(into)]
33 #[serde(borrow)]
34 pub description: Option<jacquard_common::CowStr<'a>>,
35 #[serde(skip_serializing_if = "std::option::Option::is_none")]
36 #[builder(into)]
37 #[serde(borrow)]
38 pub display_name: Option<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 ProfileGetRecordOutput<'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: Profile<'a>,
60}
61
62/// Marker type for deserializing records from this collection.
63pub struct ProfileRecord;
64impl jacquard_common::xrpc::XrpcResp for ProfileRecord {
65 const NSID: &'static str = "network.slices.actor.profile";
66 const ENCODING: &'static str = "application/json";
67 type Output<'de> = ProfileGetRecordOutput<'de>;
68 type Err<'de> = jacquard_common::types::collection::RecordError<'de>;
69}
70
71impl jacquard_common::types::collection::Collection for Profile<'_> {
72 const NSID: &'static str = "network.slices.actor.profile";
73 type Record = ProfileRecord;
74}
75
76impl From<ProfileGetRecordOutput<'_>> for Profile<'_> {
77 fn from(output: ProfileGetRecordOutput<'_>) -> Self {
78 use jacquard_common::IntoStatic;
79 output.value.into_static()
80 }
81}