Skip to main content

atrium_api/chat/bsky/convo/
send_message.rs

1// @generated - This file is generated by atrium-codegen. DO NOT EDIT.
2//!Definitions for the `chat.bsky.convo.sendMessage` namespace.
3pub const NSID: &str = "chat.bsky.convo.sendMessage";
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: crate::chat::bsky::convo::defs::MessageInput,
9}
10pub type Input = crate::types::Object<InputData>;
11pub type Output = crate::chat::bsky::convo::defs::MessageView;
12#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
13#[serde(tag = "error", content = "message")]
14pub enum Error {
15    ConvoLocked(Option<String>),
16    InvalidConvo(Option<String>),
17    ReplyTargetNotFound(Option<String>),
18}
19impl std::fmt::Display for Error {
20    fn fmt(&self, _f: &mut std::fmt::Formatter) -> std::fmt::Result {
21        match self {
22            Error::ConvoLocked(msg) => {
23                write!(_f, "ConvoLocked")?;
24                if let Some(msg) = msg {
25                    write!(_f, ": {msg}")?;
26                }
27            }
28            Error::InvalidConvo(msg) => {
29                write!(_f, "InvalidConvo")?;
30                if let Some(msg) = msg {
31                    write!(_f, ": {msg}")?;
32                }
33            }
34            Error::ReplyTargetNotFound(msg) => {
35                write!(_f, "ReplyTargetNotFound")?;
36                if let Some(msg) = msg {
37                    write!(_f, ": {msg}")?;
38                }
39            }
40        }
41        Ok(())
42    }
43}