=begin
#NSX API

#VMware NSX REST API

OpenAPI spec version: 1.0.0

Generated by: https://github.com/swagger-api/swagger-codegen.git
Swagger Codegen version: 2.3.1

=end

require "uri"

module NSXT
  class AaaApi
    attr_accessor :api_client

    def initialize(api_client = ApiClient.default)
      @api_client = api_client
    end

    # Create registration access token
    # By default, api role is network_engineer. 
    # @param [Hash] opts the optional parameters
    # @option opts [String] :registration_api_user_role API User Role for registration
    # @return [RegistrationToken]
    def create_registration_token(opts = {})
      data, _status_code, _headers = create_registration_token_with_http_info(opts)
      return data
    end

    # Create registration access token
    # By default, api role is network_engineer. 
    # @param [Hash] opts the optional parameters
    # @option opts [String] :registration_api_user_role API User Role for registration
    # @return [Array<(RegistrationToken, Fixnum, Hash)>] RegistrationToken data, response status code and response headers
    def create_registration_token_with_http_info(opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug "Calling API: AaaApi.create_registration_token ..."
      end
      if @api_client.config.client_side_validation && opts[:'registration_api_user_role'] && !['enterprise_admin', 'network_engineer'].include?(opts[:'registration_api_user_role'])
        fail ArgumentError, 'invalid value for "registration_api_user_role", must be one of enterprise_admin, network_engineer'
      end
      # resource path
      local_var_path = "/aaa/registration-token"

      # query parameters
      query_params = {}
      query_params[:'registration_api_user_role'] = opts[:'registration_api_user_role'] if !opts[:'registration_api_user_role'].nil?

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])
      # HTTP header 'Content-Type'
      header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = nil
      auth_names = ['BasicAuth']
      data, status_code, headers = @api_client.call_api(:POST, local_var_path,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => 'RegistrationToken')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: AaaApi#create_registration_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Assign roles to User or Group
    # Assign roles to User or Group
    # @param role_binding 
    # @param [Hash] opts the optional parameters
    # @return [RoleBinding]
    def create_role_binding(role_binding, opts = {})
      data, _status_code, _headers = create_role_binding_with_http_info(role_binding, opts)
      return data
    end

    # Assign roles to User or Group
    # Assign roles to User or Group
    # @param role_binding 
    # @param [Hash] opts the optional parameters
    # @return [Array<(RoleBinding, Fixnum, Hash)>] RoleBinding data, response status code and response headers
    def create_role_binding_with_http_info(role_binding, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug "Calling API: AaaApi.create_role_binding ..."
      end
      # verify the required parameter 'role_binding' is set
      if @api_client.config.client_side_validation && role_binding.nil?
        fail ArgumentError, "Missing the required parameter 'role_binding' when calling AaaApi.create_role_binding"
      end
      # resource path
      local_var_path = "/aaa/role-bindings"

      # query parameters
      query_params = {}

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])
      # HTTP header 'Content-Type'
      header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = @api_client.object_to_http_body(role_binding)
      auth_names = ['BasicAuth']
      data, status_code, headers = @api_client.call_api(:POST, local_var_path,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => 'RoleBinding')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: AaaApi#create_role_binding\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Delete registration access token
    # Delete registration access token
    # @param token Registration token
    # @param [Hash] opts the optional parameters
    # @return [nil]
    def delete_registration_token(token, opts = {})
      delete_registration_token_with_http_info(token, opts)
      return nil
    end

    # Delete registration access token
    # Delete registration access token
    # @param token Registration token
    # @param [Hash] opts the optional parameters
    # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
    def delete_registration_token_with_http_info(token, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug "Calling API: AaaApi.delete_registration_token ..."
      end
      # verify the required parameter 'token' is set
      if @api_client.config.client_side_validation && token.nil?
        fail ArgumentError, "Missing the required parameter 'token' when calling AaaApi.delete_registration_token"
      end
      # resource path
      local_var_path = "/aaa/registration-token/{token}".sub('{' + 'token' + '}', token.to_s)

      # query parameters
      query_params = {}

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])
      # HTTP header 'Content-Type'
      header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = nil
      auth_names = ['BasicAuth']
      data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names)
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: AaaApi#delete_registration_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Delete user/group's roles assignment
    # Delete user/group's roles assignment
    # @param binding_id User/Group&#39;s id
    # @param [Hash] opts the optional parameters
    # @return [nil]
    def delete_role_binding(binding_id, opts = {})
      delete_role_binding_with_http_info(binding_id, opts)
      return nil
    end

    # Delete user/group&#39;s roles assignment
    # Delete user/group&#39;s roles assignment
    # @param binding_id User/Group&#39;s id
    # @param [Hash] opts the optional parameters
    # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
    def delete_role_binding_with_http_info(binding_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug "Calling API: AaaApi.delete_role_binding ..."
      end
      # verify the required parameter 'binding_id' is set
      if @api_client.config.client_side_validation && binding_id.nil?
        fail ArgumentError, "Missing the required parameter 'binding_id' when calling AaaApi.delete_role_binding"
      end
      # resource path
      local_var_path = "/aaa/role-bindings/{binding-id}".sub('{' + 'binding-id' + '}', binding_id.to_s)

      # query parameters
      query_params = {}

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])
      # HTTP header 'Content-Type'
      header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = nil
      auth_names = ['BasicAuth']
      data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names)
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: AaaApi#delete_role_binding\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Get all users and groups with their roles
    # Get all users and groups with their roles
    # @param [Hash] opts the optional parameters
    # @option opts [String] :cursor Opaque cursor to be used for getting next page of records (supplied by current result page)
    # @option opts [String] :included_fields Comma separated list of fields that should be included to result of query
    # @option opts [String] :name User/Group name
    # @option opts [Integer] :page_size Maximum number of results to return in this page (server may return fewer) (default to 1000)
    # @option opts [BOOLEAN] :sort_ascending 
    # @option opts [String] :sort_by Field by which records are sorted
    # @option opts [String] :type Type
    # @return [RoleBindingListResult]
    def get_all_role_bindings(opts = {})
      data, _status_code, _headers = get_all_role_bindings_with_http_info(opts)
      return data
    end

    # Get all users and groups with their roles
    # Get all users and groups with their roles
    # @param [Hash] opts the optional parameters
    # @option opts [String] :cursor Opaque cursor to be used for getting next page of records (supplied by current result page)
    # @option opts [String] :included_fields Comma separated list of fields that should be included to result of query
    # @option opts [String] :name User/Group name
    # @option opts [Integer] :page_size Maximum number of results to return in this page (server may return fewer)
    # @option opts [BOOLEAN] :sort_ascending 
    # @option opts [String] :sort_by Field by which records are sorted
    # @option opts [String] :type Type
    # @return [Array<(RoleBindingListResult, Fixnum, Hash)>] RoleBindingListResult data, response status code and response headers
    def get_all_role_bindings_with_http_info(opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug "Calling API: AaaApi.get_all_role_bindings ..."
      end
      if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000
        fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling AaaApi.get_all_role_bindings, must be smaller than or equal to 1000.'
      end

      if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0
        fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling AaaApi.get_all_role_bindings, must be greater than or equal to 0.'
      end

      if @api_client.config.client_side_validation && opts[:'type'] && !['remote_user', 'remote_group'].include?(opts[:'type'])
        fail ArgumentError, 'invalid value for "type", must be one of remote_user, remote_group'
      end
      # resource path
      local_var_path = "/aaa/role-bindings"

      # query parameters
      query_params = {}
      query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
      query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?
      query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil?
      query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?
      query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?
      query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?
      query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil?

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])
      # HTTP header 'Content-Type'
      header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = nil
      auth_names = ['BasicAuth']
      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 => 'RoleBindingListResult')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: AaaApi#get_all_role_bindings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Get information about all roles
    # Get information about all roles
    # @param [Hash] opts the optional parameters
    # @return [RoleListResult]
    def get_all_roles_info(opts = {})
      data, _status_code, _headers = get_all_roles_info_with_http_info(opts)
      return data
    end

    # Get information about all roles
    # Get information about all roles
    # @param [Hash] opts the optional parameters
    # @return [Array<(RoleListResult, Fixnum, Hash)>] RoleListResult data, response status code and response headers
    def get_all_roles_info_with_http_info(opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug "Calling API: AaaApi.get_all_roles_info ..."
      end
      # resource path
      local_var_path = "/aaa/roles"

      # query parameters
      query_params = {}

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])
      # HTTP header 'Content-Type'
      header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = nil
      auth_names = ['BasicAuth']
      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 => 'RoleListResult')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: AaaApi#get_all_roles_info\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Get information about logged-in user
    # Get information about logged-in user
    # @param [Hash] opts the optional parameters
    # @return [UserInfo]
    def get_current_user_info(opts = {})
      data, _status_code, _headers = get_current_user_info_with_http_info(opts)
      return data
    end

    # Get information about logged-in user
    # Get information about logged-in user
    # @param [Hash] opts the optional parameters
    # @return [Array<(UserInfo, Fixnum, Hash)>] UserInfo data, response status code and response headers
    def get_current_user_info_with_http_info(opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug "Calling API: AaaApi.get_current_user_info ..."
      end
      # resource path
      local_var_path = "/aaa/user-info"

      # query parameters
      query_params = {}

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])
      # HTTP header 'Content-Type'
      header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = nil
      auth_names = ['BasicAuth']
      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 => 'UserInfo')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: AaaApi#get_current_user_info\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Get all the User Groups where vIDM display name matches the search key case insensitively. The search key is checked to be a substring of display name.
    # Get all the User Groups where vIDM display name matches the search key case insensitively. The search key is checked to be a substring of display name.
    # @param search_string Search string to search for. 
    # @param [Hash] opts the optional parameters
    # @option opts [String] :cursor Opaque cursor to be used for getting next page of records (supplied by current result page)
    # @option opts [String] :included_fields Comma separated list of fields that should be included to result of query
    # @option opts [Integer] :page_size Maximum number of results to return in this page (server may return fewer) (default to 1000)
    # @option opts [BOOLEAN] :sort_ascending 
    # @option opts [String] :sort_by Field by which records are sorted
    # @return [VidmInfoListResult]
    def get_group_vidm_search_result(search_string, opts = {})
      data, _status_code, _headers = get_group_vidm_search_result_with_http_info(search_string, opts)
      return data
    end

    # Get all the User Groups where vIDM display name matches the search key case insensitively. The search key is checked to be a substring of display name.
    # Get all the User Groups where vIDM display name matches the search key case insensitively. The search key is checked to be a substring of display name.
    # @param search_string Search string to search for. 
    # @param [Hash] opts the optional parameters
    # @option opts [String] :cursor Opaque cursor to be used for getting next page of records (supplied by current result page)
    # @option opts [String] :included_fields Comma separated list of fields that should be included to result of query
    # @option opts [Integer] :page_size Maximum number of results to return in this page (server may return fewer)
    # @option opts [BOOLEAN] :sort_ascending 
    # @option opts [String] :sort_by Field by which records are sorted
    # @return [Array<(VidmInfoListResult, Fixnum, Hash)>] VidmInfoListResult data, response status code and response headers
    def get_group_vidm_search_result_with_http_info(search_string, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug "Calling API: AaaApi.get_group_vidm_search_result ..."
      end
      # verify the required parameter 'search_string' is set
      if @api_client.config.client_side_validation && search_string.nil?
        fail ArgumentError, "Missing the required parameter 'search_string' when calling AaaApi.get_group_vidm_search_result"
      end
      if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000
        fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling AaaApi.get_group_vidm_search_result, must be smaller than or equal to 1000.'
      end

      if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0
        fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling AaaApi.get_group_vidm_search_result, must be greater than or equal to 0.'
      end

      # resource path
      local_var_path = "/aaa/vidm/groups"

      # query parameters
      query_params = {}
      query_params[:'search_string'] = search_string
      query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
      query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?
      query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?
      query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?
      query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])
      # HTTP header 'Content-Type'
      header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = nil
      auth_names = ['BasicAuth']
      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 => 'VidmInfoListResult')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: AaaApi#get_group_vidm_search_result\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Get registration access token
    # Get registration access token
    # @param token Registration token
    # @param [Hash] opts the optional parameters
    # @return [RegistrationToken]
    def get_registration_token(token, opts = {})
      data, _status_code, _headers = get_registration_token_with_http_info(token, opts)
      return data
    end

    # Get registration access token
    # Get registration access token
    # @param token Registration token
    # @param [Hash] opts the optional parameters
    # @return [Array<(RegistrationToken, Fixnum, Hash)>] RegistrationToken data, response status code and response headers
    def get_registration_token_with_http_info(token, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug "Calling API: AaaApi.get_registration_token ..."
      end
      # verify the required parameter 'token' is set
      if @api_client.config.client_side_validation && token.nil?
        fail ArgumentError, "Missing the required parameter 'token' when calling AaaApi.get_registration_token"
      end
      # resource path
      local_var_path = "/aaa/registration-token/{token}".sub('{' + 'token' + '}', token.to_s)

      # query parameters
      query_params = {}

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])
      # HTTP header 'Content-Type'
      header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = nil
      auth_names = ['BasicAuth']
      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 => 'RegistrationToken')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: AaaApi#get_registration_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Get user/group's role information
    # Get user/group's role information
    # @param binding_id User/Group&#39;s id
    # @param [Hash] opts the optional parameters
    # @return [RoleBinding]
    def get_role_binding(binding_id, opts = {})
      data, _status_code, _headers = get_role_binding_with_http_info(binding_id, opts)
      return data
    end

    # Get user/group&#39;s role information
    # Get user/group&#39;s role information
    # @param binding_id User/Group&#39;s id
    # @param [Hash] opts the optional parameters
    # @return [Array<(RoleBinding, Fixnum, Hash)>] RoleBinding data, response status code and response headers
    def get_role_binding_with_http_info(binding_id, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug "Calling API: AaaApi.get_role_binding ..."
      end
      # verify the required parameter 'binding_id' is set
      if @api_client.config.client_side_validation && binding_id.nil?
        fail ArgumentError, "Missing the required parameter 'binding_id' when calling AaaApi.get_role_binding"
      end
      # resource path
      local_var_path = "/aaa/role-bindings/{binding-id}".sub('{' + 'binding-id' + '}', binding_id.to_s)

      # query parameters
      query_params = {}

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])
      # HTTP header 'Content-Type'
      header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = nil
      auth_names = ['BasicAuth']
      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 => 'RoleBinding')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: AaaApi#get_role_binding\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Get role information
    # Get role information
    # @param role Role Name
    # @param [Hash] opts the optional parameters
    # @return [RoleWithFeatures]
    def get_role_info(role, opts = {})
      data, _status_code, _headers = get_role_info_with_http_info(role, opts)
      return data
    end

    # Get role information
    # Get role information
    # @param role Role Name
    # @param [Hash] opts the optional parameters
    # @return [Array<(RoleWithFeatures, Fixnum, Hash)>] RoleWithFeatures data, response status code and response headers
    def get_role_info_with_http_info(role, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug "Calling API: AaaApi.get_role_info ..."
      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 AaaApi.get_role_info"
      end
      # resource path
      local_var_path = "/aaa/roles/{role}".sub('{' + 'role' + '}', role.to_s)

      # query parameters
      query_params = {}

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])
      # HTTP header 'Content-Type'
      header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = nil
      auth_names = ['BasicAuth']
      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 => 'RoleWithFeatures')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: AaaApi#get_role_info\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Get all the users from vIDM whose userName, givenName or familyName matches the search key case insensitively. The search key is checked to be a substring of name or given name or family name.
    # Get all the users from vIDM whose userName, givenName or familyName matches the search key case insensitively. The search key is checked to be a substring of name or given name or family name.
    # @param search_string Search string to search for. 
    # @param [Hash] opts the optional parameters
    # @option opts [String] :cursor Opaque cursor to be used for getting next page of records (supplied by current result page)
    # @option opts [String] :included_fields Comma separated list of fields that should be included to result of query
    # @option opts [Integer] :page_size Maximum number of results to return in this page (server may return fewer) (default to 1000)
    # @option opts [BOOLEAN] :sort_ascending 
    # @option opts [String] :sort_by Field by which records are sorted
    # @return [VidmInfoListResult]
    def get_user_vidm_search_result(search_string, opts = {})
      data, _status_code, _headers = get_user_vidm_search_result_with_http_info(search_string, opts)
      return data
    end

    # Get all the users from vIDM whose userName, givenName or familyName matches the search key case insensitively. The search key is checked to be a substring of name or given name or family name.
    # Get all the users from vIDM whose userName, givenName or familyName matches the search key case insensitively. The search key is checked to be a substring of name or given name or family name.
    # @param search_string Search string to search for. 
    # @param [Hash] opts the optional parameters
    # @option opts [String] :cursor Opaque cursor to be used for getting next page of records (supplied by current result page)
    # @option opts [String] :included_fields Comma separated list of fields that should be included to result of query
    # @option opts [Integer] :page_size Maximum number of results to return in this page (server may return fewer)
    # @option opts [BOOLEAN] :sort_ascending 
    # @option opts [String] :sort_by Field by which records are sorted
    # @return [Array<(VidmInfoListResult, Fixnum, Hash)>] VidmInfoListResult data, response status code and response headers
    def get_user_vidm_search_result_with_http_info(search_string, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug "Calling API: AaaApi.get_user_vidm_search_result ..."
      end
      # verify the required parameter 'search_string' is set
      if @api_client.config.client_side_validation && search_string.nil?
        fail ArgumentError, "Missing the required parameter 'search_string' when calling AaaApi.get_user_vidm_search_result"
      end
      if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000
        fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling AaaApi.get_user_vidm_search_result, must be smaller than or equal to 1000.'
      end

      if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0
        fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling AaaApi.get_user_vidm_search_result, must be greater than or equal to 0.'
      end

      # resource path
      local_var_path = "/aaa/vidm/users"

      # query parameters
      query_params = {}
      query_params[:'search_string'] = search_string
      query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
      query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?
      query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?
      query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?
      query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])
      # HTTP header 'Content-Type'
      header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = nil
      auth_names = ['BasicAuth']
      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 => 'VidmInfoListResult')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: AaaApi#get_user_vidm_search_result\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Get all the users and groups from vIDM matching the search key case insensitively. The search key is checked to be a substring of name or given name or family name of user and display name of group.
    # Get all the users and groups from vIDM matching the search key case insensitively. The search key is checked to be a substring of name or given name or family name of user and display name of group.
    # @param search_string Search string to search for. 
    # @param [Hash] opts the optional parameters
    # @option opts [String] :cursor Opaque cursor to be used for getting next page of records (supplied by current result page)
    # @option opts [String] :included_fields Comma separated list of fields that should be included to result of query
    # @option opts [Integer] :page_size Maximum number of results to return in this page (server may return fewer) (default to 1000)
    # @option opts [BOOLEAN] :sort_ascending 
    # @option opts [String] :sort_by Field by which records are sorted
    # @return [VidmInfoListResult]
    def get_vidm_search_result(search_string, opts = {})
      data, _status_code, _headers = get_vidm_search_result_with_http_info(search_string, opts)
      return data
    end

    # Get all the users and groups from vIDM matching the search key case insensitively. The search key is checked to be a substring of name or given name or family name of user and display name of group.
    # Get all the users and groups from vIDM matching the search key case insensitively. The search key is checked to be a substring of name or given name or family name of user and display name of group.
    # @param search_string Search string to search for. 
    # @param [Hash] opts the optional parameters
    # @option opts [String] :cursor Opaque cursor to be used for getting next page of records (supplied by current result page)
    # @option opts [String] :included_fields Comma separated list of fields that should be included to result of query
    # @option opts [Integer] :page_size Maximum number of results to return in this page (server may return fewer)
    # @option opts [BOOLEAN] :sort_ascending 
    # @option opts [String] :sort_by Field by which records are sorted
    # @return [Array<(VidmInfoListResult, Fixnum, Hash)>] VidmInfoListResult data, response status code and response headers
    def get_vidm_search_result_with_http_info(search_string, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug "Calling API: AaaApi.get_vidm_search_result ..."
      end
      # verify the required parameter 'search_string' is set
      if @api_client.config.client_side_validation && search_string.nil?
        fail ArgumentError, "Missing the required parameter 'search_string' when calling AaaApi.get_vidm_search_result"
      end
      if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000
        fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling AaaApi.get_vidm_search_result, must be smaller than or equal to 1000.'
      end

      if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0
        fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling AaaApi.get_vidm_search_result, must be greater than or equal to 0.'
      end

      # resource path
      local_var_path = "/aaa/vidm/search"

      # query parameters
      query_params = {}
      query_params[:'search_string'] = search_string
      query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?
      query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?
      query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?
      query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?
      query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])
      # HTTP header 'Content-Type'
      header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = nil
      auth_names = ['BasicAuth']
      data, status_code, headers = @api_client.call_api(:POST, local_var_path,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => 'VidmInfoListResult')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: AaaApi#get_vidm_search_result\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Update User or Group's roles
    # Update User or Group's roles
    # @param binding_id User/Group&#39;s id
    # @param role_binding 
    # @param [Hash] opts the optional parameters
    # @return [RoleBinding]
    def update_role_binding(binding_id, role_binding, opts = {})
      data, _status_code, _headers = update_role_binding_with_http_info(binding_id, role_binding, opts)
      return data
    end

    # Update User or Group&#39;s roles
    # Update User or Group&#39;s roles
    # @param binding_id User/Group&#39;s id
    # @param role_binding 
    # @param [Hash] opts the optional parameters
    # @return [Array<(RoleBinding, Fixnum, Hash)>] RoleBinding data, response status code and response headers
    def update_role_binding_with_http_info(binding_id, role_binding, opts = {})
      if @api_client.config.debugging
        @api_client.config.logger.debug "Calling API: AaaApi.update_role_binding ..."
      end
      # verify the required parameter 'binding_id' is set
      if @api_client.config.client_side_validation && binding_id.nil?
        fail ArgumentError, "Missing the required parameter 'binding_id' when calling AaaApi.update_role_binding"
      end
      # verify the required parameter 'role_binding' is set
      if @api_client.config.client_side_validation && role_binding.nil?
        fail ArgumentError, "Missing the required parameter 'role_binding' when calling AaaApi.update_role_binding"
      end
      # resource path
      local_var_path = "/aaa/role-bindings/{binding-id}".sub('{' + 'binding-id' + '}', binding_id.to_s)

      # query parameters
      query_params = {}

      # header parameters
      header_params = {}
      # HTTP header 'Accept' (if needed)
      header_params['Accept'] = @api_client.select_header_accept(['application/json'])
      # HTTP header 'Content-Type'
      header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

      # form parameters
      form_params = {}

      # http body (model)
      post_body = @api_client.object_to_http_body(role_binding)
      auth_names = ['BasicAuth']
      data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
        :header_params => header_params,
        :query_params => query_params,
        :form_params => form_params,
        :body => post_body,
        :auth_names => auth_names,
        :return_type => 'RoleBinding')
      if @api_client.config.debugging
        @api_client.config.logger.debug "API called: AaaApi#update_role_binding\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end
  end
end
