• 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

12.24
/src/main/java/com/box/sdkgen/schemas/filerequest/FileRequest.java
1
package com.box.sdkgen.schemas.filerequest;
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
/**
18
 * A standard representation of a file request, as returned from any file request API endpoints by
19
 * default.
20
 */
21
@JsonFilter("nullablePropertyFilter")
22
public class FileRequest extends SerializableObject {
23

24
  /** The unique identifier for this file request. */
25
  protected final String id;
26

27
  /** The value will always be `file_request`. */
28
  @JsonDeserialize(using = FileRequestTypeField.FileRequestTypeFieldDeserializer.class)
29
  @JsonSerialize(using = FileRequestTypeField.FileRequestTypeFieldSerializer.class)
30
  protected EnumWrapper<FileRequestTypeField> type;
31

32
  /**
33
   * The title of file request. This is shown in the Box UI to users uploading files.
34
   *
35
   * <p>This defaults to title of the file request that was copied to create this file request.
36
   */
37
  protected String title;
38

39
  /**
40
   * The optional description of this file request. This is shown in the Box UI to users uploading
41
   * files.
42
   *
43
   * <p>This defaults to description of the file request that was copied to create this file
44
   * request.
45
   */
46
  @Nullable protected String description;
47

48
  /**
49
   * The status of the file request. This defaults to `active`.
50
   *
51
   * <p>When the status is set to `inactive`, the file request will no longer accept new
52
   * submissions, and any visitor to the file request URL will receive a `HTTP 404` status code.
53
   *
54
   * <p>This defaults to status of file request that was copied to create this file request.
55
   */
56
  @JsonDeserialize(using = FileRequestStatusField.FileRequestStatusFieldDeserializer.class)
57
  @JsonSerialize(using = FileRequestStatusField.FileRequestStatusFieldSerializer.class)
58
  protected EnumWrapper<FileRequestStatusField> status;
59

60
  /**
61
   * Whether a file request submitter is required to provide their email address.
62
   *
63
   * <p>When this setting is set to true, the Box UI will show an email field on the file request
64
   * form.
65
   *
66
   * <p>This defaults to setting of file request that was copied to create this file request.
67
   */
68
  @JsonProperty("is_email_required")
69
  protected Boolean isEmailRequired;
70

71
  /**
72
   * Whether a file request submitter is required to provide a description of the files they are
73
   * submitting.
74
   *
75
   * <p>When this setting is set to true, the Box UI will show a description field on the file
76
   * request form.
77
   *
78
   * <p>This defaults to setting of file request that was copied to create this file request.
79
   */
80
  @JsonProperty("is_description_required")
81
  protected Boolean isDescriptionRequired;
82

83
  /**
84
   * The date after which a file request will no longer accept new submissions.
85
   *
86
   * <p>After this date, the `status` will automatically be set to `inactive`.
87
   */
88
  @JsonProperty("expires_at")
89
  @JsonSerialize(using = DateTimeUtils.DateTimeSerializer.class)
90
  @JsonDeserialize(using = DateTimeUtils.DateTimeDeserializer.class)
91
  protected OffsetDateTime expiresAt;
92

93
  protected final FolderMini folder;
94

95
  /**
96
   * The generated URL for this file request. This URL can be shared with users to let them upload
97
   * files to the associated folder.
98
   */
99
  protected String url;
100

101
  /**
102
   * The HTTP `etag` of this file. This can be used in combination with the `If-Match` header when
103
   * updating a file request. By providing that header, a change will only be performed on the file
104
   * request if the `etag` on the file request still matches the `etag` provided in the `If-Match`
105
   * header.
106
   */
107
  @Nullable protected String etag;
108

109
  @JsonProperty("created_by")
110
  protected UserMini createdBy;
111

112
  /** The date and time when the file request was created. */
113
  @JsonProperty("created_at")
114
  @JsonSerialize(using = DateTimeUtils.DateTimeSerializer.class)
115
  @JsonDeserialize(using = DateTimeUtils.DateTimeDeserializer.class)
116
  protected final OffsetDateTime createdAt;
117

118
  @JsonProperty("updated_by")
119
  protected UserMini updatedBy;
120

121
  /** The date and time when the file request was last updated. */
122
  @JsonProperty("updated_at")
123
  @JsonSerialize(using = DateTimeUtils.DateTimeSerializer.class)
124
  @JsonDeserialize(using = DateTimeUtils.DateTimeDeserializer.class)
125
  protected final OffsetDateTime updatedAt;
126

127
  public FileRequest(
128
      @JsonProperty("id") String id,
129
      @JsonProperty("folder") FolderMini folder,
130
      @JsonProperty("created_at") OffsetDateTime createdAt,
131
      @JsonProperty("updated_at") OffsetDateTime updatedAt) {
132
    super();
1✔
133
    this.id = id;
1✔
134
    this.folder = folder;
1✔
135
    this.createdAt = createdAt;
1✔
136
    this.updatedAt = updatedAt;
1✔
137
    this.type = new EnumWrapper<FileRequestTypeField>(FileRequestTypeField.FILE_REQUEST);
1✔
138
  }
1✔
139

140
  protected FileRequest(Builder builder) {
141
    super();
×
142
    this.id = builder.id;
×
143
    this.type = builder.type;
×
144
    this.title = builder.title;
×
145
    this.description = builder.description;
×
146
    this.status = builder.status;
×
147
    this.isEmailRequired = builder.isEmailRequired;
×
148
    this.isDescriptionRequired = builder.isDescriptionRequired;
×
149
    this.expiresAt = builder.expiresAt;
×
150
    this.folder = builder.folder;
×
151
    this.url = builder.url;
×
152
    this.etag = builder.etag;
×
153
    this.createdBy = builder.createdBy;
×
154
    this.createdAt = builder.createdAt;
×
155
    this.updatedBy = builder.updatedBy;
×
156
    this.updatedAt = builder.updatedAt;
×
157
    markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
×
158
  }
×
159

160
  public String getId() {
161
    return id;
1✔
162
  }
163

164
  public EnumWrapper<FileRequestTypeField> getType() {
165
    return type;
1✔
166
  }
167

168
  public String getTitle() {
169
    return title;
1✔
170
  }
171

172
  public String getDescription() {
173
    return description;
1✔
174
  }
175

176
  public EnumWrapper<FileRequestStatusField> getStatus() {
177
    return status;
×
178
  }
179

180
  public Boolean getIsEmailRequired() {
181
    return isEmailRequired;
×
182
  }
183

184
  public Boolean getIsDescriptionRequired() {
185
    return isDescriptionRequired;
×
186
  }
187

188
  public OffsetDateTime getExpiresAt() {
189
    return expiresAt;
×
190
  }
191

192
  public FolderMini getFolder() {
193
    return folder;
1✔
194
  }
195

196
  public String getUrl() {
197
    return url;
×
198
  }
199

200
  public String getEtag() {
201
    return etag;
×
202
  }
203

204
  public UserMini getCreatedBy() {
205
    return createdBy;
×
206
  }
207

208
  public OffsetDateTime getCreatedAt() {
209
    return createdAt;
×
210
  }
211

212
  public UserMini getUpdatedBy() {
213
    return updatedBy;
×
214
  }
215

216
  public OffsetDateTime getUpdatedAt() {
217
    return updatedAt;
×
218
  }
219

220
  @Override
221
  public boolean equals(Object o) {
222
    if (this == o) {
×
223
      return true;
×
224
    }
225
    if (o == null || getClass() != o.getClass()) {
×
226
      return false;
×
227
    }
228
    FileRequest casted = (FileRequest) o;
×
229
    return Objects.equals(id, casted.id)
×
230
        && Objects.equals(type, casted.type)
×
231
        && Objects.equals(title, casted.title)
×
232
        && Objects.equals(description, casted.description)
×
233
        && Objects.equals(status, casted.status)
×
234
        && Objects.equals(isEmailRequired, casted.isEmailRequired)
×
235
        && Objects.equals(isDescriptionRequired, casted.isDescriptionRequired)
×
236
        && Objects.equals(expiresAt, casted.expiresAt)
×
237
        && Objects.equals(folder, casted.folder)
×
238
        && Objects.equals(url, casted.url)
×
239
        && Objects.equals(etag, casted.etag)
×
240
        && Objects.equals(createdBy, casted.createdBy)
×
241
        && Objects.equals(createdAt, casted.createdAt)
×
242
        && Objects.equals(updatedBy, casted.updatedBy)
×
243
        && Objects.equals(updatedAt, casted.updatedAt);
×
244
  }
245

246
  @Override
247
  public int hashCode() {
248
    return Objects.hash(
×
249
        id,
250
        type,
251
        title,
252
        description,
253
        status,
254
        isEmailRequired,
255
        isDescriptionRequired,
256
        expiresAt,
257
        folder,
258
        url,
259
        etag,
260
        createdBy,
261
        createdAt,
262
        updatedBy,
263
        updatedAt);
264
  }
265

266
  @Override
267
  public String toString() {
268
    return "FileRequest{"
×
269
        + "id='"
270
        + id
271
        + '\''
272
        + ", "
273
        + "type='"
274
        + type
275
        + '\''
276
        + ", "
277
        + "title='"
278
        + title
279
        + '\''
280
        + ", "
281
        + "description='"
282
        + description
283
        + '\''
284
        + ", "
285
        + "status='"
286
        + status
287
        + '\''
288
        + ", "
289
        + "isEmailRequired='"
290
        + isEmailRequired
291
        + '\''
292
        + ", "
293
        + "isDescriptionRequired='"
294
        + isDescriptionRequired
295
        + '\''
296
        + ", "
297
        + "expiresAt='"
298
        + expiresAt
299
        + '\''
300
        + ", "
301
        + "folder='"
302
        + folder
303
        + '\''
304
        + ", "
305
        + "url='"
306
        + url
307
        + '\''
308
        + ", "
309
        + "etag='"
310
        + etag
311
        + '\''
312
        + ", "
313
        + "createdBy='"
314
        + createdBy
315
        + '\''
316
        + ", "
317
        + "createdAt='"
318
        + createdAt
319
        + '\''
320
        + ", "
321
        + "updatedBy='"
322
        + updatedBy
323
        + '\''
324
        + ", "
325
        + "updatedAt='"
326
        + updatedAt
327
        + '\''
328
        + "}";
329
  }
330

331
  public static class Builder extends NullableFieldTracker {
332

333
    protected final String id;
334

335
    protected EnumWrapper<FileRequestTypeField> type;
336

337
    protected String title;
338

339
    protected String description;
340

341
    protected EnumWrapper<FileRequestStatusField> status;
342

343
    protected Boolean isEmailRequired;
344

345
    protected Boolean isDescriptionRequired;
346

347
    protected OffsetDateTime expiresAt;
348

349
    protected final FolderMini folder;
350

351
    protected String url;
352

353
    protected String etag;
354

355
    protected UserMini createdBy;
356

357
    protected final OffsetDateTime createdAt;
358

359
    protected UserMini updatedBy;
360

361
    protected final OffsetDateTime updatedAt;
362

363
    public Builder(
364
        String id, FolderMini folder, OffsetDateTime createdAt, OffsetDateTime updatedAt) {
365
      super();
×
366
      this.id = id;
×
367
      this.folder = folder;
×
368
      this.createdAt = createdAt;
×
369
      this.updatedAt = updatedAt;
×
370
      this.type = new EnumWrapper<FileRequestTypeField>(FileRequestTypeField.FILE_REQUEST);
×
371
    }
×
372

373
    public Builder type(FileRequestTypeField type) {
374
      this.type = new EnumWrapper<FileRequestTypeField>(type);
×
375
      return this;
×
376
    }
377

378
    public Builder type(EnumWrapper<FileRequestTypeField> type) {
379
      this.type = type;
×
380
      return this;
×
381
    }
382

383
    public Builder title(String title) {
384
      this.title = title;
×
385
      return this;
×
386
    }
387

388
    public Builder description(String description) {
389
      this.description = description;
×
390
      this.markNullableFieldAsSet("description");
×
391
      return this;
×
392
    }
393

394
    public Builder status(FileRequestStatusField status) {
395
      this.status = new EnumWrapper<FileRequestStatusField>(status);
×
396
      return this;
×
397
    }
398

399
    public Builder status(EnumWrapper<FileRequestStatusField> status) {
400
      this.status = status;
×
401
      return this;
×
402
    }
403

404
    public Builder isEmailRequired(Boolean isEmailRequired) {
405
      this.isEmailRequired = isEmailRequired;
×
406
      return this;
×
407
    }
408

409
    public Builder isDescriptionRequired(Boolean isDescriptionRequired) {
410
      this.isDescriptionRequired = isDescriptionRequired;
×
411
      return this;
×
412
    }
413

414
    public Builder expiresAt(OffsetDateTime expiresAt) {
415
      this.expiresAt = expiresAt;
×
416
      return this;
×
417
    }
418

419
    public Builder url(String url) {
420
      this.url = url;
×
421
      return this;
×
422
    }
423

424
    public Builder etag(String etag) {
425
      this.etag = etag;
×
426
      this.markNullableFieldAsSet("etag");
×
427
      return this;
×
428
    }
429

430
    public Builder createdBy(UserMini createdBy) {
431
      this.createdBy = createdBy;
×
432
      return this;
×
433
    }
434

435
    public Builder updatedBy(UserMini updatedBy) {
436
      this.updatedBy = updatedBy;
×
437
      return this;
×
438
    }
439

440
    public FileRequest build() {
441
      return new FileRequest(this);
×
442
    }
443
  }
444
}
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