jacquard_api/app_bsky/feed/
generator.rs

1// @generated by jacquard-lexicon. DO NOT EDIT.
2//
3// Lexicon: app.bsky.feed.generator
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 of the existence of a feed generator, and containing metadata about it. The record can exist in any repository.
9#[jacquard_derive::lexicon]
10#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
11#[serde(rename_all = "camelCase")]
12pub struct Generator<'a> {
13    ///Declaration that a feed accepts feedback interactions from a client through app.bsky.feed.sendInteractions
14    #[serde(skip_serializing_if = "std::option::Option::is_none")]
15    pub accepts_interactions: std::option::Option<bool>,
16    #[serde(skip_serializing_if = "std::option::Option::is_none")]
17    #[serde(borrow)]
18    pub avatar: std::option::Option<jacquard_common::types::blob::Blob<'a>>,
19    #[serde(skip_serializing_if = "std::option::Option::is_none")]
20    #[serde(borrow)]
21    pub content_mode: std::option::Option<jacquard_common::CowStr<'a>>,
22    pub created_at: jacquard_common::types::string::Datetime,
23    #[serde(skip_serializing_if = "std::option::Option::is_none")]
24    #[serde(borrow)]
25    pub description: std::option::Option<jacquard_common::CowStr<'a>>,
26    #[serde(skip_serializing_if = "std::option::Option::is_none")]
27    #[serde(borrow)]
28    pub description_facets: std::option::Option<
29        Vec<crate::app_bsky::richtext::facet::Facet<'a>>,
30    >,
31    #[serde(borrow)]
32    pub did: jacquard_common::types::string::Did<'a>,
33    #[serde(borrow)]
34    pub display_name: jacquard_common::CowStr<'a>,
35    ///Self-label values
36    #[serde(skip_serializing_if = "std::option::Option::is_none")]
37    #[serde(borrow)]
38    pub labels: std::option::Option<GeneratorRecordLabels<'a>>,
39}
40
41#[jacquard_derive::open_union]
42#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
43#[serde(tag = "$type")]
44#[serde(bound(deserialize = "'de: 'a"))]
45pub enum GeneratorRecordLabels<'a> {
46    #[serde(rename = "com.atproto.label.defs#selfLabels")]
47    DefsSelfLabels(Box<crate::com_atproto::label::SelfLabels<'a>>),
48}
49
50impl jacquard_common::IntoStatic for GeneratorRecordLabels<'_> {
51    type Output = GeneratorRecordLabels<'static>;
52    fn into_static(self) -> Self::Output {
53        match self {
54            GeneratorRecordLabels::DefsSelfLabels(v) => {
55                GeneratorRecordLabels::DefsSelfLabels(v.into_static())
56            }
57            GeneratorRecordLabels::Unknown(v) => {
58                GeneratorRecordLabels::Unknown(v.into_static())
59            }
60        }
61    }
62}
63
64impl jacquard_common::types::collection::Collection for Generator<'_> {
65    const NSID: &'static str = "app.bsky.feed.generator";
66}
67
68impl jacquard_common::IntoStatic for Generator<'_> {
69    type Output = Generator<'static>;
70    fn into_static(self) -> Self::Output {
71        Generator {
72            accepts_interactions: self.accepts_interactions.into_static(),
73            avatar: self.avatar.into_static(),
74            content_mode: self.content_mode.into_static(),
75            created_at: self.created_at.into_static(),
76            description: self.description.into_static(),
77            description_facets: self.description_facets.into_static(),
78            did: self.did.into_static(),
79            display_name: self.display_name.into_static(),
80            labels: self.labels.into_static(),
81            extra_data: self.extra_data.into_static(),
82        }
83    }
84}