• 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

48.39
/src/main/java/com/box/sdkgen/managers/files/UpdateFileByIdRequestBody.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.fasterxml.jackson.annotation.JsonFilter;
8
import com.fasterxml.jackson.annotation.JsonProperty;
9
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
10
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
11
import java.time.OffsetDateTime;
12
import java.util.List;
13
import java.util.Objects;
14

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

18
  /**
19
   * An optional different name for the file. This can be used to rename the file.
20
   *
21
   * <p>File names must be unique within their parent folder. The name check is case-insensitive, so
22
   * a file named `New File` cannot be created in a parent folder that already contains a folder
23
   * named `new file`.
24
   */
25
  protected String name;
26

27
  /**
28
   * The description for a file. This can be seen in the right-hand sidebar panel when viewing a
29
   * file in the Box web app. Additionally, this index is used in the search index of the file,
30
   * allowing users to find the file by the content in the description.
31
   */
32
  protected String description;
33

34
  protected UpdateFileByIdRequestBodyParentField parent;
35

36
  @JsonProperty("shared_link")
37
  @Nullable
38
  protected UpdateFileByIdRequestBodySharedLinkField sharedLink;
39

40
  /**
41
   * Defines a lock on an item. This prevents the item from being moved, renamed, or otherwise
42
   * changed by anyone other than the user who created the lock.
43
   *
44
   * <p>Set this to `null` to remove the lock.
45
   */
46
  @Nullable protected UpdateFileByIdRequestBodyLockField lock;
47

48
  /**
49
   * The retention expiration timestamp for the given file. This date cannot be shortened once set
50
   * on a file.
51
   */
52
  @JsonProperty("disposition_at")
53
  @JsonSerialize(using = DateTimeUtils.DateTimeSerializer.class)
54
  @JsonDeserialize(using = DateTimeUtils.DateTimeDeserializer.class)
55
  protected OffsetDateTime dispositionAt;
56

57
  /** Defines who can download a file. */
58
  protected UpdateFileByIdRequestBodyPermissionsField permissions;
59

60
  /**
61
   * An array of collections to make this file a member of. Currently we only support the
62
   * `favorites` collection.
63
   *
64
   * <p>To get the ID for a collection, use the [List all collections][1] endpoint.
65
   *
66
   * <p>Passing an empty array `[]` or `null` will remove the file from all collections.
67
   *
68
   * <p>[1]: e://get-collections
69
   */
70
  @Nullable protected List<UpdateFileByIdRequestBodyCollectionsField> collections;
71

72
  /**
73
   * The tags for this item. These tags are shown in the Box web app and mobile apps next to an
74
   * item.
75
   *
76
   * <p>To add or remove a tag, retrieve the item's current tags, modify them, and then update this
77
   * field.
78
   *
79
   * <p>There is a limit of 100 tags per item, and 10,000 unique tags per enterprise.
80
   */
81
  protected List<String> tags;
82

83
  public UpdateFileByIdRequestBody() {
84
    super();
×
85
  }
×
86

87
  protected UpdateFileByIdRequestBody(Builder builder) {
88
    super();
1✔
89
    this.name = builder.name;
1✔
90
    this.description = builder.description;
1✔
91
    this.parent = builder.parent;
1✔
92
    this.sharedLink = builder.sharedLink;
1✔
93
    this.lock = builder.lock;
1✔
94
    this.dispositionAt = builder.dispositionAt;
1✔
95
    this.permissions = builder.permissions;
1✔
96
    this.collections = builder.collections;
1✔
97
    this.tags = builder.tags;
1✔
98
    markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
1✔
99
  }
1✔
100

101
  public String getName() {
102
    return name;
1✔
103
  }
104

105
  public String getDescription() {
106
    return description;
1✔
107
  }
108

109
  public UpdateFileByIdRequestBodyParentField getParent() {
110
    return parent;
1✔
111
  }
112

113
  public UpdateFileByIdRequestBodySharedLinkField getSharedLink() {
114
    return sharedLink;
1✔
115
  }
116

117
  public UpdateFileByIdRequestBodyLockField getLock() {
118
    return lock;
1✔
119
  }
120

121
  public OffsetDateTime getDispositionAt() {
122
    return dispositionAt;
1✔
123
  }
124

125
  public UpdateFileByIdRequestBodyPermissionsField getPermissions() {
126
    return permissions;
1✔
127
  }
128

129
  public List<UpdateFileByIdRequestBodyCollectionsField> getCollections() {
130
    return collections;
1✔
131
  }
132

133
  public List<String> getTags() {
134
    return tags;
1✔
135
  }
136

137
  @Override
138
  public boolean equals(Object o) {
139
    if (this == o) {
×
140
      return true;
×
141
    }
142
    if (o == null || getClass() != o.getClass()) {
×
143
      return false;
×
144
    }
145
    UpdateFileByIdRequestBody casted = (UpdateFileByIdRequestBody) o;
×
146
    return Objects.equals(name, casted.name)
×
147
        && Objects.equals(description, casted.description)
×
148
        && Objects.equals(parent, casted.parent)
×
149
        && Objects.equals(sharedLink, casted.sharedLink)
×
150
        && Objects.equals(lock, casted.lock)
×
151
        && Objects.equals(dispositionAt, casted.dispositionAt)
×
152
        && Objects.equals(permissions, casted.permissions)
×
153
        && Objects.equals(collections, casted.collections)
×
154
        && Objects.equals(tags, casted.tags);
×
155
  }
156

157
  @Override
158
  public int hashCode() {
159
    return Objects.hash(
×
160
        name, description, parent, sharedLink, lock, dispositionAt, permissions, collections, tags);
161
  }
162

163
  @Override
164
  public String toString() {
165
    return "UpdateFileByIdRequestBody{"
×
166
        + "name='"
167
        + name
168
        + '\''
169
        + ", "
170
        + "description='"
171
        + description
172
        + '\''
173
        + ", "
174
        + "parent='"
175
        + parent
176
        + '\''
177
        + ", "
178
        + "sharedLink='"
179
        + sharedLink
180
        + '\''
181
        + ", "
182
        + "lock='"
183
        + lock
184
        + '\''
185
        + ", "
186
        + "dispositionAt='"
187
        + dispositionAt
188
        + '\''
189
        + ", "
190
        + "permissions='"
191
        + permissions
192
        + '\''
193
        + ", "
194
        + "collections='"
195
        + collections
196
        + '\''
197
        + ", "
198
        + "tags='"
199
        + tags
200
        + '\''
201
        + "}";
202
  }
203

204
  public static class Builder extends NullableFieldTracker {
1✔
205

206
    protected String name;
207

208
    protected String description;
209

210
    protected UpdateFileByIdRequestBodyParentField parent;
211

212
    protected UpdateFileByIdRequestBodySharedLinkField sharedLink;
213

214
    protected UpdateFileByIdRequestBodyLockField lock;
215

216
    protected OffsetDateTime dispositionAt;
217

218
    protected UpdateFileByIdRequestBodyPermissionsField permissions;
219

220
    protected List<UpdateFileByIdRequestBodyCollectionsField> collections;
221

222
    protected List<String> tags;
223

224
    public Builder name(String name) {
225
      this.name = name;
1✔
226
      return this;
1✔
227
    }
228

229
    public Builder description(String description) {
230
      this.description = description;
1✔
231
      return this;
1✔
232
    }
233

234
    public Builder parent(UpdateFileByIdRequestBodyParentField parent) {
235
      this.parent = parent;
×
236
      return this;
×
237
    }
238

239
    public Builder sharedLink(UpdateFileByIdRequestBodySharedLinkField sharedLink) {
240
      this.sharedLink = sharedLink;
×
241
      this.markNullableFieldAsSet("shared_link");
×
242
      return this;
×
243
    }
244

245
    public Builder lock(UpdateFileByIdRequestBodyLockField lock) {
246
      this.lock = lock;
1✔
247
      this.markNullableFieldAsSet("lock");
1✔
248
      return this;
1✔
249
    }
250

251
    public Builder dispositionAt(OffsetDateTime dispositionAt) {
252
      this.dispositionAt = dispositionAt;
×
253
      return this;
×
254
    }
255

256
    public Builder permissions(UpdateFileByIdRequestBodyPermissionsField permissions) {
257
      this.permissions = permissions;
×
258
      return this;
×
259
    }
260

261
    public Builder collections(List<UpdateFileByIdRequestBodyCollectionsField> collections) {
262
      this.collections = collections;
×
263
      this.markNullableFieldAsSet("collections");
×
264
      return this;
×
265
    }
266

267
    public Builder tags(List<String> tags) {
268
      this.tags = tags;
×
269
      return this;
×
270
    }
271

272
    public UpdateFileByIdRequestBody build() {
273
      return new UpdateFileByIdRequestBody(this);
1✔
274
    }
275
  }
276
}
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