1// @generated by jacquard-lexicon. DO NOT EDIT.
2//
3// Lexicon: place.stream.chat.profile
4//
5// This file was automatically generated from Lexicon schemas.
6// Any manual changes will be overwritten on the next regeneration.
7
8/// Customizations for the color of a user's name in chat
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 Color<'a> {
22 pub blue: i64,
23 pub green: i64,
24 pub red: i64,
25}
26
27/// Record containing customizations for a user's chat profile.
28#[jacquard_derive::lexicon]
29#[derive(
30 serde::Serialize,
31 serde::Deserialize,
32 Debug,
33 Clone,
34 PartialEq,
35 Eq,
36 jacquard_derive::IntoStatic,
37 bon::Builder
38)]
39#[serde(rename_all = "camelCase")]
40pub struct Profile<'a> {
41 #[serde(skip_serializing_if = "std::option::Option::is_none")]
42 #[builder(into)]
43 #[serde(borrow)]
44 pub color: Option<crate::place_stream::chat::profile::Color<'a>>,
45}
46
47/// Typed wrapper for GetRecord response with this collection's record type.
48#[derive(
49 serde::Serialize,
50 serde::Deserialize,
51 Debug,
52 Clone,
53 PartialEq,
54 Eq,
55 jacquard_derive::IntoStatic
56)]
57#[serde(rename_all = "camelCase")]
58pub struct ProfileGetRecordOutput<'a> {
59 #[serde(skip_serializing_if = "std::option::Option::is_none")]
60 #[serde(borrow)]
61 pub cid: std::option::Option<jacquard_common::types::string::Cid<'a>>,
62 #[serde(borrow)]
63 pub uri: jacquard_common::types::string::AtUri<'a>,
64 #[serde(borrow)]
65 pub value: Profile<'a>,
66}
67
68/// Marker type for deserializing records from this collection.
69pub struct ProfileRecord;
70impl jacquard_common::xrpc::XrpcResp for ProfileRecord {
71 const NSID: &'static str = "place.stream.chat.profile";
72 const ENCODING: &'static str = "application/json";
73 type Output<'de> = ProfileGetRecordOutput<'de>;
74 type Err<'de> = jacquard_common::types::collection::RecordError<'de>;
75}
76
77impl jacquard_common::types::collection::Collection for Profile<'_> {
78 const NSID: &'static str = "place.stream.chat.profile";
79 type Record = ProfileRecord;
80}
81
82impl From<ProfileGetRecordOutput<'_>> for Profile<'_> {
83 fn from(output: ProfileGetRecordOutput<'_>) -> Self {
84 use jacquard_common::IntoStatic;
85 output.value.into_static()
86 }
87}