Skip to main content

atrium_api/chat/bsky/group/
request_join.rs

1// @generated - This file is generated by atrium-codegen. DO NOT EDIT.
2//!Definitions for the `chat.bsky.group.requestJoin` namespace.
3pub const NSID: &str = "chat.bsky.group.requestJoin";
4#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
5#[serde(rename_all = "camelCase")]
6pub struct InputData {
7    pub code: String,
8}
9pub type Input = crate::types::Object<InputData>;
10#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
11#[serde(rename_all = "camelCase")]
12pub struct OutputData {
13    ///The group convo joined. This is only present in the case of status=joined
14    #[serde(skip_serializing_if = "core::option::Option::is_none")]
15    pub convo: core::option::Option<crate::chat::bsky::convo::defs::ConvoView>,
16    pub status: String,
17}
18pub type Output = crate::types::Object<OutputData>;
19#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
20#[serde(tag = "error", content = "message")]
21pub enum Error {
22    ConvoLocked(Option<String>),
23    FollowRequired(Option<String>),
24    InvalidCode(Option<String>),
25    LinkDisabled(Option<String>),
26    MemberLimitReached(Option<String>),
27    UserKicked(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::ConvoLocked(msg) => {
33                write!(_f, "ConvoLocked")?;
34                if let Some(msg) = msg {
35                    write!(_f, ": {msg}")?;
36                }
37            }
38            Error::FollowRequired(msg) => {
39                write!(_f, "FollowRequired")?;
40                if let Some(msg) = msg {
41                    write!(_f, ": {msg}")?;
42                }
43            }
44            Error::InvalidCode(msg) => {
45                write!(_f, "InvalidCode")?;
46                if let Some(msg) = msg {
47                    write!(_f, ": {msg}")?;
48                }
49            }
50            Error::LinkDisabled(msg) => {
51                write!(_f, "LinkDisabled")?;
52                if let Some(msg) = msg {
53                    write!(_f, ": {msg}")?;
54                }
55            }
56            Error::MemberLimitReached(msg) => {
57                write!(_f, "MemberLimitReached")?;
58                if let Some(msg) = msg {
59                    write!(_f, ": {msg}")?;
60                }
61            }
62            Error::UserKicked(msg) => {
63                write!(_f, "UserKicked")?;
64                if let Some(msg) = msg {
65                    write!(_f, ": {msg}")?;
66                }
67            }
68        }
69        Ok(())
70    }
71}