• 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/folder/FolderSharedLinkField.java
1
package com.box.sdkgen.schemas.folder;
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 FolderSharedLinkField 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 = FolderSharedLinkAccessField.FolderSharedLinkAccessFieldDeserializer.class)
65
  @JsonSerialize(using = FolderSharedLinkAccessField.FolderSharedLinkAccessFieldSerializer.class)
66
  protected EnumWrapper<FolderSharedLinkAccessField> 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
          FolderSharedLinkEffectiveAccessField.FolderSharedLinkEffectiveAccessFieldDeserializer
76
              .class)
77
  @JsonSerialize(
78
      using =
79
          FolderSharedLinkEffectiveAccessField.FolderSharedLinkEffectiveAccessFieldSerializer.class)
80
  @JsonProperty("effective_access")
81
  protected final EnumWrapper<FolderSharedLinkEffectiveAccessField> effectiveAccess;
82

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

248
  public FolderSharedLinkPermissionsField getPermissions() {
249
    return permissions;
×
250
  }
251

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

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

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

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

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

353
  public static class Builder extends NullableFieldTracker {
354

355
    protected final String url;
356

357
    protected String downloadUrl;
358

359
    protected String vanityUrl;
360

361
    protected String vanityName;
362

363
    protected EnumWrapper<FolderSharedLinkAccessField> access;
364

365
    protected final EnumWrapper<FolderSharedLinkEffectiveAccessField> effectiveAccess;
366

367
    protected final EnumWrapper<FolderSharedLinkEffectivePermissionField> effectivePermission;
368

369
    protected OffsetDateTime unsharedAt;
370

371
    protected final boolean isPasswordEnabled;
372

373
    protected FolderSharedLinkPermissionsField permissions;
374

375
    protected final long downloadCount;
376

377
    protected final long previewCount;
378

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

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

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

429
    public Builder(
430
        String url,
431
        EnumWrapper<FolderSharedLinkEffectiveAccessField> effectiveAccess,
432
        EnumWrapper<FolderSharedLinkEffectivePermissionField> effectivePermission,
433
        boolean isPasswordEnabled,
434
        long downloadCount,
435
        long previewCount) {
436
      super();
×
437
      this.url = url;
×
438
      this.effectiveAccess = effectiveAccess;
×
439
      this.effectivePermission = effectivePermission;
×
440
      this.isPasswordEnabled = isPasswordEnabled;
×
441
      this.downloadCount = downloadCount;
×
442
      this.previewCount = previewCount;
×
443
    }
×
444

445
    public Builder downloadUrl(String downloadUrl) {
446
      this.downloadUrl = downloadUrl;
×
447
      this.markNullableFieldAsSet("download_url");
×
448
      return this;
×
449
    }
450

451
    public Builder vanityUrl(String vanityUrl) {
452
      this.vanityUrl = vanityUrl;
×
453
      this.markNullableFieldAsSet("vanity_url");
×
454
      return this;
×
455
    }
456

457
    public Builder vanityName(String vanityName) {
458
      this.vanityName = vanityName;
×
459
      this.markNullableFieldAsSet("vanity_name");
×
460
      return this;
×
461
    }
462

463
    public Builder access(FolderSharedLinkAccessField access) {
464
      this.access = new EnumWrapper<FolderSharedLinkAccessField>(access);
×
465
      return this;
×
466
    }
467

468
    public Builder access(EnumWrapper<FolderSharedLinkAccessField> access) {
469
      this.access = access;
×
470
      return this;
×
471
    }
472

473
    public Builder unsharedAt(OffsetDateTime unsharedAt) {
474
      this.unsharedAt = unsharedAt;
×
475
      this.markNullableFieldAsSet("unshared_at");
×
476
      return this;
×
477
    }
478

479
    public Builder permissions(FolderSharedLinkPermissionsField permissions) {
480
      this.permissions = permissions;
×
481
      return this;
×
482
    }
483

484
    public FolderSharedLinkField build() {
485
      return new FolderSharedLinkField(this);
×
486
    }
487
  }
488
}
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