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

box / box-java-sdk / #7690

28 Oct 2026 03:14PM UTC coverage: 34.078% (-0.04%) from 34.12%
#7690

push

github

web-flow
feat: add `DocumentSplitManager` and document split APIs + OTP for shared links (box/box-openapi#621)

Co-authored-by: Tsitsi Nyamutswa <128546813+tnyamutswa@users.noreply.github.com>

47 of 1790 new or added lines in 64 files covered. (2.63%)

485 existing lines in 22 files now uncovered.

20002 of 58694 relevant lines covered (34.08%)

0.34 hits per line

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

0.0
/src/main/java/com/box/sdkgen/managers/files/UpdateFileByIdRequestBodySharedLinkField.java
1
package com.box.sdkgen.managers.files;
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.schemas.sharedlinkotpwritable.SharedLinkOtpWritable;
8
import com.box.sdkgen.schemas.sharedlinkotpwritableallowlist.SharedLinkOtpWritableAllowlist;
9
import com.box.sdkgen.schemas.sharedlinkotpwritablenone.SharedLinkOtpWritableNone;
10
import com.box.sdkgen.schemas.sharedlinkotpwritableopen.SharedLinkOtpWritableOpen;
11
import com.box.sdkgen.serialization.json.EnumWrapper;
12
import com.fasterxml.jackson.annotation.JsonFilter;
13
import com.fasterxml.jackson.annotation.JsonProperty;
14
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
15
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
16
import java.time.OffsetDateTime;
17
import java.util.Objects;
18

19
@JsonFilter("nullablePropertyFilter")
20
public class UpdateFileByIdRequestBodySharedLinkField extends SerializableObject {
21

22
  /**
23
   * The level of access for the shared link. This can be restricted to anyone with the link
24
   * (`open`), only people within the company (`company`) and only those who have been invited to
25
   * the folder (`collaborators`).
26
   *
27
   * <p>If not set, this field defaults to the access level specified by the enterprise admin. To
28
   * create a shared link with this default setting pass the `shared_link` object with no `access`
29
   * field, for example `{ "shared_link": {} }`.
30
   *
31
   * <p>The `company` access level is only available to paid accounts.
32
   */
33
  @JsonDeserialize(
34
      using =
35
          UpdateFileByIdRequestBodySharedLinkAccessField
36
              .UpdateFileByIdRequestBodySharedLinkAccessFieldDeserializer.class)
37
  @JsonSerialize(
38
      using =
39
          UpdateFileByIdRequestBodySharedLinkAccessField
40
              .UpdateFileByIdRequestBodySharedLinkAccessFieldSerializer.class)
41
  protected EnumWrapper<UpdateFileByIdRequestBodySharedLinkAccessField> access;
42

43
  /**
44
   * The password required to access the shared link. Set the password to `null` to remove it.
45
   * Passwords must now be at least eight characters long and include a number, upper case letter,
46
   * or a non-numeric or non-alphabetic character. A password can only be set when `access` is set
47
   * to `open`.
48
   */
49
  @Nullable protected String password;
50

51
  /**
52
   * Defines a custom vanity name to use in the shared link URL, for example
53
   * `https://app.box.com/v/my-shared-link`.
54
   *
55
   * <p>Custom URLs should not be used when sharing sensitive content as vanity URLs are a lot
56
   * easier to guess than regular shared links.
57
   */
58
  @JsonProperty("vanity_name")
59
  protected String vanityName;
60

61
  /**
62
   * The timestamp at which this shared link will expire. This field can only be set by users with
63
   * paid accounts.
64
   */
65
  @JsonProperty("unshared_at")
66
  @JsonSerialize(using = DateTimeUtils.DateTimeSerializer.class)
67
  @JsonDeserialize(using = DateTimeUtils.DateTimeDeserializer.class)
68
  protected OffsetDateTime unsharedAt;
69

70
  protected UpdateFileByIdRequestBodySharedLinkPermissionsField permissions;
71

72
  @JsonProperty("one_time_passcode")
73
  protected SharedLinkOtpWritable oneTimePasscode;
74

75
  public UpdateFileByIdRequestBodySharedLinkField() {
UNCOV
76
    super();
×
UNCOV
77
  }
×
78

79
  protected UpdateFileByIdRequestBodySharedLinkField(Builder builder) {
UNCOV
80
    super();
×
UNCOV
81
    this.access = builder.access;
×
UNCOV
82
    this.password = builder.password;
×
83
    this.vanityName = builder.vanityName;
×
84
    this.unsharedAt = builder.unsharedAt;
×
UNCOV
85
    this.permissions = builder.permissions;
×
NEW
86
    this.oneTimePasscode = builder.oneTimePasscode;
×
87
    markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
×
88
  }
×
89

90
  public EnumWrapper<UpdateFileByIdRequestBodySharedLinkAccessField> getAccess() {
91
    return access;
×
92
  }
93

94
  public String getPassword() {
95
    return password;
×
96
  }
97

98
  public String getVanityName() {
99
    return vanityName;
×
100
  }
101

102
  public OffsetDateTime getUnsharedAt() {
103
    return unsharedAt;
×
104
  }
105

106
  public UpdateFileByIdRequestBodySharedLinkPermissionsField getPermissions() {
107
    return permissions;
×
108
  }
109

110
  public SharedLinkOtpWritable getOneTimePasscode() {
NEW
111
    return oneTimePasscode;
×
112
  }
113

114
  @Override
115
  public boolean equals(Object o) {
UNCOV
116
    if (this == o) {
×
UNCOV
117
      return true;
×
118
    }
119
    if (o == null || getClass() != o.getClass()) {
×
UNCOV
120
      return false;
×
121
    }
UNCOV
122
    UpdateFileByIdRequestBodySharedLinkField casted = (UpdateFileByIdRequestBodySharedLinkField) o;
×
123
    return Objects.equals(access, casted.access)
×
UNCOV
124
        && Objects.equals(password, casted.password)
×
UNCOV
125
        && Objects.equals(vanityName, casted.vanityName)
×
UNCOV
126
        && Objects.equals(unsharedAt, casted.unsharedAt)
×
NEW
127
        && Objects.equals(permissions, casted.permissions)
×
NEW
128
        && Objects.equals(oneTimePasscode, casted.oneTimePasscode);
×
129
  }
130

131
  @Override
132
  public int hashCode() {
NEW
133
    return Objects.hash(access, password, vanityName, unsharedAt, permissions, oneTimePasscode);
×
134
  }
135

136
  @Override
137
  public String toString() {
138
    return "UpdateFileByIdRequestBodySharedLinkField{"
×
139
        + "access='"
140
        + access
141
        + '\''
142
        + ", "
143
        + "password='"
144
        + password
145
        + '\''
146
        + ", "
147
        + "vanityName='"
148
        + vanityName
149
        + '\''
150
        + ", "
151
        + "unsharedAt='"
152
        + unsharedAt
153
        + '\''
154
        + ", "
155
        + "permissions='"
156
        + permissions
157
        + '\''
158
        + ", "
159
        + "oneTimePasscode='"
160
        + oneTimePasscode
161
        + '\''
162
        + "}";
163
  }
164

UNCOV
165
  public static class Builder extends NullableFieldTracker {
×
166

167
    protected EnumWrapper<UpdateFileByIdRequestBodySharedLinkAccessField> access;
168

169
    protected String password;
170

171
    protected String vanityName;
172

173
    protected OffsetDateTime unsharedAt;
174

175
    protected UpdateFileByIdRequestBodySharedLinkPermissionsField permissions;
176

177
    protected SharedLinkOtpWritable oneTimePasscode;
178

179
    public Builder access(UpdateFileByIdRequestBodySharedLinkAccessField access) {
UNCOV
180
      this.access = new EnumWrapper<UpdateFileByIdRequestBodySharedLinkAccessField>(access);
×
UNCOV
181
      return this;
×
182
    }
183

184
    public Builder access(EnumWrapper<UpdateFileByIdRequestBodySharedLinkAccessField> access) {
UNCOV
185
      this.access = access;
×
UNCOV
186
      return this;
×
187
    }
188

189
    public Builder password(String password) {
UNCOV
190
      this.password = password;
×
UNCOV
191
      this.markNullableFieldAsSet("password");
×
UNCOV
192
      return this;
×
193
    }
194

195
    public Builder vanityName(String vanityName) {
UNCOV
196
      this.vanityName = vanityName;
×
UNCOV
197
      return this;
×
198
    }
199

200
    public Builder unsharedAt(OffsetDateTime unsharedAt) {
UNCOV
201
      this.unsharedAt = unsharedAt;
×
UNCOV
202
      return this;
×
203
    }
204

205
    public Builder permissions(UpdateFileByIdRequestBodySharedLinkPermissionsField permissions) {
UNCOV
206
      this.permissions = permissions;
×
UNCOV
207
      return this;
×
208
    }
209

210
    public Builder oneTimePasscode(SharedLinkOtpWritableNone oneTimePasscode) {
NEW
211
      this.oneTimePasscode = new SharedLinkOtpWritable(oneTimePasscode);
×
NEW
212
      return this;
×
213
    }
214

215
    public Builder oneTimePasscode(SharedLinkOtpWritableOpen oneTimePasscode) {
NEW
216
      this.oneTimePasscode = new SharedLinkOtpWritable(oneTimePasscode);
×
NEW
217
      return this;
×
218
    }
219

220
    public Builder oneTimePasscode(SharedLinkOtpWritableAllowlist oneTimePasscode) {
NEW
221
      this.oneTimePasscode = new SharedLinkOtpWritable(oneTimePasscode);
×
NEW
222
      return this;
×
223
    }
224

225
    public Builder oneTimePasscode(SharedLinkOtpWritable oneTimePasscode) {
NEW
226
      this.oneTimePasscode = oneTimePasscode;
×
NEW
227
      return this;
×
228
    }
229

230
    public UpdateFileByIdRequestBodySharedLinkField build() {
231
      return new UpdateFileByIdRequestBodySharedLinkField(this);
×
232
    }
233
  }
234
}
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