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

box / box-java-sdk / #5076

07 Oct 2025 12:35PM UTC coverage: 37.132% (+0.007%) from 37.125%
#5076

push

github

web-flow
test: Change `Event.additionalDetails` field assertion in events test (box/box-codegen#858) (#1491)

18454 of 49699 relevant lines covered (37.13%)

0.37 hits per line

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

9.76
/src/main/java/com/box/sdkgen/schemas/trashfilerestored/TrashFileRestored.java
1
package com.box.sdkgen.schemas.trashfilerestored;
2

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

18
/** Represents a file restored from the trash. */
19
@JsonFilter("nullablePropertyFilter")
20
public class TrashFileRestored extends SerializableObject {
21

22
  /**
23
   * The unique identifier that represent a file.
24
   *
25
   * <p>The ID for any file can be determined by visiting a file in the web application and copying
26
   * the ID from the URL. For example, for the URL `https://*.app.box.com/files/123` the `file_id`
27
   * is `123`.
28
   */
29
  protected final String id;
30

31
  /**
32
   * The HTTP `etag` of this file. This can be used within some API endpoints in the `If-Match` and
33
   * `If-None-Match` headers to only perform changes on the file if (no) changes have happened.
34
   */
35
  @Nullable protected String etag;
36

37
  /** The value will always be `file`. */
38
  @JsonDeserialize(using = TrashFileRestoredTypeField.TrashFileRestoredTypeFieldDeserializer.class)
39
  @JsonSerialize(using = TrashFileRestoredTypeField.TrashFileRestoredTypeFieldSerializer.class)
40
  protected EnumWrapper<TrashFileRestoredTypeField> type;
41

42
  @JsonProperty("sequence_id")
43
  protected final String sequenceId;
44

45
  /** The name of the file. */
46
  protected String name;
47

48
  /**
49
   * The SHA1 hash of the file. This can be used to compare the contents of a file on Box with a
50
   * local file.
51
   */
52
  protected final String sha1;
53

54
  @JsonProperty("file_version")
55
  protected FileVersionMini fileVersion;
56

57
  /** The optional description of this file. */
58
  protected final String description;
59

60
  /**
61
   * The file size in bytes. Be careful parsing this integer as it can get very large and cause an
62
   * integer overflow.
63
   */
64
  protected final long size;
65

66
  @JsonProperty("path_collection")
67
  protected final TrashFileRestoredPathCollectionField pathCollection;
68

69
  /** The date and time when the file was created on Box. */
70
  @JsonProperty("created_at")
71
  @JsonSerialize(using = DateTimeUtils.DateTimeSerializer.class)
72
  @JsonDeserialize(using = DateTimeUtils.DateTimeDeserializer.class)
73
  protected final OffsetDateTime createdAt;
74

75
  /** The date and time when the file was last updated on Box. */
76
  @JsonProperty("modified_at")
77
  @JsonSerialize(using = DateTimeUtils.DateTimeSerializer.class)
78
  @JsonDeserialize(using = DateTimeUtils.DateTimeDeserializer.class)
79
  protected final OffsetDateTime modifiedAt;
80

81
  /** The time at which this file was put in the trash - becomes `null` after restore. */
82
  @JsonProperty("trashed_at")
83
  @Nullable
84
  protected String trashedAt;
85

86
  /**
87
   * The time at which this file is expected to be purged from the trash - becomes `null` after
88
   * restore.
89
   */
90
  @JsonProperty("purged_at")
91
  @Nullable
92
  protected String purgedAt;
93

94
  /**
95
   * The date and time at which this file was originally created, which might be before it was
96
   * uploaded to Box.
97
   */
98
  @JsonProperty("content_created_at")
99
  @JsonSerialize(using = DateTimeUtils.DateTimeSerializer.class)
100
  @JsonDeserialize(using = DateTimeUtils.DateTimeDeserializer.class)
101
  @Nullable
102
  protected OffsetDateTime contentCreatedAt;
103

104
  /**
105
   * The date and time at which this file was last updated, which might be before it was uploaded to
106
   * Box.
107
   */
108
  @JsonProperty("content_modified_at")
109
  @JsonSerialize(using = DateTimeUtils.DateTimeSerializer.class)
110
  @JsonDeserialize(using = DateTimeUtils.DateTimeDeserializer.class)
111
  @Nullable
112
  protected OffsetDateTime contentModifiedAt;
113

114
  @JsonProperty("created_by")
115
  protected UserMini createdBy;
116

117
  @JsonProperty("modified_by")
118
  protected final UserMini modifiedBy;
119

120
  @JsonProperty("owned_by")
121
  protected final UserMini ownedBy;
122

123
  /**
124
   * The shared link for this file. This will be `null` if a file had been trashed, even though the
125
   * original shared link does become active again.
126
   */
127
  @JsonProperty("shared_link")
128
  @Nullable
129
  protected String sharedLink;
130

131
  protected FolderMini parent;
132

133
  /**
134
   * Defines if this item has been deleted or not.
135
   *
136
   * <p>* `active` when the item has is not in the trash * `trashed` when the item has been moved to
137
   * the trash but not deleted * `deleted` when the item has been permanently deleted.
138
   */
139
  @JsonDeserialize(
140
      using = TrashFileRestoredItemStatusField.TrashFileRestoredItemStatusFieldDeserializer.class)
141
  @JsonSerialize(
142
      using = TrashFileRestoredItemStatusField.TrashFileRestoredItemStatusFieldSerializer.class)
143
  @JsonProperty("item_status")
144
  protected final EnumWrapper<TrashFileRestoredItemStatusField> itemStatus;
145

146
  public TrashFileRestored(
147
      String id,
148
      String sequenceId,
149
      String sha1,
150
      String description,
151
      long size,
152
      TrashFileRestoredPathCollectionField pathCollection,
153
      OffsetDateTime createdAt,
154
      OffsetDateTime modifiedAt,
155
      UserMini modifiedBy,
156
      UserMini ownedBy,
157
      TrashFileRestoredItemStatusField itemStatus) {
158
    super();
×
159
    this.id = id;
×
160
    this.sequenceId = sequenceId;
×
161
    this.sha1 = sha1;
×
162
    this.description = description;
×
163
    this.size = size;
×
164
    this.pathCollection = pathCollection;
×
165
    this.createdAt = createdAt;
×
166
    this.modifiedAt = modifiedAt;
×
167
    this.modifiedBy = modifiedBy;
×
168
    this.ownedBy = ownedBy;
×
169
    this.itemStatus = new EnumWrapper<TrashFileRestoredItemStatusField>(itemStatus);
×
170
    this.type = new EnumWrapper<TrashFileRestoredTypeField>(TrashFileRestoredTypeField.FILE);
×
171
  }
×
172

173
  public TrashFileRestored(
174
      @JsonProperty("id") String id,
175
      @JsonProperty("sequence_id") String sequenceId,
176
      @JsonProperty("sha1") String sha1,
177
      @JsonProperty("description") String description,
178
      @JsonProperty("size") long size,
179
      @JsonProperty("path_collection") TrashFileRestoredPathCollectionField pathCollection,
180
      @JsonProperty("created_at") OffsetDateTime createdAt,
181
      @JsonProperty("modified_at") OffsetDateTime modifiedAt,
182
      @JsonProperty("modified_by") UserMini modifiedBy,
183
      @JsonProperty("owned_by") UserMini ownedBy,
184
      @JsonProperty("item_status") EnumWrapper<TrashFileRestoredItemStatusField> itemStatus) {
185
    super();
1✔
186
    this.id = id;
1✔
187
    this.sequenceId = sequenceId;
1✔
188
    this.sha1 = sha1;
1✔
189
    this.description = description;
1✔
190
    this.size = size;
1✔
191
    this.pathCollection = pathCollection;
1✔
192
    this.createdAt = createdAt;
1✔
193
    this.modifiedAt = modifiedAt;
1✔
194
    this.modifiedBy = modifiedBy;
1✔
195
    this.ownedBy = ownedBy;
1✔
196
    this.itemStatus = itemStatus;
1✔
197
    this.type = new EnumWrapper<TrashFileRestoredTypeField>(TrashFileRestoredTypeField.FILE);
1✔
198
  }
1✔
199

200
  protected TrashFileRestored(Builder builder) {
201
    super();
×
202
    this.id = builder.id;
×
203
    this.etag = builder.etag;
×
204
    this.type = builder.type;
×
205
    this.sequenceId = builder.sequenceId;
×
206
    this.name = builder.name;
×
207
    this.sha1 = builder.sha1;
×
208
    this.fileVersion = builder.fileVersion;
×
209
    this.description = builder.description;
×
210
    this.size = builder.size;
×
211
    this.pathCollection = builder.pathCollection;
×
212
    this.createdAt = builder.createdAt;
×
213
    this.modifiedAt = builder.modifiedAt;
×
214
    this.trashedAt = builder.trashedAt;
×
215
    this.purgedAt = builder.purgedAt;
×
216
    this.contentCreatedAt = builder.contentCreatedAt;
×
217
    this.contentModifiedAt = builder.contentModifiedAt;
×
218
    this.createdBy = builder.createdBy;
×
219
    this.modifiedBy = builder.modifiedBy;
×
220
    this.ownedBy = builder.ownedBy;
×
221
    this.sharedLink = builder.sharedLink;
×
222
    this.parent = builder.parent;
×
223
    this.itemStatus = builder.itemStatus;
×
224
    markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
×
225
  }
×
226

227
  public String getId() {
228
    return id;
1✔
229
  }
230

231
  public String getEtag() {
232
    return etag;
×
233
  }
234

235
  public EnumWrapper<TrashFileRestoredTypeField> getType() {
236
    return type;
×
237
  }
238

239
  public String getSequenceId() {
240
    return sequenceId;
×
241
  }
242

243
  public String getName() {
244
    return name;
1✔
245
  }
246

247
  public String getSha1() {
248
    return sha1;
×
249
  }
250

251
  public FileVersionMini getFileVersion() {
252
    return fileVersion;
×
253
  }
254

255
  public String getDescription() {
256
    return description;
×
257
  }
258

259
  public long getSize() {
260
    return size;
×
261
  }
262

263
  public TrashFileRestoredPathCollectionField getPathCollection() {
264
    return pathCollection;
×
265
  }
266

267
  public OffsetDateTime getCreatedAt() {
268
    return createdAt;
×
269
  }
270

271
  public OffsetDateTime getModifiedAt() {
272
    return modifiedAt;
×
273
  }
274

275
  public String getTrashedAt() {
276
    return trashedAt;
×
277
  }
278

279
  public String getPurgedAt() {
280
    return purgedAt;
×
281
  }
282

283
  public OffsetDateTime getContentCreatedAt() {
284
    return contentCreatedAt;
×
285
  }
286

287
  public OffsetDateTime getContentModifiedAt() {
288
    return contentModifiedAt;
×
289
  }
290

291
  public UserMini getCreatedBy() {
292
    return createdBy;
×
293
  }
294

295
  public UserMini getModifiedBy() {
296
    return modifiedBy;
×
297
  }
298

299
  public UserMini getOwnedBy() {
300
    return ownedBy;
×
301
  }
302

303
  public String getSharedLink() {
304
    return sharedLink;
×
305
  }
306

307
  public FolderMini getParent() {
308
    return parent;
×
309
  }
310

311
  public EnumWrapper<TrashFileRestoredItemStatusField> getItemStatus() {
312
    return itemStatus;
×
313
  }
314

315
  @Override
316
  public boolean equals(Object o) {
317
    if (this == o) {
×
318
      return true;
×
319
    }
320
    if (o == null || getClass() != o.getClass()) {
×
321
      return false;
×
322
    }
323
    TrashFileRestored casted = (TrashFileRestored) o;
×
324
    return Objects.equals(id, casted.id)
×
325
        && Objects.equals(etag, casted.etag)
×
326
        && Objects.equals(type, casted.type)
×
327
        && Objects.equals(sequenceId, casted.sequenceId)
×
328
        && Objects.equals(name, casted.name)
×
329
        && Objects.equals(sha1, casted.sha1)
×
330
        && Objects.equals(fileVersion, casted.fileVersion)
×
331
        && Objects.equals(description, casted.description)
×
332
        && Objects.equals(size, casted.size)
×
333
        && Objects.equals(pathCollection, casted.pathCollection)
×
334
        && Objects.equals(createdAt, casted.createdAt)
×
335
        && Objects.equals(modifiedAt, casted.modifiedAt)
×
336
        && Objects.equals(trashedAt, casted.trashedAt)
×
337
        && Objects.equals(purgedAt, casted.purgedAt)
×
338
        && Objects.equals(contentCreatedAt, casted.contentCreatedAt)
×
339
        && Objects.equals(contentModifiedAt, casted.contentModifiedAt)
×
340
        && Objects.equals(createdBy, casted.createdBy)
×
341
        && Objects.equals(modifiedBy, casted.modifiedBy)
×
342
        && Objects.equals(ownedBy, casted.ownedBy)
×
343
        && Objects.equals(sharedLink, casted.sharedLink)
×
344
        && Objects.equals(parent, casted.parent)
×
345
        && Objects.equals(itemStatus, casted.itemStatus);
×
346
  }
347

348
  @Override
349
  public int hashCode() {
350
    return Objects.hash(
×
351
        id,
352
        etag,
353
        type,
354
        sequenceId,
355
        name,
356
        sha1,
357
        fileVersion,
358
        description,
359
        size,
×
360
        pathCollection,
361
        createdAt,
362
        modifiedAt,
363
        trashedAt,
364
        purgedAt,
365
        contentCreatedAt,
366
        contentModifiedAt,
367
        createdBy,
368
        modifiedBy,
369
        ownedBy,
370
        sharedLink,
371
        parent,
372
        itemStatus);
373
  }
374

375
  @Override
376
  public String toString() {
377
    return "TrashFileRestored{"
×
378
        + "id='"
379
        + id
380
        + '\''
381
        + ", "
382
        + "etag='"
383
        + etag
384
        + '\''
385
        + ", "
386
        + "type='"
387
        + type
388
        + '\''
389
        + ", "
390
        + "sequenceId='"
391
        + sequenceId
392
        + '\''
393
        + ", "
394
        + "name='"
395
        + name
396
        + '\''
397
        + ", "
398
        + "sha1='"
399
        + sha1
400
        + '\''
401
        + ", "
402
        + "fileVersion='"
403
        + fileVersion
404
        + '\''
405
        + ", "
406
        + "description='"
407
        + description
408
        + '\''
409
        + ", "
410
        + "size='"
411
        + size
412
        + '\''
413
        + ", "
414
        + "pathCollection='"
415
        + pathCollection
416
        + '\''
417
        + ", "
418
        + "createdAt='"
419
        + createdAt
420
        + '\''
421
        + ", "
422
        + "modifiedAt='"
423
        + modifiedAt
424
        + '\''
425
        + ", "
426
        + "trashedAt='"
427
        + trashedAt
428
        + '\''
429
        + ", "
430
        + "purgedAt='"
431
        + purgedAt
432
        + '\''
433
        + ", "
434
        + "contentCreatedAt='"
435
        + contentCreatedAt
436
        + '\''
437
        + ", "
438
        + "contentModifiedAt='"
439
        + contentModifiedAt
440
        + '\''
441
        + ", "
442
        + "createdBy='"
443
        + createdBy
444
        + '\''
445
        + ", "
446
        + "modifiedBy='"
447
        + modifiedBy
448
        + '\''
449
        + ", "
450
        + "ownedBy='"
451
        + ownedBy
452
        + '\''
453
        + ", "
454
        + "sharedLink='"
455
        + sharedLink
456
        + '\''
457
        + ", "
458
        + "parent='"
459
        + parent
460
        + '\''
461
        + ", "
462
        + "itemStatus='"
463
        + itemStatus
464
        + '\''
465
        + "}";
466
  }
467

468
  public static class Builder extends NullableFieldTracker {
469

470
    protected final String id;
471

472
    protected String etag;
473

474
    protected EnumWrapper<TrashFileRestoredTypeField> type;
475

476
    protected final String sequenceId;
477

478
    protected String name;
479

480
    protected final String sha1;
481

482
    protected FileVersionMini fileVersion;
483

484
    protected final String description;
485

486
    protected final long size;
487

488
    protected final TrashFileRestoredPathCollectionField pathCollection;
489

490
    protected final OffsetDateTime createdAt;
491

492
    protected final OffsetDateTime modifiedAt;
493

494
    protected String trashedAt;
495

496
    protected String purgedAt;
497

498
    protected OffsetDateTime contentCreatedAt;
499

500
    protected OffsetDateTime contentModifiedAt;
501

502
    protected UserMini createdBy;
503

504
    protected final UserMini modifiedBy;
505

506
    protected final UserMini ownedBy;
507

508
    protected String sharedLink;
509

510
    protected FolderMini parent;
511

512
    protected final EnumWrapper<TrashFileRestoredItemStatusField> itemStatus;
513

514
    public Builder(
515
        String id,
516
        String sequenceId,
517
        String sha1,
518
        String description,
519
        long size,
520
        TrashFileRestoredPathCollectionField pathCollection,
521
        OffsetDateTime createdAt,
522
        OffsetDateTime modifiedAt,
523
        UserMini modifiedBy,
524
        UserMini ownedBy,
525
        TrashFileRestoredItemStatusField itemStatus) {
526
      super();
×
527
      this.id = id;
×
528
      this.sequenceId = sequenceId;
×
529
      this.sha1 = sha1;
×
530
      this.description = description;
×
531
      this.size = size;
×
532
      this.pathCollection = pathCollection;
×
533
      this.createdAt = createdAt;
×
534
      this.modifiedAt = modifiedAt;
×
535
      this.modifiedBy = modifiedBy;
×
536
      this.ownedBy = ownedBy;
×
537
      this.itemStatus = new EnumWrapper<TrashFileRestoredItemStatusField>(itemStatus);
×
538
      this.type = new EnumWrapper<TrashFileRestoredTypeField>(TrashFileRestoredTypeField.FILE);
×
539
    }
×
540

541
    public Builder(
542
        String id,
543
        String sequenceId,
544
        String sha1,
545
        String description,
546
        long size,
547
        TrashFileRestoredPathCollectionField pathCollection,
548
        OffsetDateTime createdAt,
549
        OffsetDateTime modifiedAt,
550
        UserMini modifiedBy,
551
        UserMini ownedBy,
552
        EnumWrapper<TrashFileRestoredItemStatusField> itemStatus) {
553
      super();
×
554
      this.id = id;
×
555
      this.sequenceId = sequenceId;
×
556
      this.sha1 = sha1;
×
557
      this.description = description;
×
558
      this.size = size;
×
559
      this.pathCollection = pathCollection;
×
560
      this.createdAt = createdAt;
×
561
      this.modifiedAt = modifiedAt;
×
562
      this.modifiedBy = modifiedBy;
×
563
      this.ownedBy = ownedBy;
×
564
      this.itemStatus = itemStatus;
×
565
      this.type = new EnumWrapper<TrashFileRestoredTypeField>(TrashFileRestoredTypeField.FILE);
×
566
    }
×
567

568
    public Builder etag(String etag) {
569
      this.etag = etag;
×
570
      this.markNullableFieldAsSet("etag");
×
571
      return this;
×
572
    }
573

574
    public Builder type(TrashFileRestoredTypeField type) {
575
      this.type = new EnumWrapper<TrashFileRestoredTypeField>(type);
×
576
      return this;
×
577
    }
578

579
    public Builder type(EnumWrapper<TrashFileRestoredTypeField> type) {
580
      this.type = type;
×
581
      return this;
×
582
    }
583

584
    public Builder name(String name) {
585
      this.name = name;
×
586
      return this;
×
587
    }
588

589
    public Builder fileVersion(FileVersionMini fileVersion) {
590
      this.fileVersion = fileVersion;
×
591
      return this;
×
592
    }
593

594
    public Builder trashedAt(String trashedAt) {
595
      this.trashedAt = trashedAt;
×
596
      this.markNullableFieldAsSet("trashed_at");
×
597
      return this;
×
598
    }
599

600
    public Builder purgedAt(String purgedAt) {
601
      this.purgedAt = purgedAt;
×
602
      this.markNullableFieldAsSet("purged_at");
×
603
      return this;
×
604
    }
605

606
    public Builder contentCreatedAt(OffsetDateTime contentCreatedAt) {
607
      this.contentCreatedAt = contentCreatedAt;
×
608
      this.markNullableFieldAsSet("content_created_at");
×
609
      return this;
×
610
    }
611

612
    public Builder contentModifiedAt(OffsetDateTime contentModifiedAt) {
613
      this.contentModifiedAt = contentModifiedAt;
×
614
      this.markNullableFieldAsSet("content_modified_at");
×
615
      return this;
×
616
    }
617

618
    public Builder createdBy(UserMini createdBy) {
619
      this.createdBy = createdBy;
×
620
      return this;
×
621
    }
622

623
    public Builder sharedLink(String sharedLink) {
624
      this.sharedLink = sharedLink;
×
625
      this.markNullableFieldAsSet("shared_link");
×
626
      return this;
×
627
    }
628

629
    public Builder parent(FolderMini parent) {
630
      this.parent = parent;
×
631
      return this;
×
632
    }
633

634
    public TrashFileRestored build() {
635
      return new TrashFileRestored(this);
×
636
    }
637
  }
638
}
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