• 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

5.67
/src/main/java/com/box/sdkgen/schemas/signrequest/SignRequest.java
1
package com.box.sdkgen.schemas.signrequest;
2

3
import com.box.sdkgen.internal.Nullable;
4
import com.box.sdkgen.internal.utils.DateTimeUtils;
5
import com.box.sdkgen.schemas.filebase.FileBase;
6
import com.box.sdkgen.schemas.filemini.FileMini;
7
import com.box.sdkgen.schemas.foldermini.FolderMini;
8
import com.box.sdkgen.schemas.signrequestbase.SignRequestBase;
9
import com.box.sdkgen.schemas.signrequestprefilltag.SignRequestPrefillTag;
10
import com.box.sdkgen.schemas.signrequestsigner.SignRequestSigner;
11
import com.box.sdkgen.serialization.json.EnumWrapper;
12
import com.fasterxml.jackson.annotation.JsonFilter;
13
import com.fasterxml.jackson.annotation.JsonProperty;
14
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
15
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
16
import java.time.OffsetDateTime;
17
import java.util.List;
18
import java.util.Objects;
19

20
/** A Box Sign request object. */
21
@JsonFilter("nullablePropertyFilter")
22
public class SignRequest extends SignRequestBase {
23

24
  /** The value will always be `sign-request`. */
25
  @JsonDeserialize(using = SignRequestTypeField.SignRequestTypeFieldDeserializer.class)
26
  @JsonSerialize(using = SignRequestTypeField.SignRequestTypeFieldSerializer.class)
27
  protected EnumWrapper<SignRequestTypeField> type;
28

29
  /**
30
   * List of files to create a signing document from. This is currently limited to ten files. Only
31
   * the ID and type fields are required for each file.
32
   */
33
  @JsonProperty("source_files")
34
  protected List<FileBase> sourceFiles;
35

36
  /** Array of signers for the signature request. */
37
  protected List<SignRequestSigner> signers;
38

39
  /** Force a specific color for the signature (blue, black, or red). */
40
  @JsonProperty("signature_color")
41
  @Nullable
42
  protected String signatureColor;
43

44
  /** Box Sign request ID. */
45
  protected String id;
46

47
  /**
48
   * This URL is returned if `is_document_preparation_needed` is set to `true` in the request. The
49
   * parameter is used to prepare the signature request using the UI. The signature request is not
50
   * sent until the preparation phase is complete.
51
   */
52
  @JsonProperty("prepare_url")
53
  @Nullable
54
  protected String prepareUrl;
55

56
  @JsonProperty("signing_log")
57
  protected FileMini signingLog;
58

59
  /** Describes the status of the signature request. */
60
  @JsonDeserialize(using = SignRequestStatusField.SignRequestStatusFieldDeserializer.class)
61
  @JsonSerialize(using = SignRequestStatusField.SignRequestStatusFieldSerializer.class)
62
  protected EnumWrapper<SignRequestStatusField> status;
63

64
  /**
65
   * List of files that will be signed, which are copies of the original source files. A new version
66
   * of these files are created as signers sign and can be downloaded at any point in the signing
67
   * process.
68
   */
69
  @JsonProperty("sign_files")
70
  protected SignRequestSignFilesField signFiles;
71

72
  /**
73
   * Uses `days_valid` to calculate the date and time, in GMT, the sign request will expire if
74
   * unsigned.
75
   */
76
  @JsonProperty("auto_expire_at")
77
  @JsonSerialize(using = DateTimeUtils.DateTimeSerializer.class)
78
  @JsonDeserialize(using = DateTimeUtils.DateTimeDeserializer.class)
79
  @Nullable
80
  protected OffsetDateTime autoExpireAt;
81

82
  @JsonProperty("parent_folder")
83
  protected FolderMini parentFolder;
84

85
  /**
86
   * The collaborator level of the user to the sign request. Values can include "owner", "editor",
87
   * and "viewer".
88
   */
89
  @JsonProperty("collaborator_level")
90
  @Nullable
91
  protected String collaboratorLevel;
92

93
  /** The email address of the sender of the sign request. */
94
  @JsonProperty("sender_email")
95
  @Nullable
96
  protected String senderEmail;
97

98
  /** The user ID of the sender of the sign request. */
99
  @JsonProperty("sender_id")
100
  @Nullable
101
  protected Long senderId;
102

103
  public SignRequest() {
104
    super();
1✔
105
  }
1✔
106

107
  protected SignRequest(Builder builder) {
108
    super(builder);
×
109
    this.type = builder.type;
×
110
    this.sourceFiles = builder.sourceFiles;
×
111
    this.signers = builder.signers;
×
112
    this.signatureColor = builder.signatureColor;
×
113
    this.id = builder.id;
×
114
    this.prepareUrl = builder.prepareUrl;
×
115
    this.signingLog = builder.signingLog;
×
116
    this.status = builder.status;
×
117
    this.signFiles = builder.signFiles;
×
118
    this.autoExpireAt = builder.autoExpireAt;
×
119
    this.parentFolder = builder.parentFolder;
×
120
    this.collaboratorLevel = builder.collaboratorLevel;
×
121
    this.senderEmail = builder.senderEmail;
×
122
    this.senderId = builder.senderId;
×
123
    markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
×
124
  }
×
125

126
  public EnumWrapper<SignRequestTypeField> getType() {
127
    return type;
1✔
128
  }
129

130
  public List<FileBase> getSourceFiles() {
131
    return sourceFiles;
×
132
  }
133

134
  public List<SignRequestSigner> getSigners() {
135
    return signers;
1✔
136
  }
137

138
  public String getSignatureColor() {
139
    return signatureColor;
×
140
  }
141

142
  public String getId() {
143
    return id;
1✔
144
  }
145

146
  public String getPrepareUrl() {
147
    return prepareUrl;
×
148
  }
149

150
  public FileMini getSigningLog() {
151
    return signingLog;
×
152
  }
153

154
  public EnumWrapper<SignRequestStatusField> getStatus() {
155
    return status;
1✔
156
  }
157

158
  public SignRequestSignFilesField getSignFiles() {
159
    return signFiles;
1✔
160
  }
161

162
  public OffsetDateTime getAutoExpireAt() {
163
    return autoExpireAt;
×
164
  }
165

166
  public FolderMini getParentFolder() {
167
    return parentFolder;
1✔
168
  }
169

170
  public String getCollaboratorLevel() {
171
    return collaboratorLevel;
×
172
  }
173

174
  public String getSenderEmail() {
175
    return senderEmail;
×
176
  }
177

178
  public Long getSenderId() {
179
    return senderId;
×
180
  }
181

182
  @Override
183
  public boolean equals(Object o) {
184
    if (this == o) {
×
185
      return true;
×
186
    }
187
    if (o == null || getClass() != o.getClass()) {
×
188
      return false;
×
189
    }
190
    SignRequest casted = (SignRequest) o;
×
191
    return Objects.equals(isDocumentPreparationNeeded, casted.isDocumentPreparationNeeded)
×
192
        && Objects.equals(redirectUrl, casted.redirectUrl)
×
193
        && Objects.equals(declinedRedirectUrl, casted.declinedRedirectUrl)
×
194
        && Objects.equals(areTextSignaturesEnabled, casted.areTextSignaturesEnabled)
×
195
        && Objects.equals(emailSubject, casted.emailSubject)
×
196
        && Objects.equals(emailMessage, casted.emailMessage)
×
197
        && Objects.equals(areRemindersEnabled, casted.areRemindersEnabled)
×
198
        && Objects.equals(name, casted.name)
×
199
        && Objects.equals(prefillTags, casted.prefillTags)
×
200
        && Objects.equals(daysValid, casted.daysValid)
×
201
        && Objects.equals(externalId, casted.externalId)
×
202
        && Objects.equals(templateId, casted.templateId)
×
203
        && Objects.equals(externalSystemName, casted.externalSystemName)
×
204
        && Objects.equals(type, casted.type)
×
205
        && Objects.equals(sourceFiles, casted.sourceFiles)
×
206
        && Objects.equals(signers, casted.signers)
×
207
        && Objects.equals(signatureColor, casted.signatureColor)
×
208
        && Objects.equals(id, casted.id)
×
209
        && Objects.equals(prepareUrl, casted.prepareUrl)
×
210
        && Objects.equals(signingLog, casted.signingLog)
×
211
        && Objects.equals(status, casted.status)
×
212
        && Objects.equals(signFiles, casted.signFiles)
×
213
        && Objects.equals(autoExpireAt, casted.autoExpireAt)
×
214
        && Objects.equals(parentFolder, casted.parentFolder)
×
215
        && Objects.equals(collaboratorLevel, casted.collaboratorLevel)
×
216
        && Objects.equals(senderEmail, casted.senderEmail)
×
217
        && Objects.equals(senderId, casted.senderId);
×
218
  }
219

220
  @Override
221
  public int hashCode() {
222
    return Objects.hash(
×
223
        isDocumentPreparationNeeded,
224
        redirectUrl,
225
        declinedRedirectUrl,
226
        areTextSignaturesEnabled,
227
        emailSubject,
228
        emailMessage,
229
        areRemindersEnabled,
230
        name,
231
        prefillTags,
232
        daysValid,
233
        externalId,
234
        templateId,
235
        externalSystemName,
236
        type,
237
        sourceFiles,
238
        signers,
239
        signatureColor,
240
        id,
241
        prepareUrl,
242
        signingLog,
243
        status,
244
        signFiles,
245
        autoExpireAt,
246
        parentFolder,
247
        collaboratorLevel,
248
        senderEmail,
249
        senderId);
250
  }
251

252
  @Override
253
  public String toString() {
254
    return "SignRequest{"
×
255
        + "isDocumentPreparationNeeded='"
256
        + isDocumentPreparationNeeded
257
        + '\''
258
        + ", "
259
        + "redirectUrl='"
260
        + redirectUrl
261
        + '\''
262
        + ", "
263
        + "declinedRedirectUrl='"
264
        + declinedRedirectUrl
265
        + '\''
266
        + ", "
267
        + "areTextSignaturesEnabled='"
268
        + areTextSignaturesEnabled
269
        + '\''
270
        + ", "
271
        + "emailSubject='"
272
        + emailSubject
273
        + '\''
274
        + ", "
275
        + "emailMessage='"
276
        + emailMessage
277
        + '\''
278
        + ", "
279
        + "areRemindersEnabled='"
280
        + areRemindersEnabled
281
        + '\''
282
        + ", "
283
        + "name='"
284
        + name
285
        + '\''
286
        + ", "
287
        + "prefillTags='"
288
        + prefillTags
289
        + '\''
290
        + ", "
291
        + "daysValid='"
292
        + daysValid
293
        + '\''
294
        + ", "
295
        + "externalId='"
296
        + externalId
297
        + '\''
298
        + ", "
299
        + "templateId='"
300
        + templateId
301
        + '\''
302
        + ", "
303
        + "externalSystemName='"
304
        + externalSystemName
305
        + '\''
306
        + ", "
307
        + "type='"
308
        + type
309
        + '\''
310
        + ", "
311
        + "sourceFiles='"
312
        + sourceFiles
313
        + '\''
314
        + ", "
315
        + "signers='"
316
        + signers
317
        + '\''
318
        + ", "
319
        + "signatureColor='"
320
        + signatureColor
321
        + '\''
322
        + ", "
323
        + "id='"
324
        + id
325
        + '\''
326
        + ", "
327
        + "prepareUrl='"
328
        + prepareUrl
329
        + '\''
330
        + ", "
331
        + "signingLog='"
332
        + signingLog
333
        + '\''
334
        + ", "
335
        + "status='"
336
        + status
337
        + '\''
338
        + ", "
339
        + "signFiles='"
340
        + signFiles
341
        + '\''
342
        + ", "
343
        + "autoExpireAt='"
344
        + autoExpireAt
345
        + '\''
346
        + ", "
347
        + "parentFolder='"
348
        + parentFolder
349
        + '\''
350
        + ", "
351
        + "collaboratorLevel='"
352
        + collaboratorLevel
353
        + '\''
354
        + ", "
355
        + "senderEmail='"
356
        + senderEmail
357
        + '\''
358
        + ", "
359
        + "senderId='"
360
        + senderId
361
        + '\''
362
        + "}";
363
  }
364

365
  public static class Builder extends SignRequestBase.Builder {
×
366

367
    protected EnumWrapper<SignRequestTypeField> type;
368

369
    protected List<FileBase> sourceFiles;
370

371
    protected List<SignRequestSigner> signers;
372

373
    protected String signatureColor;
374

375
    protected String id;
376

377
    protected String prepareUrl;
378

379
    protected FileMini signingLog;
380

381
    protected EnumWrapper<SignRequestStatusField> status;
382

383
    protected SignRequestSignFilesField signFiles;
384

385
    protected OffsetDateTime autoExpireAt;
386

387
    protected FolderMini parentFolder;
388

389
    protected String collaboratorLevel;
390

391
    protected String senderEmail;
392

393
    protected Long senderId;
394

395
    public Builder type(SignRequestTypeField type) {
396
      this.type = new EnumWrapper<SignRequestTypeField>(type);
×
397
      return this;
×
398
    }
399

400
    public Builder type(EnumWrapper<SignRequestTypeField> type) {
401
      this.type = type;
×
402
      return this;
×
403
    }
404

405
    public Builder sourceFiles(List<FileBase> sourceFiles) {
406
      this.sourceFiles = sourceFiles;
×
407
      return this;
×
408
    }
409

410
    public Builder signers(List<SignRequestSigner> signers) {
411
      this.signers = signers;
×
412
      return this;
×
413
    }
414

415
    public Builder signatureColor(String signatureColor) {
416
      this.signatureColor = signatureColor;
×
417
      this.markNullableFieldAsSet("signature_color");
×
418
      return this;
×
419
    }
420

421
    public Builder id(String id) {
422
      this.id = id;
×
423
      return this;
×
424
    }
425

426
    public Builder prepareUrl(String prepareUrl) {
427
      this.prepareUrl = prepareUrl;
×
428
      this.markNullableFieldAsSet("prepare_url");
×
429
      return this;
×
430
    }
431

432
    public Builder signingLog(FileMini signingLog) {
433
      this.signingLog = signingLog;
×
434
      return this;
×
435
    }
436

437
    public Builder status(SignRequestStatusField status) {
438
      this.status = new EnumWrapper<SignRequestStatusField>(status);
×
439
      return this;
×
440
    }
441

442
    public Builder status(EnumWrapper<SignRequestStatusField> status) {
443
      this.status = status;
×
444
      return this;
×
445
    }
446

447
    public Builder signFiles(SignRequestSignFilesField signFiles) {
448
      this.signFiles = signFiles;
×
449
      return this;
×
450
    }
451

452
    public Builder autoExpireAt(OffsetDateTime autoExpireAt) {
453
      this.autoExpireAt = autoExpireAt;
×
454
      this.markNullableFieldAsSet("auto_expire_at");
×
455
      return this;
×
456
    }
457

458
    public Builder parentFolder(FolderMini parentFolder) {
459
      this.parentFolder = parentFolder;
×
460
      return this;
×
461
    }
462

463
    public Builder collaboratorLevel(String collaboratorLevel) {
464
      this.collaboratorLevel = collaboratorLevel;
×
465
      this.markNullableFieldAsSet("collaborator_level");
×
466
      return this;
×
467
    }
468

469
    public Builder senderEmail(String senderEmail) {
470
      this.senderEmail = senderEmail;
×
471
      this.markNullableFieldAsSet("sender_email");
×
472
      return this;
×
473
    }
474

475
    public Builder senderId(Long senderId) {
476
      this.senderId = senderId;
×
477
      this.markNullableFieldAsSet("sender_id");
×
478
      return this;
×
479
    }
480

481
    @Override
482
    public Builder isDocumentPreparationNeeded(Boolean isDocumentPreparationNeeded) {
483
      this.isDocumentPreparationNeeded = isDocumentPreparationNeeded;
×
484
      return this;
×
485
    }
486

487
    @Override
488
    public Builder redirectUrl(String redirectUrl) {
489
      this.redirectUrl = redirectUrl;
×
490
      this.markNullableFieldAsSet("redirect_url");
×
491
      return this;
×
492
    }
493

494
    @Override
495
    public Builder declinedRedirectUrl(String declinedRedirectUrl) {
496
      this.declinedRedirectUrl = declinedRedirectUrl;
×
497
      this.markNullableFieldAsSet("declined_redirect_url");
×
498
      return this;
×
499
    }
500

501
    @Override
502
    public Builder areTextSignaturesEnabled(Boolean areTextSignaturesEnabled) {
503
      this.areTextSignaturesEnabled = areTextSignaturesEnabled;
×
504
      return this;
×
505
    }
506

507
    @Override
508
    public Builder emailSubject(String emailSubject) {
509
      this.emailSubject = emailSubject;
×
510
      this.markNullableFieldAsSet("email_subject");
×
511
      return this;
×
512
    }
513

514
    @Override
515
    public Builder emailMessage(String emailMessage) {
516
      this.emailMessage = emailMessage;
×
517
      this.markNullableFieldAsSet("email_message");
×
518
      return this;
×
519
    }
520

521
    @Override
522
    public Builder areRemindersEnabled(Boolean areRemindersEnabled) {
523
      this.areRemindersEnabled = areRemindersEnabled;
×
524
      return this;
×
525
    }
526

527
    @Override
528
    public Builder name(String name) {
529
      this.name = name;
×
530
      return this;
×
531
    }
532

533
    @Override
534
    public Builder prefillTags(List<SignRequestPrefillTag> prefillTags) {
535
      this.prefillTags = prefillTags;
×
536
      return this;
×
537
    }
538

539
    @Override
540
    public Builder daysValid(Long daysValid) {
541
      this.daysValid = daysValid;
×
542
      this.markNullableFieldAsSet("days_valid");
×
543
      return this;
×
544
    }
545

546
    @Override
547
    public Builder externalId(String externalId) {
548
      this.externalId = externalId;
×
549
      this.markNullableFieldAsSet("external_id");
×
550
      return this;
×
551
    }
552

553
    @Override
554
    public Builder templateId(String templateId) {
555
      this.templateId = templateId;
×
556
      this.markNullableFieldAsSet("template_id");
×
557
      return this;
×
558
    }
559

560
    @Override
561
    public Builder externalSystemName(String externalSystemName) {
562
      this.externalSystemName = externalSystemName;
×
563
      this.markNullableFieldAsSet("external_system_name");
×
564
      return this;
×
565
    }
566

567
    public SignRequest build() {
568
      return new SignRequest(this);
×
569
    }
570
  }
571
}
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