=begin #ARTIK Cloud API #No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: 2.0.0 Generated by: https://github.com/swagger-api/swagger-codegen.git =end require "uri" module ArtikCloud class DevicesManagementApi attr_accessor :api_client def initialize(api_client = ApiClient.default) @api_client = api_client end # Create a new task for one or more devices # Create a new task for one or more devices # @param task_payload Task object to be created # @param [Hash] opts the optional parameters # @return [TaskEnvelope] def create_tasks(task_payload, opts = {}) data, _status_code, _headers = create_tasks_with_http_info(task_payload, opts) return data end # Create a new task for one or more devices # Create a new task for one or more devices # @param task_payload Task object to be created # @param [Hash] opts the optional parameters # @return [Array<(TaskEnvelope, Fixnum, Hash)>] TaskEnvelope data, response status code and response headers def create_tasks_with_http_info(task_payload, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: DevicesManagementApi.create_tasks ..." end # verify the required parameter 'task_payload' is set fail ArgumentError, "Missing the required parameter 'task_payload' when calling DevicesManagementApi.create_tasks" if task_payload.nil? # resource path local_var_path = "/devicemgmt/tasks".sub('{format}','json') # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(task_payload) auth_names = ['artikcloud_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 => 'TaskEnvelope') if @api_client.config.debugging @api_client.config.logger.debug "API called: DevicesManagementApi#create_tasks\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Deletes a device's properties. # Deletes a device's properties. # @param did Device ID. # @param [Hash] opts the optional parameters # @return [MetadataEnvelope] def delete_server_properties(did, opts = {}) data, _status_code, _headers = delete_server_properties_with_http_info(did, opts) return data end # Deletes a device's properties. # Deletes a device's properties. # @param did Device ID. # @param [Hash] opts the optional parameters # @return [Array<(MetadataEnvelope, Fixnum, Hash)>] MetadataEnvelope data, response status code and response headers def delete_server_properties_with_http_info(did, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: DevicesManagementApi.delete_server_properties ..." end # verify the required parameter 'did' is set fail ArgumentError, "Missing the required parameter 'did' when calling DevicesManagementApi.delete_server_properties" if did.nil? # resource path local_var_path = "/devicemgmt/devices/{did}/serverproperties".sub('{format}','json').sub('{' + 'did' + '}', did.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['artikcloud_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, :return_type => 'MetadataEnvelope') if @api_client.config.debugging @api_client.config.logger.debug "API called: DevicesManagementApi#delete_server_properties\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Returns the list of tasks for a particular device id with optional status filter. # Returns the list of tasks for a particular device id with optional status filter. # @param did Device ID. # @param [Hash] opts the optional parameters # @option opts [Integer] :count Max results count. # @option opts [Integer] :offset Result starting offset. # @option opts [String] :status Status filter. Comma-separated statuses. # @option opts [String] :order Sort results by a field. Valid fields: createdOn. # @option opts [String] :sort Sort order. Valid values: asc or desc. # @return [TaskByDidListEnvelope] def get_all_by_did(did, opts = {}) data, _status_code, _headers = get_all_by_did_with_http_info(did, opts) return data end # Returns the list of tasks for a particular device id with optional status filter. # Returns the list of tasks for a particular device id with optional status filter. # @param did Device ID. # @param [Hash] opts the optional parameters # @option opts [Integer] :count Max results count. # @option opts [Integer] :offset Result starting offset. # @option opts [String] :status Status filter. Comma-separated statuses. # @option opts [String] :order Sort results by a field. Valid fields: createdOn. # @option opts [String] :sort Sort order. Valid values: asc or desc. # @return [Array<(TaskByDidListEnvelope, Fixnum, Hash)>] TaskByDidListEnvelope data, response status code and response headers def get_all_by_did_with_http_info(did, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: DevicesManagementApi.get_all_by_did ..." end # verify the required parameter 'did' is set fail ArgumentError, "Missing the required parameter 'did' when calling DevicesManagementApi.get_all_by_did" if did.nil? # resource path local_var_path = "/devicemgmt/devices/{did}/tasks".sub('{format}','json').sub('{' + 'did' + '}', did.to_s) # query parameters query_params = {} query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil? query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil? query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil? query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil? query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['artikcloud_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 => 'TaskByDidListEnvelope') if @api_client.config.debugging @api_client.config.logger.debug "API called: DevicesManagementApi#get_all_by_did\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Read a device type device management information. # Read a device type device management information. # @param dtid Device type ID. # @param [Hash] opts the optional parameters # @return [DeviceTypesInfoEnvelope] def get_device_types_info(dtid, opts = {}) data, _status_code, _headers = get_device_types_info_with_http_info(dtid, opts) return data end # Read a device type device management information. # Read a device type device management information. # @param dtid Device type ID. # @param [Hash] opts the optional parameters # @return [Array<(DeviceTypesInfoEnvelope, Fixnum, Hash)>] DeviceTypesInfoEnvelope data, response status code and response headers def get_device_types_info_with_http_info(dtid, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: DevicesManagementApi.get_device_types_info ..." end # verify the required parameter 'dtid' is set fail ArgumentError, "Missing the required parameter 'dtid' when calling DevicesManagementApi.get_device_types_info" if dtid.nil? # resource path local_var_path = "/devicemgmt/devicetypes/{dtid}".sub('{format}','json').sub('{' + 'dtid' + '}', dtid.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['artikcloud_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 => 'DeviceTypesInfoEnvelope') if @api_client.config.debugging @api_client.config.logger.debug "API called: DevicesManagementApi#get_device_types_info\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get a device type's device management manifest properties # Get a device type's device management manifest properties # @param dtid Device Type ID. # @param [Hash] opts the optional parameters # @return [MetadataPropertiesEnvelope] def get_manifest_properties(dtid, opts = {}) data, _status_code, _headers = get_manifest_properties_with_http_info(dtid, opts) return data end # Get a device type's device management manifest properties # Get a device type's device management manifest properties # @param dtid Device Type ID. # @param [Hash] opts the optional parameters # @return [Array<(MetadataPropertiesEnvelope, Fixnum, Hash)>] MetadataPropertiesEnvelope data, response status code and response headers def get_manifest_properties_with_http_info(dtid, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: DevicesManagementApi.get_manifest_properties ..." end # verify the required parameter 'dtid' is set fail ArgumentError, "Missing the required parameter 'dtid' when calling DevicesManagementApi.get_manifest_properties" if dtid.nil? # resource path local_var_path = "/devicemgmt/devicetypes/{dtid}/manifest/properties".sub('{format}','json').sub('{' + 'dtid' + '}', dtid.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['artikcloud_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 => 'MetadataPropertiesEnvelope') if @api_client.config.debugging @api_client.config.logger.debug "API called: DevicesManagementApi#get_manifest_properties\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Read a device's properties. # Read a device's properties. # @param did Device ID. # @param [Hash] opts the optional parameters # @option opts [BOOLEAN] :include_timestamp Include timestamp. # @return [MetadataEnvelope] def get_properties(did, opts = {}) data, _status_code, _headers = get_properties_with_http_info(did, opts) return data end # Read a device's properties. # Read a device's properties. # @param did Device ID. # @param [Hash] opts the optional parameters # @option opts [BOOLEAN] :include_timestamp Include timestamp. # @return [Array<(MetadataEnvelope, Fixnum, Hash)>] MetadataEnvelope data, response status code and response headers def get_properties_with_http_info(did, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: DevicesManagementApi.get_properties ..." end # verify the required parameter 'did' is set fail ArgumentError, "Missing the required parameter 'did' when calling DevicesManagementApi.get_properties" if did.nil? # resource path local_var_path = "/devicemgmt/devices/{did}/properties".sub('{format}','json').sub('{' + 'did' + '}', did.to_s) # query parameters query_params = {} query_params[:'includeTimestamp'] = opts[:'include_timestamp'] if !opts[:'include_timestamp'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['artikcloud_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 => 'MetadataEnvelope') if @api_client.config.debugging @api_client.config.logger.debug "API called: DevicesManagementApi#get_properties\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Returns the details and status of a task id and the individual statuses of each device id in the list. # Returns the details and status of a task id and the individual statuses of each device id in the list. # @param tid Task ID. # @param [Hash] opts the optional parameters # @option opts [Integer] :count Max results count. # @option opts [Integer] :offset Result starting offset. # @option opts [String] :status Status filter. Comma-separated statuses. # @option opts [String] :dids Devices filter. Comma-separated device IDs. # @return [TaskStatusesEnvelope] def get_statuses(tid, opts = {}) data, _status_code, _headers = get_statuses_with_http_info(tid, opts) return data end # Returns the details and status of a task id and the individual statuses of each device id in the list. # Returns the details and status of a task id and the individual statuses of each device id in the list. # @param tid Task ID. # @param [Hash] opts the optional parameters # @option opts [Integer] :count Max results count. # @option opts [Integer] :offset Result starting offset. # @option opts [String] :status Status filter. Comma-separated statuses. # @option opts [String] :dids Devices filter. Comma-separated device IDs. # @return [Array<(TaskStatusesEnvelope, Fixnum, Hash)>] TaskStatusesEnvelope data, response status code and response headers def get_statuses_with_http_info(tid, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: DevicesManagementApi.get_statuses ..." end # verify the required parameter 'tid' is set fail ArgumentError, "Missing the required parameter 'tid' when calling DevicesManagementApi.get_statuses" if tid.nil? # resource path local_var_path = "/devicemgmt/tasks/{tid}/statuses".sub('{format}','json').sub('{' + 'tid' + '}', tid.to_s) # query parameters query_params = {} query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil? query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil? query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil? query_params[:'dids'] = opts[:'dids'] if !opts[:'dids'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['artikcloud_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 => 'TaskStatusesEnvelope') if @api_client.config.debugging @api_client.config.logger.debug "API called: DevicesManagementApi#get_statuses\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Returns the history of the status changes for a specific task id, or for a specific device id in that task. # Returns the history of the status changes for a specific task id, or for a specific device id in that task. # @param tid Task ID. # @param [Hash] opts the optional parameters # @option opts [String] :did Device ID. Optional. # @return [TaskStatusesHistoryEnvelope] def get_statuses_history(tid, opts = {}) data, _status_code, _headers = get_statuses_history_with_http_info(tid, opts) return data end # Returns the history of the status changes for a specific task id, or for a specific device id in that task. # Returns the history of the status changes for a specific task id, or for a specific device id in that task. # @param tid Task ID. # @param [Hash] opts the optional parameters # @option opts [String] :did Device ID. Optional. # @return [Array<(TaskStatusesHistoryEnvelope, Fixnum, Hash)>] TaskStatusesHistoryEnvelope data, response status code and response headers def get_statuses_history_with_http_info(tid, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: DevicesManagementApi.get_statuses_history ..." end # verify the required parameter 'tid' is set fail ArgumentError, "Missing the required parameter 'tid' when calling DevicesManagementApi.get_statuses_history" if tid.nil? # resource path local_var_path = "/devicemgmt/tasks/{tid}/statuses/history".sub('{format}','json').sub('{' + 'tid' + '}', tid.to_s) # query parameters query_params = {} query_params[:'did'] = opts[:'did'] if !opts[:'did'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['artikcloud_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 => 'TaskStatusesHistoryEnvelope') if @api_client.config.debugging @api_client.config.logger.debug "API called: DevicesManagementApi#get_statuses_history\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Returns the details and global status of a specific task id. # Returns the details and global status of a specific task id. # @param tid Task ID. # @param [Hash] opts the optional parameters # @return [TaskEnvelope] def get_task_by_id(tid, opts = {}) data, _status_code, _headers = get_task_by_id_with_http_info(tid, opts) return data end # Returns the details and global status of a specific task id. # Returns the details and global status of a specific task id. # @param tid Task ID. # @param [Hash] opts the optional parameters # @return [Array<(TaskEnvelope, Fixnum, Hash)>] TaskEnvelope data, response status code and response headers def get_task_by_id_with_http_info(tid, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: DevicesManagementApi.get_task_by_id ..." end # verify the required parameter 'tid' is set fail ArgumentError, "Missing the required parameter 'tid' when calling DevicesManagementApi.get_task_by_id" if tid.nil? # resource path local_var_path = "/devicemgmt/tasks/{tid}".sub('{format}','json').sub('{' + 'tid' + '}', tid.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['artikcloud_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 => 'TaskEnvelope') if @api_client.config.debugging @api_client.config.logger.debug "API called: DevicesManagementApi#get_task_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Returns the all the tasks for a device type. # Returns the all the tasks for a device type. # @param dtid Device Type ID. # @param [Hash] opts the optional parameters # @option opts [Integer] :count Max results count. # @option opts [Integer] :offset Result starting offset. # @option opts [String] :status Status filter. Comma-separated statuses. # @option opts [String] :order Sort results by a field. Valid fields: createdOn. # @option opts [String] :sort Sort order. Valid values: asc or desc. # @return [TaskListEnvelope] def get_tasks(dtid, opts = {}) data, _status_code, _headers = get_tasks_with_http_info(dtid, opts) return data end # Returns the all the tasks for a device type. # Returns the all the tasks for a device type. # @param dtid Device Type ID. # @param [Hash] opts the optional parameters # @option opts [Integer] :count Max results count. # @option opts [Integer] :offset Result starting offset. # @option opts [String] :status Status filter. Comma-separated statuses. # @option opts [String] :order Sort results by a field. Valid fields: createdOn. # @option opts [String] :sort Sort order. Valid values: asc or desc. # @return [Array<(TaskListEnvelope, Fixnum, Hash)>] TaskListEnvelope data, response status code and response headers def get_tasks_with_http_info(dtid, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: DevicesManagementApi.get_tasks ..." end # verify the required parameter 'dtid' is set fail ArgumentError, "Missing the required parameter 'dtid' when calling DevicesManagementApi.get_tasks" if dtid.nil? # resource path local_var_path = "/devicemgmt/tasks".sub('{format}','json') # query parameters query_params = {} query_params[:'dtid'] = dtid query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil? query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil? query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil? query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil? query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['artikcloud_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 => 'TaskListEnvelope') if @api_client.config.debugging @api_client.config.logger.debug "API called: DevicesManagementApi#get_tasks\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Query device properties across devices. # Query device properties across devices. # @param dtid Device Type ID. # @param [Hash] opts the optional parameters # @option opts [Integer] :count Max results count. # @option opts [Integer] :offset Result starting offset. # @option opts [String] :filter Query filter. Comma-separated key=value pairs # @option opts [BOOLEAN] :include_timestamp Include timestamp. # @return [MetadataQueryEnvelope] def query_properties(dtid, opts = {}) data, _status_code, _headers = query_properties_with_http_info(dtid, opts) return data end # Query device properties across devices. # Query device properties across devices. # @param dtid Device Type ID. # @param [Hash] opts the optional parameters # @option opts [Integer] :count Max results count. # @option opts [Integer] :offset Result starting offset. # @option opts [String] :filter Query filter. Comma-separated key=value pairs # @option opts [BOOLEAN] :include_timestamp Include timestamp. # @return [Array<(MetadataQueryEnvelope, Fixnum, Hash)>] MetadataQueryEnvelope data, response status code and response headers def query_properties_with_http_info(dtid, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: DevicesManagementApi.query_properties ..." end # verify the required parameter 'dtid' is set fail ArgumentError, "Missing the required parameter 'dtid' when calling DevicesManagementApi.query_properties" if dtid.nil? # resource path local_var_path = "/devicemgmt/devices/properties".sub('{format}','json') # query parameters query_params = {} query_params[:'dtid'] = dtid query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil? query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil? query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil? query_params[:'includeTimestamp'] = opts[:'include_timestamp'] if !opts[:'include_timestamp'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['artikcloud_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 => 'MetadataQueryEnvelope') if @api_client.config.debugging @api_client.config.logger.debug "API called: DevicesManagementApi#query_properties\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Updates a device type information # Updates a device type information # @param dtid Device type ID. # @param device_type_info Device type info object to be set # @param [Hash] opts the optional parameters # @return [DeviceTypesInfoEnvelope] def update_device_types_info(dtid, device_type_info, opts = {}) data, _status_code, _headers = update_device_types_info_with_http_info(dtid, device_type_info, opts) return data end # Updates a device type information # Updates a device type information # @param dtid Device type ID. # @param device_type_info Device type info object to be set # @param [Hash] opts the optional parameters # @return [Array<(DeviceTypesInfoEnvelope, Fixnum, Hash)>] DeviceTypesInfoEnvelope data, response status code and response headers def update_device_types_info_with_http_info(dtid, device_type_info, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: DevicesManagementApi.update_device_types_info ..." end # verify the required parameter 'dtid' is set fail ArgumentError, "Missing the required parameter 'dtid' when calling DevicesManagementApi.update_device_types_info" if dtid.nil? # verify the required parameter 'device_type_info' is set fail ArgumentError, "Missing the required parameter 'device_type_info' when calling DevicesManagementApi.update_device_types_info" if device_type_info.nil? # resource path local_var_path = "/devicemgmt/devicetypes/{dtid}".sub('{format}','json').sub('{' + 'dtid' + '}', dtid.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(device_type_info) auth_names = ['artikcloud_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 => 'DeviceTypesInfoEnvelope') if @api_client.config.debugging @api_client.config.logger.debug "API called: DevicesManagementApi#update_device_types_info\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Updates a device's server properties. # Updates a device's server properties. # @param did Device ID. # @param device_properties Device properties object to be set # @param [Hash] opts the optional parameters # @return [MetadataEnvelope] def update_server_properties(did, device_properties, opts = {}) data, _status_code, _headers = update_server_properties_with_http_info(did, device_properties, opts) return data end # Updates a device's server properties. # Updates a device's server properties. # @param did Device ID. # @param device_properties Device properties object to be set # @param [Hash] opts the optional parameters # @return [Array<(MetadataEnvelope, Fixnum, Hash)>] MetadataEnvelope data, response status code and response headers def update_server_properties_with_http_info(did, device_properties, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: DevicesManagementApi.update_server_properties ..." end # verify the required parameter 'did' is set fail ArgumentError, "Missing the required parameter 'did' when calling DevicesManagementApi.update_server_properties" if did.nil? # verify the required parameter 'device_properties' is set fail ArgumentError, "Missing the required parameter 'device_properties' when calling DevicesManagementApi.update_server_properties" if device_properties.nil? # resource path local_var_path = "/devicemgmt/devices/{did}/serverproperties".sub('{format}','json').sub('{' + 'did' + '}', did.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(device_properties) auth_names = ['artikcloud_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 => 'MetadataEnvelope') if @api_client.config.debugging @api_client.config.logger.debug "API called: DevicesManagementApi#update_server_properties\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Updates a task for all devices - For now just allows changing the state to cancelled. # Updates a task for all devices - For now just allows changing the state to cancelled. # @param tid Task ID. # @param task_update_request Task update request # @param [Hash] opts the optional parameters # @return [TaskUpdateResponse] def update_task(tid, task_update_request, opts = {}) data, _status_code, _headers = update_task_with_http_info(tid, task_update_request, opts) return data end # Updates a task for all devices - For now just allows changing the state to cancelled. # Updates a task for all devices - For now just allows changing the state to cancelled. # @param tid Task ID. # @param task_update_request Task update request # @param [Hash] opts the optional parameters # @return [Array<(TaskUpdateResponse, Fixnum, Hash)>] TaskUpdateResponse data, response status code and response headers def update_task_with_http_info(tid, task_update_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: DevicesManagementApi.update_task ..." end # verify the required parameter 'tid' is set fail ArgumentError, "Missing the required parameter 'tid' when calling DevicesManagementApi.update_task" if tid.nil? # verify the required parameter 'task_update_request' is set fail ArgumentError, "Missing the required parameter 'task_update_request' when calling DevicesManagementApi.update_task" if task_update_request.nil? # resource path local_var_path = "/devicemgmt/tasks/{tid}".sub('{format}','json').sub('{' + 'tid' + '}', tid.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(task_update_request) auth_names = ['artikcloud_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 => 'TaskUpdateResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: DevicesManagementApi#update_task\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Updates a task for a specific device - For now just allows changing the state to cancelled. # Updates a task for a specific device - For now just allows changing the state to cancelled. # @param tid Task ID. # @param did Device ID. # @param device_task_update_request Device task update request # @param [Hash] opts the optional parameters # @return [DeviceTaskUpdateResponse] def update_task_for_device(tid, did, device_task_update_request, opts = {}) data, _status_code, _headers = update_task_for_device_with_http_info(tid, did, device_task_update_request, opts) return data end # Updates a task for a specific device - For now just allows changing the state to cancelled. # Updates a task for a specific device - For now just allows changing the state to cancelled. # @param tid Task ID. # @param did Device ID. # @param device_task_update_request Device task update request # @param [Hash] opts the optional parameters # @return [Array<(DeviceTaskUpdateResponse, Fixnum, Hash)>] DeviceTaskUpdateResponse data, response status code and response headers def update_task_for_device_with_http_info(tid, did, device_task_update_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: DevicesManagementApi.update_task_for_device ..." end # verify the required parameter 'tid' is set fail ArgumentError, "Missing the required parameter 'tid' when calling DevicesManagementApi.update_task_for_device" if tid.nil? # verify the required parameter 'did' is set fail ArgumentError, "Missing the required parameter 'did' when calling DevicesManagementApi.update_task_for_device" if did.nil? # verify the required parameter 'device_task_update_request' is set fail ArgumentError, "Missing the required parameter 'device_task_update_request' when calling DevicesManagementApi.update_task_for_device" if device_task_update_request.nil? # resource path local_var_path = "/devicemgmt/tasks/{tid}/devices/{did}".sub('{format}','json').sub('{' + 'tid' + '}', tid.to_s).sub('{' + 'did' + '}', did.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(device_task_update_request) auth_names = ['artikcloud_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 => 'DeviceTaskUpdateResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: DevicesManagementApi#update_task_for_device\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end end end