class PureCloud::MobileDevicesApi
Attributes
Public Class Methods
# File lib/purecloudplatformclientv2/api/mobile_devices_api.rb, line 23 def initialize(api_client = ApiClient.default) @api_client = api_client end
Public Instance Methods
Delete device
@param device_id Device ID @param [Hash] opts the optional parameters @return [nil]
# File lib/purecloudplatformclientv2/api/mobile_devices_api.rb, line 32 def delete_mobiledevice(device_id, opts = {}) delete_mobiledevice_with_http_info(device_id, opts) return nil end
Delete device
@param device_id Device ID @param [Hash] opts the optional parameters @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
# File lib/purecloudplatformclientv2/api/mobile_devices_api.rb, line 42 def delete_mobiledevice_with_http_info(device_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: MobileDevicesApi.delete_mobiledevice ..." end # verify the required parameter 'device_id' is set fail ArgumentError, "Missing the required parameter 'device_id' when calling MobileDevicesApi.delete_mobiledevice" if device_id.nil? # resource path local_var_path = "/api/v2/mobiledevices/{deviceId}".sub('{format}','json').sub('{' + 'deviceId' + '}', device_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud OAuth'] data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: MobileDevicesApi#delete_mobiledevice\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Get device
@param device_id Device ID @param [Hash] opts the optional parameters @return [UserDevice]
# File lib/purecloudplatformclientv2/api/mobile_devices_api.rb, line 96 def get_mobiledevice(device_id, opts = {}) data, _status_code, _headers = get_mobiledevice_with_http_info(device_id, opts) return data end
Get device
@param device_id Device ID @param [Hash] opts the optional parameters @return [Array<(UserDevice
, Fixnum, Hash)>] UserDevice
data, response status code and response headers
# File lib/purecloudplatformclientv2/api/mobile_devices_api.rb, line 106 def get_mobiledevice_with_http_info(device_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: MobileDevicesApi.get_mobiledevice ..." end # verify the required parameter 'device_id' is set fail ArgumentError, "Missing the required parameter 'device_id' when calling MobileDevicesApi.get_mobiledevice" if device_id.nil? # resource path local_var_path = "/api/v2/mobiledevices/{deviceId}".sub('{format}','json').sub('{' + 'deviceId' + '}', device_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud OAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'UserDevice') if @api_client.config.debugging @api_client.config.logger.debug "API called: MobileDevicesApi#get_mobiledevice\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Get a list of all devices.
@param [Hash] opts the optional parameters @option opts [Integer] :page_size Page
size (default to 25) @option opts [Integer] :page_number Page
number (default to 1) @option opts [String] :sort_order Ascending or descending sort order (default to ascending) @return [DirectoryUserDevicesListing]
# File lib/purecloudplatformclientv2/api/mobile_devices_api.rb, line 163 def get_mobiledevices(opts = {}) data, _status_code, _headers = get_mobiledevices_with_http_info(opts) return data end
Get a list of all devices.
@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<(DirectoryUserDevicesListing
, Fixnum, Hash)>] DirectoryUserDevicesListing
data, response status code and response headers
# File lib/purecloudplatformclientv2/api/mobile_devices_api.rb, line 175 def get_mobiledevices_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: MobileDevicesApi.get_mobiledevices ..." end if opts[:'sort_order'] && !['ascending', 'descending'].include?(opts[:'sort_order']) fail ArgumentError, 'invalid value for "sort_order", must be one of ascending, descending' end # resource path local_var_path = "/api/v2/mobiledevices".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[:'sortOrder'] = opts[:'sort_order'] if opts[:'sort_order'] # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['PureCloud OAuth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'DirectoryUserDevicesListing') if @api_client.config.debugging @api_client.config.logger.debug "API called: MobileDevicesApi#get_mobiledevices\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Create User
device
@param body Device @param [Hash] opts the optional parameters @return [UserDevice]
# File lib/purecloudplatformclientv2/api/mobile_devices_api.rb, line 247 def post_mobiledevices(body, opts = {}) data, _status_code, _headers = post_mobiledevices_with_http_info(body, opts) return data end
Create User
device
@param body Device @param [Hash] opts the optional parameters @return [Array<(UserDevice
, Fixnum, Hash)>] UserDevice
data, response status code and response headers
# File lib/purecloudplatformclientv2/api/mobile_devices_api.rb, line 257 def post_mobiledevices_with_http_info(body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: MobileDevicesApi.post_mobiledevices ..." end # verify the required parameter 'body' is set fail ArgumentError, "Missing the required parameter 'body' when calling MobileDevicesApi.post_mobiledevices" if body.nil? # resource path local_var_path = "/api/v2/mobiledevices".sub('{format}','json') # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(body) auth_names = ['PureCloud OAuth'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'UserDevice') if @api_client.config.debugging @api_client.config.logger.debug "API called: MobileDevicesApi#post_mobiledevices\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Update device
@param device_id Device ID @param [Hash] opts the optional parameters @option opts [UserDevice] :body Device @return [UserDevice]
# File lib/purecloudplatformclientv2/api/mobile_devices_api.rb, line 313 def put_mobiledevice(device_id, opts = {}) data, _status_code, _headers = put_mobiledevice_with_http_info(device_id, opts) return data end
Update device
@param device_id Device ID @param [Hash] opts the optional parameters @option opts [UserDevice] :body Device @return [Array<(UserDevice
, Fixnum, Hash)>] UserDevice
data, response status code and response headers
# File lib/purecloudplatformclientv2/api/mobile_devices_api.rb, line 324 def put_mobiledevice_with_http_info(device_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: MobileDevicesApi.put_mobiledevice ..." end # verify the required parameter 'device_id' is set fail ArgumentError, "Missing the required parameter 'device_id' when calling MobileDevicesApi.put_mobiledevice" if device_id.nil? # resource path local_var_path = "/api/v2/mobiledevices/{deviceId}".sub('{format}','json').sub('{' + 'deviceId' + '}', device_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(opts[:'body']) auth_names = ['PureCloud OAuth'] data, status_code, headers = @api_client.call_api(:PUT, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'UserDevice') if @api_client.config.debugging @api_client.config.logger.debug "API called: MobileDevicesApi#put_mobiledevice\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end