• 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

7.58
/src/main/java/com/box/sdkgen/schemas/weblink/WebLinkSharedLinkField.java
1
package com.box.sdkgen.schemas.weblink;
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.serialization.json.EnumWrapper;
8
import com.fasterxml.jackson.annotation.JsonFilter;
9
import com.fasterxml.jackson.annotation.JsonProperty;
10
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
11
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
12
import java.time.OffsetDateTime;
13
import java.util.Objects;
14

15
@JsonFilter("nullablePropertyFilter")
16
public class WebLinkSharedLinkField extends SerializableObject {
17

18
  /**
19
   * The URL that can be used to access the item on Box.
20
   *
21
   * <p>This URL will display the item in Box's preview UI where the file can be downloaded if
22
   * allowed.
23
   *
24
   * <p>This URL will continue to work even when a custom `vanity_url` has been set for this shared
25
   * link.
26
   */
27
  protected final String url;
28

29
  /**
30
   * A URL that can be used to download the file. This URL can be used in a browser to download the
31
   * file. This URL includes the file extension so that the file will be saved with the right file
32
   * type.
33
   *
34
   * <p>This property will be `null` for folders.
35
   */
36
  @JsonProperty("download_url")
37
  @Nullable
38
  protected String downloadUrl;
39

40
  /**
41
   * The "Custom URL" that can also be used to preview the item on Box. Custom URLs can only be
42
   * created or modified in the Box Web application.
43
   */
44
  @JsonProperty("vanity_url")
45
  @Nullable
46
  protected String vanityUrl;
47

48
  /** The custom name of a shared link, as used in the `vanity_url` field. */
49
  @JsonProperty("vanity_name")
50
  @Nullable
51
  protected String vanityName;
52

53
  /**
54
   * The access level for this shared link.
55
   *
56
   * <p>* `open` - provides access to this item to anyone with this link * `company` - only provides
57
   * access to this item to people the same company * `collaborators` - only provides access to this
58
   * item to people who are collaborators on this item
59
   *
60
   * <p>If this field is omitted when creating the shared link, the access level will be set to the
61
   * default access level specified by the enterprise admin.
62
   */
63
  @JsonDeserialize(
64
      using = WebLinkSharedLinkAccessField.WebLinkSharedLinkAccessFieldDeserializer.class)
65
  @JsonSerialize(using = WebLinkSharedLinkAccessField.WebLinkSharedLinkAccessFieldSerializer.class)
66
  protected EnumWrapper<WebLinkSharedLinkAccessField> access;
67

68
  /**
69
   * The effective access level for the shared link. This can be a more restrictive access level
70
   * than the value in the `access` field when the enterprise settings restrict the allowed access
71
   * levels.
72
   */
73
  @JsonDeserialize(
74
      using =
75
          WebLinkSharedLinkEffectiveAccessField.WebLinkSharedLinkEffectiveAccessFieldDeserializer
76
              .class)
77
  @JsonSerialize(
78
      using =
79
          WebLinkSharedLinkEffectiveAccessField.WebLinkSharedLinkEffectiveAccessFieldSerializer
80
              .class)
81
  @JsonProperty("effective_access")
82
  protected final EnumWrapper<WebLinkSharedLinkEffectiveAccessField> effectiveAccess;
83

84
  /**
85
   * The effective permissions for this shared link. These result in the more restrictive
86
   * combination of the share link permissions and the item permissions set by the administrator,
87
   * the owner, and any ancestor item such as a folder.
88
   */
89
  @JsonDeserialize(
90
      using =
91
          WebLinkSharedLinkEffectivePermissionField
92
              .WebLinkSharedLinkEffectivePermissionFieldDeserializer.class)
93
  @JsonSerialize(
94
      using =
95
          WebLinkSharedLinkEffectivePermissionField
96
              .WebLinkSharedLinkEffectivePermissionFieldSerializer.class)
97
  @JsonProperty("effective_permission")
98
  protected final EnumWrapper<WebLinkSharedLinkEffectivePermissionField> effectivePermission;
99

100
  /**
101
   * The date and time when this link will be unshared. This field can only be set by users with
102
   * paid accounts.
103
   */
104
  @JsonProperty("unshared_at")
105
  @JsonSerialize(using = DateTimeUtils.DateTimeSerializer.class)
106
  @JsonDeserialize(using = DateTimeUtils.DateTimeDeserializer.class)
107
  @Nullable
108
  protected OffsetDateTime unsharedAt;
109

110
  /** Defines if the shared link requires a password to access the item. */
111
  @JsonProperty("is_password_enabled")
112
  protected final boolean isPasswordEnabled;
113

114
  /**
115
   * Defines if this link allows a user to preview, edit, and download an item. These permissions
116
   * refer to the shared link only and do not supersede permissions applied to the item itself.
117
   */
118
  protected WebLinkSharedLinkPermissionsField permissions;
119

120
  /** The number of times this item has been downloaded. */
121
  @JsonProperty("download_count")
122
  protected final long downloadCount;
123

124
  /** The number of times this item has been previewed. */
125
  @JsonProperty("preview_count")
126
  protected final long previewCount;
127

128
  public WebLinkSharedLinkField(
129
      String url,
130
      WebLinkSharedLinkEffectiveAccessField effectiveAccess,
131
      WebLinkSharedLinkEffectivePermissionField effectivePermission,
132
      boolean isPasswordEnabled,
133
      long downloadCount,
134
      long previewCount) {
135
    super();
×
136
    this.url = url;
×
137
    this.effectiveAccess = new EnumWrapper<WebLinkSharedLinkEffectiveAccessField>(effectiveAccess);
×
138
    this.effectivePermission =
×
139
        new EnumWrapper<WebLinkSharedLinkEffectivePermissionField>(effectivePermission);
140
    this.isPasswordEnabled = isPasswordEnabled;
×
141
    this.downloadCount = downloadCount;
×
142
    this.previewCount = previewCount;
×
143
  }
×
144

145
  public WebLinkSharedLinkField(
146
      String url,
147
      WebLinkSharedLinkEffectiveAccessField effectiveAccess,
148
      EnumWrapper<WebLinkSharedLinkEffectivePermissionField> effectivePermission,
149
      boolean isPasswordEnabled,
150
      long downloadCount,
151
      long previewCount) {
152
    super();
×
153
    this.url = url;
×
154
    this.effectiveAccess = new EnumWrapper<WebLinkSharedLinkEffectiveAccessField>(effectiveAccess);
×
155
    this.effectivePermission = effectivePermission;
×
156
    this.isPasswordEnabled = isPasswordEnabled;
×
157
    this.downloadCount = downloadCount;
×
158
    this.previewCount = previewCount;
×
159
  }
×
160

161
  public WebLinkSharedLinkField(
162
      String url,
163
      EnumWrapper<WebLinkSharedLinkEffectiveAccessField> effectiveAccess,
164
      WebLinkSharedLinkEffectivePermissionField effectivePermission,
165
      boolean isPasswordEnabled,
166
      long downloadCount,
167
      long previewCount) {
168
    super();
×
169
    this.url = url;
×
170
    this.effectiveAccess = effectiveAccess;
×
171
    this.effectivePermission =
×
172
        new EnumWrapper<WebLinkSharedLinkEffectivePermissionField>(effectivePermission);
173
    this.isPasswordEnabled = isPasswordEnabled;
×
174
    this.downloadCount = downloadCount;
×
175
    this.previewCount = previewCount;
×
176
  }
×
177

178
  public WebLinkSharedLinkField(
179
      @JsonProperty("url") String url,
180
      @JsonProperty("effective_access")
181
          EnumWrapper<WebLinkSharedLinkEffectiveAccessField> effectiveAccess,
182
      @JsonProperty("effective_permission")
183
          EnumWrapper<WebLinkSharedLinkEffectivePermissionField> effectivePermission,
184
      @JsonProperty("is_password_enabled") boolean isPasswordEnabled,
185
      @JsonProperty("download_count") long downloadCount,
186
      @JsonProperty("preview_count") long previewCount) {
187
    super();
1✔
188
    this.url = url;
1✔
189
    this.effectiveAccess = effectiveAccess;
1✔
190
    this.effectivePermission = effectivePermission;
1✔
191
    this.isPasswordEnabled = isPasswordEnabled;
1✔
192
    this.downloadCount = downloadCount;
1✔
193
    this.previewCount = previewCount;
1✔
194
  }
1✔
195

196
  protected WebLinkSharedLinkField(Builder builder) {
197
    super();
×
198
    this.url = builder.url;
×
199
    this.downloadUrl = builder.downloadUrl;
×
200
    this.vanityUrl = builder.vanityUrl;
×
201
    this.vanityName = builder.vanityName;
×
202
    this.access = builder.access;
×
203
    this.effectiveAccess = builder.effectiveAccess;
×
204
    this.effectivePermission = builder.effectivePermission;
×
205
    this.unsharedAt = builder.unsharedAt;
×
206
    this.isPasswordEnabled = builder.isPasswordEnabled;
×
207
    this.permissions = builder.permissions;
×
208
    this.downloadCount = builder.downloadCount;
×
209
    this.previewCount = builder.previewCount;
×
210
    markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
×
211
  }
×
212

213
  public String getUrl() {
214
    return url;
1✔
215
  }
216

217
  public String getDownloadUrl() {
218
    return downloadUrl;
×
219
  }
220

221
  public String getVanityUrl() {
222
    return vanityUrl;
×
223
  }
224

225
  public String getVanityName() {
226
    return vanityName;
×
227
  }
228

229
  public EnumWrapper<WebLinkSharedLinkAccessField> getAccess() {
230
    return access;
1✔
231
  }
232

233
  public EnumWrapper<WebLinkSharedLinkEffectiveAccessField> getEffectiveAccess() {
234
    return effectiveAccess;
×
235
  }
236

237
  public EnumWrapper<WebLinkSharedLinkEffectivePermissionField> getEffectivePermission() {
238
    return effectivePermission;
×
239
  }
240

241
  public OffsetDateTime getUnsharedAt() {
242
    return unsharedAt;
×
243
  }
244

245
  public boolean getIsPasswordEnabled() {
246
    return isPasswordEnabled;
×
247
  }
248

249
  public WebLinkSharedLinkPermissionsField getPermissions() {
250
    return permissions;
×
251
  }
252

253
  public long getDownloadCount() {
254
    return downloadCount;
×
255
  }
256

257
  public long getPreviewCount() {
258
    return previewCount;
×
259
  }
260

261
  @Override
262
  public boolean equals(Object o) {
263
    if (this == o) {
×
264
      return true;
×
265
    }
266
    if (o == null || getClass() != o.getClass()) {
×
267
      return false;
×
268
    }
269
    WebLinkSharedLinkField casted = (WebLinkSharedLinkField) o;
×
270
    return Objects.equals(url, casted.url)
×
271
        && Objects.equals(downloadUrl, casted.downloadUrl)
×
272
        && Objects.equals(vanityUrl, casted.vanityUrl)
×
273
        && Objects.equals(vanityName, casted.vanityName)
×
274
        && Objects.equals(access, casted.access)
×
275
        && Objects.equals(effectiveAccess, casted.effectiveAccess)
×
276
        && Objects.equals(effectivePermission, casted.effectivePermission)
×
277
        && Objects.equals(unsharedAt, casted.unsharedAt)
×
278
        && Objects.equals(isPasswordEnabled, casted.isPasswordEnabled)
×
279
        && Objects.equals(permissions, casted.permissions)
×
280
        && Objects.equals(downloadCount, casted.downloadCount)
×
281
        && Objects.equals(previewCount, casted.previewCount);
×
282
  }
283

284
  @Override
285
  public int hashCode() {
286
    return Objects.hash(
×
287
        url,
288
        downloadUrl,
289
        vanityUrl,
290
        vanityName,
291
        access,
292
        effectiveAccess,
293
        effectivePermission,
294
        unsharedAt,
295
        isPasswordEnabled,
×
296
        permissions,
297
        downloadCount,
×
298
        previewCount);
×
299
  }
300

301
  @Override
302
  public String toString() {
303
    return "WebLinkSharedLinkField{"
×
304
        + "url='"
305
        + url
306
        + '\''
307
        + ", "
308
        + "downloadUrl='"
309
        + downloadUrl
310
        + '\''
311
        + ", "
312
        + "vanityUrl='"
313
        + vanityUrl
314
        + '\''
315
        + ", "
316
        + "vanityName='"
317
        + vanityName
318
        + '\''
319
        + ", "
320
        + "access='"
321
        + access
322
        + '\''
323
        + ", "
324
        + "effectiveAccess='"
325
        + effectiveAccess
326
        + '\''
327
        + ", "
328
        + "effectivePermission='"
329
        + effectivePermission
330
        + '\''
331
        + ", "
332
        + "unsharedAt='"
333
        + unsharedAt
334
        + '\''
335
        + ", "
336
        + "isPasswordEnabled='"
337
        + isPasswordEnabled
338
        + '\''
339
        + ", "
340
        + "permissions='"
341
        + permissions
342
        + '\''
343
        + ", "
344
        + "downloadCount='"
345
        + downloadCount
346
        + '\''
347
        + ", "
348
        + "previewCount='"
349
        + previewCount
350
        + '\''
351
        + "}";
352
  }
353

354
  public static class Builder extends NullableFieldTracker {
355

356
    protected final String url;
357

358
    protected String downloadUrl;
359

360
    protected String vanityUrl;
361

362
    protected String vanityName;
363

364
    protected EnumWrapper<WebLinkSharedLinkAccessField> access;
365

366
    protected final EnumWrapper<WebLinkSharedLinkEffectiveAccessField> effectiveAccess;
367

368
    protected final EnumWrapper<WebLinkSharedLinkEffectivePermissionField> effectivePermission;
369

370
    protected OffsetDateTime unsharedAt;
371

372
    protected final boolean isPasswordEnabled;
373

374
    protected WebLinkSharedLinkPermissionsField permissions;
375

376
    protected final long downloadCount;
377

378
    protected final long previewCount;
379

380
    public Builder(
381
        String url,
382
        WebLinkSharedLinkEffectiveAccessField effectiveAccess,
383
        WebLinkSharedLinkEffectivePermissionField effectivePermission,
384
        boolean isPasswordEnabled,
385
        long downloadCount,
386
        long previewCount) {
387
      super();
×
388
      this.url = url;
×
389
      this.effectiveAccess =
×
390
          new EnumWrapper<WebLinkSharedLinkEffectiveAccessField>(effectiveAccess);
391
      this.effectivePermission =
×
392
          new EnumWrapper<WebLinkSharedLinkEffectivePermissionField>(effectivePermission);
393
      this.isPasswordEnabled = isPasswordEnabled;
×
394
      this.downloadCount = downloadCount;
×
395
      this.previewCount = previewCount;
×
396
    }
×
397

398
    public Builder(
399
        String url,
400
        WebLinkSharedLinkEffectiveAccessField effectiveAccess,
401
        EnumWrapper<WebLinkSharedLinkEffectivePermissionField> effectivePermission,
402
        boolean isPasswordEnabled,
403
        long downloadCount,
404
        long previewCount) {
405
      super();
×
406
      this.url = url;
×
407
      this.effectiveAccess =
×
408
          new EnumWrapper<WebLinkSharedLinkEffectiveAccessField>(effectiveAccess);
409
      this.effectivePermission = effectivePermission;
×
410
      this.isPasswordEnabled = isPasswordEnabled;
×
411
      this.downloadCount = downloadCount;
×
412
      this.previewCount = previewCount;
×
413
    }
×
414

415
    public Builder(
416
        String url,
417
        EnumWrapper<WebLinkSharedLinkEffectiveAccessField> effectiveAccess,
418
        WebLinkSharedLinkEffectivePermissionField effectivePermission,
419
        boolean isPasswordEnabled,
420
        long downloadCount,
421
        long previewCount) {
422
      super();
×
423
      this.url = url;
×
424
      this.effectiveAccess = effectiveAccess;
×
425
      this.effectivePermission =
×
426
          new EnumWrapper<WebLinkSharedLinkEffectivePermissionField>(effectivePermission);
427
      this.isPasswordEnabled = isPasswordEnabled;
×
428
      this.downloadCount = downloadCount;
×
429
      this.previewCount = previewCount;
×
430
    }
×
431

432
    public Builder(
433
        String url,
434
        EnumWrapper<WebLinkSharedLinkEffectiveAccessField> effectiveAccess,
435
        EnumWrapper<WebLinkSharedLinkEffectivePermissionField> effectivePermission,
436
        boolean isPasswordEnabled,
437
        long downloadCount,
438
        long previewCount) {
439
      super();
×
440
      this.url = url;
×
441
      this.effectiveAccess = effectiveAccess;
×
442
      this.effectivePermission = effectivePermission;
×
443
      this.isPasswordEnabled = isPasswordEnabled;
×
444
      this.downloadCount = downloadCount;
×
445
      this.previewCount = previewCount;
×
446
    }
×
447

448
    public Builder downloadUrl(String downloadUrl) {
449
      this.downloadUrl = downloadUrl;
×
450
      this.markNullableFieldAsSet("download_url");
×
451
      return this;
×
452
    }
453

454
    public Builder vanityUrl(String vanityUrl) {
455
      this.vanityUrl = vanityUrl;
×
456
      this.markNullableFieldAsSet("vanity_url");
×
457
      return this;
×
458
    }
459

460
    public Builder vanityName(String vanityName) {
461
      this.vanityName = vanityName;
×
462
      this.markNullableFieldAsSet("vanity_name");
×
463
      return this;
×
464
    }
465

466
    public Builder access(WebLinkSharedLinkAccessField access) {
467
      this.access = new EnumWrapper<WebLinkSharedLinkAccessField>(access);
×
468
      return this;
×
469
    }
470

471
    public Builder access(EnumWrapper<WebLinkSharedLinkAccessField> access) {
472
      this.access = access;
×
473
      return this;
×
474
    }
475

476
    public Builder unsharedAt(OffsetDateTime unsharedAt) {
477
      this.unsharedAt = unsharedAt;
×
478
      this.markNullableFieldAsSet("unshared_at");
×
479
      return this;
×
480
    }
481

482
    public Builder permissions(WebLinkSharedLinkPermissionsField permissions) {
483
      this.permissions = permissions;
×
484
      return this;
×
485
    }
486

487
    public WebLinkSharedLinkField build() {
488
      return new WebLinkSharedLinkField(this);
×
489
    }
490
  }
491
}
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