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  /** The user's account status. */
095  @JsonDeserialize(
096      using =
097          UpdateUserByIdRequestBodyStatusField.UpdateUserByIdRequestBodyStatusFieldDeserializer
098              .class)
099  @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();
135    this.enterprise = builder.enterprise;
136    this.notify = builder.notify;
137    this.name = builder.name;
138    this.login = builder.login;
139    this.role = builder.role;
140    this.language = builder.language;
141    this.isSyncEnabled = builder.isSyncEnabled;
142    this.jobTitle = builder.jobTitle;
143    this.phone = builder.phone;
144    this.address = builder.address;
145    this.trackingCodes = builder.trackingCodes;
146    this.canSeeManagedUsers = builder.canSeeManagedUsers;
147    this.timezone = builder.timezone;
148    this.isExternalCollabRestricted = builder.isExternalCollabRestricted;
149    this.isExemptFromDeviceLimits = builder.isExemptFromDeviceLimits;
150    this.isExemptFromLoginVerification = builder.isExemptFromLoginVerification;
151    this.isPasswordResetRequired = builder.isPasswordResetRequired;
152    this.status = builder.status;
153    this.spaceAmount = builder.spaceAmount;
154    this.notificationEmail = builder.notificationEmail;
155    this.externalAppUserId = builder.externalAppUserId;
156    markNullableFieldsAsSet(builder.getExplicitlySetNullableFields());
157  }
158
159  public String getEnterprise() {
160    return enterprise;
161  }
162
163  public Boolean getNotify() {
164    return notify;
165  }
166
167  public String getName() {
168    return name;
169  }
170
171  public String getLogin() {
172    return login;
173  }
174
175  public EnumWrapper<UpdateUserByIdRequestBodyRoleField> getRole() {
176    return role;
177  }
178
179  public String getLanguage() {
180    return language;
181  }
182
183  public Boolean getIsSyncEnabled() {
184    return isSyncEnabled;
185  }
186
187  public String getJobTitle() {
188    return jobTitle;
189  }
190
191  public String getPhone() {
192    return phone;
193  }
194
195  public String getAddress() {
196    return address;
197  }
198
199  public List<TrackingCode> getTrackingCodes() {
200    return trackingCodes;
201  }
202
203  public Boolean getCanSeeManagedUsers() {
204    return canSeeManagedUsers;
205  }
206
207  public String getTimezone() {
208    return timezone;
209  }
210
211  public Boolean getIsExternalCollabRestricted() {
212    return isExternalCollabRestricted;
213  }
214
215  public Boolean getIsExemptFromDeviceLimits() {
216    return isExemptFromDeviceLimits;
217  }
218
219  public Boolean getIsExemptFromLoginVerification() {
220    return isExemptFromLoginVerification;
221  }
222
223  public Boolean getIsPasswordResetRequired() {
224    return isPasswordResetRequired;
225  }
226
227  public EnumWrapper<UpdateUserByIdRequestBodyStatusField> getStatus() {
228    return status;
229  }
230
231  public Long getSpaceAmount() {
232    return spaceAmount;
233  }
234
235  public UpdateUserByIdRequestBodyNotificationEmailField getNotificationEmail() {
236    return notificationEmail;
237  }
238
239  public String getExternalAppUserId() {
240    return externalAppUserId;
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 {
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;
447      return this;
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);
554    }
555  }
556}