atrium_api/chat/bsky/group/
create_group.rs1pub const NSID: &str = "chat.bsky.group.createGroup";
4#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
5#[serde(rename_all = "camelCase")]
6pub struct InputData {
7 pub members: Vec<crate::types::string::Did>,
9 pub name: String,
10}
11pub type Input = crate::types::Object<InputData>;
12#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
13#[serde(rename_all = "camelCase")]
14pub struct OutputData {
15 pub convo: crate::chat::bsky::convo::defs::ConvoView,
16}
17pub type Output = crate::types::Object<OutputData>;
18#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
19#[serde(tag = "error", content = "message")]
20pub enum Error {
21 AccountSuspended(Option<String>),
22 BlockedActor(Option<String>),
23 BlockedSubject(Option<String>),
24 NewAccountCannotCreateGroup(Option<String>),
25 NotFollowedBySender(Option<String>),
26 RecipientNotFound(Option<String>),
27 UserForbidsGroups(Option<String>),
28}
29impl std::fmt::Display for Error {
30 fn fmt(&self, _f: &mut std::fmt::Formatter) -> std::fmt::Result {
31 match self {
32 Error::AccountSuspended(msg) => {
33 write!(_f, "AccountSuspended")?;
34 if let Some(msg) = msg {
35 write!(_f, ": {msg}")?;
36 }
37 }
38 Error::BlockedActor(msg) => {
39 write!(_f, "BlockedActor")?;
40 if let Some(msg) = msg {
41 write!(_f, ": {msg}")?;
42 }
43 }
44 Error::BlockedSubject(msg) => {
45 write!(_f, "BlockedSubject")?;
46 if let Some(msg) = msg {
47 write!(_f, ": {msg}")?;
48 }
49 }
50 Error::NewAccountCannotCreateGroup(msg) => {
51 write!(_f, "NewAccountCannotCreateGroup")?;
52 if let Some(msg) = msg {
53 write!(_f, ": {msg}")?;
54 }
55 }
56 Error::NotFollowedBySender(msg) => {
57 write!(_f, "NotFollowedBySender")?;
58 if let Some(msg) = msg {
59 write!(_f, ": {msg}")?;
60 }
61 }
62 Error::RecipientNotFound(msg) => {
63 write!(_f, "RecipientNotFound")?;
64 if let Some(msg) = msg {
65 write!(_f, ": {msg}")?;
66 }
67 }
68 Error::UserForbidsGroups(msg) => {
69 write!(_f, "UserForbidsGroups")?;
70 if let Some(msg) = msg {
71 write!(_f, ": {msg}")?;
72 }
73 }
74 }
75 Ok(())
76 }
77}