atrium-api 0.25.8

API library for AT Protocol (Bluesky)
Documentation
// @generated - This file is generated by atrium-codegen. DO NOT EDIT.
//!Definitions for the `chat.bsky.convo.addReaction` namespace.
pub const NSID: &str = "chat.bsky.convo.addReaction";
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct InputData {
    pub convo_id: String,
    pub message_id: String,
    pub value: 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 message: crate::chat::bsky::convo::defs::MessageView,
}
pub type Output = crate::types::Object<OutputData>;
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(tag = "error", content = "message")]
pub enum Error {
    ///Indicates that the message has been deleted and reactions can no longer be added/removed.
    ReactionMessageDeleted(Option<String>),
    ///Indicates that the message has the maximum number of reactions allowed for a single user, and the requested reaction wasn't yet present. If it was already present, the request will not fail since it is idempotent.
    ReactionLimitReached(Option<String>),
    ///Indicates the value for the reaction is not acceptable. In general, this means it is not an emoji.
    ReactionInvalidValue(Option<String>),
}
impl std::fmt::Display for Error {
    fn fmt(&self, _f: &mut std::fmt::Formatter) -> std::fmt::Result {
        match self {
            Error::ReactionMessageDeleted(msg) => {
                write!(_f, "ReactionMessageDeleted")?;
                if let Some(msg) = msg {
                    write!(_f, ": {msg}")?;
                }
            }
            Error::ReactionLimitReached(msg) => {
                write!(_f, "ReactionLimitReached")?;
                if let Some(msg) = msg {
                    write!(_f, ": {msg}")?;
                }
            }
            Error::ReactionInvalidValue(msg) => {
                write!(_f, "ReactionInvalidValue")?;
                if let Some(msg) = msg {
                    write!(_f, ": {msg}")?;
                }
            }
        }
        Ok(())
    }
}