• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

smartsheet / smartsheet-java-sdk / #56

06 Jun 2025 04:28PM UTC coverage: 60.611% (+0.06%) from 60.548%
#56

push

github

web-flow
chore: Added pull request template (#121)

* Initial commit: Added pull request template

* Updated wording and grammar

* Added relevant links and removed style guide requirement

* chore: Updated pull request template and added codeowners file

* chore: Removed redundant checklist point and codeowners file

---------

Co-authored-by: Priyanka Lakhe <priyankalakhe@gmail.com>

4164 of 6870 relevant lines covered (60.61%)

0.61 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

65.52
/src/main/java/com/smartsheet/api/models/UserModel.java
1
/*
2
 * Copyright (C) 2025 Smartsheet
3
 *
4
 * Licensed under the Apache License, Version 2.0 (the "License");
5
 * you may not use this file except in compliance with the License.
6
 * You may obtain a copy of the License at
7
 *
8
 *      http://www.apache.org/licenses/LICENSE-2.0
9
 *
10
 * Unless required by applicable law or agreed to in writing, software
11
 * distributed under the License is distributed on an "AS IS" BASIS,
12
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
 * See the License for the specific language governing permissions and
14
 * limitations under the License.
15
 */
16

17
package com.smartsheet.api.models;
18

19
import com.smartsheet.api.models.enums.UserStatus;
20

21
import java.util.Date;
22
import java.util.List;
23

24
public abstract class UserModel extends IdentifiableModel<Long> {
1✔
25
    /**
26
     * Represents the email address.
27
     */
28
    private String email;
29

30
    /**
31
     * Represents the first name.
32
     */
33
    private String firstName;
34

35
    /**
36
     * Represents the last name.
37
     */
38
    private String lastName;
39

40
    /**
41
     * Represents the admin flag which allows managing users and accounts.
42
     */
43
    private Boolean admin;
44

45
    /**
46
     * Represents the licensed sheet creator flag which allows creating and owning sheets.
47
     */
48
    private Boolean licensedSheetCreator;
49

50
    /**
51
     * Represents the resource manager flag which allows the user access to the Resource Manager functionality.
52
     */
53
    private Boolean resourceViewer;
54

55
    /**
56
     * Represents the group admin flag which allows users to create and modify groups.
57
     */
58
    private Boolean groupAdmin;
59

60
    /**
61
     * Represents the user status (active, pending, declined).
62
     */
63
    private UserStatus status;
64

65
    /**
66
     * An array of AlternateEmail Objects representing the alternate email addresses associated with the User account
67
     */
68
    private List<AlternateEmail> alternateEmails;
69

70
    /**
71
     * The number of sheets owned by the current user within the organization.
72
     * Note: As of 5-12-2025, this behavior will be discontinued and sheetCount will hold a value of -1 only if the user's status is ACTIVE.
73
     * For more information, see the <a href="https://developers.smartsheet.com/api/smartsheet/changelog#2025-04-22">API Changelog</a>.
74
     */
75
    private Integer sheetCount;
76

77
    /**
78
     * Last login time of the current user
79
     */
80
    private Date lastLogin;
81

82
    /**
83
     * Timestamp of viewing an Enterprise Custom Welcome Screen by the current user
84
     */
85
    private Date customWelcomeScreenViewed;
86

87
    /**
88
     * Company name from the user's profile
89
     */
90
    private String company;
91

92
    /**
93
     * Department name from the user's profile
94
     */
95
    private String department;
96

97
    /**
98
     * User's mobile phone number from the profile
99
     */
100
    private String mobilePhone;
101

102
    /**
103
     * Link to the user's profile image
104
     */
105
    private ProfileImage profileImage;
106

107
    /**
108
     * User's role
109
     */
110
    private String role;
111

112
    /**
113
     * User's title
114
     */
115
    private String title;
116

117
    /**
118
     * Work phone number from the user's profile
119
     */
120
    private String workPhone;
121

122
    /**
123
     * Gets the email address.
124
     *
125
     * @return the email address
126
     */
127
    public String getEmail() {
128
        return email;
1✔
129
    }
130

131
    /**
132
     * Sets the email address.
133
     *
134
     * @param email the new email address
135
     */
136
    public UserModel setEmail(String email) {
137
        this.email = email;
1✔
138
        return this;
1✔
139
    }
140

141
    /**
142
     * Gets the first name.
143
     *
144
     * @return the first name
145
     */
146
    public String getFirstName() {
147
        return firstName;
1✔
148
    }
149

150
    /**
151
     * Sets the first name.
152
     *
153
     * @param firstName the new first name
154
     */
155
    public UserModel setFirstName(String firstName) {
156
        this.firstName = firstName;
1✔
157
        return this;
1✔
158
    }
159

160
    /**
161
     * Gets the last name.
162
     *
163
     * @return the last name
164
     */
165
    public String getLastName() {
166
        return lastName;
1✔
167
    }
168

169
    /**
170
     * Sets the last name.
171
     *
172
     * @param lastName the new last name
173
     */
174
    public UserModel setLastName(String lastName) {
175
        this.lastName = lastName;
1✔
176
        return this;
1✔
177
    }
178

179
    /**
180
     * Gets the admin flag which allows managing users and accounts.
181
     *
182
     * @return the admin
183
     */
184
    public Boolean getAdmin() {
185
        return admin;
1✔
186
    }
187

188
    /**
189
     * Sets the admin flag which allows managing users and accounts.
190
     *
191
     * @param admin the new admin
192
     */
193
    public UserModel setAdmin(Boolean admin) {
194
        this.admin = admin;
1✔
195
        return this;
1✔
196
    }
197

198
    /**
199
     * Gets the licensed sheet creator flag that allows creating and owning sheets.
200
     *
201
     * @return the licensed sheet creator
202
     */
203
    public Boolean getLicensedSheetCreator() {
204
        return licensedSheetCreator;
1✔
205
    }
206

207
    /**
208
     * Sets the licensed sheet creator flag that allows creating and owning sheets.
209
     *
210
     * @param licensedSheetCreator the new licensed sheet creator
211
     */
212
    public UserModel setLicensedSheetCreator(Boolean licensedSheetCreator) {
213
        this.licensedSheetCreator = licensedSheetCreator;
1✔
214
        return this;
1✔
215
    }
216

217
    /**
218
     * Gets the status of the user (active, pending, declined).
219
     *
220
     * @return the status
221
     */
222
    public UserStatus getStatus() {
223
        return status;
1✔
224
    }
225

226
    /**
227
     * Sets the status of the user.
228
     *
229
     * @param status the new status
230
     */
231
    public UserModel setStatus(UserStatus status) {
232
        this.status = status;
1✔
233
        return this;
1✔
234
    }
235

236
    /**
237
     * @return the flag indicating if someone is a resource manager
238
     */
239
    public Boolean getResourceViewer() {
240
        return resourceViewer;
1✔
241
    }
242

243
    /**
244
     * Sets the resource manager flag.
245
     *
246
     * @param resourceViewer the flag
247
     */
248
    public UserModel setResourceViewer(Boolean resourceViewer) {
249
        this.resourceViewer = resourceViewer;
1✔
250
        return this;
1✔
251
    }
252

253
    /**
254
     * @return the flag indicating if the user is able to administer group.
255
     */
256
    public Boolean getGroupAdmin() {
257
        return groupAdmin;
1✔
258
    }
259

260
    /**
261
     * @param groupAdmin sets the flag that indicates if someone is a groupAdmin
262
     */
263
    public UserModel setGroupAdmin(Boolean groupAdmin) {
264
        this.groupAdmin = groupAdmin;
1✔
265
        return this;
1✔
266
    }
267

268
    /**
269
     * Gets the list of alternateEmails
270
     *
271
     * @return the list of alternateEmails
272
     */
273
    public List<AlternateEmail> getAlternateEmails() {
274
        return alternateEmails;
1✔
275
    }
276

277
    /**
278
     * Sets the list of alternateEmails
279
     *
280
     * @param alternateEmails the new list of alternateEmails
281
     * @return the UserModel
282
     */
283
    public UserModel setAlternateEmails(List<AlternateEmail> alternateEmails) {
284
        this.alternateEmails = alternateEmails;
×
285
        return this;
×
286
    }
287

288
    /**
289
     * Gets the sheetCount.
290
     * The number of sheets owned by the current user within the organization.
291
     * Note: As of 5-12-2025, this behavior will be discontinued and sheetCount will hold a value of -1 only if the user's status is ACTIVE.
292
     * For more information, see the <a href="https://developers.smartsheet.com/api/smartsheet/changelog#2025-04-22">API Changelog</a>.
293
     * @return sheetCount
294
     */
295
    public Integer getSheetCount() {
296
        return sheetCount;
1✔
297
    }
298

299
    /**
300
     * Sets the sheetCount
301
     *
302
     * @param sheetCount the new sheetCount
303
     * @return the UserModel
304
     */
305
    public UserModel setSheetCount(Integer sheetCount) {
306
        this.sheetCount = sheetCount;
×
307
        return this;
×
308
    }
309

310
    /**
311
     * Gets the lastLogin date
312
     *
313
     * @return the lastLogin date
314
     */
315
    public Date getLastLogin() {
316
        return lastLogin;
1✔
317
    }
318

319
    /**
320
     * Sets the lastLogin date
321
     *
322
     * @param lastLogin the new lastLogin date
323
     * @return the UserModel
324
     */
325
    public UserModel setLastLogin(Date lastLogin) {
326
        this.lastLogin = lastLogin;
1✔
327
        return this;
1✔
328
    }
329

330
    /**
331
     * Gets the customWelcomeScreenViewed date
332
     *
333
     * @return the customerWelcomeScreenViewed date
334
     */
335
    public Date getCustomWelcomeScreenViewed() {
336
        return customWelcomeScreenViewed;
1✔
337
    }
338

339
    /**
340
     * Sets the customWelcomeScreenViewed date
341
     *
342
     * @param customWelcomeScreenViewed the new customWelcomeScreenViewed date
343
     * @return the UserModel
344
     */
345
    public UserModel setCustomWelcomeScreenViewed(Date customWelcomeScreenViewed) {
346
        this.customWelcomeScreenViewed = customWelcomeScreenViewed;
×
347
        return this;
×
348
    }
349

350
    /**
351
     * Gets the user's company name
352
     *
353
     * @return the company name
354
     */
355
    public String getCompany() {
356
        return company;
1✔
357
    }
358

359
    /**
360
     * Sets the user's company name
361
     *
362
     * @param company the company name
363
     */
364
    public UserModel setCompany(String company) {
365
        this.company = company;
×
366
        return this;
×
367
    }
368

369
    /**
370
     * Gets the user's department
371
     *
372
     * @return the department
373
     */
374
    public String getDepartment() {
375
        return department;
1✔
376
    }
377

378
    /**
379
     * Sets the user's department
380
     *
381
     * @param department the department
382
     */
383
    public UserModel setDepartment(String department) {
384
        this.department = department;
×
385
        return this;
×
386
    }
387

388
    /**
389
     * Gets the user's mobile phone number
390
     *
391
     * @return the phone number
392
     */
393
    public String getMobilePhone() {
394
        return mobilePhone;
1✔
395
    }
396

397
    /**
398
     * Sets the user's mobile phone number
399
     *
400
     * @param mobilePhone the phone number
401
     */
402
    public UserModel setMobilePhone(String mobilePhone) {
403
        this.mobilePhone = mobilePhone;
×
404
        return this;
×
405
    }
406

407
    /**
408
     * Gets the user's profile image
409
     *
410
     * @return the ProfileImage
411
     */
412
    public ProfileImage getProfileImage() {
413
        return profileImage;
1✔
414
    }
415

416
    /**
417
     * Sets the user's profile image
418
     *
419
     * @param profileImage the ProfileImage
420
     */
421
    public UserModel setProfileImage(ProfileImage profileImage) {
422
        this.profileImage = profileImage;
×
423
        return this;
×
424
    }
425

426
    /**
427
     * Gets the user's role
428
     *
429
     * @return the role
430
     */
431
    public String getRole() {
432
        return role;
1✔
433
    }
434

435
    /**
436
     * Sets the user's role
437
     *
438
     * @param role the role
439
     */
440
    public UserModel setRole(String role) {
441
        this.role = role;
×
442
        return this;
×
443
    }
444

445
    /**
446
     * Gets the user's title
447
     *
448
     * @return the title
449
     */
450
    public String getTitle() {
451
        return title;
1✔
452
    }
453

454
    /**
455
     * Sets the user's title
456
     *
457
     * @param title the title
458
     */
459
    public UserModel setTitle(String title) {
460
        this.title = title;
×
461
        return this;
×
462
    }
463

464
    /**
465
     * Gets the user's work phone number
466
     *
467
     * @return the phone number
468
     */
469
    public String getWorkPhone() {
470
        return workPhone;
1✔
471
    }
472

473
    /**
474
     * Sets the user's work phone number
475
     *
476
     * @param workPhone the phone number
477
     */
478
    public UserModel setWorkPhone(String workPhone) {
479
        this.workPhone = workPhone;
×
480
        return this;
×
481
    }
482
}
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

© 2025 Coveralls, Inc