require "uri" module PureCloud class UsersApi attr_accessor :api_client def initialize(api_client = ApiClient.default) @api_client = api_client 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_by Sort by # @option opts [String] :role Role # @option opts [String] :name Name # @option opts [String] :username Username # @option opts [Array] :skill Skill # @option opts [Array] :expand Which fields, if any, to expand # @return [UsersEntityListing] 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_by Sort by # @option opts [String] :role Role # @option opts [String] :name Name # @option opts [String] :username Username # @option opts [Array] :skill Skill # @option opts [Array] :expand Which fields, if any, to expand # @return [Array<(UsersEntityListing, Fixnum, Hash)>] UsersEntityListing 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 # resource path path = "/api/v1/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[:'sortBy'] = opts[:'sort_by'] if opts[:'sort_by'] query_params[:'role'] = opts[:'role'] if opts[:'role'] query_params[:'name'] = opts[:'name'] if opts[:'name'] query_params[:'username'] = opts[:'username'] if opts[:'username'] query_params[:'skill'] = @api_client.build_collection_param(opts[:'skill'], :multi) if opts[:'skill'] query_params[:'expand'] = @api_client.build_collection_param(opts[:'expand'], :multi) if opts[:'expand'] # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_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, path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'UsersEntityListing') 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 # Create a configuration service user. # # @param [Hash] opts the optional parameters # @option opts [User] :body User # @return [User] def post_users(opts = {}) data, status_code, headers = post_users_with_http_info(opts) return data end # Create a configuration service user. # # @param [Hash] opts the optional parameters # @option opts [User] :body User # @return [Array<(User, Fixnum, Hash)>] User data, response status code and response headers def post_users_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi#post_users ..." end # resource path path = "/api/v1/users".sub('{format}','json') # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_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(:POST, 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 # Get user. # # @param [Hash] opts the optional parameters # @option opts [Array] :expand Which fields, if any, to expand # @return [User] def get_me(opts = {}) data, status_code, headers = get_me_with_http_info(opts) return data end # Get user. # # @param [Hash] opts the optional parameters # @option opts [Array] :expand Which fields, if any, to expand # @return [Array<(User, Fixnum, Hash)>] User data, response status code and response headers def get_me_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi#get_me ..." end # resource path path = "/api/v1/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) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_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, 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_me\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 # @return [User] def get(user_id, opts = {}) data, status_code, headers = get_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 # @return [Array<(User, Fixnum, Hash)>] User data, response status code and response headers def get_with_http_info(user_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi#get ..." end # verify the required parameter 'user_id' is set fail "Missing the required parameter 'user_id' when calling get" if user_id.nil? # resource path path = "/api/v1/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'] # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_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, 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\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Set user station # # @param user_id User ID # @param body stationUri # @param [Hash] opts the optional parameters # @return [User] def put(user_id, body, opts = {}) data, status_code, headers = put_with_http_info(user_id, body, opts) return data end # Set user station # # @param user_id User ID # @param body stationUri # @param [Hash] opts the optional parameters # @return [Array<(User, Fixnum, Hash)>] User data, response status code and response headers def put_with_http_info(user_id, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi#put ..." end # verify the required parameter 'user_id' is set fail "Missing the required parameter 'user_id' when calling put" if user_id.nil? # verify the required parameter 'body' is set fail "Missing the required parameter 'body' when calling put" if body.nil? # resource path path = "/api/v1/users/{userId}".sub('{format}','json').sub('{' + 'userId' + '}', user_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_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, 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#put\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_callforwarding(user_id, opts = {}) data, status_code, headers = get_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_callforwarding_with_http_info(user_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi#get_callforwarding ..." end # verify the required parameter 'user_id' is set fail "Missing the required parameter 'user_id' when calling get_callforwarding" if user_id.nil? # resource path path = "/api/v1/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) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_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, 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_callforwarding\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 [Hash] opts the optional parameters # @option opts [CallForwarding] :body # @return [CallForwarding] def put_callforwarding(user_id, opts = {}) data, status_code, headers = put_callforwarding_with_http_info(user_id, opts) return data end # Update a user's CallForwarding # # @param user_id User ID # @param [Hash] opts the optional parameters # @option opts [CallForwarding] :body # @return [Array<(CallForwarding, Fixnum, Hash)>] CallForwarding data, response status code and response headers def put_callforwarding_with_http_info(user_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi#put_callforwarding ..." end # verify the required parameter 'user_id' is set fail "Missing the required parameter 'user_id' when calling put_callforwarding" if user_id.nil? # resource path path = "/api/v1/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) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_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, 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_callforwarding\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 [Hash] opts the optional parameters # @option opts [CallForwarding] :body # @return [CallForwarding] def patch_callforwarding(user_id, opts = {}) data, status_code, headers = patch_callforwarding_with_http_info(user_id, opts) return data end # Patch a user's CallForwarding # # @param user_id User ID # @param [Hash] opts the optional parameters # @option opts [CallForwarding] :body # @return [Array<(CallForwarding, Fixnum, Hash)>] CallForwarding data, response status code and response headers def patch_callforwarding_with_http_info(user_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi#patch_callforwarding ..." end # verify the required parameter 'user_id' is set fail "Missing the required parameter 'user_id' when calling patch_callforwarding" if user_id.nil? # resource path path = "/api/v1/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) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_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(:PATCH, 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_callforwarding\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_geolocation(user_id, client_id, opts = {}) data, status_code, headers = get_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_geolocation_with_http_info(user_id, client_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi#get_geolocation ..." end # verify the required parameter 'user_id' is set fail "Missing the required parameter 'user_id' when calling get_geolocation" if user_id.nil? # verify the required parameter 'client_id' is set fail "Missing the required parameter 'client_id' when calling get_geolocation" if client_id.nil? # resource path path = "/api/v1/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) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_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, 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_geolocation\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 [Hash] opts the optional parameters # @option opts [Geolocation] :body # @return [Geolocation] def patch_geolocation(user_id, client_id, opts = {}) data, status_code, headers = patch_geolocation_with_http_info(user_id, client_id, 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 [Hash] opts the optional parameters # @option opts [Geolocation] :body # @return [Array<(Geolocation, Fixnum, Hash)>] Geolocation data, response status code and response headers def patch_geolocation_with_http_info(user_id, client_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi#patch_geolocation ..." end # verify the required parameter 'user_id' is set fail "Missing the required parameter 'user_id' when calling patch_geolocation" if user_id.nil? # verify the required parameter 'client_id' is set fail "Missing the required parameter 'client_id' when calling patch_geolocation" if client_id.nil? # resource path path = "/api/v1/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) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_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(:PATCH, 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_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_outofoffice(user_id, opts = {}) data, status_code, headers = get_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_outofoffice_with_http_info(user_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi#get_outofoffice ..." end # verify the required parameter 'user_id' is set fail "Missing the required parameter 'user_id' when calling get_outofoffice" if user_id.nil? # resource path path = "/api/v1/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) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_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, 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_outofoffice\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_outofoffice(user_id, body, opts = {}) data, status_code, headers = put_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_outofoffice_with_http_info(user_id, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi#put_outofoffice ..." end # verify the required parameter 'user_id' is set fail "Missing the required parameter 'user_id' when calling put_outofoffice" if user_id.nil? # verify the required parameter 'body' is set fail "Missing the required parameter 'body' when calling put_outofoffice" if body.nil? # resource path path = "/api/v1/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) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_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, 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_outofoffice\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get a user's PrimaryUserPresenceSource # # @param user_id User ID # @param [Hash] opts the optional parameters # @return [PrimaryUserPresenceSource] def get_primarypresencesource(user_id, opts = {}) data, status_code, headers = get_primarypresencesource_with_http_info(user_id, opts) return data end # Get a user's PrimaryUserPresenceSource # # @param user_id User ID # @param [Hash] opts the optional parameters # @return [Array<(PrimaryUserPresenceSource, Fixnum, Hash)>] PrimaryUserPresenceSource data, response status code and response headers def get_primarypresencesource_with_http_info(user_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi#get_primarypresencesource ..." end # verify the required parameter 'user_id' is set fail "Missing the required parameter 'user_id' when calling get_primarypresencesource" if user_id.nil? # resource path path = "/api/v1/users/{userId}/primarypresencesource".sub('{format}','json').sub('{' + 'userId' + '}', user_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_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, path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'PrimaryUserPresenceSource') if @api_client.config.debugging @api_client.config.logger.debug "API called: UsersApi#get_primarypresencesource\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Update a user's PrimaryUserPresenceSource # # @param user_id User ID # @param [Hash] opts the optional parameters # @option opts [PrimaryUserPresenceSource] :body # @return [PrimaryUserPresenceSource] def put_primarypresencesource(user_id, opts = {}) data, status_code, headers = put_primarypresencesource_with_http_info(user_id, opts) return data end # Update a user's PrimaryUserPresenceSource # # @param user_id User ID # @param [Hash] opts the optional parameters # @option opts [PrimaryUserPresenceSource] :body # @return [Array<(PrimaryUserPresenceSource, Fixnum, Hash)>] PrimaryUserPresenceSource data, response status code and response headers def put_primarypresencesource_with_http_info(user_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi#put_primarypresencesource ..." end # verify the required parameter 'user_id' is set fail "Missing the required parameter 'user_id' when calling put_primarypresencesource" if user_id.nil? # resource path path = "/api/v1/users/{userId}/primarypresencesource".sub('{format}','json').sub('{' + 'userId' + '}', user_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_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, path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'PrimaryUserPresenceSource') if @api_client.config.debugging @api_client.config.logger.debug "API called: UsersApi#put_primarypresencesource\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 # @option opts [Integer] :page_number Page number # @return [UserQueueEntityListing] def get_queues(user_id, opts = {}) data, status_code, headers = get_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 # @return [Array<(UserQueueEntityListing, Fixnum, Hash)>] UserQueueEntityListing data, response status code and response headers def get_queues_with_http_info(user_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi#get_queues ..." end # verify the required parameter 'user_id' is set fail "Missing the required parameter 'user_id' when calling get_queues" if user_id.nil? # resource path path = "/api/v1/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'] # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_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, 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_queues\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 [Hash] opts the optional parameters # @option opts [Array] :body User Queues # @return [UserQueue] def patch_queues(user_id, opts = {}) data, status_code, headers = patch_queues_with_http_info(user_id, opts) return data end # Join or unjoin a set of queues for a user # # @param user_id User ID # @param [Hash] opts the optional parameters # @option opts [Array] :body User Queues # @return [Array<(UserQueue, Fixnum, Hash)>] UserQueue data, response status code and response headers def patch_queues_with_http_info(user_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi#patch_queues ..." end # verify the required parameter 'user_id' is set fail "Missing the required parameter 'user_id' when calling patch_queues" if user_id.nil? # resource path path = "/api/v1/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) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_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(:PATCH, 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_queues\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 [Hash] opts the optional parameters # @option opts [UserQueue] :body Queue Member # @return [UserQueue] def patch_queue(queue_id, user_id, opts = {}) data, status_code, headers = patch_queue_with_http_info(queue_id, user_id, opts) return data end # Join or unjoin a queue for a user # # @param queue_id Queue ID # @param user_id User ID # @param [Hash] opts the optional parameters # @option opts [UserQueue] :body Queue Member # @return [Array<(UserQueue, Fixnum, Hash)>] UserQueue data, response status code and response headers def patch_queue_with_http_info(queue_id, user_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi#patch_queue ..." end # verify the required parameter 'queue_id' is set fail "Missing the required parameter 'queue_id' when calling patch_queue" if queue_id.nil? # verify the required parameter 'user_id' is set fail "Missing the required parameter 'user_id' when calling patch_queue" if user_id.nil? # resource path path = "/api/v1/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) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_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(:PATCH, 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_queue\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # List roles for user # # @param user_id User ID # @param [Hash] opts the optional parameters # @return [Array] def get_roles(user_id, opts = {}) data, status_code, headers = get_roles_with_http_info(user_id, opts) return data end # List roles for 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_roles_with_http_info(user_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi#get_roles ..." end # verify the required parameter 'user_id' is set fail "Missing the required parameter 'user_id' when calling get_roles" if user_id.nil? # resource path path = "/api/v1/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) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_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, 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_roles\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_routingstatus(user_id, opts = {}) data, status_code, headers = get_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_routingstatus_with_http_info(user_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi#get_routingstatus ..." end # verify the required parameter 'user_id' is set fail "Missing the required parameter 'user_id' when calling get_routingstatus" if user_id.nil? # resource path path = "/api/v1/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) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_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, 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_routingstatus\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 [Hash] opts the optional parameters # @option opts [RoutingStatus] :body Routing Status # @return [RoutingStatus] def put_routingstatus(user_id, opts = {}) data, status_code, headers = put_routingstatus_with_http_info(user_id, opts) return data end # Update the routing status of a user # # @param user_id User ID # @param [Hash] opts the optional parameters # @option opts [RoutingStatus] :body Routing Status # @return [Array<(RoutingStatus, Fixnum, Hash)>] RoutingStatus data, response status code and response headers def put_routingstatus_with_http_info(user_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi#put_routingstatus ..." end # verify the required parameter 'user_id' is set fail "Missing the required parameter 'user_id' when calling put_routingstatus" if user_id.nil? # resource path path = "/api/v1/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) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_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, 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_routingstatus\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # List skills for user # # @param user_id User ID # @param [Hash] opts the optional parameters # @return [UserSkillEntityListing] def get_skills(user_id, opts = {}) data, status_code, headers = get_skills_with_http_info(user_id, opts) return data end # List skills for user # # @param user_id User ID # @param [Hash] opts the optional parameters # @return [Array<(UserSkillEntityListing, Fixnum, Hash)>] UserSkillEntityListing data, response status code and response headers def get_skills_with_http_info(user_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi#get_skills ..." end # verify the required parameter 'user_id' is set fail "Missing the required parameter 'user_id' when calling get_skills" if user_id.nil? # resource path path = "/api/v1/users/{userId}/skills".sub('{format}','json').sub('{' + 'userId' + '}', user_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) _header_accept = ['application/json'] _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result # HTTP header 'Content-Type' _header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(_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, 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_skills\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end end end