Module: Octokit::Client::Marketplace

Included in:
Octokit::Client
Defined in:
lib/octokit/client/marketplace.rb

Overview

Methods for the Marketplace Listing API

Instance Method Summary collapse

Instance Method Details

#list_accounts_for_plan(plan_id, options = {}) ⇒ Array<Sawyer::Resource>

List all GitHub accounts on a specific plan

Parameters:

  • plan_id (Integer)

    The id of the GitHub plan

  • options (Hash) (defaults to: {})

    A customizable set of options

Returns:

  • (Array<Sawyer::Resource>)

    A list of accounts

See Also:



29
30
31
32
# File 'lib/octokit/client/marketplace.rb', line 29

def list_accounts_for_plan(plan_id, options = {})
  opts = ensure_api_media_type(:marketplace, options)
  paginate "/marketplace_listing/plans/#{plan_id}/accounts", opts
end

#list_plans(options = {}) ⇒ Array<Sawyer::Resource>

List all plans for an app’s marketplace listing

Parameters:

  • options (Hash) (defaults to: {})

    A customizable set of options

Returns:

  • (Array<Sawyer::Resource>)

    A list of plans

See Also:



16
17
18
19
# File 'lib/octokit/client/marketplace.rb', line 16

def list_plans(options = {})
  opts = ensure_api_media_type(:marketplace, options)
  paginate "/marketplace_listing/plans", opts
end

#marketplace_purchases(options = {}) ⇒ Array<Sawyer::Resource>

Get user’s Marketplace purchases

Parameters:

  • options (Hash) (defaults to: {})

    A customizable set of options

Returns:

  • (Array<Sawyer::Resource>)

    A list of Marketplace purchases

See Also:



54
55
56
57
# File 'lib/octokit/client/marketplace.rb', line 54

def marketplace_purchases(options = {})
  opts = ensure_api_media_type(:marketplace, options)
  get "/user/marketplace_purchases", opts
end

#plan_for_account(account_id, options = {}) ⇒ Sawyer::Resource

Get the plan associated with a given GitHub account

Parameters:

  • account_id (Integer)

    The id of the GitHub account

  • options (Hash) (defaults to: {})

    A customizable set of options

Returns:

  • (Sawyer::Resource)

    Account with plan details, or nil

See Also:



42
43
44
45
# File 'lib/octokit/client/marketplace.rb', line 42

def (, options = {})
  opts = ensure_api_media_type(:marketplace, options)
  get "/marketplace_listing/accounts/#{}", opts
end