• 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

56.32
/src/main/java/com/smartsheet/api/internal/UserResourcesImpl.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.internal;
18

19
import com.smartsheet.api.AuthorizationException;
20
import com.smartsheet.api.InvalidRequestException;
21
import com.smartsheet.api.ResourceNotFoundException;
22
import com.smartsheet.api.ServiceUnavailableException;
23
import com.smartsheet.api.SmartsheetException;
24
import com.smartsheet.api.UserResources;
25
import com.smartsheet.api.internal.http.HttpEntity;
26
import com.smartsheet.api.internal.http.HttpMethod;
27
import com.smartsheet.api.internal.http.HttpRequest;
28
import com.smartsheet.api.internal.http.HttpResponse;
29
import com.smartsheet.api.internal.util.QueryUtil;
30
import com.smartsheet.api.internal.util.Util;
31
import com.smartsheet.api.models.AlternateEmail;
32
import com.smartsheet.api.models.DeleteUserParameters;
33
import com.smartsheet.api.models.PagedResult;
34
import com.smartsheet.api.models.PaginationParameters;
35
import com.smartsheet.api.models.Sheet;
36
import com.smartsheet.api.models.User;
37
import com.smartsheet.api.models.UserProfile;
38
import com.smartsheet.api.models.enums.ListUserInclusion;
39
import com.smartsheet.api.models.enums.UserInclusion;
40

41
import java.io.File;
42
import java.io.FileInputStream;
43
import java.io.FileNotFoundException;
44
import java.io.InputStream;
45
import java.net.URLEncoder;
46
import java.nio.charset.StandardCharsets;
47
import java.text.SimpleDateFormat;
48
import java.util.Date;
49
import java.util.EnumSet;
50
import java.util.HashMap;
51
import java.util.List;
52
import java.util.Map;
53
import java.util.Set;
54

55
/**
56
 * This is the implementation of the UserResources.
57
 * <p>
58
 * Thread Safety: This class is thread safe because it is immutable and its base class is thread safe.
59
 */
60
public class UserResourcesImpl extends AbstractResources implements UserResources {
61

62
    private static final String USERS = "users";
63
    private static final String ALTERNATE_EMAILS = "alternateemails";
64

65
    /**
66
     * Constructor.
67
     * <p>
68
     * Exceptions: - IllegalArgumentException : if any argument is null
69
     *
70
     * @param smartsheet the smartsheet
71
     */
72
    public UserResourcesImpl(SmartsheetImpl smartsheet) {
73
        super(smartsheet);
1✔
74
    }
1✔
75

76
    /**
77
     * List all users.
78
     * <p>
79
     * It mirrors to the following Smartsheet REST API method: GET /users
80
     *
81
     * @return the list of all users
82
     * @throws IllegalArgumentException    if any argument is null or empty string
83
     * @throws InvalidRequestException     if there is any problem with the REST API request
84
     * @throws AuthorizationException      if there is any problem with  the REST API authorization (access token)
85
     * @throws ResourceNotFoundException   if the resource cannot be found
86
     * @throws ServiceUnavailableException if the REST API service is not available (possibly due to rate limiting)
87
     * @throws SmartsheetException         if there is any other error during the operation
88
     */
89
    public PagedResult<User> listUsers() throws SmartsheetException {
90
        return this.listUsersInternal(null, null, null);
1✔
91
    }
92

93
    /**
94
     * List all users.
95
     * <p>
96
     * It mirrors to the following Smartsheet REST API method: GET /users
97
     * <p>
98
     * Exceptions:
99
     *   - InvalidRequestException : if there is any problem with the REST API request
100
     *   - AuthorizationException : if there is any problem with the REST API authorization(access token)
101
     *   - ServiceUnavailableException : if the REST API service is not available (possibly due to rate limiting)
102
     *   - SmartsheetRestException : if there is any other REST API related error occurred during the operation
103
     *   - SmartsheetException : if there is any other error occurred during the operation
104
     *
105
     * @param pagination the object containing the pagination query parameters
106
     * @return all users (note that empty list will be returned if there is none)
107
     * @throws SmartsheetException the smartsheet exception
108
     */
109
    public PagedResult<User> listUsers(PaginationParameters pagination) throws SmartsheetException {
110
        return this.listUsersInternal(null, null, pagination);
1✔
111
    }
112

113
    /**
114
     * List all users.
115
     * <p>
116
     * It mirrors to the following Smartsheet REST API method: GET /users
117
     * <p>
118
     * Exceptions:
119
     * - InvalidRequestException : if there is any problem with the REST API request
120
     * - AuthorizationException : if there is any problem with the REST API authorization(access token)
121
     * - ServiceUnavailableException : if the REST API service is not available (possibly due to rate limiting)
122
     * - SmartsheetRestException : if there is any other REST API related error occurred during the operation
123
     * - SmartsheetException : if there is any other error occurred during the operation
124
     *
125
     * @param email      the list of email addresses
126
     * @param pagination the object containing the pagination query parameters
127
     * @return all users (note that empty list will be returned if there is none)
128
     * @throws SmartsheetException the smartsheet exception
129
     */
130
    public PagedResult<User> listUsers(Set<String> email, PaginationParameters pagination) throws SmartsheetException {
131
        return this.listUsersInternal(email, null, pagination);
1✔
132
    }
133

134
    /**
135
     * List all users.
136
     * <p>
137
     * It mirrors to the following Smartsheet REST API method: GET /users
138
     * <p>
139
     * Exceptions:
140
     * - InvalidRequestException : if there is any problem with the REST API request
141
     * - AuthorizationException : if there is any problem with the REST API authorization(access token)
142
     * - ServiceUnavailableException : if the REST API service is not available (possibly due to rate limiting)
143
     * - SmartsheetRestException : if there is any other REST API related error occurred during the operation
144
     * - SmartsheetException : if there is any other error occurred during the operation
145
     *
146
     * @param email      the list of email addresses
147
     * @param includes   elements to include in the response
148
     * @param pagination the object containing the pagination query parameters
149
     * @return all users (note that empty list will be returned if there is none)
150
     * @throws SmartsheetException the smartsheet exception
151
     */
152
    public PagedResult<User> listUsers(Set<String> email, EnumSet<ListUserInclusion> includes,
153
                                       PaginationParameters pagination) throws SmartsheetException {
154
        return this.listUsersInternal(email, includes, pagination);
1✔
155
    }
156

157
    /**
158
     * List all users.
159
     * <p>
160
     * It mirrors to the following Smartsheet REST API method: GET /users
161
     * <p>
162
     * Exceptions:
163
     *   - InvalidRequestException : if there is any problem with the REST API request
164
     *   - AuthorizationException : if there is any problem with the REST API authorization(access token)
165
     *   - ServiceUnavailableException : if the REST API service is not available (possibly due to rate limiting)
166
     *   - SmartsheetRestException : if there is any other REST API related error occurred during the operation
167
     *   - SmartsheetException : if there is any other error occurred during the operation
168
     *
169
     * @param email the list of email addresses
170
     * @param includes elements to include in the response
171
     * @param pagination the object containing the pagination query parameters
172
     * @return all users (note that empty list will be returned if there is none)
173
     * @throws SmartsheetException the smartsheet exception
174
     */
175
    private PagedResult<User> listUsersInternal(Set<String> email, EnumSet<ListUserInclusion> includes,
176
                                       PaginationParameters pagination) throws SmartsheetException {
177
        String path = USERS;
1✔
178
        Map<String, Object> parameters = new HashMap<>();
1✔
179

180
        if (pagination != null) {
1✔
181
            parameters = pagination.toHashMap();
1✔
182
        }
183

184
        if (email != null) {
1✔
185
            parameters.put("email", QueryUtil.generateCommaSeparatedList(email));
1✔
186
        }
187

188
        if (includes != null) {
1✔
189
            parameters.put("include", QueryUtil.generateCommaSeparatedList(includes));
1✔
190
        }
191

192
        path += QueryUtil.generateUrl(null, parameters);
1✔
193
        return this.listResourcesWithWrapper(path, User.class);
1✔
194
    }
195

196
    /**
197
     * Add a user to the organization, without sending email.
198
     * <p>
199
     * It mirrors to the following Smartsheet REST API method: POST /users
200
     * <p>
201
     * Exceptions:
202
     * - IllegalArgumentException : if any argument is null
203
     * - InvalidRequestException : if there is any problem with the REST API request
204
     * - AuthorizationException : if there is any problem with the REST API authorization(access token)
205
     * - ResourceNotFoundException : if the resource can not be found
206
     * - ServiceUnavailableException : if the REST API service is not available (possibly due to rate limiting)
207
     * - SmartsheetRestException : if there is any other REST API related error occurred during the operation
208
     * - SmartsheetException : if there is any other error occurred during the operation
209
     *
210
     * @param user the user object limited to the following attributes: * admin * email * licensedSheetCreator
211
     * @return the user
212
     * @throws SmartsheetException the smartsheet exception
213
     */
214
    public User addUser(User user) throws SmartsheetException {
215
        return this.createResource(USERS, User.class, user);
1✔
216
    }
217

218
    /**
219
     * Add a user to the organization, without sending email.
220
     * <p>
221
     * It mirrors to the following Smartsheet REST API method: POST /users
222
     * <p>
223
     * Exceptions:
224
     * - IllegalArgumentException : if any argument is null
225
     * - InvalidRequestException : if there is any problem with the REST API request
226
     * - AuthorizationException : if there is any problem with the REST API authorization(access token)
227
     * - ResourceNotFoundException : if the resource can not be found
228
     * - ServiceUnavailableException : if the REST API service is not available (possibly due to rate limiting)
229
     * - SmartsheetRestException : if there is any other REST API related error occurred during the operation
230
     * - SmartsheetException : if there is any other error occurred during the operation
231
     *
232
     * @param user      the created user
233
     * @param sendEmail whether to send email
234
     * @return the user object limited to the following attributes: * admin * email * licensedSheetCreator
235
     * @throws SmartsheetException the smartsheet exception
236
     */
237
    public User addUser(User user, boolean sendEmail) throws SmartsheetException {
238
        return this.createResource("users?sendEmail=" + sendEmail, User.class, user);
1✔
239
    }
240

241
    /**
242
     * Get the current user.
243
     * <p>
244
     * It mirrors to the following Smartsheet REST API method: GET /users/{userId}
245
     *
246
     * @param userId the user id
247
     * @return the user
248
     * @throws IllegalArgumentException    if any argument is null or empty string
249
     * @throws InvalidRequestException     if there is any problem with the REST API request
250
     * @throws AuthorizationException      if there is any problem with  the REST API authorization (access token)
251
     * @throws ResourceNotFoundException   if the resource cannot be found
252
     * @throws ServiceUnavailableException if the REST API service is not available (possibly due to rate limiting)
253
     * @throws SmartsheetException         if there is any other error during the operation
254
     */
255
    public UserProfile getUser(long userId) throws SmartsheetException {
256
        return this.getResource(USERS + "/" + userId, UserProfile.class);
1✔
257
    }
258

259
    /**
260
     * Get the current user.
261
     * <p>
262
     * It mirrors to the following Smartsheet REST API method: GET /users/me
263
     * <p>
264
     * Exceptions:
265
     * - InvalidRequestException : if there is any problem with the REST API request
266
     * - AuthorizationException : if there is any problem with the REST API authorization(access token)
267
     * - ResourceNotFoundException : if the resource can not be found
268
     * - ServiceUnavailableException : if the REST API service is not available (possibly due to rate limiting)
269
     * - SmartsheetRestException : if there is any other REST API related error occurred during the operation
270
     * - SmartsheetException : if there is any other error occurred during the operation
271
     *
272
     * @return the resource (note that if there is no such resource, this method will throw ResourceNotFoundException
273
     * rather than returning null).
274
     * @throws SmartsheetException the smartsheet exception
275
     */
276
    public UserProfile getCurrentUser() throws SmartsheetException {
277
        return this.getResource("users/me", UserProfile.class);
1✔
278
    }
279

280
    /**
281
     * <p>Get the current user.</p>
282
     *
283
     * <p>It mirrors to the following Smartsheet REST API method: GET /user/me</p>
284
     *
285
     * @param includes used to specify the optional objects to include.
286
     * @return the current user
287
     * @throws IllegalArgumentException    if any argument is null or empty string
288
     * @throws InvalidRequestException     if there is any problem with the REST API request
289
     * @throws AuthorizationException      if there is any problem with  the REST API authorization (access token)
290
     * @throws ResourceNotFoundException   if the resource cannot be found
291
     * @throws ServiceUnavailableException if the REST API service is not available (possibly due to rate limiting)
292
     * @throws SmartsheetException         if there is any other error during the operation
293
     */
294
    public UserProfile getCurrentUser(EnumSet<UserInclusion> includes) throws SmartsheetException {
295
        String path = "users/me";
1✔
296

297
        Map<String, Object> parameters = new HashMap<>();
1✔
298
        parameters.put("include", QueryUtil.generateCommaSeparatedList(includes));
1✔
299

300
        path += QueryUtil.generateUrl(null, parameters);
1✔
301
        return this.getResource(path, UserProfile.class);
1✔
302
    }
303

304
    /**
305
     * List all organisation sheets.
306
     * <p>
307
     * It mirrors to the following Smartsheet REST API method: GET /users/sheets
308
     *
309
     * @param pagination the object containing the pagination query parameters
310
     * @return the list of all organisation sheets
311
     * @throws IllegalArgumentException    if any argument is null or empty string
312
     * @throws InvalidRequestException     if there is any problem with the REST API request
313
     * @throws AuthorizationException      if there is any problem with  the REST API authorization (access token)
314
     * @throws ResourceNotFoundException   if the resource cannot be found
315
     * @throws ServiceUnavailableException if the REST API service is not available (possibly due to rate limiting)
316
     * @throws SmartsheetException         if there is any other error during the operation
317
     */
318
    public PagedResult<Sheet> listOrgSheets(PaginationParameters pagination, Date modifiedSince) throws SmartsheetException {
319
        String path = "users/sheets";
1✔
320

321
        Map<String, Object> parameters = new HashMap<>();
1✔
322
        if (pagination != null) {
1✔
323
            parameters = pagination.toHashMap();
1✔
324
        }
325
        if (modifiedSince != null) {
1✔
326
            String isoDate = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ").format(modifiedSince);
×
327
            parameters.put("modifiedSince", isoDate);
×
328
        }
329
        path += QueryUtil.generateUrl(null, parameters);
1✔
330
        return this.listResourcesWithWrapper(path, Sheet.class);
1✔
331
    }
332

333
    public PagedResult<Sheet> listOrgSheets(PaginationParameters pagination) throws SmartsheetException {
334
        return this.listOrgSheets(pagination, null);
×
335
    }
336

337
    /**
338
     * List all user alternate emails.
339
     * <p>
340
     * It mirrors to the following Smartsheet REST API method: GET /users/{userId}/alternateemails
341
     *
342
     * @param userId     the id of the user
343
     * @param pagination the object containing the pagination query parameters
344
     * @return the list of all user alternate emails
345
     * @throws IllegalArgumentException    if any argument is null or empty string
346
     * @throws InvalidRequestException     if there is any problem with the REST API request
347
     * @throws AuthorizationException      if there is any problem with  the REST API authorization (access token)
348
     * @throws ResourceNotFoundException   if the resource cannot be found
349
     * @throws ServiceUnavailableException if the REST API service is not available (possibly due to rate limiting)
350
     * @throws SmartsheetException         if there is any other error during the operation
351
     */
352
    public PagedResult<AlternateEmail> listAlternateEmails(long userId, PaginationParameters pagination) throws SmartsheetException {
353
        String path = USERS + "/" + userId + "/" + ALTERNATE_EMAILS;
1✔
354

355
        if (pagination != null) {
1✔
356
            path += pagination.toQueryString();
1✔
357
        }
358
        return this.listResourcesWithWrapper(path, AlternateEmail.class);
1✔
359
    }
360

361
    /**
362
     * Get alternate email.
363
     * <p>
364
     * It mirrors to the following Smartsheet REST API method: GET /users/{userId}/alternateemails/{alternateEmailId}
365
     *
366
     * @param userId     the id of the user
367
     * @param altEmailId the alternate email id for the alternate email to retrieve.
368
     * @return the resource (note that if there is no such resource, this method will throw
369
     * ResourceNotFoundException rather than returning null).
370
     * @throws IllegalArgumentException    if any argument is null or empty string
371
     * @throws InvalidRequestException     if there is any problem with the REST API request
372
     * @throws AuthorizationException      if there is any problem with  the REST API authorization (access token)
373
     * @throws ResourceNotFoundException   if the resource cannot be found
374
     * @throws ServiceUnavailableException if the REST API service is not available (possibly due to rate limiting)
375
     * @throws SmartsheetException         if there is any other error during the operation
376
     */
377
    public AlternateEmail getAlternateEmail(long userId, long altEmailId) throws SmartsheetException {
378
        return this.getResource(USERS + "/" + userId + "/" + ALTERNATE_EMAILS + "/" + altEmailId, AlternateEmail.class);
1✔
379
    }
380

381
    /**
382
     * Add an alternate email.
383
     * <p>
384
     * It mirrors to the following Smartsheet REST API method: POST /users/{userId}/alternateemails
385
     *
386
     * @param userId    the id of the user
387
     * @param altEmails AlternateEmail alternate email address to add.
388
     * @return the resource (note that if there is no such resource, this method will throw
389
     * ResourceNotFoundException rather than returning null).
390
     * @throws IllegalArgumentException    if any argument is null or empty string
391
     * @throws InvalidRequestException     if there is any problem with the REST API request
392
     * @throws AuthorizationException      if there is any problem with  the REST API authorization (access token)
393
     * @throws ResourceNotFoundException   if the resource cannot be found
394
     * @throws ServiceUnavailableException if the REST API service is not available (possibly due to rate limiting)
395
     * @throws SmartsheetException         if there is any other error during the operation
396
     */
397
    public List<AlternateEmail> addAlternateEmail(long userId, List<AlternateEmail> altEmails) throws SmartsheetException {
398
        Util.throwIfNull(altEmails);
1✔
399
        if (altEmails.size() == 0) {
1✔
400
            return altEmails;
1✔
401
        }
402
        return this.postAndReceiveList(USERS + "/" + userId + "/" + ALTERNATE_EMAILS, altEmails, AlternateEmail.class);
1✔
403
    }
404

405
    /**
406
     * Delete an alternate email.
407
     * <p>
408
     * It mirrors to the following Smartsheet REST API method: DELETE /users/{userId}/alternateemails/{alternateEmailId}
409
     *
410
     * @param userId     the id of the user
411
     * @param altEmailId the alternate email id for the alternate email to retrieve.
412
     * @throws IllegalArgumentException    if any argument is null or empty string
413
     * @throws InvalidRequestException     if there is any problem with the REST API request
414
     * @throws AuthorizationException      if there is any problem with  the REST API authorization (access token)
415
     * @throws ResourceNotFoundException   if the resource cannot be found
416
     * @throws ServiceUnavailableException if the REST API service is not available (possibly due to rate limiting)
417
     * @throws SmartsheetException         if there is any other error during the operation
418
     */
419
    public void deleteAlternateEmail(long userId, long altEmailId) throws SmartsheetException {
420
        this.deleteResource(USERS + "/" + userId + "/" + ALTERNATE_EMAILS + "/" + altEmailId, AlternateEmail.class);
1✔
421
    }
1✔
422

423
    /**
424
     * Promote and alternate email to primary.
425
     *
426
     * @param userId     id of the user
427
     * @param altEmailId alternate email id
428
     * @return alternateEmail of the primary
429
     * @throws IllegalArgumentException    if any argument is null or empty string
430
     * @throws InvalidRequestException     if there is any problem with the REST API request
431
     * @throws AuthorizationException      if there is any problem with  the REST API authorization (access token)
432
     * @throws ResourceNotFoundException   if the resource cannot be found
433
     * @throws ServiceUnavailableException if the REST API service is not available (possibly due to rate limiting)
434
     * @throws SmartsheetException         f there is any other error during the operation
435
     */
436
    public AlternateEmail promoteAlternateEmail(long userId, long altEmailId) throws SmartsheetException {
437

438
        HttpRequest request = createHttpRequest(smartsheet.getBaseURI().resolve(
×
439
                USERS + "/" + userId + "/" + ALTERNATE_EMAILS + "/" + altEmailId + "/makeprimary"), HttpMethod.POST);
440

441
        Object obj = null;
×
442
        try {
443
            HttpResponse response = this.smartsheet.getHttpClient().request(request);
×
444
            switch (response.getStatusCode()) {
×
445
                case 200:
446
                    obj = this.smartsheet.getJsonSerializer().deserializeResult(AlternateEmail.class,
×
447
                            response.getEntity().getContent());
×
448
                    break;
×
449
                default:
450
                    handleError(response);
×
451
            }
452
        } finally {
453
            smartsheet.getHttpClient().releaseConnection();
×
454
        }
455

456
        return (AlternateEmail) obj;
×
457
    }
458

459
    /**
460
     * Uploads a profile image for the specified user.
461
     *
462
     * @param userId   id of the user
463
     * @param file     path to the image file
464
     * @param fileType content type of the image file
465
     * @return user
466
     * @throws IllegalArgumentException    if any argument is null or empty string
467
     * @throws InvalidRequestException     if there is any problem with the REST API request
468
     * @throws AuthorizationException      if there is any problem with  the REST API authorization (access token)
469
     * @throws ResourceNotFoundException   if the resource cannot be found
470
     * @throws ServiceUnavailableException if the REST API service is not available (possibly due to rate limiting)
471
     * @throws SmartsheetException         f there is any other error during the operation
472
     */
473
    public User addProfileImage(long userId, String file, String fileType) throws SmartsheetException, FileNotFoundException {
474
        return attachProfileImage(USERS + "/" + userId + "/profileimage", file, fileType);
×
475
    }
476

477
    private User attachProfileImage(String path, String file, String contentType) throws SmartsheetException, FileNotFoundException {
478
        Util.throwIfNull(file);
×
479

480
        if (contentType == null) {
×
481
            contentType = "application/octet-stream";
×
482
        }
483

484
        Map<String, Object> parameters = new HashMap<>();
×
485
        path += QueryUtil.generateUrl(null, parameters);
×
486

487
        HttpRequest request = createHttpRequest(this.smartsheet.getBaseURI().resolve(path), HttpMethod.POST);
×
488
        String attachmentHeaderValue = "attachment; filename=\"" + URLEncoder.encode(file, StandardCharsets.UTF_8) + "\"";
×
489
        request.getHeaders().put("Content-Disposition", attachmentHeaderValue);
×
490

491
        File f = new File(file);
×
492
        InputStream is = new FileInputStream(f);
×
493

494
        HttpEntity entity = new HttpEntity();
×
495
        entity.setContentType(contentType);
×
496
        entity.setContent(is);
×
497
        entity.setContentLength(f.length());
×
498
        request.setEntity(entity);
×
499

500
        User obj = null;
×
501
        try {
502
            HttpResponse response = this.smartsheet.getHttpClient().request(request);
×
503
            switch (response.getStatusCode()) {
×
504
                case 200:
505
                    obj = this.smartsheet.getJsonSerializer().deserializeResult(User.class,
×
506
                            response.getEntity().getContent()).getResult();
×
507
                    break;
×
508
                default:
509
                    handleError(response);
×
510
            }
511
        } finally {
512
            smartsheet.getHttpClient().releaseConnection();
×
513
        }
514

515
        return obj;
×
516
    }
517

518
    @Override
519
    public User updateUser(User user) throws SmartsheetException {
520
        return this.updateResource(USERS + "/" + user.getId(), User.class, user);
1✔
521
    }
522

523
    @Override
524
    public void deleteUser(long userId, DeleteUserParameters parameters) throws SmartsheetException {
525
        String path = USERS + "/" + userId;
1✔
526

527
        if (parameters != null) {
1✔
528
            path += parameters.toQueryString();
1✔
529
        }
530

531
        this.deleteResource(path, User.class);
1✔
532
    }
1✔
533
}
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