@@ -36,6 +36,24 @@ public List<Event> getAuthenticatedUserEvents(ActionType action, TargetType targ
3636 return (getAuthenticatedUserEvents (action , targetType , before , after , sortOrder , getDefaultPerPage ()).all ());
3737 }
3838
39+ /**
40+ * Get a list of all events for the authenticated user, across all of the user's projects.
41+ *
42+ * <pre><code>GitLab Endpoint: GET /events</code></pre>
43+ *
44+ * @param action include only events of a particular action type, optional
45+ * @param targetType include only events of a particular target type, optional
46+ * @param before include only events created before a particular date, optional
47+ * @param after include only events created after a particular date, optional
48+ * @param sortOrder sort events in ASC or DESC order by created_at. Default is DESC, optional
49+ * @return a list of events for the authenticated user and matching the supplied parameters
50+ * @throws GitLabApiException if any exception occurs
51+ */
52+ public List <Event > getAllAuthenticatedUserEvents (ActionType action , TargetType targetType ,
53+ Date before , Date after , SortOrder sortOrder ) throws GitLabApiException {
54+ return (getAuthenticatedUserEvents (action , targetType , before , after , sortOrder , getDefaultPerPage (), EventScope .ALL ).all ());
55+ }
56+
3957 /**
4058 * Get a list of events for the authenticated user and in the specified page range.
4159 *
@@ -53,6 +71,27 @@ public List<Event> getAuthenticatedUserEvents(ActionType action, TargetType targ
5371 */
5472 public List <Event > getAuthenticatedUserEvents (ActionType action , TargetType targetType ,
5573 Date before , Date after , SortOrder sortOrder , int page , int perPage ) throws GitLabApiException {
74+ return (getAuthenticatedUserEvents (action , targetType , before , after , sortOrder , page , perPage , null ));
75+ }
76+
77+ /**
78+ * Get a list of events for the authenticated user and in the specified page range.
79+ *
80+ * <pre><code>GitLab Endpoint: GET /events</code></pre>
81+ *
82+ * @param action include only events of a particular action type, optional
83+ * @param targetType include only events of a particular target type, optional
84+ * @param before include only events created before a particular date, optional
85+ * @param after include only events created after a particular date, optional
86+ * @param sortOrder sort events in ASC or DESC order by created_at. Default is DESC, optional
87+ * @param page the page to get
88+ * @param perPage the number of projects per page
89+ * @param scope include all events across a user’s projects, optional
90+ * @return a list of events for the authenticated user and matching the supplied parameters
91+ * @throws GitLabApiException if any exception occurs
92+ */
93+ public List <Event > getAuthenticatedUserEvents (ActionType action , TargetType targetType ,
94+ Date before , Date after , SortOrder sortOrder , int page , int perPage , EventScope scope ) throws GitLabApiException {
5695
5796 GitLabApiForm formData = new GitLabApiForm ()
5897 .withParam ("action" , action )
@@ -61,7 +100,8 @@ public List<Event> getAuthenticatedUserEvents(ActionType action, TargetType targ
61100 .withParam ("after" , after )
62101 .withParam ("sort" , sortOrder )
63102 .withParam (PAGE_PARAM , page )
64- .withParam (PER_PAGE_PARAM , perPage );
103+ .withParam (PER_PAGE_PARAM , perPage )
104+ .withParam ("scope" , scope != null ? scope .toValue ().toLowerCase () : null );
65105
66106 Response response = get (Response .Status .OK , formData .asMap (), "events" );
67107 return (response .readEntity (new GenericType <List <Event >>() {}));
@@ -83,13 +123,34 @@ public List<Event> getAuthenticatedUserEvents(ActionType action, TargetType targ
83123 */
84124 public Pager <Event > getAuthenticatedUserEvents (ActionType action , TargetType targetType , Date before , Date after ,
85125 SortOrder sortOrder , int itemsPerPage ) throws GitLabApiException {
126+ return (getAuthenticatedUserEvents (action , targetType , before , after , sortOrder , itemsPerPage , null ));
127+ }
128+
129+ /**
130+ * Get a list of events for the authenticated user and in the specified page range.
131+ *
132+ * <pre><code>GitLab Endpoint: GET /events</code></pre>
133+ *
134+ * @param action include only events of a particular action type, optional
135+ * @param targetType include only events of a particular target type, optional
136+ * @param before include only events created before a particular date, optional
137+ * @param after include only events created after a particular date, optional
138+ * @param sortOrder sort events in ASC or DESC order by created_at. Default is DESC, optional
139+ * @param itemsPerPage the number of Event instances that will be fetched per page
140+ * @param scope include all events across a user’s projects, optional
141+ * @return a Pager of events for the authenticated user and matching the supplied parameters
142+ * @throws GitLabApiException if any exception occurs
143+ */
144+ public Pager <Event > getAuthenticatedUserEvents (ActionType action , TargetType targetType , Date before , Date after ,
145+ SortOrder sortOrder , int itemsPerPage , EventScope scope ) throws GitLabApiException {
86146
87147 GitLabApiForm formData = new GitLabApiForm ()
88148 .withParam ("action" , action )
89149 .withParam ("target_type" , targetType != null ? targetType .toValue ().toLowerCase () : null )
90150 .withParam ("before" , before )
91151 .withParam ("after" , after )
92- .withParam ("sort" , sortOrder );
152+ .withParam ("sort" , sortOrder )
153+ .withParam ("scope" , scope != null ? scope .toValue ().toLowerCase () : null );
93154
94155 return (new Pager <Event >(this , Event .class , itemsPerPage , formData .asMap (), "events" ));
95156 }
@@ -109,7 +170,25 @@ public Pager<Event> getAuthenticatedUserEvents(ActionType action, TargetType tar
109170 */
110171 public Stream <Event > getAuthenticatedUserEventsStream (ActionType action , TargetType targetType ,
111172 Date before , Date after , SortOrder sortOrder ) throws GitLabApiException {
112- return (getAuthenticatedUserEvents (action , targetType , before , after , sortOrder , getDefaultPerPage ()).stream ());
173+ return (getAuthenticatedUserEvents (action , targetType , before , after , sortOrder , getDefaultPerPage (), null ).stream ());
174+ }
175+
176+ /**
177+ * Get a Stream of all events for the authenticated user, across all of the user's projects.
178+ *
179+ * <pre><code>GitLab Endpoint: GET /events</code></pre>
180+ *
181+ * @param action include only events of a particular action type, optional
182+ * @param targetType include only events of a particular target type, optional
183+ * @param before include only events created before a particular date, optional
184+ * @param after include only events created after a particular date, optional
185+ * @param sortOrder sort events in ASC or DESC order by created_at. Default is DESC, optional
186+ * @return a Stream of events for the authenticated user and matching the supplied parameters
187+ * @throws GitLabApiException if any exception occurs
188+ */
189+ public Stream <Event > getAllAuthenticatedUserEventsStream (ActionType action , TargetType targetType ,
190+ Date before , Date after , SortOrder sortOrder ) throws GitLabApiException {
191+ return (getAuthenticatedUserEvents (action , targetType , before , after , sortOrder , getDefaultPerPage (), EventScope .ALL ).stream ());
113192 }
114193
115194 /**
0 commit comments