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

box / box-java-sdk / #5762

01 Dec 2025 10:27AM UTC coverage: 13.282% (-0.02%) from 13.3%
#5762

push

github

web-flow
feat(boxsdkgen): Support new sign request metadata (box/box-openapi#565) (#1598)

0 of 48 new or added lines in 3 files covered. (0.0%)

15 existing lines in 9 files now uncovered.

8368 of 63001 relevant lines covered (13.28%)

0.13 hits per line

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

0.0
/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
  /** Short identifier for the sign request. */
94
  @JsonProperty("short_id")
95
  protected String shortId;
96

97
  /** Timestamp marking when the sign request was created. */
98
  @JsonProperty("created_at")
99
  @JsonSerialize(using = DateTimeUtils.DateTimeSerializer.class)
100
  @JsonDeserialize(using = DateTimeUtils.DateTimeDeserializer.class)
101
  protected OffsetDateTime createdAt;
102

103
  /** Timestamp indicating when all signing actions completed. */
104
  @JsonProperty("finished_at")
105
  @JsonSerialize(using = DateTimeUtils.DateTimeSerializer.class)
106
  @JsonDeserialize(using = DateTimeUtils.DateTimeDeserializer.class)
107
  @Nullable
108
  protected OffsetDateTime finishedAt;
109

110
  /** The email address of the sender of the sign request. */
111
  @JsonProperty("sender_email")
112
  @Nullable
113
  protected String senderEmail;
114

115
  /** The user ID of the sender of the sign request. */
116
  @JsonProperty("sender_id")
117
  @Nullable
118
  protected Long senderId;
119

120
  public SignRequest() {
121
    super();
×
122
  }
×
123

124
  protected SignRequest(Builder builder) {
125
    super(builder);
×
126
    this.type = builder.type;
×
127
    this.sourceFiles = builder.sourceFiles;
×
128
    this.signers = builder.signers;
×
129
    this.signatureColor = builder.signatureColor;
×
130
    this.id = builder.id;
×
131
    this.prepareUrl = builder.prepareUrl;
×
132
    this.signingLog = builder.signingLog;
×
133
    this.status = builder.status;
×
134
    this.signFiles = builder.signFiles;
×
135
    this.autoExpireAt = builder.autoExpireAt;
×
136
    this.parentFolder = builder.parentFolder;
×
137
    this.collaboratorLevel = builder.collaboratorLevel;
×
NEW
138
    this.shortId = builder.shortId;
×
NEW
139
    this.createdAt = builder.createdAt;
×
NEW
140
    this.finishedAt = builder.finishedAt;
×
141
    this.senderEmail = builder.senderEmail;
×
142
    this.senderId = builder.senderId;
×
143
    markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
×
144
  }
×
145

146
  public EnumWrapper<SignRequestTypeField> getType() {
147
    return type;
×
148
  }
149

150
  public List<FileBase> getSourceFiles() {
151
    return sourceFiles;
×
152
  }
153

154
  public List<SignRequestSigner> getSigners() {
155
    return signers;
×
156
  }
157

158
  public String getSignatureColor() {
159
    return signatureColor;
×
160
  }
161

162
  public String getId() {
163
    return id;
×
164
  }
165

166
  public String getPrepareUrl() {
167
    return prepareUrl;
×
168
  }
169

170
  public FileMini getSigningLog() {
171
    return signingLog;
×
172
  }
173

174
  public EnumWrapper<SignRequestStatusField> getStatus() {
175
    return status;
×
176
  }
177

178
  public SignRequestSignFilesField getSignFiles() {
179
    return signFiles;
×
180
  }
181

182
  public OffsetDateTime getAutoExpireAt() {
183
    return autoExpireAt;
×
184
  }
185

186
  public FolderMini getParentFolder() {
187
    return parentFolder;
×
188
  }
189

190
  public String getCollaboratorLevel() {
191
    return collaboratorLevel;
×
192
  }
193

194
  public String getShortId() {
NEW
195
    return shortId;
×
196
  }
197

198
  public OffsetDateTime getCreatedAt() {
NEW
199
    return createdAt;
×
200
  }
201

202
  public OffsetDateTime getFinishedAt() {
NEW
203
    return finishedAt;
×
204
  }
205

206
  public String getSenderEmail() {
207
    return senderEmail;
×
208
  }
209

210
  public Long getSenderId() {
211
    return senderId;
×
212
  }
213

214
  @Override
215
  public boolean equals(Object o) {
216
    if (this == o) {
×
217
      return true;
×
218
    }
219
    if (o == null || getClass() != o.getClass()) {
×
220
      return false;
×
221
    }
222
    SignRequest casted = (SignRequest) o;
×
223
    return Objects.equals(isDocumentPreparationNeeded, casted.isDocumentPreparationNeeded)
×
224
        && Objects.equals(redirectUrl, casted.redirectUrl)
×
225
        && Objects.equals(declinedRedirectUrl, casted.declinedRedirectUrl)
×
226
        && Objects.equals(areTextSignaturesEnabled, casted.areTextSignaturesEnabled)
×
227
        && Objects.equals(emailSubject, casted.emailSubject)
×
228
        && Objects.equals(emailMessage, casted.emailMessage)
×
229
        && Objects.equals(areRemindersEnabled, casted.areRemindersEnabled)
×
230
        && Objects.equals(name, casted.name)
×
231
        && Objects.equals(prefillTags, casted.prefillTags)
×
232
        && Objects.equals(daysValid, casted.daysValid)
×
233
        && Objects.equals(externalId, casted.externalId)
×
234
        && Objects.equals(templateId, casted.templateId)
×
235
        && Objects.equals(externalSystemName, casted.externalSystemName)
×
236
        && Objects.equals(type, casted.type)
×
237
        && Objects.equals(sourceFiles, casted.sourceFiles)
×
238
        && Objects.equals(signers, casted.signers)
×
239
        && Objects.equals(signatureColor, casted.signatureColor)
×
240
        && Objects.equals(id, casted.id)
×
241
        && Objects.equals(prepareUrl, casted.prepareUrl)
×
242
        && Objects.equals(signingLog, casted.signingLog)
×
243
        && Objects.equals(status, casted.status)
×
244
        && Objects.equals(signFiles, casted.signFiles)
×
245
        && Objects.equals(autoExpireAt, casted.autoExpireAt)
×
246
        && Objects.equals(parentFolder, casted.parentFolder)
×
247
        && Objects.equals(collaboratorLevel, casted.collaboratorLevel)
×
NEW
248
        && Objects.equals(shortId, casted.shortId)
×
NEW
249
        && Objects.equals(createdAt, casted.createdAt)
×
NEW
250
        && Objects.equals(finishedAt, casted.finishedAt)
×
251
        && Objects.equals(senderEmail, casted.senderEmail)
×
252
        && Objects.equals(senderId, casted.senderId);
×
253
  }
254

255
  @Override
256
  public int hashCode() {
257
    return Objects.hash(
×
258
        isDocumentPreparationNeeded,
259
        redirectUrl,
260
        declinedRedirectUrl,
261
        areTextSignaturesEnabled,
262
        emailSubject,
263
        emailMessage,
264
        areRemindersEnabled,
265
        name,
266
        prefillTags,
267
        daysValid,
268
        externalId,
269
        templateId,
270
        externalSystemName,
271
        type,
272
        sourceFiles,
273
        signers,
274
        signatureColor,
275
        id,
276
        prepareUrl,
277
        signingLog,
278
        status,
279
        signFiles,
280
        autoExpireAt,
281
        parentFolder,
282
        collaboratorLevel,
283
        shortId,
284
        createdAt,
285
        finishedAt,
286
        senderEmail,
287
        senderId);
288
  }
289

290
  @Override
291
  public String toString() {
292
    return "SignRequest{"
×
293
        + "isDocumentPreparationNeeded='"
294
        + isDocumentPreparationNeeded
295
        + '\''
296
        + ", "
297
        + "redirectUrl='"
298
        + redirectUrl
299
        + '\''
300
        + ", "
301
        + "declinedRedirectUrl='"
302
        + declinedRedirectUrl
303
        + '\''
304
        + ", "
305
        + "areTextSignaturesEnabled='"
306
        + areTextSignaturesEnabled
307
        + '\''
308
        + ", "
309
        + "emailSubject='"
310
        + emailSubject
311
        + '\''
312
        + ", "
313
        + "emailMessage='"
314
        + emailMessage
315
        + '\''
316
        + ", "
317
        + "areRemindersEnabled='"
318
        + areRemindersEnabled
319
        + '\''
320
        + ", "
321
        + "name='"
322
        + name
323
        + '\''
324
        + ", "
325
        + "prefillTags='"
326
        + prefillTags
327
        + '\''
328
        + ", "
329
        + "daysValid='"
330
        + daysValid
331
        + '\''
332
        + ", "
333
        + "externalId='"
334
        + externalId
335
        + '\''
336
        + ", "
337
        + "templateId='"
338
        + templateId
339
        + '\''
340
        + ", "
341
        + "externalSystemName='"
342
        + externalSystemName
343
        + '\''
344
        + ", "
345
        + "type='"
346
        + type
347
        + '\''
348
        + ", "
349
        + "sourceFiles='"
350
        + sourceFiles
351
        + '\''
352
        + ", "
353
        + "signers='"
354
        + signers
355
        + '\''
356
        + ", "
357
        + "signatureColor='"
358
        + signatureColor
359
        + '\''
360
        + ", "
361
        + "id='"
362
        + id
363
        + '\''
364
        + ", "
365
        + "prepareUrl='"
366
        + prepareUrl
367
        + '\''
368
        + ", "
369
        + "signingLog='"
370
        + signingLog
371
        + '\''
372
        + ", "
373
        + "status='"
374
        + status
375
        + '\''
376
        + ", "
377
        + "signFiles='"
378
        + signFiles
379
        + '\''
380
        + ", "
381
        + "autoExpireAt='"
382
        + autoExpireAt
383
        + '\''
384
        + ", "
385
        + "parentFolder='"
386
        + parentFolder
387
        + '\''
388
        + ", "
389
        + "collaboratorLevel='"
390
        + collaboratorLevel
391
        + '\''
392
        + ", "
393
        + "shortId='"
394
        + shortId
395
        + '\''
396
        + ", "
397
        + "createdAt='"
398
        + createdAt
399
        + '\''
400
        + ", "
401
        + "finishedAt='"
402
        + finishedAt
403
        + '\''
404
        + ", "
405
        + "senderEmail='"
406
        + senderEmail
407
        + '\''
408
        + ", "
409
        + "senderId='"
410
        + senderId
411
        + '\''
412
        + "}";
413
  }
414

415
  public static class Builder extends SignRequestBase.Builder {
×
416

417
    protected EnumWrapper<SignRequestTypeField> type;
418

419
    protected List<FileBase> sourceFiles;
420

421
    protected List<SignRequestSigner> signers;
422

423
    protected String signatureColor;
424

425
    protected String id;
426

427
    protected String prepareUrl;
428

429
    protected FileMini signingLog;
430

431
    protected EnumWrapper<SignRequestStatusField> status;
432

433
    protected SignRequestSignFilesField signFiles;
434

435
    protected OffsetDateTime autoExpireAt;
436

437
    protected FolderMini parentFolder;
438

439
    protected String collaboratorLevel;
440

441
    protected String shortId;
442

443
    protected OffsetDateTime createdAt;
444

445
    protected OffsetDateTime finishedAt;
446

447
    protected String senderEmail;
448

449
    protected Long senderId;
450

451
    public Builder type(SignRequestTypeField type) {
452
      this.type = new EnumWrapper<SignRequestTypeField>(type);
×
453
      return this;
×
454
    }
455

456
    public Builder type(EnumWrapper<SignRequestTypeField> type) {
457
      this.type = type;
×
458
      return this;
×
459
    }
460

461
    public Builder sourceFiles(List<FileBase> sourceFiles) {
462
      this.sourceFiles = sourceFiles;
×
463
      return this;
×
464
    }
465

466
    public Builder signers(List<SignRequestSigner> signers) {
467
      this.signers = signers;
×
468
      return this;
×
469
    }
470

471
    public Builder signatureColor(String signatureColor) {
472
      this.signatureColor = signatureColor;
×
473
      this.markNullableFieldAsSet("signature_color");
×
474
      return this;
×
475
    }
476

477
    public Builder id(String id) {
478
      this.id = id;
×
479
      return this;
×
480
    }
481

482
    public Builder prepareUrl(String prepareUrl) {
483
      this.prepareUrl = prepareUrl;
×
484
      this.markNullableFieldAsSet("prepare_url");
×
485
      return this;
×
486
    }
487

488
    public Builder signingLog(FileMini signingLog) {
489
      this.signingLog = signingLog;
×
490
      return this;
×
491
    }
492

493
    public Builder status(SignRequestStatusField status) {
494
      this.status = new EnumWrapper<SignRequestStatusField>(status);
×
495
      return this;
×
496
    }
497

498
    public Builder status(EnumWrapper<SignRequestStatusField> status) {
499
      this.status = status;
×
500
      return this;
×
501
    }
502

503
    public Builder signFiles(SignRequestSignFilesField signFiles) {
504
      this.signFiles = signFiles;
×
505
      return this;
×
506
    }
507

508
    public Builder autoExpireAt(OffsetDateTime autoExpireAt) {
509
      this.autoExpireAt = autoExpireAt;
×
510
      this.markNullableFieldAsSet("auto_expire_at");
×
511
      return this;
×
512
    }
513

514
    public Builder parentFolder(FolderMini parentFolder) {
515
      this.parentFolder = parentFolder;
×
516
      return this;
×
517
    }
518

519
    public Builder collaboratorLevel(String collaboratorLevel) {
520
      this.collaboratorLevel = collaboratorLevel;
×
521
      this.markNullableFieldAsSet("collaborator_level");
×
522
      return this;
×
523
    }
524

525
    public Builder shortId(String shortId) {
NEW
526
      this.shortId = shortId;
×
NEW
527
      return this;
×
528
    }
529

530
    public Builder createdAt(OffsetDateTime createdAt) {
NEW
531
      this.createdAt = createdAt;
×
NEW
532
      return this;
×
533
    }
534

535
    public Builder finishedAt(OffsetDateTime finishedAt) {
NEW
536
      this.finishedAt = finishedAt;
×
NEW
537
      this.markNullableFieldAsSet("finished_at");
×
NEW
538
      return this;
×
539
    }
540

541
    public Builder senderEmail(String senderEmail) {
542
      this.senderEmail = senderEmail;
×
543
      this.markNullableFieldAsSet("sender_email");
×
544
      return this;
×
545
    }
546

547
    public Builder senderId(Long senderId) {
548
      this.senderId = senderId;
×
549
      this.markNullableFieldAsSet("sender_id");
×
550
      return this;
×
551
    }
552

553
    @Override
554
    public Builder isDocumentPreparationNeeded(Boolean isDocumentPreparationNeeded) {
555
      this.isDocumentPreparationNeeded = isDocumentPreparationNeeded;
×
556
      return this;
×
557
    }
558

559
    @Override
560
    public Builder redirectUrl(String redirectUrl) {
561
      this.redirectUrl = redirectUrl;
×
562
      this.markNullableFieldAsSet("redirect_url");
×
563
      return this;
×
564
    }
565

566
    @Override
567
    public Builder declinedRedirectUrl(String declinedRedirectUrl) {
568
      this.declinedRedirectUrl = declinedRedirectUrl;
×
569
      this.markNullableFieldAsSet("declined_redirect_url");
×
570
      return this;
×
571
    }
572

573
    @Override
574
    public Builder areTextSignaturesEnabled(Boolean areTextSignaturesEnabled) {
575
      this.areTextSignaturesEnabled = areTextSignaturesEnabled;
×
576
      return this;
×
577
    }
578

579
    @Override
580
    public Builder emailSubject(String emailSubject) {
581
      this.emailSubject = emailSubject;
×
582
      this.markNullableFieldAsSet("email_subject");
×
583
      return this;
×
584
    }
585

586
    @Override
587
    public Builder emailMessage(String emailMessage) {
588
      this.emailMessage = emailMessage;
×
589
      this.markNullableFieldAsSet("email_message");
×
590
      return this;
×
591
    }
592

593
    @Override
594
    public Builder areRemindersEnabled(Boolean areRemindersEnabled) {
595
      this.areRemindersEnabled = areRemindersEnabled;
×
596
      return this;
×
597
    }
598

599
    @Override
600
    public Builder name(String name) {
601
      this.name = name;
×
602
      return this;
×
603
    }
604

605
    @Override
606
    public Builder prefillTags(List<SignRequestPrefillTag> prefillTags) {
607
      this.prefillTags = prefillTags;
×
608
      return this;
×
609
    }
610

611
    @Override
612
    public Builder daysValid(Long daysValid) {
613
      this.daysValid = daysValid;
×
614
      this.markNullableFieldAsSet("days_valid");
×
615
      return this;
×
616
    }
617

618
    @Override
619
    public Builder externalId(String externalId) {
620
      this.externalId = externalId;
×
621
      this.markNullableFieldAsSet("external_id");
×
622
      return this;
×
623
    }
624

625
    @Override
626
    public Builder templateId(String templateId) {
627
      this.templateId = templateId;
×
628
      this.markNullableFieldAsSet("template_id");
×
629
      return this;
×
630
    }
631

632
    @Override
633
    public Builder externalSystemName(String externalSystemName) {
634
      this.externalSystemName = externalSystemName;
×
635
      this.markNullableFieldAsSet("external_system_name");
×
636
      return this;
×
637
    }
638

639
    public SignRequest build() {
640
      return new SignRequest(this);
×
641
    }
642
  }
643
}
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

© 2025 Coveralls, Inc