1+ mod space;
2+
13pub mod models {
24 use serde_json:: { json, Value } ;
35 use serde:: { Deserialize , Serialize } ;
@@ -6,7 +8,7 @@ pub mod models {
68 #[ allow( non_snake_case) ]
79 pub struct Extentions < T > {
810 #[ serde( skip_serializing_if = "Option::is_none" ) ]
9- position : Option < T > ,
11+ pub position : Option < T > ,
1012 }
1113
1214 // impl Extentions {
@@ -37,72 +39,80 @@ pub mod models {
3739 #[ derive( Default , Debug , Clone , PartialEq , Serialize , Deserialize ) ]
3840 #[ allow( non_snake_case) ]
3941 pub struct Expandable {
40- container : String ,
41- metadata : String ,
42- operations : String ,
43- children : String ,
44- restrictions : String ,
45- ancestors : String ,
46- body : String ,
47- descendants : String ,
42+ pub container : String ,
43+ pub metadata : String ,
44+ pub operations : String ,
45+ pub children : String ,
46+ pub restrictions : String ,
47+ pub ancestors : String ,
48+ pub body : String ,
49+ pub descendants : String ,
4850 }
4951
5052 #[ derive( Default , Debug , Clone , PartialEq , Serialize , Deserialize ) ]
5153 #[ allow( non_snake_case) ]
5254 pub struct ContentLinks {
5355 #[ serde( rename( serialize = "self" ) ) ]
5456 #[ serde( rename( deserialize = "self" ) ) ]
55- sself : String ,
56- webui : String ,
57- edit : String ,
58- tinyui : String ,
57+ pub sself : String ,
58+ pub webui : String ,
59+ pub edit : String ,
60+ pub tinyui : String ,
5961 }
6062
6163 #[ derive( Default , Debug , Clone , PartialEq , Serialize , Deserialize ) ]
6264 #[ allow( non_snake_case) ]
6365 pub struct Links {
6466 #[ serde( rename( serialize = "self" ) ) ]
6567 #[ serde( rename( deserialize = "self" ) ) ]
66- sself : String ,
68+ #[ serde( skip_serializing_if = "String::is_empty" ) ]
69+ pub sself : String ,
6770 #[ serde( skip_serializing_if = "String::is_empty" ) ]
6871 // #[serde(skip_deserializing_if = "String::is_empty")]
69- next : String ,
70- base : String ,
71- context : String ,
72+ pub next : String ,
73+ pub base : String ,
74+ pub context : String ,
75+ }
76+
77+ #[ derive( Default , Debug , Clone , PartialEq , Serialize , Deserialize ) ]
78+ #[ allow( non_snake_case) ]
79+ pub struct SearchResultsLinks {
80+ pub base : String ,
81+ pub context : String ,
7282 }
7383
7484 #[ derive( Default , Debug , Clone , PartialEq , Serialize , Deserialize ) ]
7585 #[ allow( non_snake_case) ]
7686 pub struct ContentArrPage {
77- id : String ,
87+ pub id : String ,
7888 #[ serde( rename( serialize = "type" ) ) ]
7989 #[ serde( rename( deserialize = "type" ) ) ]
80- Type : String ,
81- status : String ,
82- title : String ,
90+ pub Type : String ,
91+ pub status : String ,
92+ pub title : String ,
8393 #[ serde( skip_serializing_if = "Option::is_none" ) ]
84- extensions : Option < Extentions < String > > ,
94+ pub extensions : Option < Extentions < String > > ,
8595 #[ serde( rename( deserialize = "_expandable" ) ) ]
86- _expandable : Expandable ,
87- _links : ContentLinks ,
96+ pub _expandable : Expandable ,
97+ pub _links : ContentLinks ,
8898 }
8999
90100 #[ derive( Default , Debug , Clone , PartialEq , Serialize , Deserialize ) ]
91101 #[ allow( non_snake_case) ]
92102 pub struct ContentResponse {
93- results : Vec < ContentArrPage > ,
94- start : i8 ,
95- limit : i8 ,
96- size : i8 ,
103+ pub results : Vec < ContentArrPage > ,
104+ pub start : i8 ,
105+ pub limit : i8 ,
106+ pub size : i8 ,
97107 // #[serde(skip_serializing_if = "Option::is_none")]
98108 #[ serde( skip) ]
99- _links : Links ,
109+ pub _links : Links ,
100110 }
101111
102112 #[ derive( Default , Debug , Clone , PartialEq , Serialize , Deserialize ) ]
103113 pub struct User {
104- login : String ,
105- id : u32 ,
114+ pub login : String ,
115+ pub id : u32 ,
106116 }
107117
108118 #[ derive( Default , Debug , Clone , PartialEq , Serialize , Deserialize ) ]
@@ -227,4 +237,19 @@ pub mod models {
227237 pub body : String ,
228238 pub descendants : String ,
229239 }
240+
241+ #[ derive( Default , Debug , Clone , PartialEq , Serialize , Deserialize ) ]
242+ #[ serde( rename_all = "camelCase" ) ]
243+ pub struct SearchResults {
244+ pub results : Vec < ContentArrPage > ,
245+ pub start : i8 ,
246+ pub limit : i8 ,
247+ pub size : i8 ,
248+ #[ serde( rename = "totalSize" ) ]
249+ pub total_size : i8 ,
250+ #[ serde( rename = "cqlQuery" ) ]
251+ pub cql_query : String ,
252+ #[ serde( skip) ]
253+ pub _links : Links ,
254+ }
230255}
0 commit comments