module Octokit::Client::Reactions

Methods for the Reacions API

@see developer.github.com/v3/reactions/

Public Instance Methods

commit_comment_reactions(repo, id, options = {}) click to toggle source

List reactions for a commit comment

@param repo [Integer, String, Hash, Repository] A GitHub repository @param id [Integer] The id of the commit comment @see developer.github.com/v3/reactions/#list-reactions-for-a-commit-comment

@example

@client.commit_comment_reactions("octokit/octokit.rb", 1)

@return [Array<Sawyer::Resource>] Array of Hashes representing the reactions.

# File lib/octokit/client/reactions.rb, line 19
def commit_comment_reactions(repo, id, options = {})
  options = ensure_api_media_type(:reactions, options)
  get "#{Repository.path repo}/comments/#{id}/reactions", options
end
create_commit_comment_reaction(repo, id, reaction, options = {}) click to toggle source

Create a reaction for a commit comment

@param repo [Integer, String, Hash, Repository] A GitHub repository @param id [Integer] The id of the commit comment @param reaction [String] The Reaction @see developer.github.com/v3/reactions/#create-reaction-for-a-commit-comment @see developer.github.com/v3/reactions/#reaction-types

@example

@client.create_commit_comment_reactions("octokit/octokit.rb", 1)

@return [<Sawyer::Resource>] Hash representing the reaction

# File lib/octokit/client/reactions.rb, line 36
def create_commit_comment_reaction(repo, id, reaction, options = {})
  options = ensure_api_media_type(:reactions, options.merge(:content => reaction))
  post "#{Repository.path repo}/comments/#{id}/reactions", options
end
create_issue_comment_reaction(repo, id, reaction, options = {}) click to toggle source

Create reaction for an issue comment

@param repo [Integer, String, Hash, Repository] A GitHub repository @param id [Integer] The Issue comment id @param reaction [String] The Reaction

@see developer.github.com/v3/reactions/#create-reaction-for-an-issue-comment @see developer.github.com/v3/reactions/#reaction-types

@example

@client.create_issue_comment_reaction("octokit/octokit.rb", 1)

@return [<Sawyer::Resource>] Hashes representing the reaction.

# File lib/octokit/client/reactions.rb, line 103
def create_issue_comment_reaction(repo, id, reaction, options = {})
  options = ensure_api_media_type(:reactions, options.merge(:content => reaction))
  post "#{Repository.path repo}/issues/comments/#{id}/reactions", options
end
create_issue_reaction(repo, number, reaction, options = {}) click to toggle source

Create reaction for an issue

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

@see developer.github.com/v3/reactions/#create-reaction-for-an-issue @see developer.github.com/v3/reactions/#reaction-types

@example

@client.create_issue_reaction("octokit/octokit.rb", 1)

@return [<Sawyer::Resource>] Hash representing the reaction.

# File lib/octokit/client/reactions.rb, line 69
def create_issue_reaction(repo, number, reaction, options = {})
  options = ensure_api_media_type(:reactions, options.merge(:content => reaction))
  post "#{Repository.path repo}/issues/#{number}/reactions", options
end
create_pull_request_review_comment_reaction(repo, id, reaction, options = {}) click to toggle source

Create reaction for a pull request review comment

@param repo [Integer, String, Hash, Repository] A GitHub repository @param id [Integer] The Issue comment id @param reaction [String] The Reaction

@see developer.github.com/v3/reactions/#create-reaction-for-a-pull-request-review-comment @see developer.github.com/v3/reactions/#reaction-types

@example

@client.create_pull_request_reiew_comment_reaction("octokit/octokit.rb", 1)

@return [<Sawyer::Resource>] Hash representing the reaction.

# File lib/octokit/client/reactions.rb, line 137
def create_pull_request_review_comment_reaction(repo, id, reaction, options = {})
  options = ensure_api_media_type(:reactions, options.merge(:content => reaction))
  post "#{Repository.path repo}/pulls/comments/#{id}/reactions", options
end
delete_reaction(id, options = {}) click to toggle source

Delete a reaction

@param id [Integer] Reaction id

@see developer.github.com/v3/reactions/#delete-a-reaction

@example

@client.delete_reaction(1)

@return [Boolean] Return true if reaction was deleted, false otherwise.

# File lib/octokit/client/reactions.rb, line 152
def delete_reaction(id, options = {})
  options = ensure_api_media_type(:reactions, options)
  boolean_from_response :delete, "reactions/#{id}", options
end
issue_comment_reactions(repo, id, options = {}) click to toggle source

List reactions for an issue comment

@param repo [Integer, String, Hash, Repository] A GitHub repository @param id [Integer] The Issue comment id

@see developer.github.com/v3/reactions/#list-reactions-for-an-issue-comment

@example

@client.issue_comment_reactions("octokit/octokit.rb", 1)

@return [Array<Sawyer::Resource>] Array of Hashes representing the reactions.

# File lib/octokit/client/reactions.rb, line 85
def issue_comment_reactions(repo, id, options = {})
  options = ensure_api_media_type(:reactions, options)
  get "#{Repository.path repo}/issues/comments/#{id}/reactions", options
end
issue_reactions(repo, number, options = {}) click to toggle source

List reactions for an issue

@param repo [Integer, String, Hash, Repository] A GitHub repository @param number [Integer] The Issue number @see developer.github.com/v3/reactions/#list-reactions-for-an-issue

@example

@client.issue_reactions("octokit/octokit.rb", 1)

@return [Array<Sawyer::Resource>] Array of Hashes representing the reactions.

# File lib/octokit/client/reactions.rb, line 51
def issue_reactions(repo, number, options = {})
  options = ensure_api_media_type(:reactions, options)
  get "#{Repository.path repo}/issues/#{number}/reactions", options
end
pull_request_review_comment_reactions(repo, id, options = {}) click to toggle source

List reactions for a pull request review comment

@param repo [Integer, String, Hash, Repository] A GitHub repository @param id [Integer] The Issue comment id

@see developer.github.com/v3/reactions/#list-reactions-for-a-pull-request-review-comment

@example

@client.pull_request_review_comment_reactions("octokit/octokit.rb", 1)

@return [Array<Sawyer::Resource>] Array of Hashes representing the reactions.

# File lib/octokit/client/reactions.rb, line 119
def pull_request_review_comment_reactions(repo, id, options = {})
  options = ensure_api_media_type(:reactions, options)
  get "#{Repository.path repo}/pulls/comments/#{id}/reactions", options
end