class Github::Client::Authorizations

OAuth Authorizations API

def create(*args)

Other tags:
    Api: - public

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

Parameters:
  • params (Hash) --
def create(*args)
  raise_authentication_error unless authenticated?
  arguments(args) do
    permit VALID_AUTH_PARAM_NAMES
  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: (**inputs)
  • :note (String) --
  • :remove_scopes (Array) --
  • :add_scopes (Array) --
  • :scopes (Array) --

Parameters:
  • inputs (Hash) --
def update(*args)
  raise_authentication_error unless authenticated?
  arguments(args, required: [:id]) do
    permit VALID_AUTH_PARAM_NAMES
  end
  patch_request("/authorizations/#{arguments.id}", arguments.params)
end