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

box / box-java-sdk-gen / #155

30 May 2025 01:03PM UTC coverage: 35.646% (+0.3%) from 35.311%
#155

push

github

web-flow
fix: Fix downscope token to use `retrieveToken` method for token retrieval (box/box-codegen#731) (#320)

4 of 4 new or added lines in 4 files covered. (100.0%)

2952 existing lines in 99 files now uncovered.

15628 of 43842 relevant lines covered (35.65%)

0.36 hits per line

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

10.53
/src/main/java/com/box/sdkgen/schemas/file/FileSharedLinkField.java
1
package com.box.sdkgen.schemas.file;
2

3
import com.box.sdkgen.internal.SerializableObject;
4
import com.box.sdkgen.internal.utils.DateTimeUtils;
5
import com.box.sdkgen.serialization.json.EnumWrapper;
6
import com.fasterxml.jackson.annotation.JsonProperty;
7
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
8
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
9
import java.util.Date;
10
import java.util.Objects;
11

12
public class FileSharedLinkField extends SerializableObject {
13

14
  protected final String url;
15

16
  @JsonProperty("download_url")
17
  protected String downloadUrl;
18

19
  @JsonProperty("vanity_url")
20
  protected String vanityUrl;
21

22
  @JsonProperty("vanity_name")
23
  protected String vanityName;
24

25
  @JsonDeserialize(using = FileSharedLinkAccessField.FileSharedLinkAccessFieldDeserializer.class)
26
  @JsonSerialize(using = FileSharedLinkAccessField.FileSharedLinkAccessFieldSerializer.class)
27
  protected EnumWrapper<FileSharedLinkAccessField> access;
28

29
  @JsonDeserialize(
30
      using =
31
          FileSharedLinkEffectiveAccessField.FileSharedLinkEffectiveAccessFieldDeserializer.class)
32
  @JsonSerialize(
33
      using = FileSharedLinkEffectiveAccessField.FileSharedLinkEffectiveAccessFieldSerializer.class)
34
  @JsonProperty("effective_access")
35
  protected final EnumWrapper<FileSharedLinkEffectiveAccessField> effectiveAccess;
36

37
  @JsonDeserialize(
38
      using =
39
          FileSharedLinkEffectivePermissionField.FileSharedLinkEffectivePermissionFieldDeserializer
40
              .class)
41
  @JsonSerialize(
42
      using =
43
          FileSharedLinkEffectivePermissionField.FileSharedLinkEffectivePermissionFieldSerializer
44
              .class)
45
  @JsonProperty("effective_permission")
46
  protected final EnumWrapper<FileSharedLinkEffectivePermissionField> effectivePermission;
47

48
  @JsonProperty("unshared_at")
49
  @JsonSerialize(using = DateTimeUtils.DateTimeSerializer.class)
50
  @JsonDeserialize(using = DateTimeUtils.DateTimeDeserializer.class)
51
  protected Date unsharedAt;
52

53
  @JsonProperty("is_password_enabled")
54
  protected final boolean isPasswordEnabled;
55

56
  protected FileSharedLinkPermissionsField permissions;
57

58
  @JsonProperty("download_count")
59
  protected final long downloadCount;
60

61
  @JsonProperty("preview_count")
62
  protected final long previewCount;
63

64
  public FileSharedLinkField(
65
      @JsonProperty("url") String url,
66
      @JsonProperty("effective_access")
67
          EnumWrapper<FileSharedLinkEffectiveAccessField> effectiveAccess,
68
      @JsonProperty("effective_permission")
69
          EnumWrapper<FileSharedLinkEffectivePermissionField> effectivePermission,
70
      @JsonProperty("is_password_enabled") boolean isPasswordEnabled,
71
      @JsonProperty("download_count") long downloadCount,
72
      @JsonProperty("preview_count") long previewCount) {
73
    super();
1✔
74
    this.url = url;
1✔
75
    this.effectiveAccess = effectiveAccess;
1✔
76
    this.effectivePermission = effectivePermission;
1✔
77
    this.isPasswordEnabled = isPasswordEnabled;
1✔
78
    this.downloadCount = downloadCount;
1✔
79
    this.previewCount = previewCount;
1✔
80
  }
1✔
81

82
  public FileSharedLinkField(
83
      String url,
84
      FileSharedLinkEffectiveAccessField effectiveAccess,
85
      FileSharedLinkEffectivePermissionField effectivePermission,
86
      boolean isPasswordEnabled,
87
      long downloadCount,
88
      long previewCount) {
UNCOV
89
    super();
×
90
    this.url = url;
×
91
    this.effectiveAccess = new EnumWrapper<FileSharedLinkEffectiveAccessField>(effectiveAccess);
×
92
    this.effectivePermission =
×
93
        new EnumWrapper<FileSharedLinkEffectivePermissionField>(effectivePermission);
UNCOV
94
    this.isPasswordEnabled = isPasswordEnabled;
×
UNCOV
95
    this.downloadCount = downloadCount;
×
96
    this.previewCount = previewCount;
×
97
  }
×
98

99
  protected FileSharedLinkField(FileSharedLinkFieldBuilder builder) {
100
    super();
×
101
    this.url = builder.url;
×
102
    this.downloadUrl = builder.downloadUrl;
×
103
    this.vanityUrl = builder.vanityUrl;
×
104
    this.vanityName = builder.vanityName;
×
105
    this.access = builder.access;
×
106
    this.effectiveAccess = builder.effectiveAccess;
×
107
    this.effectivePermission = builder.effectivePermission;
×
108
    this.unsharedAt = builder.unsharedAt;
×
109
    this.isPasswordEnabled = builder.isPasswordEnabled;
×
UNCOV
110
    this.permissions = builder.permissions;
×
UNCOV
111
    this.downloadCount = builder.downloadCount;
×
UNCOV
112
    this.previewCount = builder.previewCount;
×
UNCOV
113
  }
×
114

115
  public String getUrl() {
116
    return url;
1✔
117
  }
118

119
  public String getDownloadUrl() {
120
    return downloadUrl;
×
121
  }
122

123
  public String getVanityUrl() {
124
    return vanityUrl;
×
125
  }
126

127
  public String getVanityName() {
UNCOV
128
    return vanityName;
×
129
  }
130

131
  public EnumWrapper<FileSharedLinkAccessField> getAccess() {
132
    return access;
1✔
133
  }
134

135
  public EnumWrapper<FileSharedLinkEffectiveAccessField> getEffectiveAccess() {
136
    return effectiveAccess;
×
137
  }
138

139
  public EnumWrapper<FileSharedLinkEffectivePermissionField> getEffectivePermission() {
140
    return effectivePermission;
×
141
  }
142

143
  public Date getUnsharedAt() {
144
    return unsharedAt;
×
145
  }
146

147
  public boolean getIsPasswordEnabled() {
148
    return isPasswordEnabled;
×
149
  }
150

151
  public FileSharedLinkPermissionsField getPermissions() {
152
    return permissions;
×
153
  }
154

155
  public long getDownloadCount() {
156
    return downloadCount;
×
157
  }
158

159
  public long getPreviewCount() {
UNCOV
160
    return previewCount;
×
161
  }
162

163
  @Override
164
  public boolean equals(Object o) {
165
    if (this == o) {
×
UNCOV
166
      return true;
×
167
    }
168
    if (o == null || getClass() != o.getClass()) {
×
169
      return false;
×
170
    }
171
    FileSharedLinkField casted = (FileSharedLinkField) o;
×
172
    return Objects.equals(url, casted.url)
×
173
        && Objects.equals(downloadUrl, casted.downloadUrl)
×
174
        && Objects.equals(vanityUrl, casted.vanityUrl)
×
175
        && Objects.equals(vanityName, casted.vanityName)
×
176
        && Objects.equals(access, casted.access)
×
177
        && Objects.equals(effectiveAccess, casted.effectiveAccess)
×
178
        && Objects.equals(effectivePermission, casted.effectivePermission)
×
179
        && Objects.equals(unsharedAt, casted.unsharedAt)
×
UNCOV
180
        && Objects.equals(isPasswordEnabled, casted.isPasswordEnabled)
×
UNCOV
181
        && Objects.equals(permissions, casted.permissions)
×
UNCOV
182
        && Objects.equals(downloadCount, casted.downloadCount)
×
UNCOV
183
        && Objects.equals(previewCount, casted.previewCount);
×
184
  }
185

186
  @Override
187
  public int hashCode() {
UNCOV
188
    return Objects.hash(
×
189
        url,
190
        downloadUrl,
191
        vanityUrl,
192
        vanityName,
193
        access,
194
        effectiveAccess,
195
        effectivePermission,
196
        unsharedAt,
UNCOV
197
        isPasswordEnabled,
×
198
        permissions,
UNCOV
199
        downloadCount,
×
UNCOV
200
        previewCount);
×
201
  }
202

203
  @Override
204
  public String toString() {
UNCOV
205
    return "FileSharedLinkField{"
×
206
        + "url='"
207
        + url
208
        + '\''
209
        + ", "
210
        + "downloadUrl='"
211
        + downloadUrl
212
        + '\''
213
        + ", "
214
        + "vanityUrl='"
215
        + vanityUrl
216
        + '\''
217
        + ", "
218
        + "vanityName='"
219
        + vanityName
220
        + '\''
221
        + ", "
222
        + "access='"
223
        + access
224
        + '\''
225
        + ", "
226
        + "effectiveAccess='"
227
        + effectiveAccess
228
        + '\''
229
        + ", "
230
        + "effectivePermission='"
231
        + effectivePermission
232
        + '\''
233
        + ", "
234
        + "unsharedAt='"
235
        + unsharedAt
236
        + '\''
237
        + ", "
238
        + "isPasswordEnabled='"
239
        + isPasswordEnabled
240
        + '\''
241
        + ", "
242
        + "permissions='"
243
        + permissions
244
        + '\''
245
        + ", "
246
        + "downloadCount='"
247
        + downloadCount
248
        + '\''
249
        + ", "
250
        + "previewCount='"
251
        + previewCount
252
        + '\''
253
        + "}";
254
  }
255

256
  public static class FileSharedLinkFieldBuilder {
257

258
    protected final String url;
259

260
    protected String downloadUrl;
261

262
    protected String vanityUrl;
263

264
    protected String vanityName;
265

266
    protected EnumWrapper<FileSharedLinkAccessField> access;
267

268
    protected final EnumWrapper<FileSharedLinkEffectiveAccessField> effectiveAccess;
269

270
    protected final EnumWrapper<FileSharedLinkEffectivePermissionField> effectivePermission;
271

272
    protected Date unsharedAt;
273

274
    protected final boolean isPasswordEnabled;
275

276
    protected FileSharedLinkPermissionsField permissions;
277

278
    protected final long downloadCount;
279

280
    protected final long previewCount;
281

282
    public FileSharedLinkFieldBuilder(
283
        String url,
284
        EnumWrapper<FileSharedLinkEffectiveAccessField> effectiveAccess,
285
        EnumWrapper<FileSharedLinkEffectivePermissionField> effectivePermission,
286
        boolean isPasswordEnabled,
287
        long downloadCount,
288
        long previewCount) {
×
289
      this.url = url;
×
290
      this.effectiveAccess = effectiveAccess;
×
291
      this.effectivePermission = effectivePermission;
×
UNCOV
292
      this.isPasswordEnabled = isPasswordEnabled;
×
UNCOV
293
      this.downloadCount = downloadCount;
×
UNCOV
294
      this.previewCount = previewCount;
×
UNCOV
295
    }
×
296

297
    public FileSharedLinkFieldBuilder(
298
        String url,
299
        FileSharedLinkEffectiveAccessField effectiveAccess,
300
        FileSharedLinkEffectivePermissionField effectivePermission,
301
        boolean isPasswordEnabled,
302
        long downloadCount,
UNCOV
303
        long previewCount) {
×
304
      this.url = url;
×
305
      this.effectiveAccess = new EnumWrapper<FileSharedLinkEffectiveAccessField>(effectiveAccess);
×
306
      this.effectivePermission =
×
307
          new EnumWrapper<FileSharedLinkEffectivePermissionField>(effectivePermission);
UNCOV
308
      this.isPasswordEnabled = isPasswordEnabled;
×
UNCOV
309
      this.downloadCount = downloadCount;
×
310
      this.previewCount = previewCount;
×
311
    }
×
312

313
    public FileSharedLinkFieldBuilder downloadUrl(String downloadUrl) {
UNCOV
314
      this.downloadUrl = downloadUrl;
×
315
      return this;
×
316
    }
317

318
    public FileSharedLinkFieldBuilder vanityUrl(String vanityUrl) {
UNCOV
319
      this.vanityUrl = vanityUrl;
×
320
      return this;
×
321
    }
322

323
    public FileSharedLinkFieldBuilder vanityName(String vanityName) {
UNCOV
324
      this.vanityName = vanityName;
×
325
      return this;
×
326
    }
327

328
    public FileSharedLinkFieldBuilder access(FileSharedLinkAccessField access) {
UNCOV
329
      this.access = new EnumWrapper<FileSharedLinkAccessField>(access);
×
330
      return this;
×
331
    }
332

333
    public FileSharedLinkFieldBuilder access(EnumWrapper<FileSharedLinkAccessField> access) {
UNCOV
334
      this.access = access;
×
335
      return this;
×
336
    }
337

338
    public FileSharedLinkFieldBuilder unsharedAt(Date unsharedAt) {
UNCOV
339
      this.unsharedAt = unsharedAt;
×
340
      return this;
×
341
    }
342

343
    public FileSharedLinkFieldBuilder permissions(FileSharedLinkPermissionsField permissions) {
UNCOV
344
      this.permissions = permissions;
×
345
      return this;
×
346
    }
347

348
    public FileSharedLinkField build() {
UNCOV
349
      return new FileSharedLinkField(this);
×
350
    }
351
  }
352
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc