artikcloud 2.1.0 → 2.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +11 -11
  3. data/artikcloud.gemspec +1 -1
  4. data/docs/.DS_Store +0 -0
  5. data/docs/DeviceShareInfo.md +1 -1
  6. data/docs/UsersApi.md +1 -1
  7. data/lib/.DS_Store +0 -0
  8. data/lib/artikcloud/.DS_Store +0 -0
  9. data/lib/artikcloud/api/.DS_Store +0 -0
  10. data/lib/artikcloud/api/{devicesshares_api.rb → devices_shares_api.rb} +20 -20
  11. data/lib/artikcloud/api/{devicestatus_api.rb → devices_status_api.rb} +10 -10
  12. data/lib/artikcloud/api/users_api.rb +7 -1
  13. data/lib/artikcloud/models/.DS_Store +0 -0
  14. data/lib/artikcloud/models/device_share_info.rb +7 -7
  15. data/lib/artikcloud/version.rb +1 -5
  16. data/lib/artikcloud.rb +2 -2
  17. data/pom.xml +1 -1
  18. data/spec/.DS_Store +0 -0
  19. data/spec/api/.DS_Store +0 -0
  20. data/spec/api/device_types_api_spec.rb +1 -1
  21. data/spec/api/devices_api_spec.rb +8 -1
  22. data/spec/api/{devicesshares_api_spec.rb → devices_shares_api_spec.rb} +6 -6
  23. data/spec/api/{devicestatus_api_spec.rb → devices_status_api_spec.rb} +6 -6
  24. data/spec/api/export_api_spec.rb +2 -2
  25. data/spec/api/messages_api_spec.rb +20 -10
  26. data/spec/api/registrations_api_spec.rb +1 -1
  27. data/spec/api/rules_api_spec.rb +1 -1
  28. data/spec/api/tags_api_spec.rb +2 -2
  29. data/spec/api/tokens_api_spec.rb +16 -3
  30. data/spec/models/device_share_info_spec.rb +41 -0
  31. data/spec/models/device_sharing_array_spec.rb +41 -0
  32. data/spec/models/device_sharing_envelope_spec.rb +59 -0
  33. data/spec/models/device_sharing_id_spec.rb +41 -0
  34. data/spec/models/device_sharing_spec.rb +59 -0
  35. data/spec/models/device_spec.rb +12 -0
  36. data/spec/models/device_status_batch_spec.rb +59 -0
  37. data/spec/models/device_status_data_spec.rb +65 -0
  38. data/spec/models/device_status_put_data_spec.rb +41 -0
  39. data/spec/models/device_status_put_spec.rb +41 -0
  40. data/spec/models/device_status_spec.rb +47 -0
  41. data/spec/models/notif_message_array_spec.rb +41 -0
  42. data/spec/models/notif_message_spec.rb +83 -0
  43. data/spec/models/notif_messages_response_spec.rb +65 -0
  44. data/spec/models/subscription_array_spec.rb +41 -0
  45. data/spec/models/subscription_envelope_spec.rb +41 -0
  46. data/spec/models/subscription_info_spec.rb +113 -0
  47. data/spec/models/subscription_spec.rb +137 -0
  48. data/spec/models/subscriptions_envelope_spec.rb +59 -0
  49. data/spec/models/task_parameters_spec.rb +12 -0
  50. data/spec/models/update_parameters_spec.rb +41 -0
  51. data/spec/models/validation_callback_info_spec.rb +47 -0
  52. data/spec/spec_helper.rb +79 -6
  53. metadata +57 -13
  54. data/docs/DevicessharesApi.md +0 -235
  55. data/docs/DevicestatusApi.md +0 -183
  56. data/docs/MetadataRequest.md +0 -7
  57. data/lib/artikcloud/models/metadata_request.rb +0 -190
@@ -1,183 +0,0 @@
1
- # ArtikCloud::DevicestatusApi
2
-
3
- All URIs are relative to *https://api.artik.cloud/v1.1*
4
-
5
- Method | HTTP request | Description
6
- ------------- | ------------- | -------------
7
- [**get_device_status**](DevicestatusApi.md#get_device_status) | **GET** /devices/{deviceId}/status | Get Device Status
8
- [**get_devices_status**](DevicestatusApi.md#get_devices_status) | **GET** /devices/status | Get Devices Status
9
- [**put_device_status**](DevicestatusApi.md#put_device_status) | **PUT** /devices/{deviceId}/status | Update Device Status
10
-
11
-
12
- # **get_device_status**
13
- > DeviceStatus get_device_status(device_id, opts)
14
-
15
- Get Device Status
16
-
17
- Get Device Status
18
-
19
- ### Example
20
- ```ruby
21
- # load the gem
22
- require 'artikcloud'
23
- # setup authorization
24
- ArtikCloud.configure do |config|
25
- # Configure OAuth2 access token for authorization: artikcloud_oauth
26
- config.access_token = 'YOUR ACCESS TOKEN'
27
- end
28
-
29
- api_instance = ArtikCloud::DevicestatusApi.new
30
-
31
- device_id = "device_id_example" # String | Device ID.
32
-
33
- opts = {
34
- include_snapshot: true, # BOOLEAN | Include device snapshot into the response
35
- include_snapshot_timestamp: true # BOOLEAN | Include device snapshot timestamp into the response
36
- }
37
-
38
- begin
39
- #Get Device Status
40
- result = api_instance.get_device_status(device_id, opts)
41
- p result
42
- rescue ArtikCloud::ApiError => e
43
- puts "Exception when calling DevicestatusApi->get_device_status: #{e}"
44
- end
45
- ```
46
-
47
- ### Parameters
48
-
49
- Name | Type | Description | Notes
50
- ------------- | ------------- | ------------- | -------------
51
- **device_id** | **String**| Device ID. |
52
- **include_snapshot** | **BOOLEAN**| Include device snapshot into the response | [optional]
53
- **include_snapshot_timestamp** | **BOOLEAN**| Include device snapshot timestamp into the response | [optional]
54
-
55
- ### Return type
56
-
57
- [**DeviceStatus**](DeviceStatus.md)
58
-
59
- ### Authorization
60
-
61
- [artikcloud_oauth](../README.md#artikcloud_oauth)
62
-
63
- ### HTTP request headers
64
-
65
- - **Content-Type**: Not defined
66
- - **Accept**: application/json
67
-
68
-
69
-
70
- # **get_devices_status**
71
- > DeviceStatusBatch get_devices_status(dids, opts)
72
-
73
- Get Devices Status
74
-
75
- Get Devices Status
76
-
77
- ### Example
78
- ```ruby
79
- # load the gem
80
- require 'artikcloud'
81
- # setup authorization
82
- ArtikCloud.configure do |config|
83
- # Configure OAuth2 access token for authorization: artikcloud_oauth
84
- config.access_token = 'YOUR ACCESS TOKEN'
85
- end
86
-
87
- api_instance = ArtikCloud::DevicestatusApi.new
88
-
89
- dids = "dids_example" # String | List of device ids (comma-separated) for which the statuses are requested.
90
-
91
- opts = {
92
- include_snapshot: true, # BOOLEAN | Include device snapshot into the response
93
- include_snapshot_timestamp: true # BOOLEAN | Include device snapshot timestamp into the response
94
- }
95
-
96
- begin
97
- #Get Devices Status
98
- result = api_instance.get_devices_status(dids, opts)
99
- p result
100
- rescue ArtikCloud::ApiError => e
101
- puts "Exception when calling DevicestatusApi->get_devices_status: #{e}"
102
- end
103
- ```
104
-
105
- ### Parameters
106
-
107
- Name | Type | Description | Notes
108
- ------------- | ------------- | ------------- | -------------
109
- **dids** | **String**| List of device ids (comma-separated) for which the statuses are requested. |
110
- **include_snapshot** | **BOOLEAN**| Include device snapshot into the response | [optional]
111
- **include_snapshot_timestamp** | **BOOLEAN**| Include device snapshot timestamp into the response | [optional]
112
-
113
- ### Return type
114
-
115
- [**DeviceStatusBatch**](DeviceStatusBatch.md)
116
-
117
- ### Authorization
118
-
119
- [artikcloud_oauth](../README.md#artikcloud_oauth)
120
-
121
- ### HTTP request headers
122
-
123
- - **Content-Type**: Not defined
124
- - **Accept**: application/json
125
-
126
-
127
-
128
- # **put_device_status**
129
- > DeviceStatus put_device_status(device_id, opts)
130
-
131
- Update Device Status
132
-
133
- Update Device Status
134
-
135
- ### Example
136
- ```ruby
137
- # load the gem
138
- require 'artikcloud'
139
- # setup authorization
140
- ArtikCloud.configure do |config|
141
- # Configure OAuth2 access token for authorization: artikcloud_oauth
142
- config.access_token = 'YOUR ACCESS TOKEN'
143
- end
144
-
145
- api_instance = ArtikCloud::DevicestatusApi.new
146
-
147
- device_id = "device_id_example" # String | Device ID.
148
-
149
- opts = {
150
- body: ArtikCloud::DeviceStatusPut.new # DeviceStatusPut | Body
151
- }
152
-
153
- begin
154
- #Update Device Status
155
- result = api_instance.put_device_status(device_id, opts)
156
- p result
157
- rescue ArtikCloud::ApiError => e
158
- puts "Exception when calling DevicestatusApi->put_device_status: #{e}"
159
- end
160
- ```
161
-
162
- ### Parameters
163
-
164
- Name | Type | Description | Notes
165
- ------------- | ------------- | ------------- | -------------
166
- **device_id** | **String**| Device ID. |
167
- **body** | [**DeviceStatusPut**](DeviceStatusPut.md)| Body | [optional]
168
-
169
- ### Return type
170
-
171
- [**DeviceStatus**](DeviceStatus.md)
172
-
173
- ### Authorization
174
-
175
- [artikcloud_oauth](../README.md#artikcloud_oauth)
176
-
177
- ### HTTP request headers
178
-
179
- - **Content-Type**: Not defined
180
- - **Accept**: application/json
181
-
182
-
183
-
@@ -1,7 +0,0 @@
1
- # ArtikCloud::MetadataRequest
2
-
3
- ## Properties
4
- Name | Type | Description | Notes
5
- ------------ | ------------- | ------------- | -------------
6
-
7
-
@@ -1,190 +0,0 @@
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 MetadataRequest
29
-
30
- # Attribute mapping from ruby-style variable name to JSON key.
31
- def self.attribute_map
32
- {
33
- }
34
- end
35
-
36
- # Attribute type mapping.
37
- def self.swagger_types
38
- {
39
- }
40
- end
41
-
42
- # Initializes the object
43
- # @param [Hash] attributes Model attributes in the form of hash
44
- def initialize(attributes = {})
45
- return unless attributes.is_a?(Hash)
46
-
47
- # convert string to symbol for hash key
48
- attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
49
-
50
- end
51
-
52
- # Show invalid properties with the reasons. Usually used together with valid?
53
- # @return Array for valid properies with the reasons
54
- def list_invalid_properties
55
- invalid_properties = Array.new
56
- return invalid_properties
57
- end
58
-
59
- # Check to see if the all the properties in the model are valid
60
- # @return true if the model is valid
61
- def valid?
62
- return true
63
- end
64
-
65
- # Checks equality by comparing each attribute.
66
- # @param [Object] Object to be compared
67
- def ==(o)
68
- return true if self.equal?(o)
69
- self.class == o.class
70
- end
71
-
72
- # @see the `==` method
73
- # @param [Object] Object to be compared
74
- def eql?(o)
75
- self == o
76
- end
77
-
78
- # Calculates hash code according to all attributes.
79
- # @return [Fixnum] Hash code
80
- def hash
81
- [].hash
82
- end
83
-
84
- # Builds the object from hash
85
- # @param [Hash] attributes Model attributes in the form of hash
86
- # @return [Object] Returns the model itself
87
- def build_from_hash(attributes)
88
- return nil unless attributes.is_a?(Hash)
89
- self.class.swagger_types.each_pair do |key, type|
90
- if type =~ /^Array<(.*)>/i
91
- # check to ensure the input is an array given that the the attribute
92
- # is documented as an array but the input is not
93
- if attributes[self.class.attribute_map[key]].is_a?(Array)
94
- self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
95
- end
96
- elsif !attributes[self.class.attribute_map[key]].nil?
97
- self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
98
- end # or else data not found in attributes(hash), not an issue as the data can be optional
99
- end
100
-
101
- self
102
- end
103
-
104
- # Deserializes the data based on type
105
- # @param string type Data type
106
- # @param string value Value to be deserialized
107
- # @return [Object] Deserialized data
108
- def _deserialize(type, value)
109
- case type.to_sym
110
- when :DateTime
111
- DateTime.parse(value)
112
- when :Date
113
- Date.parse(value)
114
- when :String
115
- value.to_s
116
- when :Integer
117
- value.to_i
118
- when :Float
119
- value.to_f
120
- when :BOOLEAN
121
- if value.to_s =~ /^(true|t|yes|y|1)$/i
122
- true
123
- else
124
- false
125
- end
126
- when :Object
127
- # generic object (usually a Hash), return directly
128
- value
129
- when /\AArray<(?<inner_type>.+)>\z/
130
- inner_type = Regexp.last_match[:inner_type]
131
- value.map { |v| _deserialize(inner_type, v) }
132
- when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
133
- k_type = Regexp.last_match[:k_type]
134
- v_type = Regexp.last_match[:v_type]
135
- {}.tap do |hash|
136
- value.each do |k, v|
137
- hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
138
- end
139
- end
140
- else # model
141
- temp_model = ArtikCloud.const_get(type).new
142
- temp_model.build_from_hash(value)
143
- end
144
- end
145
-
146
- # Returns the string representation of the object
147
- # @return [String] String presentation of the object
148
- def to_s
149
- to_hash.to_s
150
- end
151
-
152
- # to_body is an alias to to_hash (backward compatibility)
153
- # @return [Hash] Returns the object in the form of hash
154
- def to_body
155
- to_hash
156
- end
157
-
158
- # Returns the object in the form of hash
159
- # @return [Hash] Returns the object in the form of hash
160
- def to_hash
161
- hash = {}
162
- self.class.attribute_map.each_pair do |attr, param|
163
- value = self.send(attr)
164
- next if value.nil?
165
- hash[param] = _to_hash(value)
166
- end
167
- hash
168
- end
169
-
170
- # Outputs non-array value in the form of hash
171
- # For object, use to_hash. Otherwise, just return the value
172
- # @param [Object] value Any valid value
173
- # @return [Hash] Returns the value in the form of hash
174
- def _to_hash(value)
175
- if value.is_a?(Array)
176
- value.compact.map{ |v| _to_hash(v) }
177
- elsif value.is_a?(Hash)
178
- {}.tap do |hash|
179
- value.each { |k, v| hash[k] = _to_hash(v) }
180
- end
181
- elsif value.respond_to? :to_hash
182
- value.to_hash
183
- else
184
- value
185
- end
186
- end
187
-
188
- end
189
-
190
- end