1- use serde :: { Deserialize , Serialize } ;
2- use crate :: model :: models :: { Links } ;
1+ pub mod space {
2+ use serde :: { Deserialize , Serialize } ;
33
4- #[ derive( Deserialize , Serialize , Debug ) ]
5- pub struct Space {
6- id : i16 ,
7- key : String ,
8- name : String ,
9- #[ serde( rename( serialize = "type" ) ) ]
10- #[ serde( rename( deserialize = "type" ) ) ]
11- ttype : String ,
12- _links : Links ,
13- _expandable : SpaceExpandable
14- }
4+ #[ derive( Deserialize , Serialize , Debug ) ]
5+ pub struct Space {
6+ pub id : i64 ,
7+ pub key : String ,
8+ pub name : String ,
9+ #[ serde( rename( serialize = "type" ) ) ]
10+ #[ serde( rename( deserialize = "type" ) ) ]
11+ pub ttype : String ,
12+ pub _links : SpaceLinks ,
13+ pub _expandable : SpaceExpandable
14+ }
1515
16- #[ derive( Default , Debug , Clone , PartialEq , Serialize , Deserialize ) ]
17- #[ allow( non_snake_case) ]
18- pub struct SpaceExpandable {
19- pub metadata : String ,
20- pub icon : String ,
21- pub description : String ,
22- #[ serde( rename( serialize = "retentionPolicy" ) ) ]
23- #[ serde( rename( deserialize = "retentionPolicy" ) ) ]
24- pub retention_policy : String ,
25- pub homepage : String ,
26- }
16+ #[ derive( Deserialize , Serialize , Debug ) ]
17+ pub struct SpaceLinks {
18+ pub webui : String ,
19+ pub collection : String ,
20+ pub base : String ,
21+ #[ serde( skip_serializing_if = "String::is_empty" ) ]
22+ pub context : String ,
23+ #[ serde( rename( serialize = "self" ) ) ]
24+ #[ serde( rename( deserialize = "self" ) ) ]
25+ #[ serde( skip_serializing_if = "String::is_empty" ) ]
26+ pub sself : String ,
27+ }
2728
28- #[ derive( Deserialize , Serialize , Debug ) ]
29- pub struct CreateSpace {
30- key : String ,
31- name : String ,
32- }
29+ #[ derive( Default , Debug , Clone , PartialEq , Serialize , Deserialize ) ]
30+ #[ allow( non_snake_case) ]
31+ pub struct SpaceExpandable {
32+ pub metadata : String ,
33+ pub icon : String ,
34+ pub description : String ,
35+ #[ serde( rename( serialize = "retentionPolicy" ) ) ]
36+ #[ serde( rename( deserialize = "retentionPolicy" ) ) ]
37+ pub retention_policy : String ,
38+ pub homepage : String ,
39+ }
40+
41+ #[ derive( Deserialize , Serialize , Debug ) ]
42+ pub struct CreateSpace {
43+ pub key : String ,
44+ pub name : String ,
45+ }
46+
47+ }
0 commit comments