Skip to content
This repository was archived by the owner on Oct 17, 2023. It is now read-only.

Latest commit

 

History

History
327 lines (214 loc) · 8.41 KB

RolesApi.md

File metadata and controls

327 lines (214 loc) · 8.41 KB

Bfwd::RolesApi

All URIs are relative to https://localhost:8080/RestAPI

Method HTTP request Description
create_role POST /roles Create a new role.
get_all_roles GET /roles Retrieves a collection of all roles. By default 10 values are returned. Records are returned in natural order.
get_role_by_id GET /roles/{role} Retrieves a single role, specified by the ID parameter.
remove_permission_from_role DELETE /roles/{role}/permission/{resource}/{action} Revokes a particular permission
revoke_role DELETE /roles/{role} Revokes a role
update_role PUT /roles Update a role.

create_role

RolePagedMetadata create_role(role_request)

Create a new role.

{"nickname":"Create a new role","request":"createRoleRequest.html","response":"createRoleResponse.html"}

Example

# load the gem
require 'bf_ruby2'

api_instance = Bfwd::RolesApi.new

role_request = Bfwd::BillingEntityBase.new # BillingEntityBase | 


begin
  #Create a new role.
  result = api_instance.create_role(role_request)
  p result
rescue Bfwd::ApiError => e
  puts "Exception when calling RolesApi->create_role: #{e}"
end

Parameters

Name Type Description Notes
role_request BillingEntityBase

Return type

RolePagedMetadata

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json; charset=utf-8
  • Accept: text/xml, application/xml, application/json; charset=utf-8

get_all_roles

RolePagedMetadata get_all_roles(opts)

Retrieves a collection of all roles. By default 10 values are returned. Records are returned in natural order.

{"nickname":"Retrieve all roles","response":"getRoleAll.html"}

Example

# load the gem
require 'bf_ruby2'

api_instance = Bfwd::RolesApi.new

opts = { 
  organizations: ["organizations_example"], # Array<String> | 
  offset: 0, # Integer | The offset from the first subscription to return.
  records: 10, # Integer | The maximum number of subscriptions to return.
  order_by: "created", # String | Specify a field used to order the result set.
  order: "DESC", # String | Ihe direction of any ordering, either ASC or DESC.
  include_retired: false # BOOLEAN | Whether retired subscriptions should be returned.
}

begin
  #Retrieves a collection of all roles. By default 10 values are returned. Records are returned in natural order.
  result = api_instance.get_all_roles(opts)
  p result
rescue Bfwd::ApiError => e
  puts "Exception when calling RolesApi->get_all_roles: #{e}"
end

Parameters

Name Type Description Notes
organizations Array<String> [optional]
offset Integer The offset from the first subscription to return. [optional] [default to 0]
records Integer The maximum number of subscriptions to return. [optional] [default to 10]
order_by String Specify a field used to order the result set. [optional] [default to created]
order String Ihe direction of any ordering, either ASC or DESC. [optional] [default to DESC]
include_retired BOOLEAN Whether retired subscriptions should be returned. [optional] [default to false]

Return type

RolePagedMetadata

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json; charset=utf-8

get_role_by_id

RolePagedMetadata get_role_by_id(role, opts)

Retrieves a single role, specified by the ID parameter.

{"nickname":"Retrieve a role","response":"getRoleByID.html"}

Example

# load the gem
require 'bf_ruby2'

api_instance = Bfwd::RolesApi.new

role = "role_example" # String | ID or name of the role.

opts = { 
  organizations: ["organizations_example"], # Array<String> | 
  include_retired: false # BOOLEAN | Whether retired subscriptions should be returned.
}

begin
  #Retrieves a single role, specified by the ID parameter.
  result = api_instance.get_role_by_id(role, opts)
  p result
rescue Bfwd::ApiError => e
  puts "Exception when calling RolesApi->get_role_by_id: #{e}"
end

Parameters

Name Type Description Notes
role String ID or name of the role.
organizations Array<String> [optional]
include_retired BOOLEAN Whether retired subscriptions should be returned. [optional] [default to false]

Return type

RolePagedMetadata

Authorization

No authorization required

HTTP request headers

  • Content-Type: text/plain
  • Accept: application/json; charset=utf-8

remove_permission_from_role

RolePagedMetadata remove_permission_from_role(role, resource, action, opts)

Revokes a particular permission

{"nickname":"Remove Permission from role","response":"removePermissionFromGroup.html","request":"removePermissionFromGroupRequest.html"}

Example

# load the gem
require 'bf_ruby2'

api_instance = Bfwd::RolesApi.new

role = "role_example" # String | ID or name of the role.

resource = "resource_example" # String | 

action = "action_example" # String | 

opts = { 
  organizations: ["organizations_example"] # Array<String> | 
}

begin
  #Revokes a particular permission
  result = api_instance.remove_permission_from_role(role, resource, action, opts)
  p result
rescue Bfwd::ApiError => e
  puts "Exception when calling RolesApi->remove_permission_from_role: #{e}"
end

Parameters

Name Type Description Notes
role String ID or name of the role.
resource String
action String
organizations Array<String> [optional]

Return type

RolePagedMetadata

Authorization

No authorization required

HTTP request headers

  • Content-Type: text/plain
  • Accept: application/json; charset=utf-8

revoke_role

RolePagedMetadata revoke_role(role, opts)

Revokes a role

{"nickname":"Revoke role","response":"revokeRole.html","request":"revokeRoleRequest.html"}

Example

# load the gem
require 'bf_ruby2'

api_instance = Bfwd::RolesApi.new

role = "role_example" # String | ID or name of the role.

opts = { 
  organizations: ["organizations_example"] # Array<String> | 
}

begin
  #Revokes a role
  result = api_instance.revoke_role(role, opts)
  p result
rescue Bfwd::ApiError => e
  puts "Exception when calling RolesApi->revoke_role: #{e}"
end

Parameters

Name Type Description Notes
role String ID or name of the role.
organizations Array<String> [optional]

Return type

RolePagedMetadata

Authorization

No authorization required

HTTP request headers

  • Content-Type: text/plain
  • Accept: application/json; charset=utf-8

update_role

RolePagedMetadata update_role(role_request)

Update a role.

{"nickname":"Update a role","request":"updateRoleRequest.html","response":"updateRoleResponse.html"}

Example

# load the gem
require 'bf_ruby2'

api_instance = Bfwd::RolesApi.new

role_request = Bfwd::UpdateRoleRequest.new # UpdateRoleRequest | 


begin
  #Update a role.
  result = api_instance.update_role(role_request)
  p result
rescue Bfwd::ApiError => e
  puts "Exception when calling RolesApi->update_role: #{e}"
end

Parameters

Name Type Description Notes
role_request UpdateRoleRequest

Return type

RolePagedMetadata

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json; charset=utf-8
  • Accept: text/xml, application/xml, application/json; charset=utf-8