Class: Unit::Resource::AuthorizationResource

Inherits:
BaseResource show all
Defined in:
lib/unit/api_resources/authorization_resource.rb

Class Method Summary collapse

Methods inherited from BaseResource

file_response_handler, response_handler

Class Method Details

.get(params) ⇒ UnitResponse, UnitError

Get authorization by calling Unit’s API

Parameters:

  • params (GetRequest)

Returns:



15
16
17
18
19
# File 'lib/unit/api_resources/authorization_resource.rb', line 15

def get(params)
  payload = params.to_hash
  response = HttpHelper.get("#{api_url}/authorizations/#{params.authorization_id}", params: payload, headers: headers)
  response_handler(response)
end

.list(params = nil) ⇒ UnitResponse, UnitError

Get authorization by calling Unit’s API

Parameters:

  • params (GetRequest) (defaults to: nil)

Returns:



24
25
26
27
# File 'lib/unit/api_resources/authorization_resource.rb', line 24

def list(params = nil)
  response = HttpHelper.get("#{api_url}/authorizations", params: params&.to_hash, headers: headers)
  response_handler(response)
end