class EmassClient::SystemRolesApi

Attributes

api_client[RW]

Public Class Methods

new(api_client = ApiClient.default) click to toggle source
# File lib/emass_client/api/system_roles_api.rb, line 16
def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Public Instance Methods

get_system_roles(opts = {}) click to toggle source

Get available roles Returns all available roles @param [Hash] opts the optional parameters @return [SystemRolesResponse]

# File lib/emass_client/api/system_roles_api.rb, line 23
def get_system_roles(opts = {})
  data, _status_code, _headers = get_system_roles_with_http_info(opts)
  data
end
get_system_roles_by_category_id(role_category, role, opts = {}) click to toggle source

Get system roles Returns the role(s) data matching parameters. @param role_category **Role Category**: The system role category been queried @param role Role: Accepts single value from options available at base system-roles endpoint e.g., SCA. @param [Hash] opts the optional parameters @option opts [String] :policy **System Policy**: Filter query by system policy. If no value is specified and more than one policy is available, the default return is the RMF policy information. (default to rmf) @option opts [BOOLEAN] :include_decommissioned **Include Decommissioned Systems**: Indicates if decommissioned systems are retrieved. If no value is specified, the default returns true to include decommissioned systems. (default to true) @return [SystemRolesCategoryResponse]

# File lib/emass_client/api/system_roles_api.rb, line 77
def get_system_roles_by_category_id(role_category, role, opts = {})
  data, _status_code, _headers = get_system_roles_by_category_id_with_http_info(role_category, role, opts)
  data
end
get_system_roles_by_category_id_with_http_info(role_category, role, opts = {}) click to toggle source

Get system roles Returns the role(s) data matching parameters. @param role_category **Role Category**: The system role category been queried @param role Role: Accepts single value from options available at base system-roles endpoint e.g., SCA. @param [Hash] opts the optional parameters @option opts [String] :policy **System Policy**: Filter query by system policy. If no value is specified and more than one policy is available, the default return is the RMF policy information. @option opts [BOOLEAN] :include_decommissioned **Include Decommissioned Systems**: Indicates if decommissioned systems are retrieved. If no value is specified, the default returns true to include decommissioned systems. @return [Array<(SystemRolesCategoryResponse, Integer, Hash)>] SystemRolesCategoryResponse data, response status code and response headers

# File lib/emass_client/api/system_roles_api.rb, line 90
def get_system_roles_by_category_id_with_http_info(role_category, role, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SystemRolesApi.get_system_roles_by_category_id ...'
  end
  # verify the required parameter 'role_category' is set
  if @api_client.config.client_side_validation && role_category.nil?
    fail ArgumentError, "Missing the required parameter 'role_category' when calling SystemRolesApi.get_system_roles_by_category_id"
  end
  # verify enum value
  if @api_client.config.client_side_validation && !['CAC', 'PAC', 'Other'].include?(role_category)
    fail ArgumentError, "invalid value for 'role_category', must be one of CAC, PAC, Other"
  end
  # verify the required parameter 'role' is set
  if @api_client.config.client_side_validation && role.nil?
    fail ArgumentError, "Missing the required parameter 'role' when calling SystemRolesApi.get_system_roles_by_category_id"
  end
  # verify enum value
  if @api_client.config.client_side_validation && !['AO', 'Auditor', 'Artifact Manager', 'C&A Team', 'IAO', 'ISSO', 'PM/IAM', 'SCA', 'User Rep', 'Validator'].include?(role)
    fail ArgumentError, "invalid value for 'role', must be one of AO, Auditor, Artifact Manager, C&A Team, IAO, ISSO, PM/IAM, SCA, User Rep, Validator"
  end
  if @api_client.config.client_side_validation && opts[:'policy'] && !['diacap', 'rmf', 'reporting'].include?(opts[:'policy'])
    fail ArgumentError, 'invalid value for "policy", must be one of diacap, rmf, reporting'
  end
  # resource path
  local_var_path = '/api/system-roles/{roleCategory}'.sub('{' + 'roleCategory' + '}', role_category.to_s)

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'role'] = role
  query_params[:'policy'] = opts[:'policy'] if !opts[:'policy'].nil?
  query_params[:'includeDecommissioned'] = opts[:'include_decommissioned'] if !opts[:'include_decommissioned'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  return_type = opts[:return_type] || 'SystemRolesCategoryResponse' 

  auth_names = opts[:auth_names] || ['apikey', 'mockType', 'userid']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type)

  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SystemRolesApi#get_system_roles_by_category_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
get_system_roles_with_http_info(opts = {}) click to toggle source

Get available roles Returns all available roles @param [Hash] opts the optional parameters @return [Array<(SystemRolesResponse, Integer, Hash)>] SystemRolesResponse data, response status code and response headers

# File lib/emass_client/api/system_roles_api.rb, line 32
def get_system_roles_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: SystemRolesApi.get_system_roles ...'
  end
  # resource path
  local_var_path = '/api/system-roles'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  return_type = opts[:return_type] || 'SystemRolesResponse' 

  auth_names = opts[:auth_names] || ['apikey', 'mockType', 'userid']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type)

  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SystemRolesApi#get_system_roles\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end