Class EventsApi

  • All Implemented Interfaces:
    Constants

    public class EventsApi
    extends AbstractApi
    This class implements the client side API for the GitLab events calls.
    • Constructor Detail

      • EventsApi

        public EventsApi​(GitLabApi gitLabApi)
    • Method Detail

      • getAuthenticatedUserEvents

        public List<Event> getAuthenticatedUserEvents​(Constants.ActionType action,
                                                      Constants.TargetType targetType,
                                                      Date before,
                                                      Date after,
                                                      Constants.SortOrder sortOrder)
                                               throws GitLabApiException
        Get a list of events for the authenticated user.
        GitLab Endpoint: GET /events
        Parameters:
        action - include only events of a particular action type, optional
        targetType - include only events of a particular target type, optional
        before - include only events created before a particular date, optional
        after - include only events created after a particular date, optional
        sortOrder - sort events in ASC or DESC order by created_at. Default is DESC, optional
        Returns:
        a list of events for the authenticated user and matching the supplied parameters
        Throws:
        GitLabApiException - if any exception occurs
      • getAuthenticatedUserEvents

        public List<Event> getAuthenticatedUserEvents​(Constants.ActionType action,
                                                      Constants.TargetType targetType,
                                                      Date before,
                                                      Date after,
                                                      Constants.SortOrder sortOrder,
                                                      int page,
                                                      int perPage)
                                               throws GitLabApiException
        Get a list of events for the authenticated user and in the specified page range.
        GitLab Endpoint: GET /events
        Parameters:
        action - include only events of a particular action type, optional
        targetType - include only events of a particular target type, optional
        before - include only events created before a particular date, optional
        after - include only events created after a particular date, optional
        sortOrder - sort events in ASC or DESC order by created_at. Default is DESC, optional
        page - the page to get
        perPage - the number of projects per page
        Returns:
        a list of events for the authenticated user and matching the supplied parameters
        Throws:
        GitLabApiException - if any exception occurs
      • getAuthenticatedUserEvents

        public Pager<Event> getAuthenticatedUserEvents​(Constants.ActionType action,
                                                       Constants.TargetType targetType,
                                                       Date before,
                                                       Date after,
                                                       Constants.SortOrder sortOrder,
                                                       int itemsPerPage)
                                                throws GitLabApiException
        Get a list of events for the authenticated user and in the specified page range.
        GitLab Endpoint: GET /events
        Parameters:
        action - include only events of a particular action type, optional
        targetType - include only events of a particular target type, optional
        before - include only events created before a particular date, optional
        after - include only events created after a particular date, optional
        sortOrder - sort events in ASC or DESC order by created_at. Default is DESC, optional
        itemsPerPage - the number of Event instances that will be fetched per page
        Returns:
        a Pager of events for the authenticated user and matching the supplied parameters
        Throws:
        GitLabApiException - if any exception occurs
      • getAuthenticatedUserEventsStream

        public Stream<Event> getAuthenticatedUserEventsStream​(Constants.ActionType action,
                                                              Constants.TargetType targetType,
                                                              Date before,
                                                              Date after,
                                                              Constants.SortOrder sortOrder)
                                                       throws GitLabApiException
        Get a Stream of events for the authenticated user.
        GitLab Endpoint: GET /events
        Parameters:
        action - include only events of a particular action type, optional
        targetType - include only events of a particular target type, optional
        before - include only events created before a particular date, optional
        after - include only events created after a particular date, optional
        sortOrder - sort events in ASC or DESC order by created_at. Default is DESC, optional
        Returns:
        a Stream of events for the authenticated user and matching the supplied parameters
        Throws:
        GitLabApiException - if any exception occurs
      • getUserEvents

        public List<Event> getUserEvents​(Object userIdOrUsername,
                                         Constants.ActionType action,
                                         Constants.TargetType targetType,
                                         Date before,
                                         Date after,
                                         Constants.SortOrder sortOrder)
                                  throws GitLabApiException
        Get a list of events for the specified user.
        GitLab Endpoint: GET /users/:userId/events
        Parameters:
        userIdOrUsername - the user ID, username of the user, or a User instance holding the user ID or username
        action - include only events of a particular action type, optional
        targetType - include only events of a particular target type, optional
        before - include only events created before a particular date, optional
        after - include only events created after a particular date, optional
        sortOrder - sort events in ASC or DESC order by created_at. Default is DESC, optional
        Returns:
        a list of events for the specified user and matching the supplied parameters
        Throws:
        GitLabApiException - if any exception occurs
      • getUserEvents

        public List<Event> getUserEvents​(Object userIdOrUsername,
                                         Constants.ActionType action,
                                         Constants.TargetType targetType,
                                         Date before,
                                         Date after,
                                         Constants.SortOrder sortOrder,
                                         int page,
                                         int perPage)
                                  throws GitLabApiException
        Get a list of events for the specified user and in the specified page range.
        GitLab Endpoint: GET /users/:userId/events
        Parameters:
        userIdOrUsername - the user ID, username of the user, or a User instance holding the user ID or username
        action - include only events of a particular action type, optional
        targetType - include only events of a particular target type, optional
        before - include only events created before a particular date, optional
        after - include only events created after a particular date, optional
        sortOrder - sort events in ASC or DESC order by created_at. Default is DESC, optional
        page - the page to get
        perPage - the number of projects per page
        Returns:
        a list of events for the specified user and matching the supplied parameters
        Throws:
        GitLabApiException - if any exception occurs
      • getUserEvents

        public Pager<Event> getUserEvents​(Object userIdOrUsername,
                                          Constants.ActionType action,
                                          Constants.TargetType targetType,
                                          Date before,
                                          Date after,
                                          Constants.SortOrder sortOrder,
                                          int itemsPerPage)
                                   throws GitLabApiException
        Get a list of events for the specified user and in the specified page range.
        GitLab Endpoint: GET /users/:userId/events
        Parameters:
        userIdOrUsername - the user ID, username of the user, or a User instance holding the user ID or username
        action - include only events of a particular action type, optional
        targetType - include only events of a particular target type, optional
        before - include only events created before a particular date, optional
        after - include only events created after a particular date, optional
        sortOrder - sort events in ASC or DESC order by created_at. Default is DESC, optional
        itemsPerPage - the number of Event instances that will be fetched per page
        Returns:
        a Pager of events for the specified user and matching the supplied parameters
        Throws:
        GitLabApiException - if any exception occurs
      • getUserEventsStream

        public Stream<Event> getUserEventsStream​(Object userIdOrUsername,
                                                 Constants.ActionType action,
                                                 Constants.TargetType targetType,
                                                 Date before,
                                                 Date after,
                                                 Constants.SortOrder sortOrder)
                                          throws GitLabApiException
        Get a Stream of events for the specified user.
        GitLab Endpoint: GET /users/:userId/events
        Parameters:
        userIdOrUsername - the user ID, username of the user, or a User instance holding the user ID or username
        action - include only events of a particular action type, optional
        targetType - include only events of a particular target type, optional
        before - include only events created before a particular date, optional
        after - include only events created after a particular date, optional
        sortOrder - sort events in ASC or DESC order by created_at. Default is DESC, optional
        Returns:
        a Stream of events for the specified user and matching the supplied parameters
        Throws:
        GitLabApiException - if any exception occurs
      • getProjectEvents

        public List<Event> getProjectEvents​(Object projectIdOrPath,
                                            Constants.ActionType action,
                                            Constants.TargetType targetType,
                                            Date before,
                                            Date after,
                                            Constants.SortOrder sortOrder)
                                     throws GitLabApiException
        Get a list of events for the specified project.
        GitLab Endpoint: GET /:projectId/events
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        action - include only events of a particular action type, optional
        targetType - include only events of a particular target type, optional
        before - include only events created before a particular date, optional
        after - include only events created after a particular date, optional
        sortOrder - sort events in ASC or DESC order by created_at. Default is DESC, optional
        Returns:
        a list of events for the specified project and matching the supplied parameters
        Throws:
        GitLabApiException - if any exception occurs
      • getProjectEvents

        public List<Event> getProjectEvents​(Integer projectIdOrPath,
                                            Constants.ActionType action,
                                            Constants.TargetType targetType,
                                            Date before,
                                            Date after,
                                            Constants.SortOrder sortOrder,
                                            int page,
                                            int perPage)
                                     throws GitLabApiException
        Get a list of events for the specified project and in the specified page range.
        GitLab Endpoint: GET /projects/:projectId/events
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        action - include only events of a particular action type, optional
        targetType - include only events of a particular target type, optional
        before - include only events created before a particular date, optional
        after - include only events created after a particular date, optional
        sortOrder - sort events in ASC or DESC order by created_at. Default is DESC, optional
        page - the page to get
        perPage - the number of projects per page
        Returns:
        a list of events for the specified project and matching the supplied parameters
        Throws:
        GitLabApiException - if any exception occurs
      • getProjectEvents

        public Pager<Event> getProjectEvents​(Object projectIdOrPath,
                                             Constants.ActionType action,
                                             Constants.TargetType targetType,
                                             Date before,
                                             Date after,
                                             Constants.SortOrder sortOrder,
                                             int itemsPerPage)
                                      throws GitLabApiException
        Get a list of events for the specified project and in the specified page range.
        GitLab Endpoint: GET /projects/:projectId/events
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        action - include only events of a particular action type, optional
        targetType - include only events of a particular target type, optional
        before - include only events created before a particular date, optional
        after - include only events created after a particular date, optional
        sortOrder - sort events in ASC or DESC order by created_at. Default is DESC, optional
        itemsPerPage - the number of Event instances that will be fetched per page
        Returns:
        a Pager of events for the specified project and matching the supplied parameters
        Throws:
        GitLabApiException - if any exception occurs
      • getProjectEventsStream

        public Stream<Event> getProjectEventsStream​(Object projectIdOrPath,
                                                    Constants.ActionType action,
                                                    Constants.TargetType targetType,
                                                    Date before,
                                                    Date after,
                                                    Constants.SortOrder sortOrder)
                                             throws GitLabApiException
        Get a Stream of events for the specified project.
        GitLab Endpoint: GET /:projectId/events
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        action - include only events of a particular action type, optional
        targetType - include only events of a particular target type, optional
        before - include only events created before a particular date, optional
        after - include only events created after a particular date, optional
        sortOrder - sort events in ASC or DESC order by created_at. Default is DESC, optional
        Returns:
        a Stream of events for the specified project and matching the supplied parameters
        Throws:
        GitLabApiException - if any exception occurs