artikcloud 2.0.0 → 2.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +12 -12
- data/README.md +33 -10
- data/artikcloud.gemspec +5 -6
- data/docs/Action.md +9 -0
- data/docs/ActionArray.md +8 -0
- data/docs/Actions.md +12 -0
- data/docs/DeviceTypesApi.md +10 -10
- data/docs/DevicesApi.md +68 -15
- data/docs/ExportApi.md +10 -10
- data/docs/Message.md +11 -0
- data/docs/MessagesApi.md +205 -27
- data/docs/NormalizedAction.md +16 -0
- data/docs/NormalizedActionsEnvelope.md +17 -0
- data/docs/PresenceEnvelope.md +9 -0
- data/docs/PresenceModel.md +9 -0
- data/docs/RegistrationsApi.md +6 -6
- data/docs/RulesApi.md +8 -8
- data/docs/RulesEnvelope.md +1 -1
- data/docs/SnapshotResponse.md +9 -0
- data/docs/SnapshotResponses.md +10 -0
- data/docs/SnapshotsResponseEnvelope.md +9 -0
- data/docs/TagsApi.md +7 -7
- data/docs/TokenInfo.md +11 -0
- data/docs/TokenInfoSuccessResponse.md +8 -0
- data/docs/TokensApi.md +54 -7
- data/docs/UsersApi.md +18 -20
- data/git_push.sh +16 -1
- data/lib/artikcloud/api/device_types_api.rb +52 -59
- data/lib/artikcloud/api/devices_api.rb +120 -76
- data/lib/artikcloud/api/export_api.rb +43 -45
- data/lib/artikcloud/api/messages_api.rb +285 -103
- data/lib/artikcloud/api/registrations_api.rb +34 -34
- data/lib/artikcloud/api/rules_api.rb +43 -48
- data/lib/artikcloud/api/tags_api.rb +37 -35
- data/lib/artikcloud/api/tokens_api.rb +85 -30
- data/lib/artikcloud/api/users_api.rb +83 -102
- data/lib/artikcloud/api_client.rb +56 -13
- data/lib/artikcloud/api_error.rb +13 -4
- data/lib/artikcloud/configuration.rb +45 -1
- data/lib/artikcloud/models/ack_envelope.rb +59 -24
- data/lib/artikcloud/models/acknowledgement.rb +65 -33
- data/lib/artikcloud/models/action.rb +212 -0
- data/lib/artikcloud/models/action_array.rb +201 -0
- data/lib/artikcloud/models/action_details.rb +61 -27
- data/lib/artikcloud/models/action_details_array.rb +59 -24
- data/lib/artikcloud/models/action_in.rb +69 -39
- data/lib/artikcloud/models/action_out.rb +67 -36
- data/lib/artikcloud/models/actions.rb +241 -0
- data/lib/artikcloud/models/aggregate_data.rb +69 -39
- data/lib/artikcloud/models/aggregates_histogram_data.rb +71 -42
- data/lib/artikcloud/models/aggregates_histogram_response.rb +71 -42
- data/lib/artikcloud/models/aggregates_response.rb +69 -39
- data/lib/artikcloud/models/app_properties.rb +64 -30
- data/lib/artikcloud/models/check_token_message.rb +59 -24
- data/lib/artikcloud/models/check_token_response.rb +59 -24
- data/lib/artikcloud/models/device.rb +85 -63
- data/lib/artikcloud/models/device_array.rb +59 -24
- data/lib/artikcloud/models/device_envelope.rb +60 -24
- data/lib/artikcloud/models/device_reg_complete_request.rb +59 -24
- data/lib/artikcloud/models/device_reg_confirm_user_request.rb +63 -30
- data/lib/artikcloud/models/device_reg_confirm_user_response.rb +59 -24
- data/lib/artikcloud/models/device_reg_confirm_user_response_envelope.rb +59 -24
- data/lib/artikcloud/models/device_reg_status_response.rb +61 -27
- data/lib/artikcloud/models/device_reg_status_response_envelope.rb +59 -24
- data/lib/artikcloud/models/device_token.rb +69 -33
- data/lib/artikcloud/models/device_token_envelope.rb +60 -24
- data/lib/artikcloud/models/device_type.rb +93 -75
- data/lib/artikcloud/models/device_type_array.rb +59 -24
- data/lib/artikcloud/models/device_type_envelope.rb +60 -24
- data/lib/artikcloud/models/device_types_envelope.rb +68 -33
- data/lib/artikcloud/models/devices_envelope.rb +68 -33
- data/lib/artikcloud/models/error_envelope.rb +59 -24
- data/lib/artikcloud/models/export_data.rb +71 -42
- data/lib/artikcloud/models/export_data_array.rb +59 -24
- data/lib/artikcloud/models/export_history_response.rb +65 -33
- data/lib/artikcloud/models/export_normalized_messages_response.rb +83 -60
- data/lib/artikcloud/models/export_request.rb +73 -45
- data/lib/artikcloud/models/export_request_data.rb +79 -54
- data/lib/artikcloud/models/export_request_info.rb +77 -51
- data/lib/artikcloud/models/export_request_response.rb +59 -24
- data/lib/artikcloud/models/export_response.rb +79 -54
- data/lib/artikcloud/models/export_status_response.rb +67 -36
- data/lib/artikcloud/models/field_path.rb +59 -24
- data/lib/artikcloud/models/field_presence.rb +60 -24
- data/lib/artikcloud/models/field_presence_envelope.rb +78 -42
- data/lib/artikcloud/models/fields_actions.rb +61 -27
- data/lib/artikcloud/models/manifest_properties.rb +60 -24
- data/lib/artikcloud/models/manifest_properties_envelope.rb +60 -24
- data/lib/artikcloud/models/manifest_versions.rb +60 -24
- data/lib/artikcloud/models/manifest_versions_envelope.rb +60 -24
- data/lib/artikcloud/models/message.rb +233 -0
- data/lib/artikcloud/models/message_action.rb +67 -36
- data/lib/artikcloud/models/message_id.rb +59 -24
- data/lib/artikcloud/models/message_id_envelope.rb +59 -24
- data/lib/artikcloud/models/message_in.rb +69 -39
- data/lib/artikcloud/models/message_out.rb +67 -36
- data/lib/artikcloud/models/non_empty_string.rb +59 -24
- data/lib/artikcloud/models/normalized_action.rb +279 -0
- data/lib/artikcloud/models/normalized_actions_envelope.rb +285 -0
- data/lib/artikcloud/models/normalized_message.rb +81 -45
- data/lib/artikcloud/models/normalized_messages_envelope.rb +80 -51
- data/lib/artikcloud/models/output_rule.rb +85 -63
- data/lib/artikcloud/models/presence_envelope.rb +208 -0
- data/lib/artikcloud/models/presence_model.rb +208 -0
- data/lib/artikcloud/models/properties_envelope.rb +60 -24
- data/lib/artikcloud/models/refresh_token_response.rb +65 -33
- data/lib/artikcloud/models/register_message.rb +67 -36
- data/lib/artikcloud/models/rule_array.rb +59 -24
- data/lib/artikcloud/models/rule_creation_info.rb +65 -33
- data/lib/artikcloud/models/rule_envelope.rb +59 -24
- data/lib/artikcloud/models/rule_error.rb +65 -33
- data/lib/artikcloud/models/rule_update_info.rb +65 -33
- data/lib/artikcloud/models/rule_warning_output.rb +61 -27
- data/lib/artikcloud/models/rules_envelope.rb +69 -35
- data/lib/artikcloud/models/snapshot_response.rb +210 -0
- data/lib/artikcloud/models/snapshot_responses.rb +219 -0
- data/lib/artikcloud/models/snapshots_response_envelope.rb +208 -0
- data/lib/artikcloud/models/tag.rb +61 -27
- data/lib/artikcloud/models/tag_array.rb +59 -24
- data/lib/artikcloud/models/tags_envelope.rb +59 -24
- data/lib/artikcloud/models/token.rb +65 -33
- data/lib/artikcloud/models/token_info.rb +226 -0
- data/lib/artikcloud/models/token_info_success_response.rb +199 -0
- data/lib/artikcloud/models/token_request.rb +59 -24
- data/lib/artikcloud/models/token_response.rb +59 -24
- data/lib/artikcloud/models/unregister_device_response.rb +79 -54
- data/lib/artikcloud/models/unregister_device_response_envelope.rb +59 -24
- data/lib/artikcloud/models/user.rb +77 -42
- data/lib/artikcloud/models/user_envelope.rb +60 -24
- data/lib/artikcloud/models/web_socket_error.rb +63 -30
- data/lib/artikcloud/version.rb +14 -5
- data/lib/artikcloud.rb +26 -4
- data/spec/api/device_types_api_spec.rb +110 -0
- data/spec/api/devices_api_spec.rb +143 -0
- data/spec/api/export_api_spec.rb +96 -0
- data/spec/api/messages_api_spec.rb +7 -7
- data/spec/api/registrations_api_spec.rb +82 -0
- data/spec/api/rules_api_spec.rb +96 -0
- data/spec/api/tags_api_spec.rb +84 -0
- data/spec/api/tokens_api_spec.rb +12 -21
- data/spec/api/users_api_spec.rb +1 -1
- data/spec/spec_helper.rb +1 -1
- 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
|
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
|
10
15
|
|
11
|
-
|
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,
|
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
|
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
|
-
|
67
|
-
|
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
|
-
|
71
|
-
header_params['Content-Type'] = @api_client.select_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,
|
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
|
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
|
-
|
130
|
-
|
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
|
-
|
134
|
-
header_params['Content-Type'] = @api_client.select_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,
|
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
|
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
|
-
|
185
|
-
|
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
|
-
|
189
|
-
header_params['Content-Type'] = @api_client.select_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'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,
|
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
|
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
|
-
|
254
|
-
|
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
|
-
|
258
|
-
header_params['Content-Type'] = @api_client.select_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'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,
|
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
|
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
|
-
|
323
|
-
|
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
|
-
|
327
|
-
header_params['Content-Type'] = @api_client.select_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,
|
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
|
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
|
-
|
386
|
-
|
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
|
-
|
390
|
-
header_params['Content-Type'] = @api_client.select_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,
|
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
|
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[:'
|
450
|
-
query_params[:'
|
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
|
-
|
458
|
-
|
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
|
-
|
462
|
-
header_params['Content-Type'] = @api_client.select_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,
|
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
|
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
|
-
|
526
|
-
|
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
|
-
|
530
|
-
header_params['Content-Type'] = @api_client.select_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
|
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
|
10
15
|
|
11
|
-
|
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
|
-
|
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
|
-
|
339
|
+
local_body = nil
|
297
340
|
if model.is_a?(Array)
|
298
|
-
|
341
|
+
local_body = model.map{|m| object_to_hash(m) }
|
299
342
|
else
|
300
|
-
|
343
|
+
local_body = object_to_hash(model)
|
301
344
|
end
|
302
|
-
|
345
|
+
local_body.to_json
|
303
346
|
end
|
304
347
|
|
305
348
|
# Convert object(non-array) to hash.
|