Skip to main content

misskey_websocket/model/
outgoing.rs

1use crate::model::{ApiRequestId, ChannelId, SubNoteId};
2
3use serde::Serialize;
4use serde_json::Value;
5
6#[derive(Serialize, Debug, Clone)]
7#[serde(rename_all = "camelCase", tag = "type", content = "body")]
8pub enum OutgoingMessage {
9    Api {
10        id: ApiRequestId,
11        endpoint: &'static str,
12        data: Value,
13    },
14    Connect {
15        id: ChannelId,
16        channel: &'static str,
17        params: Value,
18        pong: bool,
19    },
20    Channel {
21        id: ChannelId,
22        #[serde(flatten)]
23        message: Value,
24    },
25    Disconnect {
26        id: ChannelId,
27    },
28    SubNote {
29        id: SubNoteId,
30    },
31    UnsubNote {
32        id: SubNoteId,
33    },
34}