11package com .box .sdkgen .schemas .collaborationitem ;
22
33import com .box .sdkgen .internal .OneOfThree ;
4- import com .box .sdkgen .schemas .file .File ;
5- import com .box .sdkgen .schemas .folder .Folder ;
4+ import com .box .sdkgen .schemas .filemini .FileMini ;
65import com .box .sdkgen .schemas .foldermini .FolderMini ;
7- import com .box .sdkgen .schemas .usermini .UserMini ;
8- import com .box .sdkgen .schemas .weblink .WebLink ;
6+ import com .box .sdkgen .schemas .weblinkmini .WebLinkMini ;
97import com .box .sdkgen .serialization .json .EnumWrapper ;
108import com .box .sdkgen .serialization .json .JsonManager ;
119import com .fasterxml .jackson .core .JsonParser ;
1614import com .fasterxml .jackson .databind .annotation .JsonDeserialize ;
1715import com .fasterxml .jackson .databind .annotation .JsonSerialize ;
1816import java .io .IOException ;
19- import java .time .OffsetDateTime ;
2017
2118@ JsonDeserialize (using = CollaborationItem .CollaborationItemDeserializer .class )
2219@ JsonSerialize (using = OneOfThree .OneOfThreeSerializer .class )
23- public class CollaborationItem extends OneOfThree <File , Folder , WebLink > {
24-
25- protected final String description ;
26-
27- protected final OffsetDateTime createdAt ;
28-
29- protected final OffsetDateTime modifiedAt ;
30-
31- protected final OffsetDateTime trashedAt ;
32-
33- protected final OffsetDateTime purgedAt ;
34-
35- protected final UserMini createdBy ;
36-
37- protected final UserMini modifiedBy ;
38-
39- protected final UserMini ownedBy ;
40-
41- protected final FolderMini parent ;
42-
43- protected final String itemStatus ;
20+ public class CollaborationItem extends OneOfThree <FileMini , FolderMini , WebLinkMini > {
4421
4522 protected final String sequenceId ;
4623
@@ -52,127 +29,57 @@ public class CollaborationItem extends OneOfThree<File, Folder, WebLink> {
5229
5330 protected final String type ;
5431
55- public CollaborationItem (File file ) {
56- super (file , null , null );
57- this .description = file .getDescription ();
58- this .createdAt = file .getCreatedAt ();
59- this .modifiedAt = file .getModifiedAt ();
60- this .trashedAt = file .getTrashedAt ();
61- this .purgedAt = file .getPurgedAt ();
62- this .createdBy = file .getCreatedBy ();
63- this .modifiedBy = file .getModifiedBy ();
64- this .ownedBy = file .getOwnedBy ();
65- this .parent = file .getParent ();
66- this .itemStatus = EnumWrapper .convertToString (file .getItemStatus ());
67- this .sequenceId = file .getSequenceId ();
68- this .name = file .getName ();
69- this .id = file .getId ();
70- this .etag = file .getEtag ();
71- this .type = EnumWrapper .convertToString (file .getType ());
32+ public CollaborationItem (FileMini fileMini ) {
33+ super (fileMini , null , null );
34+ this .sequenceId = fileMini .getSequenceId ();
35+ this .name = fileMini .getName ();
36+ this .id = fileMini .getId ();
37+ this .etag = fileMini .getEtag ();
38+ this .type = EnumWrapper .convertToString (fileMini .getType ());
7239 }
7340
74- public CollaborationItem (Folder folder ) {
75- super (null , folder , null );
76- this .description = folder .getDescription ();
77- this .createdAt = folder .getCreatedAt ();
78- this .modifiedAt = folder .getModifiedAt ();
79- this .trashedAt = folder .getTrashedAt ();
80- this .purgedAt = folder .getPurgedAt ();
81- this .createdBy = folder .getCreatedBy ();
82- this .modifiedBy = folder .getModifiedBy ();
83- this .ownedBy = folder .getOwnedBy ();
84- this .parent = folder .getParent ();
85- this .itemStatus = EnumWrapper .convertToString (folder .getItemStatus ());
86- this .sequenceId = folder .getSequenceId ();
87- this .name = folder .getName ();
88- this .id = folder .getId ();
89- this .etag = folder .getEtag ();
90- this .type = EnumWrapper .convertToString (folder .getType ());
41+ public CollaborationItem (FolderMini folderMini ) {
42+ super (null , folderMini , null );
43+ this .sequenceId = folderMini .getSequenceId ();
44+ this .name = folderMini .getName ();
45+ this .id = folderMini .getId ();
46+ this .etag = folderMini .getEtag ();
47+ this .type = EnumWrapper .convertToString (folderMini .getType ());
9148 }
9249
93- public CollaborationItem (WebLink webLink ) {
94- super (null , null , webLink );
95- this .description = webLink .getDescription ();
96- this .createdAt = webLink .getCreatedAt ();
97- this .modifiedAt = webLink .getModifiedAt ();
98- this .trashedAt = webLink .getTrashedAt ();
99- this .purgedAt = webLink .getPurgedAt ();
100- this .createdBy = webLink .getCreatedBy ();
101- this .modifiedBy = webLink .getModifiedBy ();
102- this .ownedBy = webLink .getOwnedBy ();
103- this .parent = webLink .getParent ();
104- this .itemStatus = EnumWrapper .convertToString (webLink .getItemStatus ());
105- this .sequenceId = webLink .getSequenceId ();
106- this .name = webLink .getName ();
107- this .id = webLink .getId ();
108- this .etag = webLink .getEtag ();
109- this .type = EnumWrapper .convertToString (webLink .getType ());
50+ public CollaborationItem (WebLinkMini webLinkMini ) {
51+ super (null , null , webLinkMini );
52+ this .sequenceId = webLinkMini .getSequenceId ();
53+ this .name = webLinkMini .getName ();
54+ this .id = webLinkMini .getId ();
55+ this .etag = webLinkMini .getEtag ();
56+ this .type = EnumWrapper .convertToString (webLinkMini .getType ());
11057 }
11158
112- public boolean isFile () {
59+ public boolean isFileMini () {
11360 return value0 != null ;
11461 }
11562
116- public File getFile () {
63+ public FileMini getFileMini () {
11764 return value0 ;
11865 }
11966
120- public boolean isFolder () {
67+ public boolean isFolderMini () {
12168 return value1 != null ;
12269 }
12370
124- public Folder getFolder () {
71+ public FolderMini getFolderMini () {
12572 return value1 ;
12673 }
12774
128- public boolean isWebLink () {
75+ public boolean isWebLinkMini () {
12976 return value2 != null ;
13077 }
13178
132- public WebLink getWebLink () {
79+ public WebLinkMini getWebLinkMini () {
13380 return value2 ;
13481 }
13582
136- public String getDescription () {
137- return description ;
138- }
139-
140- public OffsetDateTime getCreatedAt () {
141- return createdAt ;
142- }
143-
144- public OffsetDateTime getModifiedAt () {
145- return modifiedAt ;
146- }
147-
148- public OffsetDateTime getTrashedAt () {
149- return trashedAt ;
150- }
151-
152- public OffsetDateTime getPurgedAt () {
153- return purgedAt ;
154- }
155-
156- public UserMini getCreatedBy () {
157- return createdBy ;
158- }
159-
160- public UserMini getModifiedBy () {
161- return modifiedBy ;
162- }
163-
164- public UserMini getOwnedBy () {
165- return ownedBy ;
166- }
167-
168- public FolderMini getParent () {
169- return parent ;
170- }
171-
172- public String getItemStatus () {
173- return itemStatus ;
174- }
175-
17683 public String getSequenceId () {
17784 return sequenceId ;
17885 }
@@ -207,11 +114,11 @@ public CollaborationItem deserialize(JsonParser jp, DeserializationContext ctxt)
207114 if (!(discriminant0 == null )) {
208115 switch (discriminant0 .asText ()) {
209116 case "file" :
210- return new CollaborationItem (JsonManager .deserialize (node , File .class ));
117+ return new CollaborationItem (JsonManager .deserialize (node , FileMini .class ));
211118 case "folder" :
212- return new CollaborationItem (JsonManager .deserialize (node , Folder .class ));
119+ return new CollaborationItem (JsonManager .deserialize (node , FolderMini .class ));
213120 case "web_link" :
214- return new CollaborationItem (JsonManager .deserialize (node , WebLink .class ));
121+ return new CollaborationItem (JsonManager .deserialize (node , WebLinkMini .class ));
215122 }
216123 }
217124 throw new JsonMappingException (jp , "Unable to deserialize CollaborationItem" );
0 commit comments