Skip to main content

atrium_api/chat/bsky/convo/
add_reaction.rs

1// @generated - This file is generated by atrium-codegen. DO NOT EDIT.
2//!Definitions for the `chat.bsky.convo.addReaction` namespace.
3pub const NSID: &str = "chat.bsky.convo.addReaction";
4#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
5#[serde(rename_all = "camelCase")]
6pub struct InputData {
7    pub convo_id: String,
8    pub message_id: String,
9    pub value: 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 message: crate::chat::bsky::convo::defs::MessageView,
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    ///Indicates that the message has been deleted and reactions can no longer be added/removed.
22    ReactionMessageDeleted(Option<String>),
23    ///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.
24    ReactionLimitReached(Option<String>),
25    ///Indicates the value for the reaction is not acceptable. In general, this means it is not an emoji.
26    ReactionInvalidValue(Option<String>),
27}
28impl std::fmt::Display for Error {
29    fn fmt(&self, _f: &mut std::fmt::Formatter) -> std::fmt::Result {
30        match self {
31            Error::ReactionMessageDeleted(msg) => {
32                write!(_f, "ReactionMessageDeleted")?;
33                if let Some(msg) = msg {
34                    write!(_f, ": {msg}")?;
35                }
36            }
37            Error::ReactionLimitReached(msg) => {
38                write!(_f, "ReactionLimitReached")?;
39                if let Some(msg) = msg {
40                    write!(_f, ": {msg}")?;
41                }
42            }
43            Error::ReactionInvalidValue(msg) => {
44                write!(_f, "ReactionInvalidValue")?;
45                if let Some(msg) = msg {
46                    write!(_f, ": {msg}")?;
47                }
48            }
49        }
50        Ok(())
51    }
52}