ipfs_api_prelude/response/
files.rs1use crate::response::serde;
10use crate::serde::Deserialize;
11
12pub type FilesCpResponse = ();
13
14pub type FilesFlushResponse = ();
15
16#[derive(Debug, Deserialize)]
17#[serde(rename_all = "PascalCase")]
18pub struct FilesEntry {
19 pub name: String,
20
21 #[serde(rename = "Type")]
25 pub typ: u64,
26 pub size: u64,
27 pub hash: String,
28}
29
30#[derive(Debug, Deserialize)]
31#[serde(rename_all = "PascalCase")]
32pub struct FilesLsResponse {
33 #[serde(deserialize_with = "serde::deserialize_vec")]
34 pub entries: Vec<FilesEntry>,
35}
36
37pub type FilesMkdirResponse = ();
38
39pub type FilesMvResponse = ();
40
41pub type FilesRmResponse = ();
42
43#[derive(Debug, Deserialize)]
44#[serde(rename_all = "PascalCase")]
45pub struct FilesStatResponse {
46 pub hash: String,
47 pub size: u64,
48 pub cumulative_size: u64,
49 pub blocks: u64,
50
51 #[serde(rename = "Type")]
52 pub typ: String,
53
54 #[serde(default)]
55 pub size_local: Option<u64>,
56 #[serde(default)]
57 pub local: Option<bool>,
58}
59
60pub type FilesWriteResponse = ();
61
62pub type FilesChcidResponse = ();
63
64#[cfg(test)]
65mod tests {
66 deserialize_test!(v0_files_ls_0, FilesLsResponse);
67 deserialize_test!(v0_files_stat_0, FilesStatResponse);
68}