26 lines
547 B
Rust
26 lines
547 B
Rust
use crate::endpoints::Endpoint;
|
|
use crate::types::note::PackNoteMaybeFull;
|
|
use http::Method;
|
|
use magnetar_sdk_macros::Endpoint;
|
|
use serde::{Deserialize, Serialize};
|
|
use ts_rs::TS;
|
|
|
|
// Get note by id
|
|
#[derive(Serialize, Deserialize, TS)]
|
|
#[ts(export)]
|
|
pub struct NoteByIdReq {
|
|
#[serde(default)]
|
|
pub context: bool,
|
|
#[serde(default)]
|
|
pub attachments: bool,
|
|
}
|
|
|
|
#[derive(Endpoint)]
|
|
#[endpoint(
|
|
endpoint = "/notes/:id",
|
|
method = Method::GET,
|
|
request = NoteByIdReq,
|
|
response = PackNoteMaybeFull
|
|
)]
|
|
pub struct GetNoteById;
|