• 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

43.12
/src/main/java/com/box/sdkgen/managers/users/CreateUserRequestBody.java
1
package com.box.sdkgen.managers.users;
2

3
import com.box.sdkgen.internal.NullableFieldTracker;
4
import com.box.sdkgen.internal.SerializableObject;
5
import com.box.sdkgen.schemas.trackingcode.TrackingCode;
6
import com.box.sdkgen.serialization.json.EnumWrapper;
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.util.List;
12
import java.util.Objects;
13

14
@JsonFilter("nullablePropertyFilter")
15
public class CreateUserRequestBody extends SerializableObject {
16

17
  /** The name of the user. */
18
  protected final String name;
19

20
  /**
21
   * The email address the user uses to log in
22
   *
23
   * <p>Required, unless `is_platform_access_only` is set to `true`.
24
   */
25
  protected String login;
26

27
  /** Specifies that the user is an app user. */
28
  @JsonProperty("is_platform_access_only")
29
  protected Boolean isPlatformAccessOnly;
30

31
  /** The user’s enterprise role. */
32
  @JsonDeserialize(
33
      using = CreateUserRequestBodyRoleField.CreateUserRequestBodyRoleFieldDeserializer.class)
34
  @JsonSerialize(
35
      using = CreateUserRequestBodyRoleField.CreateUserRequestBodyRoleFieldSerializer.class)
36
  protected EnumWrapper<CreateUserRequestBodyRoleField> role;
37

38
  /**
39
   * The language of the user, formatted in modified version of the [ISO
40
   * 639-1](/guides/api-calls/language-codes) format.
41
   */
42
  protected String language;
43

44
  /** Whether the user can use Box Sync. */
45
  @JsonProperty("is_sync_enabled")
46
  protected Boolean isSyncEnabled;
47

48
  /** The user’s job title. */
49
  @JsonProperty("job_title")
50
  protected String jobTitle;
51

52
  /** The user’s phone number. */
53
  protected String phone;
54

55
  /** The user’s address. */
56
  protected String address;
57

58
  /** The user’s total available space in bytes. Set this to `-1` to indicate unlimited storage. */
59
  @JsonProperty("space_amount")
60
  protected Long spaceAmount;
61

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

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

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

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

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

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

89
  /** The user's account status. */
90
  @JsonDeserialize(
91
      using = CreateUserRequestBodyStatusField.CreateUserRequestBodyStatusFieldDeserializer.class)
92
  @JsonSerialize(
93
      using = CreateUserRequestBodyStatusField.CreateUserRequestBodyStatusFieldSerializer.class)
94
  protected EnumWrapper<CreateUserRequestBodyStatusField> status;
95

96
  /**
97
   * An external identifier for an app user, which can be used to look up the user. This can be used
98
   * to tie user IDs from external identity providers to Box users.
99
   */
100
  @JsonProperty("external_app_user_id")
101
  protected String externalAppUserId;
102

103
  public CreateUserRequestBody(@JsonProperty("name") String name) {
104
    super();
×
105
    this.name = name;
×
106
  }
×
107

108
  protected CreateUserRequestBody(Builder builder) {
109
    super();
1✔
110
    this.name = builder.name;
1✔
111
    this.login = builder.login;
1✔
112
    this.isPlatformAccessOnly = builder.isPlatformAccessOnly;
1✔
113
    this.role = builder.role;
1✔
114
    this.language = builder.language;
1✔
115
    this.isSyncEnabled = builder.isSyncEnabled;
1✔
116
    this.jobTitle = builder.jobTitle;
1✔
117
    this.phone = builder.phone;
1✔
118
    this.address = builder.address;
1✔
119
    this.spaceAmount = builder.spaceAmount;
1✔
120
    this.trackingCodes = builder.trackingCodes;
1✔
121
    this.canSeeManagedUsers = builder.canSeeManagedUsers;
1✔
122
    this.timezone = builder.timezone;
1✔
123
    this.isExternalCollabRestricted = builder.isExternalCollabRestricted;
1✔
124
    this.isExemptFromDeviceLimits = builder.isExemptFromDeviceLimits;
1✔
125
    this.isExemptFromLoginVerification = builder.isExemptFromLoginVerification;
1✔
126
    this.status = builder.status;
1✔
127
    this.externalAppUserId = builder.externalAppUserId;
1✔
128
    markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
1✔
129
  }
1✔
130

131
  public String getName() {
132
    return name;
1✔
133
  }
134

135
  public String getLogin() {
136
    return login;
1✔
137
  }
138

139
  public Boolean getIsPlatformAccessOnly() {
140
    return isPlatformAccessOnly;
1✔
141
  }
142

143
  public EnumWrapper<CreateUserRequestBodyRoleField> getRole() {
144
    return role;
1✔
145
  }
146

147
  public String getLanguage() {
148
    return language;
1✔
149
  }
150

151
  public Boolean getIsSyncEnabled() {
152
    return isSyncEnabled;
1✔
153
  }
154

155
  public String getJobTitle() {
156
    return jobTitle;
1✔
157
  }
158

159
  public String getPhone() {
160
    return phone;
1✔
161
  }
162

163
  public String getAddress() {
164
    return address;
1✔
165
  }
166

167
  public Long getSpaceAmount() {
168
    return spaceAmount;
1✔
169
  }
170

171
  public List<TrackingCode> getTrackingCodes() {
172
    return trackingCodes;
1✔
173
  }
174

175
  public Boolean getCanSeeManagedUsers() {
176
    return canSeeManagedUsers;
1✔
177
  }
178

179
  public String getTimezone() {
180
    return timezone;
1✔
181
  }
182

183
  public Boolean getIsExternalCollabRestricted() {
184
    return isExternalCollabRestricted;
1✔
185
  }
186

187
  public Boolean getIsExemptFromDeviceLimits() {
188
    return isExemptFromDeviceLimits;
1✔
189
  }
190

191
  public Boolean getIsExemptFromLoginVerification() {
192
    return isExemptFromLoginVerification;
1✔
193
  }
194

195
  public EnumWrapper<CreateUserRequestBodyStatusField> getStatus() {
196
    return status;
1✔
197
  }
198

199
  public String getExternalAppUserId() {
200
    return externalAppUserId;
1✔
201
  }
202

203
  @Override
204
  public boolean equals(Object o) {
205
    if (this == o) {
×
206
      return true;
×
207
    }
208
    if (o == null || getClass() != o.getClass()) {
×
209
      return false;
×
210
    }
211
    CreateUserRequestBody casted = (CreateUserRequestBody) o;
×
212
    return Objects.equals(name, casted.name)
×
213
        && Objects.equals(login, casted.login)
×
214
        && Objects.equals(isPlatformAccessOnly, casted.isPlatformAccessOnly)
×
215
        && Objects.equals(role, casted.role)
×
216
        && Objects.equals(language, casted.language)
×
217
        && Objects.equals(isSyncEnabled, casted.isSyncEnabled)
×
218
        && Objects.equals(jobTitle, casted.jobTitle)
×
219
        && Objects.equals(phone, casted.phone)
×
220
        && Objects.equals(address, casted.address)
×
221
        && Objects.equals(spaceAmount, casted.spaceAmount)
×
222
        && Objects.equals(trackingCodes, casted.trackingCodes)
×
223
        && Objects.equals(canSeeManagedUsers, casted.canSeeManagedUsers)
×
224
        && Objects.equals(timezone, casted.timezone)
×
225
        && Objects.equals(isExternalCollabRestricted, casted.isExternalCollabRestricted)
×
226
        && Objects.equals(isExemptFromDeviceLimits, casted.isExemptFromDeviceLimits)
×
227
        && Objects.equals(isExemptFromLoginVerification, casted.isExemptFromLoginVerification)
×
228
        && Objects.equals(status, casted.status)
×
229
        && Objects.equals(externalAppUserId, casted.externalAppUserId);
×
230
  }
231

232
  @Override
233
  public int hashCode() {
234
    return Objects.hash(
×
235
        name,
236
        login,
237
        isPlatformAccessOnly,
238
        role,
239
        language,
240
        isSyncEnabled,
241
        jobTitle,
242
        phone,
243
        address,
244
        spaceAmount,
245
        trackingCodes,
246
        canSeeManagedUsers,
247
        timezone,
248
        isExternalCollabRestricted,
249
        isExemptFromDeviceLimits,
250
        isExemptFromLoginVerification,
251
        status,
252
        externalAppUserId);
253
  }
254

255
  @Override
256
  public String toString() {
257
    return "CreateUserRequestBody{"
×
258
        + "name='"
259
        + name
260
        + '\''
261
        + ", "
262
        + "login='"
263
        + login
264
        + '\''
265
        + ", "
266
        + "isPlatformAccessOnly='"
267
        + isPlatformAccessOnly
268
        + '\''
269
        + ", "
270
        + "role='"
271
        + role
272
        + '\''
273
        + ", "
274
        + "language='"
275
        + language
276
        + '\''
277
        + ", "
278
        + "isSyncEnabled='"
279
        + isSyncEnabled
280
        + '\''
281
        + ", "
282
        + "jobTitle='"
283
        + jobTitle
284
        + '\''
285
        + ", "
286
        + "phone='"
287
        + phone
288
        + '\''
289
        + ", "
290
        + "address='"
291
        + address
292
        + '\''
293
        + ", "
294
        + "spaceAmount='"
295
        + spaceAmount
296
        + '\''
297
        + ", "
298
        + "trackingCodes='"
299
        + trackingCodes
300
        + '\''
301
        + ", "
302
        + "canSeeManagedUsers='"
303
        + canSeeManagedUsers
304
        + '\''
305
        + ", "
306
        + "timezone='"
307
        + timezone
308
        + '\''
309
        + ", "
310
        + "isExternalCollabRestricted='"
311
        + isExternalCollabRestricted
312
        + '\''
313
        + ", "
314
        + "isExemptFromDeviceLimits='"
315
        + isExemptFromDeviceLimits
316
        + '\''
317
        + ", "
318
        + "isExemptFromLoginVerification='"
319
        + isExemptFromLoginVerification
320
        + '\''
321
        + ", "
322
        + "status='"
323
        + status
324
        + '\''
325
        + ", "
326
        + "externalAppUserId='"
327
        + externalAppUserId
328
        + '\''
329
        + "}";
330
  }
331

332
  public static class Builder extends NullableFieldTracker {
333

334
    protected final String name;
335

336
    protected String login;
337

338
    protected Boolean isPlatformAccessOnly;
339

340
    protected EnumWrapper<CreateUserRequestBodyRoleField> role;
341

342
    protected String language;
343

344
    protected Boolean isSyncEnabled;
345

346
    protected String jobTitle;
347

348
    protected String phone;
349

350
    protected String address;
351

352
    protected Long spaceAmount;
353

354
    protected List<TrackingCode> trackingCodes;
355

356
    protected Boolean canSeeManagedUsers;
357

358
    protected String timezone;
359

360
    protected Boolean isExternalCollabRestricted;
361

362
    protected Boolean isExemptFromDeviceLimits;
363

364
    protected Boolean isExemptFromLoginVerification;
365

366
    protected EnumWrapper<CreateUserRequestBodyStatusField> status;
367

368
    protected String externalAppUserId;
369

370
    public Builder(String name) {
371
      super();
1✔
372
      this.name = name;
1✔
373
    }
1✔
374

375
    public Builder login(String login) {
376
      this.login = login;
1✔
377
      return this;
1✔
378
    }
379

380
    public Builder isPlatformAccessOnly(Boolean isPlatformAccessOnly) {
381
      this.isPlatformAccessOnly = isPlatformAccessOnly;
1✔
382
      return this;
1✔
383
    }
384

385
    public Builder role(CreateUserRequestBodyRoleField role) {
386
      this.role = new EnumWrapper<CreateUserRequestBodyRoleField>(role);
×
387
      return this;
×
388
    }
389

390
    public Builder role(EnumWrapper<CreateUserRequestBodyRoleField> role) {
391
      this.role = role;
×
392
      return this;
×
393
    }
394

395
    public Builder language(String language) {
396
      this.language = language;
×
397
      return this;
×
398
    }
399

400
    public Builder isSyncEnabled(Boolean isSyncEnabled) {
401
      this.isSyncEnabled = isSyncEnabled;
×
402
      return this;
×
403
    }
404

405
    public Builder jobTitle(String jobTitle) {
406
      this.jobTitle = jobTitle;
×
407
      return this;
×
408
    }
409

410
    public Builder phone(String phone) {
411
      this.phone = phone;
×
412
      return this;
×
413
    }
414

415
    public Builder address(String address) {
416
      this.address = address;
×
417
      return this;
×
418
    }
419

420
    public Builder spaceAmount(Long spaceAmount) {
421
      this.spaceAmount = spaceAmount;
×
422
      return this;
×
423
    }
424

425
    public Builder trackingCodes(List<TrackingCode> trackingCodes) {
426
      this.trackingCodes = trackingCodes;
×
427
      return this;
×
428
    }
429

430
    public Builder canSeeManagedUsers(Boolean canSeeManagedUsers) {
431
      this.canSeeManagedUsers = canSeeManagedUsers;
×
432
      return this;
×
433
    }
434

435
    public Builder timezone(String timezone) {
436
      this.timezone = timezone;
×
437
      return this;
×
438
    }
439

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

445
    public Builder isExemptFromDeviceLimits(Boolean isExemptFromDeviceLimits) {
446
      this.isExemptFromDeviceLimits = isExemptFromDeviceLimits;
×
447
      return this;
×
448
    }
449

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

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

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

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

470
    public CreateUserRequestBody build() {
471
      return new CreateUserRequestBody(this);
1✔
472
    }
473
  }
474
}
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