• 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

39.2
/src/main/java/com/box/sdkgen/managers/users/UpdateUserByIdRequestBody.java
1
package com.box.sdkgen.managers.users;
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.schemas.trackingcode.TrackingCode;
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.util.List;
13
import java.util.Objects;
14

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

18
  /** Set this to `null` to roll the user out of the enterprise and make them a free user. */
19
  @Nullable protected String enterprise;
20

21
  /** Whether the user should receive an email when they are rolled out of an enterprise. */
22
  protected Boolean notify;
23

24
  /** The name of the user. */
25
  protected String name;
26

27
  /**
28
   * The email address the user uses to log in
29
   *
30
   * <p>Note: If the target user's email is not confirmed, then the primary login address cannot be
31
   * changed.
32
   */
33
  protected String login;
34

35
  /** The user’s enterprise role. */
36
  @JsonDeserialize(
37
      using =
38
          UpdateUserByIdRequestBodyRoleField.UpdateUserByIdRequestBodyRoleFieldDeserializer.class)
39
  @JsonSerialize(
40
      using = UpdateUserByIdRequestBodyRoleField.UpdateUserByIdRequestBodyRoleFieldSerializer.class)
41
  protected EnumWrapper<UpdateUserByIdRequestBodyRoleField> role;
42

43
  /**
44
   * The language of the user, formatted in modified version of the [ISO
45
   * 639-1](/guides/api-calls/language-codes) format.
46
   */
47
  protected String language;
48

49
  /** Whether the user can use Box Sync. */
50
  @JsonProperty("is_sync_enabled")
51
  protected Boolean isSyncEnabled;
52

53
  /** The user’s job title. */
54
  @JsonProperty("job_title")
55
  protected String jobTitle;
56

57
  /** The user’s phone number. */
58
  protected String phone;
59

60
  /** The user’s address. */
61
  protected String address;
62

63
  /**
64
   * Tracking codes allow an admin to generate reports from the admin console and assign an
65
   * attribute to a specific group of users. This setting must be enabled for an enterprise before
66
   * it can be used.
67
   */
68
  @JsonProperty("tracking_codes")
69
  protected List<TrackingCode> trackingCodes;
70

71
  /** Whether the user can see other enterprise users in their contact list. */
72
  @JsonProperty("can_see_managed_users")
73
  protected Boolean canSeeManagedUsers;
74

75
  /** The user's timezone. */
76
  protected String timezone;
77

78
  /** Whether the user is allowed to collaborate with users outside their enterprise. */
79
  @JsonProperty("is_external_collab_restricted")
80
  protected Boolean isExternalCollabRestricted;
81

82
  /** Whether to exempt the user from enterprise device limits. */
83
  @JsonProperty("is_exempt_from_device_limits")
84
  protected Boolean isExemptFromDeviceLimits;
85

86
  /** Whether the user must use two-factor authentication. */
87
  @JsonProperty("is_exempt_from_login_verification")
88
  protected Boolean isExemptFromLoginVerification;
89

90
  /** Whether the user is required to reset their password. */
91
  @JsonProperty("is_password_reset_required")
92
  protected Boolean isPasswordResetRequired;
93

94
  /** The user's account status. */
95
  @JsonDeserialize(
96
      using =
97
          UpdateUserByIdRequestBodyStatusField.UpdateUserByIdRequestBodyStatusFieldDeserializer
98
              .class)
99
  @JsonSerialize(
100
      using =
101
          UpdateUserByIdRequestBodyStatusField.UpdateUserByIdRequestBodyStatusFieldSerializer.class)
102
  protected EnumWrapper<UpdateUserByIdRequestBodyStatusField> status;
103

104
  /** The user’s total available space in bytes. Set this to `-1` to indicate unlimited storage. */
105
  @JsonProperty("space_amount")
106
  protected Long spaceAmount;
107

108
  /**
109
   * An alternate notification email address to which email notifications are sent. When it's
110
   * confirmed, this will be the email address to which notifications are sent instead of to the
111
   * primary email address.
112
   *
113
   * <p>Set this value to `null` to remove the notification email.
114
   */
115
  @JsonProperty("notification_email")
116
  @Nullable
117
  protected UpdateUserByIdRequestBodyNotificationEmailField notificationEmail;
118

119
  /**
120
   * An external identifier for an app user, which can be used to look up the user. This can be used
121
   * to tie user IDs from external identity providers to Box users.
122
   *
123
   * <p>Note: In order to update this field, you need to request a token using the application that
124
   * created the app user.
125
   */
126
  @JsonProperty("external_app_user_id")
127
  protected String externalAppUserId;
128

129
  public UpdateUserByIdRequestBody() {
130
    super();
×
131
  }
×
132

133
  protected UpdateUserByIdRequestBody(Builder builder) {
134
    super();
1✔
135
    this.enterprise = builder.enterprise;
1✔
136
    this.notify = builder.notify;
1✔
137
    this.name = builder.name;
1✔
138
    this.login = builder.login;
1✔
139
    this.role = builder.role;
1✔
140
    this.language = builder.language;
1✔
141
    this.isSyncEnabled = builder.isSyncEnabled;
1✔
142
    this.jobTitle = builder.jobTitle;
1✔
143
    this.phone = builder.phone;
1✔
144
    this.address = builder.address;
1✔
145
    this.trackingCodes = builder.trackingCodes;
1✔
146
    this.canSeeManagedUsers = builder.canSeeManagedUsers;
1✔
147
    this.timezone = builder.timezone;
1✔
148
    this.isExternalCollabRestricted = builder.isExternalCollabRestricted;
1✔
149
    this.isExemptFromDeviceLimits = builder.isExemptFromDeviceLimits;
1✔
150
    this.isExemptFromLoginVerification = builder.isExemptFromLoginVerification;
1✔
151
    this.isPasswordResetRequired = builder.isPasswordResetRequired;
1✔
152
    this.status = builder.status;
1✔
153
    this.spaceAmount = builder.spaceAmount;
1✔
154
    this.notificationEmail = builder.notificationEmail;
1✔
155
    this.externalAppUserId = builder.externalAppUserId;
1✔
156
    markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
1✔
157
  }
1✔
158

159
  public String getEnterprise() {
160
    return enterprise;
1✔
161
  }
162

163
  public Boolean getNotify() {
164
    return notify;
1✔
165
  }
166

167
  public String getName() {
168
    return name;
1✔
169
  }
170

171
  public String getLogin() {
172
    return login;
1✔
173
  }
174

175
  public EnumWrapper<UpdateUserByIdRequestBodyRoleField> getRole() {
176
    return role;
1✔
177
  }
178

179
  public String getLanguage() {
180
    return language;
1✔
181
  }
182

183
  public Boolean getIsSyncEnabled() {
184
    return isSyncEnabled;
1✔
185
  }
186

187
  public String getJobTitle() {
188
    return jobTitle;
1✔
189
  }
190

191
  public String getPhone() {
192
    return phone;
1✔
193
  }
194

195
  public String getAddress() {
196
    return address;
1✔
197
  }
198

199
  public List<TrackingCode> getTrackingCodes() {
200
    return trackingCodes;
1✔
201
  }
202

203
  public Boolean getCanSeeManagedUsers() {
204
    return canSeeManagedUsers;
1✔
205
  }
206

207
  public String getTimezone() {
208
    return timezone;
1✔
209
  }
210

211
  public Boolean getIsExternalCollabRestricted() {
212
    return isExternalCollabRestricted;
1✔
213
  }
214

215
  public Boolean getIsExemptFromDeviceLimits() {
216
    return isExemptFromDeviceLimits;
1✔
217
  }
218

219
  public Boolean getIsExemptFromLoginVerification() {
220
    return isExemptFromLoginVerification;
1✔
221
  }
222

223
  public Boolean getIsPasswordResetRequired() {
224
    return isPasswordResetRequired;
1✔
225
  }
226

227
  public EnumWrapper<UpdateUserByIdRequestBodyStatusField> getStatus() {
228
    return status;
1✔
229
  }
230

231
  public Long getSpaceAmount() {
232
    return spaceAmount;
1✔
233
  }
234

235
  public UpdateUserByIdRequestBodyNotificationEmailField getNotificationEmail() {
236
    return notificationEmail;
1✔
237
  }
238

239
  public String getExternalAppUserId() {
240
    return externalAppUserId;
1✔
241
  }
242

243
  @Override
244
  public boolean equals(Object o) {
245
    if (this == o) {
×
246
      return true;
×
247
    }
248
    if (o == null || getClass() != o.getClass()) {
×
249
      return false;
×
250
    }
251
    UpdateUserByIdRequestBody casted = (UpdateUserByIdRequestBody) o;
×
252
    return Objects.equals(enterprise, casted.enterprise)
×
253
        && Objects.equals(notify, casted.notify)
×
254
        && Objects.equals(name, casted.name)
×
255
        && Objects.equals(login, casted.login)
×
256
        && Objects.equals(role, casted.role)
×
257
        && Objects.equals(language, casted.language)
×
258
        && Objects.equals(isSyncEnabled, casted.isSyncEnabled)
×
259
        && Objects.equals(jobTitle, casted.jobTitle)
×
260
        && Objects.equals(phone, casted.phone)
×
261
        && Objects.equals(address, casted.address)
×
262
        && Objects.equals(trackingCodes, casted.trackingCodes)
×
263
        && Objects.equals(canSeeManagedUsers, casted.canSeeManagedUsers)
×
264
        && Objects.equals(timezone, casted.timezone)
×
265
        && Objects.equals(isExternalCollabRestricted, casted.isExternalCollabRestricted)
×
266
        && Objects.equals(isExemptFromDeviceLimits, casted.isExemptFromDeviceLimits)
×
267
        && Objects.equals(isExemptFromLoginVerification, casted.isExemptFromLoginVerification)
×
268
        && Objects.equals(isPasswordResetRequired, casted.isPasswordResetRequired)
×
269
        && Objects.equals(status, casted.status)
×
270
        && Objects.equals(spaceAmount, casted.spaceAmount)
×
271
        && Objects.equals(notificationEmail, casted.notificationEmail)
×
272
        && Objects.equals(externalAppUserId, casted.externalAppUserId);
×
273
  }
274

275
  @Override
276
  public int hashCode() {
277
    return Objects.hash(
×
278
        enterprise,
279
        notify,
280
        name,
281
        login,
282
        role,
283
        language,
284
        isSyncEnabled,
285
        jobTitle,
286
        phone,
287
        address,
288
        trackingCodes,
289
        canSeeManagedUsers,
290
        timezone,
291
        isExternalCollabRestricted,
292
        isExemptFromDeviceLimits,
293
        isExemptFromLoginVerification,
294
        isPasswordResetRequired,
295
        status,
296
        spaceAmount,
297
        notificationEmail,
298
        externalAppUserId);
299
  }
300

301
  @Override
302
  public String toString() {
303
    return "UpdateUserByIdRequestBody{"
×
304
        + "enterprise='"
305
        + enterprise
306
        + '\''
307
        + ", "
308
        + "notify='"
309
        + notify
310
        + '\''
311
        + ", "
312
        + "name='"
313
        + name
314
        + '\''
315
        + ", "
316
        + "login='"
317
        + login
318
        + '\''
319
        + ", "
320
        + "role='"
321
        + role
322
        + '\''
323
        + ", "
324
        + "language='"
325
        + language
326
        + '\''
327
        + ", "
328
        + "isSyncEnabled='"
329
        + isSyncEnabled
330
        + '\''
331
        + ", "
332
        + "jobTitle='"
333
        + jobTitle
334
        + '\''
335
        + ", "
336
        + "phone='"
337
        + phone
338
        + '\''
339
        + ", "
340
        + "address='"
341
        + address
342
        + '\''
343
        + ", "
344
        + "trackingCodes='"
345
        + trackingCodes
346
        + '\''
347
        + ", "
348
        + "canSeeManagedUsers='"
349
        + canSeeManagedUsers
350
        + '\''
351
        + ", "
352
        + "timezone='"
353
        + timezone
354
        + '\''
355
        + ", "
356
        + "isExternalCollabRestricted='"
357
        + isExternalCollabRestricted
358
        + '\''
359
        + ", "
360
        + "isExemptFromDeviceLimits='"
361
        + isExemptFromDeviceLimits
362
        + '\''
363
        + ", "
364
        + "isExemptFromLoginVerification='"
365
        + isExemptFromLoginVerification
366
        + '\''
367
        + ", "
368
        + "isPasswordResetRequired='"
369
        + isPasswordResetRequired
370
        + '\''
371
        + ", "
372
        + "status='"
373
        + status
374
        + '\''
375
        + ", "
376
        + "spaceAmount='"
377
        + spaceAmount
378
        + '\''
379
        + ", "
380
        + "notificationEmail='"
381
        + notificationEmail
382
        + '\''
383
        + ", "
384
        + "externalAppUserId='"
385
        + externalAppUserId
386
        + '\''
387
        + "}";
388
  }
389

390
  public static class Builder extends NullableFieldTracker {
1✔
391

392
    protected String enterprise;
393

394
    protected Boolean notify;
395

396
    protected String name;
397

398
    protected String login;
399

400
    protected EnumWrapper<UpdateUserByIdRequestBodyRoleField> role;
401

402
    protected String language;
403

404
    protected Boolean isSyncEnabled;
405

406
    protected String jobTitle;
407

408
    protected String phone;
409

410
    protected String address;
411

412
    protected List<TrackingCode> trackingCodes;
413

414
    protected Boolean canSeeManagedUsers;
415

416
    protected String timezone;
417

418
    protected Boolean isExternalCollabRestricted;
419

420
    protected Boolean isExemptFromDeviceLimits;
421

422
    protected Boolean isExemptFromLoginVerification;
423

424
    protected Boolean isPasswordResetRequired;
425

426
    protected EnumWrapper<UpdateUserByIdRequestBodyStatusField> status;
427

428
    protected Long spaceAmount;
429

430
    protected UpdateUserByIdRequestBodyNotificationEmailField notificationEmail;
431

432
    protected String externalAppUserId;
433

434
    public Builder enterprise(String enterprise) {
435
      this.enterprise = enterprise;
×
436
      this.markNullableFieldAsSet("enterprise");
×
437
      return this;
×
438
    }
439

440
    public Builder notify(Boolean notify) {
441
      this.notify = notify;
×
442
      return this;
×
443
    }
444

445
    public Builder name(String name) {
446
      this.name = name;
1✔
447
      return this;
1✔
448
    }
449

450
    public Builder login(String login) {
451
      this.login = login;
×
452
      return this;
×
453
    }
454

455
    public Builder role(UpdateUserByIdRequestBodyRoleField role) {
456
      this.role = new EnumWrapper<UpdateUserByIdRequestBodyRoleField>(role);
×
457
      return this;
×
458
    }
459

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

465
    public Builder language(String language) {
466
      this.language = language;
×
467
      return this;
×
468
    }
469

470
    public Builder isSyncEnabled(Boolean isSyncEnabled) {
471
      this.isSyncEnabled = isSyncEnabled;
×
472
      return this;
×
473
    }
474

475
    public Builder jobTitle(String jobTitle) {
476
      this.jobTitle = jobTitle;
×
477
      return this;
×
478
    }
479

480
    public Builder phone(String phone) {
481
      this.phone = phone;
×
482
      return this;
×
483
    }
484

485
    public Builder address(String address) {
486
      this.address = address;
×
487
      return this;
×
488
    }
489

490
    public Builder trackingCodes(List<TrackingCode> trackingCodes) {
491
      this.trackingCodes = trackingCodes;
×
492
      return this;
×
493
    }
494

495
    public Builder canSeeManagedUsers(Boolean canSeeManagedUsers) {
496
      this.canSeeManagedUsers = canSeeManagedUsers;
×
497
      return this;
×
498
    }
499

500
    public Builder timezone(String timezone) {
501
      this.timezone = timezone;
×
502
      return this;
×
503
    }
504

505
    public Builder isExternalCollabRestricted(Boolean isExternalCollabRestricted) {
506
      this.isExternalCollabRestricted = isExternalCollabRestricted;
×
507
      return this;
×
508
    }
509

510
    public Builder isExemptFromDeviceLimits(Boolean isExemptFromDeviceLimits) {
511
      this.isExemptFromDeviceLimits = isExemptFromDeviceLimits;
×
512
      return this;
×
513
    }
514

515
    public Builder isExemptFromLoginVerification(Boolean isExemptFromLoginVerification) {
516
      this.isExemptFromLoginVerification = isExemptFromLoginVerification;
×
517
      return this;
×
518
    }
519

520
    public Builder isPasswordResetRequired(Boolean isPasswordResetRequired) {
521
      this.isPasswordResetRequired = isPasswordResetRequired;
×
522
      return this;
×
523
    }
524

525
    public Builder status(UpdateUserByIdRequestBodyStatusField status) {
526
      this.status = new EnumWrapper<UpdateUserByIdRequestBodyStatusField>(status);
×
527
      return this;
×
528
    }
529

530
    public Builder status(EnumWrapper<UpdateUserByIdRequestBodyStatusField> status) {
531
      this.status = status;
×
532
      return this;
×
533
    }
534

535
    public Builder spaceAmount(Long spaceAmount) {
536
      this.spaceAmount = spaceAmount;
×
537
      return this;
×
538
    }
539

540
    public Builder notificationEmail(
541
        UpdateUserByIdRequestBodyNotificationEmailField notificationEmail) {
542
      this.notificationEmail = notificationEmail;
×
543
      this.markNullableFieldAsSet("notification_email");
×
544
      return this;
×
545
    }
546

547
    public Builder externalAppUserId(String externalAppUserId) {
548
      this.externalAppUserId = externalAppUserId;
×
549
      return this;
×
550
    }
551

552
    public UpdateUserByIdRequestBody build() {
553
      return new UpdateUserByIdRequestBody(this);
1✔
554
    }
555
  }
556
}
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