artikcloud 2.0.8 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (197) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +5 -2
  3. data/LICENSE +1 -1
  4. data/README.md +39 -4
  5. data/Rakefile +8 -0
  6. data/artikcloud.gemspec +5 -16
  7. data/docs/Device.md +2 -0
  8. data/docs/DeviceShareInfo.md +8 -0
  9. data/docs/DeviceSharing.md +11 -0
  10. data/docs/DeviceSharingArray.md +8 -0
  11. data/docs/DeviceSharingEnvelope.md +11 -0
  12. data/docs/DeviceSharingId.md +8 -0
  13. data/docs/DeviceStatus.md +9 -0
  14. data/docs/DeviceStatusBatch.md +11 -0
  15. data/docs/DeviceStatusData.md +12 -0
  16. data/docs/DeviceStatusPut.md +8 -0
  17. data/docs/DeviceStatusPutData.md +8 -0
  18. data/docs/DevicessharesApi.md +235 -0
  19. data/docs/DevicestatusApi.md +183 -0
  20. data/docs/NotifMessage.md +15 -0
  21. data/docs/NotifMessageArray.md +8 -0
  22. data/docs/NotifMessagesResponse.md +12 -0
  23. data/docs/Subscription.md +24 -0
  24. data/docs/SubscriptionArray.md +8 -0
  25. data/docs/SubscriptionEnvelope.md +8 -0
  26. data/docs/SubscriptionInfo.md +20 -0
  27. data/docs/SubscriptionsApi.md +342 -0
  28. data/docs/SubscriptionsEnvelope.md +11 -0
  29. data/docs/TaskParameters.md +2 -0
  30. data/docs/UpdateParameters.md +8 -0
  31. data/docs/UsersApi.md +67 -1
  32. data/docs/ValidationCallbackInfo.md +9 -0
  33. data/git_push.sh +0 -12
  34. data/lib/artikcloud.rb +24 -13
  35. data/lib/artikcloud/api/device_types_api.rb +7 -55
  36. data/lib/artikcloud/api/devices_api.rb +12 -66
  37. data/lib/artikcloud/api/devices_management_api.rb +16 -118
  38. data/lib/artikcloud/api/devicesshares_api.rb +244 -0
  39. data/lib/artikcloud/api/devicestatus_api.rb +190 -0
  40. data/lib/artikcloud/api/export_api.rb +5 -41
  41. data/lib/artikcloud/api/messages_api.rb +10 -76
  42. data/lib/artikcloud/api/registrations_api.rb +4 -34
  43. data/lib/artikcloud/api/rules_api.rb +5 -41
  44. data/lib/artikcloud/api/subscriptions_api.rb +346 -0
  45. data/lib/artikcloud/api/tags_api.rb +4 -34
  46. data/lib/artikcloud/api/tokens_api.rb +5 -33
  47. data/lib/artikcloud/api/users_api.rb +79 -67
  48. data/lib/artikcloud/api_client.rb +17 -20
  49. data/lib/artikcloud/api_error.rb +8 -18
  50. data/lib/artikcloud/configuration.rb +1 -13
  51. data/lib/artikcloud/models/ack_envelope.rb +4 -16
  52. data/lib/artikcloud/models/acknowledgement.rb +4 -16
  53. data/lib/artikcloud/models/action.rb +4 -16
  54. data/lib/artikcloud/models/action_array.rb +4 -16
  55. data/lib/artikcloud/models/action_details.rb +4 -16
  56. data/lib/artikcloud/models/action_details_array.rb +4 -16
  57. data/lib/artikcloud/models/action_in.rb +4 -16
  58. data/lib/artikcloud/models/action_out.rb +4 -16
  59. data/lib/artikcloud/models/actions.rb +4 -16
  60. data/lib/artikcloud/models/aggregate_data.rb +4 -16
  61. data/lib/artikcloud/models/aggregates_histogram_data.rb +4 -16
  62. data/lib/artikcloud/models/aggregates_histogram_response.rb +4 -16
  63. data/lib/artikcloud/models/aggregates_response.rb +4 -16
  64. data/lib/artikcloud/models/app_properties.rb +8 -16
  65. data/lib/artikcloud/models/check_token_message.rb +4 -16
  66. data/lib/artikcloud/models/check_token_response.rb +4 -16
  67. data/lib/artikcloud/models/device.rb +28 -20
  68. data/lib/artikcloud/models/device_array.rb +4 -16
  69. data/lib/artikcloud/models/device_envelope.rb +8 -16
  70. data/lib/artikcloud/models/device_reg_complete_request.rb +4 -16
  71. data/lib/artikcloud/models/device_reg_confirm_user_request.rb +4 -16
  72. data/lib/artikcloud/models/device_reg_confirm_user_response.rb +4 -16
  73. data/lib/artikcloud/models/device_reg_confirm_user_response_envelope.rb +4 -16
  74. data/lib/artikcloud/models/device_reg_status_response.rb +4 -16
  75. data/lib/artikcloud/models/device_reg_status_response_envelope.rb +4 -16
  76. data/lib/artikcloud/models/device_share_info.rb +188 -0
  77. data/lib/artikcloud/models/device_sharing.rb +218 -0
  78. data/lib/artikcloud/models/device_sharing_array.rb +189 -0
  79. data/lib/artikcloud/models/device_sharing_envelope.rb +214 -0
  80. data/lib/artikcloud/models/device_sharing_id.rb +188 -0
  81. data/lib/artikcloud/models/device_status.rb +196 -0
  82. data/lib/artikcloud/models/device_status_batch.rb +216 -0
  83. data/lib/artikcloud/models/device_status_data.rb +225 -0
  84. data/lib/artikcloud/models/device_status_put.rb +187 -0
  85. data/lib/artikcloud/models/device_status_put_data.rb +187 -0
  86. data/lib/artikcloud/models/device_task.rb +4 -16
  87. data/lib/artikcloud/models/device_task_update_request.rb +4 -16
  88. data/lib/artikcloud/models/device_task_update_response.rb +4 -16
  89. data/lib/artikcloud/models/device_token.rb +20 -16
  90. data/lib/artikcloud/models/device_token_envelope.rb +8 -16
  91. data/lib/artikcloud/models/device_type.rb +4 -16
  92. data/lib/artikcloud/models/device_type_array.rb +4 -16
  93. data/lib/artikcloud/models/device_type_envelope.rb +8 -16
  94. data/lib/artikcloud/models/device_type_info.rb +4 -16
  95. data/lib/artikcloud/models/device_type_info_envelope.rb +4 -16
  96. data/lib/artikcloud/models/device_types_envelope.rb +16 -16
  97. data/lib/artikcloud/models/device_types_info.rb +4 -16
  98. data/lib/artikcloud/models/device_types_info_envelope.rb +4 -16
  99. data/lib/artikcloud/models/devices_envelope.rb +16 -16
  100. data/lib/artikcloud/models/error_envelope.rb +4 -16
  101. data/lib/artikcloud/models/event_feed_data.rb +4 -16
  102. data/lib/artikcloud/models/export_data.rb +4 -16
  103. data/lib/artikcloud/models/export_data_array.rb +4 -16
  104. data/lib/artikcloud/models/export_history_response.rb +4 -16
  105. data/lib/artikcloud/models/export_normalized_messages_response.rb +4 -16
  106. data/lib/artikcloud/models/export_request.rb +4 -16
  107. data/lib/artikcloud/models/export_request_data.rb +4 -16
  108. data/lib/artikcloud/models/export_request_info.rb +4 -16
  109. data/lib/artikcloud/models/export_request_response.rb +4 -16
  110. data/lib/artikcloud/models/export_response.rb +4 -16
  111. data/lib/artikcloud/models/export_status_response.rb +4 -16
  112. data/lib/artikcloud/models/field_path.rb +4 -16
  113. data/lib/artikcloud/models/field_presence.rb +8 -16
  114. data/lib/artikcloud/models/field_presence_envelope.rb +32 -16
  115. data/lib/artikcloud/models/fields_actions.rb +4 -16
  116. data/lib/artikcloud/models/manifest_properties.rb +8 -16
  117. data/lib/artikcloud/models/manifest_properties_envelope.rb +8 -16
  118. data/lib/artikcloud/models/manifest_versions.rb +8 -16
  119. data/lib/artikcloud/models/manifest_versions_envelope.rb +8 -16
  120. data/lib/artikcloud/models/message.rb +4 -16
  121. data/lib/artikcloud/models/message_action.rb +4 -16
  122. data/lib/artikcloud/models/message_id.rb +4 -16
  123. data/lib/artikcloud/models/message_id_envelope.rb +4 -16
  124. data/lib/artikcloud/models/message_in.rb +4 -16
  125. data/lib/artikcloud/models/message_out.rb +4 -16
  126. data/lib/artikcloud/models/metadata_envelope.rb +4 -16
  127. data/lib/artikcloud/models/metadata_properties_envelope.rb +4 -16
  128. data/lib/artikcloud/models/metadata_query_envelope.rb +4 -16
  129. data/lib/artikcloud/models/non_empty_string.rb +4 -16
  130. data/lib/artikcloud/models/normalized_action.rb +36 -16
  131. data/lib/artikcloud/models/normalized_actions_envelope.rb +16 -16
  132. data/lib/artikcloud/models/normalized_message.rb +36 -16
  133. data/lib/artikcloud/models/normalized_messages_envelope.rb +16 -16
  134. data/lib/artikcloud/models/notif_message.rb +252 -0
  135. data/lib/artikcloud/models/notif_message_array.rb +189 -0
  136. data/lib/artikcloud/models/notif_messages_response.rb +223 -0
  137. data/lib/artikcloud/models/output_rule.rb +4 -16
  138. data/lib/artikcloud/models/presence_envelope.rb +4 -16
  139. data/lib/artikcloud/models/presence_model.rb +4 -16
  140. data/lib/artikcloud/models/properties_envelope.rb +8 -16
  141. data/lib/artikcloud/models/refresh_token_response.rb +4 -16
  142. data/lib/artikcloud/models/register_message.rb +4 -16
  143. data/lib/artikcloud/models/rule_array.rb +4 -16
  144. data/lib/artikcloud/models/rule_creation_info.rb +4 -16
  145. data/lib/artikcloud/models/rule_envelope.rb +4 -16
  146. data/lib/artikcloud/models/rule_error.rb +4 -16
  147. data/lib/artikcloud/models/rule_update_info.rb +4 -16
  148. data/lib/artikcloud/models/rule_warning_output.rb +4 -16
  149. data/lib/artikcloud/models/rules_envelope.rb +4 -16
  150. data/lib/artikcloud/models/snapshot_response.rb +4 -16
  151. data/lib/artikcloud/models/snapshot_responses.rb +4 -16
  152. data/lib/artikcloud/models/snapshots_response_envelope.rb +4 -16
  153. data/lib/artikcloud/models/subscription.rb +348 -0
  154. data/lib/artikcloud/models/subscription_array.rb +189 -0
  155. data/lib/artikcloud/models/subscription_envelope.rb +187 -0
  156. data/lib/artikcloud/models/subscription_info.rb +308 -0
  157. data/lib/artikcloud/models/subscriptions_envelope.rb +214 -0
  158. data/lib/artikcloud/models/tag.rb +4 -16
  159. data/lib/artikcloud/models/tag_array.rb +4 -16
  160. data/lib/artikcloud/models/tags_envelope.rb +4 -16
  161. data/lib/artikcloud/models/task.rb +4 -16
  162. data/lib/artikcloud/models/task_by_did.rb +4 -16
  163. data/lib/artikcloud/models/task_by_did_list.rb +4 -16
  164. data/lib/artikcloud/models/task_by_did_list_envelope.rb +4 -16
  165. data/lib/artikcloud/models/task_envelope.rb +4 -16
  166. data/lib/artikcloud/models/task_history.rb +4 -16
  167. data/lib/artikcloud/models/task_history_list.rb +4 -16
  168. data/lib/artikcloud/models/task_list.rb +4 -16
  169. data/lib/artikcloud/models/task_list_envelope.rb +4 -16
  170. data/lib/artikcloud/models/task_parameters.rb +25 -17
  171. data/lib/artikcloud/models/task_request.rb +4 -16
  172. data/lib/artikcloud/models/task_status.rb +4 -16
  173. data/lib/artikcloud/models/task_status_counts.rb +4 -16
  174. data/lib/artikcloud/models/task_statuses.rb +4 -16
  175. data/lib/artikcloud/models/task_statuses_envelope.rb +4 -16
  176. data/lib/artikcloud/models/task_statuses_history_envelope.rb +4 -16
  177. data/lib/artikcloud/models/task_update_request.rb +4 -16
  178. data/lib/artikcloud/models/task_update_response.rb +4 -16
  179. data/lib/artikcloud/models/tasks_status_counts.rb +4 -16
  180. data/lib/artikcloud/models/token.rb +4 -16
  181. data/lib/artikcloud/models/token_info.rb +4 -16
  182. data/lib/artikcloud/models/token_info_success_response.rb +4 -16
  183. data/lib/artikcloud/models/token_request.rb +4 -16
  184. data/lib/artikcloud/models/token_response.rb +4 -16
  185. data/lib/artikcloud/models/unregister_device_response.rb +4 -16
  186. data/lib/artikcloud/models/unregister_device_response_envelope.rb +4 -16
  187. data/lib/artikcloud/models/update_parameters.rb +188 -0
  188. data/lib/artikcloud/models/user.rb +28 -16
  189. data/lib/artikcloud/models/user_envelope.rb +8 -16
  190. data/lib/artikcloud/models/validation_callback_info.rb +198 -0
  191. data/lib/artikcloud/models/web_socket_error.rb +4 -16
  192. data/lib/artikcloud/version.rb +2 -14
  193. data/pom.xml +1 -1
  194. data/spec/api/devicesshares_api_spec.rb +87 -0
  195. data/spec/api/devicestatus_api_spec.rb +75 -0
  196. data/spec/api/subscriptions_api_spec.rb +112 -0
  197. metadata +58 -26
@@ -1,24 +1,12 @@
1
1
  =begin
2
2
  #ARTIK Cloud API
3
3
 
4
- #No descripton provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
4
+ #No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
5
5
 
6
6
  OpenAPI spec version: 2.0.0
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
9
 
10
- Licensed under the Apache License, Version 2.0 (the "License");
11
- you may not use this file except in compliance with the License.
12
- You may obtain a copy of the License at
13
-
14
- http://www.apache.org/licenses/LICENSE-2.0
15
-
16
- Unless required by applicable law or agreed to in writing, software
17
- distributed under the License is distributed on an "AS IS" BASIS,
18
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
- See the License for the specific language governing permissions and
20
- limitations under the License.
21
-
22
10
  =end
23
11
 
24
12
  require "uri"
@@ -60,14 +48,8 @@ module ArtikCloud
60
48
 
61
49
  # header parameters
62
50
  header_params = {}
63
-
64
51
  # HTTP header 'Accept' (if needed)
65
- local_header_accept = ['application/json']
66
- local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
67
-
68
- # HTTP header 'Content-Type'
69
- local_header_content_type = []
70
- header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
52
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
71
53
 
72
54
  # form parameters
73
55
  form_params = {}
@@ -121,14 +103,10 @@ module ArtikCloud
121
103
 
122
104
  # header parameters
123
105
  header_params = {}
124
-
125
106
  # HTTP header 'Accept' (if needed)
126
- local_header_accept = ['application/json']
127
- local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
128
-
107
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
129
108
  # HTTP header 'Content-Type'
130
- local_header_content_type = ['application/x-www-form-urlencoded']
131
- header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
109
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])
132
110
 
133
111
  # form parameters
134
112
  form_params = {}
@@ -176,14 +154,8 @@ module ArtikCloud
176
154
 
177
155
  # header parameters
178
156
  header_params = {}
179
-
180
157
  # HTTP header 'Accept' (if needed)
181
- local_header_accept = ['application/json']
182
- local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
183
-
184
- # HTTP header 'Content-Type'
185
- local_header_content_type = []
186
- header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
158
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
187
159
 
188
160
  # form parameters
189
161
  form_params = {}
@@ -1,24 +1,12 @@
1
1
  =begin
2
2
  #ARTIK Cloud API
3
3
 
4
- #No descripton provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
4
+ #No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
5
5
 
6
6
  OpenAPI spec version: 2.0.0
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
9
 
10
- Licensed under the Apache License, Version 2.0 (the "License");
11
- you may not use this file except in compliance with the License.
12
- You may obtain a copy of the License at
13
-
14
- http://www.apache.org/licenses/LICENSE-2.0
15
-
16
- Unless required by applicable law or agreed to in writing, software
17
- distributed under the License is distributed on an "AS IS" BASIS,
18
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
- See the License for the specific language governing permissions and
20
- limitations under the License.
21
-
22
10
  =end
23
11
 
24
12
  require "uri"
@@ -67,14 +55,10 @@ module ArtikCloud
67
55
 
68
56
  # header parameters
69
57
  header_params = {}
70
-
71
58
  # HTTP header 'Accept' (if needed)
72
- local_header_accept = ['application/json']
73
- local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
74
-
59
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
75
60
  # HTTP header 'Content-Type'
76
- local_header_content_type = ['application/json']
77
- header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
61
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
78
62
 
79
63
  # form parameters
80
64
  form_params = {}
@@ -127,14 +111,8 @@ module ArtikCloud
127
111
 
128
112
  # header parameters
129
113
  header_params = {}
130
-
131
114
  # HTTP header 'Accept' (if needed)
132
- local_header_accept = ['application/json']
133
- local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
134
-
135
- # HTTP header 'Content-Type'
136
- local_header_content_type = []
137
- header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
115
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
138
116
 
139
117
  # form parameters
140
118
  form_params = {}
@@ -180,14 +158,8 @@ module ArtikCloud
180
158
 
181
159
  # header parameters
182
160
  header_params = {}
183
-
184
161
  # HTTP header 'Accept' (if needed)
185
- local_header_accept = ['application/json']
186
- local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
187
-
188
- # HTTP header 'Content-Type'
189
- local_header_content_type = []
190
- header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
162
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
191
163
 
192
164
  # form parameters
193
165
  form_params = {}
@@ -246,14 +218,8 @@ module ArtikCloud
246
218
 
247
219
  # header parameters
248
220
  header_params = {}
249
-
250
221
  # HTTP header 'Accept' (if needed)
251
- local_header_accept = ['application/json']
252
- local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
253
-
254
- # HTTP header 'Content-Type'
255
- local_header_content_type = []
256
- header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
222
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
257
223
 
258
224
  # form parameters
259
225
  form_params = {}
@@ -281,6 +247,8 @@ module ArtikCloud
281
247
  # @option opts [Integer] :offset Offset for pagination.
282
248
  # @option opts [Integer] :count Desired count of items in the result set
283
249
  # @option opts [BOOLEAN] :include_properties Optional. Boolean (true/false) - If false, only return the user's device types. If true, also return device types shared by other users.
250
+ # @option opts [String] :owner Return owned and/or shared devices. Default to ALL.
251
+ # @option opts [BOOLEAN] :include_share_info Include share info
284
252
  # @return [DevicesEnvelope]
285
253
  def get_user_devices(user_id, opts = {})
286
254
  data, _status_code, _headers = get_user_devices_with_http_info(user_id, opts)
@@ -294,6 +262,8 @@ module ArtikCloud
294
262
  # @option opts [Integer] :offset Offset for pagination.
295
263
  # @option opts [Integer] :count Desired count of items in the result set
296
264
  # @option opts [BOOLEAN] :include_properties Optional. Boolean (true/false) - If false, only return the user's device types. If true, also return device types shared by other users.
265
+ # @option opts [String] :owner Return owned and/or shared devices. Default to ALL.
266
+ # @option opts [BOOLEAN] :include_share_info Include share info
297
267
  # @return [Array<(DevicesEnvelope, Fixnum, Hash)>] DevicesEnvelope data, response status code and response headers
298
268
  def get_user_devices_with_http_info(user_id, opts = {})
299
269
  if @api_client.config.debugging
@@ -309,17 +279,13 @@ module ArtikCloud
309
279
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
310
280
  query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil?
311
281
  query_params[:'includeProperties'] = opts[:'include_properties'] if !opts[:'include_properties'].nil?
282
+ query_params[:'owner'] = opts[:'owner'] if !opts[:'owner'].nil?
283
+ query_params[:'includeShareInfo'] = opts[:'include_share_info'] if !opts[:'include_share_info'].nil?
312
284
 
313
285
  # header parameters
314
286
  header_params = {}
315
-
316
287
  # HTTP header 'Accept' (if needed)
317
- local_header_accept = ['application/json']
318
- local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
319
-
320
- # HTTP header 'Content-Type'
321
- local_header_content_type = []
322
- header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
288
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
323
289
 
324
290
  # form parameters
325
291
  form_params = {}
@@ -372,14 +338,8 @@ module ArtikCloud
372
338
 
373
339
  # header parameters
374
340
  header_params = {}
375
-
376
341
  # HTTP header 'Accept' (if needed)
377
- local_header_accept = ['application/json']
378
- local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
379
-
380
- # HTTP header 'Content-Type'
381
- local_header_content_type = []
382
- header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
342
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
383
343
 
384
344
  # form parameters
385
345
  form_params = {}
@@ -438,14 +398,8 @@ module ArtikCloud
438
398
 
439
399
  # header parameters
440
400
  header_params = {}
441
-
442
401
  # HTTP header 'Accept' (if needed)
443
- local_header_accept = ['application/json']
444
- local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
445
-
446
- # HTTP header 'Content-Type'
447
- local_header_content_type = []
448
- header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
402
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
449
403
 
450
404
  # form parameters
451
405
  form_params = {}
@@ -466,6 +420,68 @@ module ArtikCloud
466
420
  return data, status_code, headers
467
421
  end
468
422
 
423
+ # Get User shares
424
+ # Get User shares
425
+ # @param user_id User ID.
426
+ # @param filter filter
427
+ # @param [Hash] opts the optional parameters
428
+ # @option opts [Integer] :count Desired count of items in the result set.
429
+ # @option opts [Integer] :offset Offset for pagination.
430
+ # @return [DeviceSharingEnvelope]
431
+ def list_all_shares_for_user(user_id, filter, opts = {})
432
+ data, _status_code, _headers = list_all_shares_for_user_with_http_info(user_id, filter, opts)
433
+ return data
434
+ end
435
+
436
+ # Get User shares
437
+ # Get User shares
438
+ # @param user_id User ID.
439
+ # @param filter filter
440
+ # @param [Hash] opts the optional parameters
441
+ # @option opts [Integer] :count Desired count of items in the result set.
442
+ # @option opts [Integer] :offset Offset for pagination.
443
+ # @return [Array<(DeviceSharingEnvelope, Fixnum, Hash)>] DeviceSharingEnvelope data, response status code and response headers
444
+ def list_all_shares_for_user_with_http_info(user_id, filter, opts = {})
445
+ if @api_client.config.debugging
446
+ @api_client.config.logger.debug "Calling API: UsersApi.list_all_shares_for_user ..."
447
+ end
448
+ # verify the required parameter 'user_id' is set
449
+ fail ArgumentError, "Missing the required parameter 'user_id' when calling UsersApi.list_all_shares_for_user" if user_id.nil?
450
+ # verify the required parameter 'filter' is set
451
+ fail ArgumentError, "Missing the required parameter 'filter' when calling UsersApi.list_all_shares_for_user" if filter.nil?
452
+ # resource path
453
+ local_var_path = "in/api/users/{userId}/shares".sub('{format}','json').sub('{' + 'userId' + '}', user_id.to_s)
454
+
455
+ # query parameters
456
+ query_params = {}
457
+ query_params[:'filter'] = filter
458
+ query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil?
459
+ query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
460
+
461
+ # header parameters
462
+ header_params = {}
463
+ # HTTP header 'Accept' (if needed)
464
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
465
+
466
+ # form parameters
467
+ form_params = {}
468
+
469
+ # http body (model)
470
+ post_body = nil
471
+ auth_names = ['artikcloud_oauth']
472
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
473
+ :header_params => header_params,
474
+ :query_params => query_params,
475
+ :form_params => form_params,
476
+ :body => post_body,
477
+ :auth_names => auth_names,
478
+ :return_type => 'DeviceSharingEnvelope')
479
+ if @api_client.config.debugging
480
+ @api_client.config.logger.debug "API called: UsersApi#list_all_shares_for_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
481
+ end
482
+ return data, status_code, headers
483
+ end
484
+
469
485
  # Update User Application Properties
470
486
  # Updates application properties of a user
471
487
  # @param user_id User Id
@@ -502,14 +518,10 @@ module ArtikCloud
502
518
 
503
519
  # header parameters
504
520
  header_params = {}
505
-
506
521
  # HTTP header 'Accept' (if needed)
507
- local_header_accept = ['application/json']
508
- local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result
509
-
522
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
510
523
  # HTTP header 'Content-Type'
511
- local_header_content_type = ['application/json']
512
- header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
524
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
513
525
 
514
526
  # form parameters
515
527
  form_params = {}
@@ -1,24 +1,12 @@
1
1
  =begin
2
2
  #ARTIK Cloud API
3
3
 
4
- #No descripton provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
4
+ #No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
5
5
 
6
6
  OpenAPI spec version: 2.0.0
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
9
 
10
- Licensed under the Apache License, Version 2.0 (the "License");
11
- you may not use this file except in compliance with the License.
12
- You may obtain a copy of the License at
13
-
14
- http://www.apache.org/licenses/LICENSE-2.0
15
-
16
- Unless required by applicable law or agreed to in writing, software
17
- distributed under the License is distributed on an "AS IS" BASIS,
18
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
- See the License for the specific language governing permissions and
20
- limitations under the License.
21
-
22
10
  =end
23
11
 
24
12
  require 'date'
@@ -66,10 +54,18 @@ module ArtikCloud
66
54
  end
67
55
 
68
56
  unless response.success?
69
- fail ApiError.new(:code => response.code,
70
- :response_headers => response.headers,
71
- :response_body => response.body),
72
- response.status_message
57
+ if response.timed_out?
58
+ fail ApiError.new('Connection timed out')
59
+ elsif response.code == 0
60
+ # Errors from libcurl will be made visible here
61
+ fail ApiError.new(:code => 0,
62
+ :message => response.return_message)
63
+ else
64
+ fail ApiError.new(:code => response.code,
65
+ :response_headers => response.headers,
66
+ :response_body => response.body),
67
+ response.status_message
68
+ end
73
69
  end
74
70
 
75
71
  if opts[:return_type]
@@ -134,10 +130,11 @@ module ArtikCloud
134
130
  # application/json
135
131
  # application/json; charset=UTF8
136
132
  # APPLICATION/JSON
133
+ # */*
137
134
  # @param [String] mime MIME
138
- # @return [Boolean] True if the MIME is applicaton/json
135
+ # @return [Boolean] True if the MIME is application/json
139
136
  def json_mime?(mime)
140
- !(mime =~ /\Aapplication\/json(;.*)?\z/i).nil?
137
+ (mime == "*/*") || !(mime =~ /\Aapplication\/json(;.*)?\z/i).nil?
141
138
  end
142
139
 
143
140
  # Deserialize the response to the given return type.
@@ -288,7 +285,7 @@ module ArtikCloud
288
285
  # Update hearder and query params based on authentication settings.
289
286
  #
290
287
  # @param [Hash] header_params Header parameters
291
- # @param [Hash] form_params Query parameters
288
+ # @param [Hash] query_params Query parameters
292
289
  # @param [String] auth_names Authentication scheme name
293
290
  def update_params_for_auth!(header_params, query_params, auth_names)
294
291
  Array(auth_names).each do |auth_name|
@@ -1,24 +1,12 @@
1
1
  =begin
2
2
  #ARTIK Cloud API
3
3
 
4
- #No descripton provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
4
+ #No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
5
5
 
6
6
  OpenAPI spec version: 2.0.0
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
9
 
10
- Licensed under the Apache License, Version 2.0 (the "License");
11
- you may not use this file except in compliance with the License.
12
- You may obtain a copy of the License at
13
-
14
- http://www.apache.org/licenses/LICENSE-2.0
15
-
16
- Unless required by applicable law or agreed to in writing, software
17
- distributed under the License is distributed on an "AS IS" BASIS,
18
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
- See the License for the specific language governing permissions and
20
- limitations under the License.
21
-
22
10
  =end
23
11
 
24
12
  module ArtikCloud
@@ -32,12 +20,14 @@ module ArtikCloud
32
20
  # ApiError.new(:code => 404, :message => "Not Found")
33
21
  def initialize(arg = nil)
34
22
  if arg.is_a? Hash
23
+ if arg.key?(:message) || arg.key?('message')
24
+ super(arg[:message] || arg['message'])
25
+ else
26
+ super arg
27
+ end
28
+
35
29
  arg.each do |k, v|
36
- if k.to_s == 'message'
37
- super v
38
- else
39
- instance_variable_set "@#{k}", v
40
- end
30
+ instance_variable_set "@#{k}", v
41
31
  end
42
32
  else
43
33
  super arg
@@ -1,24 +1,12 @@
1
1
  =begin
2
2
  #ARTIK Cloud API
3
3
 
4
- #No descripton provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
4
+ #No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
5
5
 
6
6
  OpenAPI spec version: 2.0.0
7
7
 
8
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
9
9
 
10
- Licensed under the Apache License, Version 2.0 (the "License");
11
- you may not use this file except in compliance with the License.
12
- You may obtain a copy of the License at
13
-
14
- http://www.apache.org/licenses/LICENSE-2.0
15
-
16
- Unless required by applicable law or agreed to in writing, software
17
- distributed under the License is distributed on an "AS IS" BASIS,
18
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
- See the License for the specific language governing permissions and
20
- limitations under the License.
21
-
22
10
  =end
23
11
 
24
12
  require 'uri'