=begin
#DocuSign Rooms API - v2

#An API for an integrator to access the features of DocuSign Rooms

OpenAPI spec version: v2
Contact: devcenter@docusign.com
Generated by: https://github.com/swagger-api/swagger-codegen.git

=end

require "uri"

module DocuSign_Rooms

  class GetUsersOptions
    # Filters by name and email
    attr_accessor :filter

    # Valid values are 'FirstNameAsc', 'FirstNameDesc', 'LastNameAsc', 'LastNameDesc', 'EmailAsc', 'EmailDesc'
    attr_accessor :sort

    # 
    attr_accessor :default_office_id

    # Valid values are 'Company', 'Region', 'Office', 'Contributor'
    attr_accessor :access_level

    # Only valid for classic companies
    attr_accessor :title_id

    # Only valid for next gen companies
    attr_accessor :role_id

    # Valid values are 'Active', 'Pending'
    attr_accessor :status

    # When set to true, filters for users whose accounts are locked
    attr_accessor :locked_only

    # Defaults to 0
    attr_accessor :start_position

    # Defaults to 100. Must be less than or equal to 100
    attr_accessor :count

    def self.default
      @@default ||= GetUsersOptions.new
    end
  end


  class UsersApi
    attr_accessor :api_client

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

    # Adds the user to the designated office.
    # Adds the user to the designated office.
    # @param user_id The id of the user.
    # @param account_id (Required) The globally unique identifier (GUID) for the account.
    # @param body  (optional parameter)
    # @return [nil]
    def add_user_to_office(user_id, account_id, body)
      add_user_to_office_with_http_info(user_id, account_id,  body)
      return nil
    end

    # Adds the user to the designated office.
    # Adds the user to the designated office.
    # @param user_id The id of the user.
    # @param account_id (Required) The globally unique identifier (GUID) for the account.
    # @param body  (optional parameter)
    # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
    def add_user_to_office_with_http_info(user_id, account_id, body)
      if @api_client.config.debugging
        @api_client.config.logger.debug "Calling API: UsersApi.add_user_to_office ..."
      end
      # verify the required parameter 'user_id' is set
      fail ArgumentError, "Missing the required parameter 'user_id' when calling UsersApi.add_user_to_office" if user_id.nil?
      # verify the required parameter 'account_id' is set
      fail ArgumentError, "Missing the required parameter 'account_id' when calling UsersApi.add_user_to_office" if account_id.nil?
      # resource path
      local_var_path = "/v2/accounts/{accountId}/users/{userId}/add_to_office".sub('{format}','json').sub('{' + 'userId' + '}', user_id.to_s).sub('{' + 'accountId' + '}', account_id.to_s)

      # query parameters
      query_params = {}

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

      # form parameters
      form_params = {}

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

    # Adds the user to the designated region.
    # Adds the user to the designated region.
    # @param user_id The id of the user.
    # @param account_id (Required) The globally unique identifier (GUID) for the account.
    # @param body  (optional parameter)
    # @return [nil]
    def add_user_to_region(user_id, account_id, body)
      add_user_to_region_with_http_info(user_id, account_id,  body)
      return nil
    end

    # Adds the user to the designated region.
    # Adds the user to the designated region.
    # @param user_id The id of the user.
    # @param account_id (Required) The globally unique identifier (GUID) for the account.
    # @param body  (optional parameter)
    # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
    def add_user_to_region_with_http_info(user_id, account_id, body)
      if @api_client.config.debugging
        @api_client.config.logger.debug "Calling API: UsersApi.add_user_to_region ..."
      end
      # verify the required parameter 'user_id' is set
      fail ArgumentError, "Missing the required parameter 'user_id' when calling UsersApi.add_user_to_region" if user_id.nil?
      # verify the required parameter 'account_id' is set
      fail ArgumentError, "Missing the required parameter 'account_id' when calling UsersApi.add_user_to_region" if account_id.nil?
      # resource path
      local_var_path = "/v2/accounts/{accountId}/users/{userId}/add_to_region".sub('{format}','json').sub('{' + 'userId' + '}', user_id.to_s).sub('{' + 'accountId' + '}', account_id.to_s)

      # query parameters
      query_params = {}

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

      # form parameters
      form_params = {}

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

    # Retrieves user information for the user having the given UserId.
    # Retrieves user information for the user having the given UserId.
    # @param user_id The id of the user.
    # @param account_id (Required) The globally unique identifier (GUID) for the account.
    # @return [User]
    def get_user(user_id, account_id)
      data, _status_code, _headers = get_user_with_http_info(user_id, account_id)
      return data
    end

    # Retrieves user information for the user having the given UserId.
    # Retrieves user information for the user having the given UserId.
    # @param user_id The id of the user.
    # @param account_id (Required) The globally unique identifier (GUID) for the account.
    # @return [Array<(User, Fixnum, Hash)>] User data, response status code and response headers
    def get_user_with_http_info(user_id, account_id)
      if @api_client.config.debugging
        @api_client.config.logger.debug "Calling API: UsersApi.get_user ..."
      end
      # verify the required parameter 'user_id' is set
      fail ArgumentError, "Missing the required parameter 'user_id' when calling UsersApi.get_user" if user_id.nil?
      # verify the required parameter 'account_id' is set
      fail ArgumentError, "Missing the required parameter 'account_id' when calling UsersApi.get_user" if account_id.nil?
      # resource path
      local_var_path = "/v2/accounts/{accountId}/users/{userId}".sub('{format}','json').sub('{' + 'userId' + '}', user_id.to_s).sub('{' + 'accountId' + '}', account_id.to_s)

      # query parameters
      query_params = {}

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

      # form parameters
      form_params = {}

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

    # Gets a paged-list of users.
    # Retrieves a paged-list of Company Users in the User's company using the given filter and sort parameters.
    # @param account_id (Required) The globally unique identifier (GUID) for the account.
    # @param DocuSign_Rooms::GetUsersOptions Options for modifying the behavior of the function.
    # @return [UserSummaryList]
    def get_users(account_id, options = DocuSign_Rooms::GetUsersOptions.default)
      data, _status_code, _headers = get_users_with_http_info(account_id, options)
      return data
    end

    # Gets a paged-list of users.
    # Retrieves a paged-list of Company Users in the User&#39;s company using the given filter and sort parameters.
    # @param account_id (Required) The globally unique identifier (GUID) for the account.
    # @param DocuSign_Rooms::GetUsersOptions Options for modifying the behavior of the function.
    # @return [Array<(UserSummaryList, Fixnum, Hash)>] UserSummaryList data, response status code and response headers
    def get_users_with_http_info(account_id, options = DocuSign_Rooms::GetUsersOptions.default)
      if @api_client.config.debugging
        @api_client.config.logger.debug "Calling API: UsersApi.get_users ..."
      end
      # verify the required parameter 'account_id' is set
      fail ArgumentError, "Missing the required parameter 'account_id' when calling UsersApi.get_users" if account_id.nil?
      if options.sort && !['FirstNameAsc', 'LastNameAsc', 'EmailAsc', 'FirstNameDesc', 'LastNameDesc', 'EmailDesc'].include?(options.sort)
        fail ArgumentError, 'invalid value for "sort", must be one of FirstNameAsc, LastNameAsc, EmailAsc, FirstNameDesc, LastNameDesc, EmailDesc'
      end
      if options.access_level && !['Contributor', 'Office', 'Region', 'Company', 'Admin'].include?(options.access_level)
        fail ArgumentError, 'invalid value for "access_level", must be one of Contributor, Office, Region, Company, Admin'
      end
      if options.status && !['Active', 'Pending'].include?(options.status)
        fail ArgumentError, 'invalid value for "status", must be one of Active, Pending'
      end
      # resource path
      local_var_path = "/v2/accounts/{accountId}/users".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s)

      # query parameters
      query_params = {}
      query_params[:'filter'] = options.filter if !options.filter.nil?
      query_params[:'sort'] = options.sort if !options.sort.nil?
      query_params[:'defaultOfficeId'] = options.default_office_id if !options.default_office_id.nil?
      query_params[:'accessLevel'] = options.access_level if !options.access_level.nil?
      query_params[:'titleId'] = options.title_id if !options.title_id.nil?
      query_params[:'roleId'] = options.role_id if !options.role_id.nil?
      query_params[:'status'] = options.status if !options.status.nil?
      query_params[:'lockedOnly'] = options.locked_only if !options.locked_only.nil?
      query_params[:'startPosition'] = options.start_position if !options.start_position.nil?
      query_params[:'count'] = options.count if !options.count.nil?

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

      # form parameters
      form_params = {}

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

    # CLASSIC COMPANY ONLY. Send an invitation to join the company as an admin.
    # Invites a new user to join a company account on Rooms Version 5 as an Admin.
    # @param account_id (Required) The globally unique identifier (GUID) for the account.
    # @param body  (optional parameter)
    # @return [User]
    def invite_classic_admin(account_id, body)
      data, _status_code, _headers = invite_classic_admin_with_http_info(account_id,  body)
      return data
    end

    # CLASSIC COMPANY ONLY. Send an invitation to join the company as an admin.
    # Invites a new user to join a company account on Rooms Version 5 as an Admin.
    # @param account_id (Required) The globally unique identifier (GUID) for the account.
    # @param body  (optional parameter)
    # @return [Array<(User, Fixnum, Hash)>] User data, response status code and response headers
    def invite_classic_admin_with_http_info(account_id, body)
      if @api_client.config.debugging
        @api_client.config.logger.debug "Calling API: UsersApi.invite_classic_admin ..."
      end
      # verify the required parameter 'account_id' is set
      fail ArgumentError, "Missing the required parameter 'account_id' when calling UsersApi.invite_classic_admin" if account_id.nil?
      # resource path
      local_var_path = "/v2/accounts/{accountId}/users/invite_classic_admin".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s)

      # query parameters
      query_params = {}

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

      # form parameters
      form_params = {}

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

    # CLASSIC COMPANY ONLY. Send an invitation to join the company as an agent.
    # Invites a new user to join a company account on Rooms Version 5 as an Agent.
    # @param account_id (Required) The globally unique identifier (GUID) for the account.
    # @param body  (optional parameter)
    # @return [User]
    def invite_classic_agent(account_id, body)
      data, _status_code, _headers = invite_classic_agent_with_http_info(account_id,  body)
      return data
    end

    # CLASSIC COMPANY ONLY. Send an invitation to join the company as an agent.
    # Invites a new user to join a company account on Rooms Version 5 as an Agent.
    # @param account_id (Required) The globally unique identifier (GUID) for the account.
    # @param body  (optional parameter)
    # @return [Array<(User, Fixnum, Hash)>] User data, response status code and response headers
    def invite_classic_agent_with_http_info(account_id, body)
      if @api_client.config.debugging
        @api_client.config.logger.debug "Calling API: UsersApi.invite_classic_agent ..."
      end
      # verify the required parameter 'account_id' is set
      fail ArgumentError, "Missing the required parameter 'account_id' when calling UsersApi.invite_classic_agent" if account_id.nil?
      # resource path
      local_var_path = "/v2/accounts/{accountId}/users/invite_classic_agent".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s)

      # query parameters
      query_params = {}

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

      # form parameters
      form_params = {}

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

    # CLASSIC COMPANY ONLY. Send an invitation to join the company as a manager.
    # Invites a new user to join a company account on Rooms Version 5 as a Manager.
    # @param account_id (Required) The globally unique identifier (GUID) for the account.
    # @param body  (optional parameter)
    # @return [User]
    def invite_classic_manager(account_id, body)
      data, _status_code, _headers = invite_classic_manager_with_http_info(account_id,  body)
      return data
    end

    # CLASSIC COMPANY ONLY. Send an invitation to join the company as a manager.
    # Invites a new user to join a company account on Rooms Version 5 as a Manager.
    # @param account_id (Required) The globally unique identifier (GUID) for the account.
    # @param body  (optional parameter)
    # @return [Array<(User, Fixnum, Hash)>] User data, response status code and response headers
    def invite_classic_manager_with_http_info(account_id, body)
      if @api_client.config.debugging
        @api_client.config.logger.debug "Calling API: UsersApi.invite_classic_manager ..."
      end
      # verify the required parameter 'account_id' is set
      fail ArgumentError, "Missing the required parameter 'account_id' when calling UsersApi.invite_classic_manager" if account_id.nil?
      # resource path
      local_var_path = "/v2/accounts/{accountId}/users/invite_classic_manager".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s)

      # query parameters
      query_params = {}

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

      # form parameters
      form_params = {}

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

    # NON-CLASSIC COMPANY ONLY. Send an invitation to the user or non-user having the given email.
    # Invites a new user to join a company account on Rooms Version 6.
    # @param account_id (Required) The globally unique identifier (GUID) for the account.
    # @param body  (optional parameter)
    # @return [User]
    def invite_user(account_id, body)
      data, _status_code, _headers = invite_user_with_http_info(account_id,  body)
      return data
    end

    # NON-CLASSIC COMPANY ONLY. Send an invitation to the user or non-user having the given email.
    # Invites a new user to join a company account on Rooms Version 6.
    # @param account_id (Required) The globally unique identifier (GUID) for the account.
    # @param body  (optional parameter)
    # @return [Array<(User, Fixnum, Hash)>] User data, response status code and response headers
    def invite_user_with_http_info(account_id, body)
      if @api_client.config.debugging
        @api_client.config.logger.debug "Calling API: UsersApi.invite_user ..."
      end
      # verify the required parameter 'account_id' is set
      fail ArgumentError, "Missing the required parameter 'account_id' when calling UsersApi.invite_user" if account_id.nil?
      # resource path
      local_var_path = "/v2/accounts/{accountId}/users/invite_user".sub('{format}','json').sub('{' + 'accountId' + '}', account_id.to_s)

      # query parameters
      query_params = {}

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

      # form parameters
      form_params = {}

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

    # Locks the account of the user.
    # Locks the account of the user.
    # @param user_id User Id of the user attempting to be locked.
    # @param account_id (Required) The globally unique identifier (GUID) for the account.
    # @param body  (optional parameter)
    # @return [nil]
    def lock_user(user_id, account_id, body)
      lock_user_with_http_info(user_id, account_id,  body)
      return nil
    end

    # Locks the account of the user.
    # Locks the account of the user.
    # @param user_id User Id of the user attempting to be locked.
    # @param account_id (Required) The globally unique identifier (GUID) for the account.
    # @param body  (optional parameter)
    # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
    def lock_user_with_http_info(user_id, account_id, body)
      if @api_client.config.debugging
        @api_client.config.logger.debug "Calling API: UsersApi.lock_user ..."
      end
      # verify the required parameter 'user_id' is set
      fail ArgumentError, "Missing the required parameter 'user_id' when calling UsersApi.lock_user" if user_id.nil?
      # verify the required parameter 'account_id' is set
      fail ArgumentError, "Missing the required parameter 'account_id' when calling UsersApi.lock_user" if account_id.nil?
      # resource path
      local_var_path = "/v2/accounts/{accountId}/users/{userId}/lock".sub('{format}','json').sub('{' + 'userId' + '}', user_id.to_s).sub('{' + 'accountId' + '}', account_id.to_s)

      # query parameters
      query_params = {}

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

      # form parameters
      form_params = {}

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

    # Reinvites the pending user with the given userId.
    # Reinvites an unactivated user to join a company account. You can use this method with either Rooms Version 5 or Rooms Version 6.
    # @param user_id 
    # @param account_id (Required) The globally unique identifier (GUID) for the account.
    # @return [nil]
    def reinvite_user(user_id, account_id)
      reinvite_user_with_http_info(user_id, account_id)
      return nil
    end

    # Reinvites the pending user with the given userId.
    # Reinvites an unactivated user to join a company account. You can use this method with either Rooms Version 5 or Rooms Version 6.
    # @param user_id 
    # @param account_id (Required) The globally unique identifier (GUID) for the account.
    # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
    def reinvite_user_with_http_info(user_id, account_id)
      if @api_client.config.debugging
        @api_client.config.logger.debug "Calling API: UsersApi.reinvite_user ..."
      end
      # verify the required parameter 'user_id' is set
      fail ArgumentError, "Missing the required parameter 'user_id' when calling UsersApi.reinvite_user" if user_id.nil?
      # verify the required parameter 'account_id' is set
      fail ArgumentError, "Missing the required parameter 'account_id' when calling UsersApi.reinvite_user" if account_id.nil?
      # resource path
      local_var_path = "/v2/accounts/{accountId}/users/{userId}/reinvite".sub('{format}','json').sub('{' + 'userId' + '}', user_id.to_s).sub('{' + 'accountId' + '}', account_id.to_s)

      # query parameters
      query_params = {}

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

      # form parameters
      form_params = {}

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

    # Removes a user from the company.
    # Removes the user. Will fail if the user owns any Rooms.   The rooms will need to be transferred to other agents before removing.
    # @param user_id Id of the user you wish to remove.
    # @param account_id (Required) The globally unique identifier (GUID) for the account.
    # @return [nil]
    def remove_user(user_id, account_id)
      remove_user_with_http_info(user_id, account_id)
      return nil
    end

    # Removes a user from the company.
    # Removes the user. Will fail if the user owns any Rooms.   The rooms will need to be transferred to other agents before removing.
    # @param user_id Id of the user you wish to remove.
    # @param account_id (Required) The globally unique identifier (GUID) for the account.
    # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
    def remove_user_with_http_info(user_id, account_id)
      if @api_client.config.debugging
        @api_client.config.logger.debug "Calling API: UsersApi.remove_user ..."
      end
      # verify the required parameter 'user_id' is set
      fail ArgumentError, "Missing the required parameter 'user_id' when calling UsersApi.remove_user" if user_id.nil?
      # verify the required parameter 'account_id' is set
      fail ArgumentError, "Missing the required parameter 'account_id' when calling UsersApi.remove_user" if account_id.nil?
      # resource path
      local_var_path = "/v2/accounts/{accountId}/users/{userId}".sub('{format}','json').sub('{' + 'userId' + '}', user_id.to_s).sub('{' + 'accountId' + '}', account_id.to_s)

      # query parameters
      query_params = {}

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

      # form parameters
      form_params = {}

      # http body (model)
      post_body = nil
      auth_names = []
      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: UsersApi#remove_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
      end
      return data, status_code, headers
    end

    # Removes the user from the designated office.
    # Removes the user from the designated office.
    # @param user_id The id of the user.
    # @param account_id (Required) The globally unique identifier (GUID) for the account.
    # @param body  (optional parameter)
    # @return [nil]
    def remove_user_from_office(user_id, account_id, body)
      remove_user_from_office_with_http_info(user_id, account_id,  body)
      return nil
    end

    # Removes the user from the designated office.
    # Removes the user from the designated office.
    # @param user_id The id of the user.
    # @param account_id (Required) The globally unique identifier (GUID) for the account.
    # @param body  (optional parameter)
    # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
    def remove_user_from_office_with_http_info(user_id, account_id, body)
      if @api_client.config.debugging
        @api_client.config.logger.debug "Calling API: UsersApi.remove_user_from_office ..."
      end
      # verify the required parameter 'user_id' is set
      fail ArgumentError, "Missing the required parameter 'user_id' when calling UsersApi.remove_user_from_office" if user_id.nil?
      # verify the required parameter 'account_id' is set
      fail ArgumentError, "Missing the required parameter 'account_id' when calling UsersApi.remove_user_from_office" if account_id.nil?
      # resource path
      local_var_path = "/v2/accounts/{accountId}/users/{userId}/remove_from_office".sub('{format}','json').sub('{' + 'userId' + '}', user_id.to_s).sub('{' + 'accountId' + '}', account_id.to_s)

      # query parameters
      query_params = {}

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

      # form parameters
      form_params = {}

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

    # Removes the user from the designated region.
    # Removes the user from the designated region.
    # @param user_id The id of the user.
    # @param account_id (Required) The globally unique identifier (GUID) for the account.
    # @param body  (optional parameter)
    # @return [nil]
    def remove_user_from_region(user_id, account_id, body)
      remove_user_from_region_with_http_info(user_id, account_id,  body)
      return nil
    end

    # Removes the user from the designated region.
    # Removes the user from the designated region.
    # @param user_id The id of the user.
    # @param account_id (Required) The globally unique identifier (GUID) for the account.
    # @param body  (optional parameter)
    # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
    def remove_user_from_region_with_http_info(user_id, account_id, body)
      if @api_client.config.debugging
        @api_client.config.logger.debug "Calling API: UsersApi.remove_user_from_region ..."
      end
      # verify the required parameter 'user_id' is set
      fail ArgumentError, "Missing the required parameter 'user_id' when calling UsersApi.remove_user_from_region" if user_id.nil?
      # verify the required parameter 'account_id' is set
      fail ArgumentError, "Missing the required parameter 'account_id' when calling UsersApi.remove_user_from_region" if account_id.nil?
      # resource path
      local_var_path = "/v2/accounts/{accountId}/users/{userId}/remove_from_region".sub('{format}','json').sub('{' + 'userId' + '}', user_id.to_s).sub('{' + 'accountId' + '}', account_id.to_s)

      # query parameters
      query_params = {}

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

      # form parameters
      form_params = {}

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

    # Unlocks the account of the user.
    # Unlocks the account of the user.
    # @param user_id User Id of the user attempting to be unlocked.
    # @param account_id (Required) The globally unique identifier (GUID) for the account.
    # @return [nil]
    def unlock_user(user_id, account_id)
      unlock_user_with_http_info(user_id, account_id)
      return nil
    end

    # Unlocks the account of the user.
    # Unlocks the account of the user.
    # @param user_id User Id of the user attempting to be unlocked.
    # @param account_id (Required) The globally unique identifier (GUID) for the account.
    # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
    def unlock_user_with_http_info(user_id, account_id)
      if @api_client.config.debugging
        @api_client.config.logger.debug "Calling API: UsersApi.unlock_user ..."
      end
      # verify the required parameter 'user_id' is set
      fail ArgumentError, "Missing the required parameter 'user_id' when calling UsersApi.unlock_user" if user_id.nil?
      # verify the required parameter 'account_id' is set
      fail ArgumentError, "Missing the required parameter 'account_id' when calling UsersApi.unlock_user" if account_id.nil?
      # resource path
      local_var_path = "/v2/accounts/{accountId}/users/{userId}/unlock".sub('{format}','json').sub('{' + 'userId' + '}', user_id.to_s).sub('{' + 'accountId' + '}', account_id.to_s)

      # query parameters
      query_params = {}

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

      # form parameters
      form_params = {}

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

    # Updates user information
    # Updates user information
    # @param user_id The id of the user.
    # @param account_id (Required) The globally unique identifier (GUID) for the account.
    # @param body  (optional parameter)
    # @return [User]
    def update_user(user_id, account_id, body)
      data, _status_code, _headers = update_user_with_http_info(user_id, account_id,  body)
      return data
    end

    # Updates user information
    # Updates user information
    # @param user_id The id of the user.
    # @param account_id (Required) The globally unique identifier (GUID) for the account.
    # @param body  (optional parameter)
    # @return [Array<(User, Fixnum, Hash)>] User data, response status code and response headers
    def update_user_with_http_info(user_id, account_id, body)
      if @api_client.config.debugging
        @api_client.config.logger.debug "Calling API: UsersApi.update_user ..."
      end
      # verify the required parameter 'user_id' is set
      fail ArgumentError, "Missing the required parameter 'user_id' when calling UsersApi.update_user" if user_id.nil?
      # verify the required parameter 'account_id' is set
      fail ArgumentError, "Missing the required parameter 'account_id' when calling UsersApi.update_user" if account_id.nil?
      # resource path
      local_var_path = "/v2/accounts/{accountId}/users/{userId}".sub('{format}','json').sub('{' + 'userId' + '}', user_id.to_s).sub('{' + 'accountId' + '}', account_id.to_s)

      # query parameters
      query_params = {}

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

      # form parameters
      form_params = {}

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