module Octokit::Client::Events

Method for the Events API

@see developer.github.com/v3/activity/events/ @see developer.github.com/v3/issues/events/

Public Instance Methods

issue_event(repo, number, options = {}) click to toggle source

Get information on a single Issue Event

@param repo [Integer, String, Repository, Hash] A GitHub repository @param number [Integer] Event number

@return [Sawyer::Resource] A single Event for an Issue @see developer.github.com/v3/issues/events/#get-a-single-event @example Get Event information for ID 3094334 (a pull request was closed)

Octokit.issue_event("octokit/octokit.rb", 3094334)
# File lib/octokit/client/events.rb, line 147
def issue_event(repo, number, options = {})
  paginate "#{Repository.path repo}/issues/events/#{number}", options
end
issue_events(repo, number, options = {}) click to toggle source

List events for an Issue

@param repo [Integer, String, Repository, Hash] A GitHub repository @param number [Integer] Issue number

@return [Array<Sawyer::Resource>] Array of events for that issue @see developer.github.com/v3/issues/events/#list-events-for-an-issue @example List all issues events for issue #38 on octokit/octokit.rb

Octokit.issue_events("octokit/octokit.rb", 38)
# File lib/octokit/client/events.rb, line 133
def issue_events(repo, number, options = {})
  options = ensure_api_media_type(:project_card_events, options)
  paginate "#{Repository.path repo}/issues/#{number}/events", options
end
organization_events(org, options = {}) click to toggle source

List all events for an organization

Requires authenticated client.

@param org [String] Organization GitHub handle @return [Array<Sawyer::Resource>] List of all events from a GitHub organization @see developer.github.com/v3/activity/events/#list-events-for-an-organization @example List events for the lostisland organization

@client.organization_events("lostisland")
# File lib/octokit/client/events.rb, line 95
def organization_events(org, options = {})
  paginate "users/#{login}/events/orgs/#{org}", options
end
organization_public_events(org, options = {}) click to toggle source

List an organization's public events

@param org [String, Integer] Organization GitHub login or id. @return [Array<Sawyer::Resource>] List of public events from a GitHub organization @see developer.github.com/v3/activity/events/#list-public-events-for-an-organization @example List public events for GitHub

Octokit.organization_public_events("GitHub")
# File lib/octokit/client/events.rb, line 106
def organization_public_events(org, options = {})
  paginate "#{Organization.path org}/events", options
end
public_events(options = {}) click to toggle source

List all public events for GitHub

@return [Array<Sawyer::Resource>] A list of all public events from GitHub @see developer.github.com/v3/activity/events/#list-public-events @example List all pubilc events

Octokit.public_events
# File lib/octokit/client/events.rb, line 16
def public_events(options = {})
  paginate "events", options
end
received_events(user, options = {}) click to toggle source

List events that a user has received

@param user [Integer, String] GitHub user login or id @return [Array<Sawyer::Resource>] A list of all user received events @see developer.github.com/v3/activity/events/#list-events-that-a-user-has-received @example List all user received events

Octokit.received_events("sferik")
# File lib/octokit/client/events.rb, line 49
def received_events(user, options = {})
  paginate "#{User.path user}/received_events", options
end
received_public_events(user, options = {}) click to toggle source

List public events a user has received

@param user [Integer, String] GitHub user login or id @return [Array<Sawyer::Resource>] A list of public user received events @see developer.github.com/v3/activity/events/#list-public-events-that-a-user-has-received @example List public user received events

Octokit.received_public_events("sferik")
# File lib/octokit/client/events.rb, line 60
def received_public_events(user, options = {})
  paginate "#{User.path user}/received_events/public", options
end
repo_issue_events(repo, options = {})
repository_events(repo, options = {}) click to toggle source

List events for a repository

@param repo [Integer, String, Repository, Hash] A GitHub repository @return [Array<Sawyer::Resource>] A list of events for a repository @see developer.github.com/v3/activity/events/#list-repository-events @example List events for a repository

Octokit.repository_events("sferik/rails_admin")
# File lib/octokit/client/events.rb, line 71
def repository_events(repo, options = {})
  paginate "#{Repository.path repo}/events", options
end
repository_issue_events(repo, options = {}) click to toggle source

Get all Issue Events for a given Repository

@param repo [Integer, String, Repository, Hash] A GitHub repository

@return [Array<Sawyer::Resource>] Array of all Issue Events for this Repository @see developer.github.com/v3/issues/events/#list-events-for-a-repository @see developer.github.com/v3/activity/events/#list-issue-events-for-a-repository @example Get all Issue Events for Octokit

Octokit.repository_issue_events("octokit/octokit.rb")
# File lib/octokit/client/events.rb, line 119
def repository_issue_events(repo, options = {})
  paginate "#{Repository.path repo}/issues/events", options
end
Also aliased as: repo_issue_events
repository_network_events(repo, options = {}) click to toggle source

List public events for a repository's network

@param repo [String, Repository, Hash] A GitHub repository @return [Array<Sawyer::Resource>] A list of events for a repository's network @see developer.github.com/v3/activity/events/#list-public-events-for-a-network-of-repositories @example List events for a repository's network

Octokit.repository_network_events("sferik/rails_admin")
# File lib/octokit/client/events.rb, line 82
def repository_network_events(repo, options = {})
  paginate "networks/#{Repository.new(repo)}/events", options
end
user_events(user, options = {}) click to toggle source

List all user events

@param user [Integer, String] GitHub user login or id. @return [Array<Sawyer::Resource>] A list of all user events @see developer.github.com/v3/activity/events/#list-events-performed-by-a-user @example List all user events

Octokit.user_events("sferik")
# File lib/octokit/client/events.rb, line 27
def user_events(user, options = {})
  paginate "#{User.path user}/events", options
end
user_public_events(user, options = {}) click to toggle source

List public user events

@param user [Integer, String] GitHub user login or id @return [Array<Sawyer::Resource>] A list of public user events @see developer.github.com/v3/activity/events/#list-public-events-performed-by-a-user @example List public user events

Octokit.user_events("sferik")
# File lib/octokit/client/events.rb, line 38
def user_public_events(user, options = {})
  paginate "#{User.path user}/events/public", options
end