Module: Gitlab::Client::Events

Included in:
Gitlab::Client
Defined in:
lib/gitlab/client/events.rb

Overview

Defines methods related to events.

Instance Method Summary collapse

Instance Method Details

#events(options = {}) ⇒ Array<Gitlab::ObjectifiedHash>

Gets a list of authenticated user’s events

Examples:

Gitlab.events()
Gitlab.events({ action: 'created', target_type: 'issue' })

Parameters:

  • options (Hash) (defaults to: {})

    A customizable set of options.

Options Hash (options):

  • :action (String)

    Only events of specific action type

  • :target_type (String)

    Only events of specific target type

  • :before (String)

    Only events created before YYYY-MM-DD

  • :after (String)

    Only events created after YYYY-MM-DD

  • :sort (String)

    Sort by created_at either ‘asc’ or ‘desc’

Returns:



20
21
22
# File 'lib/gitlab/client/events.rb', line 20

def events(options = {})
  get('/events', query: options)
end

#project_events(project, options = {}) ⇒ Array<Gitlab::ObjectifiedHash>

Gets a list of visible project events

Examples:

Gitlab.project_events(1)
Gitlab.project_events(1, { action: created })

Parameters:

  • project (Integer)

    The ID of project

  • options (Hash) (defaults to: {})

    A customizable set of options.

Options Hash (options):

  • :action (String)

    Only events of specific action type

  • :target_type (String)

    Only events of specific target type

  • :before (String)

    Only events created before YYYY-MM-DD

  • :after (String)

    Only events created after YYYY-MM-DD

  • :sort (String)

    Sort by created_at either ‘asc’ or ‘desc’

Returns:



56
57
58
# File 'lib/gitlab/client/events.rb', line 56

def project_events(project, options = {})
  get("/projects/#{url_encode project}/events", query: options)
end

#user_events(user, options = {}) ⇒ Array<Gitlab::ObjectifiedHash>

Gets a list of user contribution events

Examples:

Gitlab.user_events(1)
Gitlab.user_events(1, { action: created})

Parameters:

  • user (Integer, String)

    The ID or username of user

  • options (Hash) (defaults to: {})

    A customizable set of options.

Options Hash (options):

  • :action (String)

    Only events of specific action type

  • :target_type (String)

    Only events of specific target type

  • :before (String)

    Only events created before YYYY-MM-DD

  • :after (String)

    Only events created after YYYY-MM-DD

  • :sort (String)

    Sort by created_at either ‘asc’ or ‘desc’

Returns:



38
39
40
# File 'lib/gitlab/client/events.rb', line 38

def user_events(user, options = {})
  get("/users/#{url_encode user}/events", query: options)
end