Class: Conductor::Http::Api::RoleResourceApi
- Inherits:
-
Object
- Object
- Conductor::Http::Api::RoleResourceApi
- Defined in:
- lib/conductor/http/api/role_resource_api.rb
Overview
RoleResourceApi - API for role management operations (Orkes)
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#create_role(body) ⇒ Object
Create a role.
-
#delete_role(name) ⇒ Object
Delete a role.
-
#get_role(name) ⇒ Object
Get a role by name.
-
#initialize(api_client = nil) ⇒ RoleResourceApi
constructor
A new instance of RoleResourceApi.
-
#list_all_roles ⇒ Object
List all roles.
-
#list_available_permissions ⇒ Object
List available permissions.
-
#list_custom_roles ⇒ Object
List custom roles.
-
#list_system_roles ⇒ Object
List system roles.
-
#update_role(name, body) ⇒ Object
Update a role.
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_client ⇒ Object
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_roles ⇒ Object
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_permissions ⇒ Object
List available permissions
32 33 34 |
# File 'lib/conductor/http/api/role_resource_api.rb', line 32 def @api_client.call_api('/roles/permissions', 'GET', return_type: 'Object', return_http_data_only: true) end |
#list_custom_roles ⇒ Object
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_roles ⇒ Object
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 |