Class: KhipuChaski::DeviceRegistryApi
- Inherits:
-
Object
- Object
- KhipuChaski::DeviceRegistryApi
- Defined in:
- lib/khipu-chaski-api-client/api/device_registry_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#add_device(device, opts = {}) ⇒ SuccessResponse
Registro de dispositivo Registra un dispositivo identificado por su tokenId.
-
#add_device_recipient(token_id, recipient_id, opts = {}) ⇒ SuccessResponse
Agregar receptor Agregar receptor de un dispositivo especifico.
-
#add_unique_alias_device(device, opts = {}) ⇒ SuccessResponse
Registro de dispositivo eliminando alias anteriores Registra un dispositivo identificado por su tokenId, elimina alias anteriores.
-
#get_device(token_id, opts = {}) ⇒ Device
Obtiene dispositivo Obtiene la informacion de un dispositivo especifico.
-
#initialize(api_client = nil) ⇒ DeviceRegistryApi
constructor
A new instance of DeviceRegistryApi.
-
#remove_device_recipient(token_id, recipient_id, opts = {}) ⇒ SuccessResponse
Elimina receptor Elimina receptor de un dispositivo especifico.
Constructor Details
#initialize(api_client = nil) ⇒ DeviceRegistryApi
Returns a new instance of DeviceRegistryApi.
7 8 9 |
# File 'lib/khipu-chaski-api-client/api/device_registry_api.rb', line 7 def initialize(api_client = nil) @api_client = api_client || Configuration.api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
5 6 7 |
# File 'lib/khipu-chaski-api-client/api/device_registry_api.rb', line 5 def api_client @api_client end |
Instance Method Details
#add_device(device, opts = {}) ⇒ SuccessResponse
Registro de dispositivo Registra un dispositivo identificado por su tokenId
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/khipu-chaski-api-client/api/device_registry_api.rb', line 16 def add_device(device, opts = {}) if Configuration.debugging Configuration.logger.debug "Calling API: DeviceRegistryApi#add_device ..." end # verify the required parameter 'device' is set fail "Missing the required parameter 'device' when calling add_device" if device.nil? # resource path path = "/devices".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(device) auth_names = ['khipu'] result = @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 => 'SuccessResponse') if Configuration.debugging Configuration.logger.debug "API called: DeviceRegistryApi#add_device. Result: #{result.inspect}" end return result end |
#add_device_recipient(token_id, recipient_id, opts = {}) ⇒ SuccessResponse
Agregar receptor Agregar receptor de un dispositivo especifico
170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 |
# File 'lib/khipu-chaski-api-client/api/device_registry_api.rb', line 170 def add_device_recipient(token_id, recipient_id, opts = {}) if Configuration.debugging Configuration.logger.debug "Calling API: DeviceRegistryApi#add_device_recipient ..." end # verify the required parameter 'token_id' is set fail "Missing the required parameter 'token_id' when calling add_device_recipient" if token_id.nil? # verify the required parameter 'recipient_id' is set fail "Missing the required parameter 'recipient_id' when calling add_device_recipient" if recipient_id.nil? # resource path path = "/devices/{tokenId}/recipients/{recipientId}".sub('{format}','json').sub('{' + 'tokenId' + '}', token_id.to_s).sub('{' + 'recipientId' + '}', recipient_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 = ['khipu'] result = @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 => 'SuccessResponse') if Configuration.debugging Configuration.logger.debug "API called: DeviceRegistryApi#add_device_recipient. Result: #{result.inspect}" end return result end |
#add_unique_alias_device(device, opts = {}) ⇒ SuccessResponse
Registro de dispositivo eliminando alias anteriores Registra un dispositivo identificado por su tokenId, elimina alias anteriores
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 |
# File 'lib/khipu-chaski-api-client/api/device_registry_api.rb', line 67 def add_unique_alias_device(device, opts = {}) if Configuration.debugging Configuration.logger.debug "Calling API: DeviceRegistryApi#add_unique_alias_device ..." end # verify the required parameter 'device' is set fail "Missing the required parameter 'device' when calling add_unique_alias_device" if device.nil? # resource path path = "/devices/uniqueAlias".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(device) auth_names = ['khipu'] result = @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 => 'SuccessResponse') if Configuration.debugging Configuration.logger.debug "API called: DeviceRegistryApi#add_unique_alias_device. Result: #{result.inspect}" end return result end |
#get_device(token_id, opts = {}) ⇒ Device
Obtiene dispositivo Obtiene la informacion de un dispositivo especifico
118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 |
# File 'lib/khipu-chaski-api-client/api/device_registry_api.rb', line 118 def get_device(token_id, opts = {}) if Configuration.debugging Configuration.logger.debug "Calling API: DeviceRegistryApi#get_device ..." end # verify the required parameter 'token_id' is set fail "Missing the required parameter 'token_id' when calling get_device" if token_id.nil? # resource path path = "/devices/{tokenId}".sub('{format}','json').sub('{' + 'tokenId' + '}', token_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 = ['khipu'] result = @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 => 'Device') if Configuration.debugging Configuration.logger.debug "API called: DeviceRegistryApi#get_device. Result: #{result.inspect}" end return result end |
#remove_device_recipient(token_id, recipient_id, opts = {}) ⇒ SuccessResponse
Elimina receptor Elimina receptor de un dispositivo especifico
225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 |
# File 'lib/khipu-chaski-api-client/api/device_registry_api.rb', line 225 def remove_device_recipient(token_id, recipient_id, opts = {}) if Configuration.debugging Configuration.logger.debug "Calling API: DeviceRegistryApi#remove_device_recipient ..." end # verify the required parameter 'token_id' is set fail "Missing the required parameter 'token_id' when calling remove_device_recipient" if token_id.nil? # verify the required parameter 'recipient_id' is set fail "Missing the required parameter 'recipient_id' when calling remove_device_recipient" if recipient_id.nil? # resource path path = "/devices/{tokenId}/recipients/{recipientId}".sub('{format}','json').sub('{' + 'tokenId' + '}', token_id.to_s).sub('{' + 'recipientId' + '}', recipient_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 = ['khipu'] result = @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 => 'SuccessResponse') if Configuration.debugging Configuration.logger.debug "API called: DeviceRegistryApi#remove_device_recipient. Result: #{result.inspect}" end return result end |