You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As of GitLab4J-API 4.6.6, all API requests support performing the API call as if you were another user, provided you are authenticated as an administrator:
47
+
```java
48
+
// Create a GitLabApi instance to communicate with your GitLab server (must be an administrator)
// sudo as as a different user, in this case the user named "johndoe", all future calls will be done as "johndoe"
52
+
gitLabApi.sudo("johndoe")
53
+
54
+
// To turn off sudo mode
55
+
gitLabApi.unsudo();
56
+
```
57
+
40
58
---
41
59
42
-
As of GitLab4J-API 4.2.0 support has been added for GitLab API V4. If your application requires GitLab API V3 you can still use GitLab4J-API by creating your GitLabApi instance as follows:
60
+
As of GitLab4J-API 4.2.0 support has been added for GitLab API V4. If your application requires GitLab API V3,
61
+
you can still use GitLab4J-API by creating your GitLabApi instance as follows:
43
62
```java
44
63
// Create a GitLabApi instance to communicate with your GitLab server using GitLab API V3
GitLab4J-API provides an easy to use paging mechanism to page through lists of results from the GitLab API. Here are a couple of examples on how to use the Pager:
69
+
GitLab4J-API provides an easy to use paging mechanism to page through lists of results from the GitLab API.
70
+
Here are a couple of examples on how to use the Pager:
51
71
```java
52
72
// Get a Pager instance that will page through the projects with 10 projects per page
0 commit comments