Class: ArtikCloud::RegistrationsApi

Inherits:
Object
  • Object
show all
Defined in:
lib/artikcloud/api/registrations_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ RegistrationsApi



18
19
20
# File 'lib/artikcloud/api/registrations_api.rb', line 18

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



16
17
18
# File 'lib/artikcloud/api/registrations_api.rb', line 16

def api_client
  @api_client
end

Instance Method Details

#confirm_user(registration_info, opts = {}) ⇒ DeviceRegConfirmUserResponseEnvelope

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.



27
28
29
30
# File 'lib/artikcloud/api/registrations_api.rb', line 27

def confirm_user(registration_info, opts = {})
  data, _status_code, _headers = confirm_user_with_http_info(registration_info, opts)
  return data
end

#confirm_user_with_http_info(registration_info, opts = {}) ⇒ Array<(DeviceRegConfirmUserResponseEnvelope, Fixnum, Hash)>

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.



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/artikcloud/api/registrations_api.rb', line 37

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(request_id, opts = {}) ⇒ DeviceRegStatusResponseEnvelope

Get Request Status For User This call checks the status of the request so users can poll and know when registration is complete.



78
79
80
81
# File 'lib/artikcloud/api/registrations_api.rb', line 78

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_with_http_info(request_id, opts = {}) ⇒ Array<(DeviceRegStatusResponseEnvelope, Fixnum, Hash)>

Get Request Status For User This call checks the status of the request so users can poll and know when registration is complete.



88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# File 'lib/artikcloud/api/registrations_api.rb', line 88

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(device_id, opts = {}) ⇒ UnregisterDeviceResponseEnvelope

Unregister Device This call clears any associations from the secure device registration.



129
130
131
132
# File 'lib/artikcloud/api/registrations_api.rb', line 129

def unregister_device(device_id, opts = {})
  data, _status_code, _headers = unregister_device_with_http_info(device_id, opts)
  return data
end

#unregister_device_with_http_info(device_id, opts = {}) ⇒ Array<(UnregisterDeviceResponseEnvelope, Fixnum, Hash)>

Unregister Device This call clears any associations from the secure device registration.



139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
# File 'lib/artikcloud/api/registrations_api.rb', line 139

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