jacquard_api/app_bsky/embed/
external.rs

1// @generated by jacquard-lexicon. DO NOT EDIT.
2//
3// Lexicon: app.bsky.embed.external
4//
5// This file was automatically generated from Lexicon schemas.
6// Any manual changes will be overwritten on the next regeneration.
7
8#[jacquard_derive::lexicon]
9#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
10#[serde(rename_all = "camelCase")]
11pub struct External<'a> {
12    #[serde(borrow)]
13    pub description: jacquard_common::CowStr<'a>,
14    #[serde(skip_serializing_if = "std::option::Option::is_none")]
15    #[serde(borrow)]
16    pub thumb: std::option::Option<jacquard_common::types::blob::Blob<'a>>,
17    #[serde(borrow)]
18    pub title: jacquard_common::CowStr<'a>,
19    #[serde(borrow)]
20    pub uri: jacquard_common::types::string::Uri<'a>,
21}
22
23impl jacquard_common::IntoStatic for External<'_> {
24    type Output = External<'static>;
25    fn into_static(self) -> Self::Output {
26        External {
27            description: self.description.into_static(),
28            thumb: self.thumb.into_static(),
29            title: self.title.into_static(),
30            uri: self.uri.into_static(),
31            extra_data: self.extra_data.into_static(),
32        }
33    }
34}
35
36///A representation of some externally linked content (eg, a URL and 'card'), embedded in a Bluesky record (eg, a post).
37#[jacquard_derive::lexicon]
38#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
39#[serde(rename_all = "camelCase")]
40pub struct ExternalRecord<'a> {
41    #[serde(borrow)]
42    pub external: crate::app_bsky::embed::external::External<'a>,
43}
44
45impl jacquard_common::IntoStatic for ExternalRecord<'_> {
46    type Output = ExternalRecord<'static>;
47    fn into_static(self) -> Self::Output {
48        ExternalRecord {
49            external: self.external.into_static(),
50            extra_data: self.extra_data.into_static(),
51        }
52    }
53}
54
55#[jacquard_derive::lexicon]
56#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
57#[serde(rename_all = "camelCase")]
58pub struct View<'a> {
59    #[serde(borrow)]
60    pub external: crate::app_bsky::embed::external::ViewExternal<'a>,
61}
62
63impl jacquard_common::IntoStatic for View<'_> {
64    type Output = View<'static>;
65    fn into_static(self) -> Self::Output {
66        View {
67            external: self.external.into_static(),
68            extra_data: self.extra_data.into_static(),
69        }
70    }
71}
72
73#[jacquard_derive::lexicon]
74#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
75#[serde(rename_all = "camelCase")]
76pub struct ViewExternal<'a> {
77    #[serde(borrow)]
78    pub description: jacquard_common::CowStr<'a>,
79    #[serde(skip_serializing_if = "std::option::Option::is_none")]
80    #[serde(borrow)]
81    pub thumb: std::option::Option<jacquard_common::types::string::Uri<'a>>,
82    #[serde(borrow)]
83    pub title: jacquard_common::CowStr<'a>,
84    #[serde(borrow)]
85    pub uri: jacquard_common::types::string::Uri<'a>,
86}
87
88impl jacquard_common::IntoStatic for ViewExternal<'_> {
89    type Output = ViewExternal<'static>;
90    fn into_static(self) -> Self::Output {
91        ViewExternal {
92            description: self.description.into_static(),
93            thumb: self.thumb.into_static(),
94            title: self.title.into_static(),
95            uri: self.uri.into_static(),
96            extra_data: self.extra_data.into_static(),
97        }
98    }
99}