proto-blue-api 0.3.1

AT Protocol high-level API: agent, rich text, moderation, generated types
Documentation
// Generated by atproto-codegen. Do not edit.
//! Lexicon: app.bsky.feed.defs
#![allow(clippy::pedantic, clippy::nursery, clippy::all)]

use serde::{Deserialize, Serialize};

#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct BlockedAuthor {
    pub did: proto_blue_syntax::Did,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub viewer: Option<crate::app::bsky::actor::defs::ViewerState>,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct BlockedPost {
    pub author: BlockedAuthor,
    pub blocked: bool,
    pub uri: proto_blue_syntax::AtUri,
}

/// User clicked through to the author of the feed item
pub const CLICKTHROUGH_AUTHOR: &str = "app.bsky.feed.defs#clickthroughAuthor";

/// User clicked through to the embedded content of the feed item
pub const CLICKTHROUGH_EMBED: &str = "app.bsky.feed.defs#clickthroughEmbed";

/// User clicked through to the feed item
pub const CLICKTHROUGH_ITEM: &str = "app.bsky.feed.defs#clickthroughItem";

/// User clicked through to the reposter of the feed item
pub const CLICKTHROUGH_REPOSTER: &str = "app.bsky.feed.defs#clickthroughReposter";

/// Declares the feed generator returns any types of posts.
pub const CONTENT_MODE_UNSPECIFIED: &str = "app.bsky.feed.defs#contentModeUnspecified";

/// Declares the feed generator returns posts containing app.bsky.embed.video embeds.
pub const CONTENT_MODE_VIDEO: &str = "app.bsky.feed.defs#contentModeVideo";

#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(tag = "$type")]
pub enum FeedViewPostReasonRefs {
    #[serde(rename = "app.bsky.feed.defs#reasonRepost")]
    BskyFeedDefsReasonRepost(Box<ReasonRepost>),
    #[serde(rename = "app.bsky.feed.defs#reasonPin")]
    BskyFeedDefsReasonPin(Box<ReasonPin>),
    #[serde(other)]
    Other,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct FeedViewPost {
    #[serde(skip_serializing_if = "Option::is_none")]
    pub feed_context: Option<String>,
    pub post: PostView,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub reason: Option<FeedViewPostReasonRefs>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub reply: Option<ReplyRef>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub req_id: Option<String>,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct GeneratorView {
    #[serde(skip_serializing_if = "Option::is_none")]
    pub accepts_interactions: Option<bool>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub avatar: Option<String>,
    pub cid: String,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub content_mode: Option<String>,
    pub creator: crate::app::bsky::actor::defs::ProfileView,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub description_facets: Option<Vec<crate::app::bsky::richtext::facet::Main>>,
    pub did: proto_blue_syntax::Did,
    pub display_name: String,
    pub indexed_at: proto_blue_syntax::Datetime,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub labels: Option<Vec<crate::com::atproto::label::defs::Label>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub like_count: Option<i64>,
    pub uri: proto_blue_syntax::AtUri,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub viewer: Option<GeneratorViewerState>,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct GeneratorViewerState {
    #[serde(skip_serializing_if = "Option::is_none")]
    pub like: Option<proto_blue_syntax::AtUri>,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct Interaction {
    #[serde(skip_serializing_if = "Option::is_none")]
    pub event: Option<String>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub feed_context: Option<String>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub item: Option<proto_blue_syntax::AtUri>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub req_id: Option<String>,
}

/// User liked the feed item
pub const INTERACTION_LIKE: &str = "app.bsky.feed.defs#interactionLike";

/// User quoted the feed item
pub const INTERACTION_QUOTE: &str = "app.bsky.feed.defs#interactionQuote";

/// User replied to the feed item
pub const INTERACTION_REPLY: &str = "app.bsky.feed.defs#interactionReply";

/// User reposted the feed item
pub const INTERACTION_REPOST: &str = "app.bsky.feed.defs#interactionRepost";

/// Feed item was seen by user
pub const INTERACTION_SEEN: &str = "app.bsky.feed.defs#interactionSeen";

/// User shared the feed item
pub const INTERACTION_SHARE: &str = "app.bsky.feed.defs#interactionShare";

#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct NotFoundPost {
    pub not_found: bool,
    pub uri: proto_blue_syntax::AtUri,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(tag = "$type")]
pub enum PostViewEmbedRefs {
    #[serde(rename = "app.bsky.embed.images#view")]
    BskyEmbedImagesView(Box<crate::app::bsky::embed::images::View>),
    #[serde(rename = "app.bsky.embed.video#view")]
    BskyEmbedVideoView(Box<crate::app::bsky::embed::video::View>),
    #[serde(rename = "app.bsky.embed.external#view")]
    BskyEmbedExternalView(Box<crate::app::bsky::embed::external::View>),
    #[serde(rename = "app.bsky.embed.record#view")]
    BskyEmbedRecordView(Box<crate::app::bsky::embed::record::View>),
    #[serde(rename = "app.bsky.embed.recordWithMedia#view")]
    BskyEmbedRecordWithMediaView(Box<crate::app::bsky::embed::record_with_media::View>),
    #[serde(other)]
    Other,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct PostView {
    pub author: crate::app::bsky::actor::defs::ProfileViewBasic,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub bookmark_count: Option<i64>,
    pub cid: String,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub debug: Option<serde_json::Value>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub embed: Option<PostViewEmbedRefs>,
    pub indexed_at: proto_blue_syntax::Datetime,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub labels: Option<Vec<crate::com::atproto::label::defs::Label>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub like_count: Option<i64>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub quote_count: Option<i64>,
    pub record: serde_json::Value,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub reply_count: Option<i64>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub repost_count: Option<i64>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub threadgate: Option<ThreadgateView>,
    pub uri: proto_blue_syntax::AtUri,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub viewer: Option<ViewerState>,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ReasonPin {}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ReasonRepost {
    pub by: crate::app::bsky::actor::defs::ProfileViewBasic,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub cid: Option<String>,
    pub indexed_at: proto_blue_syntax::Datetime,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub uri: Option<proto_blue_syntax::AtUri>,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(tag = "$type")]
pub enum ReplyRefParentRefs {
    #[serde(rename = "app.bsky.feed.defs#postView")]
    BskyFeedDefsPostView(Box<PostView>),
    #[serde(rename = "app.bsky.feed.defs#notFoundPost")]
    BskyFeedDefsNotFoundPost(Box<NotFoundPost>),
    #[serde(rename = "app.bsky.feed.defs#blockedPost")]
    BskyFeedDefsBlockedPost(Box<BlockedPost>),
    #[serde(other)]
    Other,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(tag = "$type")]
pub enum ReplyRefRootRefs {
    #[serde(rename = "app.bsky.feed.defs#postView")]
    BskyFeedDefsPostView(Box<PostView>),
    #[serde(rename = "app.bsky.feed.defs#notFoundPost")]
    BskyFeedDefsNotFoundPost(Box<NotFoundPost>),
    #[serde(rename = "app.bsky.feed.defs#blockedPost")]
    BskyFeedDefsBlockedPost(Box<BlockedPost>),
    #[serde(other)]
    Other,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ReplyRef {
    #[serde(skip_serializing_if = "Option::is_none")]
    pub grandparent_author: Option<crate::app::bsky::actor::defs::ProfileViewBasic>,
    pub parent: ReplyRefParentRefs,
    pub root: ReplyRefRootRefs,
}

/// Request that less content like the given feed item be shown in the feed
pub const REQUEST_LESS: &str = "app.bsky.feed.defs#requestLess";

/// Request that more content like the given feed item be shown in the feed
pub const REQUEST_MORE: &str = "app.bsky.feed.defs#requestMore";

#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(tag = "$type")]
pub enum SkeletonFeedPostReasonRefs {
    #[serde(rename = "app.bsky.feed.defs#skeletonReasonRepost")]
    BskyFeedDefsSkeletonReasonRepost(Box<SkeletonReasonRepost>),
    #[serde(rename = "app.bsky.feed.defs#skeletonReasonPin")]
    BskyFeedDefsSkeletonReasonPin(Box<SkeletonReasonPin>),
    #[serde(other)]
    Other,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct SkeletonFeedPost {
    #[serde(skip_serializing_if = "Option::is_none")]
    pub feed_context: Option<String>,
    pub post: proto_blue_syntax::AtUri,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub reason: Option<SkeletonFeedPostReasonRefs>,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct SkeletonReasonPin {}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct SkeletonReasonRepost {
    pub repost: proto_blue_syntax::AtUri,
}

/// Metadata about this post within the context of the thread it is in.
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ThreadContext {
    #[serde(skip_serializing_if = "Option::is_none")]
    pub root_author_like: Option<proto_blue_syntax::AtUri>,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(tag = "$type")]
pub enum ThreadViewPostParentRefs {
    #[serde(rename = "app.bsky.feed.defs#threadViewPost")]
    BskyFeedDefsThreadViewPost(Box<ThreadViewPost>),
    #[serde(rename = "app.bsky.feed.defs#notFoundPost")]
    BskyFeedDefsNotFoundPost(Box<NotFoundPost>),
    #[serde(rename = "app.bsky.feed.defs#blockedPost")]
    BskyFeedDefsBlockedPost(Box<BlockedPost>),
    #[serde(other)]
    Other,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(tag = "$type")]
pub enum ThreadViewPostRepliesItemRefs {
    #[serde(rename = "app.bsky.feed.defs#threadViewPost")]
    BskyFeedDefsThreadViewPost(Box<ThreadViewPost>),
    #[serde(rename = "app.bsky.feed.defs#notFoundPost")]
    BskyFeedDefsNotFoundPost(Box<NotFoundPost>),
    #[serde(rename = "app.bsky.feed.defs#blockedPost")]
    BskyFeedDefsBlockedPost(Box<BlockedPost>),
    #[serde(other)]
    Other,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ThreadViewPost {
    #[serde(skip_serializing_if = "Option::is_none")]
    pub parent: Option<ThreadViewPostParentRefs>,
    pub post: PostView,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub replies: Option<Vec<ThreadViewPostRepliesItemRefs>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub thread_context: Option<ThreadContext>,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ThreadgateView {
    #[serde(skip_serializing_if = "Option::is_none")]
    pub cid: Option<String>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub lists: Option<Vec<crate::app::bsky::graph::defs::ListViewBasic>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub record: Option<serde_json::Value>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub uri: Option<proto_blue_syntax::AtUri>,
}

/// Metadata about the requesting account's relationship with the subject content. Only has meaningful content for authed requests.
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ViewerState {
    #[serde(skip_serializing_if = "Option::is_none")]
    pub bookmarked: Option<bool>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub embedding_disabled: Option<bool>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub like: Option<proto_blue_syntax::AtUri>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub pinned: Option<bool>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub reply_disabled: Option<bool>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub repost: Option<proto_blue_syntax::AtUri>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub thread_muted: Option<bool>,
}