1// @generated by jacquard-lexicon. DO NOT EDIT.
2//
3// Lexicon: app.bsky.graph.list
4//
5// This file was automatically generated from Lexicon schemas.
6// Any manual changes will be overwritten on the next regeneration.
7
8///Record representing a list of accounts (actors). Scope includes both moderation-oriented lists and curration-oriented lists.
9#[jacquard_derive::lexicon]
10#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
11#[serde(rename_all = "camelCase")]
12pub struct List<'a> {
13 #[serde(skip_serializing_if = "std::option::Option::is_none")]
14 #[serde(borrow)]
15 pub avatar: std::option::Option<jacquard_common::types::blob::Blob<'a>>,
16 pub created_at: jacquard_common::types::string::Datetime,
17 #[serde(skip_serializing_if = "std::option::Option::is_none")]
18 #[serde(borrow)]
19 pub description: std::option::Option<jacquard_common::CowStr<'a>>,
20 #[serde(skip_serializing_if = "std::option::Option::is_none")]
21 #[serde(borrow)]
22 pub description_facets: std::option::Option<
23 Vec<crate::app_bsky::richtext::facet::Facet<'a>>,
24 >,
25 #[serde(skip_serializing_if = "std::option::Option::is_none")]
26 #[serde(borrow)]
27 pub labels: std::option::Option<ListRecordLabels<'a>>,
28 ///Display name for list; can not be empty.
29 #[serde(borrow)]
30 pub name: jacquard_common::CowStr<'a>,
31 ///Defines the purpose of the list (aka, moderation-oriented or curration-oriented)
32 #[serde(borrow)]
33 pub purpose: crate::app_bsky::graph::ListPurpose<'a>,
34}
35
36#[jacquard_derive::open_union]
37#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
38#[serde(tag = "$type")]
39#[serde(bound(deserialize = "'de: 'a"))]
40pub enum ListRecordLabels<'a> {
41 #[serde(rename = "com.atproto.label.defs#selfLabels")]
42 DefsSelfLabels(Box<crate::com_atproto::label::SelfLabels<'a>>),
43}
44
45impl jacquard_common::IntoStatic for ListRecordLabels<'_> {
46 type Output = ListRecordLabels<'static>;
47 fn into_static(self) -> Self::Output {
48 match self {
49 ListRecordLabels::DefsSelfLabels(v) => {
50 ListRecordLabels::DefsSelfLabels(v.into_static())
51 }
52 ListRecordLabels::Unknown(v) => ListRecordLabels::Unknown(v.into_static()),
53 }
54 }
55}
56
57impl jacquard_common::types::collection::Collection for List<'_> {
58 const NSID: &'static str = "app.bsky.graph.list";
59}
60
61impl jacquard_common::IntoStatic for List<'_> {
62 type Output = List<'static>;
63 fn into_static(self) -> Self::Output {
64 List {
65 avatar: self.avatar.into_static(),
66 created_at: self.created_at.into_static(),
67 description: self.description.into_static(),
68 description_facets: self.description_facets.into_static(),
69 labels: self.labels.into_static(),
70 name: self.name.into_static(),
71 purpose: self.purpose.into_static(),
72 extra_data: self.extra_data.into_static(),
73 }
74 }
75}