Skip to main content

proto_blue_api/generated/app/bsky/feed/
defs.rs

1// Generated by atproto-codegen. Do not edit.
2//! Lexicon: app.bsky.feed.defs
3
4use serde::{Deserialize, Serialize};
5
6#[derive(Debug, Clone, Serialize, Deserialize)]
7#[serde(rename_all = "camelCase")]
8pub struct BlockedAuthor {
9    pub did: proto_blue_syntax::Did,
10    #[serde(skip_serializing_if = "Option::is_none")]
11    pub viewer: Option<crate::app::bsky::actor::defs::ViewerState>,
12}
13
14#[derive(Debug, Clone, Serialize, Deserialize)]
15#[serde(rename_all = "camelCase")]
16pub struct BlockedPost {
17    pub author: BlockedAuthor,
18    pub blocked: bool,
19    pub uri: proto_blue_syntax::AtUri,
20}
21
22/// User clicked through to the author of the feed item
23pub const CLICKTHROUGH_AUTHOR: &str = "app.bsky.feed.defs#clickthroughAuthor";
24
25/// User clicked through to the embedded content of the feed item
26pub const CLICKTHROUGH_EMBED: &str = "app.bsky.feed.defs#clickthroughEmbed";
27
28/// User clicked through to the feed item
29pub const CLICKTHROUGH_ITEM: &str = "app.bsky.feed.defs#clickthroughItem";
30
31/// User clicked through to the reposter of the feed item
32pub const CLICKTHROUGH_REPOSTER: &str = "app.bsky.feed.defs#clickthroughReposter";
33
34/// Declares the feed generator returns any types of posts.
35pub const CONTENT_MODE_UNSPECIFIED: &str = "app.bsky.feed.defs#contentModeUnspecified";
36
37/// Declares the feed generator returns posts containing app.bsky.embed.video embeds.
38pub const CONTENT_MODE_VIDEO: &str = "app.bsky.feed.defs#contentModeVideo";
39
40#[derive(Debug, Clone, Serialize, Deserialize)]
41#[serde(tag = "$type")]
42pub enum FeedViewPostReasonRefs {
43    #[serde(rename = "app.bsky.feed.defs#reasonRepost")]
44    BskyFeedDefsReasonRepost(Box<ReasonRepost>),
45    #[serde(rename = "app.bsky.feed.defs#reasonPin")]
46    BskyFeedDefsReasonPin(Box<ReasonPin>),
47    #[serde(other)]
48    Other,
49}
50
51#[derive(Debug, Clone, Serialize, Deserialize)]
52#[serde(rename_all = "camelCase")]
53pub struct FeedViewPost {
54    #[serde(skip_serializing_if = "Option::is_none")]
55    pub feed_context: Option<String>,
56    pub post: PostView,
57    #[serde(skip_serializing_if = "Option::is_none")]
58    pub reason: Option<FeedViewPostReasonRefs>,
59    #[serde(skip_serializing_if = "Option::is_none")]
60    pub reply: Option<ReplyRef>,
61    #[serde(skip_serializing_if = "Option::is_none")]
62    pub req_id: Option<String>,
63}
64
65#[derive(Debug, Clone, Serialize, Deserialize)]
66#[serde(rename_all = "camelCase")]
67pub struct GeneratorView {
68    #[serde(skip_serializing_if = "Option::is_none")]
69    pub accepts_interactions: Option<bool>,
70    #[serde(skip_serializing_if = "Option::is_none")]
71    pub avatar: Option<String>,
72    pub cid: String,
73    #[serde(skip_serializing_if = "Option::is_none")]
74    pub content_mode: Option<String>,
75    pub creator: crate::app::bsky::actor::defs::ProfileView,
76    #[serde(skip_serializing_if = "Option::is_none")]
77    pub description: Option<String>,
78    #[serde(skip_serializing_if = "Option::is_none")]
79    pub description_facets: Option<Vec<crate::app::bsky::richtext::facet::Main>>,
80    pub did: proto_blue_syntax::Did,
81    pub display_name: String,
82    pub indexed_at: proto_blue_syntax::Datetime,
83    #[serde(skip_serializing_if = "Option::is_none")]
84    pub labels: Option<Vec<crate::com::atproto::label::defs::Label>>,
85    #[serde(skip_serializing_if = "Option::is_none")]
86    pub like_count: Option<i64>,
87    pub uri: proto_blue_syntax::AtUri,
88    #[serde(skip_serializing_if = "Option::is_none")]
89    pub viewer: Option<GeneratorViewerState>,
90}
91
92#[derive(Debug, Clone, Serialize, Deserialize)]
93#[serde(rename_all = "camelCase")]
94pub struct GeneratorViewerState {
95    #[serde(skip_serializing_if = "Option::is_none")]
96    pub like: Option<proto_blue_syntax::AtUri>,
97}
98
99#[derive(Debug, Clone, Serialize, Deserialize)]
100#[serde(rename_all = "camelCase")]
101pub struct Interaction {
102    #[serde(skip_serializing_if = "Option::is_none")]
103    pub event: Option<String>,
104    #[serde(skip_serializing_if = "Option::is_none")]
105    pub feed_context: Option<String>,
106    #[serde(skip_serializing_if = "Option::is_none")]
107    pub item: Option<proto_blue_syntax::AtUri>,
108    #[serde(skip_serializing_if = "Option::is_none")]
109    pub req_id: Option<String>,
110}
111
112/// User liked the feed item
113pub const INTERACTION_LIKE: &str = "app.bsky.feed.defs#interactionLike";
114
115/// User quoted the feed item
116pub const INTERACTION_QUOTE: &str = "app.bsky.feed.defs#interactionQuote";
117
118/// User replied to the feed item
119pub const INTERACTION_REPLY: &str = "app.bsky.feed.defs#interactionReply";
120
121/// User reposted the feed item
122pub const INTERACTION_REPOST: &str = "app.bsky.feed.defs#interactionRepost";
123
124/// Feed item was seen by user
125pub const INTERACTION_SEEN: &str = "app.bsky.feed.defs#interactionSeen";
126
127/// User shared the feed item
128pub const INTERACTION_SHARE: &str = "app.bsky.feed.defs#interactionShare";
129
130#[derive(Debug, Clone, Serialize, Deserialize)]
131#[serde(rename_all = "camelCase")]
132pub struct NotFoundPost {
133    pub not_found: bool,
134    pub uri: proto_blue_syntax::AtUri,
135}
136
137#[derive(Debug, Clone, Serialize, Deserialize)]
138#[serde(tag = "$type")]
139pub enum PostViewEmbedRefs {
140    #[serde(rename = "app.bsky.embed.images#view")]
141    BskyEmbedImagesView(Box<crate::app::bsky::embed::images::View>),
142    #[serde(rename = "app.bsky.embed.video#view")]
143    BskyEmbedVideoView(Box<crate::app::bsky::embed::video::View>),
144    #[serde(rename = "app.bsky.embed.external#view")]
145    BskyEmbedExternalView(Box<crate::app::bsky::embed::external::View>),
146    #[serde(rename = "app.bsky.embed.record#view")]
147    BskyEmbedRecordView(Box<crate::app::bsky::embed::record::View>),
148    #[serde(rename = "app.bsky.embed.recordWithMedia#view")]
149    BskyEmbedRecordWithMediaView(Box<crate::app::bsky::embed::record_with_media::View>),
150    #[serde(other)]
151    Other,
152}
153
154#[derive(Debug, Clone, Serialize, Deserialize)]
155#[serde(rename_all = "camelCase")]
156pub struct PostView {
157    pub author: crate::app::bsky::actor::defs::ProfileViewBasic,
158    #[serde(skip_serializing_if = "Option::is_none")]
159    pub bookmark_count: Option<i64>,
160    pub cid: String,
161    #[serde(skip_serializing_if = "Option::is_none")]
162    pub debug: Option<serde_json::Value>,
163    #[serde(skip_serializing_if = "Option::is_none")]
164    pub embed: Option<PostViewEmbedRefs>,
165    pub indexed_at: proto_blue_syntax::Datetime,
166    #[serde(skip_serializing_if = "Option::is_none")]
167    pub labels: Option<Vec<crate::com::atproto::label::defs::Label>>,
168    #[serde(skip_serializing_if = "Option::is_none")]
169    pub like_count: Option<i64>,
170    #[serde(skip_serializing_if = "Option::is_none")]
171    pub quote_count: Option<i64>,
172    pub record: serde_json::Value,
173    #[serde(skip_serializing_if = "Option::is_none")]
174    pub reply_count: Option<i64>,
175    #[serde(skip_serializing_if = "Option::is_none")]
176    pub repost_count: Option<i64>,
177    #[serde(skip_serializing_if = "Option::is_none")]
178    pub threadgate: Option<ThreadgateView>,
179    pub uri: proto_blue_syntax::AtUri,
180    #[serde(skip_serializing_if = "Option::is_none")]
181    pub viewer: Option<ViewerState>,
182}
183
184#[derive(Debug, Clone, Serialize, Deserialize)]
185#[serde(rename_all = "camelCase")]
186pub struct ReasonPin {}
187
188#[derive(Debug, Clone, Serialize, Deserialize)]
189#[serde(rename_all = "camelCase")]
190pub struct ReasonRepost {
191    pub by: crate::app::bsky::actor::defs::ProfileViewBasic,
192    #[serde(skip_serializing_if = "Option::is_none")]
193    pub cid: Option<String>,
194    pub indexed_at: proto_blue_syntax::Datetime,
195    #[serde(skip_serializing_if = "Option::is_none")]
196    pub uri: Option<proto_blue_syntax::AtUri>,
197}
198
199#[derive(Debug, Clone, Serialize, Deserialize)]
200#[serde(tag = "$type")]
201pub enum ReplyRefParentRefs {
202    #[serde(rename = "app.bsky.feed.defs#postView")]
203    BskyFeedDefsPostView(Box<PostView>),
204    #[serde(rename = "app.bsky.feed.defs#notFoundPost")]
205    BskyFeedDefsNotFoundPost(Box<NotFoundPost>),
206    #[serde(rename = "app.bsky.feed.defs#blockedPost")]
207    BskyFeedDefsBlockedPost(Box<BlockedPost>),
208    #[serde(other)]
209    Other,
210}
211
212#[derive(Debug, Clone, Serialize, Deserialize)]
213#[serde(tag = "$type")]
214pub enum ReplyRefRootRefs {
215    #[serde(rename = "app.bsky.feed.defs#postView")]
216    BskyFeedDefsPostView(Box<PostView>),
217    #[serde(rename = "app.bsky.feed.defs#notFoundPost")]
218    BskyFeedDefsNotFoundPost(Box<NotFoundPost>),
219    #[serde(rename = "app.bsky.feed.defs#blockedPost")]
220    BskyFeedDefsBlockedPost(Box<BlockedPost>),
221    #[serde(other)]
222    Other,
223}
224
225#[derive(Debug, Clone, Serialize, Deserialize)]
226#[serde(rename_all = "camelCase")]
227pub struct ReplyRef {
228    #[serde(skip_serializing_if = "Option::is_none")]
229    pub grandparent_author: Option<crate::app::bsky::actor::defs::ProfileViewBasic>,
230    pub parent: ReplyRefParentRefs,
231    pub root: ReplyRefRootRefs,
232}
233
234/// Request that less content like the given feed item be shown in the feed
235pub const REQUEST_LESS: &str = "app.bsky.feed.defs#requestLess";
236
237/// Request that more content like the given feed item be shown in the feed
238pub const REQUEST_MORE: &str = "app.bsky.feed.defs#requestMore";
239
240#[derive(Debug, Clone, Serialize, Deserialize)]
241#[serde(tag = "$type")]
242pub enum SkeletonFeedPostReasonRefs {
243    #[serde(rename = "app.bsky.feed.defs#skeletonReasonRepost")]
244    BskyFeedDefsSkeletonReasonRepost(Box<SkeletonReasonRepost>),
245    #[serde(rename = "app.bsky.feed.defs#skeletonReasonPin")]
246    BskyFeedDefsSkeletonReasonPin(Box<SkeletonReasonPin>),
247    #[serde(other)]
248    Other,
249}
250
251#[derive(Debug, Clone, Serialize, Deserialize)]
252#[serde(rename_all = "camelCase")]
253pub struct SkeletonFeedPost {
254    #[serde(skip_serializing_if = "Option::is_none")]
255    pub feed_context: Option<String>,
256    pub post: proto_blue_syntax::AtUri,
257    #[serde(skip_serializing_if = "Option::is_none")]
258    pub reason: Option<SkeletonFeedPostReasonRefs>,
259}
260
261#[derive(Debug, Clone, Serialize, Deserialize)]
262#[serde(rename_all = "camelCase")]
263pub struct SkeletonReasonPin {}
264
265#[derive(Debug, Clone, Serialize, Deserialize)]
266#[serde(rename_all = "camelCase")]
267pub struct SkeletonReasonRepost {
268    pub repost: proto_blue_syntax::AtUri,
269}
270
271/// Metadata about this post within the context of the thread it is in.
272#[derive(Debug, Clone, Serialize, Deserialize)]
273#[serde(rename_all = "camelCase")]
274pub struct ThreadContext {
275    #[serde(skip_serializing_if = "Option::is_none")]
276    pub root_author_like: Option<proto_blue_syntax::AtUri>,
277}
278
279#[derive(Debug, Clone, Serialize, Deserialize)]
280#[serde(tag = "$type")]
281pub enum ThreadViewPostParentRefs {
282    #[serde(rename = "app.bsky.feed.defs#threadViewPost")]
283    BskyFeedDefsThreadViewPost(Box<ThreadViewPost>),
284    #[serde(rename = "app.bsky.feed.defs#notFoundPost")]
285    BskyFeedDefsNotFoundPost(Box<NotFoundPost>),
286    #[serde(rename = "app.bsky.feed.defs#blockedPost")]
287    BskyFeedDefsBlockedPost(Box<BlockedPost>),
288    #[serde(other)]
289    Other,
290}
291
292#[derive(Debug, Clone, Serialize, Deserialize)]
293#[serde(tag = "$type")]
294pub enum ThreadViewPostRepliesItemRefs {
295    #[serde(rename = "app.bsky.feed.defs#threadViewPost")]
296    BskyFeedDefsThreadViewPost(Box<ThreadViewPost>),
297    #[serde(rename = "app.bsky.feed.defs#notFoundPost")]
298    BskyFeedDefsNotFoundPost(Box<NotFoundPost>),
299    #[serde(rename = "app.bsky.feed.defs#blockedPost")]
300    BskyFeedDefsBlockedPost(Box<BlockedPost>),
301    #[serde(other)]
302    Other,
303}
304
305#[derive(Debug, Clone, Serialize, Deserialize)]
306#[serde(rename_all = "camelCase")]
307pub struct ThreadViewPost {
308    #[serde(skip_serializing_if = "Option::is_none")]
309    pub parent: Option<ThreadViewPostParentRefs>,
310    pub post: PostView,
311    #[serde(skip_serializing_if = "Option::is_none")]
312    pub replies: Option<Vec<ThreadViewPostRepliesItemRefs>>,
313    #[serde(skip_serializing_if = "Option::is_none")]
314    pub thread_context: Option<ThreadContext>,
315}
316
317#[derive(Debug, Clone, Serialize, Deserialize)]
318#[serde(rename_all = "camelCase")]
319pub struct ThreadgateView {
320    #[serde(skip_serializing_if = "Option::is_none")]
321    pub cid: Option<String>,
322    #[serde(skip_serializing_if = "Option::is_none")]
323    pub lists: Option<Vec<crate::app::bsky::graph::defs::ListViewBasic>>,
324    #[serde(skip_serializing_if = "Option::is_none")]
325    pub record: Option<serde_json::Value>,
326    #[serde(skip_serializing_if = "Option::is_none")]
327    pub uri: Option<proto_blue_syntax::AtUri>,
328}
329
330/// Metadata about the requesting account's relationship with the subject content. Only has meaningful content for authed requests.
331#[derive(Debug, Clone, Serialize, Deserialize)]
332#[serde(rename_all = "camelCase")]
333pub struct ViewerState {
334    #[serde(skip_serializing_if = "Option::is_none")]
335    pub bookmarked: Option<bool>,
336    #[serde(skip_serializing_if = "Option::is_none")]
337    pub embedding_disabled: Option<bool>,
338    #[serde(skip_serializing_if = "Option::is_none")]
339    pub like: Option<proto_blue_syntax::AtUri>,
340    #[serde(skip_serializing_if = "Option::is_none")]
341    pub pinned: Option<bool>,
342    #[serde(skip_serializing_if = "Option::is_none")]
343    pub reply_disabled: Option<bool>,
344    #[serde(skip_serializing_if = "Option::is_none")]
345    pub repost: Option<proto_blue_syntax::AtUri>,
346    #[serde(skip_serializing_if = "Option::is_none")]
347    pub thread_muted: Option<bool>,
348}