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.createGroup` namespace.
pub const NSID: &str = "chat.bsky.group.createGroup";
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct InputData {
    ///The members to add to the group. The owner is automatically added. Implementations may enforce a lower maximum than the 10,000-item schema limit; Bluesky currently supports up to 100 total members. If the owner is included in this list, the list may contain up to the implementation's total member limit. Otherwise, it may contain one fewer.
    pub members: Vec<crate::types::string::Did>,
    pub name: String,
}
pub type Input = crate::types::Object<InputData>;
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct OutputData {
    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>),
    NewAccountCannotCreateGroup(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::NewAccountCannotCreateGroup(msg) => {
                write!(_f, "NewAccountCannotCreateGroup")?;
                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(())
    }
}