• 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/file/FileSharedLinkField.java
1
package com.box.sdkgen.schemas.file;
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 FileSharedLinkField 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(using = FileSharedLinkAccessField.FileSharedLinkAccessFieldDeserializer.class)
64
  @JsonSerialize(using = FileSharedLinkAccessField.FileSharedLinkAccessFieldSerializer.class)
65
  protected EnumWrapper<FileSharedLinkAccessField> access;
66

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

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

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

106
  /** Defines if the shared link requires a password to access the item. */
107
  @JsonProperty("is_password_enabled")
108
  protected final boolean isPasswordEnabled;
109

110
  /**
111
   * Defines if this link allows a user to preview, edit, and download an item. These permissions
112
   * refer to the shared link only and do not supersede permissions applied to the item itself.
113
   */
114
  protected FileSharedLinkPermissionsField permissions;
115

116
  /** The number of times this item has been downloaded. */
117
  @JsonProperty("download_count")
118
  protected final long downloadCount;
119

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

124
  public FileSharedLinkField(
125
      String url,
126
      FileSharedLinkEffectiveAccessField effectiveAccess,
127
      FileSharedLinkEffectivePermissionField effectivePermission,
128
      boolean isPasswordEnabled,
129
      long downloadCount,
130
      long previewCount) {
131
    super();
×
132
    this.url = url;
×
133
    this.effectiveAccess = new EnumWrapper<FileSharedLinkEffectiveAccessField>(effectiveAccess);
×
134
    this.effectivePermission =
×
135
        new EnumWrapper<FileSharedLinkEffectivePermissionField>(effectivePermission);
136
    this.isPasswordEnabled = isPasswordEnabled;
×
137
    this.downloadCount = downloadCount;
×
138
    this.previewCount = previewCount;
×
139
  }
×
140

141
  public FileSharedLinkField(
142
      String url,
143
      FileSharedLinkEffectiveAccessField effectiveAccess,
144
      EnumWrapper<FileSharedLinkEffectivePermissionField> effectivePermission,
145
      boolean isPasswordEnabled,
146
      long downloadCount,
147
      long previewCount) {
148
    super();
×
149
    this.url = url;
×
150
    this.effectiveAccess = new EnumWrapper<FileSharedLinkEffectiveAccessField>(effectiveAccess);
×
151
    this.effectivePermission = effectivePermission;
×
152
    this.isPasswordEnabled = isPasswordEnabled;
×
153
    this.downloadCount = downloadCount;
×
154
    this.previewCount = previewCount;
×
155
  }
×
156

157
  public FileSharedLinkField(
158
      String url,
159
      EnumWrapper<FileSharedLinkEffectiveAccessField> effectiveAccess,
160
      FileSharedLinkEffectivePermissionField effectivePermission,
161
      boolean isPasswordEnabled,
162
      long downloadCount,
163
      long previewCount) {
164
    super();
×
165
    this.url = url;
×
166
    this.effectiveAccess = effectiveAccess;
×
167
    this.effectivePermission =
×
168
        new EnumWrapper<FileSharedLinkEffectivePermissionField>(effectivePermission);
169
    this.isPasswordEnabled = isPasswordEnabled;
×
170
    this.downloadCount = downloadCount;
×
171
    this.previewCount = previewCount;
×
172
  }
×
173

174
  public FileSharedLinkField(
175
      @JsonProperty("url") String url,
176
      @JsonProperty("effective_access")
177
          EnumWrapper<FileSharedLinkEffectiveAccessField> effectiveAccess,
178
      @JsonProperty("effective_permission")
179
          EnumWrapper<FileSharedLinkEffectivePermissionField> effectivePermission,
180
      @JsonProperty("is_password_enabled") boolean isPasswordEnabled,
181
      @JsonProperty("download_count") long downloadCount,
182
      @JsonProperty("preview_count") long previewCount) {
183
    super();
1✔
184
    this.url = url;
1✔
185
    this.effectiveAccess = effectiveAccess;
1✔
186
    this.effectivePermission = effectivePermission;
1✔
187
    this.isPasswordEnabled = isPasswordEnabled;
1✔
188
    this.downloadCount = downloadCount;
1✔
189
    this.previewCount = previewCount;
1✔
190
  }
1✔
191

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

209
  public String getUrl() {
210
    return url;
1✔
211
  }
212

213
  public String getDownloadUrl() {
214
    return downloadUrl;
×
215
  }
216

217
  public String getVanityUrl() {
218
    return vanityUrl;
×
219
  }
220

221
  public String getVanityName() {
222
    return vanityName;
×
223
  }
224

225
  public EnumWrapper<FileSharedLinkAccessField> getAccess() {
226
    return access;
1✔
227
  }
228

229
  public EnumWrapper<FileSharedLinkEffectiveAccessField> getEffectiveAccess() {
230
    return effectiveAccess;
×
231
  }
232

233
  public EnumWrapper<FileSharedLinkEffectivePermissionField> getEffectivePermission() {
234
    return effectivePermission;
×
235
  }
236

237
  public OffsetDateTime getUnsharedAt() {
238
    return unsharedAt;
×
239
  }
240

241
  public boolean getIsPasswordEnabled() {
242
    return isPasswordEnabled;
×
243
  }
244

245
  public FileSharedLinkPermissionsField getPermissions() {
246
    return permissions;
×
247
  }
248

249
  public long getDownloadCount() {
250
    return downloadCount;
×
251
  }
252

253
  public long getPreviewCount() {
254
    return previewCount;
×
255
  }
256

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

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

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

350
  public static class Builder extends NullableFieldTracker {
351

352
    protected final String url;
353

354
    protected String downloadUrl;
355

356
    protected String vanityUrl;
357

358
    protected String vanityName;
359

360
    protected EnumWrapper<FileSharedLinkAccessField> access;
361

362
    protected final EnumWrapper<FileSharedLinkEffectiveAccessField> effectiveAccess;
363

364
    protected final EnumWrapper<FileSharedLinkEffectivePermissionField> effectivePermission;
365

366
    protected OffsetDateTime unsharedAt;
367

368
    protected final boolean isPasswordEnabled;
369

370
    protected FileSharedLinkPermissionsField permissions;
371

372
    protected final long downloadCount;
373

374
    protected final long previewCount;
375

376
    public Builder(
377
        String url,
378
        FileSharedLinkEffectiveAccessField effectiveAccess,
379
        FileSharedLinkEffectivePermissionField effectivePermission,
380
        boolean isPasswordEnabled,
381
        long downloadCount,
382
        long previewCount) {
383
      super();
×
384
      this.url = url;
×
385
      this.effectiveAccess = new EnumWrapper<FileSharedLinkEffectiveAccessField>(effectiveAccess);
×
386
      this.effectivePermission =
×
387
          new EnumWrapper<FileSharedLinkEffectivePermissionField>(effectivePermission);
388
      this.isPasswordEnabled = isPasswordEnabled;
×
389
      this.downloadCount = downloadCount;
×
390
      this.previewCount = previewCount;
×
391
    }
×
392

393
    public Builder(
394
        String url,
395
        FileSharedLinkEffectiveAccessField effectiveAccess,
396
        EnumWrapper<FileSharedLinkEffectivePermissionField> effectivePermission,
397
        boolean isPasswordEnabled,
398
        long downloadCount,
399
        long previewCount) {
400
      super();
×
401
      this.url = url;
×
402
      this.effectiveAccess = new EnumWrapper<FileSharedLinkEffectiveAccessField>(effectiveAccess);
×
403
      this.effectivePermission = effectivePermission;
×
404
      this.isPasswordEnabled = isPasswordEnabled;
×
405
      this.downloadCount = downloadCount;
×
406
      this.previewCount = previewCount;
×
407
    }
×
408

409
    public Builder(
410
        String url,
411
        EnumWrapper<FileSharedLinkEffectiveAccessField> effectiveAccess,
412
        FileSharedLinkEffectivePermissionField effectivePermission,
413
        boolean isPasswordEnabled,
414
        long downloadCount,
415
        long previewCount) {
416
      super();
×
417
      this.url = url;
×
418
      this.effectiveAccess = effectiveAccess;
×
419
      this.effectivePermission =
×
420
          new EnumWrapper<FileSharedLinkEffectivePermissionField>(effectivePermission);
421
      this.isPasswordEnabled = isPasswordEnabled;
×
422
      this.downloadCount = downloadCount;
×
423
      this.previewCount = previewCount;
×
424
    }
×
425

426
    public Builder(
427
        String url,
428
        EnumWrapper<FileSharedLinkEffectiveAccessField> effectiveAccess,
429
        EnumWrapper<FileSharedLinkEffectivePermissionField> effectivePermission,
430
        boolean isPasswordEnabled,
431
        long downloadCount,
432
        long previewCount) {
433
      super();
×
434
      this.url = url;
×
435
      this.effectiveAccess = effectiveAccess;
×
436
      this.effectivePermission = effectivePermission;
×
437
      this.isPasswordEnabled = isPasswordEnabled;
×
438
      this.downloadCount = downloadCount;
×
439
      this.previewCount = previewCount;
×
440
    }
×
441

442
    public Builder downloadUrl(String downloadUrl) {
443
      this.downloadUrl = downloadUrl;
×
444
      this.markNullableFieldAsSet("download_url");
×
445
      return this;
×
446
    }
447

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

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

460
    public Builder access(FileSharedLinkAccessField access) {
461
      this.access = new EnumWrapper<FileSharedLinkAccessField>(access);
×
462
      return this;
×
463
    }
464

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

470
    public Builder unsharedAt(OffsetDateTime unsharedAt) {
471
      this.unsharedAt = unsharedAt;
×
472
      this.markNullableFieldAsSet("unshared_at");
×
473
      return this;
×
474
    }
475

476
    public Builder permissions(FileSharedLinkPermissionsField permissions) {
477
      this.permissions = permissions;
×
478
      return this;
×
479
    }
480

481
    public FileSharedLinkField build() {
482
      return new FileSharedLinkField(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