-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add marketplace listings API endpoints #929
Conversation
1 similar comment
@tarebyte are you the right person to review? |
@sbarnekow - FYI, I wrote this while I was getting a feel for the API. Should make integrating with marketplace even easier for anyone else written in Ruby. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR, a few small changes and this will be good to go!
# Methods for the Marketplace Listing API | ||
# | ||
# @see https://developer.github.com/v3/apps/marketplace/ | ||
module MarketplaceListings |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's go ahead and rename this to Marketplace
def plan_for_account(account_id, options = {}) | ||
opts = ensure_api_media_type(:marketplace, options) | ||
get "/marketplace_listing/accounts/#{account_id}", opts | ||
rescue Octokit::NotFound |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this isn't consistent with the rest of Octokit, let's go ahead and remove this rescue so the error bubbles up.
@@ -15,6 +15,7 @@ module Preview | |||
:projects => 'application/vnd.github.inertia-preview+json'.freeze, | |||
:traffic => 'application/vnd.github.spiderman-preview'.freeze, | |||
:integrations => 'application/vnd.github.machine-man-preview+json'.freeze, | |||
:marketplace => 'application/vnd.github.valkyrie-preview+json'.freeze, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
|
||
private | ||
|
||
def new_jwt_token |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is now used in two different test files, let's move this into the spec/helper.rb
so we don't repeat logic.
1 similar comment
@tarebyte - updated and 💚 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry noticed this after I ✅ the PR.
end | ||
|
||
# List all GitHub accounts on a specific plan | ||
# |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you mind adding the plan
parameter here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
lib/octokit/client/marketplace.rb
Outdated
end | ||
|
||
# Get the plan associated with a given GitHub account | ||
# |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you mind adding the account_id
parameter here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
1 similar comment
1 similar comment
1 similar comment
🍰 |
That. 🎁