#![doc = "Definitions for the `app.bsky.feed.getPostThread` namespace."]
#[doc = "`app.bsky.feed.getPostThread`"]
#[async_trait::async_trait]
pub trait GetPostThread: crate::xrpc::XrpcClient {
async fn get_post_thread(
&self,
params: Parameters,
) -> Result<Output, Box<dyn std::error::Error>> {
let body = crate::xrpc::XrpcClient::send::<Error>(
self,
http::Method::GET,
"app.bsky.feed.getPostThread",
Some(serde_qs::to_string(¶ms)?),
None,
None,
)
.await?;
serde_json::from_slice(&body).map_err(|e| e.into())
}
}
#[derive(serde :: Serialize, serde :: Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct Parameters {
#[serde(skip_serializing_if = "Option::is_none")]
pub depth: Option<i32>,
pub uri: String,
}
#[derive(serde :: Serialize, serde :: Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct Output {
pub thread: OutputThreadEnum,
}
#[derive(serde :: Serialize, serde :: Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(tag = "error", content = "message")]
pub enum Error {
NotFound(Option<String>),
}
#[derive(serde :: Serialize, serde :: Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(tag = "$type")]
pub enum OutputThreadEnum {
#[serde(rename = "app.bsky.feed.defs#threadViewPost")]
AppBskyFeedDefsThreadViewPost(Box<crate::app::bsky::feed::defs::ThreadViewPost>),
#[serde(rename = "app.bsky.feed.defs#notFoundPost")]
AppBskyFeedDefsNotFoundPost(Box<crate::app::bsky::feed::defs::NotFoundPost>),
#[serde(rename = "app.bsky.feed.defs#blockedPost")]
AppBskyFeedDefsBlockedPost(Box<crate::app::bsky::feed::defs::BlockedPost>),
}