Class: Conductor::Http::Api::TokenResourceApi

Inherits:
Object
  • Object
show all
Defined in:
lib/conductor/http/api/token_resource_api.rb

Overview

TokenResourceApi - API for token management operations (Orkes)

Instance Attribute Summary collapse

Instance Method Summary collapse

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_clientObject

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

Parameters:

  • body (GenerateTokenRequest)

    Token request

Returns:

  • (Hash)


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_infoHash

Get user info from current token

Returns:

  • (Hash)


31
32
33
34
35
36
37
38
# File 'lib/conductor/http/api/token_resource_api.rb', line 31

def 
  @api_client.call_api(
    '/token/userInfo',
    'GET',
    return_type: 'Object',
    return_http_data_only: true
  )
end