Class: Conductor::Http::Api::TokenResourceApi
- Inherits:
-
Object
- Object
- Conductor::Http::Api::TokenResourceApi
- Defined in:
- lib/conductor/http/api/token_resource_api.rb
Overview
TokenResourceApi - API for token management operations (Orkes)
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#generate_token(body) ⇒ Hash
Generate a token.
-
#get_user_info ⇒ Hash
Get user info from current token.
-
#initialize(api_client = nil) ⇒ TokenResourceApi
constructor
A new instance of TokenResourceApi.
Constructor Details
#initialize(api_client = nil) ⇒ TokenResourceApi
Returns a new instance of TokenResourceApi.
12 13 14 |
# File 'lib/conductor/http/api/token_resource_api.rb', line 12 def initialize(api_client = nil) @api_client = api_client || ApiClient.new end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
10 11 12 |
# File 'lib/conductor/http/api/token_resource_api.rb', line 10 def api_client @api_client end |
Instance Method Details
#generate_token(body) ⇒ Hash
Generate a token
19 20 21 22 23 24 25 26 27 |
# File 'lib/conductor/http/api/token_resource_api.rb', line 19 def generate_token(body) @api_client.call_api( '/token', 'POST', body: body, return_type: 'Object', return_http_data_only: true ) end |
#get_user_info ⇒ Hash
Get user info from current token
31 32 33 34 35 36 37 38 |
# File 'lib/conductor/http/api/token_resource_api.rb', line 31 def get_user_info @api_client.call_api( '/token/userInfo', 'GET', return_type: 'Object', return_http_data_only: true ) end |