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