artikcloud 2.0.0 → 2.0.5

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 (144) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +12 -12
  3. data/README.md +33 -10
  4. data/artikcloud.gemspec +5 -6
  5. data/docs/Action.md +9 -0
  6. data/docs/ActionArray.md +8 -0
  7. data/docs/Actions.md +12 -0
  8. data/docs/DeviceTypesApi.md +10 -10
  9. data/docs/DevicesApi.md +68 -15
  10. data/docs/ExportApi.md +10 -10
  11. data/docs/Message.md +11 -0
  12. data/docs/MessagesApi.md +205 -27
  13. data/docs/NormalizedAction.md +16 -0
  14. data/docs/NormalizedActionsEnvelope.md +17 -0
  15. data/docs/PresenceEnvelope.md +9 -0
  16. data/docs/PresenceModel.md +9 -0
  17. data/docs/RegistrationsApi.md +6 -6
  18. data/docs/RulesApi.md +8 -8
  19. data/docs/RulesEnvelope.md +1 -1
  20. data/docs/SnapshotResponse.md +9 -0
  21. data/docs/SnapshotResponses.md +10 -0
  22. data/docs/SnapshotsResponseEnvelope.md +9 -0
  23. data/docs/TagsApi.md +7 -7
  24. data/docs/TokenInfo.md +11 -0
  25. data/docs/TokenInfoSuccessResponse.md +8 -0
  26. data/docs/TokensApi.md +54 -7
  27. data/docs/UsersApi.md +18 -20
  28. data/git_push.sh +16 -1
  29. data/lib/artikcloud/api/device_types_api.rb +52 -59
  30. data/lib/artikcloud/api/devices_api.rb +120 -76
  31. data/lib/artikcloud/api/export_api.rb +43 -45
  32. data/lib/artikcloud/api/messages_api.rb +285 -103
  33. data/lib/artikcloud/api/registrations_api.rb +34 -34
  34. data/lib/artikcloud/api/rules_api.rb +43 -48
  35. data/lib/artikcloud/api/tags_api.rb +37 -35
  36. data/lib/artikcloud/api/tokens_api.rb +85 -30
  37. data/lib/artikcloud/api/users_api.rb +83 -102
  38. data/lib/artikcloud/api_client.rb +56 -13
  39. data/lib/artikcloud/api_error.rb +13 -4
  40. data/lib/artikcloud/configuration.rb +45 -1
  41. data/lib/artikcloud/models/ack_envelope.rb +59 -24
  42. data/lib/artikcloud/models/acknowledgement.rb +65 -33
  43. data/lib/artikcloud/models/action.rb +212 -0
  44. data/lib/artikcloud/models/action_array.rb +201 -0
  45. data/lib/artikcloud/models/action_details.rb +61 -27
  46. data/lib/artikcloud/models/action_details_array.rb +59 -24
  47. data/lib/artikcloud/models/action_in.rb +69 -39
  48. data/lib/artikcloud/models/action_out.rb +67 -36
  49. data/lib/artikcloud/models/actions.rb +241 -0
  50. data/lib/artikcloud/models/aggregate_data.rb +69 -39
  51. data/lib/artikcloud/models/aggregates_histogram_data.rb +71 -42
  52. data/lib/artikcloud/models/aggregates_histogram_response.rb +71 -42
  53. data/lib/artikcloud/models/aggregates_response.rb +69 -39
  54. data/lib/artikcloud/models/app_properties.rb +64 -30
  55. data/lib/artikcloud/models/check_token_message.rb +59 -24
  56. data/lib/artikcloud/models/check_token_response.rb +59 -24
  57. data/lib/artikcloud/models/device.rb +85 -63
  58. data/lib/artikcloud/models/device_array.rb +59 -24
  59. data/lib/artikcloud/models/device_envelope.rb +60 -24
  60. data/lib/artikcloud/models/device_reg_complete_request.rb +59 -24
  61. data/lib/artikcloud/models/device_reg_confirm_user_request.rb +63 -30
  62. data/lib/artikcloud/models/device_reg_confirm_user_response.rb +59 -24
  63. data/lib/artikcloud/models/device_reg_confirm_user_response_envelope.rb +59 -24
  64. data/lib/artikcloud/models/device_reg_status_response.rb +61 -27
  65. data/lib/artikcloud/models/device_reg_status_response_envelope.rb +59 -24
  66. data/lib/artikcloud/models/device_token.rb +69 -33
  67. data/lib/artikcloud/models/device_token_envelope.rb +60 -24
  68. data/lib/artikcloud/models/device_type.rb +93 -75
  69. data/lib/artikcloud/models/device_type_array.rb +59 -24
  70. data/lib/artikcloud/models/device_type_envelope.rb +60 -24
  71. data/lib/artikcloud/models/device_types_envelope.rb +68 -33
  72. data/lib/artikcloud/models/devices_envelope.rb +68 -33
  73. data/lib/artikcloud/models/error_envelope.rb +59 -24
  74. data/lib/artikcloud/models/export_data.rb +71 -42
  75. data/lib/artikcloud/models/export_data_array.rb +59 -24
  76. data/lib/artikcloud/models/export_history_response.rb +65 -33
  77. data/lib/artikcloud/models/export_normalized_messages_response.rb +83 -60
  78. data/lib/artikcloud/models/export_request.rb +73 -45
  79. data/lib/artikcloud/models/export_request_data.rb +79 -54
  80. data/lib/artikcloud/models/export_request_info.rb +77 -51
  81. data/lib/artikcloud/models/export_request_response.rb +59 -24
  82. data/lib/artikcloud/models/export_response.rb +79 -54
  83. data/lib/artikcloud/models/export_status_response.rb +67 -36
  84. data/lib/artikcloud/models/field_path.rb +59 -24
  85. data/lib/artikcloud/models/field_presence.rb +60 -24
  86. data/lib/artikcloud/models/field_presence_envelope.rb +78 -42
  87. data/lib/artikcloud/models/fields_actions.rb +61 -27
  88. data/lib/artikcloud/models/manifest_properties.rb +60 -24
  89. data/lib/artikcloud/models/manifest_properties_envelope.rb +60 -24
  90. data/lib/artikcloud/models/manifest_versions.rb +60 -24
  91. data/lib/artikcloud/models/manifest_versions_envelope.rb +60 -24
  92. data/lib/artikcloud/models/message.rb +233 -0
  93. data/lib/artikcloud/models/message_action.rb +67 -36
  94. data/lib/artikcloud/models/message_id.rb +59 -24
  95. data/lib/artikcloud/models/message_id_envelope.rb +59 -24
  96. data/lib/artikcloud/models/message_in.rb +69 -39
  97. data/lib/artikcloud/models/message_out.rb +67 -36
  98. data/lib/artikcloud/models/non_empty_string.rb +59 -24
  99. data/lib/artikcloud/models/normalized_action.rb +279 -0
  100. data/lib/artikcloud/models/normalized_actions_envelope.rb +285 -0
  101. data/lib/artikcloud/models/normalized_message.rb +81 -45
  102. data/lib/artikcloud/models/normalized_messages_envelope.rb +80 -51
  103. data/lib/artikcloud/models/output_rule.rb +85 -63
  104. data/lib/artikcloud/models/presence_envelope.rb +208 -0
  105. data/lib/artikcloud/models/presence_model.rb +208 -0
  106. data/lib/artikcloud/models/properties_envelope.rb +60 -24
  107. data/lib/artikcloud/models/refresh_token_response.rb +65 -33
  108. data/lib/artikcloud/models/register_message.rb +67 -36
  109. data/lib/artikcloud/models/rule_array.rb +59 -24
  110. data/lib/artikcloud/models/rule_creation_info.rb +65 -33
  111. data/lib/artikcloud/models/rule_envelope.rb +59 -24
  112. data/lib/artikcloud/models/rule_error.rb +65 -33
  113. data/lib/artikcloud/models/rule_update_info.rb +65 -33
  114. data/lib/artikcloud/models/rule_warning_output.rb +61 -27
  115. data/lib/artikcloud/models/rules_envelope.rb +69 -35
  116. data/lib/artikcloud/models/snapshot_response.rb +210 -0
  117. data/lib/artikcloud/models/snapshot_responses.rb +219 -0
  118. data/lib/artikcloud/models/snapshots_response_envelope.rb +208 -0
  119. data/lib/artikcloud/models/tag.rb +61 -27
  120. data/lib/artikcloud/models/tag_array.rb +59 -24
  121. data/lib/artikcloud/models/tags_envelope.rb +59 -24
  122. data/lib/artikcloud/models/token.rb +65 -33
  123. data/lib/artikcloud/models/token_info.rb +226 -0
  124. data/lib/artikcloud/models/token_info_success_response.rb +199 -0
  125. data/lib/artikcloud/models/token_request.rb +59 -24
  126. data/lib/artikcloud/models/token_response.rb +59 -24
  127. data/lib/artikcloud/models/unregister_device_response.rb +79 -54
  128. data/lib/artikcloud/models/unregister_device_response_envelope.rb +59 -24
  129. data/lib/artikcloud/models/user.rb +77 -42
  130. data/lib/artikcloud/models/user_envelope.rb +60 -24
  131. data/lib/artikcloud/models/web_socket_error.rb +63 -30
  132. data/lib/artikcloud/version.rb +14 -5
  133. data/lib/artikcloud.rb +26 -4
  134. data/spec/api/device_types_api_spec.rb +110 -0
  135. data/spec/api/devices_api_spec.rb +143 -0
  136. data/spec/api/export_api_spec.rb +96 -0
  137. data/spec/api/messages_api_spec.rb +7 -7
  138. data/spec/api/registrations_api_spec.rb +82 -0
  139. data/spec/api/rules_api_spec.rb +96 -0
  140. data/spec/api/tags_api_spec.rb +84 -0
  141. data/spec/api/tokens_api_spec.rb +12 -21
  142. data/spec/api/users_api_spec.rb +1 -1
  143. data/spec/spec_helper.rb +1 -1
  144. metadata +60 -22
@@ -1,14 +1,23 @@
1
1
  =begin
2
- ARTIK Cloud API
2
+ #ARTIK Cloud API
3
+
4
+ #No descripton provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
3
5
 
4
6
  OpenAPI spec version: 2.0.0
5
7
 
6
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
7
9
 
8
- License: MIT
9
- http://en.wikipedia.org/wiki/MIT_License
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
10
15
 
11
- Terms of Service: http://www.samsung.com/global/business/mobile/info/terms-and-conditions.html
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.
12
21
 
13
22
  =end
14
23
 
@@ -30,7 +39,7 @@ module ArtikCloud
30
39
  # @option opts [String] :aid Application ID
31
40
  # @return [PropertiesEnvelope]
32
41
  def create_user_properties(user_id, properties, opts = {})
33
- data, status_code, headers = create_user_properties_with_http_info(user_id, properties, opts)
42
+ data, _status_code, _headers = create_user_properties_with_http_info(user_id, properties, opts)
34
43
  return data
35
44
  end
36
45
 
@@ -43,39 +52,35 @@ module ArtikCloud
43
52
  # @return [Array<(PropertiesEnvelope, Fixnum, Hash)>] PropertiesEnvelope data, response status code and response headers
44
53
  def create_user_properties_with_http_info(user_id, properties, opts = {})
45
54
  if @api_client.config.debugging
46
- @api_client.config.logger.debug "Calling API: UsersApi#create_user_properties ..."
55
+ @api_client.config.logger.debug "Calling API: UsersApi.create_user_properties ..."
47
56
  end
48
-
49
57
  # verify the required parameter 'user_id' is set
50
- fail "Missing the required parameter 'user_id' when calling create_user_properties" if user_id.nil?
51
-
58
+ fail ArgumentError, "Missing the required parameter 'user_id' when calling UsersApi.create_user_properties" if user_id.nil?
52
59
  # verify the required parameter 'properties' is set
53
- fail "Missing the required parameter 'properties' when calling create_user_properties" if properties.nil?
54
-
60
+ fail ArgumentError, "Missing the required parameter 'properties' when calling UsersApi.create_user_properties" if properties.nil?
55
61
  # resource path
56
62
  local_var_path = "/users/{userId}/properties".sub('{format}','json').sub('{' + 'userId' + '}', user_id.to_s)
57
63
 
58
64
  # query parameters
59
65
  query_params = {}
60
- query_params[:'aid'] = opts[:'aid'] if opts[:'aid']
66
+ query_params[:'aid'] = opts[:'aid'] if !opts[:'aid'].nil?
61
67
 
62
68
  # header parameters
63
69
  header_params = {}
64
70
 
65
71
  # HTTP header 'Accept' (if needed)
66
- _header_accept = ['application/json']
67
- _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result
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
68
74
 
69
75
  # HTTP header 'Content-Type'
70
- _header_content_type = ['application/json']
71
- header_params['Content-Type'] = @api_client.select_header_content_type(_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)
72
78
 
73
79
  # form parameters
74
80
  form_params = {}
75
81
 
76
82
  # http body (model)
77
83
  post_body = @api_client.object_to_http_body(properties)
78
-
79
84
  auth_names = ['artikcloud_oauth']
80
85
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
81
86
  :header_params => header_params,
@@ -97,7 +102,7 @@ module ArtikCloud
97
102
  # @option opts [String] :aid Application ID
98
103
  # @return [PropertiesEnvelope]
99
104
  def delete_user_properties(user_id, opts = {})
100
- data, status_code, headers = delete_user_properties_with_http_info(user_id, opts)
105
+ data, _status_code, _headers = delete_user_properties_with_http_info(user_id, opts)
101
106
  return data
102
107
  end
103
108
 
@@ -109,36 +114,33 @@ module ArtikCloud
109
114
  # @return [Array<(PropertiesEnvelope, Fixnum, Hash)>] PropertiesEnvelope data, response status code and response headers
110
115
  def delete_user_properties_with_http_info(user_id, opts = {})
111
116
  if @api_client.config.debugging
112
- @api_client.config.logger.debug "Calling API: UsersApi#delete_user_properties ..."
117
+ @api_client.config.logger.debug "Calling API: UsersApi.delete_user_properties ..."
113
118
  end
114
-
115
119
  # verify the required parameter 'user_id' is set
116
- fail "Missing the required parameter 'user_id' when calling delete_user_properties" if user_id.nil?
117
-
120
+ fail ArgumentError, "Missing the required parameter 'user_id' when calling UsersApi.delete_user_properties" if user_id.nil?
118
121
  # resource path
119
122
  local_var_path = "/users/{userId}/properties".sub('{format}','json').sub('{' + 'userId' + '}', user_id.to_s)
120
123
 
121
124
  # query parameters
122
125
  query_params = {}
123
- query_params[:'aid'] = opts[:'aid'] if opts[:'aid']
126
+ query_params[:'aid'] = opts[:'aid'] if !opts[:'aid'].nil?
124
127
 
125
128
  # header parameters
126
129
  header_params = {}
127
130
 
128
131
  # HTTP header 'Accept' (if needed)
129
- _header_accept = ['application/json']
130
- _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result
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
131
134
 
132
135
  # HTTP header 'Content-Type'
133
- _header_content_type = []
134
- header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)
136
+ local_header_content_type = []
137
+ header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
135
138
 
136
139
  # form parameters
137
140
  form_params = {}
138
141
 
139
142
  # http body (model)
140
143
  post_body = nil
141
-
142
144
  auth_names = ['artikcloud_oauth']
143
145
  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
144
146
  :header_params => header_params,
@@ -158,7 +160,7 @@ module ArtikCloud
158
160
  # @param [Hash] opts the optional parameters
159
161
  # @return [UserEnvelope]
160
162
  def get_self(opts = {})
161
- data, status_code, headers = get_self_with_http_info(opts)
163
+ data, _status_code, _headers = get_self_with_http_info(opts)
162
164
  return data
163
165
  end
164
166
 
@@ -168,9 +170,8 @@ module ArtikCloud
168
170
  # @return [Array<(UserEnvelope, Fixnum, Hash)>] UserEnvelope data, response status code and response headers
169
171
  def get_self_with_http_info(opts = {})
170
172
  if @api_client.config.debugging
171
- @api_client.config.logger.debug "Calling API: UsersApi#get_self ..."
173
+ @api_client.config.logger.debug "Calling API: UsersApi.get_self ..."
172
174
  end
173
-
174
175
  # resource path
175
176
  local_var_path = "/users/self".sub('{format}','json')
176
177
 
@@ -181,19 +182,18 @@ module ArtikCloud
181
182
  header_params = {}
182
183
 
183
184
  # HTTP header 'Accept' (if needed)
184
- _header_accept = ['application/json']
185
- _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result
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
186
187
 
187
188
  # HTTP header 'Content-Type'
188
- _header_content_type = []
189
- header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)
189
+ local_header_content_type = []
190
+ header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
190
191
 
191
192
  # form parameters
192
193
  form_params = {}
193
194
 
194
195
  # http body (model)
195
196
  post_body = nil
196
-
197
197
  auth_names = ['artikcloud_oauth']
198
198
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
199
199
  :header_params => header_params,
@@ -217,7 +217,7 @@ module ArtikCloud
217
217
  # @option opts [BOOLEAN] :include_shared Optional. Boolean (true/false) - If false, only return the user&#39;s device types. If true, also return device types shared by other users.
218
218
  # @return [DeviceTypesEnvelope]
219
219
  def get_user_device_types(user_id, opts = {})
220
- data, status_code, headers = get_user_device_types_with_http_info(user_id, opts)
220
+ data, _status_code, _headers = get_user_device_types_with_http_info(user_id, opts)
221
221
  return data
222
222
  end
223
223
 
@@ -231,38 +231,35 @@ module ArtikCloud
231
231
  # @return [Array<(DeviceTypesEnvelope, Fixnum, Hash)>] DeviceTypesEnvelope data, response status code and response headers
232
232
  def get_user_device_types_with_http_info(user_id, opts = {})
233
233
  if @api_client.config.debugging
234
- @api_client.config.logger.debug "Calling API: UsersApi#get_user_device_types ..."
234
+ @api_client.config.logger.debug "Calling API: UsersApi.get_user_device_types ..."
235
235
  end
236
-
237
236
  # verify the required parameter 'user_id' is set
238
- fail "Missing the required parameter 'user_id' when calling get_user_device_types" if user_id.nil?
239
-
237
+ fail ArgumentError, "Missing the required parameter 'user_id' when calling UsersApi.get_user_device_types" if user_id.nil?
240
238
  # resource path
241
239
  local_var_path = "/users/{userId}/devicetypes".sub('{format}','json').sub('{' + 'userId' + '}', user_id.to_s)
242
240
 
243
241
  # query parameters
244
242
  query_params = {}
245
- query_params[:'offset'] = opts[:'offset'] if opts[:'offset']
246
- query_params[:'count'] = opts[:'count'] if opts[:'count']
247
- query_params[:'includeShared'] = opts[:'include_shared'] if opts[:'include_shared']
243
+ query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
244
+ query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil?
245
+ query_params[:'includeShared'] = opts[:'include_shared'] if !opts[:'include_shared'].nil?
248
246
 
249
247
  # header parameters
250
248
  header_params = {}
251
249
 
252
250
  # HTTP header 'Accept' (if needed)
253
- _header_accept = ['application/json']
254
- _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result
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
255
253
 
256
254
  # HTTP header 'Content-Type'
257
- _header_content_type = []
258
- header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)
255
+ local_header_content_type = []
256
+ header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
259
257
 
260
258
  # form parameters
261
259
  form_params = {}
262
260
 
263
261
  # http body (model)
264
262
  post_body = nil
265
-
266
263
  auth_names = ['artikcloud_oauth']
267
264
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
268
265
  :header_params => header_params,
@@ -286,7 +283,7 @@ module ArtikCloud
286
283
  # @option opts [BOOLEAN] :include_properties Optional. Boolean (true/false) - If false, only return the user&#39;s device types. If true, also return device types shared by other users.
287
284
  # @return [DevicesEnvelope]
288
285
  def get_user_devices(user_id, opts = {})
289
- data, status_code, headers = get_user_devices_with_http_info(user_id, opts)
286
+ data, _status_code, _headers = get_user_devices_with_http_info(user_id, opts)
290
287
  return data
291
288
  end
292
289
 
@@ -300,38 +297,35 @@ module ArtikCloud
300
297
  # @return [Array<(DevicesEnvelope, Fixnum, Hash)>] DevicesEnvelope data, response status code and response headers
301
298
  def get_user_devices_with_http_info(user_id, opts = {})
302
299
  if @api_client.config.debugging
303
- @api_client.config.logger.debug "Calling API: UsersApi#get_user_devices ..."
300
+ @api_client.config.logger.debug "Calling API: UsersApi.get_user_devices ..."
304
301
  end
305
-
306
302
  # verify the required parameter 'user_id' is set
307
- fail "Missing the required parameter 'user_id' when calling get_user_devices" if user_id.nil?
308
-
303
+ fail ArgumentError, "Missing the required parameter 'user_id' when calling UsersApi.get_user_devices" if user_id.nil?
309
304
  # resource path
310
305
  local_var_path = "/users/{userId}/devices".sub('{format}','json').sub('{' + 'userId' + '}', user_id.to_s)
311
306
 
312
307
  # query parameters
313
308
  query_params = {}
314
- query_params[:'offset'] = opts[:'offset'] if opts[:'offset']
315
- query_params[:'count'] = opts[:'count'] if opts[:'count']
316
- query_params[:'includeProperties'] = opts[:'include_properties'] if opts[:'include_properties']
309
+ query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
310
+ query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil?
311
+ query_params[:'includeProperties'] = opts[:'include_properties'] if !opts[:'include_properties'].nil?
317
312
 
318
313
  # header parameters
319
314
  header_params = {}
320
315
 
321
316
  # HTTP header 'Accept' (if needed)
322
- _header_accept = ['application/json']
323
- _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result
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
324
319
 
325
320
  # HTTP header 'Content-Type'
326
- _header_content_type = []
327
- header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)
321
+ local_header_content_type = []
322
+ header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
328
323
 
329
324
  # form parameters
330
325
  form_params = {}
331
326
 
332
327
  # http body (model)
333
328
  post_body = nil
334
-
335
329
  auth_names = ['artikcloud_oauth']
336
330
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
337
331
  :header_params => header_params,
@@ -353,7 +347,7 @@ module ArtikCloud
353
347
  # @option opts [String] :aid Application ID
354
348
  # @return [PropertiesEnvelope]
355
349
  def get_user_properties(user_id, opts = {})
356
- data, status_code, headers = get_user_properties_with_http_info(user_id, opts)
350
+ data, _status_code, _headers = get_user_properties_with_http_info(user_id, opts)
357
351
  return data
358
352
  end
359
353
 
@@ -365,36 +359,33 @@ module ArtikCloud
365
359
  # @return [Array<(PropertiesEnvelope, Fixnum, Hash)>] PropertiesEnvelope data, response status code and response headers
366
360
  def get_user_properties_with_http_info(user_id, opts = {})
367
361
  if @api_client.config.debugging
368
- @api_client.config.logger.debug "Calling API: UsersApi#get_user_properties ..."
362
+ @api_client.config.logger.debug "Calling API: UsersApi.get_user_properties ..."
369
363
  end
370
-
371
364
  # verify the required parameter 'user_id' is set
372
- fail "Missing the required parameter 'user_id' when calling get_user_properties" if user_id.nil?
373
-
365
+ fail ArgumentError, "Missing the required parameter 'user_id' when calling UsersApi.get_user_properties" if user_id.nil?
374
366
  # resource path
375
367
  local_var_path = "/users/{userId}/properties".sub('{format}','json').sub('{' + 'userId' + '}', user_id.to_s)
376
368
 
377
369
  # query parameters
378
370
  query_params = {}
379
- query_params[:'aid'] = opts[:'aid'] if opts[:'aid']
371
+ query_params[:'aid'] = opts[:'aid'] if !opts[:'aid'].nil?
380
372
 
381
373
  # header parameters
382
374
  header_params = {}
383
375
 
384
376
  # HTTP header 'Accept' (if needed)
385
- _header_accept = ['application/json']
386
- _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result
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
387
379
 
388
380
  # HTTP header 'Content-Type'
389
- _header_content_type = []
390
- header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)
381
+ local_header_content_type = []
382
+ header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
391
383
 
392
384
  # form parameters
393
385
  form_params = {}
394
386
 
395
387
  # http body (model)
396
388
  post_body = nil
397
-
398
389
  auth_names = ['artikcloud_oauth']
399
390
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
400
391
  :header_params => header_params,
@@ -414,12 +405,11 @@ module ArtikCloud
414
405
  # @param user_id User ID.
415
406
  # @param [Hash] opts the optional parameters
416
407
  # @option opts [BOOLEAN] :exclude_disabled Exclude disabled rules in the result.
417
- # @option opts [BOOLEAN] :other_applications List rules of other applications if current application id has full read access
418
408
  # @option opts [Integer] :count Desired count of items in the result set.
419
409
  # @option opts [Integer] :offset Offset for pagination.
420
410
  # @return [RulesEnvelope]
421
411
  def get_user_rules(user_id, opts = {})
422
- data, status_code, headers = get_user_rules_with_http_info(user_id, opts)
412
+ data, _status_code, _headers = get_user_rules_with_http_info(user_id, opts)
423
413
  return data
424
414
  end
425
415
 
@@ -428,45 +418,40 @@ module ArtikCloud
428
418
  # @param user_id User ID.
429
419
  # @param [Hash] opts the optional parameters
430
420
  # @option opts [BOOLEAN] :exclude_disabled Exclude disabled rules in the result.
431
- # @option opts [BOOLEAN] :other_applications List rules of other applications if current application id has full read access
432
421
  # @option opts [Integer] :count Desired count of items in the result set.
433
422
  # @option opts [Integer] :offset Offset for pagination.
434
423
  # @return [Array<(RulesEnvelope, Fixnum, Hash)>] RulesEnvelope data, response status code and response headers
435
424
  def get_user_rules_with_http_info(user_id, opts = {})
436
425
  if @api_client.config.debugging
437
- @api_client.config.logger.debug "Calling API: UsersApi#get_user_rules ..."
426
+ @api_client.config.logger.debug "Calling API: UsersApi.get_user_rules ..."
438
427
  end
439
-
440
428
  # verify the required parameter 'user_id' is set
441
- fail "Missing the required parameter 'user_id' when calling get_user_rules" if user_id.nil?
442
-
429
+ fail ArgumentError, "Missing the required parameter 'user_id' when calling UsersApi.get_user_rules" if user_id.nil?
443
430
  # resource path
444
431
  local_var_path = "/users/{userId}/rules".sub('{format}','json').sub('{' + 'userId' + '}', user_id.to_s)
445
432
 
446
433
  # query parameters
447
434
  query_params = {}
448
- query_params[:'excludeDisabled'] = opts[:'exclude_disabled'] if opts[:'exclude_disabled']
449
- query_params[:'otherApplications'] = opts[:'other_applications'] if opts[:'other_applications']
450
- query_params[:'count'] = opts[:'count'] if opts[:'count']
451
- query_params[:'offset'] = opts[:'offset'] if opts[:'offset']
435
+ query_params[:'excludeDisabled'] = opts[:'exclude_disabled'] if !opts[:'exclude_disabled'].nil?
436
+ query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil?
437
+ query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?
452
438
 
453
439
  # header parameters
454
440
  header_params = {}
455
441
 
456
442
  # HTTP header 'Accept' (if needed)
457
- _header_accept = ['application/json']
458
- _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result
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
459
445
 
460
446
  # HTTP header 'Content-Type'
461
- _header_content_type = []
462
- header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)
447
+ local_header_content_type = []
448
+ header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)
463
449
 
464
450
  # form parameters
465
451
  form_params = {}
466
452
 
467
453
  # http body (model)
468
454
  post_body = nil
469
-
470
455
  auth_names = ['artikcloud_oauth']
471
456
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
472
457
  :header_params => header_params,
@@ -489,7 +474,7 @@ module ArtikCloud
489
474
  # @option opts [String] :aid Application ID
490
475
  # @return [PropertiesEnvelope]
491
476
  def update_user_properties(user_id, properties, opts = {})
492
- data, status_code, headers = update_user_properties_with_http_info(user_id, properties, opts)
477
+ data, _status_code, _headers = update_user_properties_with_http_info(user_id, properties, opts)
493
478
  return data
494
479
  end
495
480
 
@@ -502,39 +487,35 @@ module ArtikCloud
502
487
  # @return [Array<(PropertiesEnvelope, Fixnum, Hash)>] PropertiesEnvelope data, response status code and response headers
503
488
  def update_user_properties_with_http_info(user_id, properties, opts = {})
504
489
  if @api_client.config.debugging
505
- @api_client.config.logger.debug "Calling API: UsersApi#update_user_properties ..."
490
+ @api_client.config.logger.debug "Calling API: UsersApi.update_user_properties ..."
506
491
  end
507
-
508
492
  # verify the required parameter 'user_id' is set
509
- fail "Missing the required parameter 'user_id' when calling update_user_properties" if user_id.nil?
510
-
493
+ fail ArgumentError, "Missing the required parameter 'user_id' when calling UsersApi.update_user_properties" if user_id.nil?
511
494
  # verify the required parameter 'properties' is set
512
- fail "Missing the required parameter 'properties' when calling update_user_properties" if properties.nil?
513
-
495
+ fail ArgumentError, "Missing the required parameter 'properties' when calling UsersApi.update_user_properties" if properties.nil?
514
496
  # resource path
515
497
  local_var_path = "/users/{userId}/properties".sub('{format}','json').sub('{' + 'userId' + '}', user_id.to_s)
516
498
 
517
499
  # query parameters
518
500
  query_params = {}
519
- query_params[:'aid'] = opts[:'aid'] if opts[:'aid']
501
+ query_params[:'aid'] = opts[:'aid'] if !opts[:'aid'].nil?
520
502
 
521
503
  # header parameters
522
504
  header_params = {}
523
505
 
524
506
  # HTTP header 'Accept' (if needed)
525
- _header_accept = ['application/json']
526
- _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result
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
527
509
 
528
510
  # HTTP header 'Content-Type'
529
- _header_content_type = ['application/json']
530
- header_params['Content-Type'] = @api_client.select_header_content_type(_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)
531
513
 
532
514
  # form parameters
533
515
  form_params = {}
534
516
 
535
517
  # http body (model)
536
518
  post_body = @api_client.object_to_http_body(properties)
537
-
538
519
  auth_names = ['artikcloud_oauth']
539
520
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
540
521
  :header_params => header_params,
@@ -1,14 +1,23 @@
1
1
  =begin
2
- ARTIK Cloud API
2
+ #ARTIK Cloud API
3
+
4
+ #No descripton provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
3
5
 
4
6
  OpenAPI spec version: 2.0.0
5
7
 
6
8
  Generated by: https://github.com/swagger-api/swagger-codegen.git
7
9
 
8
- License: MIT
9
- http://en.wikipedia.org/wiki/MIT_License
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
10
15
 
11
- Terms of Service: http://www.samsung.com/global/business/mobile/info/terms-and-conditions.html
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.
12
21
 
13
22
  =end
14
23
 
@@ -29,6 +38,8 @@ module ArtikCloud
29
38
  # @return [Hash]
30
39
  attr_accessor :default_headers
31
40
 
41
+ # Initializes the ApiClient
42
+ # @option config [Configuration] Configuration for initializing the object, default to Configuration.default
32
43
  def initialize(config = Configuration.default)
33
44
  @config = config
34
45
  @user_agent = "Swagger-Codegen/#{VERSION}/ruby"
@@ -69,6 +80,15 @@ module ArtikCloud
69
80
  return data, response.code, response.headers
70
81
  end
71
82
 
83
+ # Builds the HTTP request
84
+ #
85
+ # @param [String] http_method HTTP method/verb (e.g. POST)
86
+ # @param [String] path URL path (e.g. /account/new)
87
+ # @option opts [Hash] :header_params Header parameters
88
+ # @option opts [Hash] :query_params Query parameters
89
+ # @option opts [Hash] :form_params Query parameters
90
+ # @option opts [Object] :body HTTP body (JSON/XML)
91
+ # @return [Typhoeus::Request] A Typhoeus Request
72
92
  def build_request(http_method, path, opts = {})
73
93
  url = build_request_url(path)
74
94
  http_method = http_method.to_sym.downcase
@@ -77,21 +97,25 @@ module ArtikCloud
77
97
  query_params = opts[:query_params] || {}
78
98
  form_params = opts[:form_params] || {}
79
99
 
80
-
81
100
  update_params_for_auth! header_params, query_params, opts[:auth_names]
82
-
101
+
102
+ # set ssl_verifyhosts option based on @config.verify_ssl_host (true/false)
103
+ _verify_ssl_host = @config.verify_ssl_host ? 2 : 0
83
104
 
84
105
  req_opts = {
85
106
  :method => http_method,
86
107
  :headers => header_params,
87
108
  :params => query_params,
109
+ :params_encoding => @config.params_encoding,
88
110
  :timeout => @config.timeout,
89
111
  :ssl_verifypeer => @config.verify_ssl,
112
+ :ssl_verifyhost => _verify_ssl_host,
90
113
  :sslcert => @config.cert_file,
91
114
  :sslkey => @config.key_file,
92
115
  :verbose => @config.debugging
93
116
  }
94
117
 
118
+ # set custom cert, if provided
95
119
  req_opts[:cainfo] = @config.ssl_ca_cert if @config.ssl_ca_cert
96
120
 
97
121
  if [:post, :patch, :put, :delete].include?(http_method)
@@ -110,12 +134,15 @@ module ArtikCloud
110
134
  # application/json
111
135
  # application/json; charset=UTF8
112
136
  # APPLICATION/JSON
137
+ # @param [String] mime MIME
138
+ # @return [Boolean] True if the MIME is applicaton/json
113
139
  def json_mime?(mime)
114
- !!(mime =~ /\Aapplication\/json(;.*)?\z/i)
140
+ !(mime =~ /\Aapplication\/json(;.*)?\z/i).nil?
115
141
  end
116
142
 
117
143
  # Deserialize the response to the given return type.
118
144
  #
145
+ # @param [Response] response HTTP response
119
146
  # @param [String] return_type some examples: "User", "Array[User]", "Hash[String,Integer]"
120
147
  def deserialize(response, return_type)
121
148
  body = response.body
@@ -146,6 +173,9 @@ module ArtikCloud
146
173
  end
147
174
 
148
175
  # Convert data to the given return type.
176
+ # @param [Object] data Data to be converted
177
+ # @param [String] return_type Return type
178
+ # @return [Mixed] Data in a particular type
149
179
  def convert_to_type(data, return_type)
150
180
  return nil if data.nil?
151
181
  case return_type
@@ -191,7 +221,7 @@ module ArtikCloud
191
221
  # @return [Tempfile] the file downloaded
192
222
  def download_file(response)
193
223
  content_disposition = response.headers['Content-Disposition']
194
- if content_disposition
224
+ if content_disposition and content_disposition =~ /filename=/i
195
225
  filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1]
196
226
  prefix = sanitize_filename(filename)
197
227
  else
@@ -218,7 +248,7 @@ module ArtikCloud
218
248
  # @param [String] filename the filename to be sanitized
219
249
  # @return [String] the sanitized filename
220
250
  def sanitize_filename(filename)
221
- filename.gsub /.*[\/\\]/, ''
251
+ filename.gsub(/.*[\/\\]/, '')
222
252
  end
223
253
 
224
254
  def build_request_url(path)
@@ -227,6 +257,12 @@ module ArtikCloud
227
257
  URI.encode(@config.base_url + path)
228
258
  end
229
259
 
260
+ # Builds the HTTP request body
261
+ #
262
+ # @param [Hash] header_params Header parameters
263
+ # @param [Hash] form_params Query parameters
264
+ # @param [Object] body HTTP body (JSON/XML)
265
+ # @return [String] HTTP body data in the form of string
230
266
  def build_request_body(header_params, form_params, body)
231
267
  # http form
232
268
  if header_params['Content-Type'] == 'application/x-www-form-urlencoded' ||
@@ -250,6 +286,10 @@ module ArtikCloud
250
286
  end
251
287
 
252
288
  # Update hearder and query params based on authentication settings.
289
+ #
290
+ # @param [Hash] header_params Header parameters
291
+ # @param [Hash] form_params Query parameters
292
+ # @param [String] auth_names Authentication scheme name
253
293
  def update_params_for_auth!(header_params, query_params, auth_names)
254
294
  Array(auth_names).each do |auth_name|
255
295
  auth_setting = @config.auth_settings[auth_name]
@@ -262,6 +302,9 @@ module ArtikCloud
262
302
  end
263
303
  end
264
304
 
305
+ # Sets user agent in HTTP header
306
+ #
307
+ # @param [String] user_agent User agent (e.g. swagger-codegen/ruby/1.0.0)
265
308
  def user_agent=(user_agent)
266
309
  @user_agent = user_agent
267
310
  @default_headers['User-Agent'] = @user_agent
@@ -293,13 +336,13 @@ module ArtikCloud
293
336
  # @return [String] JSON string representation of the object
294
337
  def object_to_http_body(model)
295
338
  return model if model.nil? || model.is_a?(String)
296
- _body = nil
339
+ local_body = nil
297
340
  if model.is_a?(Array)
298
- _body = model.map{|m| object_to_hash(m) }
341
+ local_body = model.map{|m| object_to_hash(m) }
299
342
  else
300
- _body = object_to_hash(model)
343
+ local_body = object_to_hash(model)
301
344
  end
302
- _body.to_json
345
+ local_body.to_json
303
346
  end
304
347
 
305
348
  # Convert object(non-array) to hash.