artikcloud 2.0.5 → 2.0.7
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.lock +23 -1
- data/LICENSE +1 -2
- data/README.md +50 -4
- data/artikcloud.gemspec +29 -5
- data/docs/DeviceTask.md +13 -0
- data/docs/DeviceTaskUpdateRequest.md +8 -0
- data/docs/DeviceTaskUpdateResponse.md +8 -0
- data/docs/DeviceTypeInfo.md +14 -0
- data/docs/DeviceTypeInfoEnvelope.md +8 -0
- data/docs/DeviceTypesApi.md +61 -0
- data/docs/DeviceTypesInfo.md +14 -0
- data/docs/DeviceTypesInfoEnvelope.md +8 -0
- data/docs/DevicesManagementApi.md +870 -0
- data/docs/EventFeedData.md +10 -0
- data/docs/MetadataEnvelope.md +8 -0
- data/docs/MetadataPropertiesEnvelope.md +8 -0
- data/docs/MetadataQueryEnvelope.md +11 -0
- data/docs/MetadataRequest.md +7 -0
- data/docs/Task.md +18 -0
- data/docs/TaskByDid.md +19 -0
- data/docs/TaskByDidList.md +8 -0
- data/docs/TaskByDidListEnvelope.md +11 -0
- data/docs/TaskEnvelope.md +8 -0
- data/docs/TaskHistory.md +13 -0
- data/docs/TaskHistoryList.md +8 -0
- data/docs/TaskList.md +8 -0
- data/docs/TaskListEnvelope.md +12 -0
- data/docs/TaskParameters.md +9 -0
- data/docs/TaskRequest.md +13 -0
- data/docs/TaskStatus.md +13 -0
- data/docs/TaskStatusCounts.md +12 -0
- data/docs/TaskStatuses.md +19 -0
- data/docs/TaskStatusesEnvelope.md +11 -0
- data/docs/TaskStatusesHistoryEnvelope.md +8 -0
- data/docs/TaskUpdateRequest.md +8 -0
- data/docs/TaskUpdateResponse.md +8 -0
- data/docs/TasksStatusCounts.md +11 -0
- data/lib/artikcloud/api/device_types_api.rb +66 -0
- data/lib/artikcloud/api/devices_management_api.rb +971 -0
- data/lib/artikcloud/models/device_task.rb +250 -0
- data/lib/artikcloud/models/device_task_update_request.rb +200 -0
- data/lib/artikcloud/models/device_task_update_response.rb +200 -0
- data/lib/artikcloud/models/device_type_info.rb +260 -0
- data/lib/artikcloud/models/device_type_info_envelope.rb +199 -0
- data/lib/artikcloud/models/device_types_info.rb +260 -0
- data/lib/artikcloud/models/device_types_info_envelope.rb +199 -0
- data/lib/artikcloud/models/event_feed_data.rb +222 -0
- data/lib/artikcloud/models/metadata_envelope.rb +202 -0
- data/lib/artikcloud/models/metadata_properties_envelope.rb +201 -0
- data/lib/artikcloud/models/metadata_query_envelope.rb +232 -0
- data/lib/artikcloud/models/metadata_request.rb +190 -0
- data/lib/artikcloud/models/task.rb +302 -0
- data/lib/artikcloud/models/task_by_did.rb +314 -0
- data/lib/artikcloud/models/task_by_did_list.rb +202 -0
- data/lib/artikcloud/models/task_by_did_list_envelope.rb +230 -0
- data/lib/artikcloud/models/task_envelope.rb +200 -0
- data/lib/artikcloud/models/task_history.rb +250 -0
- data/lib/artikcloud/models/task_history_list.rb +202 -0
- data/lib/artikcloud/models/task_list.rb +202 -0
- data/lib/artikcloud/models/task_list_envelope.rb +240 -0
- data/lib/artikcloud/models/task_parameters.rb +210 -0
- data/lib/artikcloud/models/task_request.rb +252 -0
- data/lib/artikcloud/models/task_status.rb +250 -0
- data/lib/artikcloud/models/task_status_counts.rb +240 -0
- data/lib/artikcloud/models/task_statuses.rb +314 -0
- data/lib/artikcloud/models/task_statuses_envelope.rb +230 -0
- data/lib/artikcloud/models/task_statuses_history_envelope.rb +200 -0
- data/lib/artikcloud/models/task_update_request.rb +200 -0
- data/lib/artikcloud/models/task_update_response.rb +200 -0
- data/lib/artikcloud/models/tasks_status_counts.rb +230 -0
- data/lib/artikcloud/version.rb +1 -1
- data/lib/artikcloud.rb +31 -0
- data/pom.xml +1 -1
- data/spec/api/devices_api_spec.rb +7 -10
- data/spec/api/devices_management_api_spec.rb +251 -0
- data/spec/api/messages_api_spec.rb +67 -25
- data/spec/api/tokens_api_spec.rb +10 -33
- data/spec/api/users_api_spec.rb +65 -14
- data/spec/api_client_spec.rb +237 -0
- data/spec/configuration_spec.rb +53 -0
- data/spec/factories/devices.rb +32 -0
- data/spec/factories/users.rb +31 -0
- data/spec/fixtures/cassettes/DevicesApi/get_device_presence_test/should_work.yml +50 -0
- data/spec/fixtures/cassettes/MessagesApi/get_message_snapshots/should_work.yml +54 -0
- data/spec/fixtures/cassettes/MessagesApi/send_actions/should_work.yml +93 -0
- data/spec/fixtures/cassettes/MessagesApi/send_message_action_test/should_work.yml +99 -0
- data/spec/fixtures/cassettes/TokensApi/refresh_token_test/should_work.yml +43 -0
- data/spec/fixtures/cassettes/TokensApi/token_info_test/should_work.yml +38 -0
- data/spec/fixtures/cassettes/UsersApi/get_self_test/should_work.yml +53 -0
- data/spec/fixtures/cassettes/UsersApi/get_user_device_types_test/should_work.yml +55 -0
- data/spec/fixtures/cassettes/UsersApi/get_user_devices_test/should_work.yml +55 -0
- data/spec/fixtures/cassettes/UsersApi/get_user_properties_update_user_properties_and_delete_user_properties_test/should_work.yml +52 -0
- data/spec/fixtures/cassettes/UsersApi/get_user_rules_test/should_work.yml +58 -0
- data/spec/spec_helper.rb +20 -5
- metadata +142 -46
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#ARTIK Cloud API
|
|
3
|
+
|
|
4
|
+
#No descripton 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
|
+
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
|
+
=end
|
|
23
|
+
|
|
24
|
+
require 'date'
|
|
25
|
+
|
|
26
|
+
module ArtikCloud
|
|
27
|
+
#
|
|
28
|
+
class TasksStatusCounts
|
|
29
|
+
# Cancelled
|
|
30
|
+
attr_accessor :cancelled
|
|
31
|
+
|
|
32
|
+
# Complete
|
|
33
|
+
attr_accessor :complete
|
|
34
|
+
|
|
35
|
+
# Processing
|
|
36
|
+
attr_accessor :processing
|
|
37
|
+
|
|
38
|
+
# Requested
|
|
39
|
+
attr_accessor :requested
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
43
|
+
def self.attribute_map
|
|
44
|
+
{
|
|
45
|
+
:'cancelled' => :'CANCELLED',
|
|
46
|
+
:'complete' => :'COMPLETE',
|
|
47
|
+
:'processing' => :'PROCESSING',
|
|
48
|
+
:'requested' => :'REQUESTED'
|
|
49
|
+
}
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
# Attribute type mapping.
|
|
53
|
+
def self.swagger_types
|
|
54
|
+
{
|
|
55
|
+
:'cancelled' => :'Integer',
|
|
56
|
+
:'complete' => :'Integer',
|
|
57
|
+
:'processing' => :'Integer',
|
|
58
|
+
:'requested' => :'Integer'
|
|
59
|
+
}
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
# Initializes the object
|
|
63
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
64
|
+
def initialize(attributes = {})
|
|
65
|
+
return unless attributes.is_a?(Hash)
|
|
66
|
+
|
|
67
|
+
# convert string to symbol for hash key
|
|
68
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
|
69
|
+
|
|
70
|
+
if attributes.has_key?(:'CANCELLED')
|
|
71
|
+
self.cancelled = attributes[:'CANCELLED']
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
if attributes.has_key?(:'COMPLETE')
|
|
75
|
+
self.complete = attributes[:'COMPLETE']
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
if attributes.has_key?(:'PROCESSING')
|
|
79
|
+
self.processing = attributes[:'PROCESSING']
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
if attributes.has_key?(:'REQUESTED')
|
|
83
|
+
self.requested = attributes[:'REQUESTED']
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
89
|
+
# @return Array for valid properies with the reasons
|
|
90
|
+
def list_invalid_properties
|
|
91
|
+
invalid_properties = Array.new
|
|
92
|
+
return invalid_properties
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
# Check to see if the all the properties in the model are valid
|
|
96
|
+
# @return true if the model is valid
|
|
97
|
+
def valid?
|
|
98
|
+
return true
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
# Checks equality by comparing each attribute.
|
|
102
|
+
# @param [Object] Object to be compared
|
|
103
|
+
def ==(o)
|
|
104
|
+
return true if self.equal?(o)
|
|
105
|
+
self.class == o.class &&
|
|
106
|
+
cancelled == o.cancelled &&
|
|
107
|
+
complete == o.complete &&
|
|
108
|
+
processing == o.processing &&
|
|
109
|
+
requested == o.requested
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
# @see the `==` method
|
|
113
|
+
# @param [Object] Object to be compared
|
|
114
|
+
def eql?(o)
|
|
115
|
+
self == o
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
# Calculates hash code according to all attributes.
|
|
119
|
+
# @return [Fixnum] Hash code
|
|
120
|
+
def hash
|
|
121
|
+
[cancelled, complete, processing, requested].hash
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
# Builds the object from hash
|
|
125
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
126
|
+
# @return [Object] Returns the model itself
|
|
127
|
+
def build_from_hash(attributes)
|
|
128
|
+
return nil unless attributes.is_a?(Hash)
|
|
129
|
+
self.class.swagger_types.each_pair do |key, type|
|
|
130
|
+
if type =~ /^Array<(.*)>/i
|
|
131
|
+
# check to ensure the input is an array given that the the attribute
|
|
132
|
+
# is documented as an array but the input is not
|
|
133
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
134
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
|
135
|
+
end
|
|
136
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
137
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
138
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
self
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
# Deserializes the data based on type
|
|
145
|
+
# @param string type Data type
|
|
146
|
+
# @param string value Value to be deserialized
|
|
147
|
+
# @return [Object] Deserialized data
|
|
148
|
+
def _deserialize(type, value)
|
|
149
|
+
case type.to_sym
|
|
150
|
+
when :DateTime
|
|
151
|
+
DateTime.parse(value)
|
|
152
|
+
when :Date
|
|
153
|
+
Date.parse(value)
|
|
154
|
+
when :String
|
|
155
|
+
value.to_s
|
|
156
|
+
when :Integer
|
|
157
|
+
value.to_i
|
|
158
|
+
when :Float
|
|
159
|
+
value.to_f
|
|
160
|
+
when :BOOLEAN
|
|
161
|
+
if value.to_s =~ /^(true|t|yes|y|1)$/i
|
|
162
|
+
true
|
|
163
|
+
else
|
|
164
|
+
false
|
|
165
|
+
end
|
|
166
|
+
when :Object
|
|
167
|
+
# generic object (usually a Hash), return directly
|
|
168
|
+
value
|
|
169
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
170
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
171
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
172
|
+
when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
|
|
173
|
+
k_type = Regexp.last_match[:k_type]
|
|
174
|
+
v_type = Regexp.last_match[:v_type]
|
|
175
|
+
{}.tap do |hash|
|
|
176
|
+
value.each do |k, v|
|
|
177
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
178
|
+
end
|
|
179
|
+
end
|
|
180
|
+
else # model
|
|
181
|
+
temp_model = ArtikCloud.const_get(type).new
|
|
182
|
+
temp_model.build_from_hash(value)
|
|
183
|
+
end
|
|
184
|
+
end
|
|
185
|
+
|
|
186
|
+
# Returns the string representation of the object
|
|
187
|
+
# @return [String] String presentation of the object
|
|
188
|
+
def to_s
|
|
189
|
+
to_hash.to_s
|
|
190
|
+
end
|
|
191
|
+
|
|
192
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
193
|
+
# @return [Hash] Returns the object in the form of hash
|
|
194
|
+
def to_body
|
|
195
|
+
to_hash
|
|
196
|
+
end
|
|
197
|
+
|
|
198
|
+
# Returns the object in the form of hash
|
|
199
|
+
# @return [Hash] Returns the object in the form of hash
|
|
200
|
+
def to_hash
|
|
201
|
+
hash = {}
|
|
202
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
203
|
+
value = self.send(attr)
|
|
204
|
+
next if value.nil?
|
|
205
|
+
hash[param] = _to_hash(value)
|
|
206
|
+
end
|
|
207
|
+
hash
|
|
208
|
+
end
|
|
209
|
+
|
|
210
|
+
# Outputs non-array value in the form of hash
|
|
211
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
212
|
+
# @param [Object] value Any valid value
|
|
213
|
+
# @return [Hash] Returns the value in the form of hash
|
|
214
|
+
def _to_hash(value)
|
|
215
|
+
if value.is_a?(Array)
|
|
216
|
+
value.compact.map{ |v| _to_hash(v) }
|
|
217
|
+
elsif value.is_a?(Hash)
|
|
218
|
+
{}.tap do |hash|
|
|
219
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
220
|
+
end
|
|
221
|
+
elsif value.respond_to? :to_hash
|
|
222
|
+
value.to_hash
|
|
223
|
+
else
|
|
224
|
+
value
|
|
225
|
+
end
|
|
226
|
+
end
|
|
227
|
+
|
|
228
|
+
end
|
|
229
|
+
|
|
230
|
+
end
|
data/lib/artikcloud/version.rb
CHANGED
data/lib/artikcloud.rb
CHANGED
|
@@ -53,14 +53,22 @@ require 'artikcloud/models/device_reg_confirm_user_response'
|
|
|
53
53
|
require 'artikcloud/models/device_reg_confirm_user_response_envelope'
|
|
54
54
|
require 'artikcloud/models/device_reg_status_response'
|
|
55
55
|
require 'artikcloud/models/device_reg_status_response_envelope'
|
|
56
|
+
require 'artikcloud/models/device_task'
|
|
57
|
+
require 'artikcloud/models/device_task_update_request'
|
|
58
|
+
require 'artikcloud/models/device_task_update_response'
|
|
56
59
|
require 'artikcloud/models/device_token'
|
|
57
60
|
require 'artikcloud/models/device_token_envelope'
|
|
58
61
|
require 'artikcloud/models/device_type'
|
|
59
62
|
require 'artikcloud/models/device_type_array'
|
|
60
63
|
require 'artikcloud/models/device_type_envelope'
|
|
64
|
+
require 'artikcloud/models/device_type_info'
|
|
65
|
+
require 'artikcloud/models/device_type_info_envelope'
|
|
61
66
|
require 'artikcloud/models/device_types_envelope'
|
|
67
|
+
require 'artikcloud/models/device_types_info'
|
|
68
|
+
require 'artikcloud/models/device_types_info_envelope'
|
|
62
69
|
require 'artikcloud/models/devices_envelope'
|
|
63
70
|
require 'artikcloud/models/error_envelope'
|
|
71
|
+
require 'artikcloud/models/event_feed_data'
|
|
64
72
|
require 'artikcloud/models/export_data'
|
|
65
73
|
require 'artikcloud/models/export_data_array'
|
|
66
74
|
require 'artikcloud/models/export_history_response'
|
|
@@ -85,6 +93,9 @@ require 'artikcloud/models/message_id'
|
|
|
85
93
|
require 'artikcloud/models/message_id_envelope'
|
|
86
94
|
require 'artikcloud/models/message_in'
|
|
87
95
|
require 'artikcloud/models/message_out'
|
|
96
|
+
require 'artikcloud/models/metadata_envelope'
|
|
97
|
+
require 'artikcloud/models/metadata_properties_envelope'
|
|
98
|
+
require 'artikcloud/models/metadata_query_envelope'
|
|
88
99
|
require 'artikcloud/models/non_empty_string'
|
|
89
100
|
require 'artikcloud/models/normalized_action'
|
|
90
101
|
require 'artikcloud/models/normalized_actions_envelope'
|
|
@@ -109,6 +120,25 @@ require 'artikcloud/models/snapshots_response_envelope'
|
|
|
109
120
|
require 'artikcloud/models/tag'
|
|
110
121
|
require 'artikcloud/models/tag_array'
|
|
111
122
|
require 'artikcloud/models/tags_envelope'
|
|
123
|
+
require 'artikcloud/models/task'
|
|
124
|
+
require 'artikcloud/models/task_by_did'
|
|
125
|
+
require 'artikcloud/models/task_by_did_list'
|
|
126
|
+
require 'artikcloud/models/task_by_did_list_envelope'
|
|
127
|
+
require 'artikcloud/models/task_envelope'
|
|
128
|
+
require 'artikcloud/models/task_history'
|
|
129
|
+
require 'artikcloud/models/task_history_list'
|
|
130
|
+
require 'artikcloud/models/task_list'
|
|
131
|
+
require 'artikcloud/models/task_list_envelope'
|
|
132
|
+
require 'artikcloud/models/task_parameters'
|
|
133
|
+
require 'artikcloud/models/task_request'
|
|
134
|
+
require 'artikcloud/models/task_status'
|
|
135
|
+
require 'artikcloud/models/task_status_counts'
|
|
136
|
+
require 'artikcloud/models/task_statuses'
|
|
137
|
+
require 'artikcloud/models/task_statuses_envelope'
|
|
138
|
+
require 'artikcloud/models/task_statuses_history_envelope'
|
|
139
|
+
require 'artikcloud/models/task_update_request'
|
|
140
|
+
require 'artikcloud/models/task_update_response'
|
|
141
|
+
require 'artikcloud/models/tasks_status_counts'
|
|
112
142
|
require 'artikcloud/models/token'
|
|
113
143
|
require 'artikcloud/models/token_info'
|
|
114
144
|
require 'artikcloud/models/token_info_success_response'
|
|
@@ -123,6 +153,7 @@ require 'artikcloud/models/web_socket_error'
|
|
|
123
153
|
# APIs
|
|
124
154
|
require 'artikcloud/api/device_types_api'
|
|
125
155
|
require 'artikcloud/api/devices_api'
|
|
156
|
+
require 'artikcloud/api/devices_management_api'
|
|
126
157
|
require 'artikcloud/api/export_api'
|
|
127
158
|
require 'artikcloud/api/messages_api'
|
|
128
159
|
require 'artikcloud/api/registrations_api'
|
data/pom.xml
CHANGED
|
@@ -27,15 +27,8 @@ require 'json'
|
|
|
27
27
|
# Unit tests for ArtikCloud::DevicesApi
|
|
28
28
|
# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
|
|
29
29
|
# Please update as you see appropriate
|
|
30
|
-
describe 'DevicesApi' do
|
|
31
|
-
|
|
32
|
-
# run before each test
|
|
33
|
-
@instance = ArtikCloud::DevicesApi.new
|
|
34
|
-
end
|
|
35
|
-
|
|
36
|
-
after do
|
|
37
|
-
# run after each test
|
|
38
|
-
end
|
|
30
|
+
describe 'DevicesApi', :vcr do
|
|
31
|
+
let(:instance) { ArtikCloud::DevicesApi.new(API_CLIENT) }
|
|
39
32
|
|
|
40
33
|
describe 'test an instance of DevicesApi' do
|
|
41
34
|
it 'should create an instact of DevicesApi' do
|
|
@@ -98,8 +91,12 @@ describe 'DevicesApi' do
|
|
|
98
91
|
# @param [Hash] opts the optional parameters
|
|
99
92
|
# @return [PresenceEnvelope]
|
|
100
93
|
describe 'get_device_presence test' do
|
|
94
|
+
let(:device) { FactoryGirl.create(:device1) }
|
|
95
|
+
|
|
101
96
|
it "should work" do
|
|
102
|
-
|
|
97
|
+
result = instance.get_device_presence(device.id)
|
|
98
|
+
expect(result.sdid).to eq device.id
|
|
99
|
+
expect(result.data.last_seen_on).to_not be_nil
|
|
103
100
|
end
|
|
104
101
|
end
|
|
105
102
|
|
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#ARTIK Cloud API
|
|
3
|
+
|
|
4
|
+
#No descripton 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
|
+
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
|
+
=end
|
|
23
|
+
|
|
24
|
+
require 'spec_helper'
|
|
25
|
+
require 'json'
|
|
26
|
+
|
|
27
|
+
# Unit tests for ArtikCloud::DevicesManagementApi
|
|
28
|
+
# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
|
|
29
|
+
# Please update as you see appropriate
|
|
30
|
+
describe 'DevicesManagementApi' do
|
|
31
|
+
before do
|
|
32
|
+
# run before each test
|
|
33
|
+
@instance = ArtikCloud::DevicesManagementApi.new
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
after do
|
|
37
|
+
# run after each test
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
describe 'test an instance of DevicesManagementApi' do
|
|
41
|
+
it 'should create an instact of DevicesManagementApi' do
|
|
42
|
+
expect(@instance).to be_instance_of(ArtikCloud::DevicesManagementApi)
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
# unit tests for create_tasks
|
|
47
|
+
# Create a new task for one or more devices
|
|
48
|
+
# Create a new task for one or more devices
|
|
49
|
+
# @param task_payload Task object to be created
|
|
50
|
+
# @param [Hash] opts the optional parameters
|
|
51
|
+
# @return [TaskEnvelope]
|
|
52
|
+
describe 'create_tasks test' do
|
|
53
|
+
it "should work" do
|
|
54
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
# unit tests for delete_server_properties
|
|
59
|
+
# Deletes a device's properties.
|
|
60
|
+
# Deletes a device's properties.
|
|
61
|
+
# @param did Device ID.
|
|
62
|
+
# @param [Hash] opts the optional parameters
|
|
63
|
+
# @return [MetadataEnvelope]
|
|
64
|
+
describe 'delete_server_properties test' do
|
|
65
|
+
it "should work" do
|
|
66
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
67
|
+
end
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
# unit tests for get_all_by_did
|
|
71
|
+
# Returns the list of tasks for a particular device id with optional status filter.
|
|
72
|
+
# Returns the list of tasks for a particular device id with optional status filter.
|
|
73
|
+
# @param did Device ID.
|
|
74
|
+
# @param [Hash] opts the optional parameters
|
|
75
|
+
# @option opts [Integer] :count Max results count.
|
|
76
|
+
# @option opts [Integer] :offset Result starting offset.
|
|
77
|
+
# @option opts [String] :status Status filter. Comma-separated statuses.
|
|
78
|
+
# @option opts [String] :order Sort results by a field. Valid fields: createdOn.
|
|
79
|
+
# @option opts [String] :sort Sort order. Valid values: asc or desc.
|
|
80
|
+
# @return [TaskByDidListEnvelope]
|
|
81
|
+
describe 'get_all_by_did 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
|
+
# unit tests for get_device_types_info
|
|
88
|
+
# Read a device type device management information.
|
|
89
|
+
# Read a device type device management information.
|
|
90
|
+
# @param dtid Device type ID.
|
|
91
|
+
# @param [Hash] opts the optional parameters
|
|
92
|
+
# @return [DeviceTypesInfoEnvelope]
|
|
93
|
+
describe 'get_device_types_info test' do
|
|
94
|
+
it "should work" do
|
|
95
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
96
|
+
end
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
# unit tests for get_manifest_properties
|
|
100
|
+
# Get a device type's device management manifest properties
|
|
101
|
+
# Get a device type's device management manifest properties
|
|
102
|
+
# @param dtid Device Type ID.
|
|
103
|
+
# @param [Hash] opts the optional parameters
|
|
104
|
+
# @return [MetadataPropertiesEnvelope]
|
|
105
|
+
describe 'get_manifest_properties test' do
|
|
106
|
+
it "should work" do
|
|
107
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
108
|
+
end
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
# unit tests for get_properties
|
|
112
|
+
# Read a device's properties.
|
|
113
|
+
# Read a device's properties.
|
|
114
|
+
# @param did Device ID.
|
|
115
|
+
# @param [Hash] opts the optional parameters
|
|
116
|
+
# @option opts [BOOLEAN] :include_timestamp Include timestamp.
|
|
117
|
+
# @return [MetadataEnvelope]
|
|
118
|
+
describe 'get_properties test' do
|
|
119
|
+
it "should work" do
|
|
120
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
121
|
+
end
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
# unit tests for get_statuses
|
|
125
|
+
# Returns the details and status of a task id and the individual statuses of each device id in the list.
|
|
126
|
+
# Returns the details and status of a task id and the individual statuses of each device id in the list.
|
|
127
|
+
# @param tid Task ID.
|
|
128
|
+
# @param [Hash] opts the optional parameters
|
|
129
|
+
# @option opts [Integer] :count Max results count.
|
|
130
|
+
# @option opts [Integer] :offset Result starting offset.
|
|
131
|
+
# @option opts [String] :status Status filter. Comma-separated statuses.
|
|
132
|
+
# @option opts [String] :dids Devices filter. Comma-separated device IDs.
|
|
133
|
+
# @return [TaskStatusesEnvelope]
|
|
134
|
+
describe 'get_statuses test' do
|
|
135
|
+
it "should work" do
|
|
136
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
137
|
+
end
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
# unit tests for get_statuses_history
|
|
141
|
+
# Returns the history of the status changes for a specific task id, or for a specific device id in that task.
|
|
142
|
+
# Returns the history of the status changes for a specific task id, or for a specific device id in that task.
|
|
143
|
+
# @param tid Task ID.
|
|
144
|
+
# @param [Hash] opts the optional parameters
|
|
145
|
+
# @option opts [String] :did Device ID. Optional.
|
|
146
|
+
# @return [TaskStatusesHistoryEnvelope]
|
|
147
|
+
describe 'get_statuses_history test' do
|
|
148
|
+
it "should work" do
|
|
149
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
150
|
+
end
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
# unit tests for get_task_by_id
|
|
154
|
+
# Returns the details and global status of a specific task id.
|
|
155
|
+
# Returns the details and global status of a specific task id.
|
|
156
|
+
# @param tid Task ID.
|
|
157
|
+
# @param [Hash] opts the optional parameters
|
|
158
|
+
# @return [TaskEnvelope]
|
|
159
|
+
describe 'get_task_by_id test' do
|
|
160
|
+
it "should work" do
|
|
161
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
162
|
+
end
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
# unit tests for get_tasks
|
|
166
|
+
# Returns the all the tasks for a device type.
|
|
167
|
+
# Returns the all the tasks for a device type.
|
|
168
|
+
# @param dtid Device Type ID.
|
|
169
|
+
# @param [Hash] opts the optional parameters
|
|
170
|
+
# @option opts [Integer] :count Max results count.
|
|
171
|
+
# @option opts [Integer] :offset Result starting offset.
|
|
172
|
+
# @option opts [String] :status Status filter. Comma-separated statuses.
|
|
173
|
+
# @option opts [String] :order Sort results by a field. Valid fields: createdOn.
|
|
174
|
+
# @option opts [String] :sort Sort order. Valid values: asc or desc.
|
|
175
|
+
# @return [TaskListEnvelope]
|
|
176
|
+
describe 'get_tasks test' do
|
|
177
|
+
it "should work" do
|
|
178
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
179
|
+
end
|
|
180
|
+
end
|
|
181
|
+
|
|
182
|
+
# unit tests for query_properties
|
|
183
|
+
# Query device properties across devices.
|
|
184
|
+
# Query device properties across devices.
|
|
185
|
+
# @param dtid Device Type ID.
|
|
186
|
+
# @param [Hash] opts the optional parameters
|
|
187
|
+
# @option opts [Integer] :count Max results count.
|
|
188
|
+
# @option opts [Integer] :offset Result starting offset.
|
|
189
|
+
# @option opts [String] :filter Query filter. Comma-separated key=value pairs
|
|
190
|
+
# @option opts [BOOLEAN] :include_timestamp Include timestamp.
|
|
191
|
+
# @return [MetadataQueryEnvelope]
|
|
192
|
+
describe 'query_properties test' do
|
|
193
|
+
it "should work" do
|
|
194
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
195
|
+
end
|
|
196
|
+
end
|
|
197
|
+
|
|
198
|
+
# unit tests for update_device_types_info
|
|
199
|
+
# Updates a device type information
|
|
200
|
+
# Updates a device type information
|
|
201
|
+
# @param dtid Device type ID.
|
|
202
|
+
# @param device_type_info Device type info object to be set
|
|
203
|
+
# @param [Hash] opts the optional parameters
|
|
204
|
+
# @return [DeviceTypesInfoEnvelope]
|
|
205
|
+
describe 'update_device_types_info test' do
|
|
206
|
+
it "should work" do
|
|
207
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
208
|
+
end
|
|
209
|
+
end
|
|
210
|
+
|
|
211
|
+
# unit tests for update_server_properties
|
|
212
|
+
# Updates a device's server properties.
|
|
213
|
+
# Updates a device's server properties.
|
|
214
|
+
# @param did Device ID.
|
|
215
|
+
# @param device_properties Device properties object to be set
|
|
216
|
+
# @param [Hash] opts the optional parameters
|
|
217
|
+
# @return [MetadataEnvelope]
|
|
218
|
+
describe 'update_server_properties test' do
|
|
219
|
+
it "should work" do
|
|
220
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
221
|
+
end
|
|
222
|
+
end
|
|
223
|
+
|
|
224
|
+
# unit tests for update_task
|
|
225
|
+
# Updates a task for all devices - For now just allows changing the state to cancelled.
|
|
226
|
+
# Updates a task for all devices - For now just allows changing the state to cancelled.
|
|
227
|
+
# @param tid Task ID.
|
|
228
|
+
# @param task_update_request Task update request
|
|
229
|
+
# @param [Hash] opts the optional parameters
|
|
230
|
+
# @return [TaskUpdateResponse]
|
|
231
|
+
describe 'update_task test' do
|
|
232
|
+
it "should work" do
|
|
233
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
234
|
+
end
|
|
235
|
+
end
|
|
236
|
+
|
|
237
|
+
# unit tests for update_task_for_device
|
|
238
|
+
# Updates a task for a specific device - For now just allows changing the state to cancelled.
|
|
239
|
+
# Updates a task for a specific device - For now just allows changing the state to cancelled.
|
|
240
|
+
# @param tid Task ID.
|
|
241
|
+
# @param did Device ID.
|
|
242
|
+
# @param device_task_update_request Device task update request
|
|
243
|
+
# @param [Hash] opts the optional parameters
|
|
244
|
+
# @return [DeviceTaskUpdateResponse]
|
|
245
|
+
describe 'update_task_for_device test' do
|
|
246
|
+
it "should work" do
|
|
247
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
248
|
+
end
|
|
249
|
+
end
|
|
250
|
+
|
|
251
|
+
end
|