// This file is generated by atrium-codegen. DO NOT EDIT.
//!Definitions for the `app.bsky.feed.getPostThread` namespace.
pub const NSID: &str = "app.bsky.feed.getPostThread";
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct ParametersData {
    ///How many levels of reply depth should be included in response.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub depth: Option<crate::types::LimitedU16<1000u16>>,
    ///How many levels of parent (and grandparent, etc) post to include.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub parent_height: Option<crate::types::LimitedU16<1000u16>>,
    ///Reference (AT-URI) to post record.
    pub uri: String,
}
pub type Parameters = crate::types::Object<ParametersData>;
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct OutputData {
    pub thread: crate::types::Union<OutputThreadRefs>,
}
pub type Output = crate::types::Object<OutputData>;
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(tag = "error", content = "message")]
pub enum Error {
    NotFound(Option<String>),
}
impl std::fmt::Display for Error {
    fn fmt(&self, _f: &mut std::fmt::Formatter) -> std::fmt::Result {
        match self {
            Error::NotFound(msg) => {
                write!(_f, "NotFound")?;
                if let Some(msg) = msg {
                    write!(_f, ": {msg}")?;
                }
            }
        }
        Ok(())
    }
}
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(tag = "$type")]
pub enum OutputThreadRefs {
    #[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>),
}
