Class: Conductor::Http::Api::RoleResourceApi

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

Overview

RoleResourceApi - API for role management operations (Orkes)

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = nil) ⇒ RoleResourceApi

Returns a new instance of RoleResourceApi.



12
13
14
# File 'lib/conductor/http/api/role_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/role_resource_api.rb', line 10

def api_client
  @api_client
end

Instance Method Details

#create_role(body) ⇒ Object

Create a role



37
38
39
# File 'lib/conductor/http/api/role_resource_api.rb', line 37

def create_role(body)
  @api_client.call_api('/roles', 'POST', body: body, return_type: 'Object', return_http_data_only: true)
end

#delete_role(name) ⇒ Object

Delete a role



54
55
56
# File 'lib/conductor/http/api/role_resource_api.rb', line 54

def delete_role(name)
  @api_client.call_api('/roles/{name}', 'DELETE', path_params: { name: name }, return_http_data_only: true)
end

#get_role(name) ⇒ Object

Get a role by name



42
43
44
45
# File 'lib/conductor/http/api/role_resource_api.rb', line 42

def get_role(name)
  @api_client.call_api('/roles/{name}', 'GET', path_params: { name: name }, return_type: 'Object',
                                               return_http_data_only: true)
end

#list_all_rolesObject

List all roles



17
18
19
# File 'lib/conductor/http/api/role_resource_api.rb', line 17

def list_all_roles
  @api_client.call_api('/roles', 'GET', return_type: 'Array<Role>', return_http_data_only: true)
end

#list_available_permissionsObject

List available permissions



32
33
34
# File 'lib/conductor/http/api/role_resource_api.rb', line 32

def list_available_permissions
  @api_client.call_api('/roles/permissions', 'GET', return_type: 'Object', return_http_data_only: true)
end

#list_custom_rolesObject

List custom roles



27
28
29
# File 'lib/conductor/http/api/role_resource_api.rb', line 27

def list_custom_roles
  @api_client.call_api('/roles/custom', 'GET', return_type: 'Array<Role>', return_http_data_only: true)
end

#list_system_rolesObject

List system roles



22
23
24
# File 'lib/conductor/http/api/role_resource_api.rb', line 22

def list_system_roles
  @api_client.call_api('/roles/system', 'GET', return_type: 'Object', return_http_data_only: true)
end

#update_role(name, body) ⇒ Object

Update a role



48
49
50
51
# File 'lib/conductor/http/api/role_resource_api.rb', line 48

def update_role(name, body)
  @api_client.call_api('/roles/{name}', 'PUT', path_params: { name: name }, body: body, return_type: 'Object',
                                               return_http_data_only: true)
end