misskey_api/endpoint/i/
pin.rs1use crate::model::{id::Id, note::Note, user::User};
2
3use serde::Serialize;
4
5#[derive(Serialize, Debug, Clone)]
6#[serde(rename_all = "camelCase")]
7pub struct Request {
8 pub note_id: Id<Note>,
9}
10
11impl misskey_core::Request for Request {
12 type Response = User;
13 const ENDPOINT: &'static str = "i/pin";
14}
15
16#[cfg(test)]
17mod tests {
18 use super::Request;
19 use crate::test::{ClientExt, TestClient};
20
21 #[tokio::test]
22 async fn request() {
23 let client = TestClient::new();
24 let note = client.create_note(Some("test"), None, None).await;
25 client.test(Request { note_id: note.id }).await;
26 }
27}