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.
- checksums.yaml +4 -4
- data/Gemfile +5 -2
- data/LICENSE +1 -1
- data/README.md +39 -4
- data/Rakefile +8 -0
- data/artikcloud.gemspec +5 -16
- data/docs/Device.md +2 -0
- data/docs/DeviceShareInfo.md +8 -0
- data/docs/DeviceSharing.md +11 -0
- data/docs/DeviceSharingArray.md +8 -0
- data/docs/DeviceSharingEnvelope.md +11 -0
- data/docs/DeviceSharingId.md +8 -0
- data/docs/DeviceStatus.md +9 -0
- data/docs/DeviceStatusBatch.md +11 -0
- data/docs/DeviceStatusData.md +12 -0
- data/docs/DeviceStatusPut.md +8 -0
- data/docs/DeviceStatusPutData.md +8 -0
- data/docs/DevicessharesApi.md +235 -0
- data/docs/DevicestatusApi.md +183 -0
- data/docs/NotifMessage.md +15 -0
- data/docs/NotifMessageArray.md +8 -0
- data/docs/NotifMessagesResponse.md +12 -0
- data/docs/Subscription.md +24 -0
- data/docs/SubscriptionArray.md +8 -0
- data/docs/SubscriptionEnvelope.md +8 -0
- data/docs/SubscriptionInfo.md +20 -0
- data/docs/SubscriptionsApi.md +342 -0
- data/docs/SubscriptionsEnvelope.md +11 -0
- data/docs/TaskParameters.md +2 -0
- data/docs/UpdateParameters.md +8 -0
- data/docs/UsersApi.md +67 -1
- data/docs/ValidationCallbackInfo.md +9 -0
- data/git_push.sh +0 -12
- data/lib/artikcloud.rb +24 -13
- data/lib/artikcloud/api/device_types_api.rb +7 -55
- data/lib/artikcloud/api/devices_api.rb +12 -66
- data/lib/artikcloud/api/devices_management_api.rb +16 -118
- data/lib/artikcloud/api/devicesshares_api.rb +244 -0
- data/lib/artikcloud/api/devicestatus_api.rb +190 -0
- data/lib/artikcloud/api/export_api.rb +5 -41
- data/lib/artikcloud/api/messages_api.rb +10 -76
- data/lib/artikcloud/api/registrations_api.rb +4 -34
- data/lib/artikcloud/api/rules_api.rb +5 -41
- data/lib/artikcloud/api/subscriptions_api.rb +346 -0
- data/lib/artikcloud/api/tags_api.rb +4 -34
- data/lib/artikcloud/api/tokens_api.rb +5 -33
- data/lib/artikcloud/api/users_api.rb +79 -67
- data/lib/artikcloud/api_client.rb +17 -20
- data/lib/artikcloud/api_error.rb +8 -18
- data/lib/artikcloud/configuration.rb +1 -13
- data/lib/artikcloud/models/ack_envelope.rb +4 -16
- data/lib/artikcloud/models/acknowledgement.rb +4 -16
- data/lib/artikcloud/models/action.rb +4 -16
- data/lib/artikcloud/models/action_array.rb +4 -16
- data/lib/artikcloud/models/action_details.rb +4 -16
- data/lib/artikcloud/models/action_details_array.rb +4 -16
- data/lib/artikcloud/models/action_in.rb +4 -16
- data/lib/artikcloud/models/action_out.rb +4 -16
- data/lib/artikcloud/models/actions.rb +4 -16
- data/lib/artikcloud/models/aggregate_data.rb +4 -16
- data/lib/artikcloud/models/aggregates_histogram_data.rb +4 -16
- data/lib/artikcloud/models/aggregates_histogram_response.rb +4 -16
- data/lib/artikcloud/models/aggregates_response.rb +4 -16
- data/lib/artikcloud/models/app_properties.rb +8 -16
- data/lib/artikcloud/models/check_token_message.rb +4 -16
- data/lib/artikcloud/models/check_token_response.rb +4 -16
- data/lib/artikcloud/models/device.rb +28 -20
- data/lib/artikcloud/models/device_array.rb +4 -16
- data/lib/artikcloud/models/device_envelope.rb +8 -16
- data/lib/artikcloud/models/device_reg_complete_request.rb +4 -16
- data/lib/artikcloud/models/device_reg_confirm_user_request.rb +4 -16
- data/lib/artikcloud/models/device_reg_confirm_user_response.rb +4 -16
- data/lib/artikcloud/models/device_reg_confirm_user_response_envelope.rb +4 -16
- data/lib/artikcloud/models/device_reg_status_response.rb +4 -16
- data/lib/artikcloud/models/device_reg_status_response_envelope.rb +4 -16
- data/lib/artikcloud/models/device_share_info.rb +188 -0
- data/lib/artikcloud/models/device_sharing.rb +218 -0
- data/lib/artikcloud/models/device_sharing_array.rb +189 -0
- data/lib/artikcloud/models/device_sharing_envelope.rb +214 -0
- data/lib/artikcloud/models/device_sharing_id.rb +188 -0
- data/lib/artikcloud/models/device_status.rb +196 -0
- data/lib/artikcloud/models/device_status_batch.rb +216 -0
- data/lib/artikcloud/models/device_status_data.rb +225 -0
- data/lib/artikcloud/models/device_status_put.rb +187 -0
- data/lib/artikcloud/models/device_status_put_data.rb +187 -0
- data/lib/artikcloud/models/device_task.rb +4 -16
- data/lib/artikcloud/models/device_task_update_request.rb +4 -16
- data/lib/artikcloud/models/device_task_update_response.rb +4 -16
- data/lib/artikcloud/models/device_token.rb +20 -16
- data/lib/artikcloud/models/device_token_envelope.rb +8 -16
- data/lib/artikcloud/models/device_type.rb +4 -16
- data/lib/artikcloud/models/device_type_array.rb +4 -16
- data/lib/artikcloud/models/device_type_envelope.rb +8 -16
- data/lib/artikcloud/models/device_type_info.rb +4 -16
- data/lib/artikcloud/models/device_type_info_envelope.rb +4 -16
- data/lib/artikcloud/models/device_types_envelope.rb +16 -16
- data/lib/artikcloud/models/device_types_info.rb +4 -16
- data/lib/artikcloud/models/device_types_info_envelope.rb +4 -16
- data/lib/artikcloud/models/devices_envelope.rb +16 -16
- data/lib/artikcloud/models/error_envelope.rb +4 -16
- data/lib/artikcloud/models/event_feed_data.rb +4 -16
- data/lib/artikcloud/models/export_data.rb +4 -16
- data/lib/artikcloud/models/export_data_array.rb +4 -16
- data/lib/artikcloud/models/export_history_response.rb +4 -16
- data/lib/artikcloud/models/export_normalized_messages_response.rb +4 -16
- data/lib/artikcloud/models/export_request.rb +4 -16
- data/lib/artikcloud/models/export_request_data.rb +4 -16
- data/lib/artikcloud/models/export_request_info.rb +4 -16
- data/lib/artikcloud/models/export_request_response.rb +4 -16
- data/lib/artikcloud/models/export_response.rb +4 -16
- data/lib/artikcloud/models/export_status_response.rb +4 -16
- data/lib/artikcloud/models/field_path.rb +4 -16
- data/lib/artikcloud/models/field_presence.rb +8 -16
- data/lib/artikcloud/models/field_presence_envelope.rb +32 -16
- data/lib/artikcloud/models/fields_actions.rb +4 -16
- data/lib/artikcloud/models/manifest_properties.rb +8 -16
- data/lib/artikcloud/models/manifest_properties_envelope.rb +8 -16
- data/lib/artikcloud/models/manifest_versions.rb +8 -16
- data/lib/artikcloud/models/manifest_versions_envelope.rb +8 -16
- data/lib/artikcloud/models/message.rb +4 -16
- data/lib/artikcloud/models/message_action.rb +4 -16
- data/lib/artikcloud/models/message_id.rb +4 -16
- data/lib/artikcloud/models/message_id_envelope.rb +4 -16
- data/lib/artikcloud/models/message_in.rb +4 -16
- data/lib/artikcloud/models/message_out.rb +4 -16
- data/lib/artikcloud/models/metadata_envelope.rb +4 -16
- data/lib/artikcloud/models/metadata_properties_envelope.rb +4 -16
- data/lib/artikcloud/models/metadata_query_envelope.rb +4 -16
- data/lib/artikcloud/models/non_empty_string.rb +4 -16
- data/lib/artikcloud/models/normalized_action.rb +36 -16
- data/lib/artikcloud/models/normalized_actions_envelope.rb +16 -16
- data/lib/artikcloud/models/normalized_message.rb +36 -16
- data/lib/artikcloud/models/normalized_messages_envelope.rb +16 -16
- data/lib/artikcloud/models/notif_message.rb +252 -0
- data/lib/artikcloud/models/notif_message_array.rb +189 -0
- data/lib/artikcloud/models/notif_messages_response.rb +223 -0
- data/lib/artikcloud/models/output_rule.rb +4 -16
- data/lib/artikcloud/models/presence_envelope.rb +4 -16
- data/lib/artikcloud/models/presence_model.rb +4 -16
- data/lib/artikcloud/models/properties_envelope.rb +8 -16
- data/lib/artikcloud/models/refresh_token_response.rb +4 -16
- data/lib/artikcloud/models/register_message.rb +4 -16
- data/lib/artikcloud/models/rule_array.rb +4 -16
- data/lib/artikcloud/models/rule_creation_info.rb +4 -16
- data/lib/artikcloud/models/rule_envelope.rb +4 -16
- data/lib/artikcloud/models/rule_error.rb +4 -16
- data/lib/artikcloud/models/rule_update_info.rb +4 -16
- data/lib/artikcloud/models/rule_warning_output.rb +4 -16
- data/lib/artikcloud/models/rules_envelope.rb +4 -16
- data/lib/artikcloud/models/snapshot_response.rb +4 -16
- data/lib/artikcloud/models/snapshot_responses.rb +4 -16
- data/lib/artikcloud/models/snapshots_response_envelope.rb +4 -16
- data/lib/artikcloud/models/subscription.rb +348 -0
- data/lib/artikcloud/models/subscription_array.rb +189 -0
- data/lib/artikcloud/models/subscription_envelope.rb +187 -0
- data/lib/artikcloud/models/subscription_info.rb +308 -0
- data/lib/artikcloud/models/subscriptions_envelope.rb +214 -0
- data/lib/artikcloud/models/tag.rb +4 -16
- data/lib/artikcloud/models/tag_array.rb +4 -16
- data/lib/artikcloud/models/tags_envelope.rb +4 -16
- data/lib/artikcloud/models/task.rb +4 -16
- data/lib/artikcloud/models/task_by_did.rb +4 -16
- data/lib/artikcloud/models/task_by_did_list.rb +4 -16
- data/lib/artikcloud/models/task_by_did_list_envelope.rb +4 -16
- data/lib/artikcloud/models/task_envelope.rb +4 -16
- data/lib/artikcloud/models/task_history.rb +4 -16
- data/lib/artikcloud/models/task_history_list.rb +4 -16
- data/lib/artikcloud/models/task_list.rb +4 -16
- data/lib/artikcloud/models/task_list_envelope.rb +4 -16
- data/lib/artikcloud/models/task_parameters.rb +25 -17
- data/lib/artikcloud/models/task_request.rb +4 -16
- data/lib/artikcloud/models/task_status.rb +4 -16
- data/lib/artikcloud/models/task_status_counts.rb +4 -16
- data/lib/artikcloud/models/task_statuses.rb +4 -16
- data/lib/artikcloud/models/task_statuses_envelope.rb +4 -16
- data/lib/artikcloud/models/task_statuses_history_envelope.rb +4 -16
- data/lib/artikcloud/models/task_update_request.rb +4 -16
- data/lib/artikcloud/models/task_update_response.rb +4 -16
- data/lib/artikcloud/models/tasks_status_counts.rb +4 -16
- data/lib/artikcloud/models/token.rb +4 -16
- data/lib/artikcloud/models/token_info.rb +4 -16
- data/lib/artikcloud/models/token_info_success_response.rb +4 -16
- data/lib/artikcloud/models/token_request.rb +4 -16
- data/lib/artikcloud/models/token_response.rb +4 -16
- data/lib/artikcloud/models/unregister_device_response.rb +4 -16
- data/lib/artikcloud/models/unregister_device_response_envelope.rb +4 -16
- data/lib/artikcloud/models/update_parameters.rb +188 -0
- data/lib/artikcloud/models/user.rb +28 -16
- data/lib/artikcloud/models/user_envelope.rb +8 -16
- data/lib/artikcloud/models/validation_callback_info.rb +198 -0
- data/lib/artikcloud/models/web_socket_error.rb +4 -16
- data/lib/artikcloud/version.rb +2 -14
- data/pom.xml +1 -1
- data/spec/api/devicesshares_api_spec.rb +87 -0
- data/spec/api/devicestatus_api_spec.rb +75 -0
- data/spec/api/subscriptions_api_spec.rb +112 -0
- metadata +58 -26
|
@@ -1,24 +1,12 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#ARTIK Cloud API
|
|
3
3
|
|
|
4
|
-
#No
|
|
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'
|
|
@@ -109,6 +97,30 @@ module ArtikCloud
|
|
|
109
97
|
# @return Array for valid properies with the reasons
|
|
110
98
|
def list_invalid_properties
|
|
111
99
|
invalid_properties = Array.new
|
|
100
|
+
if @id.nil?
|
|
101
|
+
invalid_properties.push("invalid value for 'id', id cannot be nil.")
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
if @name.nil?
|
|
105
|
+
invalid_properties.push("invalid value for 'name', name cannot be nil.")
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
if @email.nil?
|
|
109
|
+
invalid_properties.push("invalid value for 'email', email cannot be nil.")
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
if @full_name.nil?
|
|
113
|
+
invalid_properties.push("invalid value for 'full_name', full_name cannot be nil.")
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
if @created_on.nil?
|
|
117
|
+
invalid_properties.push("invalid value for 'created_on', created_on cannot be nil.")
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
if @modified_on.nil?
|
|
121
|
+
invalid_properties.push("invalid value for 'modified_on', modified_on cannot be nil.")
|
|
122
|
+
end
|
|
123
|
+
|
|
112
124
|
return invalid_properties
|
|
113
125
|
end
|
|
114
126
|
|
|
@@ -156,7 +168,7 @@ module ArtikCloud
|
|
|
156
168
|
def build_from_hash(attributes)
|
|
157
169
|
return nil unless attributes.is_a?(Hash)
|
|
158
170
|
self.class.swagger_types.each_pair do |key, type|
|
|
159
|
-
if type =~
|
|
171
|
+
if type =~ /\AArray<(.*)>/i
|
|
160
172
|
# check to ensure the input is an array given that the the attribute
|
|
161
173
|
# is documented as an array but the input is not
|
|
162
174
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
@@ -187,7 +199,7 @@ module ArtikCloud
|
|
|
187
199
|
when :Float
|
|
188
200
|
value.to_f
|
|
189
201
|
when :BOOLEAN
|
|
190
|
-
if value.to_s =~
|
|
202
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
191
203
|
true
|
|
192
204
|
else
|
|
193
205
|
false
|
|
@@ -198,7 +210,7 @@ module ArtikCloud
|
|
|
198
210
|
when /\AArray<(?<inner_type>.+)>\z/
|
|
199
211
|
inner_type = Regexp.last_match[:inner_type]
|
|
200
212
|
value.map { |v| _deserialize(inner_type, v) }
|
|
201
|
-
when /\AHash<(?<k_type
|
|
213
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
202
214
|
k_type = Regexp.last_match[:k_type]
|
|
203
215
|
v_type = Regexp.last_match[:v_type]
|
|
204
216
|
{}.tap do |hash|
|
|
@@ -1,24 +1,12 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#ARTIK Cloud API
|
|
3
3
|
|
|
4
|
-
#No
|
|
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'
|
|
@@ -61,6 +49,10 @@ module ArtikCloud
|
|
|
61
49
|
# @return Array for valid properies with the reasons
|
|
62
50
|
def list_invalid_properties
|
|
63
51
|
invalid_properties = Array.new
|
|
52
|
+
if @data.nil?
|
|
53
|
+
invalid_properties.push("invalid value for 'data', data cannot be nil.")
|
|
54
|
+
end
|
|
55
|
+
|
|
64
56
|
return invalid_properties
|
|
65
57
|
end
|
|
66
58
|
|
|
@@ -97,7 +89,7 @@ module ArtikCloud
|
|
|
97
89
|
def build_from_hash(attributes)
|
|
98
90
|
return nil unless attributes.is_a?(Hash)
|
|
99
91
|
self.class.swagger_types.each_pair do |key, type|
|
|
100
|
-
if type =~
|
|
92
|
+
if type =~ /\AArray<(.*)>/i
|
|
101
93
|
# check to ensure the input is an array given that the the attribute
|
|
102
94
|
# is documented as an array but the input is not
|
|
103
95
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
@@ -128,7 +120,7 @@ module ArtikCloud
|
|
|
128
120
|
when :Float
|
|
129
121
|
value.to_f
|
|
130
122
|
when :BOOLEAN
|
|
131
|
-
if value.to_s =~
|
|
123
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
132
124
|
true
|
|
133
125
|
else
|
|
134
126
|
false
|
|
@@ -139,7 +131,7 @@ module ArtikCloud
|
|
|
139
131
|
when /\AArray<(?<inner_type>.+)>\z/
|
|
140
132
|
inner_type = Regexp.last_match[:inner_type]
|
|
141
133
|
value.map { |v| _deserialize(inner_type, v) }
|
|
142
|
-
when /\AHash<(?<k_type
|
|
134
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
143
135
|
k_type = Regexp.last_match[:k_type]
|
|
144
136
|
v_type = Regexp.last_match[:v_type]
|
|
145
137
|
{}.tap do |hash|
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#ARTIK Cloud API
|
|
3
|
+
|
|
4
|
+
#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
|
|
5
|
+
|
|
6
|
+
OpenAPI spec version: 2.0.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
|
9
|
+
|
|
10
|
+
=end
|
|
11
|
+
|
|
12
|
+
require 'date'
|
|
13
|
+
|
|
14
|
+
module ArtikCloud
|
|
15
|
+
#
|
|
16
|
+
class ValidationCallbackInfo
|
|
17
|
+
# Application id that created the subscription.
|
|
18
|
+
attr_accessor :aid
|
|
19
|
+
|
|
20
|
+
# Nonce obtained from the validation request.
|
|
21
|
+
attr_accessor :nonce
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
25
|
+
def self.attribute_map
|
|
26
|
+
{
|
|
27
|
+
:'aid' => :'aid',
|
|
28
|
+
:'nonce' => :'nonce'
|
|
29
|
+
}
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Attribute type mapping.
|
|
33
|
+
def self.swagger_types
|
|
34
|
+
{
|
|
35
|
+
:'aid' => :'String',
|
|
36
|
+
:'nonce' => :'String'
|
|
37
|
+
}
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
# Initializes the object
|
|
41
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
42
|
+
def initialize(attributes = {})
|
|
43
|
+
return unless attributes.is_a?(Hash)
|
|
44
|
+
|
|
45
|
+
# convert string to symbol for hash key
|
|
46
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
|
47
|
+
|
|
48
|
+
if attributes.has_key?(:'aid')
|
|
49
|
+
self.aid = attributes[:'aid']
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
if attributes.has_key?(:'nonce')
|
|
53
|
+
self.nonce = attributes[:'nonce']
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
59
|
+
# @return Array for valid properies with the reasons
|
|
60
|
+
def list_invalid_properties
|
|
61
|
+
invalid_properties = Array.new
|
|
62
|
+
return invalid_properties
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# Check to see if the all the properties in the model are valid
|
|
66
|
+
# @return true if the model is valid
|
|
67
|
+
def valid?
|
|
68
|
+
return true
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
# Checks equality by comparing each attribute.
|
|
72
|
+
# @param [Object] Object to be compared
|
|
73
|
+
def ==(o)
|
|
74
|
+
return true if self.equal?(o)
|
|
75
|
+
self.class == o.class &&
|
|
76
|
+
aid == o.aid &&
|
|
77
|
+
nonce == o.nonce
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
# @see the `==` method
|
|
81
|
+
# @param [Object] Object to be compared
|
|
82
|
+
def eql?(o)
|
|
83
|
+
self == o
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
# Calculates hash code according to all attributes.
|
|
87
|
+
# @return [Fixnum] Hash code
|
|
88
|
+
def hash
|
|
89
|
+
[aid, nonce].hash
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
# Builds the object from hash
|
|
93
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
94
|
+
# @return [Object] Returns the model itself
|
|
95
|
+
def build_from_hash(attributes)
|
|
96
|
+
return nil unless attributes.is_a?(Hash)
|
|
97
|
+
self.class.swagger_types.each_pair do |key, type|
|
|
98
|
+
if type =~ /\AArray<(.*)>/i
|
|
99
|
+
# check to ensure the input is an array given that the the attribute
|
|
100
|
+
# is documented as an array but the input is not
|
|
101
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
102
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
|
103
|
+
end
|
|
104
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
105
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
106
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
self
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
# Deserializes the data based on type
|
|
113
|
+
# @param string type Data type
|
|
114
|
+
# @param string value Value to be deserialized
|
|
115
|
+
# @return [Object] Deserialized data
|
|
116
|
+
def _deserialize(type, value)
|
|
117
|
+
case type.to_sym
|
|
118
|
+
when :DateTime
|
|
119
|
+
DateTime.parse(value)
|
|
120
|
+
when :Date
|
|
121
|
+
Date.parse(value)
|
|
122
|
+
when :String
|
|
123
|
+
value.to_s
|
|
124
|
+
when :Integer
|
|
125
|
+
value.to_i
|
|
126
|
+
when :Float
|
|
127
|
+
value.to_f
|
|
128
|
+
when :BOOLEAN
|
|
129
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
130
|
+
true
|
|
131
|
+
else
|
|
132
|
+
false
|
|
133
|
+
end
|
|
134
|
+
when :Object
|
|
135
|
+
# generic object (usually a Hash), return directly
|
|
136
|
+
value
|
|
137
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
138
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
139
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
140
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
141
|
+
k_type = Regexp.last_match[:k_type]
|
|
142
|
+
v_type = Regexp.last_match[:v_type]
|
|
143
|
+
{}.tap do |hash|
|
|
144
|
+
value.each do |k, v|
|
|
145
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
146
|
+
end
|
|
147
|
+
end
|
|
148
|
+
else # model
|
|
149
|
+
temp_model = ArtikCloud.const_get(type).new
|
|
150
|
+
temp_model.build_from_hash(value)
|
|
151
|
+
end
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
# Returns the string representation of the object
|
|
155
|
+
# @return [String] String presentation of the object
|
|
156
|
+
def to_s
|
|
157
|
+
to_hash.to_s
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
161
|
+
# @return [Hash] Returns the object in the form of hash
|
|
162
|
+
def to_body
|
|
163
|
+
to_hash
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
# Returns the object in the form of hash
|
|
167
|
+
# @return [Hash] Returns the object in the form of hash
|
|
168
|
+
def to_hash
|
|
169
|
+
hash = {}
|
|
170
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
171
|
+
value = self.send(attr)
|
|
172
|
+
next if value.nil?
|
|
173
|
+
hash[param] = _to_hash(value)
|
|
174
|
+
end
|
|
175
|
+
hash
|
|
176
|
+
end
|
|
177
|
+
|
|
178
|
+
# Outputs non-array value in the form of hash
|
|
179
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
180
|
+
# @param [Object] value Any valid value
|
|
181
|
+
# @return [Hash] Returns the value in the form of hash
|
|
182
|
+
def _to_hash(value)
|
|
183
|
+
if value.is_a?(Array)
|
|
184
|
+
value.compact.map{ |v| _to_hash(v) }
|
|
185
|
+
elsif value.is_a?(Hash)
|
|
186
|
+
{}.tap do |hash|
|
|
187
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
188
|
+
end
|
|
189
|
+
elsif value.respond_to? :to_hash
|
|
190
|
+
value.to_hash
|
|
191
|
+
else
|
|
192
|
+
value
|
|
193
|
+
end
|
|
194
|
+
end
|
|
195
|
+
|
|
196
|
+
end
|
|
197
|
+
|
|
198
|
+
end
|
|
@@ -1,24 +1,12 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#ARTIK Cloud API
|
|
3
3
|
|
|
4
|
-
#No
|
|
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'
|
|
@@ -117,7 +105,7 @@ module ArtikCloud
|
|
|
117
105
|
def build_from_hash(attributes)
|
|
118
106
|
return nil unless attributes.is_a?(Hash)
|
|
119
107
|
self.class.swagger_types.each_pair do |key, type|
|
|
120
|
-
if type =~
|
|
108
|
+
if type =~ /\AArray<(.*)>/i
|
|
121
109
|
# check to ensure the input is an array given that the the attribute
|
|
122
110
|
# is documented as an array but the input is not
|
|
123
111
|
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
@@ -148,7 +136,7 @@ module ArtikCloud
|
|
|
148
136
|
when :Float
|
|
149
137
|
value.to_f
|
|
150
138
|
when :BOOLEAN
|
|
151
|
-
if value.to_s =~
|
|
139
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
152
140
|
true
|
|
153
141
|
else
|
|
154
142
|
false
|
|
@@ -159,7 +147,7 @@ module ArtikCloud
|
|
|
159
147
|
when /\AArray<(?<inner_type>.+)>\z/
|
|
160
148
|
inner_type = Regexp.last_match[:inner_type]
|
|
161
149
|
value.map { |v| _deserialize(inner_type, v) }
|
|
162
|
-
when /\AHash<(?<k_type
|
|
150
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
163
151
|
k_type = Regexp.last_match[:k_type]
|
|
164
152
|
v_type = Regexp.last_match[:v_type]
|
|
165
153
|
{}.tap do |hash|
|
data/lib/artikcloud/version.rb
CHANGED
|
@@ -1,26 +1,14 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#ARTIK Cloud API
|
|
3
3
|
|
|
4
|
-
#No
|
|
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
|
|
25
|
-
VERSION = "2.0
|
|
13
|
+
VERSION = "2.1.0"
|
|
26
14
|
end
|
data/pom.xml
CHANGED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#ARTIK Cloud API
|
|
3
|
+
|
|
4
|
+
#No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
|
|
5
|
+
|
|
6
|
+
OpenAPI spec version: 2.0.0
|
|
7
|
+
|
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
|
9
|
+
|
|
10
|
+
=end
|
|
11
|
+
|
|
12
|
+
require 'spec_helper'
|
|
13
|
+
require 'json'
|
|
14
|
+
|
|
15
|
+
# Unit tests for ArtikCloud::DevicessharesApi
|
|
16
|
+
# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
|
|
17
|
+
# Please update as you see appropriate
|
|
18
|
+
describe 'DevicessharesApi' do
|
|
19
|
+
before do
|
|
20
|
+
# run before each test
|
|
21
|
+
@instance = ArtikCloud::DevicessharesApi.new
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
after do
|
|
25
|
+
# run after each test
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
describe 'test an instance of DevicessharesApi' do
|
|
29
|
+
it 'should create an instact of DevicessharesApi' do
|
|
30
|
+
expect(@instance).to be_instance_of(ArtikCloud::DevicessharesApi)
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
# unit tests for create_share_for_device
|
|
35
|
+
# Share a device
|
|
36
|
+
# Share a device
|
|
37
|
+
# @param device_id Device ID.
|
|
38
|
+
# @param device_share_info Device object that needs to be added
|
|
39
|
+
# @param [Hash] opts the optional parameters
|
|
40
|
+
# @return [DeviceSharingId]
|
|
41
|
+
describe 'create_share_for_device test' do
|
|
42
|
+
it "should work" do
|
|
43
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
# unit tests for delete_sharing_for_device
|
|
48
|
+
# Delete specific share of the given device id
|
|
49
|
+
# Delete specific share of the given device id
|
|
50
|
+
# @param device_id Device ID.
|
|
51
|
+
# @param share_id Share ID.
|
|
52
|
+
# @param [Hash] opts the optional parameters
|
|
53
|
+
# @return [DeviceSharingId]
|
|
54
|
+
describe 'delete_sharing_for_device test' do
|
|
55
|
+
it "should work" do
|
|
56
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
# unit tests for get_all_shares_for_device
|
|
61
|
+
# List all shares for the given device id
|
|
62
|
+
# List all shares for the given device id
|
|
63
|
+
# @param device_id Device ID.
|
|
64
|
+
# @param [Hash] opts the optional parameters
|
|
65
|
+
# @option opts [Integer] :count Desired count of items in the result set.
|
|
66
|
+
# @option opts [Integer] :offset Offset for pagination.
|
|
67
|
+
# @return [DeviceSharingEnvelope]
|
|
68
|
+
describe 'get_all_shares_for_device test' do
|
|
69
|
+
it "should work" do
|
|
70
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
71
|
+
end
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
# unit tests for get_sharing_for_device
|
|
75
|
+
# Get specific share of the given device id
|
|
76
|
+
# Get specific share of the given device id
|
|
77
|
+
# @param device_id Device ID.
|
|
78
|
+
# @param share_id Share ID.
|
|
79
|
+
# @param [Hash] opts the optional parameters
|
|
80
|
+
# @return [DeviceSharing]
|
|
81
|
+
describe 'get_sharing_for_device test' do
|
|
82
|
+
it "should work" do
|
|
83
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
84
|
+
end
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
end
|