misskey_api/endpoint/clips/
add_note.rs

1use crate::model::{clip::Clip, id::Id, note::Note};
2
3use serde::Serialize;
4
5#[derive(Serialize, Debug, Clone)]
6#[serde(rename_all = "camelCase")]
7pub struct Request {
8    pub clip_id: Id<Clip>,
9    pub note_id: Id<Note>,
10}
11
12impl misskey_core::Request for Request {
13    type Response = ();
14    const ENDPOINT: &'static str = "clips/add-note";
15}
16
17#[cfg(test)]
18mod tests {
19    use super::Request;
20    use crate::test::{ClientExt, TestClient};
21
22    #[tokio::test]
23    async fn request() {
24        let client = TestClient::new();
25        let note = client.user.create_note(Some("test"), None, None).await;
26        let clip = client
27            .user
28            .test(crate::endpoint::clips::create::Request {
29                name: "testclip".to_string(),
30                is_public: None,
31                description: None,
32            })
33            .await;
34        client
35            .test(Request {
36                clip_id: clip.id,
37                note_id: note.id,
38            })
39            .await;
40    }
41}