module Octokit::Client::Reactions
Methods for the Reacions API
Public Instance Methods
Source
# File lib/octokit/client/reactions.rb, line 19 def commit_comment_reactions(repo, id, options = {}) get "#{Repository.path repo}/comments/#{id}/reactions", options end
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.
Source
# File lib/octokit/client/reactions.rb, line 35 def create_commit_comment_reaction(repo, id, reaction, options = {}) options = options.merge(content: reaction) post "#{Repository.path repo}/comments/#{id}/reactions", options end
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
Source
# File lib/octokit/client/reactions.rb, line 100 def create_issue_comment_reaction(repo, id, reaction, options = {}) options = options.merge(content: reaction) post "#{Repository.path repo}/issues/comments/#{id}/reactions", options end
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.
Source
# File lib/octokit/client/reactions.rb, line 67 def create_issue_reaction(repo, number, reaction, options = {}) options = options.merge(content: reaction) post "#{Repository.path repo}/issues/#{number}/reactions", options end
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.
Source
# File lib/octokit/client/reactions.rb, line 149 def create_pull_request_review_comment_reaction(repo, id, reaction, options = {}) options = options.merge(content: reaction) post "#{Repository.path repo}/pulls/comments/#{id}/reactions", options end
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.
Source
# File lib/octokit/client/reactions.rb, line 198 def create_release_reaction(repo, release_id, reaction, options = {}) options = options.merge(content: reaction) post "#{Repository.path repo}/releases/#{release_id}/reactions", options end
Create reaction for a release
@param repo [Integer, String, Hash, Repository] A GitHub repository @param id [Integer] The Release id @param reaction [String] The Reaction
@see docs.github.com/en/free-pro-team@latest/rest/reactions/reactions?apiVersion=2022-11-28#create-reaction-for-a-release @see developer.github.com/v3/reactions/#reaction-types
@example
@client.create_release_reaction("octokit/octokit.rb", 1)
@return [<Sawyer::Resource>] Hash representing the reaction.
Source
# File lib/octokit/client/reactions.rb, line 117 def delete_issue_comment_reaction(repo, comment_id, reaction_id, options = {}) boolean_from_response :delete, "#{Repository.path repo}/issues/comments/#{comment_id}/reactions/#{reaction_id}", options end
Delete a reaction from an issue comment
@param repo [Integer, String, Hash, Repository] A GitHub repository @param comment_id [Integer] The Issue comment id @param reaction_id [Integer] The Reaction id
@see docs.github.com/en/rest/reactions/reactions#delete-an-issue-comment-reaction
@example
@client.delete_issue_comment_reaction("octokit/octokit.rb", 1, 2)
@return [Boolean] Return true if reaction was deleted, false otherwise.
Source
# File lib/octokit/client/reactions.rb, line 166 def delete_issue_reaction(repo, issue_id, reaction_id, options = {}) boolean_from_response :delete, "#{Repository.path repo}/issues/#{issue_id}/reactions/#{reaction_id}", options end
Delete a reaction
@param repo [Integer, String, Hash, Repository] A GitHub repository @param issue_id [Integer] The Issue comment id @param reaction_id [Integer] The Reaction id
@see docs.github.com/en/rest/reactions/reactions#delete-an-issue-reaction
@example
@client.delete_issue_reaction("octokit/octokit.rb", 1, 2)
@return [Boolean] Return true if reaction was deleted, false otherwise.
Source
# File lib/octokit/client/reactions.rb, line 215 def delete_release_reaction(repo, release_id, reaction_id, options = {}) boolean_from_response :delete, "#{Repository.path repo}/releases/#{release_id}/reactions/#{reaction_id}", options end
Delete a reaction for a release
@param repo [Integer, String, Hash, Repository] A GitHub repository @param issue_id [Integer] The Release id @param reaction_id [Integer] The Reaction id
@example
@client.delete_release_reaction("octokit/octokit.rb", 1, 2)
@return [Boolean] Return true if reaction was deleted, false otherwise.
Source
# File lib/octokit/client/reactions.rb, line 83 def issue_comment_reactions(repo, id, options = {}) get "#{Repository.path repo}/issues/comments/#{id}/reactions", options end
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.
Source
# File lib/octokit/client/reactions.rb, line 50 def issue_reactions(repo, number, options = {}) get "#{Repository.path repo}/issues/#{number}/reactions", options end
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.
Source
# File lib/octokit/client/reactions.rb, line 132 def pull_request_review_comment_reactions(repo, id, options = {}) get "#{Repository.path repo}/pulls/comments/#{id}/reactions", options end
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.
Source
# File lib/octokit/client/reactions.rb, line 181 def release_reactions(repo, release_id, options = {}) get "#{Repository.path repo}/releases/#{release_id}/reactions", options end
List reactions for a release
@param repo [Integer, String, Hash, Repository] A GitHub repository @param id [Integer] The Release id
@example
@client.release_reactions("octokit/octokit.rb", 1)
@return [Array<Sawyer::Resource>] Array of Hashes representing the reactions.