• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

box / box-java-sdk / #4847

15 Sep 2025 09:55AM UTC coverage: 37.163% (-0.1%) from 37.307%
#4847

push

github

web-flow
feat: Add missing webhook events (box/box-openapi#554) (#1412)

8 of 12 new or added lines in 3 files covered. (66.67%)

74 existing lines in 11 files now uncovered.

18446 of 49635 relevant lines covered (37.16%)

0.37 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

2.44
/src/main/java/com/box/sdkgen/schemas/recentitemresource/RecentItemResource.java
1
package com.box.sdkgen.schemas.recentitemresource;
2

3
import com.box.sdkgen.internal.OneOfThree;
4
import com.box.sdkgen.schemas.filefull.FileFull;
5
import com.box.sdkgen.schemas.folderfull.FolderFull;
6
import com.box.sdkgen.schemas.foldermini.FolderMini;
7
import com.box.sdkgen.schemas.usermini.UserMini;
8
import com.box.sdkgen.schemas.weblink.WebLink;
9
import com.box.sdkgen.serialization.json.EnumWrapper;
10
import com.box.sdkgen.serialization.json.JsonManager;
11
import com.fasterxml.jackson.core.JsonParser;
12
import com.fasterxml.jackson.databind.DeserializationContext;
13
import com.fasterxml.jackson.databind.JsonDeserializer;
14
import com.fasterxml.jackson.databind.JsonMappingException;
15
import com.fasterxml.jackson.databind.JsonNode;
16
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
17
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
18
import java.io.IOException;
19
import java.util.Date;
20

21
@JsonDeserialize(using = RecentItemResource.RecentItemResourceDeserializer.class)
22
@JsonSerialize(using = OneOfThree.OneOfThreeSerializer.class)
23
public class RecentItemResource extends OneOfThree<FileFull, FolderFull, WebLink> {
24

25
  protected final String description;
26

27
  protected final Date createdAt;
28

29
  protected final Date modifiedAt;
30

31
  protected final Date trashedAt;
32

33
  protected final Date 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;
44

45
  protected final String sequenceId;
46

47
  protected final String name;
48

49
  protected final String id;
50

51
  protected final String etag;
52

53
  protected final String type;
54

55
  public RecentItemResource(FileFull fileFull) {
UNCOV
56
    super(fileFull, null, null);
×
UNCOV
57
    this.description = fileFull.getDescription();
×
UNCOV
58
    this.createdAt = fileFull.getCreatedAt();
×
UNCOV
59
    this.modifiedAt = fileFull.getModifiedAt();
×
UNCOV
60
    this.trashedAt = fileFull.getTrashedAt();
×
UNCOV
61
    this.purgedAt = fileFull.getPurgedAt();
×
UNCOV
62
    this.createdBy = fileFull.getCreatedBy();
×
UNCOV
63
    this.modifiedBy = fileFull.getModifiedBy();
×
UNCOV
64
    this.ownedBy = fileFull.getOwnedBy();
×
UNCOV
65
    this.parent = fileFull.getParent();
×
UNCOV
66
    this.itemStatus = EnumWrapper.convertToString(fileFull.getItemStatus());
×
UNCOV
67
    this.sequenceId = fileFull.getSequenceId();
×
UNCOV
68
    this.name = fileFull.getName();
×
UNCOV
69
    this.id = fileFull.getId();
×
UNCOV
70
    this.etag = fileFull.getEtag();
×
UNCOV
71
    this.type = EnumWrapper.convertToString(fileFull.getType());
×
UNCOV
72
  }
×
73

74
  public RecentItemResource(FolderFull folderFull) {
75
    super(null, folderFull, null);
×
76
    this.description = folderFull.getDescription();
×
77
    this.createdAt = folderFull.getCreatedAt();
×
78
    this.modifiedAt = folderFull.getModifiedAt();
×
79
    this.trashedAt = folderFull.getTrashedAt();
×
80
    this.purgedAt = folderFull.getPurgedAt();
×
81
    this.createdBy = folderFull.getCreatedBy();
×
82
    this.modifiedBy = folderFull.getModifiedBy();
×
83
    this.ownedBy = folderFull.getOwnedBy();
×
84
    this.parent = folderFull.getParent();
×
85
    this.itemStatus = EnumWrapper.convertToString(folderFull.getItemStatus());
×
86
    this.sequenceId = folderFull.getSequenceId();
×
87
    this.name = folderFull.getName();
×
88
    this.id = folderFull.getId();
×
89
    this.etag = folderFull.getEtag();
×
90
    this.type = EnumWrapper.convertToString(folderFull.getType());
×
91
  }
×
92

93
  public RecentItemResource(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());
×
110
  }
×
111

112
  public boolean isFileFull() {
113
    return value0 != null;
×
114
  }
115

116
  public FileFull getFileFull() {
117
    return value0;
×
118
  }
119

120
  public boolean isFolderFull() {
121
    return value1 != null;
×
122
  }
123

124
  public FolderFull getFolderFull() {
125
    return value1;
×
126
  }
127

128
  public boolean isWebLink() {
129
    return value2 != null;
×
130
  }
131

132
  public WebLink getWebLink() {
133
    return value2;
×
134
  }
135

136
  public String getDescription() {
137
    return description;
×
138
  }
139

140
  public Date getCreatedAt() {
141
    return createdAt;
×
142
  }
143

144
  public Date getModifiedAt() {
145
    return modifiedAt;
×
146
  }
147

148
  public Date getTrashedAt() {
149
    return trashedAt;
×
150
  }
151

152
  public Date 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

176
  public String getSequenceId() {
177
    return sequenceId;
×
178
  }
179

180
  public String getName() {
181
    return name;
×
182
  }
183

184
  public String getId() {
185
    return id;
×
186
  }
187

188
  public String getEtag() {
189
    return etag;
×
190
  }
191

192
  public String getType() {
193
    return type;
×
194
  }
195

196
  static class RecentItemResourceDeserializer extends JsonDeserializer<RecentItemResource> {
197

198
    public RecentItemResourceDeserializer() {
199
      super();
1✔
200
    }
1✔
201

202
    @Override
203
    public RecentItemResource deserialize(JsonParser jp, DeserializationContext ctxt)
204
        throws IOException {
UNCOV
205
      JsonNode node = JsonManager.jsonToSerializedData(jp);
×
UNCOV
206
      JsonNode discriminant0 = node.get("type");
×
UNCOV
207
      if (!(discriminant0 == null)) {
×
UNCOV
208
        switch (discriminant0.asText()) {
×
209
          case "file":
UNCOV
210
            return new RecentItemResource(JsonManager.deserialize(node, FileFull.class));
×
211
          case "folder":
212
            return new RecentItemResource(JsonManager.deserialize(node, FolderFull.class));
×
213
          case "web_link":
214
            return new RecentItemResource(JsonManager.deserialize(node, WebLink.class));
×
215
        }
216
      }
217
      throw new JsonMappingException(jp, "Unable to deserialize RecentItemResource");
×
218
    }
219
  }
220
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc