pub const NSID: &str = "chat.bsky.group.requestJoin";
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct InputData {
pub code: String,
}
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 convo: core::option::Option<crate::chat::bsky::convo::defs::ConvoView>,
pub status: String,
}
pub type Output = crate::types::Object<OutputData>;
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(tag = "error", content = "message")]
pub enum Error {
ConvoLocked(Option<String>),
FollowRequired(Option<String>),
InvalidCode(Option<String>),
LinkDisabled(Option<String>),
MemberLimitReached(Option<String>),
UserKicked(Option<String>),
}
impl std::fmt::Display for Error {
fn fmt(&self, _f: &mut std::fmt::Formatter) -> std::fmt::Result {
match self {
Error::ConvoLocked(msg) => {
write!(_f, "ConvoLocked")?;
if let Some(msg) = msg {
write!(_f, ": {msg}")?;
}
}
Error::FollowRequired(msg) => {
write!(_f, "FollowRequired")?;
if let Some(msg) = msg {
write!(_f, ": {msg}")?;
}
}
Error::InvalidCode(msg) => {
write!(_f, "InvalidCode")?;
if let Some(msg) = msg {
write!(_f, ": {msg}")?;
}
}
Error::LinkDisabled(msg) => {
write!(_f, "LinkDisabled")?;
if let Some(msg) = msg {
write!(_f, ": {msg}")?;
}
}
Error::MemberLimitReached(msg) => {
write!(_f, "MemberLimitReached")?;
if let Some(msg) = msg {
write!(_f, ": {msg}")?;
}
}
Error::UserKicked(msg) => {
write!(_f, "UserKicked")?;
if let Some(msg) = msg {
write!(_f, ": {msg}")?;
}
}
}
Ok(())
}
}