atrium_api/app/bsky/feed/
get_post_thread.rs

1// @generated - This file is generated by atrium-codegen. DO NOT EDIT.
2//!Definitions for the `app.bsky.feed.getPostThread` namespace.
3pub const NSID: &str = "app.bsky.feed.getPostThread";
4#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
5#[serde(rename_all = "camelCase")]
6pub struct ParametersData {
7    ///How many levels of reply depth should be included in response.
8    #[serde(skip_serializing_if = "core::option::Option::is_none")]
9    pub depth: core::option::Option<crate::types::LimitedU16<1000u16>>,
10    ///How many levels of parent (and grandparent, etc) post to include.
11    #[serde(skip_serializing_if = "core::option::Option::is_none")]
12    pub parent_height: core::option::Option<crate::types::LimitedU16<1000u16>>,
13    ///Reference (AT-URI) to post record.
14    pub uri: String,
15}
16pub type Parameters = crate::types::Object<ParametersData>;
17#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
18#[serde(rename_all = "camelCase")]
19pub struct OutputData {
20    pub thread: crate::types::Union<OutputThreadRefs>,
21    #[serde(skip_serializing_if = "core::option::Option::is_none")]
22    pub threadgate: core::option::Option<crate::app::bsky::feed::defs::ThreadgateView>,
23}
24pub type Output = crate::types::Object<OutputData>;
25#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
26#[serde(tag = "error", content = "message")]
27pub enum Error {
28    NotFound(Option<String>),
29}
30impl std::fmt::Display for Error {
31    fn fmt(&self, _f: &mut std::fmt::Formatter) -> std::fmt::Result {
32        match self {
33            Error::NotFound(msg) => {
34                write!(_f, "NotFound")?;
35                if let Some(msg) = msg {
36                    write!(_f, ": {msg}")?;
37                }
38            }
39        }
40        Ok(())
41    }
42}
43#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
44#[serde(tag = "$type")]
45pub enum OutputThreadRefs {
46    #[serde(rename = "app.bsky.feed.defs#threadViewPost")]
47    AppBskyFeedDefsThreadViewPost(Box<crate::app::bsky::feed::defs::ThreadViewPost>),
48    #[serde(rename = "app.bsky.feed.defs#notFoundPost")]
49    AppBskyFeedDefsNotFoundPost(Box<crate::app::bsky::feed::defs::NotFoundPost>),
50    #[serde(rename = "app.bsky.feed.defs#blockedPost")]
51    AppBskyFeedDefsBlockedPost(Box<crate::app::bsky::feed::defs::BlockedPost>),
52}