atrium-api 0.26.0

API library for AT Protocol (Bluesky)
Documentation
// @generated - This file is generated by atrium-codegen. DO NOT EDIT.
//!Definitions for the `chat.bsky.group.addMembers` namespace.
pub const NSID: &str = "chat.bsky.group.addMembers";
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct InputData {
    pub convo_id: String,
    pub members: Vec<crate::types::string::Did>,
}
pub type Input = crate::types::Object<InputData>;
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct OutputData {
    #[serde(skip_serializing_if = "core::option::Option::is_none")]
    pub added_members: core::option::Option<
        Vec<crate::chat::bsky::actor::defs::ProfileViewBasic>,
    >,
    pub convo: crate::chat::bsky::convo::defs::ConvoView,
}
pub type Output = crate::types::Object<OutputData>;
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(tag = "error", content = "message")]
pub enum Error {
    AccountSuspended(Option<String>),
    BlockedActor(Option<String>),
    BlockedSubject(Option<String>),
    ConvoLocked(Option<String>),
    InsufficientRole(Option<String>),
    InvalidConvo(Option<String>),
    MemberLimitReached(Option<String>),
    NotFollowedBySender(Option<String>),
    RecipientNotFound(Option<String>),
    UserForbidsGroups(Option<String>),
}
impl std::fmt::Display for Error {
    fn fmt(&self, _f: &mut std::fmt::Formatter) -> std::fmt::Result {
        match self {
            Error::AccountSuspended(msg) => {
                write!(_f, "AccountSuspended")?;
                if let Some(msg) = msg {
                    write!(_f, ": {msg}")?;
                }
            }
            Error::BlockedActor(msg) => {
                write!(_f, "BlockedActor")?;
                if let Some(msg) = msg {
                    write!(_f, ": {msg}")?;
                }
            }
            Error::BlockedSubject(msg) => {
                write!(_f, "BlockedSubject")?;
                if let Some(msg) = msg {
                    write!(_f, ": {msg}")?;
                }
            }
            Error::ConvoLocked(msg) => {
                write!(_f, "ConvoLocked")?;
                if let Some(msg) = msg {
                    write!(_f, ": {msg}")?;
                }
            }
            Error::InsufficientRole(msg) => {
                write!(_f, "InsufficientRole")?;
                if let Some(msg) = msg {
                    write!(_f, ": {msg}")?;
                }
            }
            Error::InvalidConvo(msg) => {
                write!(_f, "InvalidConvo")?;
                if let Some(msg) = msg {
                    write!(_f, ": {msg}")?;
                }
            }
            Error::MemberLimitReached(msg) => {
                write!(_f, "MemberLimitReached")?;
                if let Some(msg) = msg {
                    write!(_f, ": {msg}")?;
                }
            }
            Error::NotFollowedBySender(msg) => {
                write!(_f, "NotFollowedBySender")?;
                if let Some(msg) = msg {
                    write!(_f, ": {msg}")?;
                }
            }
            Error::RecipientNotFound(msg) => {
                write!(_f, "RecipientNotFound")?;
                if let Some(msg) = msg {
                    write!(_f, ": {msg}")?;
                }
            }
            Error::UserForbidsGroups(msg) => {
                write!(_f, "UserForbidsGroups")?;
                if let Some(msg) = msg {
                    write!(_f, ": {msg}")?;
                }
            }
        }
        Ok(())
    }
}