// This file is generated by atrium-codegen. DO NOT EDIT.
//!Definitions for the `app.bsky.graph.getRelationships` namespace.
pub const NSID: &str = "app.bsky.graph.getRelationships";
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct ParametersData {
    ///Primary account requesting relationships for.
    pub actor: crate::types::string::AtIdentifier,
    ///List of 'other' accounts to be related back to the primary.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub others: Option<Vec<crate::types::string::AtIdentifier>>,
}
pub type Parameters = crate::types::Object<ParametersData>;
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct OutputData {
    #[serde(skip_serializing_if = "Option::is_none")]
    pub actor: Option<crate::types::string::Did>,
    pub relationships: Vec<crate::types::Union<OutputRelationshipsItem>>,
}
pub type Output = crate::types::Object<OutputData>;
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(tag = "error", content = "message")]
pub enum Error {
    ///the primary actor at-identifier could not be resolved
    ActorNotFound(Option<String>),
}
impl std::fmt::Display for Error {
    fn fmt(&self, _f: &mut std::fmt::Formatter) -> std::fmt::Result {
        match self {
            Error::ActorNotFound(msg) => {
                write!(_f, "ActorNotFound")?;
                if let Some(msg) = msg {
                    write!(_f, ": {msg}")?;
                }
            }
        }
        Ok(())
    }
}
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(tag = "$type")]
pub enum OutputRelationshipsItem {
    #[serde(rename = "app.bsky.graph.defs#relationship")]
    AppBskyGraphDefsRelationship(Box<crate::app::bsky::graph::defs::Relationship>),
    #[serde(rename = "app.bsky.graph.defs#notFoundActor")]
    AppBskyGraphDefsNotFoundActor(Box<crate::app::bsky::graph::defs::NotFoundActor>),
}
