• 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

8.86
/src/main/java/com/box/sdkgen/schemas/trashfolder/TrashFolder.java
1
package com.box.sdkgen.schemas.trashfolder;
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.foldermini.FolderMini;
8
import com.box.sdkgen.schemas.usermini.UserMini;
9
import com.box.sdkgen.serialization.json.EnumWrapper;
10
import com.fasterxml.jackson.annotation.JsonFilter;
11
import com.fasterxml.jackson.annotation.JsonProperty;
12
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
13
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
14
import java.time.OffsetDateTime;
15
import java.util.Objects;
16

17
/** Represents a trashed folder. */
18
@JsonFilter("nullablePropertyFilter")
19
public class TrashFolder extends SerializableObject {
20

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

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

37
  /** The value will always be `folder`. */
38
  @JsonDeserialize(using = TrashFolderTypeField.TrashFolderTypeFieldDeserializer.class)
39
  @JsonSerialize(using = TrashFolderTypeField.TrashFolderTypeFieldSerializer.class)
40
  protected EnumWrapper<TrashFolderTypeField> type;
41

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

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

48
  /**
49
   * The date and time when the folder was created. This value may be `null` for some folders such
50
   * as the root folder or the trash folder.
51
   */
52
  @JsonProperty("created_at")
53
  @JsonSerialize(using = DateTimeUtils.DateTimeSerializer.class)
54
  @JsonDeserialize(using = DateTimeUtils.DateTimeDeserializer.class)
55
  @Nullable
56
  protected OffsetDateTime createdAt;
57

58
  /**
59
   * The date and time when the folder was last updated. This value may be `null` for some folders
60
   * such as the root folder or the trash folder.
61
   */
62
  @JsonProperty("modified_at")
63
  @JsonSerialize(using = DateTimeUtils.DateTimeSerializer.class)
64
  @JsonDeserialize(using = DateTimeUtils.DateTimeDeserializer.class)
65
  @Nullable
66
  protected OffsetDateTime modifiedAt;
67

68
  protected final String description;
69

70
  /**
71
   * The folder size in bytes.
72
   *
73
   * <p>Be careful parsing this integer as its value can get very large.
74
   */
75
  protected final long size;
76

77
  @JsonProperty("path_collection")
78
  protected final TrashFolderPathCollectionField pathCollection;
79

80
  @JsonProperty("created_by")
81
  protected final UserMini createdBy;
82

83
  @JsonProperty("modified_by")
84
  protected final UserMini modifiedBy;
85

86
  /** The time at which this folder was put in the trash. */
87
  @JsonProperty("trashed_at")
88
  @JsonSerialize(using = DateTimeUtils.DateTimeSerializer.class)
89
  @JsonDeserialize(using = DateTimeUtils.DateTimeDeserializer.class)
90
  @Nullable
91
  protected OffsetDateTime trashedAt;
92

93
  /** The time at which this folder is expected to be purged from the trash. */
94
  @JsonProperty("purged_at")
95
  @JsonSerialize(using = DateTimeUtils.DateTimeSerializer.class)
96
  @JsonDeserialize(using = DateTimeUtils.DateTimeDeserializer.class)
97
  @Nullable
98
  protected OffsetDateTime purgedAt;
99

100
  /** The date and time at which this folder was originally created. */
101
  @JsonProperty("content_created_at")
102
  @JsonSerialize(using = DateTimeUtils.DateTimeSerializer.class)
103
  @JsonDeserialize(using = DateTimeUtils.DateTimeDeserializer.class)
104
  @Nullable
105
  protected OffsetDateTime contentCreatedAt;
106

107
  /** The date and time at which this folder was last updated. */
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("owned_by")
115
  protected final UserMini ownedBy;
116

117
  /**
118
   * The shared link for this folder. This will be `null` if a folder has been trashed, since the
119
   * link will no longer be active.
120
   */
121
  @JsonProperty("shared_link")
122
  @Nullable
123
  protected String sharedLink;
124

125
  /**
126
   * The folder upload email for this folder. This will be `null` if a folder has been trashed,
127
   * since the upload will no longer work.
128
   */
129
  @JsonProperty("folder_upload_email")
130
  @Nullable
131
  protected String folderUploadEmail;
132

133
  protected FolderMini parent;
134

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

146
  public TrashFolder(
147
      String id,
148
      String name,
149
      String description,
150
      long size,
151
      TrashFolderPathCollectionField pathCollection,
152
      UserMini createdBy,
153
      UserMini modifiedBy,
154
      UserMini ownedBy,
155
      TrashFolderItemStatusField itemStatus) {
156
    super();
×
157
    this.id = id;
×
158
    this.name = name;
×
159
    this.description = description;
×
160
    this.size = size;
×
161
    this.pathCollection = pathCollection;
×
162
    this.createdBy = createdBy;
×
163
    this.modifiedBy = modifiedBy;
×
164
    this.ownedBy = ownedBy;
×
165
    this.itemStatus = new EnumWrapper<TrashFolderItemStatusField>(itemStatus);
×
166
    this.type = new EnumWrapper<TrashFolderTypeField>(TrashFolderTypeField.FOLDER);
×
167
  }
×
168

169
  public TrashFolder(
170
      @JsonProperty("id") String id,
171
      @JsonProperty("name") String name,
172
      @JsonProperty("description") String description,
173
      @JsonProperty("size") long size,
174
      @JsonProperty("path_collection") TrashFolderPathCollectionField pathCollection,
175
      @JsonProperty("created_by") UserMini createdBy,
176
      @JsonProperty("modified_by") UserMini modifiedBy,
177
      @JsonProperty("owned_by") UserMini ownedBy,
178
      @JsonProperty("item_status") EnumWrapper<TrashFolderItemStatusField> itemStatus) {
179
    super();
1✔
180
    this.id = id;
1✔
181
    this.name = name;
1✔
182
    this.description = description;
1✔
183
    this.size = size;
1✔
184
    this.pathCollection = pathCollection;
1✔
185
    this.createdBy = createdBy;
1✔
186
    this.modifiedBy = modifiedBy;
1✔
187
    this.ownedBy = ownedBy;
1✔
188
    this.itemStatus = itemStatus;
1✔
189
    this.type = new EnumWrapper<TrashFolderTypeField>(TrashFolderTypeField.FOLDER);
1✔
190
  }
1✔
191

192
  protected TrashFolder(Builder builder) {
193
    super();
×
194
    this.id = builder.id;
×
195
    this.etag = builder.etag;
×
196
    this.type = builder.type;
×
197
    this.sequenceId = builder.sequenceId;
×
198
    this.name = builder.name;
×
199
    this.createdAt = builder.createdAt;
×
200
    this.modifiedAt = builder.modifiedAt;
×
201
    this.description = builder.description;
×
202
    this.size = builder.size;
×
203
    this.pathCollection = builder.pathCollection;
×
204
    this.createdBy = builder.createdBy;
×
205
    this.modifiedBy = builder.modifiedBy;
×
206
    this.trashedAt = builder.trashedAt;
×
207
    this.purgedAt = builder.purgedAt;
×
208
    this.contentCreatedAt = builder.contentCreatedAt;
×
209
    this.contentModifiedAt = builder.contentModifiedAt;
×
210
    this.ownedBy = builder.ownedBy;
×
211
    this.sharedLink = builder.sharedLink;
×
212
    this.folderUploadEmail = builder.folderUploadEmail;
×
213
    this.parent = builder.parent;
×
214
    this.itemStatus = builder.itemStatus;
×
215
    markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
×
216
  }
×
217

218
  public String getId() {
219
    return id;
1✔
220
  }
221

222
  public String getEtag() {
223
    return etag;
×
224
  }
225

226
  public EnumWrapper<TrashFolderTypeField> getType() {
227
    return type;
×
228
  }
229

230
  public String getSequenceId() {
231
    return sequenceId;
×
232
  }
233

234
  public String getName() {
235
    return name;
1✔
236
  }
237

238
  public OffsetDateTime getCreatedAt() {
239
    return createdAt;
×
240
  }
241

242
  public OffsetDateTime getModifiedAt() {
243
    return modifiedAt;
×
244
  }
245

246
  public String getDescription() {
247
    return description;
×
248
  }
249

250
  public long getSize() {
251
    return size;
×
252
  }
253

254
  public TrashFolderPathCollectionField getPathCollection() {
255
    return pathCollection;
×
256
  }
257

258
  public UserMini getCreatedBy() {
259
    return createdBy;
×
260
  }
261

262
  public UserMini getModifiedBy() {
263
    return modifiedBy;
×
264
  }
265

266
  public OffsetDateTime getTrashedAt() {
267
    return trashedAt;
×
268
  }
269

270
  public OffsetDateTime getPurgedAt() {
271
    return purgedAt;
×
272
  }
273

274
  public OffsetDateTime getContentCreatedAt() {
275
    return contentCreatedAt;
×
276
  }
277

278
  public OffsetDateTime getContentModifiedAt() {
279
    return contentModifiedAt;
×
280
  }
281

282
  public UserMini getOwnedBy() {
283
    return ownedBy;
×
284
  }
285

286
  public String getSharedLink() {
287
    return sharedLink;
×
288
  }
289

290
  public String getFolderUploadEmail() {
291
    return folderUploadEmail;
×
292
  }
293

294
  public FolderMini getParent() {
295
    return parent;
×
296
  }
297

298
  public EnumWrapper<TrashFolderItemStatusField> getItemStatus() {
299
    return itemStatus;
×
300
  }
301

302
  @Override
303
  public boolean equals(Object o) {
304
    if (this == o) {
×
305
      return true;
×
306
    }
307
    if (o == null || getClass() != o.getClass()) {
×
308
      return false;
×
309
    }
310
    TrashFolder casted = (TrashFolder) o;
×
311
    return Objects.equals(id, casted.id)
×
312
        && Objects.equals(etag, casted.etag)
×
313
        && Objects.equals(type, casted.type)
×
314
        && Objects.equals(sequenceId, casted.sequenceId)
×
315
        && Objects.equals(name, casted.name)
×
316
        && Objects.equals(createdAt, casted.createdAt)
×
317
        && Objects.equals(modifiedAt, casted.modifiedAt)
×
318
        && Objects.equals(description, casted.description)
×
319
        && Objects.equals(size, casted.size)
×
320
        && Objects.equals(pathCollection, casted.pathCollection)
×
321
        && Objects.equals(createdBy, casted.createdBy)
×
322
        && Objects.equals(modifiedBy, casted.modifiedBy)
×
323
        && Objects.equals(trashedAt, casted.trashedAt)
×
324
        && Objects.equals(purgedAt, casted.purgedAt)
×
325
        && Objects.equals(contentCreatedAt, casted.contentCreatedAt)
×
326
        && Objects.equals(contentModifiedAt, casted.contentModifiedAt)
×
327
        && Objects.equals(ownedBy, casted.ownedBy)
×
328
        && Objects.equals(sharedLink, casted.sharedLink)
×
329
        && Objects.equals(folderUploadEmail, casted.folderUploadEmail)
×
330
        && Objects.equals(parent, casted.parent)
×
331
        && Objects.equals(itemStatus, casted.itemStatus);
×
332
  }
333

334
  @Override
335
  public int hashCode() {
336
    return Objects.hash(
×
337
        id,
338
        etag,
339
        type,
340
        sequenceId,
341
        name,
342
        createdAt,
343
        modifiedAt,
344
        description,
345
        size,
×
346
        pathCollection,
347
        createdBy,
348
        modifiedBy,
349
        trashedAt,
350
        purgedAt,
351
        contentCreatedAt,
352
        contentModifiedAt,
353
        ownedBy,
354
        sharedLink,
355
        folderUploadEmail,
356
        parent,
357
        itemStatus);
358
  }
359

360
  @Override
361
  public String toString() {
362
    return "TrashFolder{"
×
363
        + "id='"
364
        + id
365
        + '\''
366
        + ", "
367
        + "etag='"
368
        + etag
369
        + '\''
370
        + ", "
371
        + "type='"
372
        + type
373
        + '\''
374
        + ", "
375
        + "sequenceId='"
376
        + sequenceId
377
        + '\''
378
        + ", "
379
        + "name='"
380
        + name
381
        + '\''
382
        + ", "
383
        + "createdAt='"
384
        + createdAt
385
        + '\''
386
        + ", "
387
        + "modifiedAt='"
388
        + modifiedAt
389
        + '\''
390
        + ", "
391
        + "description='"
392
        + description
393
        + '\''
394
        + ", "
395
        + "size='"
396
        + size
397
        + '\''
398
        + ", "
399
        + "pathCollection='"
400
        + pathCollection
401
        + '\''
402
        + ", "
403
        + "createdBy='"
404
        + createdBy
405
        + '\''
406
        + ", "
407
        + "modifiedBy='"
408
        + modifiedBy
409
        + '\''
410
        + ", "
411
        + "trashedAt='"
412
        + trashedAt
413
        + '\''
414
        + ", "
415
        + "purgedAt='"
416
        + purgedAt
417
        + '\''
418
        + ", "
419
        + "contentCreatedAt='"
420
        + contentCreatedAt
421
        + '\''
422
        + ", "
423
        + "contentModifiedAt='"
424
        + contentModifiedAt
425
        + '\''
426
        + ", "
427
        + "ownedBy='"
428
        + ownedBy
429
        + '\''
430
        + ", "
431
        + "sharedLink='"
432
        + sharedLink
433
        + '\''
434
        + ", "
435
        + "folderUploadEmail='"
436
        + folderUploadEmail
437
        + '\''
438
        + ", "
439
        + "parent='"
440
        + parent
441
        + '\''
442
        + ", "
443
        + "itemStatus='"
444
        + itemStatus
445
        + '\''
446
        + "}";
447
  }
448

449
  public static class Builder extends NullableFieldTracker {
450

451
    protected final String id;
452

453
    protected String etag;
454

455
    protected EnumWrapper<TrashFolderTypeField> type;
456

457
    protected String sequenceId;
458

459
    protected final String name;
460

461
    protected OffsetDateTime createdAt;
462

463
    protected OffsetDateTime modifiedAt;
464

465
    protected final String description;
466

467
    protected final long size;
468

469
    protected final TrashFolderPathCollectionField pathCollection;
470

471
    protected final UserMini createdBy;
472

473
    protected final UserMini modifiedBy;
474

475
    protected OffsetDateTime trashedAt;
476

477
    protected OffsetDateTime purgedAt;
478

479
    protected OffsetDateTime contentCreatedAt;
480

481
    protected OffsetDateTime contentModifiedAt;
482

483
    protected final UserMini ownedBy;
484

485
    protected String sharedLink;
486

487
    protected String folderUploadEmail;
488

489
    protected FolderMini parent;
490

491
    protected final EnumWrapper<TrashFolderItemStatusField> itemStatus;
492

493
    public Builder(
494
        String id,
495
        String name,
496
        String description,
497
        long size,
498
        TrashFolderPathCollectionField pathCollection,
499
        UserMini createdBy,
500
        UserMini modifiedBy,
501
        UserMini ownedBy,
502
        TrashFolderItemStatusField itemStatus) {
503
      super();
×
504
      this.id = id;
×
505
      this.name = name;
×
506
      this.description = description;
×
507
      this.size = size;
×
508
      this.pathCollection = pathCollection;
×
509
      this.createdBy = createdBy;
×
510
      this.modifiedBy = modifiedBy;
×
511
      this.ownedBy = ownedBy;
×
512
      this.itemStatus = new EnumWrapper<TrashFolderItemStatusField>(itemStatus);
×
513
      this.type = new EnumWrapper<TrashFolderTypeField>(TrashFolderTypeField.FOLDER);
×
514
    }
×
515

516
    public Builder(
517
        String id,
518
        String name,
519
        String description,
520
        long size,
521
        TrashFolderPathCollectionField pathCollection,
522
        UserMini createdBy,
523
        UserMini modifiedBy,
524
        UserMini ownedBy,
525
        EnumWrapper<TrashFolderItemStatusField> itemStatus) {
526
      super();
×
527
      this.id = id;
×
528
      this.name = name;
×
529
      this.description = description;
×
530
      this.size = size;
×
531
      this.pathCollection = pathCollection;
×
532
      this.createdBy = createdBy;
×
533
      this.modifiedBy = modifiedBy;
×
534
      this.ownedBy = ownedBy;
×
535
      this.itemStatus = itemStatus;
×
536
      this.type = new EnumWrapper<TrashFolderTypeField>(TrashFolderTypeField.FOLDER);
×
537
    }
×
538

539
    public Builder etag(String etag) {
540
      this.etag = etag;
×
541
      this.markNullableFieldAsSet("etag");
×
542
      return this;
×
543
    }
544

545
    public Builder type(TrashFolderTypeField type) {
546
      this.type = new EnumWrapper<TrashFolderTypeField>(type);
×
547
      return this;
×
548
    }
549

550
    public Builder type(EnumWrapper<TrashFolderTypeField> type) {
551
      this.type = type;
×
552
      return this;
×
553
    }
554

555
    public Builder sequenceId(String sequenceId) {
556
      this.sequenceId = sequenceId;
×
557
      return this;
×
558
    }
559

560
    public Builder createdAt(OffsetDateTime createdAt) {
561
      this.createdAt = createdAt;
×
562
      this.markNullableFieldAsSet("created_at");
×
563
      return this;
×
564
    }
565

566
    public Builder modifiedAt(OffsetDateTime modifiedAt) {
567
      this.modifiedAt = modifiedAt;
×
568
      this.markNullableFieldAsSet("modified_at");
×
569
      return this;
×
570
    }
571

572
    public Builder trashedAt(OffsetDateTime trashedAt) {
573
      this.trashedAt = trashedAt;
×
574
      this.markNullableFieldAsSet("trashed_at");
×
575
      return this;
×
576
    }
577

578
    public Builder purgedAt(OffsetDateTime purgedAt) {
579
      this.purgedAt = purgedAt;
×
580
      this.markNullableFieldAsSet("purged_at");
×
581
      return this;
×
582
    }
583

584
    public Builder contentCreatedAt(OffsetDateTime contentCreatedAt) {
585
      this.contentCreatedAt = contentCreatedAt;
×
586
      this.markNullableFieldAsSet("content_created_at");
×
587
      return this;
×
588
    }
589

590
    public Builder contentModifiedAt(OffsetDateTime contentModifiedAt) {
591
      this.contentModifiedAt = contentModifiedAt;
×
592
      this.markNullableFieldAsSet("content_modified_at");
×
593
      return this;
×
594
    }
595

596
    public Builder sharedLink(String sharedLink) {
597
      this.sharedLink = sharedLink;
×
598
      this.markNullableFieldAsSet("shared_link");
×
599
      return this;
×
600
    }
601

602
    public Builder folderUploadEmail(String folderUploadEmail) {
603
      this.folderUploadEmail = folderUploadEmail;
×
604
      this.markNullableFieldAsSet("folder_upload_email");
×
605
      return this;
×
606
    }
607

608
    public Builder parent(FolderMini parent) {
609
      this.parent = parent;
×
610
      return this;
×
611
    }
612

613
    public TrashFolder build() {
614
      return new TrashFolder(this);
×
615
    }
616
  }
617
}
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