=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 RegistrationsApi attr_accessor :api_client def initialize(api_client = ApiClient.default) @api_client = api_client end # Confirm User # This call updates the registration request issued earlier by associating it with an authenticated user and captures all additional information required to add a new device. # @param registration_info Device Registration information. # @param [Hash] opts the optional parameters # @return [DeviceRegConfirmUserResponseEnvelope] def confirm_user(registration_info, opts = {}) data, _status_code, _headers = confirm_user_with_http_info(registration_info, opts) return data end # Confirm User # This call updates the registration request issued earlier by associating it with an authenticated user and captures all additional information required to add a new device. # @param registration_info Device Registration information. # @param [Hash] opts the optional parameters # @return [Array<(DeviceRegConfirmUserResponseEnvelope, Fixnum, Hash)>] DeviceRegConfirmUserResponseEnvelope data, response status code and response headers def confirm_user_with_http_info(registration_info, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: RegistrationsApi.confirm_user ..." end # verify the required parameter 'registration_info' is set fail ArgumentError, "Missing the required parameter 'registration_info' when calling RegistrationsApi.confirm_user" if registration_info.nil? # resource path local_var_path = "/devices/registrations/pin".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(registration_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 => 'DeviceRegConfirmUserResponseEnvelope') if @api_client.config.debugging @api_client.config.logger.debug "API called: RegistrationsApi#confirm_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Get Request Status For User # This call checks the status of the request so users can poll and know when registration is complete. # @param request_id Request ID. # @param [Hash] opts the optional parameters # @return [DeviceRegStatusResponseEnvelope] def get_request_status_for_user(request_id, opts = {}) data, _status_code, _headers = get_request_status_for_user_with_http_info(request_id, opts) return data end # Get Request Status For User # This call checks the status of the request so users can poll and know when registration is complete. # @param request_id Request ID. # @param [Hash] opts the optional parameters # @return [Array<(DeviceRegStatusResponseEnvelope, Fixnum, Hash)>] DeviceRegStatusResponseEnvelope data, response status code and response headers def get_request_status_for_user_with_http_info(request_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: RegistrationsApi.get_request_status_for_user ..." end # verify the required parameter 'request_id' is set fail ArgumentError, "Missing the required parameter 'request_id' when calling RegistrationsApi.get_request_status_for_user" if request_id.nil? # resource path local_var_path = "/devices/registrations/{requestId}/status".sub('{format}','json').sub('{' + 'requestId' + '}', request_id.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 => 'DeviceRegStatusResponseEnvelope') if @api_client.config.debugging @api_client.config.logger.debug "API called: RegistrationsApi#get_request_status_for_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Unregister Device # This call clears any associations from the secure device registration. # @param device_id Device ID. # @param [Hash] opts the optional parameters # @return [UnregisterDeviceResponseEnvelope] def unregister_device(device_id, opts = {}) data, _status_code, _headers = unregister_device_with_http_info(device_id, opts) return data end # Unregister Device # This call clears any associations from the secure device registration. # @param device_id Device ID. # @param [Hash] opts the optional parameters # @return [Array<(UnregisterDeviceResponseEnvelope, Fixnum, Hash)>] UnregisterDeviceResponseEnvelope data, response status code and response headers def unregister_device_with_http_info(device_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: RegistrationsApi.unregister_device ..." end # verify the required parameter 'device_id' is set fail ArgumentError, "Missing the required parameter 'device_id' when calling RegistrationsApi.unregister_device" if device_id.nil? # resource path local_var_path = "/devices/{deviceId}/registrations".sub('{format}','json').sub('{' + 'deviceId' + '}', device_id.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 => 'UnregisterDeviceResponseEnvelope') if @api_client.config.debugging @api_client.config.logger.debug "API called: RegistrationsApi#unregister_device\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end end end