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:


18
19
20
# File 'lib/gitlab/client/events.rb', line 18

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:


54
55
56
# File 'lib/gitlab/client/events.rb', line 54

def project_events(project, options={})
  get("/#{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:


36
37
38
# File 'lib/gitlab/client/events.rb', line 36

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