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

box / box-java-sdk / #7691

28 Oct 2026 03:14PM UTC coverage: 34.074% (-0.004%) from 34.078%
#7691

push

github

web-flow
feat: add `DocumentSplitManager` and document split APIs + OTP for shared links (box/box-openapi#621)

Co-authored-by: Tsitsi Nyamutswa <128546813+tnyamutswa@users.noreply.github.com>

47 of 1790 new or added lines in 64 files covered. (2.63%)

467 existing lines in 22 files now uncovered.

20001 of 58698 relevant lines covered (34.07%)

0.34 hits per line

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

84.87
/src/main/java/com/box/sdkgen/managers/users/UsersManager.java
1
package com.box.sdkgen.managers.users;
2

3
import static com.box.sdkgen.internal.utils.UtilsManager.convertToString;
4
import static com.box.sdkgen.internal.utils.UtilsManager.entryOf;
5
import static com.box.sdkgen.internal.utils.UtilsManager.mapOf;
6
import static com.box.sdkgen.internal.utils.UtilsManager.mergeMaps;
7
import static com.box.sdkgen.internal.utils.UtilsManager.prepareParams;
8

9
import com.box.sdkgen.networking.auth.Authentication;
10
import com.box.sdkgen.networking.fetchoptions.FetchOptions;
11
import com.box.sdkgen.networking.fetchoptions.ResponseFormat;
12
import com.box.sdkgen.networking.fetchresponse.FetchResponse;
13
import com.box.sdkgen.networking.network.NetworkSession;
14
import com.box.sdkgen.schemas.userfull.UserFull;
15
import com.box.sdkgen.schemas.users.Users;
16
import com.box.sdkgen.serialization.json.JsonManager;
17
import java.util.Map;
18

19
public class UsersManager {
20

21
  public Authentication auth;
22

23
  public NetworkSession networkSession;
24

25
  public UsersManager() {
×
26
    this.networkSession = new NetworkSession();
×
27
  }
×
28

29
  protected UsersManager(Builder builder) {
1 ✔
30
    this.auth = builder.auth;
1 ✔
31
    this.networkSession = builder.networkSession;
1 ✔
32
  }
1 ✔
33

34
  /**
35
   * Returns a list of all users for the Enterprise along with their `user_id`, `public_name`, and
36
   * `login`.
37
   *
38
   * <p>The application and the authenticated user need to have the permission to look up users in
39
   * the entire enterprise.
40
   */
41
  public Users getUsers() {
42
    return getUsers(new GetUsersQueryParams(), new GetUsersHeaders());
1 ✔
43
  }
44

45
  /**
46
   * Returns a list of all users for the Enterprise along with their `user_id`, `public_name`, and
47
   * `login`.
48
   *
49
   * <p>The application and the authenticated user need to have the permission to look up users in
50
   * the entire enterprise.
51
   *
52
   * @param queryParams Query parameters of getUsers method
53
   */
54
  public Users getUsers(GetUsersQueryParams queryParams) {
55
    return getUsers(queryParams, new GetUsersHeaders());
×
56
  }
57

58
  /**
59
   * Returns a list of all users for the Enterprise along with their `user_id`, `public_name`, and
60
   * `login`.
61
   *
62
   * <p>The application and the authenticated user need to have the permission to look up users in
63
   * the entire enterprise.
64
   *
65
   * @param headers Headers of getUsers method
66
   */
67
  public Users getUsers(GetUsersHeaders headers) {
68
    return getUsers(new GetUsersQueryParams(), headers);
×
69
  }
70

71
  /**
72
   * Returns a list of all users for the Enterprise along with their `user_id`, `public_name`, and
73
   * `login`.
74
   *
75
   * <p>The application and the authenticated user need to have the permission to look up users in
76
   * the entire enterprise.
77
   *
78
   * @param queryParams Query parameters of getUsers method
79
   * @param headers Headers of getUsers method
80
   */
81
  public Users getUsers(GetUsersQueryParams queryParams, GetUsersHeaders headers) {
82
    Map<String, String> queryParamsMap =
1 ✔
83
        prepareParams(
1 ✔
84
            mapOf(
1 ✔
85
                entryOf("filter_term", convertToString(queryParams.getFilterTerm())),
1 ✔
86
                entryOf("user_type", convertToString(queryParams.getUserType())),
1 ✔
87
                entryOf(
1 ✔
88
                    "external_app_user_id", convertToString(queryParams.getExternalAppUserId())),
1 ✔
89
                entryOf("fields", convertToString(queryParams.getFields())),
1 ✔
90
                entryOf("offset", convertToString(queryParams.getOffset())),
1 ✔
91
                entryOf("limit", convertToString(queryParams.getLimit())),
1 ✔
92
                entryOf("usemarker", convertToString(queryParams.getUsemarker())),
1 ✔
93
                entryOf("marker", convertToString(queryParams.getMarker()))));
1 ✔
94
    Map<String, String> headersMap = prepareParams(mergeMaps(mapOf(), headers.getExtraHeaders()));
1 ✔
95
    FetchResponse response =
1 ✔
96
        this.networkSession
97
            .getNetworkClient()
1 ✔
98
            .fetch(
1 ✔
99
                new FetchOptions.Builder(
100
                        String.join(
1 ✔
101
                            "", this.networkSession.getBaseUrls().getBaseUrl(), "/2.0/users"),
1 ✔
102
                        "GET")
103
                    .params(queryParamsMap)
1 ✔
104
                    .headers(headersMap)
1 ✔
105
                    .responseFormat(ResponseFormat.JSON)
1 ✔
106
                    .auth(this.auth)
1 ✔
107
                    .networkSession(this.networkSession)
1 ✔
108
                    .build());
1 ✔
109
    return JsonManager.deserialize(response.getData(), Users.class);
1 ✔
110
  }
111

112
  /**
113
   * Creates a new managed user in an enterprise. This endpoint is only available to users and
114
   * applications with the right admin permissions.
115
   *
116
   * @param requestBody Request body of createUser method
117
   */
118
  public UserFull createUser(CreateUserRequestBody requestBody) {
119
    return createUser(requestBody, new CreateUserQueryParams(), new CreateUserHeaders());
1 ✔
120
  }
121

122
  /**
123
   * Creates a new managed user in an enterprise. This endpoint is only available to users and
124
   * applications with the right admin permissions.
125
   *
126
   * @param requestBody Request body of createUser method
127
   * @param queryParams Query parameters of createUser method
128
   */
129
  public UserFull createUser(CreateUserRequestBody requestBody, CreateUserQueryParams queryParams) {
130
    return createUser(requestBody, queryParams, new CreateUserHeaders());
×
131
  }
132

133
  /**
134
   * Creates a new managed user in an enterprise. This endpoint is only available to users and
135
   * applications with the right admin permissions.
136
   *
137
   * @param requestBody Request body of createUser method
138
   * @param headers Headers of createUser method
139
   */
140
  public UserFull createUser(CreateUserRequestBody requestBody, CreateUserHeaders headers) {
141
    return createUser(requestBody, new CreateUserQueryParams(), headers);
×
142
  }
143

144
  /**
145
   * Creates a new managed user in an enterprise. This endpoint is only available to users and
146
   * applications with the right admin permissions.
147
   *
148
   * @param requestBody Request body of createUser method
149
   * @param queryParams Query parameters of createUser method
150
   * @param headers Headers of createUser method
151
   */
152
  public UserFull createUser(
153
      CreateUserRequestBody requestBody,
154
      CreateUserQueryParams queryParams,
155
      CreateUserHeaders headers) {
156
    Map<String, String> queryParamsMap =
1 ✔
157
        prepareParams(mapOf(entryOf("fields", convertToString(queryParams.getFields()))));
1 ✔
158
    Map<String, String> headersMap = prepareParams(mergeMaps(mapOf(), headers.getExtraHeaders()));
1 ✔
159
    FetchResponse response =
1 ✔
160
        this.networkSession
161
            .getNetworkClient()
1 ✔
162
            .fetch(
1 ✔
163
                new FetchOptions.Builder(
164
                        String.join(
1 ✔
165
                            "", this.networkSession.getBaseUrls().getBaseUrl(), "/2.0/users"),
1 ✔
166
                        "POST")
167
                    .params(queryParamsMap)
1 ✔
168
                    .headers(headersMap)
1 ✔
169
                    .data(JsonManager.serialize(requestBody))
1 ✔
170
                    .contentType("application/json")
1 ✔
171
                    .responseFormat(ResponseFormat.JSON)
1 ✔
172
                    .auth(this.auth)
1 ✔
173
                    .networkSession(this.networkSession)
1 ✔
174
                    .build());
1 ✔
175
    return JsonManager.deserialize(response.getData(), UserFull.class);
1 ✔
176
  }
177

178
  /**
179
   * Retrieves information about the user who is currently authenticated.
180
   *
181
   * <p>In the case of a client-side authenticated OAuth 2.0 application this will be the user who
182
   * authorized the app.
183
   *
184
   * <p>In the case of a JWT, server-side authenticated application this will be the service account
185
   * that belongs to the application by default.
186
   *
187
   * <p>Use the `As-User` header to change who this API call is made on behalf of.
188
   */
189
  public UserFull getUserMe() {
190
    return getUserMe(new GetUserMeQueryParams(), new GetUserMeHeaders());
1 ✔
191
  }
192

193
  /**
194
   * Retrieves information about the user who is currently authenticated.
195
   *
196
   * <p>In the case of a client-side authenticated OAuth 2.0 application this will be the user who
197
   * authorized the app.
198
   *
199
   * <p>In the case of a JWT, server-side authenticated application this will be the service account
200
   * that belongs to the application by default.
201
   *
202
   * <p>Use the `As-User` header to change who this API call is made on behalf of.
203
   *
204
   * @param queryParams Query parameters of getUserMe method
205
   */
206
  public UserFull getUserMe(GetUserMeQueryParams queryParams) {
207
    return getUserMe(queryParams, new GetUserMeHeaders());
1 ✔
208
  }
209

210
  /**
211
   * Retrieves information about the user who is currently authenticated.
212
   *
213
   * <p>In the case of a client-side authenticated OAuth 2.0 application this will be the user who
214
   * authorized the app.
215
   *
216
   * <p>In the case of a JWT, server-side authenticated application this will be the service account
217
   * that belongs to the application by default.
218
   *
219
   * <p>Use the `As-User` header to change who this API call is made on behalf of.
220
   *
221
   * @param headers Headers of getUserMe method
222
   */
223
  public UserFull getUserMe(GetUserMeHeaders headers) {
224
    return getUserMe(new GetUserMeQueryParams(), headers);
×
225
  }
226

227
  /**
228
   * Retrieves information about the user who is currently authenticated.
229
   *
230
   * <p>In the case of a client-side authenticated OAuth 2.0 application this will be the user who
231
   * authorized the app.
232
   *
233
   * <p>In the case of a JWT, server-side authenticated application this will be the service account
234
   * that belongs to the application by default.
235
   *
236
   * <p>Use the `As-User` header to change who this API call is made on behalf of.
237
   *
238
   * @param queryParams Query parameters of getUserMe method
239
   * @param headers Headers of getUserMe method
240
   */
241
  public UserFull getUserMe(GetUserMeQueryParams queryParams, GetUserMeHeaders headers) {
242
    Map<String, String> queryParamsMap =
1 ✔
243
        prepareParams(mapOf(entryOf("fields", convertToString(queryParams.getFields()))));
1 ✔
244
    Map<String, String> headersMap = prepareParams(mergeMaps(mapOf(), headers.getExtraHeaders()));
1 ✔
245
    FetchResponse response =
1 ✔
246
        this.networkSession
247
            .getNetworkClient()
1 ✔
248
            .fetch(
1 ✔
249
                new FetchOptions.Builder(
250
                        String.join(
1 ✔
251
                            "", this.networkSession.getBaseUrls().getBaseUrl(), "/2.0/users/me"),
1 ✔
252
                        "GET")
253
                    .params(queryParamsMap)
1 ✔
254
                    .headers(headersMap)
1 ✔
255
                    .responseFormat(ResponseFormat.JSON)
1 ✔
256
                    .auth(this.auth)
1 ✔
257
                    .networkSession(this.networkSession)
1 ✔
258
                    .build());
1 ✔
259
    return JsonManager.deserialize(response.getData(), UserFull.class);
1 ✔
260
  }
261

262
  /**
263
   * Retrieves information about a user in the enterprise.
264
   *
265
   * <p>The application and the authenticated user need to have the permission to look up users in
266
   * the entire enterprise.
267
   *
268
   * <p>This endpoint also returns a limited set of information for external users who are
269
   * collaborated on content owned by the enterprise for authenticated users with the right scopes.
270
   * In this case, disallowed fields will return null instead.
271
   *
272
   * @param userId The ID of the user. Example: "12345"
273
   */
274
  public UserFull getUserById(String userId) {
275
    return getUserById(userId, new GetUserByIdQueryParams(), new GetUserByIdHeaders());
1 ✔
276
  }
277

278
  /**
279
   * Retrieves information about a user in the enterprise.
280
   *
281
   * <p>The application and the authenticated user need to have the permission to look up users in
282
   * the entire enterprise.
283
   *
284
   * <p>This endpoint also returns a limited set of information for external users who are
285
   * collaborated on content owned by the enterprise for authenticated users with the right scopes.
286
   * In this case, disallowed fields will return null instead.
287
   *
288
   * @param userId The ID of the user. Example: "12345"
289
   * @param queryParams Query parameters of getUserById method
290
   */
291
  public UserFull getUserById(String userId, GetUserByIdQueryParams queryParams) {
292
    return getUserById(userId, queryParams, new GetUserByIdHeaders());
×
293
  }
294

295
  /**
296
   * Retrieves information about a user in the enterprise.
297
   *
298
   * <p>The application and the authenticated user need to have the permission to look up users in
299
   * the entire enterprise.
300
   *
301
   * <p>This endpoint also returns a limited set of information for external users who are
302
   * collaborated on content owned by the enterprise for authenticated users with the right scopes.
303
   * In this case, disallowed fields will return null instead.
304
   *
305
   * @param userId The ID of the user. Example: "12345"
306
   * @param headers Headers of getUserById method
307
   */
308
  public UserFull getUserById(String userId, GetUserByIdHeaders headers) {
309
    return getUserById(userId, new GetUserByIdQueryParams(), headers);
×
310
  }
311

312
  /**
313
   * Retrieves information about a user in the enterprise.
314
   *
315
   * <p>The application and the authenticated user need to have the permission to look up users in
316
   * the entire enterprise.
317
   *
318
   * <p>This endpoint also returns a limited set of information for external users who are
319
   * collaborated on content owned by the enterprise for authenticated users with the right scopes.
320
   * In this case, disallowed fields will return null instead.
321
   *
322
   * @param userId The ID of the user. Example: "12345"
323
   * @param queryParams Query parameters of getUserById method
324
   * @param headers Headers of getUserById method
325
   */
326
  public UserFull getUserById(
327
      String userId, GetUserByIdQueryParams queryParams, GetUserByIdHeaders headers) {
328
    Map<String, String> queryParamsMap =
1 ✔
329
        prepareParams(mapOf(entryOf("fields", convertToString(queryParams.getFields()))));
1 ✔
330
    Map<String, String> headersMap = prepareParams(mergeMaps(mapOf(), headers.getExtraHeaders()));
1 ✔
331
    FetchResponse response =
1 ✔
332
        this.networkSession
333
            .getNetworkClient()
1 ✔
334
            .fetch(
1 ✔
335
                new FetchOptions.Builder(
336
                        String.join(
1 ✔
337
                            "",
338
                            this.networkSession.getBaseUrls().getBaseUrl(),
1 ✔
339
                            "/2.0/users/",
340
                            convertToString(userId)),
1 ✔
341
                        "GET")
342
                    .params(queryParamsMap)
1 ✔
343
                    .headers(headersMap)
1 ✔
344
                    .responseFormat(ResponseFormat.JSON)
1 ✔
345
                    .auth(this.auth)
1 ✔
346
                    .networkSession(this.networkSession)
1 ✔
347
                    .build());
1 ✔
348
    return JsonManager.deserialize(response.getData(), UserFull.class);
1 ✔
349
  }
350

351
  /**
352
   * Updates a managed or app user in an enterprise. This endpoint is only available to users and
353
   * applications with the right admin permissions.
354
   *
355
   * @param userId The ID of the user. Example: "12345"
356
   */
357
  public UserFull updateUserById(String userId) {
358
    return updateUserById(
×
359
        userId,
360
        new UpdateUserByIdRequestBody(),
361
        new UpdateUserByIdQueryParams(),
362
        new UpdateUserByIdHeaders());
363
  }
364

365
  /**
366
   * Updates a managed or app user in an enterprise. This endpoint is only available to users and
367
   * applications with the right admin permissions.
368
   *
369
   * @param userId The ID of the user. Example: "12345"
370
   * @param requestBody Request body of updateUserById method
371
   */
372
  public UserFull updateUserById(String userId, UpdateUserByIdRequestBody requestBody) {
373
    return updateUserById(
1 ✔
374
        userId, requestBody, new UpdateUserByIdQueryParams(), new UpdateUserByIdHeaders());
375
  }
376

377
  /**
378
   * Updates a managed or app user in an enterprise. This endpoint is only available to users and
379
   * applications with the right admin permissions.
380
   *
381
   * @param userId The ID of the user. Example: "12345"
382
   * @param queryParams Query parameters of updateUserById method
383
   */
384
  public UserFull updateUserById(String userId, UpdateUserByIdQueryParams queryParams) {
385
    return updateUserById(
×
386
        userId, new UpdateUserByIdRequestBody(), queryParams, new UpdateUserByIdHeaders());
387
  }
388

389
  /**
390
   * Updates a managed or app user in an enterprise. This endpoint is only available to users and
391
   * applications with the right admin permissions.
392
   *
393
   * @param userId The ID of the user. Example: "12345"
394
   * @param requestBody Request body of updateUserById method
395
   * @param queryParams Query parameters of updateUserById method
396
   */
397
  public UserFull updateUserById(
398
      String userId, UpdateUserByIdRequestBody requestBody, UpdateUserByIdQueryParams queryParams) {
399
    return updateUserById(userId, requestBody, queryParams, new UpdateUserByIdHeaders());
×
400
  }
401

402
  /**
403
   * Updates a managed or app user in an enterprise. This endpoint is only available to users and
404
   * applications with the right admin permissions.
405
   *
406
   * @param userId The ID of the user. Example: "12345"
407
   * @param headers Headers of updateUserById method
408
   */
409
  public UserFull updateUserById(String userId, UpdateUserByIdHeaders headers) {
410
    return updateUserById(
×
411
        userId, new UpdateUserByIdRequestBody(), new UpdateUserByIdQueryParams(), headers);
412
  }
413

414
  /**
415
   * Updates a managed or app user in an enterprise. This endpoint is only available to users and
416
   * applications with the right admin permissions.
417
   *
418
   * @param userId The ID of the user. Example: "12345"
419
   * @param requestBody Request body of updateUserById method
420
   * @param headers Headers of updateUserById method
421
   */
422
  public UserFull updateUserById(
423
      String userId, UpdateUserByIdRequestBody requestBody, UpdateUserByIdHeaders headers) {
424
    return updateUserById(userId, requestBody, new UpdateUserByIdQueryParams(), headers);
×
425
  }
426

427
  /**
428
   * Updates a managed or app user in an enterprise. This endpoint is only available to users and
429
   * applications with the right admin permissions.
430
   *
431
   * @param userId The ID of the user. Example: "12345"
432
   * @param queryParams Query parameters of updateUserById method
433
   * @param headers Headers of updateUserById method
434
   */
435
  public UserFull updateUserById(
436
      String userId, UpdateUserByIdQueryParams queryParams, UpdateUserByIdHeaders headers) {
437
    return updateUserById(userId, new UpdateUserByIdRequestBody(), queryParams, headers);
×
438
  }
439

440
  /**
441
   * Updates a managed or app user in an enterprise. This endpoint is only available to users and
442
   * applications with the right admin permissions.
443
   *
444
   * @param userId The ID of the user. Example: "12345"
445
   * @param requestBody Request body of updateUserById method
446
   * @param queryParams Query parameters of updateUserById method
447
   * @param headers Headers of updateUserById method
448
   */
449
  public UserFull updateUserById(
450
      String userId,
451
      UpdateUserByIdRequestBody requestBody,
452
      UpdateUserByIdQueryParams queryParams,
453
      UpdateUserByIdHeaders headers) {
454
    Map<String, String> queryParamsMap =
1 ✔
455
        prepareParams(mapOf(entryOf("fields", convertToString(queryParams.getFields()))));
1 ✔
456
    Map<String, String> headersMap = prepareParams(mergeMaps(mapOf(), headers.getExtraHeaders()));
1 ✔
457
    FetchResponse response =
1 ✔
458
        this.networkSession
459
            .getNetworkClient()
1 ✔
460
            .fetch(
1 ✔
461
                new FetchOptions.Builder(
462
                        String.join(
1 ✔
463
                            "",
464
                            this.networkSession.getBaseUrls().getBaseUrl(),
1 ✔
465
                            "/2.0/users/",
466
                            convertToString(userId)),
1 ✔
467
                        "PUT")
468
                    .params(queryParamsMap)
1 ✔
469
                    .headers(headersMap)
1 ✔
470
                    .data(JsonManager.serialize(requestBody))
1 ✔
471
                    .contentType("application/json")
1 ✔
472
                    .responseFormat(ResponseFormat.JSON)
1 ✔
473
                    .auth(this.auth)
1 ✔
474
                    .networkSession(this.networkSession)
1 ✔
475
                    .build());
1 ✔
476
    return JsonManager.deserialize(response.getData(), UserFull.class);
1 ✔
477
  }
478

479
  /**
480
   * Deletes a user. By default, this operation fails if the user still owns any content. To
481
   * proceed, move their owned content first, or use the `force` parameter to delete the user and
482
   * their files.
483
   *
484
   * <p>If the enterprise has a retention policy, including a retired one, or a legal hold that is
485
   * not fully released, you can't delete a user who owns content, even with `force`. Transfer the
486
   * user's content first by using the [Transfer owned
487
   * folders](https://developer.box.com/reference/put-users-id-folders-0) endpoint.
488
   *
489
   * @param userId The ID of the user. Example: "12345"
490
   */
491
  public void deleteUserById(String userId) {
492
    deleteUserById(userId, new DeleteUserByIdQueryParams(), new DeleteUserByIdHeaders());
1 ✔
493
  }
1 ✔
494

495
  /**
496
   * Deletes a user. By default, this operation fails if the user still owns any content. To
497
   * proceed, move their owned content first, or use the `force` parameter to delete the user and
498
   * their files.
499
   *
500
   * <p>If the enterprise has a retention policy, including a retired one, or a legal hold that is
501
   * not fully released, you can't delete a user who owns content, even with `force`. Transfer the
502
   * user's content first by using the [Transfer owned
503
   * folders](https://developer.box.com/reference/put-users-id-folders-0) endpoint.
504
   *
505
   * @param userId The ID of the user. Example: "12345"
506
   * @param queryParams Query parameters of deleteUserById method
507
   */
508
  public void deleteUserById(String userId, DeleteUserByIdQueryParams queryParams) {
UNCOV
509
    deleteUserById(userId, queryParams, new DeleteUserByIdHeaders());
×
UNCOV
510
  }
×
511

512
  /**
513
   * Deletes a user. By default, this operation fails if the user still owns any content. To
514
   * proceed, move their owned content first, or use the `force` parameter to delete the user and
515
   * their files.
516
   *
517
   * <p>If the enterprise has a retention policy, including a retired one, or a legal hold that is
518
   * not fully released, you can't delete a user who owns content, even with `force`. Transfer the
519
   * user's content first by using the [Transfer owned
520
   * folders](https://developer.box.com/reference/put-users-id-folders-0) endpoint.
521
   *
522
   * @param userId The ID of the user. Example: "12345"
523
   * @param headers Headers of deleteUserById method
524
   */
525
  public void deleteUserById(String userId, DeleteUserByIdHeaders headers) {
UNCOV
526
    deleteUserById(userId, new DeleteUserByIdQueryParams(), headers);
×
UNCOV
527
  }
×
528

529
  /**
530
   * Deletes a user. By default, this operation fails if the user still owns any content. To
531
   * proceed, move their owned content first, or use the `force` parameter to delete the user and
532
   * their files.
533
   *
534
   * <p>If the enterprise has a retention policy, including a retired one, or a legal hold that is
535
   * not fully released, you can't delete a user who owns content, even with `force`. Transfer the
536
   * user's content first by using the [Transfer owned
537
   * folders](https://developer.box.com/reference/put-users-id-folders-0) endpoint.
538
   *
539
   * @param userId The ID of the user. Example: "12345"
540
   * @param queryParams Query parameters of deleteUserById method
541
   * @param headers Headers of deleteUserById method
542
   */
543
  public void deleteUserById(
544
      String userId, DeleteUserByIdQueryParams queryParams, DeleteUserByIdHeaders headers) {
545
    Map<String, String> queryParamsMap =
1 ✔
546
        prepareParams(
1 ✔
547
            mapOf(
1 ✔
548
                entryOf("notify", convertToString(queryParams.getNotify())),
1 ✔
549
                entryOf("force", convertToString(queryParams.getForce()))));
1 ✔
550
    Map<String, String> headersMap = prepareParams(mergeMaps(mapOf(), headers.getExtraHeaders()));
1 ✔
551
    FetchResponse response =
1 ✔
552
        this.networkSession
553
            .getNetworkClient()
1 ✔
554
            .fetch(
1 ✔
555
                new FetchOptions.Builder(
556
                        String.join(
1 ✔
557
                            "",
558
                            this.networkSession.getBaseUrls().getBaseUrl(),
1 ✔
559
                            "/2.0/users/",
560
                            convertToString(userId)),
1 ✔
561
                        "DELETE")
562
                    .params(queryParamsMap)
1 ✔
563
                    .headers(headersMap)
1 ✔
564
                    .responseFormat(ResponseFormat.NO_CONTENT)
1 ✔
565
                    .auth(this.auth)
1 ✔
566
                    .networkSession(this.networkSession)
1 ✔
567
                    .build());
1 ✔
568
  }
1 ✔
569

570
  public Authentication getAuth() {
UNCOV
571
    return auth;
×
572
  }
573

574
  public NetworkSession getNetworkSession() {
UNCOV
575
    return networkSession;
×
576
  }
577

578
  public static class Builder {
579

580
    protected Authentication auth;
581

582
    protected NetworkSession networkSession;
583

584
    public Builder() {}
1 ✔
585

586
    public Builder auth(Authentication auth) {
587
      this.auth = auth;
1 ✔
588
      return this;
1 ✔
589
    }
590

591
    public Builder networkSession(NetworkSession networkSession) {
592
      this.networkSession = networkSession;
1 ✔
593
      return this;
1 ✔
594
    }
595

596
    public UsersManager build() {
597
      if (this.networkSession == null) {
1 ✔
UNCOV
598
        this.networkSession = new NetworkSession();
×
599
      }
600
      return new UsersManager(this);
1 ✔
601
    }
602
  }
603
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc