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