From 4fe9a20f9d44123026e1c6c912880c2a473c015b Mon Sep 17 00:00:00 2001 From: r7kamura Date: Mon, 14 Nov 2016 16:21:25 +0900 Subject: [PATCH] Add project reaction methods --- lib/qiita/resource_based_methods.rb | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/lib/qiita/resource_based_methods.rb b/lib/qiita/resource_based_methods.rb index 9cef602..710ed60 100644 --- a/lib/qiita/resource_based_methods.rb +++ b/lib/qiita/resource_based_methods.rb @@ -245,6 +245,13 @@ def create_item_reaction(item_id, params = nil, headers = nil) post("/api/v2/items/#{item_id}/reactions", params, headers) end + # ### Qiita::Client#create_project_reaction(project_id, params = nil, headers = nil) + # Add an emoji reaction to an project. + # + def create_project_reaction(project_id, params = nil, headers = nil) + post("/api/v2/projects/#{project_id}/reactions", params, headers) + end + # ### Qiita::Client#delete_comment_reaction(comment_id, reaction_name, params = nil, headers = nil) # Delete an emoji reaction from a comment. # @@ -259,20 +266,34 @@ def delete_item_reaction(item_id, reaction_name, params = nil, headers = nil) delete("/api/v2/items/#{item_id}/reactions/#{reaction_name}", params, headers) end + # ### Qiita::Client#delete_project_reaction(project_id, reaction_name, params = nil, headers = nil) + # Delete an emoji reaction from an project. + # + def delete_project_reaction(project_id, reaction_name, params = nil, headers = nil) + delete("/api/v2/projects/#{project_id}/reactions/#{reaction_name}", params, headers) + end + # ### Qiita::Client#list_comment_reactions(comment_id, params = nil, headers = nil) - # List emoji reactions of an comment. + # List emoji reactions of an comment in recently-created order. # def list_comment_reactions(comment_id, params = nil, headers = nil) get("/api/v2/comments/#{comment_id}/reactions", params, headers) end # ### Qiita::Client#list_item_reactions(item_id, params = nil, headers = nil) - # List emoji reactions of an item. + # List emoji reactions of an item in recently-created order. # def list_item_reactions(item_id, params = nil, headers = nil) get("/api/v2/items/#{item_id}/reactions", params, headers) end + # ### Qiita::Client#list_project_reactions(project_id, params = nil, headers = nil) + # List emoji reactions of an project in recently-created order. + # + def list_project_reactions(project_id, params = nil, headers = nil) + get("/api/v2/projects/#{project_id}/reactions", params, headers) + end + # ### Qiita::Client#list_tags(params = nil, headers = nil) # List tags in newest order. #