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

box / box-java-sdk-gen / #155

30 May 2025 01:03PM UTC coverage: 35.646% (+0.3%) from 35.311%
#155

push

github

web-flow
fix: Fix downscope token to use `retrieveToken` method for token retrieval (box/box-codegen#731) (#320)

4 of 4 new or added lines in 4 files covered. (100.0%)

2952 existing lines in 99 files now uncovered.

15628 of 43842 relevant lines covered (35.65%)

0.36 hits per line

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

10.19
/src/main/java/com/box/sdkgen/schemas/trashfile/TrashFile.java
1
package com.box.sdkgen.schemas.trashfile;
2

3
import com.box.sdkgen.internal.SerializableObject;
4
import com.box.sdkgen.internal.utils.DateTimeUtils;
5
import com.box.sdkgen.schemas.fileversionmini.FileVersionMini;
6
import com.box.sdkgen.schemas.foldermini.FolderMini;
7
import com.box.sdkgen.schemas.usermini.UserMini;
8
import com.box.sdkgen.serialization.json.EnumWrapper;
9
import com.fasterxml.jackson.annotation.JsonProperty;
10
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
11
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
12
import java.util.Date;
13
import java.util.Objects;
14

15
public class TrashFile extends SerializableObject {
16

17
  protected final String id;
18

19
  protected String etag;
20

21
  @JsonDeserialize(using = TrashFileTypeField.TrashFileTypeFieldDeserializer.class)
22
  @JsonSerialize(using = TrashFileTypeField.TrashFileTypeFieldSerializer.class)
23
  protected EnumWrapper<TrashFileTypeField> type;
24

25
  @JsonProperty("sequence_id")
26
  protected final String sequenceId;
27

28
  protected String name;
29

30
  protected final String sha1;
31

32
  @JsonProperty("file_version")
33
  protected FileVersionMini fileVersion;
34

35
  protected final String description;
36

37
  protected final long size;
38

39
  @JsonProperty("path_collection")
40
  protected final TrashFilePathCollectionField pathCollection;
41

42
  @JsonProperty("created_at")
43
  @JsonSerialize(using = DateTimeUtils.DateTimeSerializer.class)
44
  @JsonDeserialize(using = DateTimeUtils.DateTimeDeserializer.class)
45
  protected final Date createdAt;
46

47
  @JsonProperty("modified_at")
48
  @JsonSerialize(using = DateTimeUtils.DateTimeSerializer.class)
49
  @JsonDeserialize(using = DateTimeUtils.DateTimeDeserializer.class)
50
  protected final Date modifiedAt;
51

52
  @JsonProperty("trashed_at")
53
  @JsonSerialize(using = DateTimeUtils.DateTimeSerializer.class)
54
  @JsonDeserialize(using = DateTimeUtils.DateTimeDeserializer.class)
55
  protected Date trashedAt;
56

57
  @JsonProperty("purged_at")
58
  @JsonSerialize(using = DateTimeUtils.DateTimeSerializer.class)
59
  @JsonDeserialize(using = DateTimeUtils.DateTimeDeserializer.class)
60
  protected Date purgedAt;
61

62
  @JsonProperty("content_created_at")
63
  @JsonSerialize(using = DateTimeUtils.DateTimeSerializer.class)
64
  @JsonDeserialize(using = DateTimeUtils.DateTimeDeserializer.class)
65
  protected Date contentCreatedAt;
66

67
  @JsonProperty("content_modified_at")
68
  @JsonSerialize(using = DateTimeUtils.DateTimeSerializer.class)
69
  @JsonDeserialize(using = DateTimeUtils.DateTimeDeserializer.class)
70
  protected Date contentModifiedAt;
71

72
  @JsonProperty("created_by")
73
  protected UserMini createdBy;
74

75
  @JsonProperty("modified_by")
76
  protected final UserMini modifiedBy;
77

78
  @JsonProperty("owned_by")
79
  protected final UserMini ownedBy;
80

81
  @JsonProperty("shared_link")
82
  protected String sharedLink;
83

84
  protected FolderMini parent;
85

86
  @JsonDeserialize(using = TrashFileItemStatusField.TrashFileItemStatusFieldDeserializer.class)
87
  @JsonSerialize(using = TrashFileItemStatusField.TrashFileItemStatusFieldSerializer.class)
88
  @JsonProperty("item_status")
89
  protected final EnumWrapper<TrashFileItemStatusField> itemStatus;
90

91
  public TrashFile(
92
      @JsonProperty("id") String id,
93
      @JsonProperty("sequence_id") String sequenceId,
94
      @JsonProperty("sha1") String sha1,
95
      @JsonProperty("description") String description,
96
      @JsonProperty("size") long size,
97
      @JsonProperty("path_collection") TrashFilePathCollectionField pathCollection,
98
      @JsonProperty("created_at") Date createdAt,
99
      @JsonProperty("modified_at") Date modifiedAt,
100
      @JsonProperty("modified_by") UserMini modifiedBy,
101
      @JsonProperty("owned_by") UserMini ownedBy,
102
      @JsonProperty("item_status") EnumWrapper<TrashFileItemStatusField> itemStatus) {
103
    super();
1✔
104
    this.id = id;
1✔
105
    this.sequenceId = sequenceId;
1✔
106
    this.sha1 = sha1;
1✔
107
    this.description = description;
1✔
108
    this.size = size;
1✔
109
    this.pathCollection = pathCollection;
1✔
110
    this.createdAt = createdAt;
1✔
111
    this.modifiedAt = modifiedAt;
1✔
112
    this.modifiedBy = modifiedBy;
1✔
113
    this.ownedBy = ownedBy;
1✔
114
    this.itemStatus = itemStatus;
1✔
115
    this.type = new EnumWrapper<TrashFileTypeField>(TrashFileTypeField.FILE);
1✔
116
  }
1✔
117

118
  public TrashFile(
119
      String id,
120
      String sequenceId,
121
      String sha1,
122
      String description,
123
      long size,
124
      TrashFilePathCollectionField pathCollection,
125
      Date createdAt,
126
      Date modifiedAt,
127
      UserMini modifiedBy,
128
      UserMini ownedBy,
129
      TrashFileItemStatusField itemStatus) {
UNCOV
130
    super();
×
UNCOV
131
    this.id = id;
×
132
    this.sequenceId = sequenceId;
×
133
    this.sha1 = sha1;
×
134
    this.description = description;
×
135
    this.size = size;
×
136
    this.pathCollection = pathCollection;
×
137
    this.createdAt = createdAt;
×
138
    this.modifiedAt = modifiedAt;
×
139
    this.modifiedBy = modifiedBy;
×
140
    this.ownedBy = ownedBy;
×
141
    this.itemStatus = new EnumWrapper<TrashFileItemStatusField>(itemStatus);
×
142
    this.type = new EnumWrapper<TrashFileTypeField>(TrashFileTypeField.FILE);
×
143
  }
×
144

145
  protected TrashFile(TrashFileBuilder builder) {
146
    super();
×
147
    this.id = builder.id;
×
148
    this.etag = builder.etag;
×
149
    this.type = builder.type;
×
150
    this.sequenceId = builder.sequenceId;
×
151
    this.name = builder.name;
×
152
    this.sha1 = builder.sha1;
×
153
    this.fileVersion = builder.fileVersion;
×
154
    this.description = builder.description;
×
155
    this.size = builder.size;
×
UNCOV
156
    this.pathCollection = builder.pathCollection;
×
UNCOV
157
    this.createdAt = builder.createdAt;
×
UNCOV
158
    this.modifiedAt = builder.modifiedAt;
×
UNCOV
159
    this.trashedAt = builder.trashedAt;
×
UNCOV
160
    this.purgedAt = builder.purgedAt;
×
UNCOV
161
    this.contentCreatedAt = builder.contentCreatedAt;
×
162
    this.contentModifiedAt = builder.contentModifiedAt;
×
UNCOV
163
    this.createdBy = builder.createdBy;
×
UNCOV
164
    this.modifiedBy = builder.modifiedBy;
×
UNCOV
165
    this.ownedBy = builder.ownedBy;
×
166
    this.sharedLink = builder.sharedLink;
×
UNCOV
167
    this.parent = builder.parent;
×
UNCOV
168
    this.itemStatus = builder.itemStatus;
×
UNCOV
169
  }
×
170

171
  public String getId() {
172
    return id;
1✔
173
  }
174

175
  public String getEtag() {
UNCOV
176
    return etag;
×
177
  }
178

179
  public EnumWrapper<TrashFileTypeField> getType() {
UNCOV
180
    return type;
×
181
  }
182

183
  public String getSequenceId() {
UNCOV
184
    return sequenceId;
×
185
  }
186

187
  public String getName() {
188
    return name;
1✔
189
  }
190

191
  public String getSha1() {
UNCOV
192
    return sha1;
×
193
  }
194

195
  public FileVersionMini getFileVersion() {
UNCOV
196
    return fileVersion;
×
197
  }
198

199
  public String getDescription() {
UNCOV
200
    return description;
×
201
  }
202

203
  public long getSize() {
UNCOV
204
    return size;
×
205
  }
206

207
  public TrashFilePathCollectionField getPathCollection() {
UNCOV
208
    return pathCollection;
×
209
  }
210

211
  public Date getCreatedAt() {
UNCOV
212
    return createdAt;
×
213
  }
214

215
  public Date getModifiedAt() {
UNCOV
216
    return modifiedAt;
×
217
  }
218

219
  public Date getTrashedAt() {
UNCOV
220
    return trashedAt;
×
221
  }
222

223
  public Date getPurgedAt() {
UNCOV
224
    return purgedAt;
×
225
  }
226

227
  public Date getContentCreatedAt() {
UNCOV
228
    return contentCreatedAt;
×
229
  }
230

231
  public Date getContentModifiedAt() {
UNCOV
232
    return contentModifiedAt;
×
233
  }
234

235
  public UserMini getCreatedBy() {
UNCOV
236
    return createdBy;
×
237
  }
238

239
  public UserMini getModifiedBy() {
UNCOV
240
    return modifiedBy;
×
241
  }
242

243
  public UserMini getOwnedBy() {
UNCOV
244
    return ownedBy;
×
245
  }
246

247
  public String getSharedLink() {
248
    return sharedLink;
×
249
  }
250

251
  public FolderMini getParent() {
UNCOV
252
    return parent;
×
253
  }
254

255
  public EnumWrapper<TrashFileItemStatusField> getItemStatus() {
256
    return itemStatus;
×
257
  }
258

259
  @Override
260
  public boolean equals(Object o) {
261
    if (this == o) {
×
262
      return true;
×
263
    }
264
    if (o == null || getClass() != o.getClass()) {
×
265
      return false;
×
266
    }
267
    TrashFile casted = (TrashFile) o;
×
268
    return Objects.equals(id, casted.id)
×
269
        && Objects.equals(etag, casted.etag)
×
270
        && Objects.equals(type, casted.type)
×
271
        && Objects.equals(sequenceId, casted.sequenceId)
×
272
        && Objects.equals(name, casted.name)
×
273
        && Objects.equals(sha1, casted.sha1)
×
274
        && Objects.equals(fileVersion, casted.fileVersion)
×
275
        && Objects.equals(description, casted.description)
×
UNCOV
276
        && Objects.equals(size, casted.size)
×
UNCOV
277
        && Objects.equals(pathCollection, casted.pathCollection)
×
UNCOV
278
        && Objects.equals(createdAt, casted.createdAt)
×
UNCOV
279
        && Objects.equals(modifiedAt, casted.modifiedAt)
×
280
        && Objects.equals(trashedAt, casted.trashedAt)
×
UNCOV
281
        && Objects.equals(purgedAt, casted.purgedAt)
×
UNCOV
282
        && Objects.equals(contentCreatedAt, casted.contentCreatedAt)
×
UNCOV
283
        && Objects.equals(contentModifiedAt, casted.contentModifiedAt)
×
UNCOV
284
        && Objects.equals(createdBy, casted.createdBy)
×
UNCOV
285
        && Objects.equals(modifiedBy, casted.modifiedBy)
×
UNCOV
286
        && Objects.equals(ownedBy, casted.ownedBy)
×
UNCOV
287
        && Objects.equals(sharedLink, casted.sharedLink)
×
UNCOV
288
        && Objects.equals(parent, casted.parent)
×
289
        && Objects.equals(itemStatus, casted.itemStatus);
×
290
  }
291

292
  @Override
293
  public int hashCode() {
UNCOV
294
    return Objects.hash(
×
295
        id,
296
        etag,
297
        type,
298
        sequenceId,
299
        name,
300
        sha1,
301
        fileVersion,
302
        description,
UNCOV
303
        size,
×
304
        pathCollection,
305
        createdAt,
306
        modifiedAt,
307
        trashedAt,
308
        purgedAt,
309
        contentCreatedAt,
310
        contentModifiedAt,
311
        createdBy,
312
        modifiedBy,
313
        ownedBy,
314
        sharedLink,
315
        parent,
316
        itemStatus);
317
  }
318

319
  @Override
320
  public String toString() {
UNCOV
321
    return "TrashFile{"
×
322
        + "id='"
323
        + id
324
        + '\''
325
        + ", "
326
        + "etag='"
327
        + etag
328
        + '\''
329
        + ", "
330
        + "type='"
331
        + type
332
        + '\''
333
        + ", "
334
        + "sequenceId='"
335
        + sequenceId
336
        + '\''
337
        + ", "
338
        + "name='"
339
        + name
340
        + '\''
341
        + ", "
342
        + "sha1='"
343
        + sha1
344
        + '\''
345
        + ", "
346
        + "fileVersion='"
347
        + fileVersion
348
        + '\''
349
        + ", "
350
        + "description='"
351
        + description
352
        + '\''
353
        + ", "
354
        + "size='"
355
        + size
356
        + '\''
357
        + ", "
358
        + "pathCollection='"
359
        + pathCollection
360
        + '\''
361
        + ", "
362
        + "createdAt='"
363
        + createdAt
364
        + '\''
365
        + ", "
366
        + "modifiedAt='"
367
        + modifiedAt
368
        + '\''
369
        + ", "
370
        + "trashedAt='"
371
        + trashedAt
372
        + '\''
373
        + ", "
374
        + "purgedAt='"
375
        + purgedAt
376
        + '\''
377
        + ", "
378
        + "contentCreatedAt='"
379
        + contentCreatedAt
380
        + '\''
381
        + ", "
382
        + "contentModifiedAt='"
383
        + contentModifiedAt
384
        + '\''
385
        + ", "
386
        + "createdBy='"
387
        + createdBy
388
        + '\''
389
        + ", "
390
        + "modifiedBy='"
391
        + modifiedBy
392
        + '\''
393
        + ", "
394
        + "ownedBy='"
395
        + ownedBy
396
        + '\''
397
        + ", "
398
        + "sharedLink='"
399
        + sharedLink
400
        + '\''
401
        + ", "
402
        + "parent='"
403
        + parent
404
        + '\''
405
        + ", "
406
        + "itemStatus='"
407
        + itemStatus
408
        + '\''
409
        + "}";
410
  }
411

412
  public static class TrashFileBuilder {
413

414
    protected final String id;
415

416
    protected String etag;
417

418
    protected EnumWrapper<TrashFileTypeField> type;
419

420
    protected final String sequenceId;
421

422
    protected String name;
423

424
    protected final String sha1;
425

426
    protected FileVersionMini fileVersion;
427

428
    protected final String description;
429

430
    protected final long size;
431

432
    protected final TrashFilePathCollectionField pathCollection;
433

434
    protected final Date createdAt;
435

436
    protected final Date modifiedAt;
437

438
    protected Date trashedAt;
439

440
    protected Date purgedAt;
441

442
    protected Date contentCreatedAt;
443

444
    protected Date contentModifiedAt;
445

446
    protected UserMini createdBy;
447

448
    protected final UserMini modifiedBy;
449

450
    protected final UserMini ownedBy;
451

452
    protected String sharedLink;
453

454
    protected FolderMini parent;
455

456
    protected final EnumWrapper<TrashFileItemStatusField> itemStatus;
457

458
    public TrashFileBuilder(
459
        String id,
460
        String sequenceId,
461
        String sha1,
462
        String description,
463
        long size,
464
        TrashFilePathCollectionField pathCollection,
465
        Date createdAt,
466
        Date modifiedAt,
467
        UserMini modifiedBy,
468
        UserMini ownedBy,
UNCOV
469
        EnumWrapper<TrashFileItemStatusField> itemStatus) {
×
UNCOV
470
      this.id = id;
×
UNCOV
471
      this.sequenceId = sequenceId;
×
UNCOV
472
      this.sha1 = sha1;
×
UNCOV
473
      this.description = description;
×
UNCOV
474
      this.size = size;
×
UNCOV
475
      this.pathCollection = pathCollection;
×
UNCOV
476
      this.createdAt = createdAt;
×
UNCOV
477
      this.modifiedAt = modifiedAt;
×
UNCOV
478
      this.modifiedBy = modifiedBy;
×
UNCOV
479
      this.ownedBy = ownedBy;
×
UNCOV
480
      this.itemStatus = itemStatus;
×
481
      this.type = new EnumWrapper<TrashFileTypeField>(TrashFileTypeField.FILE);
×
482
    }
×
483

484
    public TrashFileBuilder(
485
        String id,
486
        String sequenceId,
487
        String sha1,
488
        String description,
489
        long size,
490
        TrashFilePathCollectionField pathCollection,
491
        Date createdAt,
492
        Date modifiedAt,
493
        UserMini modifiedBy,
494
        UserMini ownedBy,
UNCOV
495
        TrashFileItemStatusField itemStatus) {
×
UNCOV
496
      this.id = id;
×
497
      this.sequenceId = sequenceId;
×
498
      this.sha1 = sha1;
×
UNCOV
499
      this.description = description;
×
UNCOV
500
      this.size = size;
×
UNCOV
501
      this.pathCollection = pathCollection;
×
502
      this.createdAt = createdAt;
×
503
      this.modifiedAt = modifiedAt;
×
UNCOV
504
      this.modifiedBy = modifiedBy;
×
UNCOV
505
      this.ownedBy = ownedBy;
×
UNCOV
506
      this.itemStatus = new EnumWrapper<TrashFileItemStatusField>(itemStatus);
×
507
      this.type = new EnumWrapper<TrashFileTypeField>(TrashFileTypeField.FILE);
×
508
    }
×
509

510
    public TrashFileBuilder etag(String etag) {
UNCOV
511
      this.etag = etag;
×
512
      return this;
×
513
    }
514

515
    public TrashFileBuilder type(TrashFileTypeField type) {
UNCOV
516
      this.type = new EnumWrapper<TrashFileTypeField>(type);
×
517
      return this;
×
518
    }
519

520
    public TrashFileBuilder type(EnumWrapper<TrashFileTypeField> type) {
UNCOV
521
      this.type = type;
×
522
      return this;
×
523
    }
524

525
    public TrashFileBuilder name(String name) {
UNCOV
526
      this.name = name;
×
527
      return this;
×
528
    }
529

530
    public TrashFileBuilder fileVersion(FileVersionMini fileVersion) {
UNCOV
531
      this.fileVersion = fileVersion;
×
532
      return this;
×
533
    }
534

535
    public TrashFileBuilder trashedAt(Date trashedAt) {
UNCOV
536
      this.trashedAt = trashedAt;
×
537
      return this;
×
538
    }
539

540
    public TrashFileBuilder purgedAt(Date purgedAt) {
UNCOV
541
      this.purgedAt = purgedAt;
×
542
      return this;
×
543
    }
544

545
    public TrashFileBuilder contentCreatedAt(Date contentCreatedAt) {
UNCOV
546
      this.contentCreatedAt = contentCreatedAt;
×
547
      return this;
×
548
    }
549

550
    public TrashFileBuilder contentModifiedAt(Date contentModifiedAt) {
UNCOV
551
      this.contentModifiedAt = contentModifiedAt;
×
552
      return this;
×
553
    }
554

555
    public TrashFileBuilder createdBy(UserMini createdBy) {
UNCOV
556
      this.createdBy = createdBy;
×
557
      return this;
×
558
    }
559

560
    public TrashFileBuilder sharedLink(String sharedLink) {
UNCOV
561
      this.sharedLink = sharedLink;
×
UNCOV
562
      return this;
×
563
    }
564

565
    public TrashFileBuilder parent(FolderMini parent) {
UNCOV
566
      this.parent = parent;
×
UNCOV
567
      return this;
×
568
    }
569

570
    public TrashFile build() {
UNCOV
571
      return new TrashFile(this);
×
572
    }
573
  }
574
}
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