hydrus_api/api_core/endpoints/
managing_pages.rs

1use crate::api_core::common::PageInformation;
2use crate::api_core::endpoints::Endpoint;
3
4#[derive(Clone, Debug, Deserialize)]
5pub struct GetPagesResponse {
6    /// The top level notebook page
7    pub pages: PageInformation,
8}
9
10pub struct GetPages;
11
12impl Endpoint for GetPages {
13    type Request = ();
14    type Response = GetPagesResponse;
15
16    fn path() -> String {
17        String::from("manage_pages/get_pages")
18    }
19}
20
21#[derive(Clone, Debug, Deserialize)]
22pub struct GetPageInfoResponse {
23    pub page_info: PageInformation,
24}
25
26pub struct GetPageInfo;
27
28impl Endpoint for GetPageInfo {
29    type Request = ();
30    type Response = GetPageInfoResponse;
31
32    fn path() -> String {
33        String::from("manage_pages/get_page_info")
34    }
35}
36
37#[derive(Clone, Debug, Serialize)]
38pub struct FocusPageRequest {
39    pub page_key: String,
40}
41
42pub struct FocusPage;
43
44impl Endpoint for FocusPage {
45    type Request = FocusPageRequest;
46    type Response = ();
47
48    fn path() -> String {
49        String::from("manage_pages/focus_page")
50    }
51}
52
53#[derive(Clone, Debug, Serialize)]
54pub struct AddFilesRequest {
55    pub page_key: String,
56    #[serde(skip_serializing_if = "Vec::is_empty")]
57    pub file_ids: Vec<u64>,
58    #[serde(skip_serializing_if = "Vec::is_empty")]
59    pub hashes: Vec<String>,
60}
61
62pub struct AddFiles;
63
64impl Endpoint for AddFiles {
65    type Request = AddFilesRequest;
66    type Response = ();
67
68    fn path() -> String {
69        String::from("manage_pages/add_files")
70    }
71}