atrium_api/app/bsky/graph/
get_relationships.rs

1// @generated - This file is generated by atrium-codegen. DO NOT EDIT.
2//!Definitions for the `app.bsky.graph.getRelationships` namespace.
3pub const NSID: &str = "app.bsky.graph.getRelationships";
4#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
5#[serde(rename_all = "camelCase")]
6pub struct ParametersData {
7    ///Primary account requesting relationships for.
8    pub actor: crate::types::string::AtIdentifier,
9    ///List of 'other' accounts to be related back to the primary.
10    #[serde(skip_serializing_if = "core::option::Option::is_none")]
11    pub others: core::option::Option<Vec<crate::types::string::AtIdentifier>>,
12}
13pub type Parameters = crate::types::Object<ParametersData>;
14#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
15#[serde(rename_all = "camelCase")]
16pub struct OutputData {
17    #[serde(skip_serializing_if = "core::option::Option::is_none")]
18    pub actor: core::option::Option<crate::types::string::Did>,
19    pub relationships: Vec<crate::types::Union<OutputRelationshipsItem>>,
20}
21pub type Output = crate::types::Object<OutputData>;
22#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
23#[serde(tag = "error", content = "message")]
24pub enum Error {
25    ///the primary actor at-identifier could not be resolved
26    ActorNotFound(Option<String>),
27}
28impl std::fmt::Display for Error {
29    fn fmt(&self, _f: &mut std::fmt::Formatter) -> std::fmt::Result {
30        match self {
31            Error::ActorNotFound(msg) => {
32                write!(_f, "ActorNotFound")?;
33                if let Some(msg) = msg {
34                    write!(_f, ": {msg}")?;
35                }
36            }
37        }
38        Ok(())
39    }
40}
41#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
42#[serde(tag = "$type")]
43pub enum OutputRelationshipsItem {
44    #[serde(rename = "app.bsky.graph.defs#relationship")]
45    AppBskyGraphDefsRelationship(Box<crate::app::bsky::graph::defs::Relationship>),
46    #[serde(rename = "app.bsky.graph.defs#notFoundActor")]
47    AppBskyGraphDefsNotFoundActor(Box<crate::app::bsky::graph::defs::NotFoundActor>),
48}