@@ -15,25 +15,60 @@ pub struct File {
15
15
pub size : Option < u64 > ,
16
16
17
17
/// The file hash.
18
- pub hash : String ,
18
+ pub hash : Option < String > ,
19
19
20
20
#[ serde( rename = "_exist" , skip_serializing_if = "Option::is_none" ) ]
21
21
pub exist : Option < bool > ,
22
22
}
23
23
24
-
25
24
#[ derive( Debug , Clone , PartialEq , Serialize , Deserialize , JsonSchema , Hash ) ]
26
25
#[ serde( rename ="Directory" , deny_unknown_fields) ]
27
26
pub struct Directory {
28
27
/// The path to the directory.
29
28
pub path : String ,
30
29
31
30
/// The directory size.
32
- pub size : u64 ,
31
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
32
+ pub size : Option < u64 > ,
33
33
34
34
/// The files under the directory.
35
- pub files : Vec < File > ,
35
+ #[ serde( skip_serializing_if = "Option::is_none" ) ]
36
+ pub files : Option < Vec < File > > ,
37
+
38
+ /// Recurse into subdirectories.
39
+ pub recurse : bool ,
40
+
41
+ #[ serde( rename = "_exist" , skip_serializing_if = "Option::is_none" ) ]
42
+ pub exist : Option < bool > ,
43
+ }
44
+
45
+ #[ derive( Debug , Clone , PartialEq , Serialize , Deserialize , JsonSchema , Hash ) ]
46
+ #[ serde( rename ="FileContent" , deny_unknown_fields) ]
47
+ pub struct FileContent
48
+ {
49
+ /// The path to the file.
50
+ pub path : String ,
51
+
52
+ /// The file hash.
53
+ pub hash : String ,
54
+
55
+ /// The file encoding.
56
+ pub encoding : Encoding ,
57
+
58
+ /// The file content.
59
+ pub content : String ,
36
60
37
61
#[ serde( rename = "_exist" , skip_serializing_if = "Option::is_none" ) ]
38
62
pub exist : Option < bool > ,
63
+ }
64
+
65
+ #[ derive( Debug , Clone , PartialEq , Serialize , Deserialize , JsonSchema , Hash ) ]
66
+ pub enum Encoding {
67
+ Utf8 ,
68
+ Utf16 ,
69
+ Utf32 ,
70
+ Ascii ,
71
+ Base64 ,
72
+ Hex ,
73
+ Binary ,
39
74
}
0 commit comments