require "uri" module PureCloud class UsersApi attr_accessor :api_client def initialize(api_client = ApiClient.default) @api_client = api_client end # Query for user aggregates # # @param [Hash] opts the optional parameters # @option opts [AggregationQuery] :body query # @return [PresenceQueryResponse] def post_users_aggregates_query(opts = {}) data, status_code, headers = post_users_aggregates_query_with_http_info(opts) return data end # Query for user aggregates # # @param [Hash] opts the optional parameters # @option opts [AggregationQuery] :body query # @return [Array<(PresenceQueryResponse, Fixnum, Hash)>] PresenceQueryResponse data, response status code and response headers def post_users_aggregates_query_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi#post_users_aggregates_query ..." end # resource path path = "/api/v2/analytics/users/aggregates/query".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 => 'PresenceQueryResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: UsersApi#post_users_aggregates_query\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Query for user observations # # @param [Hash] opts the optional parameters # @option opts [ObservationQuery] :body query # @return [ObservationQueryResponse] def post_users_observations_query(opts = {}) data, status_code, headers = post_users_observations_query_with_http_info(opts) return data end # Query for user observations # # @param [Hash] opts the optional parameters # @option opts [ObservationQuery] :body query # @return [Array<(ObservationQueryResponse, Fixnum, Hash)>] ObservationQueryResponse data, response status code and response headers def post_users_observations_query_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi#post_users_observations_query ..." end # resource path path = "/api/v2/analytics/users/observations/query".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 => 'ObservationQueryResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: UsersApi#post_users_observations_query\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 # @option opts [Integer] :page_number Page number # @option opts [Array] :id The list of user ids to get. Paging is ignored if ids are specified # @option opts [String] :sort_order Ascending or descending sort order # @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 The list of user ids to get. Paging is ignored if ids are specified # @option opts [String] :sort_order Ascending or descending sort order # @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 if opts[:'sort_order'] && !['[ascending', 'descending]'].include?(opts[:'sort_order']) fail 'invalid value for "sort_order", must be one of [ascending, descending]' end # resource path 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'] # 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 user # # @param [Hash] opts the optional parameters # @option opts [CreateUser] :body User # @return [User] def post_users(opts = {}) data, status_code, headers = post_users_with_http_info(opts) return data end # Create user # # @param [Hash] opts the optional parameters # @option opts [CreateUser] :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/v2/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 [UserMe] 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<(UserMe, Fixnum, Hash)>] UserMe 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/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) _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 => 'UserMe') 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 # Search using q64 # # @param [Hash] opts the optional parameters # @option opts [String] :q64 # @option opts [Array] :expand # @return [UsersSearchResponse] def get_search(opts = {}) data, status_code, headers = get_search_with_http_info(opts) return data end # Search using q64 # # @param [Hash] opts the optional parameters # @option opts [String] :q64 # @option opts [Array] :expand # @return [Array<(UsersSearchResponse, Fixnum, Hash)>] UsersSearchResponse data, response status code and response headers def get_search_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi#get_search ..." end # resource path path = "/api/v2/users/search".sub('{format}','json') # query parameters query_params = {} query_params[:'q64'] = opts[:'q64'] if opts[:'q64'] 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 => 'UsersSearchResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: UsersApi#get_search\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Search # # @param [Hash] opts the optional parameters # @option opts [SearchRequest] :body Search request options # @return [UsersSearchResponse] def post_search(opts = {}) data, status_code, headers = post_search_with_http_info(opts) return data end # Search # # @param [Hash] opts the optional parameters # @option opts [SearchRequest] :body Search request options # @return [Array<(UsersSearchResponse, Fixnum, Hash)>] UsersSearchResponse data, response status code and response headers def post_search_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi#post_search ..." end # resource path path = "/api/v2/users/search".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 => 'UsersSearchResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: UsersApi#post_search\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(user_id, opts = {}) data, status_code, headers = get_user_id_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_user_id_with_http_info(user_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi#get_user_id ..." end # verify the required parameter 'user_id' is set fail "Missing the required parameter 'user_id' when calling get_user_id" if user_id.nil? # resource path 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'] # 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_user_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Delete user # # @param user_id User ID # @param [Hash] opts the optional parameters # @return [String] def delete_user_id(user_id, opts = {}) data, status_code, headers = delete_user_id_with_http_info(user_id, opts) return data end # Delete user # # @param user_id User ID # @param [Hash] opts the optional parameters # @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers def delete_user_id_with_http_info(user_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi#delete_user_id ..." end # verify the required parameter 'user_id' is set fail "Missing the required parameter 'user_id' when calling delete_user_id" if user_id.nil? # resource path 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) _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(:DELETE, path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'String') if @api_client.config.debugging @api_client.config.logger.debug "API called: UsersApi#delete_user_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Update user # # @param user_id User ID # @param [Hash] opts the optional parameters # @option opts [User] :body # @return [User] def patch_user_id(user_id, opts = {}) data, status_code, headers = patch_user_id_with_http_info(user_id, opts) return data end # Update user # # @param user_id User ID # @param [Hash] opts the optional parameters # @option opts [User] :body # @return [Array<(User, Fixnum, Hash)>] User data, response status code and response headers def patch_user_id_with_http_info(user_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi#patch_user_id ..." end # verify the required parameter 'user_id' is set fail "Missing the required parameter 'user_id' when calling patch_user_id" if user_id.nil? # resource path 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) _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 => 'User') if @api_client.config.debugging @api_client.config.logger.debug "API called: UsersApi#patch_user_id\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_id_callforwarding(user_id, opts = {}) data, status_code, headers = get_user_id_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_id_callforwarding_with_http_info(user_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi#get_user_id_callforwarding ..." end # verify the required parameter 'user_id' is set fail "Missing the required parameter 'user_id' when calling get_user_id_callforwarding" if user_id.nil? # resource path 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) _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_user_id_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_user_id_callforwarding(user_id, opts = {}) data, status_code, headers = put_user_id_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_user_id_callforwarding_with_http_info(user_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi#put_user_id_callforwarding ..." end # verify the required parameter 'user_id' is set fail "Missing the required parameter 'user_id' when calling put_user_id_callforwarding" if user_id.nil? # resource path 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) _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_user_id_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_user_id_callforwarding(user_id, opts = {}) data, status_code, headers = patch_user_id_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_user_id_callforwarding_with_http_info(user_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi#patch_user_id_callforwarding ..." end # verify the required parameter 'user_id' is set fail "Missing the required parameter 'user_id' when calling patch_user_id_callforwarding" if user_id.nil? # resource path 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) _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_user_id_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_user_id_geolocations_client_id(user_id, client_id, opts = {}) data, status_code, headers = get_user_id_geolocations_client_id_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_id_geolocations_client_id_with_http_info(user_id, client_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi#get_user_id_geolocations_client_id ..." end # verify the required parameter 'user_id' is set fail "Missing the required parameter 'user_id' when calling get_user_id_geolocations_client_id" if user_id.nil? # verify the required parameter 'client_id' is set fail "Missing the required parameter 'client_id' when calling get_user_id_geolocations_client_id" if client_id.nil? # resource path 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) _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_user_id_geolocations_client_id\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_user_id_geolocations_client_id(user_id, client_id, opts = {}) data, status_code, headers = patch_user_id_geolocations_client_id_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_user_id_geolocations_client_id_with_http_info(user_id, client_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi#patch_user_id_geolocations_client_id ..." end # verify the required parameter 'user_id' is set fail "Missing the required parameter 'user_id' when calling patch_user_id_geolocations_client_id" if user_id.nil? # verify the required parameter 'client_id' is set fail "Missing the required parameter 'client_id' when calling patch_user_id_geolocations_client_id" if client_id.nil? # resource path 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) _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_user_id_geolocations_client_id\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_id_outofoffice(user_id, opts = {}) data, status_code, headers = get_user_id_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_id_outofoffice_with_http_info(user_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi#get_user_id_outofoffice ..." end # verify the required parameter 'user_id' is set fail "Missing the required parameter 'user_id' when calling get_user_id_outofoffice" if user_id.nil? # resource path 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) _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_user_id_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_user_id_outofoffice(user_id, body, opts = {}) data, status_code, headers = put_user_id_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_id_outofoffice_with_http_info(user_id, body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi#put_user_id_outofoffice ..." end # verify the required parameter 'user_id' is set fail "Missing the required parameter 'user_id' when calling put_user_id_outofoffice" if user_id.nil? # verify the required parameter 'body' is set fail "Missing the required parameter 'body' when calling put_user_id_outofoffice" if body.nil? # resource path 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) _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_user_id_outofoffice\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get a user's Presence # # @param user_id user Id # @param source source # @param [Hash] opts the optional parameters # @return [UserPresence] def get_user_id_presences_source(user_id, source, opts = {}) data, status_code, headers = get_user_id_presences_source_with_http_info(user_id, source, opts) return data end # Get a user's Presence # # @param user_id user Id # @param source source # @param [Hash] opts the optional parameters # @return [Array<(UserPresence, Fixnum, Hash)>] UserPresence data, response status code and response headers def get_user_id_presences_source_with_http_info(user_id, source, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi#get_user_id_presences_source ..." end # verify the required parameter 'user_id' is set fail "Missing the required parameter 'user_id' when calling get_user_id_presences_source" if user_id.nil? # verify the required parameter 'source' is set fail "Missing the required parameter 'source' when calling get_user_id_presences_source" if source.nil? # resource path path = "/api/v2/users/{userId}/presences/{source}".sub('{format}','json').sub('{' + 'userId' + '}', user_id.to_s).sub('{' + 'source' + '}', source.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 => 'UserPresence') if @api_client.config.debugging @api_client.config.logger.debug "API called: UsersApi#get_user_id_presences_source\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Patch a user's Presence # The presence object can be patched one of three ways. Option 1: Set the 'primary' property to true. This will set the 'source' defined in the path as the user's primary presence source. Option 2: Provide the presenceDefinition value. Option 3: Provide the message value. Option 1 can be combined with Option2 and/or Option 3. # @param user_id user Id # @param source source # @param [Hash] opts the optional parameters # @option opts [UserPresence] :body # @return [UserPresence] def patch_user_id_presences_source(user_id, source, opts = {}) data, status_code, headers = patch_user_id_presences_source_with_http_info(user_id, source, opts) return data end # Patch a user's Presence # The presence object can be patched one of three ways. Option 1: Set the 'primary' property to true. This will set the 'source' defined in the path as the user's primary presence source. Option 2: Provide the presenceDefinition value. Option 3: Provide the message value. Option 1 can be combined with Option2 and/or Option 3. # @param user_id user Id # @param source source # @param [Hash] opts the optional parameters # @option opts [UserPresence] :body # @return [Array<(UserPresence, Fixnum, Hash)>] UserPresence data, response status code and response headers def patch_user_id_presences_source_with_http_info(user_id, source, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi#patch_user_id_presences_source ..." end # verify the required parameter 'user_id' is set fail "Missing the required parameter 'user_id' when calling patch_user_id_presences_source" if user_id.nil? # verify the required parameter 'source' is set fail "Missing the required parameter 'source' when calling patch_user_id_presences_source" if source.nil? # resource path path = "/api/v2/users/{userId}/presences/{source}".sub('{format}','json').sub('{' + 'userId' + '}', user_id.to_s).sub('{' + 'source' + '}', source.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 => 'UserPresence') if @api_client.config.debugging @api_client.config.logger.debug "API called: UsersApi#patch_user_id_presences_source\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_user_id_queues(user_id, opts = {}) data, status_code, headers = get_user_id_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_user_id_queues_with_http_info(user_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi#get_user_id_queues ..." end # verify the required parameter 'user_id' is set fail "Missing the required parameter 'user_id' when calling get_user_id_queues" if user_id.nil? # resource path 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'] # 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_user_id_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_user_id_queues(user_id, opts = {}) data, status_code, headers = patch_user_id_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_user_id_queues_with_http_info(user_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi#patch_user_id_queues ..." end # verify the required parameter 'user_id' is set fail "Missing the required parameter 'user_id' when calling patch_user_id_queues" if user_id.nil? # resource path 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) _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_user_id_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_user_id_queues_queue_id(queue_id, user_id, opts = {}) data, status_code, headers = patch_user_id_queues_queue_id_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_user_id_queues_queue_id_with_http_info(queue_id, user_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi#patch_user_id_queues_queue_id ..." end # verify the required parameter 'queue_id' is set fail "Missing the required parameter 'queue_id' when calling patch_user_id_queues_queue_id" if queue_id.nil? # verify the required parameter 'user_id' is set fail "Missing the required parameter 'user_id' when calling patch_user_id_queues_queue_id" if user_id.nil? # resource path 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) _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_user_id_queues_queue_id\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_id_roles(user_id, opts = {}) data, status_code, headers = get_user_id_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_id_roles_with_http_info(user_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi#get_user_id_roles ..." end # verify the required parameter 'user_id' is set fail "Missing the required parameter 'user_id' when calling get_user_id_roles" if user_id.nil? # resource path 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) _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 => 'UserAuthorization') if @api_client.config.debugging @api_client.config.logger.debug "API called: UsersApi#get_user_id_roles\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 [Hash] opts the optional parameters # @option opts [Array] :body # @return [UserAuthorization] def put_user_id_roles(user_id, opts = {}) data, status_code, headers = put_user_id_roles_with_http_info(user_id, opts) return data end # Sets the user's roles # # @param user_id User ID # @param [Hash] opts the optional parameters # @option opts [Array] :body # @return [Array<(UserAuthorization, Fixnum, Hash)>] UserAuthorization data, response status code and response headers def put_user_id_roles_with_http_info(user_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi#put_user_id_roles ..." end # verify the required parameter 'user_id' is set fail "Missing the required parameter 'user_id' when calling put_user_id_roles" if user_id.nil? # resource path 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) _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 => 'UserAuthorization') if @api_client.config.debugging @api_client.config.logger.debug "API called: UsersApi#put_user_id_roles\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_id_roles(user_id, opts = {}) delete_user_id_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_id_roles_with_http_info(user_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi#delete_user_id_roles ..." end # verify the required parameter 'user_id' is set fail "Missing the required parameter 'user_id' when calling delete_user_id_roles" if user_id.nil? # resource path 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) _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(:DELETE, 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_id_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 # @option opts [Integer] :page_number Page number # @option opts [String] :sort_order Ascending or descending sort order # @return [UserSkillEntityListing] def get_user_id_routingskills(user_id, opts = {}) data, status_code, headers = get_user_id_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_id_routingskills_with_http_info(user_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi#get_user_id_routingskills ..." end # verify the required parameter 'user_id' is set fail "Missing the required parameter 'user_id' when calling get_user_id_routingskills" if user_id.nil? if opts[:'sort_order'] && !['[ascending', 'descending]'].include?(opts[:'sort_order']) fail 'invalid value for "sort_order", must be one of [ascending, descending]' end # resource path 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) _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_user_id_routingskills\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 [Hash] opts the optional parameters # @option opts [UserRoutingSkill] :body Skill # @return [UserRoutingSkill] def post_user_id_routingskills(user_id, opts = {}) data, status_code, headers = post_user_id_routingskills_with_http_info(user_id, opts) return data end # Add routing skill to user # # @param user_id User ID # @param [Hash] opts the optional parameters # @option opts [UserRoutingSkill] :body Skill # @return [Array<(UserRoutingSkill, Fixnum, Hash)>] UserRoutingSkill data, response status code and response headers def post_user_id_routingskills_with_http_info(user_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi#post_user_id_routingskills ..." end # verify the required parameter 'user_id' is set fail "Missing the required parameter 'user_id' when calling post_user_id_routingskills" if user_id.nil? # resource path 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) _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 => 'UserRoutingSkill') if @api_client.config.debugging @api_client.config.logger.debug "API called: UsersApi#post_user_id_routingskills\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 # @param [Hash] opts the optional parameters # @return [String] def delete_user_id_routingskills_skill_id(user_id, skill_id, opts = {}) data, status_code, headers = delete_user_id_routingskills_skill_id_with_http_info(user_id, skill_id, opts) return data end # Remove routing skill from user # # @param user_id User ID # @param skill_id # @param [Hash] opts the optional parameters # @return [Array<(String, Fixnum, Hash)>] String data, response status code and response headers def delete_user_id_routingskills_skill_id_with_http_info(user_id, skill_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi#delete_user_id_routingskills_skill_id ..." end # verify the required parameter 'user_id' is set fail "Missing the required parameter 'user_id' when calling delete_user_id_routingskills_skill_id" if user_id.nil? # verify the required parameter 'skill_id' is set fail "Missing the required parameter 'skill_id' when calling delete_user_id_routingskills_skill_id" if skill_id.nil? # resource path 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) _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(:DELETE, path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'String') if @api_client.config.debugging @api_client.config.logger.debug "API called: UsersApi#delete_user_id_routingskills_skill_id\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_id_routingstatus(user_id, opts = {}) data, status_code, headers = get_user_id_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_id_routingstatus_with_http_info(user_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi#get_user_id_routingstatus ..." end # verify the required parameter 'user_id' is set fail "Missing the required parameter 'user_id' when calling get_user_id_routingstatus" if user_id.nil? # resource path 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) _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_user_id_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_user_id_routingstatus(user_id, opts = {}) data, status_code, headers = put_user_id_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_user_id_routingstatus_with_http_info(user_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi#put_user_id_routingstatus ..." end # verify the required parameter 'user_id' is set fail "Missing the required parameter 'user_id' when calling put_user_id_routingstatus" if user_id.nil? # resource path 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) _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_user_id_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_id_station(user_id, opts = {}) data, status_code, headers = get_user_id_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_id_station_with_http_info(user_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi#get_user_id_station ..." end # verify the required parameter 'user_id' is set fail "Missing the required parameter 'user_id' when calling get_user_id_station" if user_id.nil? # resource path 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) _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 => 'UserStations') if @api_client.config.debugging @api_client.config.logger.debug "API called: UsersApi#get_user_id_station\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_id_station_associatedstation(user_id, opts = {}) delete_user_id_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_id_station_associatedstation_with_http_info(user_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi#delete_user_id_station_associatedstation ..." end # verify the required parameter 'user_id' is set fail "Missing the required parameter 'user_id' when calling delete_user_id_station_associatedstation" if user_id.nil? # resource path 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) _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(:DELETE, 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_id_station_associatedstation\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 # @param [Hash] opts the optional parameters # @return [nil] def put_user_id_station_associatedstation_station_id(user_id, station_id, opts = {}) put_user_id_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 # @param [Hash] opts the optional parameters # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers def put_user_id_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_id_station_associatedstation_station_id ..." end # verify the required parameter 'user_id' is set fail "Missing the required parameter 'user_id' when calling put_user_id_station_associatedstation_station_id" if user_id.nil? # verify the required parameter 'station_id' is set fail "Missing the required parameter 'station_id' when calling put_user_id_station_associatedstation_station_id" if station_id.nil? # resource path 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) _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(:PUT, 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_id_station_associatedstation_station_id\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_id_station_defaultstation(user_id, opts = {}) delete_user_id_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_id_station_defaultstation_with_http_info(user_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: UsersApi#delete_user_id_station_defaultstation ..." end # verify the required parameter 'user_id' is set fail "Missing the required parameter 'user_id' when calling delete_user_id_station_defaultstation" if user_id.nil? # resource path 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) _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(:DELETE, 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_id_station_defaultstation\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 # @param [Hash] opts the optional parameters # @return [nil] def put_user_id_station_defaultstation_station_id(user_id, station_id, opts = {}) put_user_id_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 # @param [Hash] opts the optional parameters # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers def put_user_id_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_id_station_defaultstation_station_id ..." end # verify the required parameter 'user_id' is set fail "Missing the required parameter 'user_id' when calling put_user_id_station_defaultstation_station_id" if user_id.nil? # verify the required parameter 'station_id' is set fail "Missing the required parameter 'station_id' when calling put_user_id_station_defaultstation_station_id" if station_id.nil? # resource path 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) _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(:PUT, 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_id_station_defaultstation_station_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end end end