Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEAT]: add missing endpoints #1633

Closed
1 task done
wJoenn opened this issue Oct 3, 2023 · 2 comments · Fixed by #1637
Closed
1 task done

[FEAT]: add missing endpoints #1633

wJoenn opened this issue Oct 3, 2023 · 2 comments · Fixed by #1637
Labels
hacktoberfest Issues for participation in Hacktoberfest Status: Up for grabs Issues that are ready to be worked on by anyone Type: Feature New feature or request

Comments

@wJoenn
Copy link
Contributor

wJoenn commented Oct 3, 2023

Describe the need

Hey
I've noticed some endpoints are missing from Octokit, specifically I've had a need to list, create and delete a release's reactions.

From what I can see it should be as easy as adding this to client/reactions.rb and throw in a couple tests which I'd be willing to do if you're open to the idea.

module Octokit
  class Client
    module Reactions
      # List reactions for a release
      #
      # @param repo [Integer, String, Hash, Repository] A GitHub repository
      # @param id [Integer] The Release id
      #
      # @see https://docs.github.com/en/free-pro-team@latest/rest/reactions/reactions?apiVersion=2022-11-28#list-reactions-for-a-release
      #
      # @example
      #   @client.release_reactions("octokit/octokit.rb", 1)
      #
      # @return [Array<Sawyer::Resource>] Array of Hashes representing the reactions.
      def release_reactions(repo, id, options = {})
        get "#{Repository.path repo}/releases/#{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 https://docs.github.com/en/free-pro-team@latest/rest/reactions/reactions?apiVersion=2022-11-28#create-reaction-for-a-release
      # @see https://developer.github.com/v3/reactions/#reaction-types
      #
      # @example
      #   @client.create_release_reaction("octokit/octokit.rb", 1)
      #
      # @return [<Sawyer::Resource>] Hash representing the reaction.
      def create_release_reaction(repo, id, reaction, options = {})
        options = options.merge(content: reaction)
        post "#{Repository.path repo}/releases/#{id}/reactions", 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
      #
      # @see https://docs.github.com/en/free-pro-team@latest/rest/reactions/reactions?apiVersion=2022-11-28#delete-a-release-reaction
      #
      # @example
      #   @client.delete_release_reaction("octokit/octokit.rb", 1, 2)
      #
      # @return [Boolean] Return true if reaction was deleted, false otherwise.
      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
    end
  end
end

SDK Version

No response

API Version

2022-11-28

Relevant log output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@wJoenn wJoenn added Status: Triage This is being looked at and prioritized Type: Feature New feature or request labels Oct 3, 2023
@github-actions
Copy link

github-actions bot commented Oct 3, 2023

👋 Hi! Thank you for this contribution! Just to let you know, our GitHub SDK team does a round of issue and PR reviews twice a week, every Monday and Friday! We have a process in place for prioritizing and responding to your input. Because you are a part of this community please feel free to comment, add to, or pick up any issues/PRs that are labled with Status: Up for grabs. You & others like you are the reason all of this works! So thank you & happy coding! 🚀

@nickfloyd nickfloyd added Status: Up for grabs Issues that are ready to be worked on by anyone hacktoberfest Issues for participation in Hacktoberfest and removed Status: Triage This is being looked at and prioritized labels Oct 6, 2023
@nickfloyd
Copy link
Contributor

Hey thank you for highlighting these missing APIs. You are correct, until we can get to generative SDKs, the SDKs have to be added manually.

I am going to assign the labels hacktoberfest and Up for Grabs to signal to the community that this is something that has been verified and can be worked. It looks like you'd be up for this so please feel free to pick the issue up! Thank you again for all that you do for this community ❤️ !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hacktoberfest Issues for participation in Hacktoberfest Status: Up for grabs Issues that are ready to be worked on by anyone Type: Feature New feature or request
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants