class Github::Authorizations
OAuth Authorizations API
def app(options={}, &block)
def app(options={}, &block) @app ||= ApiFactory.new('Authorizations::App', current_options.merge(options), &block) end
def create(*args)
- 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 sift VALID_AUTH_PARAM_NAMES end post_request('/authorizations', arguments.params) end
def delete(*args)
- Api: - public
def delete(*args) raise_authentication_error unless authenticated? arguments(args, required: [:authorization_id]) delete_request("/authorizations/#{authorization_id}", arguments.params) end
def get(*args)
- Api: - public
Returns:
-
(ResponseWrapper)-
def get(*args) raise_authentication_error unless authenticated? arguments(args, required: [:authorization_id]) get_request("/authorizations/#{authorization_id}", arguments.params) end
def list(*args)
- Api: - public
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)
- 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: [:authorization_id]) do sift VALID_AUTH_PARAM_NAMES end patch_request("/authorizations/#{authorization_id}", arguments.params) end