001package com.box.sdk;
002
003import java.util.HashMap;
004import java.util.Map;
005
006/** Contains optional parameters for creating a new enterprise user on Box. */
007public class CreateUserParams {
008  private Boolean canSeeManagedUsers;
009  private Boolean isExemptFromDeviceLimits;
010  private Boolean isExemptFromLoginVerification;
011  private Boolean isPlatformAccessOnly;
012  private Boolean isSyncEnabled;
013  private Boolean isExternalCollabRestricted;
014  private BoxUser.Role role;
015  private BoxUser.Status status;
016  private Long spaceAmount;
017  private String address;
018  private String jobTitle;
019  private String language;
020  private String phone;
021  private String timezone;
022  private String externalAppUserId;
023  private Map<String, String> trackingCodes;
024
025  /**
026   * Gets whether or not the new user will be able to see other enterprise users in their contact
027   * list.
028   *
029   * @return true if the new user will be able to see other enterprise users in their contact list;
030   *     otherwise false.
031   */
032  public Boolean getCanSeeManagedUsers() {
033    return this.canSeeManagedUsers;
034  }
035
036  /**
037   * Sets whether or not the new user will be able to see other enterprise users in their contact
038   * list.
039   *
040   * @param canSeeManagedUsers whether or not the new user will be able to see other enterprise
041   *     users in their contact list.
042   * @return this CreateUserParams object for chaining.
043   */
044  public CreateUserParams setCanSeeManagedUsers(boolean canSeeManagedUsers) {
045    this.canSeeManagedUsers = canSeeManagedUsers;
046    return this;
047  }
048
049  /**
050   * Gets whether or not the new user will be exempt from Enterprise device limits.
051   *
052   * @return true if the new user will be exempt from Enterprise device limits; otherwise false.
053   */
054  public Boolean getIsExemptFromDeviceLimits() {
055    return this.isExemptFromDeviceLimits;
056  }
057
058  /**
059   * Sets whether or not the new user will be exempt from Enterprise device limits.
060   *
061   * @param isExemptFromDeviceLimits whether or not the new user will be exempt from Enterprise
062   *     device limits.
063   * @return this CreateUserParams object for chaining.
064   */
065  public CreateUserParams setIsExemptFromDeviceLimits(boolean isExemptFromDeviceLimits) {
066    this.isExemptFromDeviceLimits = isExemptFromDeviceLimits;
067    return this;
068  }
069
070  /**
071   * Gets whether or not the new user will be required to use two-factor authentication.
072   *
073   * @return true if the new user will be required to use two-factor authentication; otherwise
074   *     false.
075   */
076  public Boolean getIsExemptFromLoginVerification() {
077    return this.isExemptFromLoginVerification;
078  }
079
080  /**
081   * Sets whether or not the new user will be required to use two-factor authentication.
082   *
083   * @param isExemptFromLoginVerification whether or not the new user will be required to use
084   *     two-factor authentication.
085   * @return this CreateUserParams object for chaining.
086   */
087  public CreateUserParams setIsExemptFromLoginVerification(boolean isExemptFromLoginVerification) {
088    this.isExemptFromLoginVerification = isExemptFromLoginVerification;
089    return this;
090  }
091
092  /**
093   * Gets whether or not the user we are creating is an app user with Box Developer Edition.
094   *
095   * @return true if the new user is an app user for Box Developer Addition; otherwise false.
096   */
097  public Boolean getIsPlatformAccessOnly() {
098    return this.isPlatformAccessOnly;
099  }
100
101  /**
102   * Sets whether or not the user we are creating is an app user with Box Developer Edition.
103   *
104   * @param isPlatformAccessOnly whether or not the user we are creating is an app user with Box
105   *     Developer Edition.
106   * @return this CreateUserParams object for chaining.
107   */
108  public CreateUserParams setIsPlatformAccessOnly(boolean isPlatformAccessOnly) {
109    this.isPlatformAccessOnly = isPlatformAccessOnly;
110    return this;
111  }
112
113  /**
114   * Gets whether or not the new user will be able to use Box Sync.
115   *
116   * @return true if the new user will be able to use Box Sync; otherwise false.
117   */
118  public Boolean getIsSyncEnabled() {
119    return this.isSyncEnabled;
120  }
121
122  /**
123   * Sets whether or not the new user will be able to use Box Sync.
124   *
125   * @param isSyncEnabled whether or not the new user will be able to use Box Sync.
126   * @return this CreateUserParams object for chaining.
127   */
128  public CreateUserParams setIsSyncEnabled(boolean isSyncEnabled) {
129    this.isSyncEnabled = isSyncEnabled;
130    return this;
131  }
132
133  /**
134   * Gets what the new user's enterprise role will be.
135   *
136   * @return what the new user's enterprise role will be.
137   */
138  public BoxUser.Role getRole() {
139    return this.role;
140  }
141
142  /**
143   * Sets what the new user's enterprise role will be.
144   *
145   * @param role what the new user's enterprise role will be.
146   * @return this CreateUserParams object for chaining.
147   */
148  public CreateUserParams setRole(BoxUser.Role role) {
149    this.role = role;
150    return this;
151  }
152
153  /**
154   * Gets what the new user's account status will be.
155   *
156   * @return what the new user's account status will be.
157   */
158  public BoxUser.Status getStatus() {
159    return this.status;
160  }
161
162  /**
163   * Sets what the new user's account status will be.
164   *
165   * @param status what the new user's account status will be.
166   * @return this CreateUserParams object for chaining.
167   */
168  public CreateUserParams setStatus(BoxUser.Status status) {
169    this.status = status;
170    return this;
171  }
172
173  /**
174   * Gets what the new user's total available space will be in bytes.
175   *
176   * @return what the new user's total available space will be in bytes.
177   */
178  public Long getSpaceAmount() {
179    return this.spaceAmount;
180  }
181
182  /**
183   * Sets what the new user's total available space will be in bytes.
184   *
185   * @param spaceAmount what the new user's total available space will be in bytes.
186   * @return this CreateUserParams object for chaining.
187   */
188  public CreateUserParams setSpaceAmount(long spaceAmount) {
189    this.spaceAmount = spaceAmount;
190    return this;
191  }
192
193  /**
194   * Gets what the address of the new user will be.
195   *
196   * @return what the address of the new user will be.
197   */
198  public String getAddress() {
199    return this.address;
200  }
201
202  /**
203   * Sets what the address of the new user will be.
204   *
205   * @param address what the address of the new user will be.
206   * @return this CreateUserParams object for chaining.
207   */
208  public CreateUserParams setAddress(String address) {
209    this.address = address;
210    return this;
211  }
212
213  /**
214   * Gets what the job title of the new user will be.
215   *
216   * @return what the job title of the new user will be.
217   */
218  public String getJobTitle() {
219    return this.jobTitle;
220  }
221
222  /**
223   * Sets what the job title of the new user will be.
224   *
225   * @param jobTitle what the job title of the new user will be.
226   * @return this CreateUserParams object for chaining.
227   */
228  public CreateUserParams setJobTitle(String jobTitle) {
229    this.jobTitle = jobTitle;
230    return this;
231  }
232
233  /**
234   * Gets what the language of the new user will be.
235   *
236   * @return what the language of the new user will be.
237   */
238  public String getLanguage() {
239    return this.language;
240  }
241
242  /**
243   * Sets what the language of the new user will be.
244   *
245   * @param language what the language of the new user will be.
246   * @return this CreateUserParams object for chaining.
247   */
248  public CreateUserParams setLanguage(String language) {
249    this.language = language;
250    return this;
251  }
252
253  /**
254   * Gets what the phone number of the new user will be.
255   *
256   * @return what the phone number of the new user will be.
257   */
258  public String getPhone() {
259    return this.phone;
260  }
261
262  /**
263   * Sets what the phone number of the new user will be.
264   *
265   * @param phone what the phone number of the new user will be.
266   * @return this CreateUserParams object for chaining.
267   */
268  public CreateUserParams setPhone(String phone) {
269    this.phone = phone;
270    return this;
271  }
272
273  /**
274   * Gets what the timezone of the new user will be.
275   *
276   * @return what the timezone of the new user will be.
277   */
278  public String getTimezone() {
279    return this.timezone;
280  }
281
282  /**
283   * Sets what the timezone of the new user will be.
284   *
285   * @param timezone what the timezone of the new user will be.
286   * @return this CreateUserParams object for chaining.
287   */
288  public CreateUserParams setTimezone(String timezone) {
289    this.timezone = timezone;
290    return this;
291  }
292
293  /**
294   * Gets the external app user id that has been set for the app user.
295   *
296   * @return the external app user id.
297   */
298  public String getExternalAppUserId() {
299    return this.externalAppUserId;
300  }
301
302  /**
303   * Sets the external app user id.
304   *
305   * @param externalAppUserId external app user id.
306   * @return this CreateUserParams object for chaining.
307   */
308  public CreateUserParams setExternalAppUserId(String externalAppUserId) {
309    this.externalAppUserId = externalAppUserId;
310    return this;
311  }
312
313  /**
314   * Gets whether this user is allowed or not to collaborate with users outside their enterprise.
315   *
316   * @return true if the user is not able to collaborate with users outside their enterpise;
317   *     otherwise false.
318   */
319  public Boolean getIsExternalCollabRestricted() {
320    return this.isExternalCollabRestricted;
321  }
322
323  /**
324   * Sets whether this user is allowed or not to collaborate with users outside their enterprise.
325   *
326   * @param isExternalCollabRestricted whether the user is allowed to collaborate with users outside
327   *     their enterprise.
328   * @return this CreateUserParams object for chaining.
329   */
330  public CreateUserParams setIsExternalCollabRestricted(boolean isExternalCollabRestricted) {
331    this.isExternalCollabRestricted = isExternalCollabRestricted;
332    return this;
333  }
334
335  /**
336   * Gets the map of tracking codes. Tracking codes allow an admin to generate reports from the
337   * admin console and assign an attribute to a specific group of users. This setting must be
338   * enabled for an enterprise before it can be used.
339   *
340   * @return map of tracking codes.
341   */
342  public Map<String, String> getTrackingCodes() {
343    return this.trackingCodes;
344  }
345
346  /**
347   * Sets the map of tracking codes. Tracking codes allow an admin to generate reports from the
348   * admin console and assign an attribute to a specific group of users. This setting must be
349   * enabled for an enterprise before it can be used.
350   *
351   * @param trackingCodes map of tracking codes.
352   * @return this CreateUserParams object for chaining.
353   */
354  public CreateUserParams setTrackingCodes(Map<String, String> trackingCodes) {
355    this.trackingCodes = trackingCodes;
356    return this;
357  }
358
359  /**
360   * Add an element the map of tracking codes. Tracking codes allow an admin to generate reports
361   * from the admin console and assign an attribute to a specific group of users. This setting must
362   * be enabled for an enterprise before it can be used.
363   *
364   * @param key of a tracking code
365   * @param value of a tracking code
366   * @return this CreateUserParams object for chaining.
367   */
368  public CreateUserParams addTrackingCode(String key, String value) {
369    if (this.trackingCodes == null) {
370      this.trackingCodes = new HashMap<>();
371    }
372    this.trackingCodes.put(key, value);
373    return this;
374  }
375}