• 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.61
/src/main/java/com/box/sdkgen/schemas/signtemplate/SignTemplate.java
1
package com.box.sdkgen.schemas.signtemplate;
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.schemas.filemini.FileMini;
7
import com.box.sdkgen.schemas.foldermini.FolderMini;
8
import com.box.sdkgen.schemas.templatesigner.TemplateSigner;
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.util.List;
15
import java.util.Objects;
16

17
/** A Box Sign template object. */
18
@JsonFilter("nullablePropertyFilter")
19
public class SignTemplate extends SerializableObject {
20

21
  /** The value will always be `sign-template`. */
22
  @JsonDeserialize(using = SignTemplateTypeField.SignTemplateTypeFieldDeserializer.class)
23
  @JsonSerialize(using = SignTemplateTypeField.SignTemplateTypeFieldSerializer.class)
24
  protected EnumWrapper<SignTemplateTypeField> type;
25

26
  /** Template identifier. */
27
  protected String id;
28

29
  /** The name of the template. */
30
  @Nullable protected String name;
31

32
  /**
33
   * Subject of signature request email. This is cleaned by sign request. If this field is not
34
   * passed, a default subject will be used.
35
   */
36
  @JsonProperty("email_subject")
37
  @Nullable
38
  protected String emailSubject;
39

40
  /**
41
   * Message to include in signature request email. The field is cleaned through sanitization of
42
   * specific characters. However, some html tags are allowed. Links included in the message are
43
   * also converted to hyperlinks in the email. The message may contain the following html tags
44
   * including `a`, `abbr`, `acronym`, `b`, `blockquote`, `code`, `em`, `i`, `ul`, `li`, `ol`, and
45
   * `strong`. Be aware that when the text to html ratio is too high, the email may end up in spam
46
   * filters. Custom styles on these tags are not allowed. If this field is not passed, a default
47
   * message will be used.
48
   */
49
  @JsonProperty("email_message")
50
  @Nullable
51
  protected String emailMessage;
52

53
  /**
54
   * Set the number of days after which the created signature request will automatically expire if
55
   * not completed. By default, we do not apply any expiration date on signature requests, and the
56
   * signature request does not expire.
57
   */
58
  @JsonProperty("days_valid")
59
  @Nullable
60
  protected Long daysValid;
61

62
  @JsonProperty("parent_folder")
63
  protected FolderMini parentFolder;
64

65
  /**
66
   * List of files to create a signing document from. Only the ID and type fields are required for
67
   * each file.
68
   */
69
  @JsonProperty("source_files")
70
  protected List<FileMini> sourceFiles;
71

72
  /** Indicates if the template input fields are editable or not. */
73
  @JsonProperty("are_fields_locked")
74
  protected Boolean areFieldsLocked;
75

76
  /**
77
   * Indicates if the template document options are editable or not, for example renaming the
78
   * document.
79
   */
80
  @JsonProperty("are_options_locked")
81
  protected Boolean areOptionsLocked;
82

83
  /** Indicates if the template signers are editable or not. */
84
  @JsonProperty("are_recipients_locked")
85
  protected Boolean areRecipientsLocked;
86

87
  /** Indicates if the template email settings are editable or not. */
88
  @JsonProperty("are_email_settings_locked")
89
  protected Boolean areEmailSettingsLocked;
90

91
  /**
92
   * Indicates if the template files are editable or not. This includes deleting or renaming
93
   * template files.
94
   */
95
  @JsonProperty("are_files_locked")
96
  protected Boolean areFilesLocked;
97

98
  /**
99
   * Array of signers for the template.
100
   *
101
   * <p>**Note**: It may happen that some signers specified in the template belong to conflicting
102
   * [segments](r://shield-information-barrier-segment-member) (user groups). This means that due to
103
   * the security policies, users are assigned to segments to prevent exchanges or communication
104
   * that could lead to ethical conflicts. In such a case, an attempt to send a sign request based
105
   * on a template that lists signers in conflicting segments will result in an error.
106
   *
107
   * <p>Read more about [segments and ethical
108
   * walls](https://support.box.com/hc/en-us/articles/9920431507603-Understanding-Information-Barriers#h_01GFVJEHQA06N7XEZ4GCZ9GFAQ).
109
   */
110
  protected List<TemplateSigner> signers;
111

112
  /** Additional information on which fields are required and which fields are not editable. */
113
  @JsonProperty("additional_info")
114
  protected SignTemplateAdditionalInfoField additionalInfo;
115

116
  /**
117
   * Box's ready-sign link feature enables you to create a link to a signature request that you've
118
   * created from a template. Use this link when you want to post a signature request on a public
119
   * form — such as an email, social media post, or web page — without knowing who the signers will
120
   * be. Note: The ready-sign link feature is limited to Enterprise Plus customers and not available
121
   * to Box Verified Enterprises.
122
   */
123
  @JsonProperty("ready_sign_link")
124
  @Nullable
125
  protected SignTemplateReadySignLinkField readySignLink;
126

127
  /** Custom branding applied to notifications and signature requests. */
128
  @JsonProperty("custom_branding")
129
  @Nullable
130
  protected SignTemplateCustomBrandingField customBranding;
131

132
  public SignTemplate() {
133
    super();
1✔
134
  }
1✔
135

136
  protected SignTemplate(Builder builder) {
137
    super();
×
138
    this.type = builder.type;
×
139
    this.id = builder.id;
×
140
    this.name = builder.name;
×
141
    this.emailSubject = builder.emailSubject;
×
142
    this.emailMessage = builder.emailMessage;
×
143
    this.daysValid = builder.daysValid;
×
144
    this.parentFolder = builder.parentFolder;
×
145
    this.sourceFiles = builder.sourceFiles;
×
146
    this.areFieldsLocked = builder.areFieldsLocked;
×
147
    this.areOptionsLocked = builder.areOptionsLocked;
×
148
    this.areRecipientsLocked = builder.areRecipientsLocked;
×
149
    this.areEmailSettingsLocked = builder.areEmailSettingsLocked;
×
150
    this.areFilesLocked = builder.areFilesLocked;
×
151
    this.signers = builder.signers;
×
152
    this.additionalInfo = builder.additionalInfo;
×
153
    this.readySignLink = builder.readySignLink;
×
154
    this.customBranding = builder.customBranding;
×
155
    markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
×
156
  }
×
157

158
  public EnumWrapper<SignTemplateTypeField> getType() {
159
    return type;
×
160
  }
161

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

166
  public String getName() {
167
    return name;
1✔
168
  }
169

170
  public String getEmailSubject() {
171
    return emailSubject;
×
172
  }
173

174
  public String getEmailMessage() {
175
    return emailMessage;
×
176
  }
177

178
  public Long getDaysValid() {
179
    return daysValid;
×
180
  }
181

182
  public FolderMini getParentFolder() {
183
    return parentFolder;
1✔
184
  }
185

186
  public List<FileMini> getSourceFiles() {
187
    return sourceFiles;
1✔
188
  }
189

190
  public Boolean getAreFieldsLocked() {
191
    return areFieldsLocked;
×
192
  }
193

194
  public Boolean getAreOptionsLocked() {
195
    return areOptionsLocked;
×
196
  }
197

198
  public Boolean getAreRecipientsLocked() {
199
    return areRecipientsLocked;
×
200
  }
201

202
  public Boolean getAreEmailSettingsLocked() {
203
    return areEmailSettingsLocked;
×
204
  }
205

206
  public Boolean getAreFilesLocked() {
207
    return areFilesLocked;
×
208
  }
209

210
  public List<TemplateSigner> getSigners() {
211
    return signers;
×
212
  }
213

214
  public SignTemplateAdditionalInfoField getAdditionalInfo() {
215
    return additionalInfo;
×
216
  }
217

218
  public SignTemplateReadySignLinkField getReadySignLink() {
219
    return readySignLink;
×
220
  }
221

222
  public SignTemplateCustomBrandingField getCustomBranding() {
223
    return customBranding;
×
224
  }
225

226
  @Override
227
  public boolean equals(Object o) {
228
    if (this == o) {
×
229
      return true;
×
230
    }
231
    if (o == null || getClass() != o.getClass()) {
×
232
      return false;
×
233
    }
234
    SignTemplate casted = (SignTemplate) o;
×
235
    return Objects.equals(type, casted.type)
×
236
        && Objects.equals(id, casted.id)
×
237
        && Objects.equals(name, casted.name)
×
238
        && Objects.equals(emailSubject, casted.emailSubject)
×
239
        && Objects.equals(emailMessage, casted.emailMessage)
×
240
        && Objects.equals(daysValid, casted.daysValid)
×
241
        && Objects.equals(parentFolder, casted.parentFolder)
×
242
        && Objects.equals(sourceFiles, casted.sourceFiles)
×
243
        && Objects.equals(areFieldsLocked, casted.areFieldsLocked)
×
244
        && Objects.equals(areOptionsLocked, casted.areOptionsLocked)
×
245
        && Objects.equals(areRecipientsLocked, casted.areRecipientsLocked)
×
246
        && Objects.equals(areEmailSettingsLocked, casted.areEmailSettingsLocked)
×
247
        && Objects.equals(areFilesLocked, casted.areFilesLocked)
×
248
        && Objects.equals(signers, casted.signers)
×
249
        && Objects.equals(additionalInfo, casted.additionalInfo)
×
250
        && Objects.equals(readySignLink, casted.readySignLink)
×
251
        && Objects.equals(customBranding, casted.customBranding);
×
252
  }
253

254
  @Override
255
  public int hashCode() {
256
    return Objects.hash(
×
257
        type,
258
        id,
259
        name,
260
        emailSubject,
261
        emailMessage,
262
        daysValid,
263
        parentFolder,
264
        sourceFiles,
265
        areFieldsLocked,
266
        areOptionsLocked,
267
        areRecipientsLocked,
268
        areEmailSettingsLocked,
269
        areFilesLocked,
270
        signers,
271
        additionalInfo,
272
        readySignLink,
273
        customBranding);
274
  }
275

276
  @Override
277
  public String toString() {
278
    return "SignTemplate{"
×
279
        + "type='"
280
        + type
281
        + '\''
282
        + ", "
283
        + "id='"
284
        + id
285
        + '\''
286
        + ", "
287
        + "name='"
288
        + name
289
        + '\''
290
        + ", "
291
        + "emailSubject='"
292
        + emailSubject
293
        + '\''
294
        + ", "
295
        + "emailMessage='"
296
        + emailMessage
297
        + '\''
298
        + ", "
299
        + "daysValid='"
300
        + daysValid
301
        + '\''
302
        + ", "
303
        + "parentFolder='"
304
        + parentFolder
305
        + '\''
306
        + ", "
307
        + "sourceFiles='"
308
        + sourceFiles
309
        + '\''
310
        + ", "
311
        + "areFieldsLocked='"
312
        + areFieldsLocked
313
        + '\''
314
        + ", "
315
        + "areOptionsLocked='"
316
        + areOptionsLocked
317
        + '\''
318
        + ", "
319
        + "areRecipientsLocked='"
320
        + areRecipientsLocked
321
        + '\''
322
        + ", "
323
        + "areEmailSettingsLocked='"
324
        + areEmailSettingsLocked
325
        + '\''
326
        + ", "
327
        + "areFilesLocked='"
328
        + areFilesLocked
329
        + '\''
330
        + ", "
331
        + "signers='"
332
        + signers
333
        + '\''
334
        + ", "
335
        + "additionalInfo='"
336
        + additionalInfo
337
        + '\''
338
        + ", "
339
        + "readySignLink='"
340
        + readySignLink
341
        + '\''
342
        + ", "
343
        + "customBranding='"
344
        + customBranding
345
        + '\''
346
        + "}";
347
  }
348

349
  public static class Builder extends NullableFieldTracker {
×
350

351
    protected EnumWrapper<SignTemplateTypeField> type;
352

353
    protected String id;
354

355
    protected String name;
356

357
    protected String emailSubject;
358

359
    protected String emailMessage;
360

361
    protected Long daysValid;
362

363
    protected FolderMini parentFolder;
364

365
    protected List<FileMini> sourceFiles;
366

367
    protected Boolean areFieldsLocked;
368

369
    protected Boolean areOptionsLocked;
370

371
    protected Boolean areRecipientsLocked;
372

373
    protected Boolean areEmailSettingsLocked;
374

375
    protected Boolean areFilesLocked;
376

377
    protected List<TemplateSigner> signers;
378

379
    protected SignTemplateAdditionalInfoField additionalInfo;
380

381
    protected SignTemplateReadySignLinkField readySignLink;
382

383
    protected SignTemplateCustomBrandingField customBranding;
384

385
    public Builder type(SignTemplateTypeField type) {
386
      this.type = new EnumWrapper<SignTemplateTypeField>(type);
×
387
      return this;
×
388
    }
389

390
    public Builder type(EnumWrapper<SignTemplateTypeField> type) {
391
      this.type = type;
×
392
      return this;
×
393
    }
394

395
    public Builder id(String id) {
396
      this.id = id;
×
397
      return this;
×
398
    }
399

400
    public Builder name(String name) {
401
      this.name = name;
×
402
      this.markNullableFieldAsSet("name");
×
403
      return this;
×
404
    }
405

406
    public Builder emailSubject(String emailSubject) {
407
      this.emailSubject = emailSubject;
×
408
      this.markNullableFieldAsSet("email_subject");
×
409
      return this;
×
410
    }
411

412
    public Builder emailMessage(String emailMessage) {
413
      this.emailMessage = emailMessage;
×
414
      this.markNullableFieldAsSet("email_message");
×
415
      return this;
×
416
    }
417

418
    public Builder daysValid(Long daysValid) {
419
      this.daysValid = daysValid;
×
420
      this.markNullableFieldAsSet("days_valid");
×
421
      return this;
×
422
    }
423

424
    public Builder parentFolder(FolderMini parentFolder) {
425
      this.parentFolder = parentFolder;
×
426
      return this;
×
427
    }
428

429
    public Builder sourceFiles(List<FileMini> sourceFiles) {
430
      this.sourceFiles = sourceFiles;
×
431
      return this;
×
432
    }
433

434
    public Builder areFieldsLocked(Boolean areFieldsLocked) {
435
      this.areFieldsLocked = areFieldsLocked;
×
436
      return this;
×
437
    }
438

439
    public Builder areOptionsLocked(Boolean areOptionsLocked) {
440
      this.areOptionsLocked = areOptionsLocked;
×
441
      return this;
×
442
    }
443

444
    public Builder areRecipientsLocked(Boolean areRecipientsLocked) {
445
      this.areRecipientsLocked = areRecipientsLocked;
×
446
      return this;
×
447
    }
448

449
    public Builder areEmailSettingsLocked(Boolean areEmailSettingsLocked) {
450
      this.areEmailSettingsLocked = areEmailSettingsLocked;
×
451
      return this;
×
452
    }
453

454
    public Builder areFilesLocked(Boolean areFilesLocked) {
455
      this.areFilesLocked = areFilesLocked;
×
456
      return this;
×
457
    }
458

459
    public Builder signers(List<TemplateSigner> signers) {
460
      this.signers = signers;
×
461
      return this;
×
462
    }
463

464
    public Builder additionalInfo(SignTemplateAdditionalInfoField additionalInfo) {
465
      this.additionalInfo = additionalInfo;
×
466
      return this;
×
467
    }
468

469
    public Builder readySignLink(SignTemplateReadySignLinkField readySignLink) {
470
      this.readySignLink = readySignLink;
×
471
      this.markNullableFieldAsSet("ready_sign_link");
×
472
      return this;
×
473
    }
474

475
    public Builder customBranding(SignTemplateCustomBrandingField customBranding) {
476
      this.customBranding = customBranding;
×
477
      this.markNullableFieldAsSet("custom_branding");
×
478
      return this;
×
479
    }
480

481
    public SignTemplate build() {
482
      return new SignTemplate(this);
×
483
    }
484
  }
485
}
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