Class: Aspera::OAuth::UrlJson
Overview
This class is used to create a token using a JSON body and a URL
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
- #create_token ⇒ Object
-
#initialize(url:, json:, **generic_params) ⇒ UrlJson
constructor
A new instance of UrlJson.
Methods inherited from Base
#create_token_call, #optional_scope_client_id, #token
Constructor Details
#initialize(url:, json:, **generic_params) ⇒ UrlJson
Returns a new instance of UrlJson.
11 12 13 14 15 16 17 18 19 20 |
# File 'lib/aspera/oauth/url_json.rb', line 11 def initialize( url:, json:, **generic_params ) super(**generic_params) @body = json @query = url @identifiers.push(@body[:url_token]) end |
Instance Method Details
#create_token ⇒ Object
22 23 24 25 26 27 28 29 30 31 |
# File 'lib/aspera/oauth/url_json.rb', line 22 def create_token @api.call( operation: 'POST', subpath: @path_token, headers: {'Accept' => 'application/json'}, query: @query.merge(scope: @scope), # scope is here because it may change over time (node) body: @body, body_type: :json ) end |