=begin PureCloud Platform API With the PureCloud Platform API, you can control all aspects of your PureCloud environment. With the APIs you can access the system configuration, manage conversations and more. OpenAPI spec version: v2 Contact: DeveloperEvangelists@genesys.com Generated by: https://github.com/swagger-api/swagger-codegen.git License: ININ http://www.inin.com Terms of Service: https://developer.mypurecloud.com/tos =end require "uri" module PureCloud class UsersApi attr_accessor :api_client def initialize(api_client = ApiClient.default) @api_client = api_client end # Delete user # # @param user_id User ID # @param [Hash] opts the optional parameters # @return [Empty] def delete_user(user_id, opts = {}) data, _status_code, _headers = delete_user_with_http_info(user_id, opts) return data end # Delete user # # @param user_id User ID # @param [Hash] opts the optional parameters # @return [Array<(Empty, Fixnum, Hash)>] Empty data, response status code and response headers def delete_user_with_http_info(user_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi.delete_user ..." end # verify the required parameter 'user_id' is set fail ArgumentError, "Missing the required parameter 'user_id' when calling UsersApi.delete_user" if user_id.nil? # resource path local_var_path = "/api/v2/users/{userId}".sub('{format}','json').sub('{' + 'userId' + '}', user_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud Auth'] 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, :return_type => 'Empty') if @api_client.config.debugging @api_client.config.logger.debug "API called: UsersApi#delete_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Removes all the roles from the user. # # @param user_id User ID # @param [Hash] opts the optional parameters # @return [nil] def delete_user_roles(user_id, opts = {}) delete_user_roles_with_http_info(user_id, opts) return nil end # Removes all the roles from the user. # # @param user_id User ID # @param [Hash] opts the optional parameters # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers def delete_user_roles_with_http_info(user_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi.delete_user_roles ..." end # verify the required parameter 'user_id' is set fail ArgumentError, "Missing the required parameter 'user_id' when calling UsersApi.delete_user_roles" if user_id.nil? # resource path local_var_path = "/api/v2/users/{userId}/roles".sub('{format}','json').sub('{' + 'userId' + '}', user_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud Auth'] 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#delete_user_roles\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Remove routing skill from user # # @param user_id User ID # @param skill_id skillId # @param [Hash] opts the optional parameters # @return [nil] def delete_user_routingskill(user_id, skill_id, opts = {}) delete_user_routingskill_with_http_info(user_id, skill_id, opts) return nil end # Remove routing skill from user # # @param user_id User ID # @param skill_id skillId # @param [Hash] opts the optional parameters # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers def delete_user_routingskill_with_http_info(user_id, skill_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi.delete_user_routingskill ..." end # verify the required parameter 'user_id' is set fail ArgumentError, "Missing the required parameter 'user_id' when calling UsersApi.delete_user_routingskill" if user_id.nil? # verify the required parameter 'skill_id' is set fail ArgumentError, "Missing the required parameter 'skill_id' when calling UsersApi.delete_user_routingskill" if skill_id.nil? # resource path local_var_path = "/api/v2/users/{userId}/routingskills/{skillId}".sub('{format}','json').sub('{' + 'userId' + '}', user_id.to_s).sub('{' + 'skillId' + '}', skill_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud Auth'] 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#delete_user_routingskill\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Clear associated station # # @param user_id User ID # @param [Hash] opts the optional parameters # @return [nil] def delete_user_station_associatedstation(user_id, opts = {}) delete_user_station_associatedstation_with_http_info(user_id, opts) return nil end # Clear associated station # # @param user_id User ID # @param [Hash] opts the optional parameters # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers def delete_user_station_associatedstation_with_http_info(user_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi.delete_user_station_associatedstation ..." end # verify the required parameter 'user_id' is set fail ArgumentError, "Missing the required parameter 'user_id' when calling UsersApi.delete_user_station_associatedstation" if user_id.nil? # resource path local_var_path = "/api/v2/users/{userId}/station/associatedstation".sub('{format}','json').sub('{' + 'userId' + '}', user_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud Auth'] 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#delete_user_station_associatedstation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Clear default station # # @param user_id User ID # @param [Hash] opts the optional parameters # @return [nil] def delete_user_station_defaultstation(user_id, opts = {}) delete_user_station_defaultstation_with_http_info(user_id, opts) return nil end # Clear default station # # @param user_id User ID # @param [Hash] opts the optional parameters # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers def delete_user_station_defaultstation_with_http_info(user_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi.delete_user_station_defaultstation ..." end # verify the required parameter 'user_id' is set fail ArgumentError, "Missing the required parameter 'user_id' when calling UsersApi.delete_user_station_defaultstation" if user_id.nil? # resource path local_var_path = "/api/v2/users/{userId}/station/defaultstation".sub('{format}','json').sub('{' + 'userId' + '}', user_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud Auth'] 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#delete_user_station_defaultstation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Fetch field config for an entity type # # @param type Field type # @param [Hash] opts the optional parameters # @return [FieldConfig] def get_fieldconfig(type, opts = {}) data, _status_code, _headers = get_fieldconfig_with_http_info(type, opts) return data end # Fetch field config for an entity type # # @param type Field type # @param [Hash] opts the optional parameters # @return [Array<(FieldConfig, Fixnum, Hash)>] FieldConfig data, response status code and response headers def get_fieldconfig_with_http_info(type, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi.get_fieldconfig ..." end # verify the required parameter 'type' is set fail ArgumentError, "Missing the required parameter 'type' when calling UsersApi.get_fieldconfig" if type.nil? # verify enum value unless ['person', 'group', 'org', 'externalContact'].include?(type) fail ArgumentError, "invalid value for 'type', must be one of person, group, org, externalContact" end # resource path local_var_path = "/api/v2/fieldconfig".sub('{format}','json') # query parameters query_params = {} query_params[:'type'] = type # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud Auth'] 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 => 'FieldConfig') if @api_client.config.debugging @api_client.config.logger.debug "API called: UsersApi#get_fieldconfig\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get user. # # @param user_id User ID # @param [Hash] opts the optional parameters # @option opts [Array] :expand Which fields, if any, to expand # @option opts [String] :state Search for a user with this state (default to active) # @return [User] def get_user(user_id, opts = {}) data, _status_code, _headers = get_user_with_http_info(user_id, opts) return data end # Get user. # # @param user_id User ID # @param [Hash] opts the optional parameters # @option opts [Array] :expand Which fields, if any, to expand # @option opts [String] :state Search for a user with this state # @return [Array<(User, Fixnum, Hash)>] User data, response status code and response headers def get_user_with_http_info(user_id, opts = {}) 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? if opts[:'state'] && !['active', 'deleted'].include?(opts[:'state']) fail ArgumentError, 'invalid value for "state", must be one of active, deleted' end # resource path local_var_path = "/api/v2/users/{userId}".sub('{format}','json').sub('{' + 'userId' + '}', user_id.to_s) # query parameters query_params = {} query_params[:'expand'] = @api_client.build_collection_param(opts[:'expand'], :multi) if opts[:'expand'] query_params[:'state'] = opts[:'state'] if opts[:'state'] # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud Auth'] 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 # Get adjacents # # @param user_id User ID # @param [Hash] opts the optional parameters # @option opts [Array] :expand Which fields, if any, to expand # @return [Adjacents] def get_user_adjacents(user_id, opts = {}) data, _status_code, _headers = get_user_adjacents_with_http_info(user_id, opts) return data end # Get adjacents # # @param user_id User ID # @param [Hash] opts the optional parameters # @option opts [Array] :expand Which fields, if any, to expand # @return [Array<(Adjacents, Fixnum, Hash)>] Adjacents data, response status code and response headers def get_user_adjacents_with_http_info(user_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi.get_user_adjacents ..." end # verify the required parameter 'user_id' is set fail ArgumentError, "Missing the required parameter 'user_id' when calling UsersApi.get_user_adjacents" if user_id.nil? # resource path local_var_path = "/api/v2/users/{userId}/adjacents".sub('{format}','json').sub('{' + 'userId' + '}', user_id.to_s) # query parameters query_params = {} query_params[:'expand'] = @api_client.build_collection_param(opts[:'expand'], :multi) if opts[:'expand'] # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud Auth'] 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 => 'Adjacents') if @api_client.config.debugging @api_client.config.logger.debug "API called: UsersApi#get_user_adjacents\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get a user's CallForwarding # # @param user_id User ID # @param [Hash] opts the optional parameters # @return [CallForwarding] def get_user_callforwarding(user_id, opts = {}) data, _status_code, _headers = get_user_callforwarding_with_http_info(user_id, opts) return data end # Get a user's CallForwarding # # @param user_id User ID # @param [Hash] opts the optional parameters # @return [Array<(CallForwarding, Fixnum, Hash)>] CallForwarding data, response status code and response headers def get_user_callforwarding_with_http_info(user_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi.get_user_callforwarding ..." end # verify the required parameter 'user_id' is set fail ArgumentError, "Missing the required parameter 'user_id' when calling UsersApi.get_user_callforwarding" if user_id.nil? # resource path local_var_path = "/api/v2/users/{userId}/callforwarding".sub('{format}','json').sub('{' + 'userId' + '}', user_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud Auth'] 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 => 'CallForwarding') if @api_client.config.debugging @api_client.config.logger.debug "API called: UsersApi#get_user_callforwarding\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get direct reports # # @param user_id User ID # @param [Hash] opts the optional parameters # @option opts [Array] :expand Which fields, if any, to expand # @return [Array] def get_user_directreports(user_id, opts = {}) data, _status_code, _headers = get_user_directreports_with_http_info(user_id, opts) return data end # Get direct reports # # @param user_id User ID # @param [Hash] opts the optional parameters # @option opts [Array] :expand Which fields, if any, to expand # @return [Array<(Array, Fixnum, Hash)>] Array data, response status code and response headers def get_user_directreports_with_http_info(user_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi.get_user_directreports ..." end # verify the required parameter 'user_id' is set fail ArgumentError, "Missing the required parameter 'user_id' when calling UsersApi.get_user_directreports" if user_id.nil? # resource path local_var_path = "/api/v2/users/{userId}/directreports".sub('{format}','json').sub('{' + 'userId' + '}', user_id.to_s) # query parameters query_params = {} query_params[:'expand'] = @api_client.build_collection_param(opts[:'expand'], :multi) if opts[:'expand'] # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud Auth'] 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 => 'Array') if @api_client.config.debugging @api_client.config.logger.debug "API called: UsersApi#get_user_directreports\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get favorites # # @param user_id User ID # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size Page size (default to 25) # @option opts [Integer] :page_number Page number (default to 1) # @option opts [String] :sort_order Sort order (default to ASC) # @option opts [Array] :expand Which fields, if any, to expand # @return [UserEntityListing] def get_user_favorites(user_id, opts = {}) data, _status_code, _headers = get_user_favorites_with_http_info(user_id, opts) return data end # Get favorites # # @param user_id User ID # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size Page size # @option opts [Integer] :page_number Page number # @option opts [String] :sort_order Sort order # @option opts [Array] :expand Which fields, if any, to expand # @return [Array<(UserEntityListing, Fixnum, Hash)>] UserEntityListing data, response status code and response headers def get_user_favorites_with_http_info(user_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi.get_user_favorites ..." end # verify the required parameter 'user_id' is set fail ArgumentError, "Missing the required parameter 'user_id' when calling UsersApi.get_user_favorites" if user_id.nil? # resource path local_var_path = "/api/v2/users/{userId}/favorites".sub('{format}','json').sub('{' + 'userId' + '}', user_id.to_s) # query parameters query_params = {} query_params[:'pageSize'] = opts[:'page_size'] if opts[:'page_size'] query_params[:'pageNumber'] = opts[:'page_number'] if opts[:'page_number'] query_params[:'sortOrder'] = opts[:'sort_order'] if opts[:'sort_order'] query_params[:'expand'] = @api_client.build_collection_param(opts[:'expand'], :multi) if opts[:'expand'] # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud Auth'] 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 => 'UserEntityListing') if @api_client.config.debugging @api_client.config.logger.debug "API called: UsersApi#get_user_favorites\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get a user's Geolocation # # @param user_id user Id # @param client_id client Id # @param [Hash] opts the optional parameters # @return [Geolocation] def get_user_geolocation(user_id, client_id, opts = {}) data, _status_code, _headers = get_user_geolocation_with_http_info(user_id, client_id, opts) return data end # Get a user's Geolocation # # @param user_id user Id # @param client_id client Id # @param [Hash] opts the optional parameters # @return [Array<(Geolocation, Fixnum, Hash)>] Geolocation data, response status code and response headers def get_user_geolocation_with_http_info(user_id, client_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi.get_user_geolocation ..." end # verify the required parameter 'user_id' is set fail ArgumentError, "Missing the required parameter 'user_id' when calling UsersApi.get_user_geolocation" if user_id.nil? # verify the required parameter 'client_id' is set fail ArgumentError, "Missing the required parameter 'client_id' when calling UsersApi.get_user_geolocation" if client_id.nil? # resource path local_var_path = "/api/v2/users/{userId}/geolocations/{clientId}".sub('{format}','json').sub('{' + 'userId' + '}', user_id.to_s).sub('{' + 'clientId' + '}', client_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud Auth'] 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 => 'Geolocation') if @api_client.config.debugging @api_client.config.logger.debug "API called: UsersApi#get_user_geolocation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get a OutOfOffice # # @param user_id User ID # @param [Hash] opts the optional parameters # @return [OutOfOffice] def get_user_outofoffice(user_id, opts = {}) data, _status_code, _headers = get_user_outofoffice_with_http_info(user_id, opts) return data end # Get a OutOfOffice # # @param user_id User ID # @param [Hash] opts the optional parameters # @return [Array<(OutOfOffice, Fixnum, Hash)>] OutOfOffice data, response status code and response headers def get_user_outofoffice_with_http_info(user_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi.get_user_outofoffice ..." end # verify the required parameter 'user_id' is set fail ArgumentError, "Missing the required parameter 'user_id' when calling UsersApi.get_user_outofoffice" if user_id.nil? # resource path local_var_path = "/api/v2/users/{userId}/outofoffice".sub('{format}','json').sub('{' + 'userId' + '}', user_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud Auth'] 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 => 'OutOfOffice') if @api_client.config.debugging @api_client.config.logger.debug "API called: UsersApi#get_user_outofoffice\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # List profile skills for a user # # @param user_id User ID # @param [Hash] opts the optional parameters # @return [Array] def get_user_profileskills(user_id, opts = {}) data, _status_code, _headers = get_user_profileskills_with_http_info(user_id, opts) return data end # List profile skills for a user # # @param user_id User ID # @param [Hash] opts the optional parameters # @return [Array<(Array, Fixnum, Hash)>] Array data, response status code and response headers def get_user_profileskills_with_http_info(user_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi.get_user_profileskills ..." end # verify the required parameter 'user_id' is set fail ArgumentError, "Missing the required parameter 'user_id' when calling UsersApi.get_user_profileskills" if user_id.nil? # resource path local_var_path = "/api/v2/users/{userId}/profileskills".sub('{format}','json').sub('{' + 'userId' + '}', user_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud Auth'] 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 => 'Array') if @api_client.config.debugging @api_client.config.logger.debug "API called: UsersApi#get_user_profileskills\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get queues for user # # @param user_id User ID # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size Page size (default to 25) # @option opts [Integer] :page_number Page number (default to 1) # @option opts [BOOLEAN] :joined Is joined to the queue (default to true) # @return [UserQueueEntityListing] def get_user_queues(user_id, opts = {}) data, _status_code, _headers = get_user_queues_with_http_info(user_id, opts) return data end # Get queues for user # # @param user_id User ID # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size Page size # @option opts [Integer] :page_number Page number # @option opts [BOOLEAN] :joined Is joined to the queue # @return [Array<(UserQueueEntityListing, Fixnum, Hash)>] UserQueueEntityListing data, response status code and response headers def get_user_queues_with_http_info(user_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi.get_user_queues ..." end # verify the required parameter 'user_id' is set fail ArgumentError, "Missing the required parameter 'user_id' when calling UsersApi.get_user_queues" if user_id.nil? # resource path local_var_path = "/api/v2/users/{userId}/queues".sub('{format}','json').sub('{' + 'userId' + '}', user_id.to_s) # query parameters query_params = {} query_params[:'pageSize'] = opts[:'page_size'] if opts[:'page_size'] query_params[:'pageNumber'] = opts[:'page_number'] if opts[:'page_number'] query_params[:'joined'] = opts[:'joined'] if opts[:'joined'] # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud Auth'] 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 => 'UserQueueEntityListing') if @api_client.config.debugging @api_client.config.logger.debug "API called: UsersApi#get_user_queues\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Returns a listing of roles and permissions for a user. # # @param user_id User ID # @param [Hash] opts the optional parameters # @return [UserAuthorization] def get_user_roles(user_id, opts = {}) data, _status_code, _headers = get_user_roles_with_http_info(user_id, opts) return data end # Returns a listing of roles and permissions for a user. # # @param user_id User ID # @param [Hash] opts the optional parameters # @return [Array<(UserAuthorization, Fixnum, Hash)>] UserAuthorization data, response status code and response headers def get_user_roles_with_http_info(user_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi.get_user_roles ..." end # verify the required parameter 'user_id' is set fail ArgumentError, "Missing the required parameter 'user_id' when calling UsersApi.get_user_roles" if user_id.nil? # resource path local_var_path = "/api/v2/users/{userId}/roles".sub('{format}','json').sub('{' + 'userId' + '}', user_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud Auth'] 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 => 'UserAuthorization') if @api_client.config.debugging @api_client.config.logger.debug "API called: UsersApi#get_user_roles\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # List routing skills for user # # @param user_id User ID # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size Page size (default to 25) # @option opts [Integer] :page_number Page number (default to 1) # @option opts [String] :sort_order Ascending or descending sort order (default to ASC) # @return [UserSkillEntityListing] def get_user_routingskills(user_id, opts = {}) data, _status_code, _headers = get_user_routingskills_with_http_info(user_id, opts) return data end # List routing skills for user # # @param user_id User ID # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size Page size # @option opts [Integer] :page_number Page number # @option opts [String] :sort_order Ascending or descending sort order # @return [Array<(UserSkillEntityListing, Fixnum, Hash)>] UserSkillEntityListing data, response status code and response headers def get_user_routingskills_with_http_info(user_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi.get_user_routingskills ..." end # verify the required parameter 'user_id' is set fail ArgumentError, "Missing the required parameter 'user_id' when calling UsersApi.get_user_routingskills" if user_id.nil? if opts[:'sort_order'] && !['ascending', 'descending'].include?(opts[:'sort_order']) fail ArgumentError, 'invalid value for "sort_order", must be one of ascending, descending' end # resource path local_var_path = "/api/v2/users/{userId}/routingskills".sub('{format}','json').sub('{' + 'userId' + '}', user_id.to_s) # query parameters query_params = {} query_params[:'pageSize'] = opts[:'page_size'] if opts[:'page_size'] query_params[:'pageNumber'] = opts[:'page_number'] if opts[:'page_number'] query_params[:'sortOrder'] = opts[:'sort_order'] if opts[:'sort_order'] # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud Auth'] 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 => 'UserSkillEntityListing') if @api_client.config.debugging @api_client.config.logger.debug "API called: UsersApi#get_user_routingskills\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Fetch the routing status of a user # # @param user_id User ID # @param [Hash] opts the optional parameters # @return [RoutingStatus] def get_user_routingstatus(user_id, opts = {}) data, _status_code, _headers = get_user_routingstatus_with_http_info(user_id, opts) return data end # Fetch the routing status of a user # # @param user_id User ID # @param [Hash] opts the optional parameters # @return [Array<(RoutingStatus, Fixnum, Hash)>] RoutingStatus data, response status code and response headers def get_user_routingstatus_with_http_info(user_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi.get_user_routingstatus ..." end # verify the required parameter 'user_id' is set fail ArgumentError, "Missing the required parameter 'user_id' when calling UsersApi.get_user_routingstatus" if user_id.nil? # resource path local_var_path = "/api/v2/users/{userId}/routingstatus".sub('{format}','json').sub('{' + 'userId' + '}', user_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud Auth'] 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 => 'RoutingStatus') if @api_client.config.debugging @api_client.config.logger.debug "API called: UsersApi#get_user_routingstatus\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get station information for user # # @param user_id User ID # @param [Hash] opts the optional parameters # @return [UserStations] def get_user_station(user_id, opts = {}) data, _status_code, _headers = get_user_station_with_http_info(user_id, opts) return data end # Get station information for user # # @param user_id User ID # @param [Hash] opts the optional parameters # @return [Array<(UserStations, Fixnum, Hash)>] UserStations data, response status code and response headers def get_user_station_with_http_info(user_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi.get_user_station ..." end # verify the required parameter 'user_id' is set fail ArgumentError, "Missing the required parameter 'user_id' when calling UsersApi.get_user_station" if user_id.nil? # resource path local_var_path = "/api/v2/users/{userId}/station".sub('{format}','json').sub('{' + 'userId' + '}', user_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud Auth'] 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 => 'UserStations') if @api_client.config.debugging @api_client.config.logger.debug "API called: UsersApi#get_user_station\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get superiors # # @param user_id User ID # @param [Hash] opts the optional parameters # @option opts [Array] :expand Which fields, if any, to expand # @return [Array] def get_user_superiors(user_id, opts = {}) data, _status_code, _headers = get_user_superiors_with_http_info(user_id, opts) return data end # Get superiors # # @param user_id User ID # @param [Hash] opts the optional parameters # @option opts [Array] :expand Which fields, if any, to expand # @return [Array<(Array, Fixnum, Hash)>] Array data, response status code and response headers def get_user_superiors_with_http_info(user_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi.get_user_superiors ..." end # verify the required parameter 'user_id' is set fail ArgumentError, "Missing the required parameter 'user_id' when calling UsersApi.get_user_superiors" if user_id.nil? # resource path local_var_path = "/api/v2/users/{userId}/superiors".sub('{format}','json').sub('{' + 'userId' + '}', user_id.to_s) # query parameters query_params = {} query_params[:'expand'] = @api_client.build_collection_param(opts[:'expand'], :multi) if opts[:'expand'] # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud Auth'] 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 => 'Array') if @api_client.config.debugging @api_client.config.logger.debug "API called: UsersApi#get_user_superiors\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get the list of available users. # # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size Page size (default to 25) # @option opts [Integer] :page_number Page number (default to 1) # @option opts [Array] :id id # @option opts [String] :sort_order Ascending or descending sort order (default to ASC) # @option opts [Array] :expand Which fields, if any, to expand # @option opts [String] :state Only list users of this state (default to active) # @return [UserEntityListing] def get_users(opts = {}) data, _status_code, _headers = get_users_with_http_info(opts) return data end # Get the list of available users. # # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size Page size # @option opts [Integer] :page_number Page number # @option opts [Array] :id id # @option opts [String] :sort_order Ascending or descending sort order # @option opts [Array] :expand Which fields, if any, to expand # @option opts [String] :state Only list users of this state # @return [Array<(UserEntityListing, Fixnum, Hash)>] UserEntityListing data, response status code and response headers def get_users_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi.get_users ..." end if opts[:'sort_order'] && !['ascending', 'descending'].include?(opts[:'sort_order']) fail ArgumentError, 'invalid value for "sort_order", must be one of ascending, descending' end if opts[:'state'] && !['active', 'deleted'].include?(opts[:'state']) fail ArgumentError, 'invalid value for "state", must be one of active, deleted' end # resource path local_var_path = "/api/v2/users".sub('{format}','json') # query parameters query_params = {} query_params[:'pageSize'] = opts[:'page_size'] if opts[:'page_size'] query_params[:'pageNumber'] = opts[:'page_number'] if opts[:'page_number'] query_params[:'id'] = @api_client.build_collection_param(opts[:'id'], :multi) if opts[:'id'] query_params[:'sortOrder'] = opts[:'sort_order'] if opts[:'sort_order'] query_params[:'expand'] = @api_client.build_collection_param(opts[:'expand'], :multi) if opts[:'expand'] query_params[:'state'] = opts[:'state'] if opts[:'state'] # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud Auth'] 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 => 'UserEntityListing') 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 # Get current user details. # This request is not valid when using the Client Credentials OAuth grant. # @param [Hash] opts the optional parameters # @option opts [Array] :expand Which fields, if any, to expand. # @return [UserMe] def get_users_me(opts = {}) data, _status_code, _headers = get_users_me_with_http_info(opts) return data end # Get current user details. # This request is not valid when using the Client Credentials OAuth grant. # @param [Hash] opts the optional parameters # @option opts [Array] :expand Which fields, if any, to expand. # @return [Array<(UserMe, Fixnum, Hash)>] UserMe data, response status code and response headers def get_users_me_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi.get_users_me ..." end # resource path local_var_path = "/api/v2/users/me".sub('{format}','json') # query parameters query_params = {} query_params[:'expand'] = @api_client.build_collection_param(opts[:'expand'], :multi) if opts[:'expand'] # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud Auth'] 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 => 'UserMe') if @api_client.config.debugging @api_client.config.logger.debug "API called: UsersApi#get_users_me\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Search users using the q64 value returned from a previous search # # @param q64 q64 # @param [Hash] opts the optional parameters # @option opts [Array] :expand expand # @return [UsersSearchResponse] def get_users_search(q64, opts = {}) data, _status_code, _headers = get_users_search_with_http_info(q64, opts) return data end # Search users using the q64 value returned from a previous search # # @param q64 q64 # @param [Hash] opts the optional parameters # @option opts [Array] :expand expand # @return [Array<(UsersSearchResponse, Fixnum, Hash)>] UsersSearchResponse data, response status code and response headers def get_users_search_with_http_info(q64, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi.get_users_search ..." end # verify the required parameter 'q64' is set fail ArgumentError, "Missing the required parameter 'q64' when calling UsersApi.get_users_search" if q64.nil? # resource path local_var_path = "/api/v2/users/search".sub('{format}','json') # query parameters query_params = {} query_params[:'q64'] = q64 query_params[:'expand'] = @api_client.build_collection_param(opts[:'expand'], :multi) if opts[:'expand'] # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud Auth'] 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 => 'UsersSearchResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: UsersApi#get_users_search\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Update user # # @param user_id User ID # @param body User # @param [Hash] opts the optional parameters # @return [User] def patch_user(user_id, body, opts = {}) data, _status_code, _headers = patch_user_with_http_info(user_id, body, opts) return data end # Update user # # @param user_id User ID # @param body User # @param [Hash] opts the optional parameters # @return [Array<(User, Fixnum, Hash)>] User data, response status code and response headers def patch_user_with_http_info(user_id, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi.patch_user ..." end # verify the required parameter 'user_id' is set fail ArgumentError, "Missing the required parameter 'user_id' when calling UsersApi.patch_user" if user_id.nil? # verify the required parameter 'body' is set fail ArgumentError, "Missing the required parameter 'body' when calling UsersApi.patch_user" if body.nil? # resource path local_var_path = "/api/v2/users/{userId}".sub('{format}','json').sub('{' + 'userId' + '}', user_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(body) auth_names = ['PureCloud Auth'] data, status_code, headers = @api_client.call_api(:PATCH, 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#patch_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Patch a user's CallForwarding # # @param user_id User ID # @param body Call forwarding # @param [Hash] opts the optional parameters # @return [CallForwarding] def patch_user_callforwarding(user_id, body, opts = {}) data, _status_code, _headers = patch_user_callforwarding_with_http_info(user_id, body, opts) return data end # Patch a user's CallForwarding # # @param user_id User ID # @param body Call forwarding # @param [Hash] opts the optional parameters # @return [Array<(CallForwarding, Fixnum, Hash)>] CallForwarding data, response status code and response headers def patch_user_callforwarding_with_http_info(user_id, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi.patch_user_callforwarding ..." end # verify the required parameter 'user_id' is set fail ArgumentError, "Missing the required parameter 'user_id' when calling UsersApi.patch_user_callforwarding" if user_id.nil? # verify the required parameter 'body' is set fail ArgumentError, "Missing the required parameter 'body' when calling UsersApi.patch_user_callforwarding" if body.nil? # resource path local_var_path = "/api/v2/users/{userId}/callforwarding".sub('{format}','json').sub('{' + 'userId' + '}', user_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(body) auth_names = ['PureCloud Auth'] data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'CallForwarding') if @api_client.config.debugging @api_client.config.logger.debug "API called: UsersApi#patch_user_callforwarding\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Patch a user's Geolocation # The geolocation object can be patched one of three ways. Option 1: Set the 'primary' property to true. This will set the client as the user's primary geolocation source. Option 2: Provide the 'latitude' and 'longitude' values. This will enqueue an asynchronous update of the 'city', 'region', and 'country', generating a notification. A subsequent GET operation will include the new values for 'city', 'region' and 'country'. Option 3: Provide the 'city', 'region', 'country' values. Option 1 can be combined with Option 2 or Option 3. For example, update the client as primary and provide latitude and longitude values. # @param user_id user Id # @param client_id client Id # @param body Geolocation # @param [Hash] opts the optional parameters # @return [Geolocation] def patch_user_geolocation(user_id, client_id, body, opts = {}) data, _status_code, _headers = patch_user_geolocation_with_http_info(user_id, client_id, body, opts) return data end # Patch a user's Geolocation # The geolocation object can be patched one of three ways. Option 1: Set the 'primary' property to true. This will set the client as the user's primary geolocation source. Option 2: Provide the 'latitude' and 'longitude' values. This will enqueue an asynchronous update of the 'city', 'region', and 'country', generating a notification. A subsequent GET operation will include the new values for 'city', 'region' and 'country'. Option 3: Provide the 'city', 'region', 'country' values. Option 1 can be combined with Option 2 or Option 3. For example, update the client as primary and provide latitude and longitude values. # @param user_id user Id # @param client_id client Id # @param body Geolocation # @param [Hash] opts the optional parameters # @return [Array<(Geolocation, Fixnum, Hash)>] Geolocation data, response status code and response headers def patch_user_geolocation_with_http_info(user_id, client_id, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi.patch_user_geolocation ..." end # verify the required parameter 'user_id' is set fail ArgumentError, "Missing the required parameter 'user_id' when calling UsersApi.patch_user_geolocation" if user_id.nil? # verify the required parameter 'client_id' is set fail ArgumentError, "Missing the required parameter 'client_id' when calling UsersApi.patch_user_geolocation" if client_id.nil? # verify the required parameter 'body' is set fail ArgumentError, "Missing the required parameter 'body' when calling UsersApi.patch_user_geolocation" if body.nil? # resource path local_var_path = "/api/v2/users/{userId}/geolocations/{clientId}".sub('{format}','json').sub('{' + 'userId' + '}', user_id.to_s).sub('{' + 'clientId' + '}', client_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(body) auth_names = ['PureCloud Auth'] data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'Geolocation') if @api_client.config.debugging @api_client.config.logger.debug "API called: UsersApi#patch_user_geolocation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Join or unjoin a queue for a user # # @param queue_id Queue ID # @param user_id User ID # @param body Queue Member # @param [Hash] opts the optional parameters # @return [UserQueue] def patch_user_queue(queue_id, user_id, body, opts = {}) data, _status_code, _headers = patch_user_queue_with_http_info(queue_id, user_id, body, opts) return data end # Join or unjoin a queue for a user # # @param queue_id Queue ID # @param user_id User ID # @param body Queue Member # @param [Hash] opts the optional parameters # @return [Array<(UserQueue, Fixnum, Hash)>] UserQueue data, response status code and response headers def patch_user_queue_with_http_info(queue_id, user_id, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi.patch_user_queue ..." end # verify the required parameter 'queue_id' is set fail ArgumentError, "Missing the required parameter 'queue_id' when calling UsersApi.patch_user_queue" if queue_id.nil? # verify the required parameter 'user_id' is set fail ArgumentError, "Missing the required parameter 'user_id' when calling UsersApi.patch_user_queue" if user_id.nil? # verify the required parameter 'body' is set fail ArgumentError, "Missing the required parameter 'body' when calling UsersApi.patch_user_queue" if body.nil? # resource path local_var_path = "/api/v2/users/{userId}/queues/{queueId}".sub('{format}','json').sub('{' + 'queueId' + '}', queue_id.to_s).sub('{' + 'userId' + '}', user_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(body) auth_names = ['PureCloud Auth'] data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'UserQueue') if @api_client.config.debugging @api_client.config.logger.debug "API called: UsersApi#patch_user_queue\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Join or unjoin a set of queues for a user # # @param user_id User ID # @param body User Queues # @param [Hash] opts the optional parameters # @return [UserQueueEntityListing] def patch_user_queues(user_id, body, opts = {}) data, _status_code, _headers = patch_user_queues_with_http_info(user_id, body, opts) return data end # Join or unjoin a set of queues for a user # # @param user_id User ID # @param body User Queues # @param [Hash] opts the optional parameters # @return [Array<(UserQueueEntityListing, Fixnum, Hash)>] UserQueueEntityListing data, response status code and response headers def patch_user_queues_with_http_info(user_id, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi.patch_user_queues ..." end # verify the required parameter 'user_id' is set fail ArgumentError, "Missing the required parameter 'user_id' when calling UsersApi.patch_user_queues" if user_id.nil? # verify the required parameter 'body' is set fail ArgumentError, "Missing the required parameter 'body' when calling UsersApi.patch_user_queues" if body.nil? # resource path local_var_path = "/api/v2/users/{userId}/queues".sub('{format}','json').sub('{' + 'userId' + '}', user_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(body) auth_names = ['PureCloud Auth'] data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'UserQueueEntityListing') if @api_client.config.debugging @api_client.config.logger.debug "API called: UsersApi#patch_user_queues\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Query for user aggregates # # @param body query # @param [Hash] opts the optional parameters # @return [PresenceQueryResponse] def post_analytics_users_aggregates_query(body, opts = {}) data, _status_code, _headers = post_analytics_users_aggregates_query_with_http_info(body, opts) return data end # Query for user aggregates # # @param body query # @param [Hash] opts the optional parameters # @return [Array<(PresenceQueryResponse, Fixnum, Hash)>] PresenceQueryResponse data, response status code and response headers def post_analytics_users_aggregates_query_with_http_info(body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi.post_analytics_users_aggregates_query ..." end # verify the required parameter 'body' is set fail ArgumentError, "Missing the required parameter 'body' when calling UsersApi.post_analytics_users_aggregates_query" if body.nil? # resource path local_var_path = "/api/v2/analytics/users/aggregates/query".sub('{format}','json') # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(body) auth_names = ['PureCloud Auth'] 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 => 'PresenceQueryResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: UsersApi#post_analytics_users_aggregates_query\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Query for user details # # @param body query # @param [Hash] opts the optional parameters # @return [AnalyticsUserDetailsQueryResponse] def post_analytics_users_details_query(body, opts = {}) data, _status_code, _headers = post_analytics_users_details_query_with_http_info(body, opts) return data end # Query for user details # # @param body query # @param [Hash] opts the optional parameters # @return [Array<(AnalyticsUserDetailsQueryResponse, Fixnum, Hash)>] AnalyticsUserDetailsQueryResponse data, response status code and response headers def post_analytics_users_details_query_with_http_info(body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi.post_analytics_users_details_query ..." end # verify the required parameter 'body' is set fail ArgumentError, "Missing the required parameter 'body' when calling UsersApi.post_analytics_users_details_query" if body.nil? # resource path local_var_path = "/api/v2/analytics/users/details/query".sub('{format}','json') # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(body) auth_names = ['PureCloud Auth'] 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 => 'AnalyticsUserDetailsQueryResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: UsersApi#post_analytics_users_details_query\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Query for user observations # # @param body query # @param [Hash] opts the optional parameters # @return [ObservationQueryResponse] def post_analytics_users_observations_query(body, opts = {}) data, _status_code, _headers = post_analytics_users_observations_query_with_http_info(body, opts) return data end # Query for user observations # # @param body query # @param [Hash] opts the optional parameters # @return [Array<(ObservationQueryResponse, Fixnum, Hash)>] ObservationQueryResponse data, response status code and response headers def post_analytics_users_observations_query_with_http_info(body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi.post_analytics_users_observations_query ..." end # verify the required parameter 'body' is set fail ArgumentError, "Missing the required parameter 'body' when calling UsersApi.post_analytics_users_observations_query" if body.nil? # resource path local_var_path = "/api/v2/analytics/users/observations/query".sub('{format}','json') # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(body) auth_names = ['PureCloud Auth'] 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 => 'ObservationQueryResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: UsersApi#post_analytics_users_observations_query\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Send an activation email to the user # # @param user_id User ID # @param [Hash] opts the optional parameters # @option opts [BOOLEAN] :force Resend the invitation even if one is already outstanding (default to false) # @return [nil] def post_user_invite(user_id, opts = {}) post_user_invite_with_http_info(user_id, opts) return nil end # Send an activation email to the user # # @param user_id User ID # @param [Hash] opts the optional parameters # @option opts [BOOLEAN] :force Resend the invitation even if one is already outstanding # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers def post_user_invite_with_http_info(user_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi.post_user_invite ..." end # verify the required parameter 'user_id' is set fail ArgumentError, "Missing the required parameter 'user_id' when calling UsersApi.post_user_invite" if user_id.nil? # resource path local_var_path = "/api/v2/users/{userId}/invite".sub('{format}','json').sub('{' + 'userId' + '}', user_id.to_s) # query parameters query_params = {} query_params[:'force'] = opts[:'force'] if opts[:'force'] # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud Auth'] 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#post_user_invite\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Add routing skill to user # # @param user_id User ID # @param body Skill # @param [Hash] opts the optional parameters # @return [UserRoutingSkill] def post_user_routingskills(user_id, body, opts = {}) data, _status_code, _headers = post_user_routingskills_with_http_info(user_id, body, opts) return data end # Add routing skill to user # # @param user_id User ID # @param body Skill # @param [Hash] opts the optional parameters # @return [Array<(UserRoutingSkill, Fixnum, Hash)>] UserRoutingSkill data, response status code and response headers def post_user_routingskills_with_http_info(user_id, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi.post_user_routingskills ..." end # verify the required parameter 'user_id' is set fail ArgumentError, "Missing the required parameter 'user_id' when calling UsersApi.post_user_routingskills" if user_id.nil? # verify the required parameter 'body' is set fail ArgumentError, "Missing the required parameter 'body' when calling UsersApi.post_user_routingskills" if body.nil? # resource path local_var_path = "/api/v2/users/{userId}/routingskills".sub('{format}','json').sub('{' + 'userId' + '}', user_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(body) auth_names = ['PureCloud Auth'] 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 => 'UserRoutingSkill') if @api_client.config.debugging @api_client.config.logger.debug "API called: UsersApi#post_user_routingskills\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Create user # # @param body User # @param [Hash] opts the optional parameters # @return [User] def post_users(body, opts = {}) data, _status_code, _headers = post_users_with_http_info(body, opts) return data end # Create user # # @param body User # @param [Hash] opts the optional parameters # @return [Array<(User, Fixnum, Hash)>] User data, response status code and response headers def post_users_with_http_info(body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi.post_users ..." end # verify the required parameter 'body' is set fail ArgumentError, "Missing the required parameter 'body' when calling UsersApi.post_users" if body.nil? # resource path local_var_path = "/api/v2/users".sub('{format}','json') # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(body) auth_names = ['PureCloud Auth'] 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#post_users\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Search users # # @param body Search request options # @param [Hash] opts the optional parameters # @return [UsersSearchResponse] def post_users_search(body, opts = {}) data, _status_code, _headers = post_users_search_with_http_info(body, opts) return data end # Search users # # @param body Search request options # @param [Hash] opts the optional parameters # @return [Array<(UsersSearchResponse, Fixnum, Hash)>] UsersSearchResponse data, response status code and response headers def post_users_search_with_http_info(body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi.post_users_search ..." end # verify the required parameter 'body' is set fail ArgumentError, "Missing the required parameter 'body' when calling UsersApi.post_users_search" if body.nil? # resource path local_var_path = "/api/v2/users/search".sub('{format}','json') # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(body) auth_names = ['PureCloud Auth'] 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 => 'UsersSearchResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: UsersApi#post_users_search\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Update a user's CallForwarding # # @param user_id User ID # @param body Call forwarding # @param [Hash] opts the optional parameters # @return [CallForwarding] def put_user_callforwarding(user_id, body, opts = {}) data, _status_code, _headers = put_user_callforwarding_with_http_info(user_id, body, opts) return data end # Update a user's CallForwarding # # @param user_id User ID # @param body Call forwarding # @param [Hash] opts the optional parameters # @return [Array<(CallForwarding, Fixnum, Hash)>] CallForwarding data, response status code and response headers def put_user_callforwarding_with_http_info(user_id, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi.put_user_callforwarding ..." end # verify the required parameter 'user_id' is set fail ArgumentError, "Missing the required parameter 'user_id' when calling UsersApi.put_user_callforwarding" if user_id.nil? # verify the required parameter 'body' is set fail ArgumentError, "Missing the required parameter 'body' when calling UsersApi.put_user_callforwarding" if body.nil? # resource path local_var_path = "/api/v2/users/{userId}/callforwarding".sub('{format}','json').sub('{' + 'userId' + '}', user_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(body) auth_names = ['PureCloud Auth'] 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 => 'CallForwarding') if @api_client.config.debugging @api_client.config.logger.debug "API called: UsersApi#put_user_callforwarding\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Update an OutOfOffice # # @param user_id User ID # @param body The updated UserPresence # @param [Hash] opts the optional parameters # @return [OutOfOffice] def put_user_outofoffice(user_id, body, opts = {}) data, _status_code, _headers = put_user_outofoffice_with_http_info(user_id, body, opts) return data end # Update an OutOfOffice # # @param user_id User ID # @param body The updated UserPresence # @param [Hash] opts the optional parameters # @return [Array<(OutOfOffice, Fixnum, Hash)>] OutOfOffice data, response status code and response headers def put_user_outofoffice_with_http_info(user_id, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi.put_user_outofoffice ..." end # verify the required parameter 'user_id' is set fail ArgumentError, "Missing the required parameter 'user_id' when calling UsersApi.put_user_outofoffice" if user_id.nil? # verify the required parameter 'body' is set fail ArgumentError, "Missing the required parameter 'body' when calling UsersApi.put_user_outofoffice" if body.nil? # resource path local_var_path = "/api/v2/users/{userId}/outofoffice".sub('{format}','json').sub('{' + 'userId' + '}', user_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(body) auth_names = ['PureCloud Auth'] 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 => 'OutOfOffice') if @api_client.config.debugging @api_client.config.logger.debug "API called: UsersApi#put_user_outofoffice\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Update profile skills for a user # # @param user_id User ID # @param [Hash] opts the optional parameters # @option opts [Array] :body Skills # @return [Array] def put_user_profileskills(user_id, opts = {}) data, _status_code, _headers = put_user_profileskills_with_http_info(user_id, opts) return data end # Update profile skills for a user # # @param user_id User ID # @param [Hash] opts the optional parameters # @option opts [Array] :body Skills # @return [Array<(Array, Fixnum, Hash)>] Array data, response status code and response headers def put_user_profileskills_with_http_info(user_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi.put_user_profileskills ..." end # verify the required parameter 'user_id' is set fail ArgumentError, "Missing the required parameter 'user_id' when calling UsersApi.put_user_profileskills" if user_id.nil? # resource path local_var_path = "/api/v2/users/{userId}/profileskills".sub('{format}','json').sub('{' + 'userId' + '}', user_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(opts[:'body']) auth_names = ['PureCloud Auth'] 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 => 'Array') if @api_client.config.debugging @api_client.config.logger.debug "API called: UsersApi#put_user_profileskills\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Sets the user's roles # # @param user_id User ID # @param body List of roles # @param [Hash] opts the optional parameters # @return [UserAuthorization] def put_user_roles(user_id, body, opts = {}) data, _status_code, _headers = put_user_roles_with_http_info(user_id, body, opts) return data end # Sets the user's roles # # @param user_id User ID # @param body List of roles # @param [Hash] opts the optional parameters # @return [Array<(UserAuthorization, Fixnum, Hash)>] UserAuthorization data, response status code and response headers def put_user_roles_with_http_info(user_id, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi.put_user_roles ..." end # verify the required parameter 'user_id' is set fail ArgumentError, "Missing the required parameter 'user_id' when calling UsersApi.put_user_roles" if user_id.nil? # verify the required parameter 'body' is set fail ArgumentError, "Missing the required parameter 'body' when calling UsersApi.put_user_roles" if body.nil? # resource path local_var_path = "/api/v2/users/{userId}/roles".sub('{format}','json').sub('{' + 'userId' + '}', user_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(body) auth_names = ['PureCloud Auth'] 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 => 'UserAuthorization') if @api_client.config.debugging @api_client.config.logger.debug "API called: UsersApi#put_user_roles\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Update routing skill proficiency or state. # # @param user_id User ID # @param skill_id skillId # @param body Skill # @param [Hash] opts the optional parameters # @return [UserRoutingSkill] def put_user_routingskill(user_id, skill_id, body, opts = {}) data, _status_code, _headers = put_user_routingskill_with_http_info(user_id, skill_id, body, opts) return data end # Update routing skill proficiency or state. # # @param user_id User ID # @param skill_id skillId # @param body Skill # @param [Hash] opts the optional parameters # @return [Array<(UserRoutingSkill, Fixnum, Hash)>] UserRoutingSkill data, response status code and response headers def put_user_routingskill_with_http_info(user_id, skill_id, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi.put_user_routingskill ..." end # verify the required parameter 'user_id' is set fail ArgumentError, "Missing the required parameter 'user_id' when calling UsersApi.put_user_routingskill" if user_id.nil? # verify the required parameter 'skill_id' is set fail ArgumentError, "Missing the required parameter 'skill_id' when calling UsersApi.put_user_routingskill" if skill_id.nil? # verify the required parameter 'body' is set fail ArgumentError, "Missing the required parameter 'body' when calling UsersApi.put_user_routingskill" if body.nil? # resource path local_var_path = "/api/v2/users/{userId}/routingskills/{skillId}".sub('{format}','json').sub('{' + 'userId' + '}', user_id.to_s).sub('{' + 'skillId' + '}', skill_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(body) auth_names = ['PureCloud Auth'] 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 => 'UserRoutingSkill') if @api_client.config.debugging @api_client.config.logger.debug "API called: UsersApi#put_user_routingskill\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Update the routing status of a user # # @param user_id User ID # @param body Routing Status # @param [Hash] opts the optional parameters # @return [RoutingStatus] def put_user_routingstatus(user_id, body, opts = {}) data, _status_code, _headers = put_user_routingstatus_with_http_info(user_id, body, opts) return data end # Update the routing status of a user # # @param user_id User ID # @param body Routing Status # @param [Hash] opts the optional parameters # @return [Array<(RoutingStatus, Fixnum, Hash)>] RoutingStatus data, response status code and response headers def put_user_routingstatus_with_http_info(user_id, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi.put_user_routingstatus ..." end # verify the required parameter 'user_id' is set fail ArgumentError, "Missing the required parameter 'user_id' when calling UsersApi.put_user_routingstatus" if user_id.nil? # verify the required parameter 'body' is set fail ArgumentError, "Missing the required parameter 'body' when calling UsersApi.put_user_routingstatus" if body.nil? # resource path local_var_path = "/api/v2/users/{userId}/routingstatus".sub('{format}','json').sub('{' + 'userId' + '}', user_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(body) auth_names = ['PureCloud Auth'] 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 => 'RoutingStatus') if @api_client.config.debugging @api_client.config.logger.debug "API called: UsersApi#put_user_routingstatus\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Set associated station # # @param user_id User ID # @param station_id stationId # @param [Hash] opts the optional parameters # @return [nil] def put_user_station_associatedstation_station_id(user_id, station_id, opts = {}) put_user_station_associatedstation_station_id_with_http_info(user_id, station_id, opts) return nil end # Set associated station # # @param user_id User ID # @param station_id stationId # @param [Hash] opts the optional parameters # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers def put_user_station_associatedstation_station_id_with_http_info(user_id, station_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi.put_user_station_associatedstation_station_id ..." end # verify the required parameter 'user_id' is set fail ArgumentError, "Missing the required parameter 'user_id' when calling UsersApi.put_user_station_associatedstation_station_id" if user_id.nil? # verify the required parameter 'station_id' is set fail ArgumentError, "Missing the required parameter 'station_id' when calling UsersApi.put_user_station_associatedstation_station_id" if station_id.nil? # resource path local_var_path = "/api/v2/users/{userId}/station/associatedstation/{stationId}".sub('{format}','json').sub('{' + 'userId' + '}', user_id.to_s).sub('{' + 'stationId' + '}', station_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud Auth'] 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) if @api_client.config.debugging @api_client.config.logger.debug "API called: UsersApi#put_user_station_associatedstation_station_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Set default station # # @param user_id User ID # @param station_id stationId # @param [Hash] opts the optional parameters # @return [nil] def put_user_station_defaultstation_station_id(user_id, station_id, opts = {}) put_user_station_defaultstation_station_id_with_http_info(user_id, station_id, opts) return nil end # Set default station # # @param user_id User ID # @param station_id stationId # @param [Hash] opts the optional parameters # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers def put_user_station_defaultstation_station_id_with_http_info(user_id, station_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi.put_user_station_defaultstation_station_id ..." end # verify the required parameter 'user_id' is set fail ArgumentError, "Missing the required parameter 'user_id' when calling UsersApi.put_user_station_defaultstation_station_id" if user_id.nil? # verify the required parameter 'station_id' is set fail ArgumentError, "Missing the required parameter 'station_id' when calling UsersApi.put_user_station_defaultstation_station_id" if station_id.nil? # resource path local_var_path = "/api/v2/users/{userId}/station/defaultstation/{stationId}".sub('{format}','json').sub('{' + 'userId' + '}', user_id.to_s).sub('{' + 'stationId' + '}', station_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud Auth'] 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) if @api_client.config.debugging @api_client.config.logger.debug "API called: UsersApi#put_user_station_defaultstation_station_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end end end