Skip to main content

atrium_api/chat/bsky/group/
edit_join_link.rs

1// @generated - This file is generated by atrium-codegen. DO NOT EDIT.
2//!Definitions for the `chat.bsky.group.editJoinLink` namespace.
3pub const NSID: &str = "chat.bsky.group.editJoinLink";
4#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
5#[serde(rename_all = "camelCase")]
6pub struct InputData {
7    pub convo_id: String,
8    #[serde(skip_serializing_if = "core::option::Option::is_none")]
9    pub join_rule: core::option::Option<crate::chat::bsky::group::defs::JoinRule>,
10    #[serde(skip_serializing_if = "core::option::Option::is_none")]
11    pub require_approval: core::option::Option<bool>,
12}
13pub type Input = crate::types::Object<InputData>;
14#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
15#[serde(rename_all = "camelCase")]
16pub struct OutputData {
17    pub join_link: crate::chat::bsky::group::defs::JoinLinkView,
18}
19pub type Output = crate::types::Object<OutputData>;
20#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
21#[serde(tag = "error", content = "message")]
22pub enum Error {
23    InvalidConvo(Option<String>),
24    InsufficientRole(Option<String>),
25    NoJoinLink(Option<String>),
26}
27impl std::fmt::Display for Error {
28    fn fmt(&self, _f: &mut std::fmt::Formatter) -> std::fmt::Result {
29        match self {
30            Error::InvalidConvo(msg) => {
31                write!(_f, "InvalidConvo")?;
32                if let Some(msg) = msg {
33                    write!(_f, ": {msg}")?;
34                }
35            }
36            Error::InsufficientRole(msg) => {
37                write!(_f, "InsufficientRole")?;
38                if let Some(msg) = msg {
39                    write!(_f, ": {msg}")?;
40                }
41            }
42            Error::NoJoinLink(msg) => {
43                write!(_f, "NoJoinLink")?;
44                if let Some(msg) = msg {
45                    write!(_f, ": {msg}")?;
46                }
47            }
48        }
49        Ok(())
50    }
51}