001package com.box.sdkgen.managers.users;
002
003import com.box.sdkgen.internal.Nullable;
004import com.box.sdkgen.internal.NullableFieldTracker;
005import com.box.sdkgen.internal.SerializableObject;
006import com.box.sdkgen.schemas.trackingcode.TrackingCode;
007import com.box.sdkgen.serialization.json.EnumWrapper;
008import com.fasterxml.jackson.annotation.JsonFilter;
009import com.fasterxml.jackson.annotation.JsonProperty;
010import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
011import com.fasterxml.jackson.databind.annotation.JsonSerialize;
012import java.util.List;
013import java.util.Objects;
014
015@JsonFilter("nullablePropertyFilter")
016public class UpdateUserByIdRequestBody extends SerializableObject {
017
018  /** Set this to `null` to roll the user out of the enterprise and make them a free user. */
019  @Nullable protected String enterprise;
020
021  /** Whether the user should receive an email when they are rolled out of an enterprise. */
022  protected Boolean notify;
023
024  /** The name of the user. */
025  protected String name;
026
027  /**
028   * The email address the user uses to log in
029   *
030   * <p>Note: If the target user's email is not confirmed, then the primary login address cannot be
031   * changed.
032   */
033  protected String login;
034
035  /** The user’s enterprise role. */
036  @JsonDeserialize(
037      using =
038          UpdateUserByIdRequestBodyRoleField.UpdateUserByIdRequestBodyRoleFieldDeserializer.class)
039  @JsonSerialize(
040      using = UpdateUserByIdRequestBodyRoleField.UpdateUserByIdRequestBodyRoleFieldSerializer.class)
041  protected EnumWrapper<UpdateUserByIdRequestBodyRoleField> role;
042
043  /**
044   * The language of the user, formatted in modified version of the [ISO
045   * 639-1](https://developer.box.com/guides/api-calls/language-codes) format.
046   */
047  protected String language;
048
049  /** Whether the user can use Box Sync. */
050  @JsonProperty("is_sync_enabled")
051  protected Boolean isSyncEnabled;
052
053  /** The user’s job title. */
054  @JsonProperty("job_title")
055  protected String jobTitle;
056
057  /** The user’s phone number. */
058  protected String phone;
059
060  /** The user’s address. */
061  protected String address;
062
063  /**
064   * Tracking codes allow an admin to generate reports from the admin console and assign an
065   * attribute to a specific group of users. This setting must be enabled for an enterprise before
066   * it can be used.
067   */
068  @JsonProperty("tracking_codes")
069  protected List<TrackingCode> trackingCodes;
070
071  /** Whether the user can see other enterprise users in their contact list. */
072  @JsonProperty("can_see_managed_users")
073  protected Boolean canSeeManagedUsers;
074
075  /** The user's timezone. */
076  protected String timezone;
077
078  /** Whether the user is allowed to collaborate with users outside their enterprise. */
079  @JsonProperty("is_external_collab_restricted")
080  protected Boolean isExternalCollabRestricted;
081
082  /** Whether to exempt the user from enterprise device limits. */
083  @JsonProperty("is_exempt_from_device_limits")
084  protected Boolean isExemptFromDeviceLimits;
085
086  /** Whether the user must use two-factor authentication. */
087  @JsonProperty("is_exempt_from_login_verification")
088  protected Boolean isExemptFromLoginVerification;
089
090  /** Whether the user is required to reset their password. */
091  @JsonProperty("is_password_reset_required")
092  protected Boolean isPasswordResetRequired;
093
094  /**
095   * Whether collaborators can access content owned by the user when the user is inactive. This
096   * setting preserves existing collaborator access and does not grant new permissions.
097   */
098  @JsonProperty("is_collaborated_content_available_when_owner_inactive")
099  protected Boolean isCollaboratedContentAvailableWhenOwnerInactive;
100
101  /** The user's account status. */
102  @JsonDeserialize(
103      using =
104          UpdateUserByIdRequestBodyStatusField.UpdateUserByIdRequestBodyStatusFieldDeserializer
105              .class)
106  @JsonSerialize(
107      using =
108          UpdateUserByIdRequestBodyStatusField.UpdateUserByIdRequestBodyStatusFieldSerializer.class)
109  protected EnumWrapper<UpdateUserByIdRequestBodyStatusField> status;
110
111  /** The user’s total available space in bytes. Set this to `-1` to indicate unlimited storage. */
112  @JsonProperty("space_amount")
113  protected Long spaceAmount;
114
115  /**
116   * An alternate notification email address to which email notifications are sent. When it's
117   * confirmed, this will be the email address to which notifications are sent instead of to the
118   * primary email address.
119   *
120   * <p>Set this value to `null` to remove the notification email.
121   */
122  @JsonProperty("notification_email")
123  @Nullable
124  protected UpdateUserByIdRequestBodyNotificationEmailField notificationEmail;
125
126  /**
127   * An external identifier for an app user, which can be used to look up the user. This can be used
128   * to tie user IDs from external identity providers to Box users.
129   *
130   * <p>Note: In order to update this field, you need to request a token using the application that
131   * created the app user.
132   */
133  @JsonProperty("external_app_user_id")
134  protected String externalAppUserId;
135
136  public UpdateUserByIdRequestBody() {
137    super();
138  }
139
140  protected UpdateUserByIdRequestBody(Builder builder) {
141    super();
142    this.enterprise = builder.enterprise;
143    this.notify = builder.notify;
144    this.name = builder.name;
145    this.login = builder.login;
146    this.role = builder.role;
147    this.language = builder.language;
148    this.isSyncEnabled = builder.isSyncEnabled;
149    this.jobTitle = builder.jobTitle;
150    this.phone = builder.phone;
151    this.address = builder.address;
152    this.trackingCodes = builder.trackingCodes;
153    this.canSeeManagedUsers = builder.canSeeManagedUsers;
154    this.timezone = builder.timezone;
155    this.isExternalCollabRestricted = builder.isExternalCollabRestricted;
156    this.isExemptFromDeviceLimits = builder.isExemptFromDeviceLimits;
157    this.isExemptFromLoginVerification = builder.isExemptFromLoginVerification;
158    this.isPasswordResetRequired = builder.isPasswordResetRequired;
159    this.isCollaboratedContentAvailableWhenOwnerInactive =
160        builder.isCollaboratedContentAvailableWhenOwnerInactive;
161    this.status = builder.status;
162    this.spaceAmount = builder.spaceAmount;
163    this.notificationEmail = builder.notificationEmail;
164    this.externalAppUserId = builder.externalAppUserId;
165    markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
166  }
167
168  public String getEnterprise() {
169    return enterprise;
170  }
171
172  public Boolean getNotify() {
173    return notify;
174  }
175
176  public String getName() {
177    return name;
178  }
179
180  public String getLogin() {
181    return login;
182  }
183
184  public EnumWrapper<UpdateUserByIdRequestBodyRoleField> getRole() {
185    return role;
186  }
187
188  public String getLanguage() {
189    return language;
190  }
191
192  public Boolean getIsSyncEnabled() {
193    return isSyncEnabled;
194  }
195
196  public String getJobTitle() {
197    return jobTitle;
198  }
199
200  public String getPhone() {
201    return phone;
202  }
203
204  public String getAddress() {
205    return address;
206  }
207
208  public List<TrackingCode> getTrackingCodes() {
209    return trackingCodes;
210  }
211
212  public Boolean getCanSeeManagedUsers() {
213    return canSeeManagedUsers;
214  }
215
216  public String getTimezone() {
217    return timezone;
218  }
219
220  public Boolean getIsExternalCollabRestricted() {
221    return isExternalCollabRestricted;
222  }
223
224  public Boolean getIsExemptFromDeviceLimits() {
225    return isExemptFromDeviceLimits;
226  }
227
228  public Boolean getIsExemptFromLoginVerification() {
229    return isExemptFromLoginVerification;
230  }
231
232  public Boolean getIsPasswordResetRequired() {
233    return isPasswordResetRequired;
234  }
235
236  public Boolean getIsCollaboratedContentAvailableWhenOwnerInactive() {
237    return isCollaboratedContentAvailableWhenOwnerInactive;
238  }
239
240  public EnumWrapper<UpdateUserByIdRequestBodyStatusField> getStatus() {
241    return status;
242  }
243
244  public Long getSpaceAmount() {
245    return spaceAmount;
246  }
247
248  public UpdateUserByIdRequestBodyNotificationEmailField getNotificationEmail() {
249    return notificationEmail;
250  }
251
252  public String getExternalAppUserId() {
253    return externalAppUserId;
254  }
255
256  @Override
257  public boolean equals(Object o) {
258    if (this == o) {
259      return true;
260    }
261    if (o == null || getClass() != o.getClass()) {
262      return false;
263    }
264    UpdateUserByIdRequestBody casted = (UpdateUserByIdRequestBody) o;
265    return Objects.equals(enterprise, casted.enterprise)
266        && Objects.equals(notify, casted.notify)
267        && Objects.equals(name, casted.name)
268        && Objects.equals(login, casted.login)
269        && Objects.equals(role, casted.role)
270        && Objects.equals(language, casted.language)
271        && Objects.equals(isSyncEnabled, casted.isSyncEnabled)
272        && Objects.equals(jobTitle, casted.jobTitle)
273        && Objects.equals(phone, casted.phone)
274        && Objects.equals(address, casted.address)
275        && Objects.equals(trackingCodes, casted.trackingCodes)
276        && Objects.equals(canSeeManagedUsers, casted.canSeeManagedUsers)
277        && Objects.equals(timezone, casted.timezone)
278        && Objects.equals(isExternalCollabRestricted, casted.isExternalCollabRestricted)
279        && Objects.equals(isExemptFromDeviceLimits, casted.isExemptFromDeviceLimits)
280        && Objects.equals(isExemptFromLoginVerification, casted.isExemptFromLoginVerification)
281        && Objects.equals(isPasswordResetRequired, casted.isPasswordResetRequired)
282        && Objects.equals(
283            isCollaboratedContentAvailableWhenOwnerInactive,
284            casted.isCollaboratedContentAvailableWhenOwnerInactive)
285        && Objects.equals(status, casted.status)
286        && Objects.equals(spaceAmount, casted.spaceAmount)
287        && Objects.equals(notificationEmail, casted.notificationEmail)
288        && Objects.equals(externalAppUserId, casted.externalAppUserId);
289  }
290
291  @Override
292  public int hashCode() {
293    return Objects.hash(
294        enterprise,
295        notify,
296        name,
297        login,
298        role,
299        language,
300        isSyncEnabled,
301        jobTitle,
302        phone,
303        address,
304        trackingCodes,
305        canSeeManagedUsers,
306        timezone,
307        isExternalCollabRestricted,
308        isExemptFromDeviceLimits,
309        isExemptFromLoginVerification,
310        isPasswordResetRequired,
311        isCollaboratedContentAvailableWhenOwnerInactive,
312        status,
313        spaceAmount,
314        notificationEmail,
315        externalAppUserId);
316  }
317
318  @Override
319  public String toString() {
320    return "UpdateUserByIdRequestBody{"
321        + "enterprise='"
322        + enterprise
323        + '\''
324        + ", "
325        + "notify='"
326        + notify
327        + '\''
328        + ", "
329        + "name='"
330        + name
331        + '\''
332        + ", "
333        + "login='"
334        + login
335        + '\''
336        + ", "
337        + "role='"
338        + role
339        + '\''
340        + ", "
341        + "language='"
342        + language
343        + '\''
344        + ", "
345        + "isSyncEnabled='"
346        + isSyncEnabled
347        + '\''
348        + ", "
349        + "jobTitle='"
350        + jobTitle
351        + '\''
352        + ", "
353        + "phone='"
354        + phone
355        + '\''
356        + ", "
357        + "address='"
358        + address
359        + '\''
360        + ", "
361        + "trackingCodes='"
362        + trackingCodes
363        + '\''
364        + ", "
365        + "canSeeManagedUsers='"
366        + canSeeManagedUsers
367        + '\''
368        + ", "
369        + "timezone='"
370        + timezone
371        + '\''
372        + ", "
373        + "isExternalCollabRestricted='"
374        + isExternalCollabRestricted
375        + '\''
376        + ", "
377        + "isExemptFromDeviceLimits='"
378        + isExemptFromDeviceLimits
379        + '\''
380        + ", "
381        + "isExemptFromLoginVerification='"
382        + isExemptFromLoginVerification
383        + '\''
384        + ", "
385        + "isPasswordResetRequired='"
386        + isPasswordResetRequired
387        + '\''
388        + ", "
389        + "isCollaboratedContentAvailableWhenOwnerInactive='"
390        + isCollaboratedContentAvailableWhenOwnerInactive
391        + '\''
392        + ", "
393        + "status='"
394        + status
395        + '\''
396        + ", "
397        + "spaceAmount='"
398        + spaceAmount
399        + '\''
400        + ", "
401        + "notificationEmail='"
402        + notificationEmail
403        + '\''
404        + ", "
405        + "externalAppUserId='"
406        + externalAppUserId
407        + '\''
408        + "}";
409  }
410
411  public static class Builder extends NullableFieldTracker {
412
413    protected String enterprise;
414
415    protected Boolean notify;
416
417    protected String name;
418
419    protected String login;
420
421    protected EnumWrapper<UpdateUserByIdRequestBodyRoleField> role;
422
423    protected String language;
424
425    protected Boolean isSyncEnabled;
426
427    protected String jobTitle;
428
429    protected String phone;
430
431    protected String address;
432
433    protected List<TrackingCode> trackingCodes;
434
435    protected Boolean canSeeManagedUsers;
436
437    protected String timezone;
438
439    protected Boolean isExternalCollabRestricted;
440
441    protected Boolean isExemptFromDeviceLimits;
442
443    protected Boolean isExemptFromLoginVerification;
444
445    protected Boolean isPasswordResetRequired;
446
447    protected Boolean isCollaboratedContentAvailableWhenOwnerInactive;
448
449    protected EnumWrapper<UpdateUserByIdRequestBodyStatusField> status;
450
451    protected Long spaceAmount;
452
453    protected UpdateUserByIdRequestBodyNotificationEmailField notificationEmail;
454
455    protected String externalAppUserId;
456
457    public Builder enterprise(String enterprise) {
458      this.enterprise = enterprise;
459      this.markNullableFieldAsSet("enterprise");
460      return this;
461    }
462
463    public Builder notify(Boolean notify) {
464      this.notify = notify;
465      return this;
466    }
467
468    public Builder name(String name) {
469      this.name = name;
470      return this;
471    }
472
473    public Builder login(String login) {
474      this.login = login;
475      return this;
476    }
477
478    public Builder role(UpdateUserByIdRequestBodyRoleField role) {
479      this.role = new EnumWrapper<UpdateUserByIdRequestBodyRoleField>(role);
480      return this;
481    }
482
483    public Builder role(EnumWrapper<UpdateUserByIdRequestBodyRoleField> role) {
484      this.role = role;
485      return this;
486    }
487
488    public Builder language(String language) {
489      this.language = language;
490      return this;
491    }
492
493    public Builder isSyncEnabled(Boolean isSyncEnabled) {
494      this.isSyncEnabled = isSyncEnabled;
495      return this;
496    }
497
498    public Builder jobTitle(String jobTitle) {
499      this.jobTitle = jobTitle;
500      return this;
501    }
502
503    public Builder phone(String phone) {
504      this.phone = phone;
505      return this;
506    }
507
508    public Builder address(String address) {
509      this.address = address;
510      return this;
511    }
512
513    public Builder trackingCodes(List<TrackingCode> trackingCodes) {
514      this.trackingCodes = trackingCodes;
515      return this;
516    }
517
518    public Builder canSeeManagedUsers(Boolean canSeeManagedUsers) {
519      this.canSeeManagedUsers = canSeeManagedUsers;
520      return this;
521    }
522
523    public Builder timezone(String timezone) {
524      this.timezone = timezone;
525      return this;
526    }
527
528    public Builder isExternalCollabRestricted(Boolean isExternalCollabRestricted) {
529      this.isExternalCollabRestricted = isExternalCollabRestricted;
530      return this;
531    }
532
533    public Builder isExemptFromDeviceLimits(Boolean isExemptFromDeviceLimits) {
534      this.isExemptFromDeviceLimits = isExemptFromDeviceLimits;
535      return this;
536    }
537
538    public Builder isExemptFromLoginVerification(Boolean isExemptFromLoginVerification) {
539      this.isExemptFromLoginVerification = isExemptFromLoginVerification;
540      return this;
541    }
542
543    public Builder isPasswordResetRequired(Boolean isPasswordResetRequired) {
544      this.isPasswordResetRequired = isPasswordResetRequired;
545      return this;
546    }
547
548    public Builder isCollaboratedContentAvailableWhenOwnerInactive(
549        Boolean isCollaboratedContentAvailableWhenOwnerInactive) {
550      this.isCollaboratedContentAvailableWhenOwnerInactive =
551          isCollaboratedContentAvailableWhenOwnerInactive;
552      return this;
553    }
554
555    public Builder status(UpdateUserByIdRequestBodyStatusField status) {
556      this.status = new EnumWrapper<UpdateUserByIdRequestBodyStatusField>(status);
557      return this;
558    }
559
560    public Builder status(EnumWrapper<UpdateUserByIdRequestBodyStatusField> status) {
561      this.status = status;
562      return this;
563    }
564
565    public Builder spaceAmount(Long spaceAmount) {
566      this.spaceAmount = spaceAmount;
567      return this;
568    }
569
570    public Builder notificationEmail(
571        UpdateUserByIdRequestBodyNotificationEmailField notificationEmail) {
572      this.notificationEmail = notificationEmail;
573      this.markNullableFieldAsSet("notification_email");
574      return this;
575    }
576
577    public Builder externalAppUserId(String externalAppUserId) {
578      this.externalAppUserId = externalAppUserId;
579      return this;
580    }
581
582    public UpdateUserByIdRequestBody build() {
583      return new UpdateUserByIdRequestBody(this);
584    }
585  }
586}