class Github::Client::Authorizations

OAuth Authorizations API

def create(*args)

Other tags:
    Api: - public

Options Hash: (**params)
  • :fingerprint (String) --
  • :client_secret (String) --
  • :client_id (String) --
  • :note_url (String) --
  • :note (String) --
  • :scopes (Array[String]) --

Parameters:
  • params (Hash) --

Other tags:
    See: https://developer.github.com/v3/oauth_authorizations/#create-a-new-authorization -
def create(*args)
  raise_authentication_error unless authenticated?
  arguments(args) do
    assert_required :note, :scopes
  end
  post_request('/authorizations', arguments.params)
end

def delete(*args)

Other tags:
    Api: - public

Other tags:
    See: https://developer.github.com/v3/oauth_authorizations/#delete-an-authorization -
def delete(*args)
  raise_authentication_error unless authenticated?
  arguments(args, required: [:id])
  delete_request("/authorizations/#{arguments.id}", arguments.params)
end

def get(*args)

Other tags:
    Api: - public

Returns:
  • (ResponseWrapper) -

Other tags:
    See: https://developer.github.com/v3/oauth_authorizations/#get-a-single-authorization -
def get(*args)
  raise_authentication_error unless authenticated?
  arguments(args, required: [:id])
  get_request("/authorizations/#{arguments.id}", arguments.params)
end

def list(*args)

Other tags:
    Api: - public

Other tags:
    See: https://developer.github.com/v3/oauth_authorizations/#list-your-authorizations -
def list(*args)
  raise_authentication_error unless authenticated?
  arguments(args)
  response = get_request('/authorizations', arguments.params)
  return response unless block_given?
  response.each { |el| yield el }
end

def raise_authentication_error

def raise_authentication_error
  raise ArgumentError, 'You can only access your own tokens' \
                       ' via Basic Authentication'
end

def update(*args)

Other tags:
    Api: - public

Options Hash: (**params)
  • :fingerprint (String) --
  • :note (String) --
  • :remove_scopes (Array) --
  • :add_scopes (Array) --
  • :scopes (Array) --

Parameters:
  • inputs (Hash) --

Other tags:
    See: https://developer.github.com/v3/oauth_authorizations/#update-an-existing-authorization -
def update(*args)
  raise_authentication_error unless authenticated?
  arguments(args, required: [:id])
  patch_request("/authorizations/#{arguments.id}", arguments.params)
end